diff options
| author | liukai <[email protected]> | 2024-09-02 12:19:05 +0800 |
|---|---|---|
| committer | liukai <[email protected]> | 2024-09-02 12:19:05 +0800 |
| commit | ef4be5e2038822c7fe793ff649039aad6b48dcee (patch) | |
| tree | 2398b4ea0c2a0c3e1be71e7852f4ea3180691c1a | |
| parent | 9d71f5792ae8d61f5723e38700ad04cf296cc545 (diff) | |
处置结果录入
| -rw-r--r-- | src/main/resources/mappers/TCommandReportMapper.xml | 143 | ||||
| -rw-r--r-- | src/main/resources/mappers/TCommandTaskMapper.xml | 55 |
2 files changed, 166 insertions, 32 deletions
diff --git a/src/main/resources/mappers/TCommandReportMapper.xml b/src/main/resources/mappers/TCommandReportMapper.xml new file mode 100644 index 0000000..bdb8c9a --- /dev/null +++ b/src/main/resources/mappers/TCommandReportMapper.xml @@ -0,0 +1,143 @@ +<?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.realtime.protection.server.v1.mapper.TCommandReportMapper"> + + <resultMap type="com.realtime.protection.server.v1.entity.TCommandReport" id="TCommandReportMap"> + <result property="id" column="id" jdbcType="INTEGER"/> + <result property="commandId" column="command_id" jdbcType="INTEGER"/> + <result property="taskId" column="task_id" jdbcType="INTEGER"/> + <result property="taskName" column="task_name" jdbcType="VARCHAR"/> + <result property="userName" column="user_name" jdbcType="VARCHAR"/> + <result property="department" column="department" jdbcType="VARCHAR"/> + <result property="eventType" column="event_type" jdbcType="VARCHAR"/> + <result property="incidence" column="incidence" jdbcType="VARCHAR"/> + <result property="eventLevel" column="event_level" jdbcType="VARCHAR"/> + <result property="eventCause" column="event_cause" jdbcType="VARCHAR"/> + <result property="eventImpact" column="event_impact" jdbcType="VARCHAR"/> + <result property="disposalMeasures" column="disposal_measures" jdbcType="VARCHAR"/> + <result property="taskStartTime" column="task_start_time" jdbcType="TIMESTAMP"/> + <result property="taskEndTime" column="task_end_time" jdbcType="TIMESTAMP"/> + <result property="disposalResults" column="disposal_results" jdbcType="VARCHAR"/> + <result property="rectificationMeasures" column="rectification_measures" jdbcType="VARCHAR"/> + <result property="createTime" column="create_time" jdbcType="TIMESTAMP"/> + </resultMap> + + <!--查询单个--> + <select id="queryByCommandId" resultMap="TCommandReportMap"> + select id, + command_id, + task_id, + task_name, + user_name, + department, + event_type, + incidence, + event_level, + event_cause, + event_impact, + disposal_measures, + task_start_time, + task_end_time, + disposal_results, + rectification_measures, + create_time + from t_command_report + where command_id = #{commandId} + </select> + + <!--新增所有列--> + <insert id="insert" keyProperty="id" useGeneratedKeys="true"> + insert into t_command_report(command_id, + task_id, + task_name, + user_name, + department, + event_type, + incidence, + event_level, + event_cause, + event_impact, + disposal_measures, + task_start_time, + task_end_time, + disposal_results, + rectification_measures, + create_time) + values (#{commandId}, + #{taskId}, + #{taskName}, + #{userName}, + #{department}, + #{eventType}, + #{incidence}, + #{eventLevel}, + #{eventCause}, + #{eventImpact}, + #{disposalMeasures}, + #{taskStartTime}, + #{taskEndTime}, + #{disposalResults}, + #{rectificationMeasures}, + #{createTime}) + </insert> + + <!--通过主键修改数据--> + <update id="update"> + update t_command_report + <set> + <if test="taskId != null"> + task_id = #{taskId}, + </if> + <if test="taskName != null and taskName != ''"> + task_name = #{taskName}, + </if> + <if test="userName != null and userName != ''"> + user_name = #{userName}, + </if> + <if test="department != null and department != ''"> + department = #{department}, + </if> + <if test="eventType != null and eventType != ''"> + event_type = #{eventType}, + </if> + <if test="incidence != null and incidence != ''"> + incidence = #{incidence}, + </if> + <if test="eventLevel != null and eventLevel != ''"> + event_level = #{eventLevel}, + </if> + <if test="eventCause != null and eventCause != ''"> + event_cause = #{eventCause}, + </if> + <if test="eventImpact != null and eventImpact != ''"> + event_impact = #{eventImpact}, + </if> + <if test="disposalMeasures != null and disposalMeasures != ''"> + disposal_measures = #{disposalMeasures}, + </if> + <if test="taskStartTime != null"> + task_start_time = #{taskStartTime}, + </if> + <if test="taskEndTime != null"> + task_end_time = #{taskEndTime}, + </if> + <if test="disposalResults != null and disposalResults != ''"> + disposal_results = #{disposalResults}, + </if> + <if test="rectificationMeasures != null and rectificationMeasures != ''"> + rectification_measures = #{rectificationMeasures}, + </if> + <if test="createTime != null"> + create_time = #{createTime}, + </if> + </set> + where command_id = #{commandId} + </update> + + <!--通过主键删除--> + <delete id="deleteById"> + delete from t_command_report where id = #{id} + </delete> + +</mapper> + diff --git a/src/main/resources/mappers/TCommandTaskMapper.xml b/src/main/resources/mappers/TCommandTaskMapper.xml index cb97ef2..547a662 100644 --- a/src/main/resources/mappers/TCommandTaskMapper.xml +++ b/src/main/resources/mappers/TCommandTaskMapper.xml @@ -19,13 +19,12 @@ <result property="taskCreateDepart" column="task_create_depart" jdbcType="VARCHAR"/> <result property="taskDisplayId" column="task_display_id" jdbcType="VARCHAR"/> <result property="taskUuid" column="task_uuid" jdbcType="VARCHAR"/> - <result property="result" column="result" jdbcType="VARCHAR"/> </resultMap> <!--查询单个--> <select id="queryById" resultMap="TCommandTaskMap"> select -task_id,id,task_name,event_type,incidence,event_level,disposal_measures,task_start_time,task_end_time,priority,file,task_create_time,task_create_username,task_create_depart,task_display_id,task_uuid,result +task_id,id,task_name,event_type,incidence,event_level,disposal_measures,task_start_time,task_end_time,priority,file,task_create_time,task_create_username,task_create_depart,task_display_id,task_uuid from t_command_task where id = #{id} </select> @@ -33,68 +32,69 @@ task_id,id,task_name,event_type,incidence,event_level,disposal_measures,task_sta <!--查询指定行数据--> <select id="queryAllByLimit" resultMap="TCommandTaskMap"> select - task_id,id,task_name,event_type,incidence,event_level,disposal_measures,task_start_time,task_end_time,priority,file,task_create_time,task_create_username,task_create_depart,task_display_id,task_uuid,result - from t_command_task + a.task_id,a.id,a.task_name,a.event_type,a.incidence,a.event_level,a.disposal_measures, + a.task_start_time,a.task_end_time,a.priority,a.file,a.task_create_time,a.task_create_username, + a.task_create_depart,a.task_display_id, + b.task_display_id task_uuid + from t_command_task a left join t_task b on a.task_id=b.task_id <where> <if test="tCommandTask.taskId != null"> - and task_id = #{tCommandTask.taskId} + and a.task_id = #{tCommandTask.taskId} </if> <if test="tCommandTask.id != null"> - and id = #{tCommandTask.id} + and a.id = #{tCommandTask.id} </if> <if test="tCommandTask.taskName != null and tCommandTask.taskName != ''"> - and task_name = #{tCommandTask.taskName} + and a.task_name = #{tCommandTask.taskName} </if> <if test="tCommandTask.taskUuid != null and tCommandTask.taskUuid != ''"> - and task_uuid = #{tCommandTask.taskUuid} + and a.task_uuid = #{tCommandTask.taskUuid} </if> <if test="tCommandTask.eventType != null and tCommandTask.eventType != ''"> - and event_type = #{tCommandTask.eventType} + and a.event_type = #{tCommandTask.eventType} </if> <if test="tCommandTask.incidence != null and tCommandTask.incidence != ''"> - and incidence = #{tCommandTask.incidence} + and a.incidence = #{tCommandTask.incidence} </if> <if test="tCommandTask.eventLevel != null and tCommandTask.eventLevel != ''"> - and event_level = #{tCommandTask.eventLevel} + and a.event_level = #{tCommandTask.eventLevel} </if> <if test="tCommandTask.disposalMeasures != null and tCommandTask.disposalMeasures != ''"> - and disposal_measures = #{tCommandTask.disposalMeasures} + and a.disposal_measures = #{tCommandTask.disposalMeasures} </if> <if test="tCommandTask.taskStartTime != null and tCommandTask.taskStartTime != ''"> - and task_start_time>#{tCommandTask.taskStartTime} + and a.task_start_time>#{tCommandTask.taskStartTime} </if> <if test="tCommandTask.taskEndTime != null and tCommandTask.taskEndTime != ''"> - and #{tCommandTask.taskEndTime} > task_end_time + and #{tCommandTask.taskEndTime} > a.task_end_time </if> <if test="tCommandTask.priority != null and tCommandTask.priority != ''"> - and priority = #{tCommandTask.priority} + and a.priority = #{tCommandTask.priority} </if> <if test="tCommandTask.file != null and tCommandTask.file != ''"> - and file = #{tCommandTask.file} + and a.file = #{tCommandTask.file} </if> <if test="tCommandTask.taskCreateTime != null"> - and task_create_time = #{tCommandTask.taskCreateTime} + and a.task_create_time = #{tCommandTask.taskCreateTime} </if> <if test="tCommandTask.taskCreateUsername != null and tCommandTask.taskCreateUsername != ''"> - and task_create_username = #{tCommandTask.taskCreateUsername} + and a.task_create_username = #{tCommandTask.taskCreateUsername} </if> <if test="tCommandTask.taskCreateDepart != null and tCommandTask.taskCreateDepart != ''"> - and task_create_depart = #{tCommandTask.taskCreateDepart} + and a.task_create_depart = #{tCommandTask.taskCreateDepart} </if> <if test="tCommandTask.taskDisplayId != null and tCommandTask.taskDisplayId != ''"> - and task_display_id = #{tCommandTask.taskDisplayId} + and a.task_display_id = #{tCommandTask.taskDisplayId} </if> </where> order by id desc limit #{page}, #{pageSize} </select> - - <!--查询指定行数据--> <select id="queryAllByLimit1" resultMap="TCommandTaskMap"> select - task_id,id,task_name,event_type,incidence,event_level,disposal_measures,task_start_time,task_end_time,priority,file,task_create_time,task_create_username,task_create_depart,task_display_id,task_uuid,result + task_id,id,task_name,event_type,incidence,event_level,disposal_measures,task_start_time,task_end_time,priority,file,task_create_time,task_create_username,task_create_depart,task_display_id,task_uuid from t_command_task where task_id IS NULL <if test="tCommandTask.taskId != null"> and task_id = #{tCommandTask.taskId} @@ -315,19 +315,10 @@ task_id,id,task_name,event_type,incidence,event_level,disposal_measures,task_sta <if test="taskDisplayId != null and taskDisplayId != ''"> task_display_id = #{taskDisplayId}, </if> - <if test="result != null and result != ''"> - result = #{result}, - </if> </set> where id = #{id} </update> - <!--通过主键删除result数据--> - <update id="updateResult"> - update t_command_task set result = NULL - where id = #{id} - </update> - <!--通过主键删除--> <delete id="deleteById"> delete from t_command_task where id = #{id} |
