修复风险总览无风险人员负数问题

This commit is contained in:
wkc
2026-05-26 16:55:53 +08:00
parent aaec746181
commit d2cdb0f3c9
8 changed files with 167 additions and 10 deletions

View File

@@ -117,12 +117,37 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap>
<select id="countMatchedStaffCountByProjectId" resultType="java.lang.Integer">
select count(distinct trim(bs.cret_no))
from ccdi_bank_statement bs
inner join ccdi_base_staff staff on staff.id_card = bs.cret_no
where bs.project_id = #{projectId}
and bs.cret_no is not null
and trim(bs.cret_no) != ''
select count(distinct scope_staff.id_card)
from (
select staff.id_card
from ccdi_bank_statement bs
inner join ccdi_base_staff staff on staff.id_card = trim(bs.cret_no)
where bs.project_id = #{projectId}
and bs.cret_no is not null
and trim(bs.cret_no) != ''
union
select family_staff.id_card
from ccdi_bank_statement bs
inner join ccdi_staff_fmy_relation relation
on relation.relation_cert_no = trim(bs.cret_no)
and relation.status = 1
inner join ccdi_base_staff family_staff
on family_staff.id_card = relation.person_id
where bs.project_id = #{projectId}
and bs.cret_no is not null
and trim(bs.cret_no) != ''
union
select account_staff.id_card
from ccdi_bank_statement bs
inner join ccdi_account_info account
on trim(account.account_no) = trim(bs.LE_ACCOUNT_NO)
and account.owner_type = 'EMPLOYEE'
inner join ccdi_base_staff account_staff
on account_staff.id_card = account.owner_id
where bs.project_id = #{projectId}
and bs.LE_ACCOUNT_NO is not null
and trim(bs.LE_ACCOUNT_NO) != ''
) scope_staff
</select>
<sql id="parsedTrxDateExpr">

View File

@@ -70,7 +70,8 @@
<update id="updateRiskCountsByProjectId">
update ccdi_project
set high_risk_count = #{highRiskCount},
set target_count = #{targetCount},
high_risk_count = #{highRiskCount},
medium_risk_count = #{mediumRiskCount},
low_risk_count = #{lowRiskCount},
update_by = #{updateBy},