<?xml version="1.0" encoding="UTF-8"?>
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
<mapper namespace="org.sxkj.fw.area.mapper.FwDefenseSceneMapper">
|
|
<!-- 通用查询映射结果 -->
|
<resultMap id="fwDefenseSceneResultMap" type="org.sxkj.fw.area.vo.FwDefenseSceneVO">
|
<result column="id" property="id"/>
|
<result column="scene_name" property="sceneName"/>
|
<result column="scene_type" property="sceneType"/>
|
<result column="longitude" property="longitude"/>
|
<result column="latitude" property="latitude"/>
|
<result column="defense_leader" property="defenseLeader"/>
|
<result column="leader_phone" property="leaderPhone"/>
|
<result column="defense_area" property="defenseArea"/>
|
<result column="device_mode" property="deviceMode"/>
|
<result column="area_divide_ids" property="areaDivideIds"/>
|
<result column="area_code" property="areaCode"/>
|
<result column="create_user" property="createUser"/>
|
<result column="create_dept" property="createDept"/>
|
<result column="create_time" property="createTime"/>
|
<result column="update_user" property="updateUser"/>
|
<result column="update_time" property="updateTime"/>
|
<result column="status" property="status"/>
|
<result column="is_deleted" property="isDeleted"/>
|
</resultMap>
|
|
|
<select id="selectFwDefenseScenePage" resultMap="fwDefenseSceneResultMap">
|
select * from ja_fw_defense_scene
|
<where>
|
is_deleted = 0
|
<if test="param2.id != null and param2.id != ''">
|
and id = #{param2.id}
|
</if>
|
<if test="param2.sceneName != null and param2.sceneName != ''">
|
and scene_name like concat('%', #{param2.sceneName}, '%')
|
</if>
|
<if test="param2.sceneType != null and param2.sceneType != ''">
|
and scene_type = #{param2.sceneType}
|
</if>
|
<if test="param2.longitude != null and param2.longitude != ''">
|
and longitude = #{param2.longitude}
|
</if>
|
<if test="param2.latitude != null and param2.latitude != ''">
|
and latitude = #{param2.latitude}
|
</if>
|
<if test="param2.defenseLeader != null and param2.defenseLeader != ''">
|
and defense_leader like concat('%', #{param2.defenseLeader}, '%')
|
</if>
|
<if test="param2.leaderPhone != null and param2.leaderPhone != ''">
|
and leader_phone = #{param2.leaderPhone}
|
</if>
|
<if test="param2.defenseArea != null and param2.defenseArea != ''">
|
and defense_area = #{param2.defenseArea}
|
</if>
|
<if test="param2.deviceMode != null and param2.deviceMode != ''">
|
and device_mode = #{param2.deviceMode}
|
</if>
|
<if test="param2.areaDivideIds != null and param2.areaDivideIds != ''">
|
and area_divide_ids = #{param2.areaDivideIds}
|
</if>
|
<if test="param2.areaCode != null and param2.areaCode != ''">
|
and area_code = #{param2.areaCode}
|
</if>
|
<if test="param2.createUser != null and param2.createUser != ''">
|
and create_user = #{param2.createUser}
|
</if>
|
<if test="param2.createDept != null and param2.createDept != ''">
|
and create_dept = #{param2.createDept}
|
</if>
|
<if test="param2.createTime != null and param2.createTime != ''">
|
and create_time = #{param2.createTime}
|
</if>
|
<if test="param2.updateUser != null and param2.updateUser != ''">
|
and update_user = #{param2.updateUser}
|
</if>
|
<if test="param2.updateTime != null and param2.updateTime != ''">
|
and update_time = #{param2.updateTime}
|
</if>
|
<if test="param2.status != null and param2.status != ''">
|
and status = #{param2.status}
|
</if>
|
</where>
|
</select>
|
|
<select id="selectFwDefenseSceneList" resultMap="fwDefenseSceneResultMap">
|
select ds.* from ja_fw_defense_scene ds
|
<where>
|
ds.is_deleted = 0
|
<if test="filterSelected != null and filterSelected == 1">
|
and (
|
not exists (
|
select 1
|
from ja_fw_defense_zone dz
|
where dz.is_deleted = 0
|
and dz.defense_scene_ids is not null
|
and dz.defense_scene_ids != ''
|
and find_in_set(ds.id, dz.defense_scene_ids)
|
)
|
<if test="zoneId != null">
|
or exists (
|
select 1
|
from ja_fw_defense_zone dz
|
where dz.is_deleted = 0
|
and dz.id = #{zoneId}
|
and dz.defense_scene_ids is not null
|
and dz.defense_scene_ids != ''
|
and find_in_set(ds.id, dz.defense_scene_ids)
|
)
|
</if>
|
)
|
</if>
|
<if test="areaId != null and (filterSelected == null or filterSelected != 1)">
|
and ds.area_divide_ids is not null
|
and ds.area_divide_ids != ''
|
and find_in_set(#{areaId}, replace(ds.area_divide_ids, ' ', ''))
|
</if>
|
</where>
|
</select>
|
|
|
<select id="exportFwDefenseScene" resultType="org.sxkj.fw.area.excel.FwDefenseSceneExcel">
|
SELECT * FROM ja_fw_defense_scene ${ew.customSqlSegment}
|
</select>
|
|
</mapper>
|