StoreCheckJobMapper.xml 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160
  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.platform.dao.mapper.store.StoreCheckJobMapper">
  4. <sql id="Base_Column_List">
  5. checkjob.id,
  6. checkjob.plan_id,
  7. checkjob.start_time,
  8. checkjob.end_time,
  9. checkjob.check_num,
  10. checkjob.real_num,
  11. checkjob.spare_id,
  12. checkjob.profit_price,
  13. checkjob.price,
  14. checkjob.profit_num,
  15. checkjob.store_id,
  16. checkjob.spare_store_id,
  17. checkjob.actual_start_time,
  18. checkjob.actual_end_time,
  19. checkjob.profit,
  20. checkjob.status,
  21. checkjob.check_user_id,
  22. checkjob.created_user_id,
  23. checkjob.update_user_id,
  24. checkjob.created_user_name,
  25. checkjob.update_user_name,
  26. checkjob.created_time,
  27. checkjob.update_time
  28. </sql>
  29. <sql id="Ref_Column_List">
  30. checkjob.id,
  31. checkjob.plan_id,
  32. checkjob.start_time,
  33. checkjob.end_time,
  34. checkjob.check_num,
  35. checkjob.real_num,
  36. checkjob.profit_price,
  37. checkjob.price,
  38. checkjob.profit_num,
  39. checkjob.spare_id,
  40. checkjob.store_id,
  41. checkjob.spare_store_id,
  42. checkjob.actual_start_time,
  43. checkjob.actual_end_time,
  44. checkjob.profit,checkjob.status
  45. </sql>
  46. <sql id="List_Condition">
  47. <if test="id != null and id != ''">
  48. and checkjob.id = #{id}
  49. </if>
  50. <if test="planId != null and planId != ''">
  51. and checkjob.plan_id = #{planId}
  52. </if>
  53. <if test="spareId != null and spareId != ''">
  54. and checkjob.spare_id = #{spareId}
  55. </if>
  56. <if test="storeId != null and storeId != ''">
  57. and checkjob.store_id = #{storeId}
  58. </if>
  59. <if test="spareStoreId != null and spareStoreId != ''">
  60. and checkjob.spare_store_id = #{spareStoreId}
  61. </if>
  62. <if test="remark != null and remark != ''">
  63. and checkjob.remark = #{remark}
  64. </if>
  65. <if test="feedback != null and feedback != ''">
  66. and checkjob.feedback = #{feedback}
  67. </if>
  68. <if test="startTime != null">
  69. and checkjob.start_time = #{startTime}
  70. </if>
  71. <if test="endTimeStart != null">
  72. and checkjob.end_time <![CDATA[>=]]>; #{endTimeStart}
  73. </if>
  74. <if test="endTimeEnd != null">
  75. and checkjob.end_time <![CDATA[<=]]> #{endTimeEnd}
  76. </if>
  77. <if test="endTime != null">
  78. and checkjob.end_time = #{endTime}
  79. </if>
  80. <if test="status != null">
  81. and checkjob.status = #{status}
  82. </if>
  83. <if test="createdUserId != null and createdUserId != ''">
  84. and checkjob.created_user_id = #{createdUserId}
  85. </if>
  86. <if test="updateUserId != null and updateUserId != ''">
  87. and checkjob.update_user_id = #{updateUserId}
  88. </if>
  89. <if test="createdTime != null">
  90. and checkjob.created_time = #{createdTime}
  91. </if>
  92. <if test="updateTime != null">
  93. and checkjob.update_time = #{updateTime}
  94. </if>
  95. <if test="checkUserId != null">
  96. and checkjob.check_user_id = #{checkUserId}
  97. </if>
  98. <if test="keyword != null and keyword != ''">
  99. and checkjob.id like concat('%',#{keyword},'%')
  100. </if>
  101. </sql>
  102. <select id="selectList" parameterType="com.platform.dao.dto.store.StoreCheckJobDTO" resultType="com.platform.dao.vo.query.store.StoreCheckJobVO">
  103. select checkjob.*,
  104. u.real_name as checkUserName,
  105. plan.name as planName,
  106. spare.name as spareName,
  107. spare.ggxh as ggxh,
  108. spare.init_no as initNo,
  109. spare.unit,
  110. spare.no as no,
  111. store.name as storeName
  112. from t_store_check_job as checkjob
  113. left join t_store_check_plan plan on checkjob.plan_id = plan.id
  114. left join t_store store on checkjob.store_id = store.id
  115. left join t_spare_part_info spare on checkjob.spare_id = spare.id
  116. left join t_sys_user u on checkjob.check_user_id = u.user_id
  117. <where>
  118. <include refid="List_Condition"/>
  119. </where>
  120. </select>
  121. <select id="selectDetail" resultType="com.platform.dao.vo.query.store.StoreCheckJobVO">
  122. select checkjob.*,
  123. u.real_name as checkUserName,
  124. plan.name as planName,
  125. spare.name as spareName,
  126. store.name as storeName
  127. from t_store_check_job as checkjob
  128. left join t_store_check_plan plan on checkjob.plan_id = plan.id
  129. left join t_store store on checkjob.store_id = store.id
  130. left join t_spare_part_info spare on checkjob.spare_id = spare.id
  131. left join t_sys_user u on checkjob.check_user_id = u.user_id
  132. where checkjob.id = #{id}
  133. </select>
  134. <select id="selectJobList" resultType="com.platform.dao.vo.query.store.StoreCheckJobVO">
  135. select checkjob.*, u.real_name as checkUserName
  136. from t_store_check_job as checkjob
  137. left join t_sys_user u on checkjob.check_user_id = u.user_id
  138. where checkjob.plan_id = #{planId}
  139. </select>
  140. <update id="updateStatus" parameterType="com.platform.dao.dto.store.StoreCheckJobDTO">
  141. update t_store_check_job
  142. set status = #{status}
  143. where plan_id = #{planId}
  144. </update>
  145. <select id="getNumByDTO" parameterType="com.platform.dao.dto.store.StoreCheckJobDTO"
  146. resultType="BigDecimal">
  147. select count(1) from t_store_check_job job left join t_store store on
  148. job.store_id=store.id
  149. <where>
  150. <if test="userId!=null and userId!=''">
  151. and store.user_id=#{userId}
  152. </if>
  153. </where>
  154. </select>
  155. </mapper>