| | |
| | | from ja_fw_area_divide ad |
| | | left join ja_fw_police_station ps on ps.id = ad.police_station_id and ps.is_deleted = 0 |
| | | <where> |
| | | ad.is_deleted = 0 |
| | | ad.is_deleted = 0 |
| | | <if test="deptList != null and deptList.size > 0"> |
| | | and ad.create_dept in |
| | | <foreach collection="deptList" item="deptId" open="(" separator="," close=")"> |
| | | #{deptId} |
| | | </foreach> |
| | | </if> |
| | | <if test="isSetSceneManage != null and isSetSceneManage == 1"> |
| | | and exists ( |
| | | select 1 |
| | |
| | | from ja_fw_effect_eval ee |
| | | join ja_fw_device d on d.id = ee.device_id and d.is_deleted = 0 |
| | | where ee.is_deleted = 0 |
| | | and ee.counter_effect = 'success' |
| | | and ee.counter_effect = '1' |
| | | and find_in_set(d.id, replace(ad.device_ids, ' ', '')) |
| | | ) |
| | | end as counter_success_count |
| | |
| | | FROM ja_fw_area_divide ${ew.customSqlSegment} |
| | | </select> |
| | | |
| | | <select id="selectFwAreaDivideListCockpit" resultType="org.sxkj.fw.area.vo.FwAreaDivideVO"> |
| | | select |
| | | ad.*, |
| | | ps.station_name as police_station_name, |
| | | ps.contact_person as police_station_contact_person, |
| | | ps.contact_phone as police_station_contact_phone |
| | | from ja_fw_area_divide ad |
| | | left join ja_fw_police_station ps on ps.id = ad.police_station_id and ps.is_deleted = 0 |
| | | inner join ( |
| | | SELECT |
| | | d.id |
| | | FROM |
| | | ja_fw_device d |
| | | WHERE |
| | | d.is_deleted = 0 |
| | | AND d.is_enabled = 1 |
| | | AND d.final_outbound_area IS NOT NULL |
| | | <if test="regionCode != null and regionCode != ''"> |
| | | and ( d.final_outbound_area_code like concat(#{regionCode},'%') |
| | | <if test="currentDeptId != null and currentDeptId != '' "> |
| | | or d.id in ( |
| | | SELECT device_id FROM ja_fw_device_per_share |
| | | WHERE loan_to_dept_id = #{currentDeptId} |
| | | AND is_deleted = 0 |
| | | ) |
| | | </if> |
| | | ) |
| | | </if> |
| | | GROUP BY |
| | | d.id |
| | | ) dd on find_in_set(dd.id, ad.device_ids) |
| | | </select> |
| | | |
| | | <select id="checkAreaBindScene" resultType="java.lang.Boolean"> |
| | | select |
| | | count(1) |
| | | from ja_fw_defense_scene_manage dsm |
| | | left join ja_fw_defense_scene ds on ds.id = dsm.defense_scene_id and ds.is_deleted = 0 |
| | | where ds.is_deleted = 0 |
| | | and find_in_set(#{areaId}, ds.area_divide_ids) |
| | | and dsm.is_deleted = 0 |
| | | </select> |
| | | |
| | | <insert id="insertWithGeom" parameterType="org.sxkj.fw.area.entity.FwAreaDivideEntity" useGeneratedKeys="true" keyProperty="id"> |
| | | insert into ja_fw_area_divide ( |
| | | id, |