TmstruckReceiptResultMapper.xml 30 KB

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