|
@@ -140,11 +140,12 @@
|
|
left join biz_task_type t4 on t4.id = t1.task_type_id
|
|
left join biz_task_type t4 on t4.id = t1.task_type_id
|
|
LEFT JOIN biz_work_order t5 on t5.id = t1.work_order_id
|
|
LEFT JOIN biz_work_order t5 on t5.id = t1.work_order_id
|
|
LEFT JOIN biz_tenant t7 on t1.from_tenant_id =t7.id
|
|
LEFT JOIN biz_tenant t7 on t1.from_tenant_id =t7.id
|
|
|
|
+ -- AND t5.no_contract = 0
|
|
|
|
+ -- AND t5.is_stop = 0
|
|
|
|
+
|
|
<where>
|
|
<where>
|
|
t1.deleted = 0 and t5.id is not null
|
|
t1.deleted = 0 and t5.id is not null
|
|
AND t5.type = 1
|
|
AND t5.type = 1
|
|
- AND t5.no_contract = 0
|
|
|
|
- AND t5.is_stop = 0
|
|
|
|
AND t5.start_month != 0
|
|
AND t5.start_month != 0
|
|
and t5.deleted = 0
|
|
and t5.deleted = 0
|
|
<if test="fromTenantId != null and fromTenantId != ''">
|
|
<if test="fromTenantId != null and fromTenantId != ''">
|
|
@@ -170,14 +171,14 @@
|
|
<if test="toAccountName != null and toAccountName!=''">
|
|
<if test="toAccountName != null and toAccountName!=''">
|
|
AND t2.account_name like concat( '%', #{toAccountName}, '%' )
|
|
AND t2.account_name like concat( '%', #{toAccountName}, '%' )
|
|
</if>
|
|
</if>
|
|
- <if test="currentMonth != null">AND t5.start_month != 0 AND DATE_FORMAT(#{currentMonth}, '%Y-%m-%d') >=
|
|
|
|
- (case when t5.task_type_id
|
|
|
|
- = 1 then DATE_ADD(t5.start_month,interval 1 month) else t5.start_month end) and
|
|
|
|
- DATE_FORMAT(#{currentMonth}, '%Y-%m-%d') <=
|
|
|
|
- (case when t5.is_continue=1 then #{currentMonth} when t5.end_month = 0 then DATE_FORMAT(#{currentMonth},
|
|
|
|
- '%Y-%m-%d') when t5.task_type_id = 1 then
|
|
|
|
- DATE_ADD(t5.end_month,interval 1 month) else t5.end_month end)
|
|
|
|
- </if>
|
|
|
|
|
|
+<!-- <if test="currentMonth != null">AND t5.start_month != 0 AND DATE_FORMAT(#{currentMonth}, '%Y-%m-%d') >=-->
|
|
|
|
+<!-- (case when t5.task_type_id-->
|
|
|
|
+<!-- = 1 then DATE_ADD(t5.start_month,interval 1 month) else t5.start_month end) and-->
|
|
|
|
+<!-- DATE_FORMAT(#{currentMonth}, '%Y-%m-%d') <=-->
|
|
|
|
+<!-- (case when t5.is_continue=1 then #{currentMonth} when t5.end_month = 0 then DATE_FORMAT(#{currentMonth},-->
|
|
|
|
+<!-- '%Y-%m-%d') when t5.task_type_id = 1 then-->
|
|
|
|
+<!-- DATE_ADD(t5.end_month,interval 1 month) else t5.end_month end)-->
|
|
|
|
+<!-- </if>-->
|
|
</where>
|
|
</where>
|
|
ORDER BY
|
|
ORDER BY
|
|
t1.work_month DESC
|
|
t1.work_month DESC
|