预警信息

This commit is contained in:
luolx 2025-03-14 19:51:51 +08:00
parent c4c07b1eaa
commit 671a8fa4c3
1 changed files with 190 additions and 0 deletions

View File

@ -0,0 +1,190 @@
<?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="com.dkl.large.mapper.DklWarningInformationMapper">
<resultMap type="DklWarningInformation" id="DklWarningInformationResult">
<result property="id" column="id" />
<result property="warningSigns" column="warning_signs" />
<result property="unitName" column="unit_name" />
<result property="unitCode" column="unit_code" />
<result property="releaseTime" column="release_time" />
<result property="warningStatus" column="warning_status" />
<result property="warningType" column="warning_type" />
<result property="eventCategory" column="event_category" />
<result property="warningLevel" column="warning_level" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
<result property="delFlag" column="del_flag" />
<result property="expectedDuration" column="expected_duration" />
<result property="scopeImpact" column="scope_impact" />
<result property="deptId" column="dept_id" />
<result property="abnormalData" column="abnormal_data" />
<result property="isSupervise" column="is_supervise" />
<result property="rulesId" column="rules_id" />
<result property="eventStatus" column="event_status" />
<result property="pointsId" column="points_id" />
</resultMap>
<sql id="selectDklWarningInformationVo">
select dwi.id, dwi.warning_signs, dwi.unit_name, dwi.unit_code, dwi.release_time, dwi.warning_status,
dwi.warning_type, dwi.event_category, dwi.warning_level, dwi.create_by, dwi.create_time, dwi.update_by,
dwi.update_time, dwi.del_flag, dwi.expected_duration, dwi.scope_impact, dwi.dept_id, dwi.abnormal_data,
dwi.is_supervise, dwi.lng, dwi.lat,dwi.rules_id,dwi.event_status,dwi.points_id,dwi.camera_id,dmp.point_name as pointName,dmc.name as cameraName,dmc.file_path as filePath from dkl_warning_information AS dwi
left join sys_dept d on dwi.dept_id = d.dept_id
left join dkl_monitoring_points dmp on dmp.id = dwi.points_id
left join dkl_monitoring_camera dmc on dmc.id = dwi.camera_id
</sql>
<select id="selectDklWarningInformationList" parameterType="DklWarningInformation" resultMap="DklWarningInformationResult">
<include refid="selectDklWarningInformationVo"/>
<where>
<if test="warningSigns != null and warningSigns != ''"> and dwi.warning_signs like concat('%', #{warningSigns}, '%') </if>
<if test="unitName != null and unitName != ''"> and dwi.unit_name like concat('%', #{unitName}, '%')</if>
<if test="unitCode != null and unitCode != ''"> and dwi.unit_code = #{unitCode}</if>
<if test="releaseTime != null "> and dwi.release_time = #{releaseTime}</if>
<if test="warningStatus != null and warningStatus != ''"> and dwi.warning_status = #{warningStatus}</if>
<if test="warningType != null and warningType != ''"> and dwi.warning_type = #{warningType}</if>
<if test="eventCategory != null and eventCategory != ''"> and dwi.event_category = #{eventCategory}</if>
<if test="warningLevel != null and warningLevel != ''"> and dwi.warning_level = #{warningLevel}</if>
<if test="expectedDuration != null and expectedDuration != ''"> and dwi.expected_duration = #{expectedDuration}</if>
<if test="scopeImpact != null "> and dwi.scope_impact = #{scopeImpact}</if>
<if test="deptId != null "> and dwi.dept_id = #{deptId}</if>
<if test="abnormalData != null and abnormalData != ''"> and dwi.abnormal_data = #{abnormalData}</if>
<if test="delFlag != null and delFlag != ''"> and dwi.del_flag = #{delFlag}</if>
<if test="startTime != null and endTime != null ">
AND dwi.create_time BETWEEN #{startTime} and #{endTime}
</if>
</where>
${params.dataScope}
order by dwi.create_time desc
</select>
<select id="selectDklWarningInformationLists" parameterType="DklWarningInformation" resultMap="DklWarningInformationResult">
<include refid="selectDklWarningInformationVo"/>
<where>
<if test="warningSigns != null and warningSigns != ''"> and dwi.warning_signs like concat('%', #{warningSigns}, '%') </if>
<if test="unitName != null and unitName != ''"> and dwi.unit_name like concat('%', #{unitName}, '%')</if>
<if test="unitCode != null and unitCode != ''"> and dwi.unit_code = #{unitCode}</if>
<if test="releaseTime != null "> and dwi.release_time = #{releaseTime}</if>
<if test="warningStatus != null and warningStatus != ''"> and dwi.warning_status != '3'</if>
<if test="warningType != null and warningType != ''"> and dwi.warning_type = #{warningType}</if>
<if test="eventCategory != null and eventCategory != ''"> and dwi.event_category = #{eventCategory}</if>
<if test="warningLevel != null and warningLevel != ''"> and dwi.warning_level = #{warningLevel}</if>
<if test="expectedDuration != null and expectedDuration != ''"> and dwi.expected_duration = #{expectedDuration}</if>
<if test="scopeImpact != null "> and dwi.scope_impact = #{scopeImpact}</if>
<if test="deptId != null "> and dwi.dept_id = #{deptId}</if>
<if test="abnormalData != null and abnormalData != ''"> and dwi.abnormal_data = #{abnormalData}</if>
<if test="delFlag != null and delFlag != ''"> and dwi.del_flag = #{delFlag}</if>
<if test="startTime != null and endTime != null ">
AND dwi.create_time BETWEEN #{startTime} and #{endTime}
</if>
</where>
${params.dataScope}
order by dwi.create_time desc
</select>
<select id="selectDklWarningInformationById" parameterType="Long" resultMap="DklWarningInformationResult">
<include refid="selectDklWarningInformationVo"/>
where dwi.id = #{id}
</select>
<insert id="insertDklWarningInformation" parameterType="DklWarningInformation" useGeneratedKeys="true" keyProperty="id" >
insert into dkl_warning_information
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="warningSigns != null">warning_signs,</if>
<if test="unitName != null">unit_name,</if>
<if test="unitCode != null">unit_code,</if>
<if test="releaseTime != null">release_time,</if>
<if test="warningStatus != null">warning_status,</if>
<if test="warningType != null">warning_type,</if>
<if test="eventCategory != null">event_category,</if>
<if test="warningLevel != null">warning_level,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
<if test="delFlag != null">del_flag,</if>
<if test="expectedDuration != null">expected_duration,</if>
<if test="scopeImpact != null">scope_impact,</if>
<if test="deptId != null">dept_id,</if>
<if test="abnormalData != null">abnormal_data,</if>
<if test="isSupervise != null">is_supervise,</if>
<if test="lng != null">lng,</if>
<if test="lat != null">lat,</if>
<if test="rulesId != null">rules_id,</if>
<if test="eventStatus != null">event_status,</if>
<if test="pointsId != null">points_id,</if>
<if test="cameraId != null">camera_id,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="warningSigns != null">#{warningSigns},</if>
<if test="unitName != null">#{unitName},</if>
<if test="unitCode != null">#{unitCode},</if>
<if test="releaseTime != null">#{releaseTime},</if>
<if test="warningStatus != null">#{warningStatus},</if>
<if test="warningType != null">#{warningType},</if>
<if test="eventCategory != null">#{eventCategory},</if>
<if test="warningLevel != null">#{warningLevel},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="delFlag != null">#{delFlag},</if>
<if test="expectedDuration != null">#{expectedDuration},</if>
<if test="scopeImpact != null">#{scopeImpact},</if>
<if test="deptId != null">#{deptId},</if>
<if test="abnormalData != null">#{abnormalData},</if>
<if test="isSupervise != null">#{isSupervise},</if>
<if test="lng != null">#{lng},</if>
<if test="lat != null">#{lat},</if>
<if test="rulesId != null">#{rulesId},</if>
<if test="eventStatus != null">#{eventStatus},</if>
<if test="pointsId != null">#{pointsId},</if>
<if test="cameraId != null">#{cameraId},</if>
</trim>
</insert>
<update id="updateDklWarningInformation" parameterType="DklWarningInformation">
update dkl_warning_information
<trim prefix="SET" suffixOverrides=",">
<if test="warningSigns != null">warning_signs = #{warningSigns},</if>
<if test="unitName != null">unit_name = #{unitName},</if>
<if test="unitCode != null">unit_code = #{unitCode},</if>
<if test="releaseTime != null">release_time = #{releaseTime},</if>
<if test="warningStatus != null">warning_status = #{warningStatus},</if>
<if test="warningType != null">warning_type = #{warningType},</if>
<if test="eventCategory != null">event_category = #{eventCategory},</if>
<if test="warningLevel != null">warning_level = #{warningLevel},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="delFlag != null">del_flag = #{delFlag},</if>
<if test="expectedDuration != null">expected_duration = #{expectedDuration},</if>
<if test="scopeImpact != null">scope_impact = #{scopeImpact},</if>
<if test="deptId != null">dept_id = #{deptId},</if>
<if test="abnormalData != null">abnormal_data = #{abnormalData},</if>
<if test="isSupervise != null">is_supervise = #{isSupervise},</if>
<if test="lng != null">lng = #{lng},</if>
<if test="lat != null">lat = #{lat},</if>
<if test="rulesId != null">rules_id = #{rulesId},</if>
<if test="eventStatus != null">event_status = #{eventStatus},</if>
</trim>
where id = #{id}
</update>
<update id="deleteDklWarningInformationById" parameterType="int">
update dkl_warning_information set del_flag = 2 where id = #{id}
</update>
<update id="deleteDklWarningInformationByIds" parameterType="int">
update dkl_warning_information set del_flag = 2 where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</update>
</mapper>