|
@@ -145,7 +145,6 @@
|
|
|
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>
|
|
@@ -153,11 +152,14 @@
|
|
|
AND t1.to_tenant_id = #{toTenantId}
|
|
|
</if>
|
|
|
<if test="fromCompanyName != null and fromCompanyName != ''">
|
|
|
-
|
|
|
AND t7.account_name like concat('%', #{fromCompanyName}, '%')
|
|
|
</if>
|
|
|
<if test="date == null">
|
|
|
- AND t1.work_month <DATE_FORMAT(CURRENT_DATE (), '%Y-%m-01')
|
|
|
+ and t5.start_month < DATE_FORMAT(CURRENT_DATE (), '%Y-%m-01')
|
|
|
+ AND MONTH ( t1.work_month ) <MONTH(CURRENT_DATE ())
|
|
|
+ </if>
|
|
|
+ <if test="date != null">
|
|
|
+ AND t1.work_month = #{date}
|
|
|
</if>
|
|
|
<if test="companyName != null and companyName != ''">
|
|
|
AND t3.name like concat('%', #{companyName}, '%')
|
|
@@ -165,12 +167,9 @@
|
|
|
<if test="toAccountName != null and toAccountName!=''">
|
|
|
AND t2.account_name like concat( '%', #{toAccountName}, '%' )
|
|
|
</if>
|
|
|
- <if test="date != null">
|
|
|
- and t1.work_month = #{date}
|
|
|
- </if>
|
|
|
</where>
|
|
|
ORDER BY
|
|
|
- t1.work_month DESC
|
|
|
+ t5.start_month DESC
|
|
|
|
|
|
</select>
|
|
|
|