|
@@ -1,36 +1,40 @@
|
|
|
<?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">
|
|
|
+ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
+ "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
|
<mapper namespace="com.doc.system.mapper.SysAlarmMapper">
|
|
|
-
|
|
|
+
|
|
|
<resultMap type="SysAlarm" id="SysAlarmResult">
|
|
|
- <result property="alarmId" column="ALARM_ID" />
|
|
|
- <result property="alarmContent" column="ALARM_CONTENT" />
|
|
|
- <result property="alarmLevel" column="ALARM_LEVEL" />
|
|
|
- <result property="alarmType" column="ALARM_TYPE" />
|
|
|
- <result property="alarmTime" column="ALARM_TIME" />
|
|
|
+ <result property="alarmId" column="ALARM_ID"/>
|
|
|
+ <result property="alarmContent" column="ALARM_CONTENT"/>
|
|
|
+ <result property="alarmLevel" column="ALARM_LEVEL"/>
|
|
|
+ <result property="alarmType" column="ALARM_TYPE"/>
|
|
|
+ <result property="alarmTime" column="ALARM_TIME"/>
|
|
|
+ <result property="remark" column="REMARK"/>
|
|
|
</resultMap>
|
|
|
|
|
|
<sql id="selectSysAlarmVo">
|
|
|
- select ALARM_ID, ALARM_CONTENT, ALARM_LEVEL, ALARM_TYPE, ALARM_TIME from sys_alarm
|
|
|
+ select ALARM_ID, ALARM_CONTENT, ALARM_LEVEL, ALARM_TYPE, ALARM_TIME, REMARK
|
|
|
+ from sys_alarm
|
|
|
</sql>
|
|
|
|
|
|
<select id="selectSysAlarmList" parameterType="SysAlarm" resultMap="SysAlarmResult">
|
|
|
<include refid="selectSysAlarmVo"/>
|
|
|
- <where>
|
|
|
- <if test="alarmContent != null and alarmContent != ''"> and ALARM_CONTENT like concat('%', #{alarmContent}, '%')</if>
|
|
|
- <if test="alarmLevel != null "> and ALARM_LEVEL = #{alarmLevel}</if>
|
|
|
- <if test="alarmType != null "> and ALARM_TYPE = #{alarmType}</if>
|
|
|
- <if test="alarmTime != null "> and ALARM_TIME = #{alarmTime}</if>
|
|
|
+ <where>
|
|
|
+ <if test="alarmContent != null and alarmContent != ''">and ALARM_CONTENT like concat('%', #{alarmContent},
|
|
|
+ '%')
|
|
|
+ </if>
|
|
|
+ <if test="alarmLevel != null ">and ALARM_LEVEL = #{alarmLevel}</if>
|
|
|
+ <if test="alarmType != null ">and ALARM_TYPE = #{alarmType}</if>
|
|
|
+ <if test="alarmTime != null ">and ALARM_TIME = #{alarmTime}</if>
|
|
|
</where>
|
|
|
</select>
|
|
|
-
|
|
|
+
|
|
|
<select id="selectSysAlarmByAlarmId" parameterType="Long" resultMap="SysAlarmResult">
|
|
|
<include refid="selectSysAlarmVo"/>
|
|
|
where ALARM_ID = #{alarmId}
|
|
|
</select>
|
|
|
-
|
|
|
+
|
|
|
<insert id="insertSysAlarm" parameterType="SysAlarm" useGeneratedKeys="true" keyProperty="alarmId">
|
|
|
insert into sys_alarm
|
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
@@ -38,13 +42,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="alarmLevel != null">ALARM_LEVEL,</if>
|
|
|
<if test="alarmType != null">ALARM_TYPE,</if>
|
|
|
<if test="alarmTime != null">ALARM_TIME,</if>
|
|
|
- </trim>
|
|
|
+ <if test="remark != null">REMARK,</if>
|
|
|
+ </trim>
|
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
<if test="alarmContent != null">#{alarmContent},</if>
|
|
|
<if test="alarmLevel != null">#{alarmLevel},</if>
|
|
|
<if test="alarmType != null">#{alarmType},</if>
|
|
|
<if test="alarmTime != null">#{alarmTime},</if>
|
|
|
- </trim>
|
|
|
+ <if test="remark != null">#{remark},</if>
|
|
|
+ </trim>
|
|
|
</insert>
|
|
|
|
|
|
<update id="updateSysAlarm" parameterType="SysAlarm">
|
|
@@ -54,16 +60,19 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="alarmLevel != null">ALARM_LEVEL = #{alarmLevel},</if>
|
|
|
<if test="alarmType != null">ALARM_TYPE = #{alarmType},</if>
|
|
|
<if test="alarmTime != null">ALARM_TIME = #{alarmTime},</if>
|
|
|
+ <if test="remark != null">REMARK = #{remark},</if>
|
|
|
</trim>
|
|
|
where ALARM_ID = #{alarmId}
|
|
|
</update>
|
|
|
|
|
|
<delete id="deleteSysAlarmByAlarmId" parameterType="Long">
|
|
|
- delete from sys_alarm where ALARM_ID = #{alarmId}
|
|
|
+ delete
|
|
|
+ from sys_alarm
|
|
|
+ where ALARM_ID = #{alarmId}
|
|
|
</delete>
|
|
|
|
|
|
<delete id="deleteSysAlarmByAlarmIds" parameterType="String">
|
|
|
- delete from sys_alarm where ALARM_ID in
|
|
|
+ delete from sys_alarm where ALARM_ID in
|
|
|
<foreach item="alarmId" collection="array" open="(" separator="," close=")">
|
|
|
#{alarmId}
|
|
|
</foreach>
|