PreparationMapper.xml 8.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186
  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.preparation.PreparationMapper">
  4. <sql id="Base_Column_List">
  5. preparation.id,
  6. preparation.position_id,
  7. preparation.user_id,
  8. preparation.depart_id,
  9. preparation.apply_time,
  10. preparation.content,
  11. preparation.status,
  12. preparation.remark,
  13. preparation.created_time,
  14. preparation.update_time,
  15. preparation.created_user_id,
  16. preparation.created_user_name,
  17. preparation.update_user_id,
  18. preparation.update_user_name,
  19. preparation.repair_start_time,
  20. preparation.repair_end_time,
  21. preparation.repair_minutes,
  22. preparation.repair_user_id,
  23. preparation.repair_content,
  24. preparation.limit_hours,
  25. preparation.fee,
  26. preparation.fee_file
  27. </sql>
  28. <sql id="Ref_Column_List">
  29. preparation.position_id,
  30. preparation.user_id,
  31. preparation.depart_id,
  32. preparation.apply_time,
  33. preparation.content,
  34. preparation.status,
  35. preparation.remark,
  36. preparation.repair_start_time,
  37. preparation.repair_end_time,
  38. preparation.repair_minutes,
  39. preparation.repair_user_id,
  40. preparation.repair_content,
  41. preparation.limit_hours,
  42. preparation.fee,
  43. preparation.fee_file
  44. </sql>
  45. <sql id="List_Condition">
  46. <if test="id != null and id != ''">
  47. and preparation.id = #{id}
  48. </if>
  49. <if test="positionId != null and positionId != ''">
  50. and preparation.position_id = #{positionId}
  51. </if>
  52. <if test="userId != null and userId != ''">
  53. and preparation.user_id = #{userId}
  54. </if>
  55. <if test="departId != null and departId != ''">
  56. and preparation.depart_id = #{departId}
  57. </if>
  58. <if test="applyTimeStart != null">
  59. and preparation.apply_time <![CDATA[>=]]> #{applyTimeStart}
  60. </if>
  61. <if test="applyTimeEnd != null">
  62. and preparation.apply_time <![CDATA[<=]]> #{applyTimeEnd}
  63. </if>
  64. <if test="applyTime != null">
  65. and preparation.apply_time = #{applyTime}
  66. </if>
  67. <if test="content != null and content != ''">
  68. and preparation.content = #{content}
  69. </if>
  70. <if test="status != null">
  71. and preparation.status = #{status}
  72. </if>
  73. <if test="remark != null and remark != ''">
  74. and preparation.remark = #{remark}
  75. </if>
  76. <if test="createdTimeStart != null">
  77. and preparation.created_time <![CDATA[>=]]> #{createdTimeStart}
  78. </if>
  79. <if test="createdTimeEnd != null">
  80. and preparation.created_time <![CDATA[<=]]> #{createdTimeEnd}
  81. </if>
  82. <if test="createdTime != null">
  83. and preparation.created_time = #{createdTime}
  84. </if>
  85. <if test="updateTimeStart != null">
  86. and preparation.update_time <![CDATA[>=]]> #{updateTimeStart}
  87. </if>
  88. <if test="updateTimeEnd != null">
  89. and preparation.update_time <![CDATA[<=]]> #{updateTimeEnd}
  90. </if>
  91. <if test="updateTime != null">
  92. and preparation.update_time = #{updateTime}
  93. </if>
  94. <if test="createdUserId != null and createdUserId != ''">
  95. and preparation.created_user_id = #{createdUserId}
  96. </if>
  97. <if test="createdUserName != null and createdUserName != ''">
  98. and preparation.created_user_name = #{createdUserName}
  99. </if>
  100. <if test="updateUserId != null and updateUserId != ''">
  101. and preparation.update_user_id = #{updateUserId}
  102. </if>
  103. <if test="updateUserName != null and updateUserName != ''">
  104. and preparation.update_user_name = #{updateUserName}
  105. </if>
  106. <if test="repairStartTimeStart != null">
  107. and preparation.repair_start_time <![CDATA[>=]]> #{repairStartTimeStart}
  108. </if>
  109. <if test="repairStartTimeEnd != null">
  110. and preparation.repair_start_time <![CDATA[<=]]> #{repairStartTimeEnd}
  111. </if>
  112. <if test="repairStartTime != null">
  113. and preparation.repair_start_time = #{repairStartTime}
  114. </if>
  115. <if test="repairEndTimeStart != null">
  116. and preparation.repair_end_time <![CDATA[>=]]> #{repairEndTimeStart}
  117. </if>
  118. <if test="repairEndTimeEnd != null">
  119. and preparation.repair_end_time <![CDATA[<=]]> #{repairEndTimeEnd}
  120. </if>
  121. <if test="repairEndTime != null">
  122. and preparation.repair_end_time = #{repairEndTime}
  123. </if>
  124. <if test="repairMinutes != null">
  125. and preparation.repair_minutes = #{repairMinutes}
  126. </if>
  127. <if test="repairUserId != null and repairUserId != ''">
  128. and preparation.repair_user_id = #{repairUserId}
  129. </if>
  130. <if test="repairContent != null and repairContent != ''">
  131. and preparation.repair_content = #{repairContent}
  132. </if>
  133. <if test="limitHoursStart != null">
  134. and preparation.limit_hours <![CDATA[>=]]> #{limitHoursStart}
  135. </if>
  136. <if test="limitHoursEnd != null">
  137. and preparation.limit_hours <![CDATA[<=]]> #{limitHoursEnd}
  138. </if>
  139. <if test="limitHours != null">
  140. and preparation.limit_hours = #{limitHours}
  141. </if>
  142. <if test="fee != null">
  143. and preparation.fee = #{fee}
  144. </if>
  145. <if test="feeFile != null and feeFile != ''">
  146. and preparation.fee_file = #{feeFile}
  147. </if>
  148. <if test="keyword != null and keyword != ''">
  149. and preparation.id like concat(concat('%',#{keyword}),'%')
  150. </if>
  151. <!-- 新增查询参数 -->
  152. <if test="statusList != null and statusList.size > 0">
  153. AND preparation.status in
  154. <foreach item="item" index="index" collection="statusList" open="(" close=")" separator=",">
  155. #{item}
  156. </foreach>
  157. </if>
  158. <if test="tempUserId != null and tempUserId != ''">
  159. and (preparation.user_id = #{tempUserId} or preparation.dispatch_user_id = #{tempUserId} or preparation.repair_user_id = #{tempUserId})
  160. </if>
  161. </sql>
  162. <select id="selectList" parameterType="com.platform.dao.dto.preparation.PreparationDTO"
  163. resultType="com.platform.dao.vo.query.preparation.PreparationVO">
  164. select preparation.*,applyU.real_name as userName,sp.name as positionName,dept.name as deptName
  165. from t_preparation as preparation join t_sys_user applyU on preparation.user_id = applyU.user_id
  166. join t_sb_position sp on preparation.position_id = sp.id
  167. join t_sys_dept dept on preparation.depart_id = dept.dept_id
  168. <where>
  169. <include refid="List_Condition"/>
  170. </where>
  171. </select>
  172. <select id="getCountByUserId" resultType="com.platform.dao.vo.query.preparation.PreparationVO"
  173. parameterType="com.platform.dao.dto.preparation.PreparationDTO">
  174. select status, count(1) counts from t_preparation
  175. <where>
  176. <if test="dispatchUserId!=null and dispatchUserId!='' ">
  177. and dispatch_user_id = #{dispatchUserId}
  178. </if>
  179. <if test="repairUserId!=null and repairUserId!=''">
  180. and repair_user_id = #{repairUserId}
  181. </if>
  182. </where>
  183. group by status
  184. </select>
  185. </mapper>