|
@@ -1,50 +1,61 @@
|
|
|
<?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.ruoyi.biz.mapper.TwinRecordAlarmsMapper">
|
|
|
-
|
|
|
+
|
|
|
<resultMap type="TwinRecordAlarms" id="TwinRecordAlarmsResult">
|
|
|
- <result property="id" column="ID" />
|
|
|
- <result property="deviceId" column="DEVICE_ID" />
|
|
|
- <result property="dataDate" column="DATA_DATE" />
|
|
|
- <result property="hour" column="HOUR" />
|
|
|
- <result property="startTime" column="START_TIME" />
|
|
|
- <result property="endTime" column="END_TIME" />
|
|
|
- <result property="alarmType" column="ALARM_TYPE" />
|
|
|
- <result property="createdBy" column="CREATED_BY" />
|
|
|
- <result property="createdTime" column="CREATED_TIME" />
|
|
|
- <result property="updatedBy" column="UPDATED_BY" />
|
|
|
- <result property="updatedTime" column="UPDATED_TIME" />
|
|
|
- <result property="remark" column="REMARK" />
|
|
|
+ <result property="id" column="ID"/>
|
|
|
+ <result property="deviceId" column="DEVICE_ID"/>
|
|
|
+ <result property="dataDate" column="DATA_DATE"/>
|
|
|
+ <result property="hour" column="HOUR"/>
|
|
|
+ <result property="startTime" column="START_TIME"/>
|
|
|
+ <result property="endTime" column="END_TIME"/>
|
|
|
+ <result property="alarmType" column="ALARM_TYPE"/>
|
|
|
+ <result property="calcStatus" column="CALC_STATUS"/>
|
|
|
+ <result property="createdBy" column="CREATED_BY"/>
|
|
|
+ <result property="createdTime" column="CREATED_TIME"/>
|
|
|
+ <result property="updatedBy" column="UPDATED_BY"/>
|
|
|
+ <result property="updatedTime" column="UPDATED_TIME"/>
|
|
|
+ <result property="remark" column="REMARK"/>
|
|
|
</resultMap>
|
|
|
|
|
|
<sql id="selectTwinRecordAlarmsVo">
|
|
|
- select ID, DEVICE_ID, DATA_DATE, HOUR, START_TIME, END_TIME, ALARM_TYPE, CREATED_BY, CREATED_TIME, UPDATED_BY, UPDATED_TIME, REMARK from twin_record_alarms
|
|
|
+ select ID,
|
|
|
+ DEVICE_ID,
|
|
|
+ DATA_DATE, HOUR, START_TIME, END_TIME, ALARM_TYPE, CALC_STATUS, CREATED_BY, CREATED_TIME, UPDATED_BY, UPDATED_TIME, REMARK
|
|
|
+ from twin_record_alarms
|
|
|
</sql>
|
|
|
|
|
|
<select id="selectTwinRecordAlarmsList" parameterType="TwinRecordAlarms" resultMap="TwinRecordAlarmsResult">
|
|
|
<include refid="selectTwinRecordAlarmsVo"/>
|
|
|
- <where>
|
|
|
- <if test="deviceId != null "> and DEVICE_ID = #{deviceId}</if>
|
|
|
- <if test="params.beginDataDate != null and params.beginDataDate != '' and params.endDataDate != null and params.endDataDate != ''"> and DATA_DATE between #{params.beginDataDate} and #{params.endDataDate}</if>
|
|
|
- <if test="hour != null and hour != ''"> and HOUR = #{hour}</if>
|
|
|
- <if test="params.beginStartTime != null and params.beginStartTime != '' and params.endStartTime != null and params.endStartTime != ''"> and START_TIME between #{params.beginStartTime} and #{params.endStartTime}</if>
|
|
|
- <if test="params.beginEndTime != null and params.beginEndTime != '' and params.endEndTime != null and params.endEndTime != ''"> and END_TIME between #{params.beginEndTime} and #{params.endEndTime}</if>
|
|
|
- <if test="alarmType != null "> and ALARM_TYPE = #{alarmType}</if>
|
|
|
- <if test="createdBy != null and createdBy != ''"> and CREATED_BY = #{createdBy}</if>
|
|
|
- <if test="createdTime != null "> and CREATED_TIME = #{createdTime}</if>
|
|
|
- <if test="updatedBy != null and updatedBy != ''"> and UPDATED_BY = #{updatedBy}</if>
|
|
|
- <if test="updatedTime != null "> and UPDATED_TIME = #{updatedTime}</if>
|
|
|
- <if test="remark != null and remark != ''"> and REMARK = #{remark}</if>
|
|
|
+ <where>
|
|
|
+ <if test="deviceId != null ">and DEVICE_ID = #{deviceId}</if>
|
|
|
+ <if test="params.beginDataDate != null and params.beginDataDate != '' and params.endDataDate != null and params.endDataDate != ''">
|
|
|
+ and DATA_DATE between #{params.beginDataDate} and #{params.endDataDate}
|
|
|
+ </if>
|
|
|
+ <if test="hour != null and hour != ''">and HOUR = #{hour}</if>
|
|
|
+ <if test="params.beginStartTime != null and params.beginStartTime != '' and params.endStartTime != null and params.endStartTime != ''">
|
|
|
+ and START_TIME between #{params.beginStartTime} and #{params.endStartTime}
|
|
|
+ </if>
|
|
|
+ <if test="params.beginEndTime != null and params.beginEndTime != '' and params.endEndTime != null and params.endEndTime != ''">
|
|
|
+ and END_TIME between #{params.beginEndTime} and #{params.endEndTime}
|
|
|
+ </if>
|
|
|
+ <if test="alarmType != null ">and ALARM_TYPE = #{alarmType}</if>
|
|
|
+ <if test="calcStatus != null ">and CALC_STATUS = #{calcStatus}</if>
|
|
|
+ <if test="createdBy != null and createdBy != ''">and CREATED_BY = #{createdBy}</if>
|
|
|
+ <if test="createdTime != null ">and CREATED_TIME = #{createdTime}</if>
|
|
|
+ <if test="updatedBy != null and updatedBy != ''">and UPDATED_BY = #{updatedBy}</if>
|
|
|
+ <if test="updatedTime != null ">and UPDATED_TIME = #{updatedTime}</if>
|
|
|
+ <if test="remark != null and remark != ''">and REMARK = #{remark}</if>
|
|
|
</where>
|
|
|
</select>
|
|
|
-
|
|
|
+
|
|
|
<select id="selectTwinRecordAlarmsById" parameterType="Long" resultMap="TwinRecordAlarmsResult">
|
|
|
<include refid="selectTwinRecordAlarmsVo"/>
|
|
|
where ID = #{id}
|
|
|
</select>
|
|
|
-
|
|
|
+
|
|
|
<insert id="insertTwinRecordAlarms" parameterType="TwinRecordAlarms" useGeneratedKeys="true" keyProperty="id">
|
|
|
insert into twin_record_alarms
|
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
@@ -54,12 +65,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="startTime != null">START_TIME,</if>
|
|
|
<if test="endTime != null">END_TIME,</if>
|
|
|
<if test="alarmType != null">ALARM_TYPE,</if>
|
|
|
+ <if test="calcStatus != null ">CALC_STATUS,</if>
|
|
|
<if test="createdBy != null">CREATED_BY,</if>
|
|
|
<if test="createdTime != null">CREATED_TIME,</if>
|
|
|
<if test="updatedBy != null">UPDATED_BY,</if>
|
|
|
<if test="updatedTime != null">UPDATED_TIME,</if>
|
|
|
<if test="remark != null">REMARK,</if>
|
|
|
- </trim>
|
|
|
+ </trim>
|
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
<if test="deviceId != null">#{deviceId},</if>
|
|
|
<if test="dataDate != null">#{dataDate},</if>
|
|
@@ -67,12 +79,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="startTime != null">#{startTime},</if>
|
|
|
<if test="endTime != null">#{endTime},</if>
|
|
|
<if test="alarmType != null">#{alarmType},</if>
|
|
|
+ <if test="calcStatus != null ">#{calcStatus},</if>
|
|
|
<if test="createdBy != null">#{createdBy},</if>
|
|
|
<if test="createdTime != null">#{createdTime},</if>
|
|
|
<if test="updatedBy != null">#{updatedBy},</if>
|
|
|
<if test="updatedTime != null">#{updatedTime},</if>
|
|
|
<if test="remark != null">#{remark},</if>
|
|
|
- </trim>
|
|
|
+ </trim>
|
|
|
</insert>
|
|
|
|
|
|
<update id="updateTwinRecordAlarms" parameterType="TwinRecordAlarms">
|
|
@@ -84,6 +97,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="startTime != null">START_TIME = #{startTime},</if>
|
|
|
<if test="endTime != null">END_TIME = #{endTime},</if>
|
|
|
<if test="alarmType != null">ALARM_TYPE = #{alarmType},</if>
|
|
|
+ <if test="calcStatus != null ">CALC_STATUS = #{calcStatus},</if>
|
|
|
<if test="createdBy != null">CREATED_BY = #{createdBy},</if>
|
|
|
<if test="createdTime != null">CREATED_TIME = #{createdTime},</if>
|
|
|
<if test="updatedBy != null">UPDATED_BY = #{updatedBy},</if>
|
|
@@ -94,14 +108,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
</update>
|
|
|
|
|
|
<delete id="deleteTwinRecordAlarmsById" parameterType="Long">
|
|
|
- delete from twin_record_alarms where ID = #{id}
|
|
|
+ delete
|
|
|
+ from twin_record_alarms
|
|
|
+ where ID = #{id}
|
|
|
</delete>
|
|
|
|
|
|
<delete id="deleteTwinRecordAlarmsByIds" parameterType="String">
|
|
|
- delete from twin_record_alarms where ID in
|
|
|
+ delete from twin_record_alarms where ID in
|
|
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
|
|
#{id}
|
|
|
</foreach>
|
|
|
</delete>
|
|
|
|
|
|
-</mapper>
|
|
|
+</mapper>
|