|
|
@@ -124,40 +124,42 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
LEFT JOIN act_hxpapply_detail hd ON hd.hxpapply_id = ah.id
|
|
|
LEFT JOIN act_applytask ak ON ak.`task_id` = ah.`id`
|
|
|
<where>
|
|
|
- ah.apply_status in(1,3)
|
|
|
- <if test="ids != null">
|
|
|
- and ah.id in
|
|
|
- <foreach item="id" collection="ids" open="(" separator="," close=")">
|
|
|
- #{id}
|
|
|
- </foreach>
|
|
|
- </if>
|
|
|
- <if test="searchValue != null ">
|
|
|
- and (
|
|
|
- ah.apply_num like concat('%', #{searchValue}, '%') or
|
|
|
- su.nick_name like concat('%', #{searchValue}, '%') or
|
|
|
- hd.chemical_name like concat('%', #{searchValue}, '%') or
|
|
|
- st.name like concat('%', #{searchValue}, '%')
|
|
|
- )
|
|
|
- </if>
|
|
|
- <if test="approvalStatus != null ">
|
|
|
- and ak.approval_status = #{approvalStatus}
|
|
|
- </if>
|
|
|
- <if test="beginCreateTime != null and beginCreateTime != ''"><!-- 申请开始时间 -->
|
|
|
- AND date_format(ak.create_time,'%y%m%d') >= date_format(#{beginCreateTime},'%y%m%d')
|
|
|
- </if>
|
|
|
- <if test="endCreateTime != null and endCreateTime != ''"><!-- 申请结束时间 -->
|
|
|
- AND date_format(ak.create_time,'%y%m%d') <= date_format(#{endCreateTime},'%y%m%d')
|
|
|
- </if>
|
|
|
+ ah.apply_status in(1,3)
|
|
|
+ <if test="ids != null">
|
|
|
+ and ah.id in
|
|
|
+ <foreach item="id" collection="ids" open="(" separator="," close=")">
|
|
|
+ #{id}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ <if test="searchValue != null ">
|
|
|
+ and (
|
|
|
+ ah.apply_num like concat('%', #{searchValue}, '%') or
|
|
|
+ su.nick_name like concat('%', #{searchValue}, '%') or
|
|
|
+ hd.chemical_name like concat('%', #{searchValue}, '%') or
|
|
|
+ st.name like concat('%', #{searchValue}, '%')
|
|
|
+ )
|
|
|
+ </if>
|
|
|
+ <if test="approvalStatus != null ">
|
|
|
+ and ak.approval_status = #{approvalStatus}
|
|
|
+ </if>
|
|
|
+ <if test="beginCreateTime != null and beginCreateTime != ''"><!-- 申请开始时间 -->
|
|
|
+ AND date_format(ak.create_time,'%y%m%d') >= date_format(#{beginCreateTime},'%y%m%d')
|
|
|
+ </if>
|
|
|
+ <if test="endCreateTime != null and endCreateTime != ''"><!-- 申请结束时间 -->
|
|
|
+ AND date_format(ak.create_time,'%y%m%d') <= date_format(#{endCreateTime},'%y%m%d')
|
|
|
+ </if>
|
|
|
|
|
|
- <if test="beginOverTime != null and beginOverTime != ''"><!-- 完成开始时间 -->
|
|
|
- AND date_format(ak.over_time,'%y%m%d') >= date_format(#{beginOverTime},'%y%m%d')
|
|
|
- </if>
|
|
|
- <if test="endOverTime != null and endOverTime != ''"><!-- 完成结束时间 -->
|
|
|
- AND date_format(ak.over_time,'%y%m%d') <= date_format(#{endOverTime},'%y%m%d')
|
|
|
- </if>
|
|
|
- <if test="userId != null and userId != ''"><!-- 创建人id -->
|
|
|
- and ah.user_id = #{userId}
|
|
|
- </if>
|
|
|
+ <if test="beginOverTime != null and beginOverTime != ''"><!-- 完成开始时间 -->
|
|
|
+ AND date_format(ak.over_time,'%y%m%d') >= date_format(#{beginOverTime},'%y%m%d')
|
|
|
+ </if>
|
|
|
+ <if test="endOverTime != null and endOverTime != ''"><!-- 完成结束时间 -->
|
|
|
+ AND date_format(ak.over_time,'%y%m%d') <= date_format(#{endOverTime},'%y%m%d')
|
|
|
+ </if>
|
|
|
+ <if test="userId != null and userId != ''"><!-- 创建人id -->
|
|
|
+ and ah.user_id = #{userId}
|
|
|
+ </if>
|
|
|
+ <!-- 数据范围过滤 -->
|
|
|
+ ${params.dataScope}
|
|
|
</where>
|
|
|
GROUP BY ah.`id`
|
|
|
)xx WHERE FIND_IN_SET(#{loginUserId},xx.currentApprover) ORDER BY xx.createTime DESC
|
|
|
@@ -233,6 +235,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="userId != null and userId != ''"><!-- 创建人id -->
|
|
|
and ah.user_id = #{userId}
|
|
|
</if>
|
|
|
+ <!-- 数据范围过滤 -->
|
|
|
+ ${params.dataScope}
|
|
|
</where>
|
|
|
GROUP BY ah.`id`
|
|
|
|