|
@@ -145,6 +145,7 @@
|
|
|
AND t5.type = 1
|
|
|
AND t5.start_month != 0
|
|
|
and t5.deleted = 0
|
|
|
+ and t5.start_month < DATE_FORMAT(CURRENT_DATE (), '%Y-%m-01')
|
|
|
<if test="fromTenantId != null and fromTenantId != ''">
|
|
|
AND t1.from_tenant_id = #{fromTenantId}
|
|
|
</if>
|
|
@@ -155,9 +156,8 @@
|
|
|
|
|
|
AND t7.account_name like concat('%', #{fromCompanyName}, '%')
|
|
|
</if>
|
|
|
-
|
|
|
<if test="date == null">
|
|
|
- AND MONTH ( t1.work_month ) <MONTH(CURRENT_DATE ())
|
|
|
+ AND t1.work_month <DATE_FORMAT(CURRENT_DATE (), '%Y-%m-01')
|
|
|
</if>
|
|
|
<if test="companyName != null and companyName != ''">
|
|
|
AND t3.name like concat('%', #{companyName}, '%')
|
|
@@ -165,13 +165,8 @@
|
|
|
<if test="toAccountName != null and toAccountName!=''">
|
|
|
AND t2.account_name like concat( '%', #{toAccountName}, '%' )
|
|
|
</if>
|
|
|
- <if test="date != null">AND t5.start_month != 0 AND DATE_FORMAT(#{date}, '%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(#{date}, '%Y-%m-%d') <=
|
|
|
- (case when t5.is_continue=1 then #{date} when t5.end_month = 0 then DATE_FORMAT(#{date},
|
|
|
- '%Y-%m-%d') when t5.task_type_id = 1 then
|
|
|
- DATE_ADD(t5.end_month,interval 1 month) else t5.end_month end)
|
|
|
+ <if test="date != null">
|
|
|
+ and t1.work_month = #{date}
|
|
|
</if>
|
|
|
</where>
|
|
|
ORDER BY
|