IotSfElementfactorMapper.xml 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <!DOCTYPE mapper
  3. PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  4. "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  5. <mapper namespace="com.yunfeiyun.agmp.iotm.web.mapper.IotSfElementfactorMapper">
  6. <select id="selectIotSfElementfactorList" parameterType="com.yunfeiyun.agmp.iotm.device.sf.domain.IotSfElementfactorListReqVo"
  7. resultType="com.yunfeiyun.agmp.iot.common.domain.IotSfElementfactor" >
  8. SELECT sf.id, sf.sfBid, sf.sfType, sf.sfCode, sf.sfName, sf.sfDisplayname, sf.sfParentBid, sf.sfSequence,
  9. sf.tid, sf.sfCreatedDate, sf.sfCreator, sf.sfModifieddate, sf.sfModifier
  10. FROM IotSfElementfactor AS sf
  11. <where>
  12. tid = #{tid}
  13. <if test="sfBid!= null and sfBid!= ''"> and sf.sfBid = #{sfBid}</if>
  14. <if test="sfType!= null and sfType!= ''"> and sf.sfType = #{sfType}</if>
  15. <if test="sfCode!= null and sfCode!= ''"> and sf.sfCode = #{sfCode}</if>
  16. <if test="sfName!= null and sfName!= ''"> and sf.sfName like concat('%', #{sfName}, '%')</if>
  17. <if test="sfDisplayname!= null and sfDisplayname!= ''"> and sf.sfDisplayname like concat('%', #{sfDisplayname}, '%')</if>
  18. <if test="sfParentBid!= null and sfParentBid!= ''"> and sf.sfParentBid = #{sfParentBid}</if>
  19. <if test="sfSequence!= null and sfSequence!= ''"> and sf.sfSequence = #{sfSequence}</if>
  20. <if test="tid!= null and tid!= ''"> and sf.tid = #{tid}</if>
  21. <if test="sfCreatedDate!= null and sfCreatedDate!= ''"> and sf.sfCreatedDate = #{sfCreatedDate}</if>
  22. <if test="sfCreator!= null and sfCreator!= ''"> and sf.sfCreator = #{sfCreator}</if>
  23. <if test="sfModifieddate!= null and sfModifieddate!= ''"> and sf.sfModifieddate = #{sfModifieddate}</if>
  24. <if test="sfModifier!= null and sfModifier!= ''"> and sf.sfModifier = #{sfModifier}</if>
  25. <if test="sfTypeList != null and sfTypeList.size() > 0">
  26. and sf.sfType in
  27. <foreach collection="sfTypeList" item="item" index="index" open="(" separator="," close=")">
  28. #{item}
  29. </foreach>
  30. </if>
  31. </where>
  32. </select>
  33. <insert id="batchInsertIotSfElementfactor">
  34. INSERT INTO IotSfElementfactor (id, sfBid, devBid, sfType, sfCode, sfName, sfDisplayname, sfParentBid, sfSequence,
  35. tid, sfCreatedDate, sfCreator, sfModifieddate, sfModifier)
  36. VALUES
  37. <foreach collection="list" item="item" index="index" separator=",">
  38. (#{item.id}, #{item.sfBid}, #{item.devBid}, #{item.sfType}, #{item.sfCode}, #{item.sfName}, #{item.sfDisplayname}, #{item.sfParentBid}, #{item.sfSequence},
  39. #{item.tid}, #{item.sfCreatedDate}, #{item.sfCreator}, #{item.sfModifieddate}, #{item.sfModifier})
  40. </foreach>
  41. </insert>
  42. </mapper>