|
@@ -4,72 +4,108 @@
|
|
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
|
<mapper namespace="com.sooka.sponest.event.centereventteventtypemonitor.mapper.CentereventTEventtypeMonitorMapper">
|
|
|
|
|
|
+ <resultMap type="CentereventTEventtypeMonitor" id="CentereventTEventtypeMonitorResult">
|
|
|
+ <result property="id" column="id"/>
|
|
|
+ <result property="eventTypeName" column="event_type_name"/>
|
|
|
+ <result property="parentId" column="parent_id"/>
|
|
|
+ <result property="serialNumber" column="serial_number"/>
|
|
|
+ <result property="templateType" column="template_type"/>
|
|
|
+ <result property="typeXlId" column="type_xl_id"/>
|
|
|
+ <result property="typeDlId" column="type_dl_id"/>
|
|
|
+ <result property="typeDlName" column="type_dl_name"/>
|
|
|
+ <result property="lxnames" column="lxnames"/>
|
|
|
+ <result property="lxids" column="lxids"/>
|
|
|
+ </resultMap>
|
|
|
+
|
|
|
<sql id="selectCentereventTEventtypeMonitorVo">
|
|
|
select id, event_type_name, parent_id, serial_number, template_type, type_xl_id, type_dl_id, type_dl_name from centerevent_t_eventtype_monitor
|
|
|
</sql>
|
|
|
|
|
|
- <sql id="selectCentereventTEventtypeMonitorSql">
|
|
|
- select id, event_type_name, parent_id, serial_number, template_type, type_xl_id, type_dl_id, type_dl_name
|
|
|
- </sql>
|
|
|
-
|
|
|
- <resultMap type="CentereventTEventtypeMonitor" id="CentereventTEventtypeMonitorResult">
|
|
|
- <result property="id" column="id" />
|
|
|
- <result property="eventTypeName" column="event_type_name" />
|
|
|
- <result property="parentId" column="parent_id" />
|
|
|
- <result property="serialNumber" column="serial_number" />
|
|
|
- <result property="templateType" column="template_type" />
|
|
|
- <result property="typeXlId" column="type_xl_id" />
|
|
|
- <result property="typeDlId" column="type_dl_id" />
|
|
|
- <result property="typeDlName" column="type_dl_name" />
|
|
|
- <result property="lxnames" column="lxnames" />
|
|
|
- <result property="lxids" column="lxids" />
|
|
|
-
|
|
|
- </resultMap>
|
|
|
+ <select id="selectCentereventTEventtypeMonitorList" parameterType="CentereventTEventtypeMonitor"
|
|
|
+ resultMap="CentereventTEventtypeMonitorResult">
|
|
|
+ select id, event_type_name, parent_id, serial_number, template_type, type_xl_id, type_dl_id, type_dl_name,
|
|
|
+ etd.lxids, etd.lxnames from centerevent_t_eventtype_monitor et
|
|
|
+ left join (
|
|
|
+ select rr.parent_id parentId,GROUP_CONCAT(rr.type_xl_id) lxids,GROUP_CONCAT(rr.event_type_name) lxnames
|
|
|
+ from centerevent_t_eventtype_monitor rr
|
|
|
+ group by rr.parent_id) etd on etd.parentId = et.id
|
|
|
+ <where>
|
|
|
+ <if test="eventTypeName != null and eventTypeName != ''">and event_type_name like concat('%',
|
|
|
+ #{eventTypeName}, '%')
|
|
|
+ </if>
|
|
|
+ <if test="parentId != null ">and parent_id = #{parentId}</if>
|
|
|
+ <if test="serialNumber != null and serialNumber != ''">and serial_number = #{serialNumber}</if>
|
|
|
+ <if test="templateType != null and templateType != ''">and template_type = #{templateType}</if>
|
|
|
+ <if test="typeXlId != null ">and type_xl_id = #{typeXlId}</if>
|
|
|
+ <if test="typeDlId != null ">and type_dl_id = #{typeDlId}</if>
|
|
|
+ <if test="typeDlName != null and typeDlName != ''">and type_dl_name like concat('%', #{typeDlName}, '%')
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ </select>
|
|
|
|
|
|
- <select id="getCentereventTEventtypemonitorTree" parameterType="string" resultType="java.util.Map">
|
|
|
- SELECT id,event_type_name,parent_id,serial_number FROM centerevent_t_eventtype_monitor where template_type=#{templateType}
|
|
|
+ <select id="selectCentereventTEventtypeMonitorById" parameterType="Long"
|
|
|
+ resultMap="CentereventTEventtypeMonitorResult">
|
|
|
+ <include refid="selectCentereventTEventtypeMonitorVo"/>
|
|
|
+ where id = #{id}
|
|
|
</select>
|
|
|
|
|
|
- <insert id="insertCentereventTEventtypemonitor" parameterType="CentereventTEventtypeMonitor">
|
|
|
+ <insert id="insertCentereventTEventtypeMonitor" parameterType="CentereventTEventtypeMonitor">
|
|
|
insert into centerevent_t_eventtype_monitor
|
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
<if test="id != null">id,</if>
|
|
|
<if test="eventTypeName != null">event_type_name,</if>
|
|
|
<if test="parentId != null">parent_id,</if>
|
|
|
- <if test="code != null">code,</if>
|
|
|
- <if test="reminderTime != null">reminder_time,</if>
|
|
|
+ <if test="serialNumber != null">serial_number,</if>
|
|
|
+ <if test="templateType != null">template_type,</if>
|
|
|
+ <if test="typeXlId != null">type_xl_id,</if>
|
|
|
+ <if test="typeDlId != null">type_dl_id,</if>
|
|
|
+ <if test="typeDlName != null">type_dl_name,</if>
|
|
|
</trim>
|
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
<if test="id != null">#{id},</if>
|
|
|
<if test="eventTypeName != null">#{eventTypeName},</if>
|
|
|
<if test="parentId != null">#{parentId},</if>
|
|
|
- <if test="code != null">#{code},</if>
|
|
|
- <if test="reminderTime != null">#{reminderTime},</if>
|
|
|
+ <if test="serialNumber != null">#{serialNumber},</if>
|
|
|
+ <if test="templateType != null">#{templateType},</if>
|
|
|
+ <if test="typeXlId != null">#{typeXlId},</if>
|
|
|
+ <if test="typeDlId != null">#{typeDlId},</if>
|
|
|
+ <if test="typeDlName != null">#{typeDlName},</if>
|
|
|
</trim>
|
|
|
</insert>
|
|
|
|
|
|
- <update id="updateCentereventTEventtypemonitor" parameterType="CentereventTEventtypeMonitor">
|
|
|
+ <update id="updateCentereventTEventtypeMonitor" parameterType="CentereventTEventtypeMonitor">
|
|
|
update centerevent_t_eventtype_monitor
|
|
|
<trim prefix="SET" suffixOverrides=",">
|
|
|
<if test="eventTypeName != null">event_type_name = #{eventTypeName},</if>
|
|
|
<if test="parentId != null">parent_id = #{parentId},</if>
|
|
|
- <if test="code != null">code = #{code},</if>
|
|
|
- <if test="reminderTime != null">reminder_time = #{reminderTime},</if>
|
|
|
+ <if test="serialNumber != null">serial_number = #{serialNumber},</if>
|
|
|
+ <if test="templateType != null">template_type = #{templateType},</if>
|
|
|
+ <if test="typeXlId != null">type_xl_id = #{typeXlId},</if>
|
|
|
+ <if test="typeDlId != null">type_dl_id = #{typeDlId},</if>
|
|
|
+ <if test="typeDlName != null">type_dl_name = #{typeDlName},</if>
|
|
|
</trim>
|
|
|
where id = #{id}
|
|
|
</update>
|
|
|
|
|
|
+ <delete id="deleteCentereventTEventtypeMonitorByParentId" parameterType="String">
|
|
|
+ delete from centerevent_t_eventtype_monitor where parent_id = #{parentId}
|
|
|
+ </delete>
|
|
|
+
|
|
|
+ <select id="getCentereventTEventtypemonitorTree" parameterType="string" resultType="java.util.Map">
|
|
|
+ SELECT id, event_type_name, parent_id, serial_number FROM centerevent_t_eventtype_monitor where template_type = #{templateType}
|
|
|
+ </select>
|
|
|
+
|
|
|
<select id="getEventByEventType" parameterType="VisuForestCloudMapVO" resultType="map">
|
|
|
SELECT
|
|
|
moni.id,
|
|
|
moni.parent_id,
|
|
|
moni.event_type_name,
|
|
|
- IFNULL(b.VALUE,0) AS nums,
|
|
|
- moni.type_xl_id AS typeXlId,
|
|
|
- moni.type_dl_id AS typeDlId,
|
|
|
- moni.type_dl_name AS typeDlName
|
|
|
-
|
|
|
- from centerevent_t_eventtype_monitor moni left join (
|
|
|
+ IFNULL(b.VALUE,0) nums,
|
|
|
+ moni.type_xl_id typeXlId,
|
|
|
+ moni.type_dl_id typeDlId,
|
|
|
+ moni.type_dl_name typeDlName
|
|
|
+ from centerevent_t_eventtype_monitor moni
|
|
|
+ left join (
|
|
|
select IFNULL(id,0) id,IFNULL(parent_id,1) parentId,IFNULL(event_type_name,'火情事件') name,count(*) value from (
|
|
|
select y.id,y.parent_id,event_type_name from (
|
|
|
<if test="isHgj != null and isHgj == 'false'">
|
|
@@ -112,83 +148,6 @@
|
|
|
group by a.event_code) t
|
|
|
group by event_type_name
|
|
|
order by id
|
|
|
- ) b on moni.type_xl_id=b.id where moni.template_type=#{templateType}
|
|
|
- </select>
|
|
|
-
|
|
|
- <select id="selectCentereventTEventtypeMonitorList" parameterType="CentereventTEventtypeMonitor" resultMap="CentereventTEventtypeMonitorResult">
|
|
|
- <include refid="selectCentereventTEventtypeMonitorSql"/>,etd.lxids,etd.lxnames from centerevent_t_eventtype_monitor et
|
|
|
- left join ( select rr.parent_id as parentId,GROUP_CONCAT(rr.type_xl_id) as lxids,GROUP_CONCAT(rr.event_type_name) as lxnames from centerevent_t_eventtype_monitor rr group by rr.parent_id )
|
|
|
- etd on etd.parentId=et.id
|
|
|
- <where>
|
|
|
- <if test="eventTypeName != null and eventTypeName != ''"> and event_type_name like concat('%', #{eventTypeName}, '%')</if>
|
|
|
- <if test="parentId != null "> and parent_id = #{parentId}</if>
|
|
|
- <if test="serialNumber != null and serialNumber != ''"> and serial_number = #{serialNumber}</if>
|
|
|
- <if test="templateType != null and templateType != ''"> and template_type = #{templateType}</if>
|
|
|
- <if test="typeXlId != null "> and type_xl_id = #{typeXlId}</if>
|
|
|
- <if test="typeDlId != null "> and type_dl_id = #{typeDlId}</if>
|
|
|
- <if test="typeDlName != null and typeDlName != ''"> and type_dl_name like concat('%', #{typeDlName}, '%')</if>
|
|
|
- </where>
|
|
|
- </select>
|
|
|
-
|
|
|
- <select id="selectCentereventTEventtypeMonitorById" parameterType="Long" resultMap="CentereventTEventtypeMonitorResult">
|
|
|
- <include refid="selectCentereventTEventtypeMonitorVo"/>
|
|
|
- where id = #{id}
|
|
|
+ ) b on moni.type_xl_id=b.id where moni.template_type = #{templateType}
|
|
|
</select>
|
|
|
- <select id="selectCentereventTEventtypeMonitorByParentId" parameterType="Long" resultMap="CentereventTEventtypeMonitorResult">
|
|
|
- <include refid="selectCentereventTEventtypeMonitorVo"/>
|
|
|
- where parent_id = #{id}
|
|
|
- </select>
|
|
|
-
|
|
|
- <insert id="insertCentereventTEventtypeMonitor" parameterType="CentereventTEventtypeMonitor">
|
|
|
- insert into centerevent_t_eventtype_monitor
|
|
|
- <trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
- <if test="id != null">id,</if>
|
|
|
- <if test="eventTypeName != null">event_type_name,</if>
|
|
|
- <if test="parentId != null">parent_id,</if>
|
|
|
- <if test="serialNumber != null">serial_number,</if>
|
|
|
- <if test="templateType != null">template_type,</if>
|
|
|
- <if test="typeXlId != null">type_xl_id,</if>
|
|
|
- <if test="typeDlId != null">type_dl_id,</if>
|
|
|
- <if test="typeDlName != null">type_dl_name,</if>
|
|
|
- </trim>
|
|
|
- <trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
- <if test="id != null">#{id},</if>
|
|
|
- <if test="eventTypeName != null">#{eventTypeName},</if>
|
|
|
- <if test="parentId != null">#{parentId},</if>
|
|
|
- <if test="serialNumber != null">#{serialNumber},</if>
|
|
|
- <if test="templateType != null">#{templateType},</if>
|
|
|
- <if test="typeXlId != null">#{typeXlId},</if>
|
|
|
- <if test="typeDlId != null">#{typeDlId},</if>
|
|
|
- <if test="typeDlName != null">#{typeDlName},</if>
|
|
|
- </trim>
|
|
|
- </insert>
|
|
|
-
|
|
|
- <update id="updateCentereventTEventtypeMonitor" parameterType="CentereventTEventtypeMonitor">
|
|
|
- update centerevent_t_eventtype_monitor
|
|
|
- <trim prefix="SET" suffixOverrides=",">
|
|
|
- <if test="eventTypeName != null">event_type_name = #{eventTypeName},</if>
|
|
|
- <if test="parentId != null">parent_id = #{parentId},</if>
|
|
|
- <if test="serialNumber != null">serial_number = #{serialNumber},</if>
|
|
|
- <if test="templateType != null">template_type = #{templateType},</if>
|
|
|
- <if test="typeXlId != null">type_xl_id = #{typeXlId},</if>
|
|
|
- <if test="typeDlId != null">type_dl_id = #{typeDlId},</if>
|
|
|
- <if test="typeDlName != null">type_dl_name = #{typeDlName},</if>
|
|
|
- </trim>
|
|
|
- where id = #{id}
|
|
|
- </update>
|
|
|
-
|
|
|
- <delete id="deleteCentereventTEventtypeMonitorById" parameterType="Long">
|
|
|
- delete from centerevent_t_eventtype_monitor where id = #{id}
|
|
|
- </delete>
|
|
|
-
|
|
|
- <delete id="deleteCentereventTEventtypeMonitorByIds" parameterType="String">
|
|
|
- delete from centerevent_t_eventtype_monitor where id in
|
|
|
- <foreach item="id" collection="array" open="(" separator="," close=")">
|
|
|
- #{id}
|
|
|
- </foreach>
|
|
|
- </delete>
|
|
|
-
|
|
|
- <delete id="deleteCentereventTEventtypeMonitorByParentId" parameterType="String">
|
|
|
- delete from centerevent_t_eventtype_monitor where parent_id = #{parentId}
|
|
|
- </delete>
|
|
|
</mapper>
|