123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384 |
- <?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.smartcity.data.access.dao.DeviceAlarmRuleMapper">
- <!--auto generated Code-->
- <resultMap id="BaseResultMap" type="com.zcxk.smartcity.data.access.entity.DeviceAlarmRule">
- <result column="id" property="id" jdbcType="INTEGER"/>
- <result column="channel_id" property="channelId" jdbcType="INTEGER"/>
- <result column="site_id" property="siteId" jdbcType="INTEGER"/>
- <result column="rule_source" property="ruleSource" jdbcType="VARCHAR"/>
- <result column="device_type" property="deviceType" jdbcType="INTEGER"/>
- <result column="rule_name" property="ruleName" jdbcType="VARCHAR"/>
- <result column="measuring_code" property="measuringCode" jdbcType="VARCHAR"/>
- <result column="expression" property="expression" jdbcType="VARCHAR"/>
- <result column="alarm_type_id" property="alarmTypeId" jdbcType="INTEGER"/>
- <result column="measuring_data_type" property="measuringDataType" jdbcType="INTEGER"/>
- <result column="status" property="status" jdbcType="INTEGER"/>
- <result column="create_date" property="createDate" jdbcType="TIMESTAMP"/>
- <result column="create_by" property="createBy" jdbcType="VARCHAR"/>
- <result column="update_date" property="updateDate" jdbcType="TIMESTAMP"/>
- <result column="update_by" property="updateBy" jdbcType="VARCHAR"/>
- </resultMap>
- <sql id="where">
- <where>
- <if test="params.id != null">
- and id = #{params.id}
- </if>
- <if test="params.channelId != null ">
- and channel_id = #{params.channelId}
- </if>
- <if test="params.siteId != null">
- and site_id = #{params.siteId}
- </if>
- <if test="params.ruleSource != null and params.ruleSource != ''">
- and rule_source = #{params.ruleSource}
- </if>
- <if test="params.deviceType != null ">
- and device_type = #{params.deviceType}
- </if>
- <if test="params.status != null ">
- and status = #{params.status}
- </if>
- <if test="params.alarmTypeId != null ">
- and alarm_type_id = #{params.alarmTypeId}
- </if>
-
- </where>
- </sql>
- <!--auto generated Code-->
- <sql id="Base_Column_List">
- id,
- channel_id,
- site_id,
- rule_source,
- device_type,
- rule_name,
- measuring_code,
- expression,
- alarm_type_id,
- measuring_data_type,
- status,
- create_date,
- create_by,
- update_date,
- update_by
- </sql>
- <select id="findByAlarmTypeId" resultType="DeviceAlarmRule">
- select <include refid="Base_Column_List" /> from sc_device_alarm_rule
- where status = 1 and alarm_type_id = #{alarmTypeId}
- </select>
-
- <select id="singleQuery" resultType="DeviceAlarmRule">
- select <include refid="Base_Column_List" /> from sc_device_alarm_rule
- <include refid="where" />
- limit 1
- </select>
- <select id="list" resultType="DeviceAlarmRule">
- select <include refid="Base_Column_List" /> from sc_device_alarm_rule
- <include refid="where" />
- </select>
- </mapper>
|