AmsTaskMapper.xml 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206
  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.ruoyi.ams.agv.ndc.mapper.AmsTaskMapper">
  6. <resultMap type="AmsTask" id="AmsTaskResult">
  7. <result property="id" column="id" />
  8. <result property="taskNo" column="task_no" />
  9. <result property="ikey" column="iKey" />
  10. <result property="aciIndex" column="aci_index" />
  11. <result property="stFrom" column="st_from" />
  12. <result property="stTo" column="st_to" />
  13. <result property="priority" column="priority" />
  14. <result property="systemStatus" column="system_status" />
  15. <result property="event" column="event" />
  16. <result property="serverAck" column="server_ack" />
  17. <result property="aciAccept" column="aci_accept" />
  18. <result property="isDelete" column="is_delete" />
  19. <result property="callbackurl" column="callBackUrl" />
  20. <result property="addtime" column="addtime" />
  21. <result property="addwho" column="addwho" />
  22. <result property="sysName" column="sys_name" />
  23. <result property="deviceName" column="device_name" />
  24. <result property="businessType" column="business_type" />
  25. <result property="heightLevel" column="height_level" />
  26. <result property="remark" column="remark" />
  27. <result property="roadway" column="roadway" />
  28. <result property="tier" column="tier" />
  29. <result property="ext1" column="ext1" />
  30. <result property="ext2" column="ext2" />
  31. <result property="ext3" column="ext3" />
  32. <result property="ext4" column="ext4" />
  33. <result property="ext5" column="ext5" />
  34. <result property="ext6" column="ext6" />
  35. <result property="ext7" column="ext7" />
  36. <result property="ext8" column="ext8" />
  37. </resultMap>
  38. <sql id="selectAmsTaskVo">
  39. select id, task_no, iKey, aci_index, st_from, st_to, priority, system_status, event, server_ack
  40. , aci_accept, is_delete, callBackUrl, addtime, addwho, sys_name, device_name, business_type
  41. , height_level, remark, roadway, tier, ext1, ext2, ext3, ext4, ext5, ext6, ext7, ext8
  42. from ams_task
  43. </sql>
  44. <select id="selectAmsTaskList" parameterType="AmsTask" resultMap="AmsTaskResult">
  45. <include refid="selectAmsTaskVo"/>
  46. <where>
  47. <if test="taskNo != null and taskNo != ''"> and task_no = #{taskNo}</if>
  48. <if test="ikey != null "> and iKey = #{ikey}</if>
  49. <if test="aciIndex != null "> and aci_index = #{aciIndex}</if>
  50. <if test="stFrom != null "> and st_from = #{stFrom}</if>
  51. <if test="stTo != null "> and st_to = #{stTo}</if>
  52. <if test="priority != null "> and priority = #{priority}</if>
  53. <if test="systemStatus != null "> and system_status = #{systemStatus}</if>
  54. <if test="event != null "> and event = #{event}</if>
  55. <if test="serverAck != null "> and server_ack = #{serverAck}</if>
  56. <if test="aciAccept != null "> and aci_accept = #{aciAccept}</if>
  57. <if test="isDelete != null "> and is_delete = #{isDelete}</if>
  58. <if test="callbackurl != null and callbackurl != ''"> and callBackUrl = #{callbackurl}</if>
  59. <if test="addtime != null "> and addtime = #{addtime}</if>
  60. <if test="addwho != null and addwho != ''"> and addwho = #{addwho}</if>
  61. <if test="sysName != null and sysName != ''"> and sys_name like concat('%', #{sysName}, '%')</if>
  62. <if test="deviceName != null and deviceName != ''"> and device_name like concat('%', #{deviceName}, '%')</if>
  63. <if test="businessType != null and businessType != ''"> and business_type = #{businessType}</if>
  64. <if test="heightLevel != null and heightLevel != ''"> and height_level = #{heightLevel}</if>
  65. <if test="roadway != null and roadway != ''"> and roadway = #{roadway}</if>
  66. <if test="tier != null and tier != ''"> and tier = #{tier}</if>
  67. <if test="ext1 != null and ext1 != ''"> and ext1 = #{ext1}</if>
  68. <if test="ext2 != null and ext2 != ''"> and ext2 = #{ext2}</if>
  69. <if test="ext3 != null and ext3 != ''"> and ext3 = #{ext3}</if>
  70. <if test="ext4 != null and ext4 != ''"> and ext4 = #{ext4}</if>
  71. <if test="ext5 != null and ext5 != ''"> and ext5 = #{ext5}</if>
  72. <if test="ext6 != null and ext6 != ''"> and ext6 = #{ext6}</if>
  73. <if test="ext7 != null and ext7 != ''"> and ext7 = #{ext7}</if>
  74. <if test="ext8 != null and ext8 != ''"> and ext8 = #{ext8}</if>
  75. <if test="remark != null and remark != ''"> and remark = #{remark}</if>
  76. </where>
  77. order by addtime desc
  78. </select>
  79. <select id="selectAmsTaskById" parameterType="Long" resultMap="AmsTaskResult">
  80. <include refid="selectAmsTaskVo"/>
  81. where id = #{id}
  82. </select>
  83. <insert id="insertAmsTask" parameterType="AmsTask" useGeneratedKeys="true" keyProperty="id">
  84. insert into ams_task
  85. <trim prefix="(" suffix=")" suffixOverrides=",">
  86. <if test="taskNo != null">task_no,</if>
  87. <if test="ikey != null">iKey,</if>
  88. <if test="aciIndex != null">aci_index,</if>
  89. <if test="stFrom != null">st_from,</if>
  90. <if test="stTo != null">st_to,</if>
  91. <if test="priority != null">priority,</if>
  92. <if test="systemStatus != null">system_status,</if>
  93. <if test="event != null">event,</if>
  94. <if test="serverAck != null">server_ack,</if>
  95. <if test="aciAccept != null">aci_accept,</if>
  96. <if test="isDelete != null">is_delete,</if>
  97. <if test="callbackurl != null">callBackUrl,</if>
  98. <if test="addtime != null">addtime,</if>
  99. <if test="addwho != null">addwho,</if>
  100. <if test="sysName != null">sys_name,</if>
  101. <if test="deviceName != null">device_name,</if>
  102. <if test="businessType != null">business_type,</if>
  103. <if test="heightLevel != null">height_level,</if>
  104. <if test="remark != null">remark,</if>
  105. <if test="roadway != null">roadway,</if>
  106. <if test="tier != null">tier,</if>
  107. <if test="ext1 != null">ext1,</if>
  108. <if test="ext2 != null">ext2,</if>
  109. <if test="ext3 != null">ext3,</if>
  110. <if test="ext4 != null">ext4,</if>
  111. <if test="ext5 != null">ext5,</if>
  112. <if test="ext6 != null">ext6,</if>
  113. <if test="ext7 != null">ext7,</if>
  114. <if test="ext8 != null">ext8,</if>
  115. </trim>
  116. <trim prefix="values (" suffix=")" suffixOverrides=",">
  117. <if test="taskNo != null">#{taskNo},</if>
  118. <if test="ikey != null">#{ikey},</if>
  119. <if test="aciIndex != null">#{aciIndex},</if>
  120. <if test="stFrom != null">#{stFrom},</if>
  121. <if test="stTo != null">#{stTo},</if>
  122. <if test="priority != null">#{priority},</if>
  123. <if test="systemStatus != null">#{systemStatus},</if>
  124. <if test="event != null">#{event},</if>
  125. <if test="serverAck != null">#{serverAck},</if>
  126. <if test="aciAccept != null">#{aciAccept},</if>
  127. <if test="isDelete != null">#{isDelete},</if>
  128. <if test="callbackurl != null">#{callbackurl},</if>
  129. <if test="addtime != null">#{addtime},</if>
  130. <if test="addwho != null">#{addwho},</if>
  131. <if test="sysName != null">#{sysName},</if>
  132. <if test="deviceName != null">#{deviceName},</if>
  133. <if test="businessType != null">#{businessType},</if>
  134. <if test="heightLevel != null">#{heightLevel},</if>
  135. <if test="remark != null">#{remark},</if>
  136. <if test="roadway != null">#{roadway},</if>
  137. <if test="tier != null">#{tier},</if>
  138. <if test="ext1 != null">#{ext1},</if>
  139. <if test="ext2 != null">#{ext2},</if>
  140. <if test="ext3 != null">#{ext3},</if>
  141. <if test="ext4 != null">#{ext4},</if>
  142. <if test="ext5 != null">#{ext5},</if>
  143. <if test="ext6 != null">#{ext6},</if>
  144. <if test="ext7 != null">#{ext7},</if>
  145. <if test="ext8 != null">#{ext8},</if>
  146. </trim>
  147. </insert>
  148. <update id="updateAmsTask" parameterType="AmsTask">
  149. update ams_task
  150. <trim prefix="SET" suffixOverrides=",">
  151. <if test="taskNo != null">task_no = #{taskNo},</if>
  152. <if test="ikey != null">iKey = #{ikey},</if>
  153. <if test="aciIndex != null">aci_index = #{aciIndex},</if>
  154. <if test="stFrom != null">st_from = #{stFrom},</if>
  155. <if test="stTo != null">st_to = #{stTo},</if>
  156. <if test="priority != null">priority = #{priority},</if>
  157. <if test="systemStatus != null">system_status = #{systemStatus},</if>
  158. <if test="event != null">event = #{event},</if>
  159. <if test="serverAck != null">server_ack = #{serverAck},</if>
  160. <if test="aciAccept != null">aci_accept = #{aciAccept},</if>
  161. <if test="isDelete != null">is_delete = #{isDelete},</if>
  162. <if test="callbackurl != null">callBackUrl = #{callbackurl},</if>
  163. <if test="addtime != null">addtime = #{addtime},</if>
  164. <if test="addwho != null">addwho = #{addwho},</if>
  165. <if test="sysName != null">sys_name = #{sysName},</if>
  166. <if test="deviceName != null">device_name = #{deviceName},</if>
  167. <if test="businessType != null">business_type = #{businessType},</if>
  168. <if test="heightLevel != null">height_level = #{heightLevel},</if>
  169. <if test="remark != null">remark = #{remark},</if>
  170. <if test="roadway != null">roadway = #{roadway},</if>
  171. <if test="tier != null">tier = #{tier},</if>
  172. <if test="ext1 != null">ext1 = #{ext1},</if>
  173. <if test="ext2 != null">ext2 = #{ext2},</if>
  174. <if test="ext3 != null">ext3 = #{ext3},</if>
  175. <if test="ext4 != null">ext4 = #{ext4},</if>
  176. <if test="ext5 != null">ext5 = #{ext5},</if>
  177. <if test="ext6 != null">ext6 = #{ext6},</if>
  178. <if test="ext7 != null">ext7 = #{ext7},</if>
  179. <if test="ext8 != null">ext8 = #{ext8},</if>
  180. </trim>
  181. where id = #{id}
  182. </update>
  183. <delete id="deleteAmsTaskById" parameterType="Long">
  184. delete from ams_task where id = #{id}
  185. </delete>
  186. <delete id="deleteAmsTaskByIds" parameterType="String">
  187. delete from ams_task where id in
  188. <foreach item="id" collection="array" open="(" separator="," close=")">
  189. #{id}
  190. </foreach>
  191. </delete>
  192. <select id="selectTaskNotIssued" resultMap="AmsTaskResult">
  193. select * from ams_task
  194. where aci_accept = 0 and is_delete = 0
  195. and business_type not in ('03','power') order by addtime
  196. </select>
  197. </mapper>