|
|
@@ -0,0 +1,152 @@
|
|
|
+<?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.ufo.project.config.mapper.ConfigPointMapper">
|
|
|
+
|
|
|
+ <resultMap type="ConfigPoint" id="ConfigPointResult">
|
|
|
+ <result property="id" column="id" />
|
|
|
+ <result property="name" column="name" />
|
|
|
+ <result property="code" column="code" />
|
|
|
+ <result property="addr" column="addr" />
|
|
|
+ <result property="category" column="category" />
|
|
|
+ <result property="configDeviceId" column="config_device_id" />
|
|
|
+ <result property="initValue" column="init_value" />
|
|
|
+ <result property="willInverse" column="will_inverse" />
|
|
|
+ <result property="kbComposite" column="kb_composite" />
|
|
|
+ <result property="k" column="k" />
|
|
|
+ <result property="b" column="b" />
|
|
|
+ <result property="zeroFilter" column="zero_filter" />
|
|
|
+ <result property="willCheckUd" column="will_check_ud" />
|
|
|
+ <result property="up1" column="up1" />
|
|
|
+ <result property="up2" column="up2" />
|
|
|
+ <result property="down1" column="down1" />
|
|
|
+ <result property="down2" column="down2" />
|
|
|
+ <result property="hopFilter" column="hop_filter" />
|
|
|
+ <result property="lazyTm" column="lazy_tm" />
|
|
|
+ <result property="configAlarmTemplateId" column="config_alarm_template_id" />
|
|
|
+ <result property="createTime" column="create_time" />
|
|
|
+ <result property="updateTime" column="update_time" />
|
|
|
+ <result property="createBy" column="create_by" />
|
|
|
+ <result property="updateBy" column="update_by" />
|
|
|
+ </resultMap>
|
|
|
+
|
|
|
+ <sql id="selectConfigPointVo">
|
|
|
+ select id, name, code, addr, category, config_device_id, init_value, will_inverse, kb_composite, k, b, zero_filter, will_check_ud, up1, up2, down1, down2, hop_filter, lazy_tm, config_alarm_template_id, create_time, update_time, create_by, update_by from config_point
|
|
|
+ </sql>
|
|
|
+
|
|
|
+ <select id="selectConfigPointList" parameterType="ConfigPoint" resultMap="ConfigPointResult">
|
|
|
+ <include refid="selectConfigPointVo"/>
|
|
|
+ <where>
|
|
|
+ <if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
|
|
|
+ <if test="code != null and code != ''"> and code = #{code}</if>
|
|
|
+ <if test="addr != null"> and addr = #{addr}</if>
|
|
|
+ <if test="category != null and category != ''"> and category = #{category}</if>
|
|
|
+ <if test="configDeviceId != null"> and config_device_id = #{configDeviceId}</if>
|
|
|
+ <if test="kbComposite != null and kbComposite != ''"> and kb_composite = #{kbComposite}</if>
|
|
|
+ <if test="willCheckUd != null and willCheckUd != ''"> and will_check_ud = #{willCheckUd}</if>
|
|
|
+ </where>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="selectConfigPointById" parameterType="Long" resultMap="ConfigPointResult">
|
|
|
+ <include refid="selectConfigPointVo"/>
|
|
|
+ where id = #{id}
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <insert id="insertConfigPoint" parameterType="ConfigPoint">
|
|
|
+ insert into config_point
|
|
|
+ <trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="id != null">id,</if>
|
|
|
+ <if test="name != null and name != ''">name,</if>
|
|
|
+ <if test="code != null and code != ''">code,</if>
|
|
|
+ <if test="addr != null">addr,</if>
|
|
|
+ <if test="category != null and category != ''">category,</if>
|
|
|
+ <if test="configDeviceId != null">config_device_id,</if>
|
|
|
+ <if test="initValue != null and initValue != ''">init_value,</if>
|
|
|
+ <if test="willInverse != null and willInverse != ''">will_inverse,</if>
|
|
|
+ <if test="kbComposite != null and kbComposite != ''">kb_composite,</if>
|
|
|
+ <if test="k != null">k,</if>
|
|
|
+ <if test="b != null">b,</if>
|
|
|
+ <if test="zeroFilter != null">zero_filter,</if>
|
|
|
+ <if test="willCheckUd != null and willCheckUd != ''">will_check_ud,</if>
|
|
|
+ <if test="up1 != null">up1,</if>
|
|
|
+ <if test="up2 != null">up2,</if>
|
|
|
+ <if test="down1 != null">down1,</if>
|
|
|
+ <if test="down2 != null">down2,</if>
|
|
|
+ <if test="hopFilter != null">hop_filter,</if>
|
|
|
+ <if test="lazyTm != null">lazy_tm,</if>
|
|
|
+ <if test="configAlarmTemplateId != null">config_alarm_template_id,</if>
|
|
|
+ <if test="createTime != null">create_time,</if>
|
|
|
+ <if test="updateTime != null">update_time,</if>
|
|
|
+ <if test="createBy != null and createBy != ''">create_by,</if>
|
|
|
+ <if test="updateBy != null and updateBy != ''">update_by,</if>
|
|
|
+ </trim>
|
|
|
+ <trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="id != null">#{id},</if>
|
|
|
+ <if test="name != null and name != ''">#{name},</if>
|
|
|
+ <if test="code != null and code != ''">#{code},</if>
|
|
|
+ <if test="addr != null">#{addr},</if>
|
|
|
+ <if test="category != null and category != ''">#{category},</if>
|
|
|
+ <if test="configDeviceId != null">#{configDeviceId},</if>
|
|
|
+ <if test="initValue != null and initValue != ''">#{initValue},</if>
|
|
|
+ <if test="willInverse != null and willInverse != ''">#{willInverse},</if>
|
|
|
+ <if test="kbComposite != null and kbComposite != ''">#{kbComposite},</if>
|
|
|
+ <if test="k != null">#{k},</if>
|
|
|
+ <if test="b != null">#{b},</if>
|
|
|
+ <if test="zeroFilter != null">#{zeroFilter},</if>
|
|
|
+ <if test="willCheckUd != null and willCheckUd != ''">#{willCheckUd},</if>
|
|
|
+ <if test="up1 != null">#{up1},</if>
|
|
|
+ <if test="up2 != null">#{up2},</if>
|
|
|
+ <if test="down1 != null">#{down1},</if>
|
|
|
+ <if test="down2 != null">#{down2},</if>
|
|
|
+ <if test="hopFilter != null">#{hopFilter},</if>
|
|
|
+ <if test="lazyTm != null">#{lazyTm},</if>
|
|
|
+ <if test="configAlarmTemplateId != null">#{configAlarmTemplateId},</if>
|
|
|
+ <if test="createTime != null">#{createTime},</if>
|
|
|
+ <if test="updateTime != null">#{updateTime},</if>
|
|
|
+ <if test="createBy != null and createBy != ''">#{createBy},</if>
|
|
|
+ <if test="updateBy != null and updateBy != ''">#{updateBy},</if>
|
|
|
+ </trim>
|
|
|
+ </insert>
|
|
|
+
|
|
|
+ <update id="updateConfigPoint" parameterType="ConfigPoint">
|
|
|
+ update config_point
|
|
|
+ <trim prefix="SET" suffixOverrides=",">
|
|
|
+ <if test="name != null and name != ''">name = #{name},</if>
|
|
|
+ <if test="code != null and code != ''">code = #{code},</if>
|
|
|
+ <if test="addr != null">addr = #{addr},</if>
|
|
|
+ <if test="category != null and category != ''">category = #{category},</if>
|
|
|
+ <if test="configDeviceId != null">config_device_id = #{configDeviceId},</if>
|
|
|
+ <if test="initValue != null and initValue != ''">init_value = #{initValue},</if>
|
|
|
+ <if test="willInverse != null and willInverse != ''">will_inverse = #{willInverse},</if>
|
|
|
+ <if test="kbComposite != null and kbComposite != ''">kb_composite = #{kbComposite},</if>
|
|
|
+ <if test="k != null">k = #{k},</if>
|
|
|
+ <if test="b != null">b = #{b},</if>
|
|
|
+ <if test="zeroFilter != null">zero_filter = #{zeroFilter},</if>
|
|
|
+ <if test="willCheckUd != null and willCheckUd != ''">will_check_ud = #{willCheckUd},</if>
|
|
|
+ <if test="up1 != null">up1 = #{up1},</if>
|
|
|
+ <if test="up2 != null">up2 = #{up2},</if>
|
|
|
+ <if test="down1 != null">down1 = #{down1},</if>
|
|
|
+ <if test="down2 != null">down2 = #{down2},</if>
|
|
|
+ <if test="hopFilter != null">hop_filter = #{hopFilter},</if>
|
|
|
+ <if test="lazyTm != null">lazy_tm = #{lazyTm},</if>
|
|
|
+ <if test="configAlarmTemplateId != null">config_alarm_template_id = #{configAlarmTemplateId},</if>
|
|
|
+ <if test="createTime != null">create_time = #{createTime},</if>
|
|
|
+ <if test="updateTime != null">update_time = #{updateTime},</if>
|
|
|
+ <if test="createBy != null and createBy != ''">create_by = #{createBy},</if>
|
|
|
+ <if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
|
|
|
+ </trim>
|
|
|
+ where id = #{id}
|
|
|
+ </update>
|
|
|
+
|
|
|
+ <delete id="deleteConfigPointById" parameterType="Long">
|
|
|
+ delete from config_point where id = #{id}
|
|
|
+ </delete>
|
|
|
+
|
|
|
+ <delete id="deleteConfigPointByIds" parameterType="Long">
|
|
|
+ delete from config_point where id in
|
|
|
+ <foreach item="id" collection="array" open="(" separator="," close=")">
|
|
|
+ #{id}
|
|
|
+ </foreach>
|
|
|
+ </delete>
|
|
|
+</mapper>
|