<iftest="agencyId != null and agencyId.trim() != ''">
<iftest="agencyId != null and agencyId.trim() != ''">
AND (AGENCY_ID = #{agencyId} or CONCAT(':',AGENCY_PIDS, ':') like CONCAT('%:',#{agencyId},':%'))
AND (AGENCY_ID = #{agencyId} or CONCAT(':',AGENCY_PIDS, ':') like CONCAT('%:',#{agencyId},':%'))
</if>
</if>
and CUSTOMER_ID = #{customerId}
</select>
</select>
<selectid="userWarnList"resultType="map">
<selectid="userWarnList"resultType="map">
@ -46,10 +47,12 @@
</if>
</if>
<iftest="tableName!='ic_resi_user'">
<iftest="tableName!='ic_resi_user'">
and ID in (
and ID in (
select IC_RESI_USER from ${tableName} where ${columnName} = '1' and DEL_FLAG = '0'
select IC_RESI_USER from ${tableName} where ${columnName} = '1' and CUSTOMER_ID = #{customerId} and DEL_FLAG = '0'
)
)
</if>
</if>
and CUSTOMER_ID = #{customerId}
and DEL_FLAG = '0'
and DEL_FLAG = '0'
group by BUILD_ID
group by BUILD_ID
</select>
</select>
@ -63,7 +66,7 @@
</if>
</if>
<iftest="tableName!='ic_resi_user'">
<iftest="tableName!='ic_resi_user'">
and ID in (
and ID in (
select IC_RESI_USER from ${tableName} where ${columnName} = '1' and DEL_FLAG = '0'
select IC_RESI_USER from ${tableName} where ${columnName} = '1' and CUSTOMER_ID = #{customerId} and DEL_FLAG = '0'
)
)
</if>
</if>
<iftest="level=='agency'">
<iftest="level=='agency'">
@ -78,6 +81,7 @@
<iftest="level=='building'">
<iftest="level=='building'">
AND BUILD_ID = #{id}
AND BUILD_ID = #{id}
</if>
</if>
and CUSTOMER_ID = #{customerId}
and DEL_FLAG = '0'
and DEL_FLAG = '0'
</select>
</select>
@ -97,9 +101,10 @@
</if>
</if>
<iftest="tableName!='ic_resi_user'">
<iftest="tableName!='ic_resi_user'">
and ID in (
and ID in (
select IC_RESI_USER from ${tableName} where ${columnName} = '1' and DEL_FLAG = '0'
select IC_RESI_USER from ${tableName} where ${columnName} = '1' and CUSTOMER_ID = #{customerId} and DEL_FLAG = '0'
)
)
</if>
</if>
and CUSTOMER_ID = #{customerId}
and DEL_FLAG = '0'
and DEL_FLAG = '0'
group by AGENCY_ID,GRID_ID,VILLAGE_ID,BUILD_ID
group by AGENCY_ID,GRID_ID,VILLAGE_ID,BUILD_ID
</select>
</select>
@ -118,9 +123,10 @@
</if>
</if>
<iftest="tableName!='ic_resi_user'">
<iftest="tableName!='ic_resi_user'">
and ID in (
and ID in (
select IC_RESI_USER from ${tableName} where ${columnName} = '1' and DEL_FLAG = '0'
select IC_RESI_USER from ${tableName} where ${columnName} = '1' and CUSTOMER_ID = #{customerId} and DEL_FLAG = '0'
)
)
</if>
</if>
and CUSTOMER_ID = #{customerId}
and DEL_FLAG = '0'
and DEL_FLAG = '0'
and AGENCY_ID = #{icStatsResiWarn.agencyId} and GRID_ID =#{icStatsResiWarn.gridId} and VILLAGE_ID=#{icStatsResiWarn.neighborHoodId} and BUILD_ID=#{icStatsResiWarn.buildingId}
and AGENCY_ID = #{icStatsResiWarn.agencyId} and GRID_ID =#{icStatsResiWarn.gridId} and VILLAGE_ID=#{icStatsResiWarn.neighborHoodId} and BUILD_ID=#{icStatsResiWarn.buildingId}