|
@@ -120,24 +120,24 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test='maps.qecETime != null '>
|
|
<if test='maps.qecETime != null '>
|
|
|
and DATE(qec.create_time) <= DATE(#{maps.qecETime})
|
|
and DATE(qec.create_time) <= DATE(#{maps.qecETime})
|
|
|
</if>
|
|
</if>
|
|
|
- <!-- 主表时间条件 -->
|
|
|
|
|
- <if test='maps.sTime != null '>
|
|
|
|
|
- and DATE(l.create_time) >= DATE(#{maps.sTime})
|
|
|
|
|
|
|
+ <!-- 主表按日期范围查询(纯 SQL 层实现 +1 天),避免对字段用函数 -->
|
|
|
|
|
+ <if test='maps.sTime != null'>
|
|
|
|
|
+ AND l.create_time >= DATE(#{maps.sTime})
|
|
|
</if>
|
|
</if>
|
|
|
- <if test='maps.eTime != null '>
|
|
|
|
|
- and DATE(l.create_time) <= DATE(#{maps.eTime})
|
|
|
|
|
|
|
+ <if test='maps.eTime != null'>
|
|
|
|
|
+ AND l.create_time < DATE_ADD(DATE(#{maps.eTime}), INTERVAL 1 DAY)
|
|
|
</if>
|
|
</if>
|
|
|
<if test='maps.scheduleStartTime != null '>
|
|
<if test='maps.scheduleStartTime != null '>
|
|
|
- and DATE(l.camp_period_time) >= DATE(#{maps.scheduleStartTime})
|
|
|
|
|
|
|
+ and l.camp_period_time >= DATE(#{maps.scheduleStartTime})
|
|
|
</if>
|
|
</if>
|
|
|
<if test='maps.scheduleEndTime != null '>
|
|
<if test='maps.scheduleEndTime != null '>
|
|
|
- and DATE(l.camp_period_time) <= DATE(#{maps.scheduleEndTime})
|
|
|
|
|
|
|
+ and l.camp_period_time < DATE_ADD(DATE(#{maps.scheduleEndTime}), INTERVAL 1 DAY)
|
|
|
</if>
|
|
</if>
|
|
|
<if test='maps.upSTime != null '>
|
|
<if test='maps.upSTime != null '>
|
|
|
- and DATE(l.update_time) >= DATE(#{maps.upSTime})
|
|
|
|
|
|
|
+ and l.update_time >= DATE(#{maps.upSTime})
|
|
|
</if>
|
|
</if>
|
|
|
<if test='maps.upETime != null '>
|
|
<if test='maps.upETime != null '>
|
|
|
- and DATE(l.update_time) <= DATE(#{maps.upETime})
|
|
|
|
|
|
|
+ and l.update_time < DATE_ADD(DATE(#{maps.upETime}), INTERVAL 1 DAY)
|
|
|
</if>
|
|
</if>
|
|
|
<!-- SOP相关条件 -->
|
|
<!-- SOP相关条件 -->
|
|
|
<if test="maps.sopIds != null and maps.sopIds.size() > 0">
|
|
<if test="maps.sopIds != null and maps.sopIds.size() > 0">
|
|
@@ -218,23 +218,23 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test='maps.qecETime != null '>
|
|
<if test='maps.qecETime != null '>
|
|
|
and DATE(qec.create_time) <= DATE(#{maps.qecETime})
|
|
and DATE(qec.create_time) <= DATE(#{maps.qecETime})
|
|
|
</if>
|
|
</if>
|
|
|
- <if test= 'maps.sTime != null '>
|
|
|
|
|
- and DATE(l.create_time) >= DATE(#{maps.sTime})
|
|
|
|
|
|
|
+ <if test='maps.sTime != null'>
|
|
|
|
|
+ AND l.create_time >= DATE(#{maps.sTime})
|
|
|
</if>
|
|
</if>
|
|
|
- <if test='maps.eTime != null '>
|
|
|
|
|
- and DATE(l.create_time) <= DATE(#{maps.eTime})
|
|
|
|
|
|
|
+ <if test='maps.eTime != null'>
|
|
|
|
|
+ AND l.create_time < DATE_ADD(DATE(#{maps.eTime}), INTERVAL 1 DAY)
|
|
|
</if>
|
|
</if>
|
|
|
- <if test= 'maps.scheduleStartTime != null '>
|
|
|
|
|
- and DATE(l.camp_period_time) >= DATE(#{maps.scheduleStartTime})
|
|
|
|
|
|
|
+ <if test='maps.scheduleStartTime != null '>
|
|
|
|
|
+ and l.camp_period_time >= DATE(#{maps.scheduleStartTime})
|
|
|
</if>
|
|
</if>
|
|
|
<if test='maps.scheduleEndTime != null '>
|
|
<if test='maps.scheduleEndTime != null '>
|
|
|
- and DATE(l.camp_period_time) <= DATE(#{maps.scheduleEndTime})
|
|
|
|
|
|
|
+ and l.camp_period_time < DATE_ADD(DATE(#{maps.scheduleEndTime}), INTERVAL 1 DAY)
|
|
|
</if>
|
|
</if>
|
|
|
- <if test= 'maps.upSTime != null '>
|
|
|
|
|
- and DATE(l.update_time) >= DATE(#{maps.upSTime})
|
|
|
|
|
|
|
+ <if test='maps.upSTime != null '>
|
|
|
|
|
+ and l.update_time >= DATE(#{maps.upSTime})
|
|
|
</if>
|
|
</if>
|
|
|
<if test='maps.upETime != null '>
|
|
<if test='maps.upETime != null '>
|
|
|
- and DATE(l.update_time) <= DATE(#{maps.upETime})
|
|
|
|
|
|
|
+ and l.update_time < DATE_ADD(DATE(#{maps.upETime}), INTERVAL 1 DAY)
|
|
|
</if>
|
|
</if>
|
|
|
<if test="maps.sopIds != null and maps.sopIds.size() > 0">
|
|
<if test="maps.sopIds != null and maps.sopIds.size() > 0">
|
|
|
and l.sop_id in
|
|
and l.sop_id in
|
|
@@ -292,17 +292,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test ='nickName !=null and maps.nickName!=""'>
|
|
<if test ='nickName !=null and maps.nickName!=""'>
|
|
|
and u.nick_name like concat('%', #{nickName}, '%')
|
|
and u.nick_name like concat('%', #{nickName}, '%')
|
|
|
</if>
|
|
</if>
|
|
|
- <if test= 'sTime != null '>
|
|
|
|
|
- and DATE(l.create_time) >= DATE(#{sTime})
|
|
|
|
|
|
|
+ <if test='maps.sTime != null'>
|
|
|
|
|
+ AND l.create_time >= DATE(#{maps.sTime})
|
|
|
</if>
|
|
</if>
|
|
|
- <if test='eTime != null '>
|
|
|
|
|
- and DATE(l.create_time) <= DATE(#{eTime})
|
|
|
|
|
|
|
+ <if test='maps.eTime != null'>
|
|
|
|
|
+ AND l.create_time < DATE_ADD(DATE(#{maps.eTime}), INTERVAL 1 DAY)
|
|
|
</if>
|
|
</if>
|
|
|
- <if test= 'maps.scheduleStartTime != null '>
|
|
|
|
|
- and DATE(l.camp_period_time) >= DATE(#{maps.scheduleStartTime})
|
|
|
|
|
|
|
+ <if test='maps.scheduleStartTime != null '>
|
|
|
|
|
+ and l.camp_period_time >= DATE(#{maps.scheduleStartTime})
|
|
|
</if>
|
|
</if>
|
|
|
<if test='maps.scheduleEndTime != null '>
|
|
<if test='maps.scheduleEndTime != null '>
|
|
|
- and DATE(l.camp_period_time) <= DATE(#{maps.scheduleEndTime})
|
|
|
|
|
|
|
+ and l.camp_period_time < DATE_ADD(DATE(#{maps.scheduleEndTime}), INTERVAL 1 DAY)
|
|
|
</if>
|
|
</if>
|
|
|
<if test="sopIds != null and sopIds.size() > 0">
|
|
<if test="sopIds != null and sopIds.size() > 0">
|
|
|
and l.sop_id in
|
|
and l.sop_id in
|
|
@@ -913,23 +913,23 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test='maps.qecETime != null '>
|
|
<if test='maps.qecETime != null '>
|
|
|
and DATE(qec.create_time) <= DATE(#{maps.qecETime})
|
|
and DATE(qec.create_time) <= DATE(#{maps.qecETime})
|
|
|
</if>
|
|
</if>
|
|
|
- <if test= 'maps.sTime != null '>
|
|
|
|
|
- and DATE(l.create_time) >= DATE(#{maps.sTime})
|
|
|
|
|
|
|
+ <if test='maps.sTime != null'>
|
|
|
|
|
+ AND l.create_time >= DATE(#{maps.sTime})
|
|
|
</if>
|
|
</if>
|
|
|
- <if test='maps.eTime != null '>
|
|
|
|
|
- and DATE(l.create_time) <= DATE(#{maps.eTime})
|
|
|
|
|
|
|
+ <if test='maps.eTime != null'>
|
|
|
|
|
+ AND l.create_time < DATE_ADD(DATE(#{maps.eTime}), INTERVAL 1 DAY)
|
|
|
</if>
|
|
</if>
|
|
|
- <if test= 'maps.scheduleStartTime != null '>
|
|
|
|
|
- and DATE(l.camp_period_time) >= DATE(#{maps.scheduleStartTime})
|
|
|
|
|
|
|
+ <if test='maps.scheduleStartTime != null '>
|
|
|
|
|
+ and l.camp_period_time >= DATE(#{maps.scheduleStartTime})
|
|
|
</if>
|
|
</if>
|
|
|
<if test='maps.scheduleEndTime != null '>
|
|
<if test='maps.scheduleEndTime != null '>
|
|
|
- and DATE(l.camp_period_time) <= DATE(#{maps.scheduleEndTime})
|
|
|
|
|
|
|
+ and l.camp_period_time < DATE_ADD(DATE(#{maps.scheduleEndTime}), INTERVAL 1 DAY)
|
|
|
</if>
|
|
</if>
|
|
|
- <if test= 'maps.upSTime != null '>
|
|
|
|
|
- and DATE(l.update_time) >= DATE(#{maps.upSTime})
|
|
|
|
|
|
|
+ <if test='maps.upSTime != null '>
|
|
|
|
|
+ and l.update_time >= DATE(#{maps.upSTime})
|
|
|
</if>
|
|
</if>
|
|
|
<if test='maps.upETime != null '>
|
|
<if test='maps.upETime != null '>
|
|
|
- and DATE(l.update_time) <= DATE(#{maps.upETime})
|
|
|
|
|
|
|
+ and l.update_time < DATE_ADD(DATE(#{maps.upETime}), INTERVAL 1 DAY)
|
|
|
</if>
|
|
</if>
|
|
|
<if test="maps.sopIds != null and maps.sopIds.size() > 0">
|
|
<if test="maps.sopIds != null and maps.sopIds.size() > 0">
|
|
|
and l.sop_id in
|
|
and l.sop_id in
|