WInventoryTransactionTaskDao.xml 8.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221
  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.imcs.admin.business.dao.WInventoryTransactionTaskDao">
  4. <resultMap type="com.imcs.admin.entity.WInventoryTransactionTask" id="WInventoryTransactionTaskMap">
  5. <result property="id" column="id" jdbcType="INTEGER"/>
  6. <result property="wInventoryTransactionOrdersId" column="w_inventory_transaction_orders_id" jdbcType="INTEGER"/>
  7. <result property="taskCode" column="task_code" jdbcType="VARCHAR"/>
  8. <result property="startPosition" column="start_position" jdbcType="VARCHAR"/>
  9. <result property="endPosition" column="end_position" jdbcType="VARCHAR"/>
  10. <result property="vectorCode" column="vector_code" jdbcType="VARCHAR"/>
  11. <result property="errorInfo" column="error_info" jdbcType="VARCHAR"/>
  12. <result property="status" column="status" jdbcType="INTEGER"/>
  13. <result property="taskType" column="task_type" jdbcType="INTEGER"/>
  14. <result property="startTime" column="start_time" jdbcType="TIMESTAMP"/>
  15. <result property="endTime" column="end_time" jdbcType="TIMESTAMP"/>
  16. <result property="remarks" column="remarks" jdbcType="VARCHAR"/>
  17. <result property="createdAt" column="created_at" jdbcType="TIMESTAMP"/>
  18. <result property="createdBy" column="created_by" jdbcType="INTEGER"/>
  19. <result property="updatedAt" column="updated_at" jdbcType="TIMESTAMP"/>
  20. <result property="updatedBy" column="updated_by" jdbcType="INTEGER"/>
  21. <result property="orderCode" column="order_code" jdbcType="INTEGER"/>
  22. <result property="orderName" column="order_name" jdbcType="INTEGER"/>
  23. <result property="inOutCode" column="in_out_code" jdbcType="INTEGER"/>
  24. </resultMap>
  25. <!--查询单个-->
  26. <select id="queryById" resultMap="WInventoryTransactionTaskMap">
  27. select
  28. *
  29. from w_inventory_transaction_task
  30. where id = #{id}
  31. </select>
  32. <!--查询指定行数据-->
  33. <select id="queryAllByLimit" resultMap="WInventoryTransactionTaskMap">
  34. select
  35. task.*,orders.order_code,orders.order_name,orders.in_out_code
  36. from w_inventory_transaction_task task
  37. left join w_inventory_transaction_orders orders on task.w_inventory_transaction_orders_id=orders.id
  38. <where>
  39. <if test="id != null">
  40. and task.id = #{id}
  41. </if>
  42. <if test="wInventoryTransactionOrdersId != null">
  43. and task.w_inventory_transaction_orders_id = #{wInventoryTransactionOrdersId}
  44. </if>
  45. <if test="taskCode != null and taskCode != ''">
  46. and task.task_code = #{taskCode}
  47. </if>
  48. <if test="startPosition != null and startPosition != ''">
  49. and task.start_position = #{startPosition}
  50. </if>
  51. <if test="endPosition != null and endPosition != ''">
  52. and task.end_position = #{endPosition}
  53. </if>
  54. <if test="vectorCode != null and vectorCode != ''">
  55. and task.vector_code = #{vectorCode}
  56. </if>
  57. <if test="errorInfo != null and errorInfo != ''">
  58. and task.error_info = #{errorInfo}
  59. </if>
  60. <if test="status != null">
  61. and task.status = #{status}
  62. </if>
  63. <if test="taskType != null and taskType!= ''">
  64. and task.task_type = #{taskType}
  65. </if>
  66. <if test="startTime != null">
  67. and task.start_time = #{startTime}
  68. </if>
  69. <if test="endTime != null">
  70. and task.end_time = #{endTime}
  71. </if>
  72. <if test="remarks != null and remarks != ''">
  73. and task.remarks = #{remarks}
  74. </if>
  75. <if test="createdAt != null">
  76. and task.created_at = #{createdAt}
  77. </if>
  78. <if test="createdBy != null">
  79. and task.created_by = #{createdBy}
  80. </if>
  81. <if test="updatedAt != null">
  82. and task.updated_at = #{updatedAt}
  83. </if>
  84. <if test="updatedBy != null">
  85. and task.updated_by = #{updatedBy}
  86. </if>
  87. <if test="orderCode != null and orderCode!= ''" >
  88. and orders.order_code = #{orderCode}
  89. </if>
  90. <if test="inOutCode != null and inOutCode!= ''" >
  91. and orders.in_out_code = #{inOutCode}
  92. </if>
  93. </where>
  94. </select>
  95. <!--统计总行数-->
  96. <select id="count" resultType="java.lang.Long">
  97. select count(1)
  98. from w_inventory_transaction_task
  99. <where>
  100. <if test="id != null">
  101. and id = #{id}
  102. </if>
  103. <if test="wInventoryTransactionOrdersId != null">
  104. and w_inventory_transaction_orders_id = #{wInventoryTransactionOrdersId}
  105. </if>
  106. <if test="taskCode != null and taskCode != ''">
  107. and task_code = #{taskCode}
  108. </if>
  109. <if test="startPosition != null and startPosition != ''">
  110. and start_position = #{startPosition}
  111. </if>
  112. <if test="endPosition != null and endPosition != ''">
  113. and end_position = #{endPosition}
  114. </if>
  115. <if test="vectorCode != null and vectorCode != ''">
  116. and vector_code = #{vectorCode}
  117. </if>
  118. <if test="errorInfo != null and errorInfo != ''">
  119. and error_info = #{errorInfo}
  120. </if>
  121. <if test="status != null">
  122. and status = #{status}
  123. </if>
  124. <if test="taskType != null">
  125. and task_type = #{taskType}
  126. </if>
  127. <if test="startTime != null">
  128. and start_time = #{startTime}
  129. </if>
  130. <if test="endTime != null">
  131. and end_time = #{endTime}
  132. </if>
  133. <if test="remarks != null and remarks != ''">
  134. and remarks = #{remarks}
  135. </if>
  136. <if test="createdAt != null">
  137. and created_at = #{createdAt}
  138. </if>
  139. <if test="createdBy != null">
  140. and created_by = #{createdBy}
  141. </if>
  142. <if test="updatedAt != null">
  143. and updated_at = #{updatedAt}
  144. </if>
  145. <if test="updatedBy != null">
  146. and updated_by = #{updatedBy}
  147. </if>
  148. </where>
  149. </select>
  150. <!--新增所有列-->
  151. <!--通过主键修改数据-->
  152. <update id="update">
  153. update w_inventory_transaction_task
  154. <set>
  155. <if test="wInventoryTransactionOrdersId != null">
  156. w_inventory_transaction_orders_id = #{wInventoryTransactionOrdersId},
  157. </if>
  158. <if test="taskCode != null and taskCode != ''">
  159. task_code = #{taskCode},
  160. </if>
  161. <if test="startPosition != null and startPosition != ''">
  162. start_position = #{startPosition},
  163. </if>
  164. <if test="endPosition != null and endPosition != ''">
  165. end_position = #{endPosition},
  166. </if>
  167. <if test="vectorCode != null and vectorCode != ''">
  168. vector_code = #{vectorCode},
  169. </if>
  170. <if test="errorInfo != null and errorInfo != ''">
  171. error_info = #{errorInfo},
  172. </if>
  173. <if test="status != null">
  174. status = #{status},
  175. </if>
  176. <if test="taskType != null">
  177. task_type = #{taskType},
  178. </if>
  179. <if test="startTime != null">
  180. start_time = #{startTime},
  181. </if>
  182. <if test="endTime != null">
  183. end_time = #{endTime},
  184. </if>
  185. <if test="remarks != null and remarks != ''">
  186. remarks = #{remarks},
  187. </if>
  188. <if test="createdAt != null">
  189. created_at = #{createdAt},
  190. </if>
  191. <if test="createdBy != null">
  192. created_by = #{createdBy},
  193. </if>
  194. <if test="updatedAt != null">
  195. updated_at = #{updatedAt},
  196. </if>
  197. <if test="updatedBy != null">
  198. updated_by = #{updatedBy},
  199. </if>
  200. </set>
  201. where id = #{id}
  202. </update>
  203. <!--通过主键删除-->
  204. <delete id="deleteById">
  205. delete from w_inventory_transaction_task where id = #{id}
  206. </delete>
  207. <select id="selectOne" resultType="com.imcs.admin.entity.WInventoryTransactionTask">
  208. select * from w_inventory_transaction_task where status in(0,1) order by id asc limit 1
  209. </select>
  210. </mapper>