调整项目人数按流水证件号统计
This commit is contained in:
@@ -117,37 +117,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
</resultMap>
|
||||
|
||||
<select id="countMatchedStaffCountByProjectId" resultType="java.lang.Integer">
|
||||
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 count(distinct trim(bs.cret_no))
|
||||
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) != ''
|
||||
</select>
|
||||
|
||||
<sql id="parsedTrxDateExpr">
|
||||
|
||||
Reference in New Issue
Block a user