|
@ -66,10 +66,18 @@ |
|
|
LEFT JOIN ic_enterprise_patrol_record r ON ( ie.id = r.ENTERPRISE_ID AND r.DEL_FLAG = '0' ) |
|
|
LEFT JOIN ic_enterprise_patrol_record r ON ( ie.id = r.ENTERPRISE_ID AND r.DEL_FLAG = '0' ) |
|
|
WHERE |
|
|
WHERE |
|
|
ie.DEL_FLAG = '0' |
|
|
ie.DEL_FLAG = '0' |
|
|
AND ( |
|
|
<if test='"grid" == orgType'> |
|
|
ie.AGENCY_ID = #{staffAgencyId} |
|
|
AND ie.GRID_ID = #{orgId} |
|
|
OR ie.AGENCY_PIDS LIKE concat( '%', #{staffAgencyId}, '%' ) |
|
|
</if> |
|
|
) |
|
|
<if test='"agency" == orgType'> |
|
|
|
|
|
AND (ie.AGENCY_ID = #{orgId} or ie.AGENCY_PIDS like concat('%',#{orgId},'%')) |
|
|
|
|
|
</if> |
|
|
|
|
|
<if test='null==orgType or "" == orgType'> |
|
|
|
|
|
AND ( |
|
|
|
|
|
ie.AGENCY_ID = #{staffAgencyId} |
|
|
|
|
|
OR ie.AGENCY_PIDS LIKE concat( '%', #{staffAgencyId}, '%' ) |
|
|
|
|
|
) |
|
|
|
|
|
</if> |
|
|
<if test='null != gridId and "" != gridId'> |
|
|
<if test='null != gridId and "" != gridId'> |
|
|
AND ie.GRID_ID = #{gridId} |
|
|
AND ie.GRID_ID = #{gridId} |
|
|
</if> |
|
|
</if> |
|
|