IotCmdexecMapper.xml 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255
  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.iots.device.mapper.IotCmdexecMapper">
  6. <resultMap type="IotCmdexec" id="IotCmdexecResult">
  7. <result property="id" column="id"/>
  8. <result property="ceBid" column="ceBid"/>
  9. <result property="tid" column="tid"/>
  10. <result property="ctBid" column="ctBid"/>
  11. <result property="devBid" column="devBid"/>
  12. <result property="ceGroupbid" column="ceGroupbid"/>
  13. <result property="ceType" column="ceType"/>
  14. <result property="ceGroupparentbid" column="ceGroupparentbid"/>
  15. <result property="ceSeq" column="ceSeq"/>
  16. <result property="ceInstruct" column="ceInstruct"/>
  17. <result property="ceStatus" column="ceStatus"/>
  18. <result property="ceSendrecount" column="ceSendrecount"/>
  19. <result property="ceValidrecount" column="ceValidrecount"/>
  20. <result property="ceDelayddate" column="ceDelayddate"/>
  21. <result property="ceFinally" column="ceFinally"/>
  22. <result property="ceDesc" column="ceDesc"/>
  23. <result property="ceStartddate" column="ceStartddate"/>
  24. <result property="ceCompletedate" column="ceCompletedate"/>
  25. <result property="ceModifieddate" column="ceModifieddate"/>
  26. <result property="ceCreateddate" column="ceCreateddate"/>
  27. <result property="ceDelstatus" column="ceDelstatus"/>
  28. </resultMap>
  29. <sql id="selectIotCmdexecVo">
  30. select id, ceBid, tid, ctBid, devBid, ceGroupbid, ceType, ceGroupparentbid, ceSeq, ceInstruct, ceStatus, ceSendrecount, ceValidrecount, ceDelayddate, ceFinally, ceDesc, ceStartddate, ceCompletedate, ceModifieddate, ceCreateddate, ceDelstatus from IotCmdexec
  31. </sql>
  32. <select id="selectIotCmdexecList" parameterType="IotCmdexec" resultMap="IotCmdexecResult">
  33. <include refid="selectIotCmdexecVo"/>
  34. <where>
  35. <if test="ceBid != null and ceBid != ''">and ceBid = #{ceBid}</if>
  36. <if test="tid != null and tid != ''">and tid = #{tid}</if>
  37. <if test="ctBid != null and ctBid != ''">and ctBid = #{ctBid}</if>
  38. <if test="devBid != null and devBid != ''">and devBid = #{devBid}</if>
  39. <if test="ceGroupbid != null and ceGroupbid != ''">and ceGroupbid = #{ceGroupbid}</if>
  40. <if test="ceType != null and ceType != ''">and ceType = #{ceType}</if>
  41. <if test="ceGroupparentbid != null and ceGroupparentbid != ''">and ceGroupparentbid = #{ceGroupparentbid}
  42. </if>
  43. <if test="ceSeq != null ">and ceSeq = #{ceSeq}</if>
  44. <if test="ceInstruct != null and ceInstruct != ''">and ceInstruct = #{ceInstruct}</if>
  45. <if test="ceStatus != null and ceStatus != ''">and ceStatus = #{ceStatus}</if>
  46. <if test="ceSendrecount != null ">and ceSendrecount = #{ceSendrecount}</if>
  47. <if test="ceValidrecount != null ">and ceValidrecount = #{ceValidrecount}</if>
  48. <if test="ceDelayddate != null ">and ceDelayddate = #{ceDelayddate}</if>
  49. <if test="ceFinally != null and ceFinally != ''">and ceFinally = #{ceFinally}</if>
  50. <if test="ceDesc != null and ceDesc != ''">and ceDesc = #{ceDesc}</if>
  51. <if test="ceStartddate != null and ceStartddate != ''">and ceStartddate = #{ceStartddate}</if>
  52. <if test="ceCompletedate != null and ceCompletedate != ''">and ceCompletedate = #{ceCompletedate}</if>
  53. <if test="ceModifieddate != null and ceModifieddate != ''">and ceModifieddate = #{ceModifieddate}</if>
  54. <if test="ceCreateddate != null and ceCreateddate != ''">and ceCreateddate = #{ceCreateddate}</if>
  55. <if test="ceDelstatus != null and ceDelstatus != ''">and ceDelstatus = #{ceDelstatus}</if>
  56. </where>
  57. </select>
  58. <select id="selectIotCmdexecById" parameterType="Long" resultMap="IotCmdexecResult">
  59. <include refid="selectIotCmdexecVo"/>
  60. where id = #{id}
  61. </select>
  62. <select id="selectIotCmdexecByCeBid" parameterType="String" resultMap="IotCmdexecResult">
  63. <include refid="selectIotCmdexecVo"/>
  64. where ceBid = #{ceBid}
  65. </select>
  66. <select id="selectIotCmdexecListByTaskIdAndSeq" resultType="com.yunfeiyun.agmp.iot.common.domain.IotCmdexec">
  67. <include refid="selectIotCmdexecVo"/>
  68. where ctBid = #{taskId} and ceSeq >= #{seq}
  69. order by ceSeq
  70. </select>
  71. <select id="selectFinallyIotCmdexecListByTaskIdAndSeq"
  72. resultType="com.yunfeiyun.agmp.iot.common.domain.IotCmdexec">
  73. <include refid="selectIotCmdexecVo"/>
  74. where ctBid = #{taskId} and ceSeq >= #{seq} and ceFinally = 1
  75. order by ceSeq
  76. </select>
  77. <insert id="insertIotCmdexec" parameterType="IotCmdexec" useGeneratedKeys="true" keyProperty="id">
  78. insert into IotCmdexec
  79. <trim prefix="(" suffix=")" suffixOverrides=",">
  80. <if test="ceBid != null">ceBid,</if>
  81. <if test="tid != null">tid,</if>
  82. <if test="ctBid != null">ctBid,</if>
  83. <if test="devBid != null">devBid,</if>
  84. <if test="ceGroupbid != null">ceGroupbid,</if>
  85. <if test="ceType != null">ceType,</if>
  86. <if test="ceGroupparentbid != null">ceGroupparentbid,</if>
  87. <if test="ceSeq != null">ceSeq,</if>
  88. <if test="ceInstruct != null">ceInstruct,</if>
  89. <if test="ceStatus != null">ceStatus,</if>
  90. <if test="ceSendrecount != null">ceSendrecount,</if>
  91. <if test="ceValidrecount != null">ceValidrecount,</if>
  92. <if test="ceDelayddate != null">ceDelayddate,</if>
  93. <if test="ceFinally != null">ceFinally,</if>
  94. <if test="ceDesc != null">ceDesc,</if>
  95. <if test="ceStartddate != null">ceStartddate,</if>
  96. <if test="ceCompletedate != null">ceCompletedate,</if>
  97. <if test="ceModifieddate != null">ceModifieddate,</if>
  98. <if test="ceCreateddate != null">ceCreateddate,</if>
  99. <if test="ceDelstatus != null">ceDelstatus,</if>
  100. </trim>
  101. <trim prefix="values (" suffix=")" suffixOverrides=",">
  102. <if test="ceBid != null">#{ceBid},</if>
  103. <if test="tid != null">#{tid},</if>
  104. <if test="ctBid != null">#{ctBid},</if>
  105. <if test="devBid != null">#{devBid},</if>
  106. <if test="ceGroupbid != null">#{ceGroupbid},</if>
  107. <if test="ceType != null">#{ceType},</if>
  108. <if test="ceGroupparentbid != null">#{ceGroupparentbid},</if>
  109. <if test="ceSeq != null">#{ceSeq},</if>
  110. <if test="ceInstruct != null">#{ceInstruct},</if>
  111. <if test="ceStatus != null">#{ceStatus},</if>
  112. <if test="ceSendrecount != null">#{ceSendrecount},</if>
  113. <if test="ceValidrecount != null">#{ceValidrecount},</if>
  114. <if test="ceDelayddate != null">#{ceDelayddate},</if>
  115. <if test="ceFinally != null">#{ceFinally},</if>
  116. <if test="ceDesc != null">#{ceDesc},</if>
  117. <if test="ceStartddate != null">#{ceStartddate},</if>
  118. <if test="ceCompletedate != null">#{ceCompletedate},</if>
  119. <if test="ceModifieddate != null">#{ceModifieddate},</if>
  120. <if test="ceCreateddate != null">#{ceCreateddate},</if>
  121. <if test="ceDelstatus != null">#{ceDelstatus},</if>
  122. </trim>
  123. </insert>
  124. <insert id="insertIotCmdexecByBatch">
  125. insert into IotCmdexec
  126. <trim prefix="(" suffix=")" suffixOverrides=",">
  127. ceBid,
  128. tid,
  129. ctBid,
  130. devBid,
  131. ceGroupbid,
  132. ceType,
  133. ceGroupparentbid,
  134. ceSeq,
  135. ceInstruct,
  136. ceStatus,
  137. ceSendrecount,
  138. ceValidrecount,
  139. ceDelayddate,
  140. ceFinally,
  141. ceDesc,
  142. ceStartddate,
  143. ceCompletedate,
  144. ceModifieddate,
  145. ceCreateddate,
  146. ceDelstatus
  147. </trim>
  148. values
  149. <foreach collection="list" separator="," index="index" item="item">
  150. (
  151. #{item.ceBid},
  152. #{item.tid},
  153. #{item.ctBid},
  154. #{item.devBid},
  155. #{item.ceGroupbid},
  156. #{item.ceType},
  157. #{item.ceGroupparentbid},
  158. #{item.ceSeq},
  159. #{item.ceInstruct},
  160. #{item.ceStatus},
  161. #{item.ceSendrecount},
  162. #{item.ceValidrecount},
  163. #{item.ceDelayddate},
  164. #{item.ceFinally},
  165. #{item.ceDesc},
  166. #{item.ceStartddate},
  167. #{item.ceCompletedate},
  168. #{item.ceModifieddate},
  169. #{item.ceCreateddate},
  170. #{item.ceDelstatus}
  171. )
  172. </foreach>
  173. </insert>
  174. <update id="updateIotCmdexec" parameterType="IotCmdexec">
  175. update IotCmdexec
  176. <trim prefix="SET" suffixOverrides=",">
  177. <if test="ceBid != null">ceBid = #{ceBid},</if>
  178. <if test="tid != null">tid = #{tid},</if>
  179. <if test="ctBid != null">ctBid = #{ctBid},</if>
  180. <if test="devBid != null">devBid = #{devBid},</if>
  181. <if test="ceGroupbid != null">ceGroupbid = #{ceGroupbid},</if>
  182. <if test="ceType != null">ceType = #{ceType},</if>
  183. <if test="ceGroupparentbid != null">ceGroupparentbid = #{ceGroupparentbid},</if>
  184. <if test="ceSeq != null">ceSeq = #{ceSeq},</if>
  185. <if test="ceInstruct != null">ceInstruct = #{ceInstruct},</if>
  186. <if test="ceStatus != null">ceStatus = #{ceStatus},</if>
  187. <if test="ceSendrecount != null">ceSendrecount = #{ceSendrecount},</if>
  188. <if test="ceValidrecount != null">ceValidrecount = #{ceValidrecount},</if>
  189. <if test="ceDelayddate != null">ceDelayddate = #{ceDelayddate},</if>
  190. <if test="ceFinally != null">ceFinally = #{ceFinally},</if>
  191. <if test="ceDesc != null">ceDesc = #{ceDesc},</if>
  192. <if test="ceStartddate != null">ceStartddate = #{ceStartddate},</if>
  193. <if test="ceCompletedate != null">ceCompletedate = #{ceCompletedate},</if>
  194. <if test="ceModifieddate != null">ceModifieddate = #{ceModifieddate},</if>
  195. <if test="ceCreateddate != null">ceCreateddate = #{ceCreateddate},</if>
  196. <if test="ceDelstatus != null">ceDelstatus = #{ceDelstatus},</if>
  197. </trim>
  198. where id = #{id}
  199. </update>
  200. <update id="updateIotCmdexecByCeBid" parameterType="IotCmdexec">
  201. update IotCmdexec
  202. <trim prefix="SET" suffixOverrides=",">
  203. <if test="ceBid != null">ceBid = #{ceBid},</if>
  204. <if test="tid != null">tid = #{tid},</if>
  205. <if test="ctBid != null">ctBid = #{ctBid},</if>
  206. <if test="devBid != null">devBid = #{devBid},</if>
  207. <if test="ceGroupbid != null">ceGroupbid = #{ceGroupbid},</if>
  208. <if test="ceType != null">ceType = #{ceType},</if>
  209. <if test="ceGroupparentbid != null">ceGroupparentbid = #{ceGroupparentbid},</if>
  210. <if test="ceSeq != null">ceSeq = #{ceSeq},</if>
  211. <if test="ceInstruct != null">ceInstruct = #{ceInstruct},</if>
  212. <if test="ceStatus != null">ceStatus = #{ceStatus},</if>
  213. <if test="ceSendrecount != null">ceSendrecount = #{ceSendrecount},</if>
  214. <if test="ceValidrecount != null">ceValidrecount = #{ceValidrecount},</if>
  215. <if test="ceDelayddate != null">ceDelayddate = #{ceDelayddate},</if>
  216. <if test="ceFinally != null">ceFinally = #{ceFinally},</if>
  217. <if test="ceDesc != null">ceDesc = #{ceDesc},</if>
  218. <if test="ceStartddate != null">ceStartddate = #{ceStartddate},</if>
  219. <if test="ceCompletedate != null">ceCompletedate = #{ceCompletedate},</if>
  220. <if test="ceModifieddate != null">ceModifieddate = #{ceModifieddate},</if>
  221. <if test="ceCreateddate != null">ceCreateddate = #{ceCreateddate},</if>
  222. <if test="ceDelstatus != null">ceDelstatus = #{ceDelstatus},</if>
  223. </trim>
  224. where ceBid = #{ceBid}
  225. </update>
  226. <update id="updateIotCmdexecCeStatusByCeBid">
  227. update IotCmdexec set ceStatus = #{ceStatus} where ceBid = #{ceBid}
  228. </update>
  229. <update id="startCmdExecLog" parameterType="String">
  230. update IotCmdexec set ceStartddate = #{ceStartddate} where ceBid = #{ceBid}
  231. </update>
  232. <delete id="deleteIotCmdexecById" parameterType="Long">
  233. delete from IotCmdexec where id = #{id}
  234. </delete>
  235. <delete id="deleteIotCmdexecByIds" parameterType="String">
  236. delete from IotCmdexec where id in
  237. <foreach item="id" collection="array" open="(" separator="," close=")">
  238. #{id}
  239. </foreach>
  240. </delete>
  241. </mapper>