IotSfElementfactorMapper.xml 8.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  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. <update id="updateIotSfElementfactor" parameterType="IotSfElementfactor">
  7. UPDATE IotSfElementfactor
  8. <set>
  9. <if test="sfDisplayname!= null and sfDisplayname!= ''">sfDisplayname = #{sfDisplayname},</if>
  10. <if test="sfSequence != null">sfSequence = #{sfSequence},</if>
  11. <if test="sfLng!= null and sfLng!= ''">sfLng = #{sfLng},</if>
  12. <if test="sfLat!= null and sfLat!= ''">sfLat = #{sfLat},</if>
  13. <if test="sfAddress != null and sfAddress!= ''">sfAddress = #{sfAddress},</if>
  14. <if test="sfModifieddate!= null and sfModifieddate!= ''">sfModifieddate = #{sfModifieddate},</if>
  15. <if test="sfModifier!= null and sfModifier!= ''">sfModifier = #{sfModifier},</if>
  16. </set>
  17. WHERE sfBid = #{sfBid}
  18. </update>
  19. <update id="batchUpdateIotSfElementfactor" parameterType="IotSfElementfactor">
  20. <foreach collection="list" item="item" index="index" separator=";">
  21. UPDATE IotSfElementfactor
  22. <set>
  23. <if test="item.sfDisplayname!= null and item.sfDisplayname!= ''">sfDisplayname = #{item.sfDisplayname},</if>
  24. <if test="item.sfSequence!= null">sfSequence = #{item.sfSequence},</if>
  25. <if test="item.sfLng!= null and item.sfLng!= ''">sfLng = #{item.sfLng},</if>
  26. <if test="item.sfLat!= null and item.sfLat!= ''">sfLat = #{item.sfLat},</if>
  27. <if test="item.sfAddress!= null and item.sfAddress!= ''">sfAddress = #{item.sfAddress},</if>
  28. <if test="item.sfModifieddate!= null and item.sfModifieddate!= ''">sfModifieddate = #{item.sfModifieddate},</if>
  29. <if test="item.sfModifier!= null and item.sfModifier!= ''">sfModifier = #{item.sfModifier},</if>
  30. </set>
  31. WHERE sfBid = #{item.sfBid}
  32. </foreach>
  33. </update>
  34. <select id="selectIotSfElementfactorList" parameterType="com.yunfeiyun.agmp.iotm.device.sf.domain.IotSfElementfactorListReqVo"
  35. resultType="com.yunfeiyun.agmp.iot.common.domain.IotSfElementfactor" >
  36. SELECT sf.id, sf.sfBid, sf.devBid, sf.sfType, sf.sfCode, sf.sfName, sf.sfDisplayname, sf.sfParentBid, sf.sfSequence,
  37. sf.tid, sf.sfCreatedDate, sf.sfCreator, sf.sfModifieddate, sf.sfModifier, sf.sfLng, sf.sfLat, sf.sfAddress
  38. FROM IotSfElementfactor AS sf
  39. <where>
  40. sf.tid = #{tid}
  41. <if test="sfBid!= null and sfBid!= ''"> and sf.sfBid = #{sfBid}</if>
  42. <if test="sfType!= null and sfType!= ''"> and sf.sfType = #{sfType}</if>
  43. <if test="devBid != null and devBid != ''"> and sf.devBid = #{devBid}</if>
  44. <if test="sfCode!= null and sfCode!= ''"> and sf.sfCode = #{sfCode}</if>
  45. <if test="sfName!= null and sfName!= ''"> and sf.sfName like concat('%', #{sfName}, '%')</if>
  46. <if test="sfDisplayname!= null and sfDisplayname!= ''"> and sf.sfDisplayname like concat('%', #{sfDisplayname}, '%')</if>
  47. <if test="sfParentBid!= null and sfParentBid!= ''"> and sf.sfParentBid = #{sfParentBid}</if>
  48. <if test="sfSequence!= null and sfSequence!= ''"> and sf.sfSequence = #{sfSequence}</if>
  49. <if test="sfCreatedDate!= null and sfCreatedDate!= ''"> and sf.sfCreatedDate = #{sfCreatedDate}</if>
  50. <if test="sfCreator!= null and sfCreator!= ''"> and sf.sfCreator = #{sfCreator}</if>
  51. <if test="sfModifieddate!= null and sfModifieddate!= ''"> and sf.sfModifieddate = #{sfModifieddate}</if>
  52. <if test="sfModifier!= null and sfModifier!= ''"> and sf.sfModifier = #{sfModifier}</if>
  53. <if test="sfTypeList != null and sfTypeList.size() > 0">
  54. and sf.sfType in
  55. <foreach collection="sfTypeList" item="item" index="index" open="(" separator="," close=")">
  56. #{item}
  57. </foreach>
  58. </if>
  59. <if test="sfBidList != null and sfBidList.size() > 0">
  60. and sf.sfBid in
  61. <foreach collection="sfBidList" item="item" index="index" open="(" separator="," close=")">
  62. #{item}
  63. </foreach>
  64. </if>
  65. </where>
  66. ORDER BY sf.sfSequence ASC, sf.sfModifieddate DESC
  67. </select>
  68. <select id="selectIotSfElementfactorBySfBid" resultType="com.yunfeiyun.agmp.iot.common.domain.IotSfElementfactor" parameterType="string">
  69. SELECT sf.id, sf.sfBid, sf.devBid, sf.sfType, sf.sfCode, sf.sfName, sf.sfDisplayname, sf.sfParentBid, sf.sfSequence,
  70. sf.tid, sf.sfCreatedDate, sf.sfCreator, sf.sfModifieddate, sf.sfModifier, sf.sfLng, sf.sfLat, sf.sfAddress
  71. FROM IotSfElementfactor AS sf
  72. where sf.sfBid = #{sfBid}
  73. </select>
  74. <select id="getAlreadyElementByBid" parameterType="string"
  75. resultType="IotSfElementfactor">
  76. SELECT sf.id, sf.sfBid, sf.devBid, sf.sfType, sf.sfCode, sf.sfName, sf.sfDisplayname, sf.sfParentBid, sf.sfSequence,
  77. sf.tid, sf.sfCreatedDate, sf.sfCreator, sf.sfModifieddate, sf.sfModifier, sf.sfLng, sf.sfLat, sf.sfAddress
  78. FROM IotSfElementfactor AS sf
  79. where sf.sfBid = #{sfBid} or sf.sfParentBid = #{sfBid}
  80. </select>
  81. <insert id="batchInsertIotSfElementfactor" parameterType="IotSfElementfactor">
  82. <foreach collection="list" item="item" index="index" separator=";">
  83. INSERT INTO IotSfElementfactor
  84. <trim prefix="(" suffix=")" suffixOverrides=",">
  85. <if test="item.sfBid!= null and item.sfBid!= ''">sfBid,</if>
  86. <if test="item.devBid!= null and item.devBid!= ''">devBid,</if>
  87. <if test="item.sfType!= null and item.sfType!= ''">sfType,</if>
  88. <if test="item.sfCode!= null and item.sfCode!= ''">sfCode,</if>
  89. <if test="item.sfName!= null and item.sfName!= ''">sfName,</if>
  90. <if test="item.sfDisplayname!= null and item.sfDisplayname!= ''">sfDisplayname,</if>
  91. <if test="item.sfParentBid!= null and item.sfParentBid!= ''">sfParentBid,</if>
  92. <if test="item.sfSequence!= null">sfSequence,</if>
  93. <if test="item.tid!= null and item.tid!= ''">tid,</if>
  94. <if test="item.sfCreatedDate!= null and item.sfCreatedDate!= ''">sfCreatedDate,</if>
  95. <if test="item.sfCreator!= null and item.sfCreator!= ''">sfCreator,</if>
  96. <if test="item.sfModifieddate!= null and item.sfModifieddate!= ''">sfModifieddate,</if>
  97. <if test="item.sfModifier!= null and item.sfModifier!= ''">sfModifier,</if>
  98. <if test="item.sfLng!= null and item.sfLng!= ''">sfLng,</if>
  99. <if test="item.sfLat!= null and item.sfLat!= ''">sfLat,</if>
  100. <if test="item.sfAddress!= null and item.sfAddress!= ''">sfAddress,</if>
  101. </trim>
  102. <trim prefix="VALUES (" suffix=")" suffixOverrides=",">
  103. <if test="item.sfBid!= null and item.sfBid!= ''">#{item.sfBid},</if>
  104. <if test="item.devBid!= null and item.devBid!= ''">#{item.devBid},</if>
  105. <if test="item.sfType!= null and item.sfType!= ''">#{item.sfType},</if>
  106. <if test="item.sfCode!= null and item.sfCode!= ''">#{item.sfCode},</if>
  107. <if test="item.sfName!= null and item.sfName!= ''">#{item.sfName},</if>
  108. <if test="item.sfDisplayname!= null and item.sfDisplayname!= ''">#{item.sfDisplayname},</if>
  109. <if test="item.sfParentBid!= null and item.sfParentBid!= ''">#{item.sfParentBid},</if>
  110. <if test="item.sfSequence!= null">#{item.sfSequence},</if>
  111. <if test="item.tid!= null and item.tid!= ''">#{item.tid},</if>
  112. <if test="item.sfCreatedDate!= null and item.sfCreatedDate!= ''">#{item.sfCreatedDate},</if>
  113. <if test="item.sfCreator!= null and item.sfCreator!= ''">#{item.sfCreator},</if>
  114. <if test="item.sfModifieddate!= null and item.sfModifieddate!= ''">#{item.sfModifieddate},</if>
  115. <if test="item.sfModifier!= null and item.sfModifier!= ''">#{item.sfModifier},</if>
  116. <if test="item.sfLng!= null and item.sfLng!= ''">#{item.sfLng},</if>
  117. <if test="item.sfLat!= null and item.sfLat!= ''">#{item.sfLat},</if>
  118. <if test="item.sfAddress!= null and item.sfAddress!= ''">#{item.sfAddress},</if>
  119. </trim>
  120. </foreach>
  121. </insert>
  122. <delete id="deleteIotSfElementfactorBySfBid" parameterType="string">
  123. DELETE FROM IotSfElementfactor WHERE sfBid = #{sfBid} OR sfParentBid = #{sfBid}
  124. </delete>
  125. </mapper>