|
@@ -1592,30 +1592,10 @@
|
|
|
t.company_id = #{companyId}
|
|
|
AND te.first_auditor_id IS NOT NULL
|
|
|
AND te.second_auditor_id IS NOT NULL
|
|
|
- AND te.audit_status IN (3, 4)
|
|
|
-
|
|
|
+ AND t.task_status IN (3, 4)
|
|
|
<if test="startDate != null and endDate != null">
|
|
|
- AND (
|
|
|
-
|
|
|
- ((t.start_date IS NULL OR t.start_date <= #{endDate}) AND (t.end_date >= #{startDate}))
|
|
|
- OR
|
|
|
-
|
|
|
- ((t.end_date IS NULL OR t.end_date >= #{startDate}) AND (t.start_date <= #{endDate}))
|
|
|
- OR
|
|
|
-
|
|
|
- (t.start_date >= #{startDate} AND t.end_date <= #{endDate})
|
|
|
- OR
|
|
|
-
|
|
|
- (t.start_date <= #{startDate} AND t.end_date >= #{endDate})
|
|
|
- )
|
|
|
- </if>
|
|
|
- <if test="startDate != null and endDate == null">
|
|
|
- AND (t.end_date IS NOT NULL AND t.end_date >= #{startDate})
|
|
|
+ and t.start_date < #{endDate} AND t.end_date > #{startDate}
|
|
|
</if>
|
|
|
- <if test="startDate == null and endDate != null">
|
|
|
- AND (t.start_date IS NOT NULL AND t.start_date <= #{endDate})
|
|
|
- </if>
|
|
|
-
|
|
|
GROUP BY
|
|
|
t.id
|
|
|
) b ON (u.id = b.first_auditor_id AND b.audit_status = 3)
|
|
@@ -1654,27 +1634,9 @@
|
|
|
t.company_id = #{companyId}
|
|
|
AND te.first_auditor_id IS NOT NULL
|
|
|
AND te.second_auditor_id IS NOT NULL
|
|
|
- AND te.audit_status IN (3, 4)
|
|
|
+ AND t.task_status IN (3, 4)
|
|
|
<if test="startDate != null and endDate != null">
|
|
|
- AND (
|
|
|
-
|
|
|
- ((t.start_date IS NULL OR t.start_date <= #{endDate}) AND (t.end_date >= #{startDate}))
|
|
|
- OR
|
|
|
-
|
|
|
- ((t.end_date IS NULL OR t.end_date >= #{startDate}) AND (t.start_date <= #{endDate}))
|
|
|
- OR
|
|
|
-
|
|
|
- (t.start_date >= #{startDate} AND t.end_date <= #{endDate})
|
|
|
- OR
|
|
|
-
|
|
|
- (t.start_date <= #{startDate} AND t.end_date >= #{endDate})
|
|
|
- )
|
|
|
- </if>
|
|
|
- <if test="startDate != null and endDate == null">
|
|
|
- AND (t.end_date IS NOT NULL AND t.end_date >= #{startDate})
|
|
|
- </if>
|
|
|
- <if test="startDate == null and endDate != null">
|
|
|
- AND (t.start_date IS NOT NULL AND t.start_date <= #{endDate})
|
|
|
+ and t.start_date < #{endDate} AND t.end_date > #{startDate}
|
|
|
</if>
|
|
|
) b ON (u.id = b.first_auditor_id AND b.audit_status = 3)
|
|
|
OR (u.id = b.second_auditor_id AND b.audit_status = 4)
|