SbInfoMeasureMapper.xml 9.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328
  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.sb.SbInfoMeasureMapper">
  4. <sql id="Base_Column_List">
  5. id
  6. , no,
  7. financing_no,
  8. financing_no_two,
  9. financing_no_third,
  10. financing_no_four,
  11. financing_no_five,
  12. param_list,
  13. name, model_id,
  14. is_child,
  15. is_show,
  16. is_financing,
  17. type_id, level, initial_value, current_value, cut_value,
  18. producer_id, source_type, source_sb_id, parent_id, unit, position_id,
  19. use_area,
  20. check_id,
  21. rate,
  22. month,
  23. used_month,
  24. card_no,
  25. use_company,
  26. use_project,
  27. use_dept,
  28. use_group,
  29. use_user,
  30. save_dept,
  31. save_user,
  32. repair_user,
  33. buy_date, start_date, next_check_date, guarantee_date, work_year, retirement_date,
  34. depreciation_type, wb_file, use_file, check_file, sb_image, qr_code, status, remark,
  35. created_user_id, update_user_id, created_time, update_time,
  36. zzh,
  37. fdjxh,
  38. fdjh,
  39. cph,
  40. dph,
  41. zz,
  42. zaiz,
  43. last_repaire_time,
  44. repaire_times,
  45. last_baoyang_time,
  46. last_baoyang_hours,
  47. last_baoyang_miles,
  48. baoyang_times,
  49. rl_type,
  50. color,
  51. use_type,
  52. seat_number,
  53. zjm,
  54. sp_date,
  55. jbdh,
  56. sbdh,
  57. jbd_date,
  58. sbd_date,
  59. bxgs,
  60. sb_date,
  61. check_date,
  62. check_period,
  63. register_no,
  64. character_type,
  65. used_no,
  66. supplier,
  67. repair_user_second,
  68. batch_no,
  69. register_date,
  70. zbh,
  71. refuse_reason,
  72. apply_time,
  73. audit_time,
  74. submit_time,
  75. process_instance_id,
  76. audit_node,
  77. remark,
  78. apply_comment,
  79. scrap_user_id,
  80. scrap_user_name
  81. </sql>
  82. <sql id="Left_Column">
  83. sb
  84. .
  85. id
  86. , sb.no,
  87. sb.financing_no_two,
  88. sb.financing_no_third,
  89. sb.financing_no_four,
  90. sb.financing_no_five,
  91. sb.financing_no,
  92. sb.name, sb.initial_value,
  93. sb.current_value, sb.cut_value,
  94. sb.is_child,
  95. sb.is_financing,
  96. sb.parent_id,
  97. sb.param_list,
  98. sb.is_show,
  99. sb.unit, sb.position_id,
  100. sb.use_area,
  101. sb.rate,
  102. sb.month,
  103. sb.used_month,
  104. sb.card_no,
  105. sb.check_id,
  106. sb.use_company,
  107. sb.use_project,
  108. sb.use_dept,
  109. sb.use_group,
  110. sb.use_user,
  111. sb.save_dept,
  112. sb.save_user,
  113. sb.repair_user,
  114. sb.buy_date, sb.start_date, sb.next_check_date, sb.guarantee_date, sb.work_year,
  115. sb.retirement_date,
  116. sb.depreciation_type, sb.wb_file, sb.use_file, sb.check_file, sb.sb_image, sb.qr_code, sb.status, sb.remark,
  117. sb.created_user_id, sb.update_user_id, sb.created_time, sb.update_time,
  118. sb.model_id,
  119. sb.zzh,
  120. sb.fdjxh,
  121. sb.fdjh,
  122. sb.cph,
  123. sb.dph,
  124. sb.zz,
  125. sb.zaiz,
  126. sb.last_repaire_time,
  127. sb.repaire_times,
  128. sb.last_baoyang_time,
  129. sb.last_baoyang_hours,
  130. sb.last_baoyang_miles,
  131. sb.use_type,
  132. sb.baoyang_times,
  133. sb.rl_type,
  134. sb.color,
  135. sb.seat_number,
  136. sb.zjm,
  137. sb.sp_date,
  138. sb.jbdh,
  139. sb.sbdh,
  140. sb.total_hours,
  141. sb.total_miles,
  142. sb.jbd_date,
  143. sb.sbd_date,
  144. sb.bxgs,
  145. sb.sb_date,
  146. sb.type_id as typeId,
  147. sb.name_model as nameModel,
  148. sb.model,
  149. sb.producer_id as producerId,
  150. sb.level,
  151. sb.unit,
  152. sb.use_type as useType,
  153. sb.check_date,
  154. sb.check_period,
  155. sb.register_no,
  156. sb.character_type,
  157. sb.used_no,
  158. sb.zbh,
  159. sb.supplier,
  160. sb.repair_user_second,
  161. sb.batch_no,
  162. sb.register_date,
  163. sb.refuse_reason,
  164. sb.apply_time,
  165. sb.audit_time,
  166. sb.submit_time,
  167. sb.process_instance_id,
  168. sb.audit_node,
  169. sb.remark,
  170. sb.apply_comment,
  171. sb.scrap_user_id,
  172. sb.scrap_user_name
  173. </sql>
  174. <sql id="deptSql">
  175. <if test="saveDept != null and saveDept != ''">
  176. and sb.save_dept = #{saveDept}
  177. </if>
  178. </sql>
  179. <select id="selectVOList" parameterType="com.platform.dao.dto.sb.SbInfoMeasureDTO"
  180. resultType="com.platform.dao.vo.sb.SbInfoMeasureVO">
  181. select
  182. <include refid="Left_Column"/>
  183. from t_sb_info_measure sb
  184. where
  185. 1 = 1
  186. <if test="keyword != null and keyword != ''">
  187. and (
  188. sb.name like concat('%',#{keyword},'%')
  189. or
  190. sb.no like concat('%',#{keyword},'%')
  191. or
  192. sb.card_no like concat('%',#{keyword},'%')
  193. )
  194. </if>
  195. <if test="isFinancing != null">
  196. and sb.is_financing like concat('%',#{isFinancing},'%')
  197. </if>
  198. <if test="zzh != null">
  199. and sb.zzh like concat('%',#{zzh},'%')
  200. </if>
  201. <if test="model != null">
  202. and sb.model like concat('%',#{model},'%')
  203. </if>
  204. <if test="useDept != null">
  205. and sb.use_dept like concat('%',#{useDept},'%')
  206. </if>
  207. <if test="nextCheckDateStart != null">
  208. and sb.next_check_date <![CDATA[ >= ]]> #{nextCheckDateStart}
  209. </if>
  210. <if test="nextCheckDateEnd != null">
  211. and sb.next_check_date <![CDATA[ <= ]]> #{nextCheckDateEnd}
  212. </if>
  213. <if test="status != null">
  214. and sb.status = #{status}
  215. </if>
  216. <if test="cardNo != null">
  217. and sb.card_no like concat('%',#{cardNo},'%')
  218. </if>
  219. <if test="seatNumber != null">
  220. and TIMESTAMPDIFF( DAY, CURDATE( ), sb.next_check_date ) <![CDATA[ <= ]]> sb.seat_number
  221. </if>
  222. <if test="notStatusList != null and notStatusList.size > 0">
  223. AND sb.status not in
  224. <foreach item="item" index="index" collection="notStatusList" open="(" close=")" separator=",">
  225. #{item}
  226. </foreach>
  227. </if>
  228. <if test="statusList != null and statusList.size > 0">
  229. AND sb.status in
  230. <foreach item="item" index="index" collection="statusList" open="(" close=")" separator=",">
  231. #{item}
  232. </foreach>
  233. </if>
  234. <if test="sbIds != null and sbIds.size > 0">
  235. AND sb.id in
  236. <foreach item="item" index="index" collection="sbIds" open="(" close=")" separator=",">
  237. #{item}
  238. </foreach>
  239. </if>
  240. </select>
  241. <select id="selectPageInfoForWarn" parameterType="com.platform.dao.dto.sb.SbInfoMeasureDTO"
  242. resultType="com.platform.dao.vo.sb.SbInfoMeasureVO">
  243. select
  244. <include refid="Left_Column"/>
  245. from t_sb_info_measure sb
  246. where
  247. TIMESTAMPDIFF( DAY, CURDATE( ), sb.next_check_date ) <![CDATA[ <= ]]> sb.seat_number
  248. <if test="keyword != null and keyword != ''">
  249. and (
  250. sb.name like concat('%',#{keyword},'%')
  251. or
  252. sb.no like concat('%',#{keyword},'%')
  253. or
  254. sb.card_no like concat('%',#{keyword},'%')
  255. )
  256. </if>
  257. <if test="zzh != null">
  258. and sb.zzh = #{zzh}
  259. </if>
  260. <if test="isFinancing != null">
  261. and sb.is_financing = #{isFinancing}
  262. </if>
  263. <if test="useProject != null">
  264. and sb.use_project = #{useProject}
  265. </if>
  266. <if test="zzh != null">
  267. and sb.zzh like concat('%',#{zzh},'%')
  268. </if>
  269. <if test="model != null">
  270. and sb.model like concat('%',#{model},'%')
  271. </if>
  272. <if test="useDept != null">
  273. and sb.use_dept like concat('%',#{useDept},'%')
  274. </if>
  275. <if test="nextCheckDateStart != null">
  276. and sb.next_check_date <![CDATA[ >= ]]> #{nextCheckDateStart}
  277. </if>
  278. <if test="nextCheckDateEnd != null">
  279. and sb.next_check_date <![CDATA[ <= ]]> #{nextCheckDateEnd}
  280. </if>
  281. <if test="status != null">
  282. and sb.status = #{status}
  283. </if>
  284. <if test="cardNo != null">
  285. and sb.card_no like concat('%',#{cardNo},'%')
  286. </if>
  287. <if test="notStatusList != null and notStatusList.size > 0">
  288. AND sb.status not in
  289. <foreach item="item" index="index" collection="notStatusList" open="(" close=")" separator=",">
  290. #{item}
  291. </foreach>
  292. </if>
  293. <if test="statusList != null and statusList.size > 0">
  294. AND sb.status in
  295. <foreach item="item" index="index" collection="statusList" open="(" close=")" separator=",">
  296. #{item}
  297. </foreach>
  298. </if>
  299. </select>
  300. <select id="getById" parameterType="java.lang.Object" resultType="com.platform.dao.vo.sb.SbInfoMeasureVO">
  301. select
  302. <include refid="Left_Column"/>
  303. from t_sb_info_measure sb
  304. where sb.id = #{value}
  305. </select>
  306. <select id="getByNo" parameterType="java.lang.Object" resultType="com.platform.dao.vo.sb.SbInfoMeasureVO">
  307. select
  308. <include refid="Left_Column"/>
  309. from t_sb_info_measure sb
  310. where sb.no = #{value}
  311. </select>
  312. <select id="getByIds" parameterType="java.util.List" resultType="com.platform.dao.vo.sb.SbInfoMeasureVO">
  313. select
  314. <include refid="Left_Column"/>
  315. from t_sb_info_measure sb
  316. where sb.id in
  317. <foreach item="item" index="index" collection="ids" open="(" close=")" separator=",">
  318. #{item}
  319. </foreach>
  320. </select>
  321. </mapper>