|
@ -49,14 +49,19 @@ |
|
|
b.nat_address natAddress, |
|
|
b.nat_address natAddress, |
|
|
b.test_tube_code testTubeCode |
|
|
b.test_tube_code testTubeCode |
|
|
FROM |
|
|
FROM |
|
|
ic_nat_relation a |
|
|
( |
|
|
|
|
|
select IC_NAT_ID, AGENCY_ID, USER_TYPE, IS_LOCAL_RESI_USER |
|
|
|
|
|
from ic_nat_relation |
|
|
|
|
|
WHERE AGENCY_ID = #{agencyId} |
|
|
|
|
|
and DEL_FLAG = '0' |
|
|
|
|
|
and customer_id = #{customerId} |
|
|
|
|
|
<if test='null != isResiUser and "" != isResiUser'> |
|
|
|
|
|
AND is_local_resi_user = #{isResiUser} |
|
|
|
|
|
</if> |
|
|
|
|
|
) a |
|
|
INNER JOIN ic_nat b ON a.IC_NAT_ID = b.ID |
|
|
INNER JOIN ic_nat b ON a.IC_NAT_ID = b.ID |
|
|
WHERE |
|
|
WHERE |
|
|
a.DEL_FLAG = '0' |
|
|
b.DEL_FLAG = '0' |
|
|
AND b.DEL_FLAG = '0' |
|
|
|
|
|
AND a.customer_id = #{customerId} |
|
|
|
|
|
<!-- AND a.pids like concat('%', #{agencyId}, '%')--> |
|
|
|
|
|
AND a.AGENCY_ID = #{agencyId} |
|
|
|
|
|
<if test='null != name and "" != name'> |
|
|
<if test='null != name and "" != name'> |
|
|
AND b.name like concat('%', #{name}, '%') |
|
|
AND b.name like concat('%', #{name}, '%') |
|
|
</if> |
|
|
</if> |
|
@ -78,9 +83,6 @@ |
|
|
<if test='null != sampleEndTime and "" != sampleEndTime'> |
|
|
<if test='null != sampleEndTime and "" != sampleEndTime'> |
|
|
AND b.sample_time <![CDATA[ <= ]]> #{sampleEndTime} |
|
|
AND b.sample_time <![CDATA[ <= ]]> #{sampleEndTime} |
|
|
</if> |
|
|
</if> |
|
|
<if test='null != isResiUser and "" != isResiUser'> |
|
|
|
|
|
AND a.is_local_resi_user = #{isResiUser} |
|
|
|
|
|
</if> |
|
|
|
|
|
ORDER BY b.nat_time DESC, b.id ASC |
|
|
ORDER BY b.nat_time DESC, b.id ASC |
|
|
</select> |
|
|
</select> |
|
|
|
|
|
|
|
@ -176,17 +178,17 @@ |
|
|
</foreach> |
|
|
</foreach> |
|
|
</select> |
|
|
</select> |
|
|
|
|
|
|
|
|
<!-- 获取关系和核酸检测 --> |
|
|
<!-- 获取关系和核酸检测,这两个表数据量可能会很大,所以用嵌套子查询先过滤出一部分来,再关联 --> |
|
|
<select id="getRelationAndNat" resultType="com.epmet.dto.result.RelationAndNatResultDTO"> |
|
|
<select id="getRelationAndNat" resultType="com.epmet.dto.result.RelationAndNatResultDTO"> |
|
|
SELECT |
|
|
SELECT r.ID AS relationId, |
|
|
r.ID AS relationId, |
|
|
i.ID AS natId, |
|
|
i.ID AS natId, |
|
|
i.ID_CARD, |
|
|
i.ID_CARD, |
|
|
r.PIDS AS staffAgencyIdPath |
|
|
r.PIDS AS staffAgencyIdPath |
|
|
FROM (SELECT ID, PIDS, IC_NAT_ID |
|
|
FROM ic_nat_relation r |
|
|
FROM ic_nat_relation |
|
|
INNER JOIN ic_nat i ON i.ID = r.IC_NAT_ID AND i.DEL_FLAG = 0 |
|
|
WHERE DEL_FLAG = 0 |
|
|
WHERE r.DEL_FLAG = 0 |
|
|
AND USER_TYPE IN ('import')) r |
|
|
AND r.USER_TYPE IN ('import') |
|
|
INNER JOIN ic_nat i ON i.ID = r.IC_NAT_ID AND i.DEL_FLAG = 0 |
|
|
</select> |
|
|
</select> |
|
|
<select id="getResiByIdCards" resultType="com.epmet.entity.IcResiUserEntity"> |
|
|
<select id="getResiByIdCards" resultType="com.epmet.entity.IcResiUserEntity"> |
|
|
SELECT * FROM ic_resi_user |
|
|
SELECT * FROM ic_resi_user |
|
|