|
|
@@ -0,0 +1,109 @@
|
|
|
+<?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.yunfeiyun.agmp.iotm.web.mapper.IotDevicefactorMapper">
|
|
|
+
|
|
|
+ <resultMap type="IotDevicefactor" id="IotDevicefactorResult">
|
|
|
+ <result property="id" column="id" />
|
|
|
+ <result property="dfBid" column="dfBid" />
|
|
|
+ <result property="devBid" column="devBid" />
|
|
|
+ <result property="dfCode" column="dfCode" />
|
|
|
+ <result property="dfAddress" column="dfAddress" />
|
|
|
+ <result property="dfName" column="dfName" />
|
|
|
+ <result property="dfDisplayname" column="dfDisplayname" />
|
|
|
+ <result property="dfDisable" column="dfDisable" />
|
|
|
+ <result property="dfCreatedDate" column="dfCreatedDate" />
|
|
|
+ <result property="dfCreator" column="dfCreator" />
|
|
|
+ <result property="dfModifieddate" column="dfModifieddate" />
|
|
|
+ <result property="dfModifier" column="dfModifier" />
|
|
|
+ </resultMap>
|
|
|
+
|
|
|
+ <sql id="selectIotDevicefactorVo">
|
|
|
+ select id, dfBid, devBid, dfCode,dfAddress, dfName, dfDisplayname, dfDisable, dfCreatedDate, dfCreator, dfModifieddate, dfModifier from IotDevicefactor
|
|
|
+ </sql>
|
|
|
+
|
|
|
+ <select id="selectIotDevicefactorList" parameterType="IotDevicefactor" resultMap="IotDevicefactorResult">
|
|
|
+ <include refid="selectIotDevicefactorVo"/>
|
|
|
+ <where>
|
|
|
+ tid = #{tid}
|
|
|
+ <if test="dfBid != null and dfBid != ''"> and dfBid = #{dfBid}</if>
|
|
|
+ <if test="devBid != null and devBid != ''"> and devBid = #{devBid}</if>
|
|
|
+ <if test="dfCode != null and dfCode != ''"> and dfCode = #{dfCode}</if>
|
|
|
+ <if test="dfAddress != null and dfAddress != ''"> and dfAddress = #{dfAddress}</if>
|
|
|
+ <if test="dfName != null and dfName != ''"> and dfName like concat('%', #{dfName}, '%')</if>
|
|
|
+ <if test="dfDisplayname != null and dfDisplayname != ''"> and dfDisplayname like concat('%', #{dfDisplayname}, '%')</if>
|
|
|
+ <if test="dfCreatedDate != null and dfCreatedDate != ''"> and dfCreatedDate = #{dfCreatedDate}</if>
|
|
|
+ <if test="dfCreator != null and dfCreator != ''"> and dfCreator = #{dfCreator}</if>
|
|
|
+ <if test="dfModifieddate != null and dfModifieddate != ''"> and dfModifieddate = #{dfModifieddate}</if>
|
|
|
+ <if test="dfModifier != null and dfModifier != ''"> and dfModifier = #{dfModifier}</if>
|
|
|
+ </where>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="selectIotDevicefactorById" parameterType="Long" resultMap="IotDevicefactorResult">
|
|
|
+ <include refid="selectIotDevicefactorVo"/>
|
|
|
+ where id = #{id}
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <insert id="insertIotDevicefactor" parameterType="IotDevicefactor" useGeneratedKeys="true" keyProperty="id">
|
|
|
+ insert into IotDevicefactor
|
|
|
+ <trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="dfBid != null">dfBid,</if>
|
|
|
+ <if test="devBid != null">devBid,</if>
|
|
|
+ <if test="dfCode != null">dfCode,</if>
|
|
|
+ <if test="dfAddress != null">dfAddress,</if>
|
|
|
+ <if test="dfName != null">dfName,</if>
|
|
|
+ <if test="dfDisplayname != null">dfDisplayname,</if>
|
|
|
+ <if test="dfDisable != null">dfDisable,</if>
|
|
|
+ <if test="dfCreatedDate != null">dfCreatedDate,</if>
|
|
|
+ <if test="dfCreator != null">dfCreator,</if>
|
|
|
+ <if test="dfModifieddate != null">dfModifieddate,</if>
|
|
|
+ <if test="dfModifier != null">dfModifier,</if>
|
|
|
+ </trim>
|
|
|
+ <trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="dfBid != null">#{dfBid},</if>
|
|
|
+ <if test="devBid != null">#{devBid},</if>
|
|
|
+ <if test="dfCode != null">#{dfCode},</if>
|
|
|
+ <if test="dfAddress != null">#{dfAddress},</if>
|
|
|
+ <if test="dfName != null">#{dfName},</if>
|
|
|
+ <if test="dfDisplayname != null">#{dfDisplayname},</if>
|
|
|
+ <if test="dfDisable != null">#{dfDisable},</if>
|
|
|
+ <if test="dfCreatedDate != null">#{dfCreatedDate},</if>
|
|
|
+ <if test="dfCreator != null">#{dfCreator},</if>
|
|
|
+ <if test="dfModifieddate != null">#{dfModifieddate},</if>
|
|
|
+ <if test="dfModifier != null">#{dfModifier},</if>
|
|
|
+ </trim>
|
|
|
+ </insert>
|
|
|
+
|
|
|
+ <update id="updateIotDevicefactor" parameterType="IotDevicefactor">
|
|
|
+ update IotDevicefactor
|
|
|
+ <trim prefix="SET" suffixOverrides=",">
|
|
|
+ <if test="dfBid != null">dfBid = #{dfBid},</if>
|
|
|
+ <if test="devBid != null">devBid = #{devBid},</if>
|
|
|
+ <if test="dfCode != null">dfCode = #{dfCode},</if>
|
|
|
+ <if test="dfAddress != null">dfAddress = #{dfAddress},</if>
|
|
|
+ <if test="dfName != null">dfName = #{dfName},</if>
|
|
|
+ <if test="dfDisplayname != null">dfDisplayname = #{dfDisplayname},</if>
|
|
|
+ <if test="dfCreatedDate != null">dfCreatedDate = #{dfCreatedDate},</if>
|
|
|
+ <if test="dfCreator != null">dfCreator = #{dfCreator},</if>
|
|
|
+ <if test="dfModifieddate != null">dfModifieddate = #{dfModifieddate},</if>
|
|
|
+ <if test="dfModifier != null">dfModifier = #{dfModifier},</if>
|
|
|
+ </trim>
|
|
|
+ where id = #{id}
|
|
|
+ </update>
|
|
|
+
|
|
|
+ <delete id="deleteIotDevicefactorById" parameterType="Long">
|
|
|
+ delete from IotDevicefactor where id = #{id}
|
|
|
+ </delete>
|
|
|
+
|
|
|
+ <delete id="deleteIotDevicefactorByDevBid" parameterType="String">
|
|
|
+ delete from IotDevicefactor where devBid = #{devBid}
|
|
|
+ </delete>
|
|
|
+
|
|
|
+ <delete id="deleteIotDevicefactorByIds" parameterType="String">
|
|
|
+ delete from IotDevicefactor where id in
|
|
|
+ <foreach item="id" collection="array" open="(" separator="," close=")">
|
|
|
+ #{id}
|
|
|
+ </foreach>
|
|
|
+ </delete>
|
|
|
+</mapper>
|