| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131 |
- <?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.IotSfElementfactorMapper">
- <update id="updateIotSfElementfactor" parameterType="IotSfElementfactor">
- UPDATE IotSfElementfactor
- <set>
- <if test="sfDisplayname!= null and sfDisplayname!= ''">sfDisplayname = #{sfDisplayname},</if>
- <if test="sfSequence != null">sfSequence = #{sfSequence},</if>
- <if test="sfLng!= null and sfLng!= ''">sfLng = #{sfLng},</if>
- <if test="sfLat!= null and sfLat!= ''">sfLat = #{sfLat},</if>
- <if test="sfAddress != null and sfAddress!= ''">sfAddress = #{sfAddress},</if>
- <if test="sfModifieddate!= null and sfModifieddate!= ''">sfModifieddate = #{sfModifieddate},</if>
- <if test="sfModifier!= null and sfModifier!= ''">sfModifier = #{sfModifier},</if>
- </set>
- WHERE sfBid = #{sfBid}
- </update>
- <update id="batchUpdateIotSfElementfactor" parameterType="IotSfElementfactor">
- <foreach collection="list" item="item" index="index" separator=";">
- UPDATE IotSfElementfactor
- <set>
- <if test="item.sfDisplayname!= null and item.sfDisplayname!= ''">sfDisplayname = #{item.sfDisplayname},</if>
- <if test="item.sfSequence!= null">sfSequence = #{item.sfSequence},</if>
- <if test="item.sfLng!= null and item.sfLng!= ''">sfLng = #{item.sfLng},</if>
- <if test="item.sfLat!= null and item.sfLat!= ''">sfLat = #{item.sfLat},</if>
- <if test="item.sfAddress!= null and item.sfAddress!= ''">sfAddress = #{item.sfAddress},</if>
- <if test="item.sfModifieddate!= null and item.sfModifieddate!= ''">sfModifieddate = #{item.sfModifieddate},</if>
- <if test="item.sfModifier!= null and item.sfModifier!= ''">sfModifier = #{item.sfModifier},</if>
- </set>
- WHERE sfBid = #{item.sfBid}
- </foreach>
- </update>
- <select id="selectIotSfElementfactorList" parameterType="com.yunfeiyun.agmp.iotm.device.sf.domain.IotSfElementfactorListReqVo"
- resultType="com.yunfeiyun.agmp.iot.common.domain.IotSfElementfactor" >
- SELECT sf.id, sf.sfBid, sf.devBid, sf.sfType, sf.sfCode, sf.sfName, sf.sfDisplayname, sf.sfParentBid, sf.sfSequence,
- sf.tid, sf.sfCreatedDate, sf.sfCreator, sf.sfModifieddate, sf.sfModifier, sf.sfLng, sf.sfLat, sf.sfAddress
- FROM IotSfElementfactor AS sf
- <where>
- sf.tid = #{tid}
- <if test="sfBid!= null and sfBid!= ''"> and sf.sfBid = #{sfBid}</if>
- <if test="sfType!= null and sfType!= ''"> and sf.sfType = #{sfType}</if>
- <if test="devBid != null and devBid != ''"> and sf.devBid = #{devBid}</if>
- <if test="sfCode!= null and sfCode!= ''"> and sf.sfCode = #{sfCode}</if>
- <if test="sfName!= null and sfName!= ''"> and sf.sfName like concat('%', #{sfName}, '%')</if>
- <if test="sfDisplayname!= null and sfDisplayname!= ''"> and sf.sfDisplayname like concat('%', #{sfDisplayname}, '%')</if>
- <if test="sfParentBid!= null and sfParentBid!= ''"> and sf.sfParentBid = #{sfParentBid}</if>
- <if test="sfSequence!= null and sfSequence!= ''"> and sf.sfSequence = #{sfSequence}</if>
- <if test="sfCreatedDate!= null and sfCreatedDate!= ''"> and sf.sfCreatedDate = #{sfCreatedDate}</if>
- <if test="sfCreator!= null and sfCreator!= ''"> and sf.sfCreator = #{sfCreator}</if>
- <if test="sfModifieddate!= null and sfModifieddate!= ''"> and sf.sfModifieddate = #{sfModifieddate}</if>
- <if test="sfModifier!= null and sfModifier!= ''"> and sf.sfModifier = #{sfModifier}</if>
- <if test="sfTypeList != null and sfTypeList.size() > 0">
- and sf.sfType in
- <foreach collection="sfTypeList" item="item" index="index" open="(" separator="," close=")">
- #{item}
- </foreach>
- </if>
- <if test="sfBidList != null and sfBidList.size() > 0">
- and sf.sfBid in
- <foreach collection="sfBidList" item="item" index="index" open="(" separator="," close=")">
- #{item}
- </foreach>
- </if>
- </where>
- ORDER BY sf.sfSequence ASC, sf.sfModifieddate DESC
- </select>
- <select id="selectIotSfElementfactorBySfBid" resultType="com.yunfeiyun.agmp.iot.common.domain.IotSfElementfactor" parameterType="string">
- SELECT sf.id, sf.sfBid, sf.devBid, sf.sfType, sf.sfCode, sf.sfName, sf.sfDisplayname, sf.sfParentBid, sf.sfSequence,
- sf.tid, sf.sfCreatedDate, sf.sfCreator, sf.sfModifieddate, sf.sfModifier, sf.sfLng, sf.sfLat, sf.sfAddress
- FROM IotSfElementfactor AS sf
- where sf.sfBid = #{sfBid}
- </select>
- <select id="getAlreadyElementByBid" parameterType="string"
- resultType="IotSfElementfactor">
- SELECT sf.id, sf.sfBid, sf.devBid, sf.sfType, sf.sfCode, sf.sfName, sf.sfDisplayname, sf.sfParentBid, sf.sfSequence,
- sf.tid, sf.sfCreatedDate, sf.sfCreator, sf.sfModifieddate, sf.sfModifier, sf.sfLng, sf.sfLat, sf.sfAddress
- FROM IotSfElementfactor AS sf
- where sf.sfBid = #{sfBid} or sf.sfParentBid = #{sfBid}
- </select>
- <insert id="batchInsertIotSfElementfactor" parameterType="IotSfElementfactor">
- <foreach collection="list" item="item" index="index" separator=";">
- INSERT INTO IotSfElementfactor
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="item.sfBid!= null and item.sfBid!= ''">sfBid,</if>
- <if test="item.devBid!= null and item.devBid!= ''">devBid,</if>
- <if test="item.sfType!= null and item.sfType!= ''">sfType,</if>
- <if test="item.sfCode!= null and item.sfCode!= ''">sfCode,</if>
- <if test="item.sfName!= null and item.sfName!= ''">sfName,</if>
- <if test="item.sfDisplayname!= null and item.sfDisplayname!= ''">sfDisplayname,</if>
- <if test="item.sfParentBid!= null and item.sfParentBid!= ''">sfParentBid,</if>
- <if test="item.sfSequence!= null">sfSequence,</if>
- <if test="item.tid!= null and item.tid!= ''">tid,</if>
- <if test="item.sfCreatedDate!= null and item.sfCreatedDate!= ''">sfCreatedDate,</if>
- <if test="item.sfCreator!= null and item.sfCreator!= ''">sfCreator,</if>
- <if test="item.sfModifieddate!= null and item.sfModifieddate!= ''">sfModifieddate,</if>
- <if test="item.sfModifier!= null and item.sfModifier!= ''">sfModifier,</if>
- <if test="item.sfLng!= null and item.sfLng!= ''">sfLng,</if>
- <if test="item.sfLat!= null and item.sfLat!= ''">sfLat,</if>
- <if test="item.sfAddress!= null and item.sfAddress!= ''">sfAddress,</if>
- </trim>
- <trim prefix="VALUES (" suffix=")" suffixOverrides=",">
- <if test="item.sfBid!= null and item.sfBid!= ''">#{item.sfBid},</if>
- <if test="item.devBid!= null and item.devBid!= ''">#{item.devBid},</if>
- <if test="item.sfType!= null and item.sfType!= ''">#{item.sfType},</if>
- <if test="item.sfCode!= null and item.sfCode!= ''">#{item.sfCode},</if>
- <if test="item.sfName!= null and item.sfName!= ''">#{item.sfName},</if>
- <if test="item.sfDisplayname!= null and item.sfDisplayname!= ''">#{item.sfDisplayname},</if>
- <if test="item.sfParentBid!= null and item.sfParentBid!= ''">#{item.sfParentBid},</if>
- <if test="item.sfSequence!= null">#{item.sfSequence},</if>
- <if test="item.tid!= null and item.tid!= ''">#{item.tid},</if>
- <if test="item.sfCreatedDate!= null and item.sfCreatedDate!= ''">#{item.sfCreatedDate},</if>
- <if test="item.sfCreator!= null and item.sfCreator!= ''">#{item.sfCreator},</if>
- <if test="item.sfModifieddate!= null and item.sfModifieddate!= ''">#{item.sfModifieddate},</if>
- <if test="item.sfModifier!= null and item.sfModifier!= ''">#{item.sfModifier},</if>
- <if test="item.sfLng!= null and item.sfLng!= ''">#{item.sfLng},</if>
- <if test="item.sfLat!= null and item.sfLat!= ''">#{item.sfLat},</if>
- <if test="item.sfAddress!= null and item.sfAddress!= ''">#{item.sfAddress},</if>
- </trim>
- </foreach>
- </insert>
- <delete id="deleteIotSfElementfactorBySfBid" parameterType="string">
- DELETE FROM IotSfElementfactor WHERE sfBid = #{sfBid} OR sfParentBid = #{sfBid}
- </delete>
- </mapper>
|