diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/IcNatDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/IcNatDao.xml index 16d15f05a2..049a806b55 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/IcNatDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/IcNatDao.xml @@ -49,14 +49,19 @@ b.nat_address natAddress, b.test_tube_code testTubeCode 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} + + AND is_local_resi_user = #{isResiUser} + + ) a INNER JOIN ic_nat b ON a.IC_NAT_ID = b.ID WHERE - a.DEL_FLAG = '0' - AND b.DEL_FLAG = '0' - AND a.customer_id = #{customerId} - - AND a.AGENCY_ID = #{agencyId} + b.DEL_FLAG = '0' AND b.name like concat('%', #{name}, '%') @@ -78,9 +83,6 @@ AND b.sample_time #{sampleEndTime} - - AND a.is_local_resi_user = #{isResiUser} - ORDER BY b.nat_time DESC, b.id ASC @@ -176,17 +178,17 @@ - +