对比信息

This commit is contained in:
gy b
2023-11-29 22:41:27 +08:00
parent 8816a64040
commit 7f26242ea8
2 changed files with 33 additions and 7 deletions
@@ -782,7 +782,8 @@
FROM
case_application c
JOIN case_affiliate ca ON ca.case_appli_id = c.id AND ca.identity_type = 1
JOIN case_application_log l on l.case_appli_id=c.id and l.update_submit_status not in(1,2) and l.version
JOIN case_application_log l on l.case_appli_id=c.id and l.update_submit_status not in(1, 2) and
l.version
= (
SELECT
max( version ) version
@@ -791,7 +792,9 @@
WHERE case_appli_id = c.id
)
WHERE
ca.identity_type=1 and c.case_status in (1,5,8,9,14,15,16,17,31)
ca.identity_type=1
and c.case_status in (1,5,8,9,14,15,16,17,31)
<!-- <if test="deptIds != null and deptIds.size() > 0">
and ca.application_organ_id in
<foreach item="item" collection="deptIds" open="(" separator="," close=")">
@@ -805,8 +808,24 @@
<if test="nameId != null and nameId != ''">
AND ca.application_organ_id=#{nameId} AND ca.identity_type=1
</if>
union
select c.id ,
c.case_status,ca.application_organ_id,
c.arbitrator_id,ca.identity_num , ca.identity_type
FROM
case_application c
JOIN case_application_log l ON c.id = l.case_appli_id
JOIN case_affiliate_log ca ON ca.case_appli_log_id = l.id
AND ca.identity_type = 1
WHERE
l.update_submit_status IN ( 1, 2 ) and ca.identity_type=1
AND l.version = (
SELECT
max( version ) version
FROM
case_application_log
WHERE
c.id = case_appli_id)
</if>
</trim>