1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495 |
- <?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.usky.iot.mapper.BaseAlarmMapper">
- <!-- 通用查询映射结果 -->
- <resultMap id="BaseResultMap" type="com.usky.iot.domain.BaseAlarm">
- <id column="id" property="id" />
- <result column="device_id" property="deviceId" />
- <result column="alarm_time" property="alarmTime" />
- <result column="alarm_type" property="alarmType" />
- <result column="alarm_object" property="alarmObject" />
- <result column="alarm_data" property="alarmData" />
- <result column="alarm_attribute" property="alarmAttribute" />
- <result column="alarm_content" property="alarmContent" />
- <result column="alarm_grade" property="alarmGrade" />
- <result column="alarm_address" property="alarmAddress" />
- <result column="handle_by" property="handleBy" />
- <result column="handle_time" property="handleTime" />
- <result column="handle_content" property="handleContent" />
- <result column="handle_phone" property="handlePhone" />
- <result column="handle_status" property="handleStatus" />
- <result column="alarm_false" property="alarmFalse" />
- <result column="site_photo" property="sitePhoto" />
- <result column="dept_id" property="deptId" />
- <result column="tenant_id" property="tenantId" />
- </resultMap>
- <select id="getAlarmTypeOne" resultType="com.usky.iot.domain.BaseAlarmType">
- select
- *
- from base_alarm_type
- <where>
- <if test="alarmType != null">
- and type_code = #{alarmType}
- </if>
- <if test="1 == 1">
- and delete_flag = 0
- </if>
- </where>
- </select>
- <select id="getAlarmTypeList" resultType="com.usky.iot.domain.BaseAlarmType">
- select
- *
- from base_alarm_type
- <where>
- <if test="1 == 1">
- and delete_flag = 0
- </if>
- </where>
- </select>
- <select id="getDeviceInfoList" resultType="com.usky.iot.domain.DmpDeviceInfo">
- select ddi.*
- from dmp_device ddi
- <where>
- <if test="1 == 1">
- and delete_flag = 0
- </if>
- <if test="1 == 1">
- and device_id in
- <foreach item="item" collection="devList" open="(" separator="," close=")">
- #{item}
- </foreach>
- </if>
- </where>
- </select>
- <select id="getUnDeviceAlarmList" resultType="com.usky.iot.domain.BaseAlarm">
- select distinct device_id as deviceId,product_code as productCode
- from base_alarm ddi
- <where>
- <if test="1 == 1">
- and handle_status = 0
- </if>
- <if test="1 == 1">
- and device_id in
- <foreach item="item" collection="devList" open="(" separator="," close=")">
- #{item}
- </foreach>
- </if>
- </where>
- </select>
- <select id="getDeviceAlarmList" resultType="com.usky.iot.domain.BaseAlarm">
- select distinct device_id as deviceId,product_code as productCode
- from base_alarm ddi
- <where>
- <if test="1 == 1">
- and handle_status = 1
- </if>
- <if test="1 == 1">
- and device_id in
- <foreach item="item" collection="devList" open="(" separator="," close=")">
- #{item}
- </foreach>
- </if>
- </where>
- </select>
- </mapper>
|