|
@@ -41,7 +41,7 @@
|
|
|
<if test="startMonth != null ">AND t1.end_month >= #{startMonth}</if>
|
|
|
<if test="monthNum != null ">AND t1.month_num = #{monthNum}</if>
|
|
|
<if test="isStop != null ">AND t1.is_stop = #{isStop}</if>
|
|
|
- <if test="currentMonth != null"> AND t1.start_month != 0 AND #{currentMonth} >= (case when t1.task_type_id = 1 then DATE_ADD(t1.start_month,interval 1 month) else t1.start_month end) and #{currentMonth} <= (case when t1.end_month = 0 then #{currentMonth} when t1.task_type_id = 1 then DATE_ADD(t1.end_month,interval 1 month) else t1.end_month end)</if>
|
|
|
+ <if test="currentMonth != null"> AND t1.start_month != 0 AND DATE_FORMAT(#{currentMonth}, '%Y-%m-%d') >= (case when t1.task_type_id = 1 then DATE_ADD(t1.start_month,interval 1 month) else t1.start_month end) and DATE_FORMAT(#{currentMonth}, '%Y-%m-%d') <= (case when t1.end_month = 0 then DATE_FORMAT(#{currentMonth}, '%Y-%m-%d') when t1.task_type_id = 1 then DATE_ADD(t1.end_month,interval 1 month) else t1.end_month end)</if>
|
|
|
<if test="toTenantId != null and currentMonth != null">
|
|
|
AND exists (select 1 from biz_entrust t6 where t6.deleted = 0 and t6.to_tenant_id = #{toTenantId} and t6.work_month = #{currentMonth} and t1.id = t6.work_order_id )
|
|
|
</if>
|
|
@@ -84,7 +84,7 @@
|
|
|
<if test="endMonth != null ">AND t1.end_month = #{endMonth}</if>
|
|
|
<if test="monthNum != null ">AND t1.month_num = #{monthNum}</if>
|
|
|
<if test="isStop != null ">AND t1.is_stop = #{isStop}</if>
|
|
|
- <if test="currentMonth != null"> AND t1.start_month != 0 AND #{currentMonth} >= (case when t1.task_type_id = 1 then DATE_ADD(t1.start_month,interval 1 month) else t1.start_month end) and #{currentMonth} <= (case when t1.end_month = 0 then #{currentMonth} when t1.task_type_id = 1 then DATE_ADD(t1.end_month,interval 1 month) else t1.end_month end)</if>
|
|
|
+ <if test="currentMonth != null"> AND t1.start_month != 0 AND DATE_FORMAT(#{currentMonth}, '%Y-%m-%d') >= (case when t1.task_type_id = 1 then DATE_ADD(t1.start_month,interval 1 month) else t1.start_month end) and DATE_FORMAT(#{currentMonth}, '%Y-%m-%d') <= (case when t1.end_month = 0 then DATE_FORMAT(#{currentMonth}, '%Y-%m-%d') when t1.task_type_id = 1 then DATE_ADD(t1.end_month,interval 1 month) else t1.end_month end)</if>
|
|
|
<if test="toTenantId != null and currentMonth != null">
|
|
|
AND exists (select 1 from biz_entrust t6 where t6.deleted = 0 and t6.to_tenant_id = #{toTenantId} and t6.work_month = #{currentMonth} and t1.id = t6.work_order_id )
|
|
|
</if>
|