TmstruckQualityResultMapper.xml 31 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730
  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.steerinfo.dil.mapper.TmstruckQualityResultMapper">
  4. <resultMap id="BaseResultMap" type="com.steerinfo.dil.model.TmstruckQualityResult">
  5. <id column="RESULT_ID" jdbcType="DECIMAL" property="resultId" />
  6. <result column="TOTAL_RESULT_ID" jdbcType="DECIMAL" property="totalResultId" />
  7. <result column="RESULT_ISSAMPLING" jdbcType="DECIMAL" property="resultIssampling" />
  8. <result column="RESULT_DEDUCTION" jdbcType="DECIMAL" property="resultDeduction" />
  9. <result column="RESULT_DEDUCTION_DESCRIPTION" jdbcType="VARCHAR" property="resultDeductionDescription" />
  10. <result column="RESULT_SAMPLING_POINT_ID" jdbcType="DECIMAL" property="resultSamplingPointId" />
  11. <result column="RESULT_CONCLUSION" jdbcType="DECIMAL" property="resultConclusion" />
  12. <result column="INSERT_USERNAME" jdbcType="VARCHAR" property="insertUsername" />
  13. <result column="INSERT_TIME" jdbcType="TIMESTAMP" property="insertTime" />
  14. <result column="UPDATE_USERNAME" jdbcType="VARCHAR" property="updateUsername" />
  15. <result column="UPDATE_TIME" jdbcType="TIMESTAMP" property="updateTime" />
  16. <result column="INSERT_UPDATE_REMARK" jdbcType="VARCHAR" property="insertUpdateRemark" />
  17. </resultMap>
  18. <sql id="columns">
  19. RESULT_ID, TOTAL_RESULT_ID, RESULT_ISSAMPLING, RESULT_DEDUCTION, RESULT_DEDUCTION_DESCRIPTION,
  20. RESULT_SAMPLING_POINT_ID, RESULT_CONCLUSION, INSERT_USERNAME, INSERT_TIME, UPDATE_USERNAME,
  21. UPDATE_TIME, INSERT_UPDATE_REMARK
  22. </sql>
  23. <sql id="columns_alias">
  24. t.RESULT_ID, t.TOTAL_RESULT_ID, t.RESULT_ISSAMPLING, t.RESULT_DEDUCTION, t.RESULT_DEDUCTION_DESCRIPTION,
  25. t.RESULT_SAMPLING_POINT_ID, t.RESULT_CONCLUSION, t.INSERT_USERNAME, t.INSERT_TIME,
  26. t.UPDATE_USERNAME, t.UPDATE_TIME, t.INSERT_UPDATE_REMARK
  27. </sql>
  28. <sql id="select">
  29. SELECT <include refid="columns"/> FROM TMSTRUCK_QUALITY_RESULT
  30. </sql>
  31. <sql id="select_alias">
  32. SELECT <include refid="columns_alias"/> FROM TMSTRUCK_QUALITY_RESULT t
  33. </sql>
  34. <sql id="where">
  35. <where>
  36. <if test="resultId != null">
  37. and RESULT_ID = #{resultId}
  38. </if>
  39. <if test="totalResultId != null">
  40. and TOTAL_RESULT_ID = #{totalResultId}
  41. </if>
  42. <if test="resultIssampling != null">
  43. and RESULT_ISSAMPLING = #{resultIssampling}
  44. </if>
  45. <if test="resultDeduction != null">
  46. and RESULT_DEDUCTION = #{resultDeduction}
  47. </if>
  48. <if test="resultDeductionDescription != null and resultDeductionDescription != ''">
  49. and RESULT_DEDUCTION_DESCRIPTION = #{resultDeductionDescription}
  50. </if>
  51. <if test="resultSamplingPointId != null">
  52. and RESULT_SAMPLING_POINT_ID = #{resultSamplingPointId}
  53. </if>
  54. <if test="resultConclusion != null">
  55. and RESULT_CONCLUSION = #{resultConclusion}
  56. </if>
  57. <if test="insertUsername != null and insertUsername != ''">
  58. and INSERT_USERNAME = #{insertUsername}
  59. </if>
  60. <if test="insertTime != null">
  61. and TO_CHAR(INSERT_TIME,'yyyy-MM-dd') = #{insertTime}
  62. </if>
  63. <if test="updateUsername != null and updateUsername != ''">
  64. and UPDATE_USERNAME = #{updateUsername}
  65. </if>
  66. <if test="updateTime != null">
  67. and TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = #{updateTime}
  68. </if>
  69. <if test="insertUpdateRemark != null and insertUpdateRemark != ''">
  70. and INSERT_UPDATE_REMARK = #{insertUpdateRemark}
  71. </if>
  72. </where>
  73. </sql>
  74. <sql id="whereLike">
  75. <where>
  76. <if test="resultId != null">
  77. and RESULT_ID = #{resultId}
  78. </if>
  79. <if test="totalResultId != null">
  80. and TOTAL_RESULT_ID = #{totalResultId}
  81. </if>
  82. <if test="resultIssampling != null">
  83. and RESULT_ISSAMPLING = #{resultIssampling}
  84. </if>
  85. <if test="resultDeduction != null">
  86. and RESULT_DEDUCTION = #{resultDeduction}
  87. </if>
  88. <if test="resultDeductionDescription != null and resultDeductionDescription != ''">
  89. and RESULT_DEDUCTION_DESCRIPTION LIKE '%${resultDeductionDescription}%'
  90. </if>
  91. <if test="resultSamplingPointId != null">
  92. and RESULT_SAMPLING_POINT_ID = #{resultSamplingPointId}
  93. </if>
  94. <if test="resultConclusion != null">
  95. and RESULT_CONCLUSION = #{resultConclusion}
  96. </if>
  97. <if test="insertUsername != null and insertUsername != ''">
  98. and INSERT_USERNAME LIKE '%${insertUsername}%'
  99. </if>
  100. <if test="insertTime != null">
  101. and TO_CHAR(INSERT_TIME,'yyyy-MM-dd') = #{insertTime}
  102. </if>
  103. <if test="updateUsername != null and updateUsername != ''">
  104. and UPDATE_USERNAME LIKE '%${updateUsername}%'
  105. </if>
  106. <if test="updateTime != null">
  107. and TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = #{updateTime}
  108. </if>
  109. <if test="insertUpdateRemark != null and insertUpdateRemark != ''">
  110. and INSERT_UPDATE_REMARK LIKE '%${insertUpdateRemark}%'
  111. </if>
  112. </where>
  113. </sql>
  114. <delete id="deleteByPrimaryKey" parameterType="java.math.BigDecimal">
  115. delete from TMSTRUCK_QUALITY_RESULT
  116. where RESULT_ID = #{resultId,jdbcType=DECIMAL}
  117. </delete>
  118. <delete id="deleteBySelectiveElement" parameterType="java.util.HashMap">
  119. delete from TMSTRUCK_QUALITY_RESULT
  120. where 1!=1
  121. <if test="totalResultId != null">
  122. or TOTAL_RESULT_ID = #{totalResultId}
  123. </if>
  124. <if test="resultIssampling != null">
  125. or RESULT_ISSAMPLING = #{resultIssampling}
  126. </if>
  127. <if test="resultDeduction != null">
  128. or RESULT_DEDUCTION = #{resultDeduction}
  129. </if>
  130. <if test="resultDeductionDescription != null and resultDeductionDescription != ''">
  131. or RESULT_DEDUCTION_DESCRIPTION = #{resultDeductionDescription}
  132. </if>
  133. <if test="resultSamplingPointId != null">
  134. or RESULT_SAMPLING_POINT_ID = #{resultSamplingPointId}
  135. </if>
  136. <if test="resultConclusion != null">
  137. or RESULT_CONCLUSION = #{resultConclusion}
  138. </if>
  139. <if test="insertUsername != null and insertUsername != ''">
  140. or INSERT_USERNAME = #{insertUsername}
  141. </if>
  142. <if test="insertTime != null">
  143. or TO_CHAR(INSERT_TIME,'yyyy-MM-dd') = '#{insertTime}'
  144. </if>
  145. <if test="updateUsername != null and updateUsername != ''">
  146. or UPDATE_USERNAME = #{updateUsername}
  147. </if>
  148. <if test="updateTime != null">
  149. or TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = '#{updateTime}'
  150. </if>
  151. <if test="insertUpdateRemark != null and insertUpdateRemark != ''">
  152. or INSERT_UPDATE_REMARK = #{insertUpdateRemark}
  153. </if>
  154. </delete>
  155. <insert id="insert" parameterType="com.steerinfo.dil.model.TmstruckQualityResult">
  156. insert into TMSTRUCK_QUALITY_RESULT (RESULT_ID, TOTAL_RESULT_ID, RESULT_ISSAMPLING,
  157. RESULT_DEDUCTION, RESULT_DEDUCTION_DESCRIPTION,
  158. RESULT_SAMPLING_POINT_ID, RESULT_CONCLUSION,
  159. INSERT_USERNAME, INSERT_TIME, UPDATE_USERNAME,
  160. UPDATE_TIME, INSERT_UPDATE_REMARK)
  161. values (#{resultId,jdbcType=DECIMAL}, #{totalResultId,jdbcType=DECIMAL}, #{resultIssampling,jdbcType=DECIMAL},
  162. #{resultDeduction,jdbcType=DECIMAL}, #{resultDeductionDescription,jdbcType=VARCHAR},
  163. #{resultSamplingPointId,jdbcType=DECIMAL}, #{resultConclusion,jdbcType=DECIMAL},
  164. #{insertUsername,jdbcType=VARCHAR}, #{insertTime,jdbcType=TIMESTAMP}, #{updateUsername,jdbcType=VARCHAR},
  165. #{updateTime,jdbcType=TIMESTAMP}, #{insertUpdateRemark,jdbcType=VARCHAR})
  166. </insert>
  167. <insert id="insertSelective" parameterType="com.steerinfo.dil.model.TmstruckQualityResult">
  168. insert into TMSTRUCK_QUALITY_RESULT
  169. <trim prefix="(" suffix=")" suffixOverrides=",">
  170. <if test="resultId != null">
  171. RESULT_ID,
  172. </if>
  173. <if test="totalResultId != null">
  174. TOTAL_RESULT_ID,
  175. </if>
  176. <if test="resultIssampling != null">
  177. RESULT_ISSAMPLING,
  178. </if>
  179. <if test="resultDeduction != null">
  180. RESULT_DEDUCTION,
  181. </if>
  182. <if test="resultDeductionDescription != null">
  183. RESULT_DEDUCTION_DESCRIPTION,
  184. </if>
  185. <if test="resultSamplingPointId != null">
  186. RESULT_SAMPLING_POINT_ID,
  187. </if>
  188. <if test="resultConclusion != null">
  189. RESULT_CONCLUSION,
  190. </if>
  191. <if test="insertUsername != null">
  192. INSERT_USERNAME,
  193. </if>
  194. <if test="insertTime != null">
  195. INSERT_TIME,
  196. </if>
  197. <if test="updateUsername != null">
  198. UPDATE_USERNAME,
  199. </if>
  200. <if test="updateTime != null">
  201. UPDATE_TIME,
  202. </if>
  203. <if test="insertUpdateRemark != null">
  204. INSERT_UPDATE_REMARK,
  205. </if>
  206. </trim>
  207. <trim prefix="values (" suffix=")" suffixOverrides=",">
  208. <if test="resultId != null">
  209. #{resultId,jdbcType=DECIMAL},
  210. </if>
  211. <if test="totalResultId != null">
  212. #{totalResultId,jdbcType=DECIMAL},
  213. </if>
  214. <if test="resultIssampling != null">
  215. #{resultIssampling,jdbcType=DECIMAL},
  216. </if>
  217. <if test="resultDeduction != null">
  218. #{resultDeduction,jdbcType=DECIMAL},
  219. </if>
  220. <if test="resultDeductionDescription != null">
  221. #{resultDeductionDescription,jdbcType=VARCHAR},
  222. </if>
  223. <if test="resultSamplingPointId != null">
  224. #{resultSamplingPointId,jdbcType=DECIMAL},
  225. </if>
  226. <if test="resultConclusion != null">
  227. #{resultConclusion,jdbcType=DECIMAL},
  228. </if>
  229. <if test="insertUsername != null">
  230. #{insertUsername,jdbcType=VARCHAR},
  231. </if>
  232. <if test="insertTime != null">
  233. #{insertTime,jdbcType=TIMESTAMP},
  234. </if>
  235. <if test="updateUsername != null">
  236. #{updateUsername,jdbcType=VARCHAR},
  237. </if>
  238. <if test="updateTime != null">
  239. #{updateTime,jdbcType=TIMESTAMP},
  240. </if>
  241. <if test="insertUpdateRemark != null">
  242. #{insertUpdateRemark,jdbcType=VARCHAR},
  243. </if>
  244. </trim>
  245. </insert>
  246. <update id="updateByPrimaryKey" parameterType="com.steerinfo.dil.model.TmstruckQualityResult">
  247. update TMSTRUCK_QUALITY_RESULT
  248. set TOTAL_RESULT_ID = #{totalResultId,jdbcType=DECIMAL},
  249. RESULT_ISSAMPLING = #{resultIssampling,jdbcType=DECIMAL},
  250. RESULT_DEDUCTION = #{resultDeduction,jdbcType=DECIMAL},
  251. RESULT_DEDUCTION_DESCRIPTION = #{resultDeductionDescription,jdbcType=VARCHAR},
  252. RESULT_SAMPLING_POINT_ID = #{resultSamplingPointId,jdbcType=DECIMAL},
  253. RESULT_CONCLUSION = #{resultConclusion,jdbcType=DECIMAL},
  254. INSERT_USERNAME = #{insertUsername,jdbcType=VARCHAR},
  255. INSERT_TIME = #{insertTime,jdbcType=TIMESTAMP},
  256. UPDATE_USERNAME = #{updateUsername,jdbcType=VARCHAR},
  257. UPDATE_TIME = #{updateTime,jdbcType=TIMESTAMP},
  258. INSERT_UPDATE_REMARK = #{insertUpdateRemark,jdbcType=VARCHAR}
  259. where RESULT_ID = #{resultId,jdbcType=DECIMAL}
  260. </update>
  261. <update id="updateByPrimaryKeySelective" parameterType="com.steerinfo.dil.model.TmstruckQualityResult">
  262. update TMSTRUCK_QUALITY_RESULT
  263. <set>
  264. <if test="totalResultId != null">
  265. TOTAL_RESULT_ID = #{totalResultId,jdbcType=DECIMAL},
  266. </if>
  267. <if test="resultIssampling != null">
  268. RESULT_ISSAMPLING = #{resultIssampling,jdbcType=DECIMAL},
  269. </if>
  270. <if test="resultDeduction != null">
  271. RESULT_DEDUCTION = #{resultDeduction,jdbcType=DECIMAL},
  272. </if>
  273. <if test="resultDeductionDescription != null">
  274. RESULT_DEDUCTION_DESCRIPTION = #{resultDeductionDescription,jdbcType=VARCHAR},
  275. </if>
  276. <if test="resultSamplingPointId != null">
  277. RESULT_SAMPLING_POINT_ID = #{resultSamplingPointId,jdbcType=DECIMAL},
  278. </if>
  279. <if test="resultConclusion != null">
  280. RESULT_CONCLUSION = #{resultConclusion,jdbcType=DECIMAL},
  281. </if>
  282. <if test="insertUsername != null">
  283. INSERT_USERNAME = #{insertUsername,jdbcType=VARCHAR},
  284. </if>
  285. <if test="insertTime != null">
  286. INSERT_TIME = #{insertTime,jdbcType=TIMESTAMP},
  287. </if>
  288. <if test="updateUsername != null">
  289. UPDATE_USERNAME = #{updateUsername,jdbcType=VARCHAR},
  290. </if>
  291. <if test="updateTime != null">
  292. UPDATE_TIME = #{updateTime,jdbcType=TIMESTAMP},
  293. </if>
  294. <if test="insertUpdateRemark != null">
  295. INSERT_UPDATE_REMARK = #{insertUpdateRemark,jdbcType=VARCHAR},
  296. </if>
  297. </set>
  298. where RESULT_ID = #{resultId,jdbcType=DECIMAL}
  299. </update>
  300. <select id="selectByPrimaryKey" parameterType="java.math.BigDecimal" resultMap="BaseResultMap">
  301. <include refid="select"/>
  302. where RESULT_ID = #{resultId,jdbcType=DECIMAL}
  303. </select>
  304. <select id="selectByParameters" parameterType="java.util.HashMap" resultMap="BaseResultMap">
  305. <include refid="select"/>
  306. <include refid="where"/>
  307. </select>
  308. <select id="selectLikeByParameters" parameterType="java.util.HashMap" resultMap="BaseResultMap">
  309. <include refid="select"/>
  310. <include refid="whereLike"/>
  311. </select>
  312. <insert id="batchInsert" parameterType="java.util.List">
  313. insert into TMSTRUCK_QUALITY_RESULT
  314. (RESULT_ID,
  315. TOTAL_RESULT_ID, RESULT_ISSAMPLING,
  316. RESULT_DEDUCTION, RESULT_DEDUCTION_DESCRIPTION,
  317. RESULT_SAMPLING_POINT_ID, RESULT_CONCLUSION,
  318. INSERT_USERNAME, INSERT_TIME,
  319. UPDATE_USERNAME, UPDATE_TIME,
  320. INSERT_UPDATE_REMARK)
  321. ( <foreach collection="list" item="item" separator="union all">
  322. select
  323. #{item.resultId,jdbcType=DECIMAL},
  324. #{item.totalResultId,jdbcType=DECIMAL}, #{item.resultIssampling,jdbcType=DECIMAL},
  325. #{item.resultDeduction,jdbcType=DECIMAL}, #{item.resultDeductionDescription,jdbcType=VARCHAR},
  326. #{item.resultSamplingPointId,jdbcType=DECIMAL}, #{item.resultConclusion,jdbcType=DECIMAL},
  327. #{item.insertUsername,jdbcType=VARCHAR}, #{item.insertTime,jdbcType=TIMESTAMP},
  328. #{item.updateUsername,jdbcType=VARCHAR}, #{item.updateTime,jdbcType=TIMESTAMP},
  329. #{item.insertUpdateRemark,jdbcType=VARCHAR} from dual
  330. </foreach> )
  331. </insert>
  332. <update id="batchUpdate" parameterType="java.util.List">
  333. update TMSTRUCK_QUALITY_RESULT
  334. set
  335. RESULT_ID=
  336. <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
  337. when #{item.resultId,jdbcType=DECIMAL} then #{item.resultId,jdbcType=DECIMAL}
  338. </foreach>
  339. ,TOTAL_RESULT_ID=
  340. <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
  341. when #{item.resultId,jdbcType=DECIMAL} then #{item.totalResultId,jdbcType=DECIMAL}
  342. </foreach>
  343. ,RESULT_ISSAMPLING=
  344. <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
  345. when #{item.resultId,jdbcType=DECIMAL} then #{item.resultIssampling,jdbcType=DECIMAL}
  346. </foreach>
  347. ,RESULT_DEDUCTION=
  348. <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
  349. when #{item.resultId,jdbcType=DECIMAL} then #{item.resultDeduction,jdbcType=DECIMAL}
  350. </foreach>
  351. ,RESULT_DEDUCTION_DESCRIPTION=
  352. <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
  353. when #{item.resultId,jdbcType=DECIMAL} then #{item.resultDeductionDescription,jdbcType=VARCHAR}
  354. </foreach>
  355. ,RESULT_SAMPLING_POINT_ID=
  356. <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
  357. when #{item.resultId,jdbcType=DECIMAL} then #{item.resultSamplingPointId,jdbcType=DECIMAL}
  358. </foreach>
  359. ,RESULT_CONCLUSION=
  360. <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
  361. when #{item.resultId,jdbcType=DECIMAL} then #{item.resultConclusion,jdbcType=DECIMAL}
  362. </foreach>
  363. ,INSERT_USERNAME=
  364. <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
  365. when #{item.resultId,jdbcType=DECIMAL} then #{item.insertUsername,jdbcType=VARCHAR}
  366. </foreach>
  367. ,INSERT_TIME=
  368. <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
  369. when #{item.resultId,jdbcType=DECIMAL} then #{item.insertTime,jdbcType=TIMESTAMP}
  370. </foreach>
  371. ,UPDATE_USERNAME=
  372. <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
  373. when #{item.resultId,jdbcType=DECIMAL} then #{item.updateUsername,jdbcType=VARCHAR}
  374. </foreach>
  375. ,UPDATE_TIME=
  376. <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
  377. when #{item.resultId,jdbcType=DECIMAL} then #{item.updateTime,jdbcType=TIMESTAMP}
  378. </foreach>
  379. ,INSERT_UPDATE_REMARK=
  380. <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
  381. when #{item.resultId,jdbcType=DECIMAL} then #{item.insertUpdateRemark,jdbcType=VARCHAR}
  382. </foreach>
  383. where RESULT_ID in
  384. <foreach collection="list" index="index" item="item" separator="," open="(" close=")">
  385. #{item.resultId,jdbcType=DECIMAL}
  386. </foreach>
  387. </update>
  388. <delete id="batchDelete" parameterType="java.util.List">
  389. delete from TMSTRUCK_QUALITY_RESULT
  390. where RESULT_ID in
  391. <foreach collection="list" item="id" open="(" close=")" separator=",">
  392. #{id}
  393. </foreach>
  394. </delete>
  395. <!-- 友情提示!!!-->
  396. <!-- 请将自己写的代码放在此标签之下,方便以后粘贴复制。-->
  397. <!-- 通过签收时间排序 -->
  398. <sql id="orderBy">
  399. <if test="orderField != null and orderField != ''">
  400. order by "${orderField}"
  401. <if test="orderType != null and orderType != ''">
  402. ${orderType}
  403. </if>
  404. </if>
  405. <if test="orderField == null ">
  406. order by "insertTime" desc
  407. </if>
  408. </sql>
  409. <!-- 查询所有的质检作业 -->
  410. <select id="getQualityResult" parameterType="java.util.Map" resultType="java.util.LinkedHashMap">
  411. select *
  412. from (
  413. select
  414. TQR.RESULT_ID "resultId",
  415. APO.PURCHASE_ORDER_NO "purchaseOrderNo",
  416. RM.MATERIAL_NAME "materialName",
  417. DB.RESULT_FOREIGN_SHIP_NAME "resultForeignShipName",
  418. OO.ORDER_NUMBER "orderNumber",
  419. TWR.RESULT_POUND_NO "resultPoundNo",
  420. RC.CAPACITY_NUMBER "capacityNumber",
  421. TQR.RESULT_ISSAMPLING "resultIssampling",
  422. TQR.RESULT_DEDUCTION "resultDeduction",
  423. TQR.RESULT_DEDUCTION_DESCRIPTION "resultDeductionDescription",
  424. RW.WAREHOUSE_NAME "warehouseName",
  425. TQR.INSERT_TIME "insertTime"
  426. from TMSTRUCK_QUALITY_RESULT TQR
  427. left join TMSTRUCK_TOTAL_RESULT TTR
  428. on TQR.TOTAL_RESULT_ID = TTR.RESULT_TOTAL_ID
  429. left join OMSTRUCK_ORDER OO
  430. on OO.ORDER_ID = TTR.ORDER_ID
  431. left join AMS_PURCHASE_ORDER APO
  432. on APO.PURCHASE_ORDER_ID = OO.ORDER_PLAN_ID
  433. left join DIL_BATCH DB
  434. on DB.BATCH_ID = APO.BATCH_ID
  435. left join TMSTRUCK_WEIGHT_RESULT TWR
  436. on TWR.RESULT_TOTAL_ID = TQR.TOTAL_RESULT_ID
  437. left join RMS_CAPACITY RC
  438. on RC.CAPACITY_ID = OO.CAPACITY_ID
  439. left join RMS_WAREHOUSE RW
  440. on RW.WAREHOUSE_ID = TQR.RESULT_SAMPLING_POINT_ID
  441. left join RMS_MATERIAL RM
  442. on RM.MATERIAL_ID = DB.MATERIAL_ID
  443. )
  444. <where>
  445. <if test="purchaseOrderNo != null">
  446. <foreach collection="purchaseOrderNo" item="item" open="(" separator="or" close=")">
  447. "purchaseOrderNo" like '%${item}%'
  448. </foreach>
  449. </if>
  450. <if test="materialName != null">
  451. and
  452. <foreach collection="materialName" item="item" open="(" separator="or" close=")">
  453. "materialName" like '%${item}%'
  454. </foreach>
  455. </if>
  456. <if test="orderNumber != null">
  457. and
  458. <foreach collection="orderNumber" item="item" open="(" separator="or" close=")">
  459. "orderNumber" like '%${item}%'
  460. </foreach>
  461. </if>
  462. <if test="capacityNumber != null">
  463. and
  464. <foreach collection="capacityNumber" item="item" open="(" separator="or" close=")">
  465. "capacityNumber" like '%${item}%'
  466. </foreach>
  467. </if>
  468. <if test="resultForeignShipName != null">
  469. and
  470. <foreach collection="resultForeignShipName" item="item" open="(" separator="or" close=")">
  471. "resultForeignShipName" like '%${item}%'
  472. </foreach>
  473. </if>
  474. <if test="resultPoundNo != null">
  475. and
  476. <foreach collection="resultPoundNo" item="item" open="(" separator="or" close=")">
  477. "resultPoundNo" like '%${item}%'
  478. </foreach>
  479. </if>
  480. <if test="resultIssampling != null">
  481. and
  482. <foreach collection="resultIssampling" item="item" open="(" separator="or" close=")">
  483. "resultIssampling" like '%${item}%'
  484. </foreach>
  485. </if>
  486. <if test="resultDeduction != null">
  487. and
  488. <foreach collection="resultDeduction" item="item" open="(" separator="or" close=")">
  489. "resultDeduction" like '%${item}%'
  490. </foreach>
  491. </if>
  492. <if test="resultDeductionDescription != null">
  493. and
  494. <foreach collection="resultDeductionDescription" item="item" open="(" separator="or" close=")">
  495. "resultDeductionDescription" like '%${item}%'
  496. </foreach>
  497. </if>
  498. <if test="warehouseName != null">
  499. and
  500. <foreach collection="warehouseName" item="item" open="(" separator="or" close=")">
  501. "warehouseName" like '%${item}%'
  502. </foreach>
  503. </if>
  504. </where>
  505. <include refid="orderBy"></include>
  506. </select>
  507. <!-- 通过ID查询质检作业实绩 -->
  508. <select id="getQualityResultById" parameterType="int" resultType="java.util.Map">
  509. select
  510. OO.ORDER_NUMBER "orderNumber",
  511. TWR.RESULT_POUND_NO "resultPoundNo",
  512. RC.CAPACITY_NUMBER "capacityNumber",
  513. TQR.RESULT_ISSAMPLING "resultIssampling",
  514. TQR.RESULT_DEDUCTION "resultDeduction",
  515. TQR.RESULT_DEDUCTION_DESCRIPTION "resultDeductionDescription",
  516. TQR.RESULT_SAMPLING_POINT_ID "resultSamplingPointId"
  517. from TMSTRUCK_QUALITY_RESULT TQR
  518. left join TMSTRUCK_TOTAL_RESULT TTR
  519. on TQR.TOTAL_RESULT_ID = TTR.RESULT_TOTAL_ID
  520. left join OMSTRUCK_ORDER OO
  521. on OO.ORDER_ID = TTR.ORDER_ID
  522. left join RMS_CAPACITY RC
  523. on RC.CAPACITY_ID = OO.CAPACITY_ID
  524. left join TMSTRUCK_WEIGHT_RESULT TWR
  525. on TWR.RESULT_TOTAL_ID = TQR.TOTAL_RESULT_ID
  526. where RESULT_ID = #{resultId}
  527. </select>
  528. <select id="getInwardQualityResult" parameterType="java.util.Map" resultType="java.util.LinkedHashMap">
  529. select
  530. *
  531. from(
  532. select TQR.RESULT_ID "resultId",
  533. APO.PURCHASE_ORDER_NO "purchaseOrderNo",
  534. RM.MATERIAL_NAME "materialName",
  535. DB.RESULT_FOREIGN_SHIP_NAME "resultForeignShipName",
  536. OO.ORDER_NUMBER "orderNumber",
  537. TWR.RESULT_POUND_NO "resultPoundNo",
  538. RC.CAPACITY_NUMBER "capacityNumber",
  539. TQR.RESULT_ISSAMPLING "resultIssampling",
  540. TQR.RESULT_DEDUCTION "resultDeduction",
  541. TQR.RESULT_DEDUCTION_DESCRIPTION "resultDeductionDescription",
  542. RW.WAREHOUSE_NAME "warehouseName",
  543. TQR.INSERT_TIME "insertTime"
  544. from TMSTRUCK_QUALITY_RESULT TQR
  545. left join rms_warehouse rw
  546. on rw.warehouse_id = tqr.result_sampling_point_id
  547. left join TMSTRUCK_TOTAL_RESULT TTR
  548. on TQR.TOTAL_RESULT_ID = TTR.RESULT_TOTAL_ID
  549. left join OMSTRUCK_ORDER OO
  550. on OO.ORDER_ID = TTR.ORDER_ID
  551. left join tmstruck_weight_result twr
  552. on twr.result_total_id = ttr.result_total_id
  553. left join rms_capacity rc
  554. on rc.capacity_id = oo.capacity_id
  555. left join amstruck_inward_plan aip
  556. on aip.plan_id = oo.order_plan_id
  557. left join amstruck_requirement_plan arp
  558. on arp.plan_id = aip.plan_id
  559. left join amstruck_inward_requirement air
  560. on air.requirement_id = arp.requirement_id
  561. left join ams_purchase_order apo
  562. on apo.purchase_order_id = air.purchase_order_id
  563. left join dil_batch db
  564. on db.batch_id = apo.batch_id
  565. left join rms_material rm
  566. on rm.material_id = db.material_id
  567. where oo.order_type = #{orderTypee}
  568. )
  569. <where>
  570. <if test="purchaseOrderNo != null">
  571. <foreach collection="purchaseOrderNo" item="item" open="(" separator="or" close=")">
  572. "purchaseOrderNo" like '%${item}%'
  573. </foreach>
  574. </if>
  575. <if test="materialName != null">
  576. and
  577. <foreach collection="materialName" item="item" open="(" separator="or" close=")">
  578. "materialName" like '%${item}%'
  579. </foreach>
  580. </if>
  581. <if test="orderNumber != null">
  582. and
  583. <foreach collection="orderNumber" item="item" open="(" separator="or" close=")">
  584. "orderNumber" like '%${item}%'
  585. </foreach>
  586. </if>
  587. <if test="capacityNumber != null">
  588. and
  589. <foreach collection="capacityNumber" item="item" open="(" separator="or" close=")">
  590. "capacityNumber" like '%${item}%'
  591. </foreach>
  592. </if>
  593. <if test="resultForeignShipName != null">
  594. and
  595. <foreach collection="resultForeignShipName" item="item" open="(" separator="or" close=")">
  596. "resultForeignShipName" like '%${item}%'
  597. </foreach>
  598. </if>
  599. <if test="resultPoundNo != null">
  600. and
  601. <foreach collection="resultPoundNo" item="item" open="(" separator="or" close=")">
  602. "resultPoundNo" like '%${item}%'
  603. </foreach>
  604. </if>
  605. <if test="resultIssampling != null">
  606. and
  607. <foreach collection="resultIssampling" item="item" open="(" separator="or" close=")">
  608. "resultIssampling" like '%${item}%'
  609. </foreach>
  610. </if>
  611. <if test="resultDeduction != null">
  612. and
  613. <foreach collection="resultDeduction" item="item" open="(" separator="or" close=")">
  614. "resultDeduction" like '%${item}%'
  615. </foreach>
  616. </if>
  617. <if test="resultDeductionDescription != null">
  618. and
  619. <foreach collection="resultDeductionDescription" item="item" open="(" separator="or" close=")">
  620. "resultDeductionDescription" like '%${item}%'
  621. </foreach>
  622. </if>
  623. <if test="warehouseName != null">
  624. and
  625. <foreach collection="warehouseName" item="item" open="(" separator="or" close=")">
  626. "warehouseName" like '%${item}%'
  627. </foreach>
  628. </if>
  629. </where>
  630. <include refid="orderBy"></include>
  631. </select>
  632. <!-- 查询销售废钢材物资单拼 -->
  633. <select id="getSaleQualityResult" parameterType="java.util.Map" resultType="java.util.Map" >
  634. SELECT *
  635. FROM (
  636. SELECT ASO.SALE_NUMBER AS "saleNumber",
  637. RM.MATERIAL_NAME AS "materialName",
  638. OO.ORDER_NUMBER AS "orderNumber",
  639. RCA.CAPACITY_NUMBER AS "capacityNumber",
  640. TQR.RESULT_ISSAMPLING AS "resultIssampling",
  641. TQR.RESULT_DEDUCTION AS "resultDeduction",
  642. TQR.RESULT_DEDUCTION_DESCRIPTION AS "resultDeductionDescription",
  643. RW.WAREHOUSE_NAME AS "warehouseName",
  644. TQR.RESULT_SAMPLING_TIME AS "insertTime",
  645. TQR.RESULT_ID AS "resultId"
  646. FROM TMSTRUCK_QUALITY_RESULT TQR
  647. LEFT JOIN TMSTRUCK_TOTAL_RESULT TTR
  648. ON TQR.TOTAL_RESULT_ID = TTR.RESULT_TOTAL_ID
  649. LEFT JOIN OMSTRUCK_ORDER OO
  650. ON OO.ORDER_ID = TTR.ORDER_ID
  651. LEFT JOIN OMSTRUCK_ORDER_MATERIAL OOM
  652. ON OOM.ORDER_ID = OO.ORDER_ID
  653. LEFT JOIN AMS_SALE_ORDER_MATERIAL ASOM
  654. ON ASOM.SALE_ORDER_MATERIAL_ID = OO.ORDER_PLAN_ID
  655. LEFT JOIN AMS_SALE_ORDER ASO
  656. ON ASO.SALE_ORDER_ID = ASOM.SALE_ORDER_ID
  657. LEFT JOIN RMS_MATERIAL RM
  658. ON RM.MATERIAL_ID = OOM.MATERIAL_ID
  659. LEFT JOIN RMS_SHIPPER RS
  660. ON RS.SHIPPER_ID = ASO.SHIPPER_ID
  661. LEFT JOIN RMS_CONSIGNEE RCO
  662. ON RCO.CONSIGNEE_ID = ASO.RECEIVE_ID
  663. LEFT JOIN RMS_CAPACITY RCA
  664. ON RCA.CAPACITY_ID = OO.CAPACITY_ID
  665. LEFT JOIN RMS_WAREHOUSE RW
  666. ON RW.WAREHOUSE_ID = TQR.RESULT_SAMPLING_POINT_ID
  667. WHERE OO.ORDER_TYPE = #{orderTypee}
  668. )
  669. <where>
  670. <if test="saleNumber != null">
  671. <foreach collection="saleNumber" item="item" open="(" separator="or" close=")">
  672. "saleNumber" like '%${item}%'
  673. </foreach>
  674. </if>
  675. <if test="materialName != null">
  676. and
  677. <foreach collection="materialName" item="item" open="(" separator="or" close=")">
  678. "materialName" like '%${item}%'
  679. </foreach>
  680. </if>
  681. <if test="orderNumber != null">
  682. and
  683. <foreach collection="orderNumber" item="item" open="(" separator="or" close=")">
  684. "orderNumber" like '%${item}%'
  685. </foreach>
  686. </if>
  687. <if test="capacityNumber != null">
  688. and
  689. <foreach collection="capacityNumber" item="item" open="(" separator="or" close=")">
  690. "capacityNumber" like '%${item}%'
  691. </foreach>
  692. </if>
  693. <if test="resultIssampling != null">
  694. and
  695. <foreach collection="resultIssampling" item="item" open="(" separator="or" close=")">
  696. "resultIssampling" like '%${item}%'
  697. </foreach>
  698. </if>
  699. <if test="resultDeduction != null">
  700. and
  701. <foreach collection="resultDeduction" item="item" open="(" separator="or" close=")">
  702. "resultDeduction" like '%${item}%'
  703. </foreach>
  704. </if>
  705. <if test="resultDeductionDescription != null">
  706. and
  707. <foreach collection="resultDeductionDescription" item="item" open="(" separator="or" close=")">
  708. "resultDeductionDescription" like '%${item}%'
  709. </foreach>
  710. </if>
  711. <if test="warehouseName != null">
  712. and
  713. <foreach collection="warehouseName" item="item" open="(" separator="or" close=")">
  714. "warehouseName" like '%${item}%'
  715. </foreach>
  716. </if>
  717. <if test="insertTime != null">
  718. and
  719. <foreach collection="insertTime" item="item" open="(" separator="or" close=")">
  720. "insertTime" like '%${item}%'
  721. </foreach>
  722. </if>
  723. </where>
  724. <include refid="orderBy"></include>
  725. </select>
  726. </mapper>