2021-11-04 10:52:21 +08:00
|
|
|
<?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="cn.com.tenlion.dao.warning.IWarningDao">
|
|
|
|
|
|
|
|
<resultMap id="warningDTO" type="cn.com.tenlion.pojo.dtos.warning.WarningDTO">
|
|
|
|
<result column="warning_id" property="warningId"/>
|
|
|
|
<result column="report_id" property="reportId"/>
|
|
|
|
</resultMap>
|
|
|
|
|
|
|
|
<resultMap id="warningBO" type="cn.com.tenlion.pojo.bos.warning.WarningBO">
|
|
|
|
<result column="warning_id" property="warningId"/>
|
|
|
|
<result column="report_id" property="reportId"/>
|
|
|
|
<result column="creator" property="creator"/>
|
|
|
|
<result column="gmt_create" property="gmtCreate"/>
|
|
|
|
<result column="modifier" property="modifier"/>
|
|
|
|
<result column="gmt_modified" property="gmtModified"/>
|
|
|
|
<result column="is_delete" property="isDelete"/>
|
|
|
|
</resultMap>
|
|
|
|
|
|
|
|
<resultMap id="warningPO" type="cn.com.tenlion.pojo.pos.warning.WarningPO">
|
|
|
|
<result column="warning_id" property="warningId"/>
|
|
|
|
<result column="report_id" property="reportId"/>
|
|
|
|
<result column="creator" property="creator"/>
|
|
|
|
<result column="gmt_create" property="gmtCreate"/>
|
|
|
|
<result column="modifier" property="modifier"/>
|
|
|
|
<result column="gmt_modified" property="gmtModified"/>
|
|
|
|
<result column="is_delete" property="isDelete"/>
|
|
|
|
</resultMap>
|
|
|
|
|
2021-11-10 17:31:22 +08:00
|
|
|
|
|
|
|
<resultMap id="warningReportDTO" type="cn.com.tenlion.pojo.dtos.warning.WarningReportDTO">
|
|
|
|
<result column="warning_id" property="warningId"/>
|
|
|
|
<result column="report_id" property="reportId"/>
|
|
|
|
<result column="report_code" property="reportCode"/>
|
|
|
|
<result column="report_area_name" property="reportAreaName"/>
|
|
|
|
<result column="report_address" property="reportAddress"/>
|
|
|
|
<result column="report_lng" property="reportLng"/>
|
|
|
|
<result column="report_lat" property="reportLat"/>
|
|
|
|
<result column="b_g_id" property="bGId"/>
|
|
|
|
<result column="case_type_name1" property="caseTypeName1"/>
|
|
|
|
<result column="case_type_name2" property="caseTypeName2"/>
|
|
|
|
<result column="case_parts_obj_id" property="casePartsObjId"/>
|
|
|
|
<result column="case_parts_obj_name" property="casePartsObjName"/>
|
|
|
|
<result column="report_photos" property="reportPhotos"/>
|
|
|
|
<result column="report_audio" property="reportAudio"/>
|
|
|
|
<result column="report_video" property="reportVideo"/>
|
|
|
|
<result column="report_source" property="reportSource"/>
|
|
|
|
<result column="report_content" property="reportContent"/>
|
|
|
|
<result column="is_self" property="isSelf"/>
|
|
|
|
<result column="handle_status" property="handleStatus"/>
|
|
|
|
<result column="report_result" property="reportResult"/>
|
|
|
|
<result column="is_archive" property="isArchive"/>
|
|
|
|
<result column="gmt_create" property="gmtCreate"/>
|
|
|
|
<result column="creator" property="creator"/>
|
|
|
|
</resultMap>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-11-04 10:52:21 +08:00
|
|
|
<!-- 新增案件预警 -->
|
|
|
|
<insert id="save" parameterType="map">
|
|
|
|
INSERT INTO case_warning(
|
|
|
|
warning_id,
|
|
|
|
report_id,
|
|
|
|
creator,
|
|
|
|
gmt_create,
|
|
|
|
modifier,
|
|
|
|
gmt_modified,
|
|
|
|
is_delete
|
|
|
|
) VALUES(
|
|
|
|
#{warningId},
|
|
|
|
#{reportId},
|
|
|
|
#{creator},
|
|
|
|
#{gmtCreate},
|
|
|
|
#{modifier},
|
|
|
|
#{gmtModified},
|
|
|
|
#{isDelete}
|
|
|
|
)
|
|
|
|
</insert>
|
|
|
|
|
|
|
|
<!-- 删除案件预警 -->
|
|
|
|
<update id="remove" parameterType="map">
|
|
|
|
UPDATE
|
|
|
|
case_warning
|
|
|
|
SET
|
|
|
|
gmt_modified = #{gmtModified},
|
|
|
|
modifier = #{modifier},
|
|
|
|
is_delete = 1
|
|
|
|
WHERE
|
|
|
|
warning_id IN
|
|
|
|
<foreach collection="warningIds" index="index" open="(" separator="," close=")">
|
|
|
|
#{warningIds[${index}]}
|
|
|
|
</foreach>
|
|
|
|
</update>
|
|
|
|
|
|
|
|
<!-- 删除案件预警(物理) -->
|
|
|
|
<update id="delete" parameterType="map">
|
|
|
|
DELETE FROM
|
|
|
|
case_warning
|
|
|
|
WHERE
|
|
|
|
warning_id IN
|
|
|
|
<foreach collection="warningIds" index="index" open="(" separator="," close=")">
|
|
|
|
#{warningIds[${index}]}
|
|
|
|
</foreach>
|
|
|
|
</update>
|
|
|
|
|
|
|
|
<!-- 修改案件预警 -->
|
|
|
|
<update id="update" parameterType="map">
|
|
|
|
UPDATE
|
|
|
|
case_warning
|
|
|
|
SET
|
|
|
|
<if test="reportId != null and reportId != ''">
|
|
|
|
report_id = #{reportId},
|
|
|
|
</if>
|
|
|
|
gmt_modified = #{gmtModified},
|
|
|
|
modifier = #{modifier},
|
|
|
|
warning_id = warning_id
|
|
|
|
WHERE
|
|
|
|
warning_id = #{warningId}
|
|
|
|
</update>
|
|
|
|
|
|
|
|
<!-- 案件预警详情 -->
|
|
|
|
<select id="get" parameterType="map" resultMap="warningDTO">
|
|
|
|
SELECT
|
|
|
|
t1.report_id,
|
|
|
|
t1.warning_id
|
|
|
|
FROM
|
|
|
|
case_warning t1
|
|
|
|
WHERE
|
|
|
|
t1.is_delete = 0
|
|
|
|
<if test="warningId != null and warningId != ''">
|
|
|
|
AND
|
|
|
|
t1.warning_id = #{warningId}
|
|
|
|
</if>
|
|
|
|
</select>
|
|
|
|
|
|
|
|
<!-- 案件预警详情 -->
|
|
|
|
<select id="getBO" parameterType="map" resultMap="warningBO">
|
|
|
|
SELECT
|
|
|
|
t1.warning_id,
|
|
|
|
t1.report_id,
|
|
|
|
t1.creator,
|
|
|
|
t1.gmt_create,
|
|
|
|
t1.modifier,
|
|
|
|
t1.gmt_modified,
|
|
|
|
t1.is_delete
|
|
|
|
FROM
|
|
|
|
case_warning t1
|
|
|
|
WHERE
|
|
|
|
t1.is_delete = 0
|
|
|
|
<if test="warningId != null and warningId != ''">
|
|
|
|
AND
|
|
|
|
t1.warning_id = #{warningId}
|
|
|
|
</if>
|
|
|
|
</select>
|
|
|
|
|
|
|
|
<!-- 案件预警详情 -->
|
|
|
|
<select id="getPO" parameterType="map" resultMap="warningPO">
|
|
|
|
SELECT
|
|
|
|
t1.warning_id,
|
|
|
|
t1.report_id,
|
|
|
|
t1.creator,
|
|
|
|
t1.gmt_create,
|
|
|
|
t1.modifier,
|
|
|
|
t1.gmt_modified,
|
|
|
|
t1.is_delete
|
|
|
|
FROM
|
|
|
|
case_warning t1
|
|
|
|
WHERE
|
|
|
|
t1.is_delete = 0
|
|
|
|
<if test="warningId != null and warningId != ''">
|
|
|
|
AND
|
|
|
|
t1.warning_id = #{warningId}
|
|
|
|
</if>
|
|
|
|
</select>
|
|
|
|
|
|
|
|
<!-- 案件预警列表 -->
|
|
|
|
<select id="list" parameterType="map" resultMap="warningDTO">
|
|
|
|
SELECT
|
|
|
|
t1.warning_id,
|
|
|
|
t1.report_id,
|
|
|
|
1
|
|
|
|
FROM
|
|
|
|
case_warning t1
|
|
|
|
WHERE
|
|
|
|
t1.is_delete = 0
|
|
|
|
<if test="keywords != null and keywords != ''">
|
|
|
|
AND (
|
|
|
|
<!-- 这里添加其他条件 -->
|
|
|
|
t1.id LIKE CONCAT('%', #{keywords}, '%')
|
|
|
|
)
|
|
|
|
</if>
|
|
|
|
<if test="startTime != null and startTime != ''">
|
|
|
|
AND
|
|
|
|
LEFT(t1.gmt_create, 10) <![CDATA[ >= ]]> #{startTime}
|
|
|
|
</if>
|
|
|
|
<if test="endTime != null and endTime != ''">
|
|
|
|
AND
|
|
|
|
LEFT(t1.gmt_create, 10) <![CDATA[ <= ]]> #{endTime}
|
|
|
|
</if>
|
|
|
|
<if test="warningIds != null and warningIds.size > 0">
|
|
|
|
AND
|
|
|
|
t1.warning_id IN
|
|
|
|
<foreach collection="warningIds" index="index" open="(" separator="," close=")">
|
|
|
|
#{warningIds[${index}]}
|
|
|
|
</foreach>
|
|
|
|
</if>
|
|
|
|
</select>
|
2021-11-10 17:31:22 +08:00
|
|
|
<!-- 案件预警列表 -->
|
|
|
|
<select id="listArea" parameterType="map" resultMap="warningReportDTO">
|
|
|
|
SELECT
|
|
|
|
t1.warning_id,
|
|
|
|
t2.report_id,
|
|
|
|
t2.report_code,
|
|
|
|
t2.report_area_name,
|
|
|
|
t2.report_address,
|
|
|
|
t2.report_lng,
|
|
|
|
t2.report_lat,
|
|
|
|
t2.b_g_id,
|
|
|
|
t2.case_type_name1,
|
|
|
|
t2.case_type_name2,
|
|
|
|
t2.case_parts_obj_name,
|
|
|
|
t2.report_photos,
|
|
|
|
t2.report_source,
|
|
|
|
t2.report_content,
|
|
|
|
t2.is_self,
|
|
|
|
t2.handle_status,
|
|
|
|
t2.report_result,
|
|
|
|
t2.is_archive,
|
|
|
|
t2.creator,
|
|
|
|
t2.gmt_create
|
|
|
|
FROM
|
|
|
|
case_warning t1
|
|
|
|
LEFT JOIN case_report t2
|
|
|
|
ON t1.report_id = t2.report_id
|
|
|
|
WHERE
|
|
|
|
t1.is_delete = 0
|
|
|
|
<if test="keywords != null and keywords != ''">
|
|
|
|
AND (
|
|
|
|
<!-- 这里添加其他条件 -->
|
|
|
|
t1.id LIKE CONCAT('%', #{keywords}, '%')
|
|
|
|
)
|
|
|
|
</if>
|
|
|
|
</select>
|
2021-11-04 10:52:21 +08:00
|
|
|
|
|
|
|
<!-- 案件预警列表 -->
|
|
|
|
<select id="listBO" parameterType="map" resultMap="warningBO">
|
|
|
|
SELECT
|
|
|
|
t1.warning_id,
|
|
|
|
t1.report_id,
|
|
|
|
t1.creator,
|
|
|
|
t1.gmt_create,
|
|
|
|
t1.modifier,
|
|
|
|
t1.gmt_modified,
|
|
|
|
t1.is_delete
|
|
|
|
FROM
|
|
|
|
case_warning t1
|
|
|
|
WHERE
|
|
|
|
t1.is_delete = 0
|
|
|
|
<if test="keywords != null and keywords != ''">
|
|
|
|
AND (
|
|
|
|
<!-- 这里添加其他条件 -->
|
|
|
|
t1.id LIKE CONCAT('%', #{keywords}, '%')
|
|
|
|
)
|
|
|
|
</if>
|
|
|
|
<if test="startTime != null and startTime != ''">
|
|
|
|
AND
|
|
|
|
LEFT(t1.gmt_create, 10) <![CDATA[ >= ]]> #{startTime}
|
|
|
|
</if>
|
|
|
|
<if test="endTime != null and endTime != ''">
|
|
|
|
AND
|
|
|
|
LEFT(t1.gmt_create, 10) <![CDATA[ <= ]]> #{endTime}
|
|
|
|
</if>
|
|
|
|
<if test="warningIds != null and warningIds.size > 0">
|
|
|
|
AND
|
|
|
|
t1.warning_id IN
|
|
|
|
<foreach collection="warningIds" index="index" open="(" separator="," close=")">
|
|
|
|
#{warningIds[${index}]}
|
|
|
|
</foreach>
|
|
|
|
</if>
|
|
|
|
</select>
|
|
|
|
|
|
|
|
<!-- 案件预警列表 -->
|
|
|
|
<select id="listPO" parameterType="map" resultMap="warningPO">
|
|
|
|
SELECT
|
|
|
|
t1.warning_id,
|
|
|
|
t1.report_id,
|
|
|
|
t1.creator,
|
|
|
|
t1.gmt_create,
|
|
|
|
t1.modifier,
|
|
|
|
t1.gmt_modified,
|
|
|
|
t1.is_delete
|
|
|
|
FROM
|
|
|
|
case_warning t1
|
|
|
|
WHERE
|
|
|
|
t1.is_delete = 0
|
|
|
|
<if test="keywords != null and keywords != ''">
|
|
|
|
AND (
|
|
|
|
<!-- 这里添加其他条件 -->
|
|
|
|
t1.id LIKE CONCAT('%', #{keywords}, '%')
|
|
|
|
)
|
|
|
|
</if>
|
|
|
|
<if test="startTime != null and startTime != ''">
|
|
|
|
AND
|
|
|
|
LEFT(t1.gmt_create, 10) <![CDATA[ >= ]]> #{startTime}
|
|
|
|
</if>
|
|
|
|
<if test="endTime != null and endTime != ''">
|
|
|
|
AND
|
|
|
|
LEFT(t1.gmt_create, 10) <![CDATA[ <= ]]> #{endTime}
|
|
|
|
</if>
|
|
|
|
<if test="warningIds != null and warningIds.size > 0">
|
|
|
|
AND
|
|
|
|
t1.warning_id IN
|
|
|
|
<foreach collection="warningIds" index="index" open="(" separator="," close=")">
|
|
|
|
#{warningIds[${index}]}
|
|
|
|
</foreach>
|
|
|
|
</if>
|
|
|
|
</select>
|
|
|
|
|
|
|
|
<!-- 案件预警统计 -->
|
|
|
|
<select id="count" parameterType="map" resultType="Integer">
|
|
|
|
SELECT
|
|
|
|
COUNT(*)
|
|
|
|
FROM
|
|
|
|
case_warning t1
|
|
|
|
WHERE
|
|
|
|
t1.is_delete = 0
|
|
|
|
<if test="reportId != null and reportId != ''">
|
|
|
|
AND t1.report_id = #{reportId}
|
|
|
|
</if>
|
|
|
|
</select>
|
|
|
|
|
|
|
|
</mapper>
|