|
@@ -0,0 +1,194 @@
|
|
|
+<?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.zcxk.rmcp.core.dao.DeviceAlarmMapper">
|
|
|
+ <resultMap id="BaseResultMap" type="com.zcxk.rmcp.core.entity.DeviceAlarm">
|
|
|
+ <!--@mbg.generated-->
|
|
|
+ <!--@Table rmcp_device_alarm-->
|
|
|
+ <id column="id" property="id" />
|
|
|
+ <result column="tenant_id" property="tenantId" />
|
|
|
+ <result column="device_id" property="deviceId" />
|
|
|
+ <result column="measuring_id" property="measuringId" />
|
|
|
+ <result column="alarm_type_id" property="alarmTypeId" />
|
|
|
+ <result column="alarm_time" property="alarmTime" />
|
|
|
+ <result column="last_alarm_time" property="lastAlarmTime" />
|
|
|
+ <result column="alarm_count" property="alarmCount" />
|
|
|
+ <result column="handle_status" property="handleStatus" />
|
|
|
+ <result column="handle_result" property="handleResult" />
|
|
|
+ <result column="measuring_data" property="measuringData" />
|
|
|
+ <result column="status" property="status" />
|
|
|
+ <result column="create_by" property="createBy" />
|
|
|
+ <result column="update_by" property="updateBy" />
|
|
|
+ <result column="create_date" property="createDate" />
|
|
|
+ <result column="update_date" property="updateDate" />
|
|
|
+ </resultMap>
|
|
|
+ <sql id="Base_Column_List">
|
|
|
+ <!--@mbg.generated-->
|
|
|
+ id, tenant_id, device_id, measuring_id, alarm_type_id, alarm_time, last_alarm_time,
|
|
|
+ alarm_count, handle_status, handle_result, measuring_data, `status`, create_by, update_by,
|
|
|
+ create_date, update_date
|
|
|
+ </sql>
|
|
|
+ <insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.zcxk.rmcp.core.entity.DeviceAlarm" useGeneratedKeys="true">
|
|
|
+ <!--@mbg.generated-->
|
|
|
+ insert into rmcp_device_alarm
|
|
|
+ <trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="tenantId != null">
|
|
|
+ tenant_id,
|
|
|
+ </if>
|
|
|
+ <if test="deviceId != null">
|
|
|
+ device_id,
|
|
|
+ </if>
|
|
|
+ <if test="measuringId != null">
|
|
|
+ measuring_id,
|
|
|
+ </if>
|
|
|
+ <if test="alarmTypeId != null">
|
|
|
+ alarm_type_id,
|
|
|
+ </if>
|
|
|
+ <if test="alarmTime != null">
|
|
|
+ alarm_time,
|
|
|
+ </if>
|
|
|
+ <if test="lastAlarmTime != null">
|
|
|
+ last_alarm_time,
|
|
|
+ </if>
|
|
|
+ <if test="alarmCount != null">
|
|
|
+ alarm_count,
|
|
|
+ </if>
|
|
|
+ <if test="handleStatus != null">
|
|
|
+ handle_status,
|
|
|
+ </if>
|
|
|
+ <if test="handleResult != null">
|
|
|
+ handle_result,
|
|
|
+ </if>
|
|
|
+ <if test="measuringData != null">
|
|
|
+ measuring_data,
|
|
|
+ </if>
|
|
|
+ <if test="status != null">
|
|
|
+ `status`,
|
|
|
+ </if>
|
|
|
+ <if test="createBy != null">
|
|
|
+ create_by,
|
|
|
+ </if>
|
|
|
+ <if test="updateBy != null">
|
|
|
+ update_by,
|
|
|
+ </if>
|
|
|
+ <if test="createDate != null">
|
|
|
+ create_date,
|
|
|
+ </if>
|
|
|
+ <if test="updateDate != null">
|
|
|
+ update_date,
|
|
|
+ </if>
|
|
|
+ </trim>
|
|
|
+ <trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="tenantId != null">
|
|
|
+ #{tenantId},
|
|
|
+ </if>
|
|
|
+ <if test="deviceId != null">
|
|
|
+ #{deviceId},
|
|
|
+ </if>
|
|
|
+ <if test="measuringId != null">
|
|
|
+ #{measuringId},
|
|
|
+ </if>
|
|
|
+ <if test="alarmTypeId != null">
|
|
|
+ #{alarmTypeId},
|
|
|
+ </if>
|
|
|
+ <if test="alarmTime != null">
|
|
|
+ #{alarmTime},
|
|
|
+ </if>
|
|
|
+ <if test="lastAlarmTime != null">
|
|
|
+ #{lastAlarmTime},
|
|
|
+ </if>
|
|
|
+ <if test="alarmCount != null">
|
|
|
+ #{alarmCount},
|
|
|
+ </if>
|
|
|
+ <if test="handleStatus != null">
|
|
|
+ #{handleStatus},
|
|
|
+ </if>
|
|
|
+ <if test="handleResult != null">
|
|
|
+ #{handleResult},
|
|
|
+ </if>
|
|
|
+ <if test="measuringData != null">
|
|
|
+ #{measuringData},
|
|
|
+ </if>
|
|
|
+ <if test="status != null">
|
|
|
+ #{status},
|
|
|
+ </if>
|
|
|
+ <if test="createBy != null">
|
|
|
+ #{createBy},
|
|
|
+ </if>
|
|
|
+ <if test="updateBy != null">
|
|
|
+ #{updateBy},
|
|
|
+ </if>
|
|
|
+ <if test="createDate != null">
|
|
|
+ #{createDate},
|
|
|
+ </if>
|
|
|
+ <if test="updateDate != null">
|
|
|
+ #{updateDate},
|
|
|
+ </if>
|
|
|
+ </trim>
|
|
|
+ </insert>
|
|
|
+ <update id="updateByPrimaryKeySelective" parameterType="com.zcxk.rmcp.core.entity.DeviceAlarm">
|
|
|
+ <!--@mbg.generated-->
|
|
|
+ update rmcp_device_alarm
|
|
|
+ <set>
|
|
|
+ <if test="tenantId != null">
|
|
|
+ tenant_id = #{tenantId},
|
|
|
+ </if>
|
|
|
+ <if test="deviceId != null">
|
|
|
+ device_id = #{deviceId},
|
|
|
+ </if>
|
|
|
+ <if test="measuringId != null">
|
|
|
+ measuring_id = #{measuringId},
|
|
|
+ </if>
|
|
|
+ <if test="alarmTypeId != null">
|
|
|
+ alarm_type_id = #{alarmTypeId},
|
|
|
+ </if>
|
|
|
+ <if test="alarmTime != null">
|
|
|
+ alarm_time = #{alarmTime},
|
|
|
+ </if>
|
|
|
+ <if test="lastAlarmTime != null">
|
|
|
+ last_alarm_time = #{lastAlarmTime},
|
|
|
+ </if>
|
|
|
+ <if test="alarmCount != null">
|
|
|
+ alarm_count = #{alarmCount},
|
|
|
+ </if>
|
|
|
+ <if test="handleStatus != null">
|
|
|
+ handle_status = #{handleStatus},
|
|
|
+ </if>
|
|
|
+ <if test="handleResult != null">
|
|
|
+ handle_result = #{handleResult},
|
|
|
+ </if>
|
|
|
+ <if test="measuringData != null">
|
|
|
+ measuring_data = #{measuringData},
|
|
|
+ </if>
|
|
|
+ <if test="status != null">
|
|
|
+ `status` = #{status},
|
|
|
+ </if>
|
|
|
+ <if test="createBy != null">
|
|
|
+ create_by = #{createBy},
|
|
|
+ </if>
|
|
|
+ <if test="updateBy != null">
|
|
|
+ update_by = #{updateBy},
|
|
|
+ </if>
|
|
|
+ <if test="createDate != null">
|
|
|
+ create_date = #{createDate},
|
|
|
+ </if>
|
|
|
+ <if test="updateDate != null">
|
|
|
+ update_date = #{updateDate},
|
|
|
+ </if>
|
|
|
+ </set>
|
|
|
+ where id = #{id}
|
|
|
+ </update>
|
|
|
+ <insert id="batchInsert" keyColumn="id" keyProperty="id" parameterType="map" useGeneratedKeys="true">
|
|
|
+ <!--@mbg.generated-->
|
|
|
+ insert into rmcp_device_alarm
|
|
|
+ (tenant_id, device_id, measuring_id, alarm_type_id, alarm_time, last_alarm_time,
|
|
|
+ alarm_count, handle_status, handle_result, measuring_data, `status`, create_by,
|
|
|
+ update_by, create_date, update_date)
|
|
|
+ values
|
|
|
+ <foreach collection="list" item="item" separator=",">
|
|
|
+ (#{item.tenantId}, #{item.deviceId}, #{item.measuringId}, #{item.alarmTypeId}, #{item.alarmTime},
|
|
|
+ #{item.lastAlarmTime}, #{item.alarmCount}, #{item.handleStatus}, #{item.handleResult},
|
|
|
+ #{item.measuringData}, #{item.status}, #{item.createBy}, #{item.updateBy}, #{item.createDate},
|
|
|
+ #{item.updateDate})
|
|
|
+ </foreach>
|
|
|
+ </insert>
|
|
|
+</mapper>
|