DeviceDataPushConfigMapper.xml 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  3. <mapper namespace="com.zcxk.smartcity.data.access.dao.DeviceDataPushConfigMapper">
  4. <resultMap id="BaseResultMap" type="com.zcxk.smartcity.data.access.entity.DeviceDataPushConfig">
  5. <!--@mbg.generated-->
  6. <id column="id" property="id" />
  7. <result column="receiver_name" property="receiverName" />
  8. <result column="push_method" property="pushMethod" />
  9. <result column="push_customers" property="pushCustomers" />
  10. <result column="push_communitys" property="pushCommunitys" />
  11. <result column="push_buildings" property="pushBuildings" />
  12. <result column="push_url" property="pushUrl" />
  13. <result column="push_server" property="pushServer" />
  14. <result column="push_port" property="pushPort" />
  15. <result column="status" property="status" />
  16. <result column="create_by" property="createBy" />
  17. <result column="update_by" property="updateBy" />
  18. <result column="date_create" property="dateCreate" />
  19. <result column="date_update" property="dateUpdate" />
  20. </resultMap>
  21. <sql id="Base_Column_List">
  22. <!--@mbg.generated-->
  23. id, receiver_name, push_method, push_customers, push_communitys, push_buildings,
  24. push_url, push_server, push_port, `status`, create_by, update_by, date_create, date_update,is_parsed
  25. </sql>
  26. <insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.zcxk.smartcity.data.access.entity.DeviceDataPushConfig" useGeneratedKeys="true">
  27. <!--@mbg.generated-->
  28. insert into sc_device_data_push_config
  29. <trim prefix="(" suffix=")" suffixOverrides=",">
  30. <if test="receiverName != null">
  31. receiver_name,
  32. </if>
  33. <if test="pushMethod != null">
  34. push_method,
  35. </if>
  36. <if test="pushCustomers != null">
  37. push_customers,
  38. </if>
  39. <if test="pushCommunitys != null">
  40. push_communitys,
  41. </if>
  42. <if test="pushBuildings != null">
  43. push_buildings,
  44. </if>
  45. <if test="pushUrl != null">
  46. push_url,
  47. </if>
  48. <if test="pushServer != null">
  49. push_server,
  50. </if>
  51. <if test="pushPort != null">
  52. push_port,
  53. </if>
  54. <if test="status != null">
  55. `status`,
  56. </if>
  57. <if test="createBy != null">
  58. create_by,
  59. </if>
  60. <if test="updateBy != null">
  61. update_by,
  62. </if>
  63. <if test="dateCreate != null">
  64. date_create,
  65. </if>
  66. <if test="dateUpdate != null">
  67. date_update,
  68. </if>
  69. </trim>
  70. <trim prefix="values (" suffix=")" suffixOverrides=",">
  71. <if test="receiverName != null">
  72. #{receiverName},
  73. </if>
  74. <if test="pushMethod != null">
  75. #{pushMethod},
  76. </if>
  77. <if test="pushCustomers != null">
  78. #{pushCustomers},
  79. </if>
  80. <if test="pushCommunitys != null">
  81. #{pushCommunitys},
  82. </if>
  83. <if test="pushBuildings != null">
  84. #{pushBuildings},
  85. </if>
  86. <if test="pushUrl != null">
  87. #{pushUrl},
  88. </if>
  89. <if test="pushServer != null">
  90. #{pushServer},
  91. </if>
  92. <if test="pushPort != null">
  93. #{pushPort},
  94. </if>
  95. <if test="status != null">
  96. #{status},
  97. </if>
  98. <if test="createBy != null">
  99. #{createBy},
  100. </if>
  101. <if test="updateBy != null">
  102. #{updateBy},
  103. </if>
  104. <if test="dateCreate != null">
  105. #{dateCreate},
  106. </if>
  107. <if test="dateUpdate != null">
  108. #{dateUpdate},
  109. </if>
  110. </trim>
  111. </insert>
  112. <update id="updateByPrimaryKeySelective" parameterType="com.zcxk.smartcity.data.access.entity.DeviceDataPushConfig">
  113. <!--@mbg.generated-->
  114. update sc_device_data_push_config
  115. <set>
  116. <if test="receiverName != null">
  117. receiver_name = #{receiverName},
  118. </if>
  119. <if test="pushMethod != null">
  120. push_method = #{pushMethod},
  121. </if>
  122. <if test="pushCustomers != null">
  123. push_customers = #{pushCustomers},
  124. </if>
  125. <if test="pushCommunitys != null">
  126. push_communitys = #{pushCommunitys},
  127. </if>
  128. <if test="pushBuildings != null">
  129. push_buildings = #{pushBuildings},
  130. </if>
  131. <if test="pushUrl != null">
  132. push_url = #{pushUrl},
  133. </if>
  134. <if test="pushServer != null">
  135. push_server = #{pushServer},
  136. </if>
  137. <if test="pushPort != null">
  138. push_port = #{pushPort},
  139. </if>
  140. <if test="status != null">
  141. `status` = #{status},
  142. </if>
  143. <if test="createBy != null">
  144. create_by = #{createBy},
  145. </if>
  146. <if test="updateBy != null">
  147. update_by = #{updateBy},
  148. </if>
  149. <if test="dateCreate != null">
  150. date_create = #{dateCreate},
  151. </if>
  152. <if test="dateUpdate != null">
  153. date_update = #{dateUpdate},
  154. </if>
  155. </set>
  156. where id = #{id}
  157. </update>
  158. <select id="findPushConfig" resultMap="BaseResultMap">
  159. select
  160. <include refid="Base_Column_List" />
  161. from sc_device_data_push_config
  162. <where>
  163. status = 1
  164. and is_batch = 0
  165. and (
  166. <trim prefixOverrides="OR">
  167. <if test="customerId != null and customerId != 0 " >
  168. or FIND_IN_SET( #{customerId}, push_customers )
  169. </if>
  170. <if test="communityId != null and communityId != 0 ">
  171. or FIND_IN_SET( #{communityId}, push_communitys )
  172. </if>
  173. <if test="buildingId != null and buildingId != 0 ">
  174. or FIND_IN_SET( #{buildingId}, push_buildings )
  175. </if>
  176. </trim>
  177. )
  178. </where>
  179. limit 1
  180. </select>
  181. </mapper>