TmstruckReceiptResultMapper.xml 45 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123
  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="RESULT_EMPTY_CONTAINER_PHOTO" jdbcType="VARCHAR" property="resultEmptyContainerPhoto" />
  8. <result column="RESULT_SIGNED_NOTE_PHOTO" jdbcType="VARCHAR" property="resultSignedNotePhoto" />
  9. <result column="RESULT_RECEIVE_NOTE_PHOTO" jdbcType="VARCHAR" property="resultReceiveNotePhoto" />
  10. <result column="WAREHOUSE_ID" jdbcType="DECIMAL" property="warehouseId" />
  11. <result column="ORDER_MILEAGE" jdbcType="DECIMAL" property="orderMileage" />
  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="STATUS" jdbcType="DECIMAL" property="status" />
  17. <result column="INSERT_UPDATE_REMARK" jdbcType="VARCHAR" property="insertUpdateRemark" />
  18. <result column="RESULT_ARRIVAL_ADDRESS" jdbcType="VARCHAR" property="resultArrivalAddress" />
  19. </resultMap>
  20. <sql id="columns">
  21. RESULT_ID, RESULT_TOTAL_ID, RESULT_EMPTY_CONTAINER_PHOTO, RESULT_SIGNED_NOTE_PHOTO,
  22. RESULT_RECEIVE_NOTE_PHOTO, WAREHOUSE_ID,ORDER_MILEAGE, INSERT_USERNAME, INSERT_TIME, UPDATE_USERNAME,
  23. UPDATE_TIME,STATUS, INSERT_UPDATE_REMARK, RESULT_ARRIVAL_ADDRESS
  24. </sql>
  25. <sql id="columns_alias">
  26. t.RESULT_ID, t.RESULT_TOTAL_ID, t.RESULT_EMPTY_CONTAINER_PHOTO, t.RESULT_SIGNED_NOTE_PHOTO,
  27. t.RESULT_RECEIVE_NOTE_PHOTO, t.WAREHOUSE_ID,ORDER_MILEAGE, t.INSERT_USERNAME, t.INSERT_TIME, t.UPDATE_USERNAME,
  28. t.UPDATE_TIME,STATUS, t.INSERT_UPDATE_REMARK, t.RESULT_ARRIVAL_ADDRESS
  29. </sql>
  30. <sql id="select">
  31. SELECT <include refid="columns" /> FROM TMSTRUCK_RECEIPT_RESULT
  32. </sql>
  33. <sql id="select_alias">
  34. SELECT <include refid="columns_alias" /> FROM TMSTRUCK_RECEIPT_RESULT t
  35. </sql>
  36. <sql id="where">
  37. <where>
  38. <if test="resultId != null">
  39. and RESULT_ID = #{resultId}
  40. </if>
  41. <if test="resultTotalId != null">
  42. and RESULT_TOTAL_ID = #{resultTotalId}
  43. </if>
  44. <if test="resultEmptyContainerPhoto != null and resultEmptyContainerPhoto != ''">
  45. and RESULT_EMPTY_CONTAINER_PHOTO = #{resultEmptyContainerPhoto}
  46. </if>
  47. <if test="resultSignedNotePhoto != null and resultSignedNotePhoto != ''">
  48. and RESULT_SIGNED_NOTE_PHOTO = #{resultSignedNotePhoto}
  49. </if>
  50. <if test="resultReceiveNotePhoto != null and resultReceiveNotePhoto != ''">
  51. and RESULT_RECEIVE_NOTE_PHOTO = #{resultReceiveNotePhoto}
  52. </if>
  53. <if test="warehouseId != null">
  54. and WAREHOUSE_ID = #{warehouseId}
  55. </if>
  56. <if test="orderMileage != null">
  57. and ORDER_MILEAGE = #{orderMileage}
  58. </if>
  59. <if test="insertUsername != null and insertUsername != ''">
  60. and INSERT_USERNAME = #{insertUsername}
  61. </if>
  62. <if test="insertTime != null">
  63. and TO_CHAR(INSERT_TIME,'yyyy-MM-dd') = #{insertTime}
  64. </if>
  65. <if test="updateUsername != null and updateUsername != ''">
  66. and UPDATE_USERNAME = #{updateUsername}
  67. </if>
  68. <if test="updateTime != null">
  69. and TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = #{updateTime}
  70. </if>
  71. <if test="status != null">
  72. and STATUS = #{status}
  73. </if>
  74. <if test="insertUpdateRemark != null and insertUpdateRemark != ''">
  75. and INSERT_UPDATE_REMARK = #{insertUpdateRemark}
  76. </if>
  77. <if test="resultArrivalAddress != null and resultArrivalAddress != ''">
  78. and RESULT_ARRIVAL_ADDRESS = #{resultArrivalAddress}
  79. </if>
  80. </where>
  81. </sql>
  82. <sql id="whereLike">
  83. <where>
  84. <if test="resultId != null">
  85. and RESULT_ID = #{resultId}
  86. </if>
  87. <if test="resultTotalId != null">
  88. and RESULT_TOTAL_ID = #{resultTotalId}
  89. </if>
  90. <if test="resultEmptyContainerPhoto != null and resultEmptyContainerPhoto != ''">
  91. and RESULT_EMPTY_CONTAINER_PHOTO LIKE '%${resultEmptyContainerPhoto}%'
  92. </if>
  93. <if test="resultSignedNotePhoto != null and resultSignedNotePhoto != ''">
  94. and RESULT_SIGNED_NOTE_PHOTO LIKE '%${resultSignedNotePhoto}%'
  95. </if>
  96. <if test="resultReceiveNotePhoto != null and resultReceiveNotePhoto != ''">
  97. and RESULT_RECEIVE_NOTE_PHOTO LIKE '%${resultReceiveNotePhoto}%'
  98. </if>
  99. <if test="warehouseId != null">
  100. and WAREHOUSE_ID = #{warehouseId}
  101. </if>
  102. <if test="orderMileage != null">
  103. and ORDER_MILEAGE = #{orderMileage}
  104. </if>
  105. <if test="insertUsername != null and insertUsername != ''">
  106. and INSERT_USERNAME LIKE '%${insertUsername}%'
  107. </if>
  108. <if test="insertTime != null">
  109. and TO_CHAR(INSERT_TIME,'yyyy-MM-dd') = #{insertTime}
  110. </if>
  111. <if test="updateUsername != null and updateUsername != ''">
  112. and UPDATE_USERNAME LIKE '%${updateUsername}%'
  113. </if>
  114. <if test="updateTime != null">
  115. and TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = #{updateTime}
  116. </if>
  117. <if test="status != null">
  118. and STATUS = #{status}
  119. </if>
  120. <if test="insertUpdateRemark != null and insertUpdateRemark != ''">
  121. and INSERT_UPDATE_REMARK LIKE '%${insertUpdateRemark}%'
  122. </if>
  123. <if test="resultArrivalAddress != null and resultArrivalAddress != ''">
  124. and RESULT_ARRIVAL_ADDRESS LIKE '%${resultArrivalAddress}%'
  125. </if>
  126. </where>
  127. </sql>
  128. <delete id="deleteByPrimaryKey" parameterType="java.math.BigDecimal">
  129. delete from TMSTRUCK_RECEIPT_RESULT
  130. where RESULT_ID = #{resultId,jdbcType=DECIMAL}
  131. </delete>
  132. <delete id="deleteBySelectiveElement" parameterType="java.util.HashMap">
  133. delete from TMSTRUCK_RECEIPT_RESULT
  134. where 1!=1
  135. <if test="resultTotalId != null">
  136. or RESULT_TOTAL_ID = #{resultTotalId}
  137. </if>
  138. <if test="resultEmptyContainerPhoto != null and resultEmptyContainerPhoto != ''">
  139. or RESULT_EMPTY_CONTAINER_PHOTO = #{resultEmptyContainerPhoto}
  140. </if>
  141. <if test="resultSignedNotePhoto != null and resultSignedNotePhoto != ''">
  142. or RESULT_SIGNED_NOTE_PHOTO = #{resultSignedNotePhoto}
  143. </if>
  144. <if test="resultReceiveNotePhoto != null and resultReceiveNotePhoto != ''">
  145. or RESULT_RECEIVE_NOTE_PHOTO = #{resultReceiveNotePhoto}
  146. </if>
  147. <if test="warehouseId != null">
  148. or WAREHOUSE_ID = #{warehouseId}
  149. </if>
  150. <if test="orderMileage != null">
  151. or ORDER_MILEAGE = #{orderMileage}
  152. </if>
  153. <if test="insertUsername != null and insertUsername != ''">
  154. or INSERT_USERNAME = #{insertUsername}
  155. </if>
  156. <if test="insertTime != null">
  157. or TO_CHAR(INSERT_TIME,'yyyy-MM-dd') = '#{insertTime}'
  158. </if>
  159. <if test="updateUsername != null and updateUsername != ''">
  160. or UPDATE_USERNAME = #{updateUsername}
  161. </if>
  162. <if test="updateTime != null">
  163. or TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = '#{updateTime}'
  164. </if>
  165. <if test="status != null">
  166. or STATUS = '#{status}'
  167. </if>
  168. <if test="insertUpdateRemark != null and insertUpdateRemark != ''">
  169. or INSERT_UPDATE_REMARK = #{insertUpdateRemark}
  170. </if>
  171. <if test="resultArrivalAddress != null and resultArrivalAddress != ''">
  172. or RESULT_ARRIVAL_ADDRESS = #{resultArrivalAddress}
  173. </if>
  174. </delete>
  175. <insert id="insert" parameterType="com.steerinfo.dil.model.TmstruckReceiptResult">
  176. insert into TMSTRUCK_RECEIPT_RESULT (RESULT_ID, RESULT_TOTAL_ID, RESULT_EMPTY_CONTAINER_PHOTO,
  177. RESULT_SIGNED_NOTE_PHOTO, RESULT_RECEIVE_NOTE_PHOTO,
  178. WAREHOUSE_ID,ORDER_MILEAGE, INSERT_USERNAME, INSERT_TIME,
  179. UPDATE_USERNAME, UPDATE_TIME,STATUS, INSERT_UPDATE_REMARK,
  180. RESULT_ARRIVAL_ADDRESS)
  181. values (#{resultId,jdbcType=DECIMAL}, #{resultTotalId,jdbcType=DECIMAL}, #{resultEmptyContainerPhoto,jdbcType=VARCHAR},
  182. #{resultSignedNotePhoto,jdbcType=VARCHAR}, #{resultReceiveNotePhoto,jdbcType=VARCHAR},
  183. #{warehouseId,jdbcType=DECIMAL},#{orderMileage,jdbcType=DECIMAL}, #{insertUsername,jdbcType=VARCHAR}, #{insertTime,jdbcType=TIMESTAMP},
  184. #{updateUsername,jdbcType=VARCHAR}, #{updateTime,jdbcType=TIMESTAMP},#{status,jdbcType=DECIMAL}, #{insertUpdateRemark,jdbcType=VARCHAR},
  185. #{resultArrivalAddress,jdbcType=VARCHAR})
  186. </insert>
  187. <insert id="insertSelective" parameterType="com.steerinfo.dil.model.TmstruckReceiptResult">
  188. insert into TMSTRUCK_RECEIPT_RESULT
  189. <trim prefix="(" suffix=")" suffixOverrides=",">
  190. <if test="resultId != null">
  191. RESULT_ID,
  192. </if>
  193. <if test="resultTotalId != null">
  194. RESULT_TOTAL_ID,
  195. </if>
  196. <if test="resultEmptyContainerPhoto != null">
  197. RESULT_EMPTY_CONTAINER_PHOTO,
  198. </if>
  199. <if test="resultSignedNotePhoto != null">
  200. RESULT_SIGNED_NOTE_PHOTO,
  201. </if>
  202. <if test="resultReceiveNotePhoto != null">
  203. RESULT_RECEIVE_NOTE_PHOTO,
  204. </if>
  205. <if test="warehouseId != null">
  206. WAREHOUSE_ID,
  207. </if>
  208. <if test="orderMileage != null">
  209. ORDER_MILEAGE,
  210. </if>
  211. <if test="insertUsername != null">
  212. INSERT_USERNAME,
  213. </if>
  214. <if test="insertTime != null">
  215. INSERT_TIME,
  216. </if>
  217. <if test="updateUsername != null">
  218. UPDATE_USERNAME,
  219. </if>
  220. <if test="updateTime != null">
  221. UPDATE_TIME,
  222. </if>
  223. <if test="status != null">
  224. STATUS,
  225. </if>
  226. <if test="insertUpdateRemark != null">
  227. INSERT_UPDATE_REMARK,
  228. </if>
  229. <if test="resultArrivalAddress != null">
  230. RESULT_ARRIVAL_ADDRESS,
  231. </if>
  232. </trim>
  233. <trim prefix="values (" suffix=")" suffixOverrides=",">
  234. <if test="resultId != null">
  235. #{resultId,jdbcType=DECIMAL},
  236. </if>
  237. <if test="resultTotalId != null">
  238. #{resultTotalId,jdbcType=DECIMAL},
  239. </if>
  240. <if test="resultEmptyContainerPhoto != null">
  241. #{resultEmptyContainerPhoto,jdbcType=VARCHAR},
  242. </if>
  243. <if test="resultSignedNotePhoto != null">
  244. #{resultSignedNotePhoto,jdbcType=VARCHAR},
  245. </if>
  246. <if test="resultReceiveNotePhoto != null">
  247. #{resultReceiveNotePhoto,jdbcType=VARCHAR},
  248. </if>
  249. <if test="warehouseId != null">
  250. #{warehouseId,jdbcType=DECIMAL},
  251. </if>
  252. <if test="orderMileage != null">
  253. #{orderMileage,jdbcType=DECIMAL},
  254. </if>
  255. <if test="insertUsername != null">
  256. #{insertUsername,jdbcType=VARCHAR},
  257. </if>
  258. <if test="insertTime != null">
  259. #{insertTime,jdbcType=TIMESTAMP},
  260. </if>
  261. <if test="updateUsername != null">
  262. #{updateUsername,jdbcType=VARCHAR},
  263. </if>
  264. <if test="updateTime != null">
  265. #{updateTime,jdbcType=TIMESTAMP},
  266. </if>
  267. <if test="status != null">
  268. #{status,jdbcType=TIMESTAMP},
  269. </if>
  270. <if test="insertUpdateRemark != null">
  271. #{insertUpdateRemark,jdbcType=VARCHAR},
  272. </if>
  273. <if test="resultArrivalAddress != null">
  274. #{resultArrivalAddress,jdbcType=VARCHAR},
  275. </if>
  276. </trim>
  277. </insert>
  278. <update id="updateByPrimaryKey" parameterType="com.steerinfo.dil.model.TmstruckReceiptResult">
  279. update TMSTRUCK_RECEIPT_RESULT
  280. set RESULT_TOTAL_ID = #{resultTotalId,jdbcType=DECIMAL},
  281. RESULT_EMPTY_CONTAINER_PHOTO = #{resultEmptyContainerPhoto,jdbcType=VARCHAR},
  282. RESULT_SIGNED_NOTE_PHOTO = #{resultSignedNotePhoto,jdbcType=VARCHAR},
  283. RESULT_RECEIVE_NOTE_PHOTO = #{resultReceiveNotePhoto,jdbcType=VARCHAR},
  284. WAREHOUSE_ID = #{warehouseId,jdbcType=DECIMAL},
  285. ORDER_MILEAGE = #{orderMileage,jdbcType=DECIMAL},
  286. INSERT_USERNAME = #{insertUsername,jdbcType=VARCHAR},
  287. INSERT_TIME = #{insertTime,jdbcType=TIMESTAMP},
  288. UPDATE_USERNAME = #{updateUsername,jdbcType=VARCHAR},
  289. UPDATE_TIME = #{updateTime,jdbcType=TIMESTAMP},
  290. STATUS = #{status,jdbcType=DECIMAL},
  291. INSERT_UPDATE_REMARK = #{insertUpdateRemark,jdbcType=VARCHAR},
  292. RESULT_ARRIVAL_ADDRESS = #{resultArrivalAddress,jdbcType=VARCHAR}
  293. where RESULT_ID = #{resultId,jdbcType=DECIMAL}
  294. </update>
  295. <update id="updateByPrimaryKeySelective" parameterType="com.steerinfo.dil.model.TmstruckReceiptResult">
  296. update TMSTRUCK_RECEIPT_RESULT
  297. <set>
  298. <if test="resultTotalId != null">
  299. RESULT_TOTAL_ID = #{resultTotalId,jdbcType=DECIMAL},
  300. </if>
  301. <if test="resultEmptyContainerPhoto != null">
  302. RESULT_EMPTY_CONTAINER_PHOTO = #{resultEmptyContainerPhoto,jdbcType=VARCHAR},
  303. </if>
  304. <if test="resultSignedNotePhoto != null">
  305. RESULT_SIGNED_NOTE_PHOTO = #{resultSignedNotePhoto,jdbcType=VARCHAR},
  306. </if>
  307. <if test="resultReceiveNotePhoto != null">
  308. RESULT_RECEIVE_NOTE_PHOTO = #{resultReceiveNotePhoto,jdbcType=VARCHAR},
  309. </if>
  310. <if test="warehouseId != null">
  311. WAREHOUSE_ID = #{warehouseId,jdbcType=DECIMAL},
  312. </if>
  313. <if test="orderMileage != null">
  314. ORDER_MILEAGE = #{orderMileage,jdbcType=DECIMAL},
  315. </if>
  316. <if test="insertUsername != null">
  317. INSERT_USERNAME = #{insertUsername,jdbcType=VARCHAR},
  318. </if>
  319. <if test="insertTime != null">
  320. INSERT_TIME = #{insertTime,jdbcType=TIMESTAMP},
  321. </if>
  322. <if test="updateUsername != null">
  323. UPDATE_USERNAME = #{updateUsername,jdbcType=VARCHAR},
  324. </if>
  325. <if test="updateTime != null">
  326. UPDATE_TIME = #{updateTime,jdbcType=TIMESTAMP},
  327. </if>
  328. <if test="status != null">
  329. STATUS = #{status,jdbcType=DECIMAL},
  330. </if>
  331. <if test="insertUpdateRemark != null">
  332. INSERT_UPDATE_REMARK = #{insertUpdateRemark,jdbcType=VARCHAR},
  333. </if>
  334. <if test="resultArrivalAddress != null">
  335. RESULT_ARRIVAL_ADDRESS = #{resultArrivalAddress,jdbcType=VARCHAR},
  336. </if>
  337. </set>
  338. where RESULT_ID = #{resultId,jdbcType=DECIMAL}
  339. </update>
  340. <select id="selectByPrimaryKey" parameterType="java.math.BigDecimal" resultMap="BaseResultMap">
  341. <include refid="select" />
  342. where RESULT_ID = #{resultId,jdbcType=DECIMAL}
  343. </select>
  344. <select id="selectByParameters" parameterType="java.util.HashMap" resultMap="BaseResultMap">
  345. <include refid="select" />
  346. <include refid="where" />
  347. </select>
  348. <select id="selectLikeByParameters" parameterType="java.util.HashMap" resultMap="BaseResultMap">
  349. <include refid="select" />
  350. <include refid="whereLike" />
  351. </select>
  352. <insert id="batchInsert" parameterType="java.util.List">
  353. insert into TMSTRUCK_RECEIPT_RESULT
  354. (RESULT_ID,
  355. RESULT_TOTAL_ID, RESULT_EMPTY_CONTAINER_PHOTO,
  356. RESULT_SIGNED_NOTE_PHOTO, RESULT_RECEIVE_NOTE_PHOTO,
  357. WAREHOUSE_ID,ORDER_MILEAGE, INSERT_USERNAME,
  358. INSERT_TIME, UPDATE_USERNAME,
  359. UPDATE_TIME, STATUS,INSERT_UPDATE_REMARK,
  360. RESULT_ARRIVAL_ADDRESS)
  361. ( <foreach collection="list" item="item" separator="union all">
  362. select
  363. #{item.resultId,jdbcType=DECIMAL},
  364. #{item.resultTotalId,jdbcType=DECIMAL}, #{item.resultEmptyContainerPhoto,jdbcType=VARCHAR},
  365. #{item.resultSignedNotePhoto,jdbcType=VARCHAR}, #{item.resultReceiveNotePhoto,jdbcType=VARCHAR},
  366. #{item.warehouseId,jdbcType=DECIMAL},#{item.orderMileage,jdbcType=DECIMAL}, #{item.insertUsername,jdbcType=VARCHAR},
  367. #{item.insertTime,jdbcType=TIMESTAMP}, #{item.updateUsername,jdbcType=VARCHAR},
  368. #{item.updateTime,jdbcType=TIMESTAMP},#{item.status,jdbcType=DECIMAL}, #{item.insertUpdateRemark,jdbcType=VARCHAR},
  369. #{item.resultArrivalAddress,jdbcType=VARCHAR} from dual
  370. </foreach> )
  371. </insert>
  372. <update id="batchUpdate" parameterType="java.util.List">
  373. update TMSTRUCK_RECEIPT_RESULT
  374. set
  375. RESULT_ID=
  376. <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
  377. when #{item.resultId,jdbcType=DECIMAL} then #{item.resultId,jdbcType=DECIMAL}
  378. </foreach>
  379. ,RESULT_TOTAL_ID=
  380. <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
  381. when #{item.resultId,jdbcType=DECIMAL} then #{item.resultTotalId,jdbcType=DECIMAL}
  382. </foreach>
  383. ,RESULT_EMPTY_CONTAINER_PHOTO=
  384. <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
  385. when #{item.resultId,jdbcType=DECIMAL} then #{item.resultEmptyContainerPhoto,jdbcType=VARCHAR}
  386. </foreach>
  387. ,RESULT_SIGNED_NOTE_PHOTO=
  388. <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
  389. when #{item.resultId,jdbcType=DECIMAL} then #{item.resultSignedNotePhoto,jdbcType=VARCHAR}
  390. </foreach>
  391. ,RESULT_RECEIVE_NOTE_PHOTO=
  392. <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
  393. when #{item.resultId,jdbcType=DECIMAL} then #{item.resultReceiveNotePhoto,jdbcType=VARCHAR}
  394. </foreach>
  395. ,WAREHOUSE_ID=
  396. <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
  397. when #{item.resultId,jdbcType=DECIMAL} then #{item.warehouseId,jdbcType=DECIMAL}
  398. </foreach>
  399. ,ORDER_MILEAGE=
  400. <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
  401. when #{item.resultId,jdbcType=DECIMAL} then #{item.orderMileage,jdbcType=DECIMAL}
  402. </foreach>
  403. ,INSERT_USERNAME=
  404. <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
  405. when #{item.resultId,jdbcType=DECIMAL} then #{item.insertUsername,jdbcType=VARCHAR}
  406. </foreach>
  407. ,INSERT_TIME=
  408. <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
  409. when #{item.resultId,jdbcType=DECIMAL} then #{item.insertTime,jdbcType=TIMESTAMP}
  410. </foreach>
  411. ,UPDATE_USERNAME=
  412. <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
  413. when #{item.resultId,jdbcType=DECIMAL} then #{item.updateUsername,jdbcType=VARCHAR}
  414. </foreach>
  415. ,UPDATE_TIME=
  416. <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
  417. when #{item.resultId,jdbcType=DECIMAL} then #{item.updateTime,jdbcType=TIMESTAMP}
  418. </foreach>
  419. ,STATUS=
  420. <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
  421. when #{item.resultId,jdbcType=DECIMAL} then #{item.status,jdbcType=DECIMAL}
  422. </foreach>
  423. ,INSERT_UPDATE_REMARK=
  424. <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
  425. when #{item.resultId,jdbcType=DECIMAL} then #{item.insertUpdateRemark,jdbcType=VARCHAR}
  426. </foreach>
  427. ,RESULT_ARRIVAL_ADDRESS=
  428. <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
  429. when #{item.resultId,jdbcType=DECIMAL} then #{item.resultArrivalAddress,jdbcType=VARCHAR}
  430. </foreach>
  431. where RESULT_ID in
  432. <foreach close=")" collection="list" index="index" item="item" open="(" separator=",">
  433. #{item.resultId,jdbcType=DECIMAL}
  434. </foreach>
  435. </update>
  436. <delete id="batchDelete" parameterType="java.util.List">
  437. delete from TMSTRUCK_RECEIPT_RESULT
  438. where RESULT_ID in
  439. <foreach close=")" collection="list" item="id" open="(" separator=",">
  440. #{id}
  441. </foreach>
  442. </delete>
  443. <!-- 友情提示!!!-->
  444. <!-- 请将自己写的代码放在此标签之下,方便以后粘贴复制。-->
  445. <!-- 获取最大ID值 -->
  446. <!-- 通过总实绩ID 查询签收实绩ID -->
  447. <select id="getIdByTotalResultId" parameterType="int" resultType="int">
  448. select TRR.RESULT_ID from TMSTRUCK_RECEIPT_RESULT TRR where TRR.RESULT_TOTAL_ID = #{totalResultId}
  449. </select>
  450. <!--通过总实绩Id 更新 状态码 为 1 已签收-->
  451. <update id="updateByTotalResultId" parameterType="java.util.Map">
  452. update TMSTRUCK_RECEIPT_RESULT
  453. <set>
  454. <if test="warehouseId != null">
  455. WAREHOUSE_ID = #{warehouseId,jdbcType=DECIMAL},
  456. </if>
  457. <if test="insertUsername != null">
  458. INSERT_USERNAME = #{insertUsername,jdbcType=VARCHAR},
  459. </if>
  460. <if test="insertTime != null">
  461. INSERT_TIME = #{insertTime,jdbcType=TIMESTAMP},
  462. </if>
  463. <if test="updateUsername != null">
  464. UPDATE_USERNAME = #{updateUsername,jdbcType=VARCHAR},
  465. </if>
  466. <if test="updateTime != null">
  467. UPDATE_TIME = #{updateTime,jdbcType=TIMESTAMP},
  468. </if>
  469. <if test="insertUpdateRemark != null">
  470. INSERT_UPDATE_REMARK = #{insertUpdateRemark,jdbcType=VARCHAR},
  471. </if>
  472. <if test="status != null">
  473. STATUS = #{status,jdbcType=DECIMAL},
  474. </if>
  475. <if test="resultEmptyContainerPhoto != null">
  476. RESULT_EMPTY_CONTAINER_PHOTO = #{resultEmptyContainerPhoto,jdbcType=BLOB},
  477. </if>
  478. <if test="resultSignedNotePhoto != null">
  479. RESULT_SIGNED_NOTE_PHOTO = #{resultSignedNotePhoto,jdbcType=BLOB},
  480. </if>
  481. <if test="resultReceiveNotePhoto != null">
  482. RESULT_RECEIVE_NOTE_PHOTO = #{resultReceiveNotePhoto,jdbcType=BLOB},
  483. </if>
  484. </set>
  485. where RESULT_TOTAL_ID = #{resultTotalId}
  486. </update>
  487. <!-- 通过签收时间排序 -->
  488. <sql id="orderBy">
  489. <if test="orderField != null and orderField != ''">
  490. order by "${orderField}"
  491. <if test="orderType != null and orderType != ''">
  492. ${orderType}
  493. </if>
  494. </if>
  495. <if test="orderField == null ">
  496. order by "insertTime" desc
  497. </if>
  498. </sql>
  499. <!-- 查询内转钢材到异地库收货实绩-->
  500. <select id="getSteelNzReceiptResult" parameterType="java.util.Map" resultType="java.util.Map">
  501. SELECT *
  502. FROM (
  503. SELECT TRR.RESULT_ID "resultId",
  504. OO.ORDER_NUMBER "orderNumber",
  505. RC.CAPACITY_NUMBER "capacityNumber",
  506. RW.WAREHOUSE_NAME "warehouseName",
  507. TRR.INSERT_TIME "insertTime",
  508. TRR.INSERT_USERNAME "insertUsername"
  509. FROM TMSTRUCK_RECEIPT_RESULT TRR
  510. LEFT JOIN TMSTRUCK_TOTAL_RESULT TTR
  511. ON TTR.RESULT_TOTAL_ID = TRR.RESULT_TOTAL_ID
  512. LEFT JOIN OMSTRUCK_ORDER OO
  513. ON OO.ORDER_ID = TTR.ORDER_ID
  514. LEFT JOIN RMS_WAREHOUSE RW
  515. ON RW.WAREHOUSE_ID = TRR.WAREHOUSE_ID
  516. LEFT JOIN RMS_CAPACITY RC
  517. ON RC.CAPACITY_ID = OO.CAPACITY_ID
  518. WHERE OO.ORDER_TYPE = 4 AND TRR.STATUS = 1
  519. )
  520. <where>
  521. <if test="orderNumber != null">
  522. <foreach collection="orderNumber" item="item" open="(" separator="or" close=")">
  523. "orderNumber" like '%${item}%'
  524. </foreach>
  525. </if>
  526. <if test="capacityNumber != null">
  527. and
  528. <foreach collection="capacityNumber" item="item" open="(" separator="or" close=")">
  529. "capacityNumber" like '%${item}%'
  530. </foreach>
  531. </if>
  532. <if test="warehouseName != null">
  533. and
  534. <foreach collection="warehouseName" item="item" open="(" separator="or" close=")">
  535. "warehouseName" like '%${item}%'
  536. </foreach>
  537. </if>
  538. <if test="insertTime != null">
  539. and
  540. <foreach collection="insertTime" item="item" open="(" separator="or" close=")">
  541. "insertTime" like '%${item}%'
  542. </foreach>
  543. </if>
  544. <if test="insertUsername != null">
  545. and
  546. <foreach collection="insertUsername" item="item" open="(" separator="or" close=")">
  547. "insertUsername" like '%${item}%'
  548. </foreach>
  549. </if>
  550. </where>
  551. <include refid="orderBy"></include>
  552. </select>
  553. <select id="getInwardReceipt" parameterType="java.util.Map" resultType="java.util.Map">
  554. select *
  555. from (
  556. select TRR.RESULT_ID "resultId",
  557. APO.PURCHASE_ORDER_NO "purchaseOrderNo",
  558. RM.MATERIAL_NAME "materialName",
  559. OO.ORDER_NUMBER "orderNumber",
  560. RC.CAPACITY_NUMBER "capacityNumber",
  561. DB.RESULT_FOREIGN_SHIP_NAME "resultForeignShipName",
  562. TUR.UNLOAD_STATUS "unloadStatus",
  563. TWR.RESULT_NET_WEIGHT "resultNetWeight",
  564. tqr.result_issampling "issampling",
  565. TRR.INSERT_USERNAME "insertUsername",
  566. TRR.INSERT_TIME "insertTime",
  567. RW.WAREHOUSE_NAME "warehouseName"
  568. from TMSTRUCK_RECEIPT_RESULT TRR
  569. left join TMSTRUCK_TOTAL_RESULT TTR
  570. on TTR.RESULT_TOTAL_ID = TRR.RESULT_TOTAL_ID
  571. left join OMSTRUCK_ORDER OO
  572. on OO.ORDER_ID = TTR.ORDER_ID
  573. left join AMSTRUCK_INWARD_PLAN AIP
  574. on AIP.PLAN_ID = OO.ORDER_PLAN_ID
  575. left join AMSTRUCK_REQUIREMENT_PLAN ARP
  576. on ARP.PLAN_ID = AIP.PLAN_ID
  577. left join AMSTRUCK_INWARD_REQUIREMENT AIR
  578. on AIR.REQUIREMENT_ID = ARP.REQUIREMENT_ID
  579. left join AMS_PURCHASE_ORDER APO
  580. on APO.PURCHASE_ORDER_ID = AIR.PURCHASE_ORDER_ID
  581. left join DIL_BATCH DB
  582. on DB.BATCH_ID = APO.BATCH_ID
  583. left join RMS_CAPACITY RC
  584. on RC.CAPACITY_ID = OO.CAPACITY_ID
  585. left join TMSTRUCK_WEIGHT_RESULT TWR
  586. on TWR.RESULT_TOTAL_ID = TRR.RESULT_TOTAL_ID
  587. left join TMSTRUCK_UNLOAD_RESULT TUR
  588. on TUR.RESULT_TOTAL_ID = TRR.RESULT_TOTAL_ID
  589. left join OMSTRUCK_ORDER_MATERIAL OOM
  590. on OOM.ORDER_ID = OO.ORDER_ID
  591. left join RMS_MATERIAL RM
  592. on OOM.MATERIAL_ID = RM.MATERIAL_ID
  593. left join tmstruck_quality_result tqr
  594. on tqr.total_result_id = ttr.result_total_id
  595. left join RMS_WAREHOUSE RW
  596. on TUR.RESULT_UNLOAD_PLACE_ID = RW.WAREHOUSE_ID
  597. where TRR.STATUS = 1
  598. and OO.ORDER_TYPE = #{orderTypee}
  599. )
  600. <where>
  601. <if test="materialName != null">
  602. <foreach collection="materialName" item="item" open="(" separator="or" close=")">
  603. "materialName" like '%${item}%'
  604. </foreach>
  605. </if>
  606. <if test="purchaseOrderNo != null">
  607. and
  608. <foreach collection="purchaseOrderNo" item="item" open="(" separator="or" close=")">
  609. "purchaseOrderNo" like '%${item}%'
  610. </foreach>
  611. </if>
  612. <if test="orderNumber != null">
  613. and
  614. <foreach collection="orderNumber" item="item" open="(" separator="or" close=")">
  615. "orderNumber" like '%${item}%'
  616. </foreach>
  617. </if>
  618. <if test="capacityNumber != null">
  619. and
  620. <foreach collection="capacityNumber" item="item" open="(" separator="or" close=")">
  621. "capacityNumber" like '%${item}%'
  622. </foreach>
  623. </if>
  624. <if test="resultForeignShipName != null">
  625. and
  626. <foreach collection="resultForeignShipName" item="item" open="(" separator="or" close=")">
  627. "resultForeignShipName" like '%${item}%'
  628. </foreach>
  629. </if>
  630. <if test="unloadStatus != null">
  631. and
  632. <foreach collection="unloadStatus" item="item" open="(" separator="or" close=")">
  633. "unloadStatus" like '%${item}%'
  634. </foreach>
  635. </if>
  636. <if test="resultNetWeight != null">
  637. and
  638. <foreach collection="resultNetWeight" item="item" open="(" separator="or" close=")">
  639. "resultNetWeight" like '%${item}%'
  640. </foreach>
  641. </if>
  642. <if test="issampling != null">
  643. and
  644. <foreach collection="issampling" item="item" open="(" separator="or" close=")">
  645. "issampling" like '%${item}%'
  646. </foreach>
  647. </if>
  648. <if test="insertUsername != null">
  649. and
  650. <foreach collection="insertUsername" item="item" open="(" separator="or" close=")">
  651. "insertUsername" like '%${item}%'
  652. </foreach>
  653. </if>
  654. <if test="insertTime != null">
  655. and
  656. <foreach collection="insertTime" item="item" open="(" separator="or" close=")">
  657. "insertTime" like '%${item}%'
  658. </foreach>
  659. </if>
  660. </where>
  661. <include refid="orderBy"></include>
  662. </select>
  663. <!-- 查询是否已收过货 -->
  664. <select id="getReceiptResult" parameterType="java.math.BigDecimal" resultType="java.lang.Integer">
  665. select TRR.RESULT_ID
  666. from TMSTRUCK_RECEIPT_RESULT TRR
  667. where TRR.RESULT_TOTAL_ID = #{resultTotalId}
  668. </select>
  669. <!-- <select id="selectMaxId" resultType="java.math.BigDecimal">-->
  670. <!-- select max(RESULT_ID) from TMSTRUCK_RECEIPT_RESULT-->
  671. <!-- </select>-->
  672. <select id="getReceiptResultInfo" parameterType="java.util.Map" resultType="java.util.LinkedHashMap">
  673. select
  674. *
  675. from (
  676. select distinct OO.ORDER_NUMBER "orderNumber", --运单订单号
  677. RC.CAPACITY_NUMBER "capacityNumber",--车牌号
  678. TWR.RESULT_GROSS_WEIGHT_TIME "resultGrossWeightTime",--计毛时间
  679. TWR.RESULT_NET_WEIGHT "resultNetWeight",--净重
  680. TLFR.RESULT_OUT_GATE_TIME "resultOutGateTime",--出厂时间
  681. RGOUT.GATEPOST_NAME "outGatepostName",--出厂门禁
  682. RCR.CARRIER_NAME "carrierName" , --承运商名称
  683. RRP.ADDRESS_DELIVERY_ADDRESS "deliveryAddress", --详细收货地址
  684. RM.MATERIAL_NAME "materialName" , --"物质名称"
  685. RM.MATERIAL_SPECIFICATION "materialSpecification", -- "物质规格"
  686. RM.MATERIAL_MODEL "materialModel", --"物质型号"
  687. RCON.CONSIGNEE_COMPANY_NAME "receiveName",--客户名称
  688. TAR.RESULT_ARRIVAL_ADDRESS "resultArrivalAddress",--抵达收货点的地址
  689. TAR.INSERT_TIME "insertTime",--抵达作业时间
  690. TAR.RESULT_FULL_CONTAINER_PHOTO "resultFullContainerPhoto" --车箱照片
  691. from OMSTRUCK_ORDER OO --运输订单
  692. left join AMS_SALE_ORDER_MATERIAL ASOM --销售订单物质表
  693. on ASOM.SALE_ORDER_MATERIAL_ID = OO.ORDER_PLAN_ID
  694. left join AMS_SALE_ORDER ASO --销售订单
  695. on ASO.SALE_ORDER_ID = ASOM.SALE_ORDER_ID
  696. left join RMS_CONSIGNEE RCON --收货客户
  697. on RCON.CONSIGNEE_ID = ASO.RECEIVE_ID
  698. left join TMSTRUCK_TOTAL_RESULT TTR --运输总实绩
  699. on TTR.ORDER_ID = OO.ORDER_ID
  700. left join TMSTRUCK_LOAD_RESULT TLR --汽车运输实绩表
  701. on TLR.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
  702. left join TMSTRUCK_ARRIVAL_RESULT TAR
  703. on TAR.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
  704. left join RMS_WAREHOUSE RW --装卸货仓库
  705. on RW.WAREHOUSE_ID = TLR.LOADING_ID
  706. left join TMSTRUCK_LEAVE_FACTORY_RESULT TLFR --离厂实绩
  707. on TLFR.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
  708. left join RMS_GATEPOST RGOUT --门岗
  709. on RGOUT.GATEPOST_ID = TLFR.GATEPOST_ID
  710. left join RMS_CAPACITY RC --运力
  711. on RC.CAPACITY_ID = OO.CAPACITY_ID
  712. left join AMS_DISPATCH_SALE_ORDER ADSO
  713. on ASOM.SALE_ORDER_MATERIAL_ID=ADSO.SALE_ORDER_MATERIAL_ID
  714. left join RMS_CARRIER RCR --承运单位
  715. on ADSO.CARRIER_ID=RCR.CARRIER_ID
  716. left join RMS_RECEIVE_PLACE RRP --收货地址
  717. on ASOM.SALE_SHIPPING_ADDRESS_ID=RRP.PLACE_ID
  718. left join RMS_RECEIVE_ADDRESS REA
  719. on RRP.ADDRESS_ID=REA.ADDRESS_ID
  720. left join AMS_SALE_TRUCKNO_MATERIAL ASTM
  721. on ASOM.SALE_ORDER_MATERIAL_ID=ASTM.SALE_ORDER_MATERIAL_ID
  722. left join AMS_SALE_MATERIAL ASM1
  723. on ASTM.MATERIAL_ID =ASM1.SALE_MATERIAL_ID
  724. left join TMSTRUCK_WEIGHT_RESULT TWR --运输实绩计重
  725. on TWR.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID and ASM1.MATERIAL_ID =TWR.MATERIAL_ID
  726. left join RMS_MATERIAL RM
  727. on ASM1.MATERIAL_ID=RM.MATERIAL_ID
  728. where OO.ORDER_TYPE in (1) and TAR.INSERT_TIME IS NOT NULL
  729. <if test="oneDate != null">
  730. and to_date(#{oneDate}, 'yyyy-mm-dd hh24:mi:ss') &lt; = TAR.INSERT_TIME
  731. </if>
  732. <if test="startDate != null">
  733. and to_date(#{startDate}, 'yyyy-mm-dd hh24:mi:ss') &lt;= TAR.INSERT_TIME
  734. and to_date(#{endDate}, 'yyyy-mm-dd hh24:mi:ss') >= TAR.INSERT_TIME
  735. </if>
  736. <if test="con!=null">
  737. and (instr(RC.CAPACITY_NUMBER,#{con})>0 or instr(RM.MATERIAL_NAME,#{con})>0
  738. or instr(RCON.CONSIGNEE_COMPANY_NAME,#{con})>0)
  739. </if>
  740. )
  741. <where>
  742. <if test="orderNumbers !=null">
  743. and "orderNumber" like '${orderNumbers}'
  744. </if>
  745. <if test="capacityNumbers !=null">
  746. and "capacityNumber" like '${capacityNumbers}'
  747. </if>
  748. <if test="resultGrossWeightTimes !=null">
  749. and "resultGrossWeightTime" like '${resultGrossWeightTimes}'
  750. </if>
  751. <if test="resultGrossWeightTimes !=null">
  752. and "resultGrossWeightTime" like '${resultGrossWeightTimes}'
  753. </if>
  754. <if test="resultOutGateTimes !=null">
  755. and "resultOutGateTime" like '${resultOutGateTimes}'
  756. </if>
  757. <if test="resultNetWeights !=null">
  758. and "resultNetWeight" like '${resultNetWeights}'
  759. </if>
  760. <if test="resultOutGateTimes !=null">
  761. and "resultOutGateTime" like '${resultOutGateTimes}'
  762. </if>
  763. <if test="outGatepostNames !=null">
  764. and "outGatepostName" like '${outGatepostNames}'
  765. </if>
  766. <if test="carrierNames !=null">
  767. and "carrierName" like '${carrierNames}'
  768. </if>
  769. <if test="deliveryAddresss !=null">
  770. and "deliveryAddress" like '${deliveryAddresss}'
  771. </if>
  772. <if test="materialNames !=null">
  773. and "materialName" like '${materialNames}'
  774. </if>
  775. <if test="materialSpecifications !=null">
  776. and "materialSpecification" like '${materialSpecifications}'
  777. </if>
  778. <if test="materialModels !=null">
  779. and "materialModel" like '${materialModels}'
  780. </if>
  781. <if test="receiveNames !=null">
  782. and "receiveName" like '${receiveNames}'
  783. </if>
  784. <if test="orderNumber !=null">
  785. and "orderNumber" in
  786. <foreach collection="orderNumber" separator="," open="(" close=")" item="item" >
  787. #{item}
  788. </foreach>
  789. </if>
  790. <if test="capacityNumber !=null">
  791. and "capacityNumber" in
  792. <foreach collection="capacityNumber" separator="," open="(" close=")" item="item" >
  793. #{item}
  794. </foreach>
  795. </if>
  796. <if test="resultGrossWeightTime !=null">
  797. and "resultGrossWeightTime" in
  798. <foreach collection="resultGrossWeightTime" separator="," open="(" close=")" item="item" >
  799. #{item}
  800. </foreach>
  801. </if>
  802. <if test="resultNetWeight !=null">
  803. and "resultNetWeight" in
  804. <foreach collection="resultNetWeight" separator="," open="(" close=")" item="item" >
  805. #{item}
  806. </foreach>
  807. </if>
  808. <if test="resultOutGateTime !=null">
  809. and "resultOutGateTime" in
  810. <foreach collection="resultOutGateTime" separator="," open="(" close=")" item="item" >
  811. #{item}
  812. </foreach>
  813. </if>
  814. <if test="outGatepostName !=null">
  815. and "outGatepostName" in
  816. <foreach collection="outGatepostName" separator="," open="(" close=")" item="item" >
  817. #{item}
  818. </foreach>
  819. </if>
  820. <if test="carrierName !=null">
  821. and "carrierName" in
  822. <foreach collection="carrierName" separator="," open="(" close=")" item="item" >
  823. #{item}
  824. </foreach>
  825. </if>
  826. <if test="deliveryAddress !=null">
  827. and "deliveryAddress" in
  828. <foreach collection="deliveryAddress" separator="," open="(" close=")" item="item" >
  829. #{item}
  830. </foreach>
  831. </if>
  832. <if test="materialSpecification !=null">
  833. and "materialSpecification" in
  834. <foreach collection="materialSpecification" separator="," open="(" close=")" item="item" >
  835. #{item}
  836. </foreach>
  837. </if>
  838. <if test="materialModel !=null">
  839. and "materialModel" in
  840. <foreach collection="materialModel" separator="," open="(" close=")" item="item" >
  841. #{item}
  842. </foreach>
  843. </if>
  844. <if test="receiveName !=null">
  845. and "receiveName" in
  846. <foreach collection="receiveName" separator="," open="(" close=")" item="item" >
  847. #{item}
  848. </foreach>
  849. </if>
  850. <if test="resultArrivalAddress !=null">
  851. and "resultArrivalAddress" in
  852. <foreach collection="resultArrivalAddress" separator="," open="(" close=")" item="item" >
  853. #{item}
  854. </foreach>
  855. </if>
  856. <if test="insertTime !=null">
  857. and "insertTime" in
  858. <foreach collection="insertTime" separator="," open="(" close=")" item="item" >
  859. #{item}
  860. </foreach>
  861. </if>
  862. <if test="resultFullContainerPhoto !=null">
  863. and "resultFullContainerPhoto" in
  864. <foreach collection="resultFullContainerPhoto" separator="," open="(" close=")" item="item" >
  865. #{item}
  866. </foreach>
  867. </if>
  868. </where>
  869. <include refid="orderBy"></include>
  870. </select>
  871. <select id="getReceiptPhoto" parameterType="java.lang.String" resultType="java.lang.String">
  872. select tar.RESULT_FULL_CONTAINER_PHOTO
  873. from TMSTRUCK_ARRIVAL_RESULT tar
  874. left join TMSTRUCK_TOTAL_RESULT ttr
  875. on ttr.RESULT_TOTAL_ID = tar.RESULT_TOTAL_ID
  876. left join OMSTRUCK_ORDER oo
  877. on oo.ORDER_ID = ttr.ORDER_ID
  878. where oo.ORDER_NUMBER = #{orderNumber}
  879. </select>
  880. <select id="getReceivingResult" parameterType="java.util.Map" resultType="java.util.LinkedHashMap">
  881. select
  882. *
  883. from (
  884. select distinct OO.ORDER_NUMBER "orderNumber", --运单订单号
  885. RC.CAPACITY_NUMBER "capacityNumber",--车牌号
  886. TWR.RESULT_GROSS_WEIGHT_TIME "resultGrossWeightTime",--计毛时间
  887. TWR.RESULT_NET_WEIGHT "resultNetWeight",--净重
  888. TLFR.RESULT_OUT_GATE_TIME "resultOutGateTime",--出厂时间
  889. RGOUT.GATEPOST_NAME "outGatepostName",--出厂门禁
  890. RCR.CARRIER_NAME "carrierName" , --承运商名称
  891. RRP.ADDRESS_DELIVERY_ADDRESS "deliveryAddress", --详细收货地址
  892. RM.MATERIAL_NAME "materialName" , --"物质名称"
  893. RM.MATERIAL_SPECIFICATION "materialSpecification", -- "物质规格"
  894. RM.MATERIAL_MODEL "materialModel", --"物质型号"
  895. RCON.CONSIGNEE_COMPANY_NAME "receiveName",--客户名称
  896. TRR.RESULT_ARRIVAL_ADDRESS "resultArrivalAddress",--签收收货点的地址
  897. TRR.INSERT_TIME "insertTime",--签收作业时间
  898. TRR.ORDER_MILEAGE "orderMileage" --运输距离
  899. from OMSTRUCK_ORDER OO --运输订单
  900. left join AMS_SALE_ORDER_MATERIAL ASOM --销售订单物质表
  901. on ASOM.SALE_ORDER_MATERIAL_ID = OO.ORDER_PLAN_ID
  902. left join AMS_SALE_ORDER ASO --销售订单
  903. on ASO.SALE_ORDER_ID = ASOM.SALE_ORDER_ID
  904. left join RMS_CONSIGNEE RCON --收货客户
  905. on RCON.CONSIGNEE_ID = ASO.RECEIVE_ID
  906. left join TMSTRUCK_TOTAL_RESULT TTR --运输总实绩
  907. on TTR.ORDER_ID = OO.ORDER_ID
  908. left join TMSTRUCK_LOAD_RESULT TLR --汽车运输实绩表
  909. on TLR.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
  910. left join TMSTRUCK_RECEIPT_RESULT TRR
  911. on TRR.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
  912. left join RMS_WAREHOUSE RW --装卸货仓库
  913. on RW.WAREHOUSE_ID = TLR.LOADING_ID
  914. left join TMSTRUCK_LEAVE_FACTORY_RESULT TLFR --离厂实绩
  915. on TLFR.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
  916. left join RMS_GATEPOST RGOUT --门岗
  917. on RGOUT.GATEPOST_ID = TLFR.GATEPOST_ID
  918. left join RMS_CAPACITY RC --运力
  919. on RC.CAPACITY_ID = OO.CAPACITY_ID
  920. left join AMS_DISPATCH_SALE_ORDER ADSO
  921. on ASOM.SALE_ORDER_MATERIAL_ID=ADSO.SALE_ORDER_MATERIAL_ID
  922. left join RMS_CARRIER RCR --承运单位
  923. on ADSO.CARRIER_ID=RCR.CARRIER_ID
  924. left join RMS_RECEIVE_PLACE RRP --收货地址
  925. on ASOM.SALE_SHIPPING_ADDRESS_ID=RRP.PLACE_ID
  926. left join RMS_RECEIVE_ADDRESS REA
  927. on RRP.ADDRESS_ID=REA.ADDRESS_ID
  928. left join AMS_SALE_TRUCKNO_MATERIAL ASTM
  929. on ASOM.SALE_ORDER_MATERIAL_ID=ASTM.SALE_ORDER_MATERIAL_ID
  930. left join AMS_SALE_MATERIAL ASM1
  931. on ASTM.MATERIAL_ID =ASM1.SALE_MATERIAL_ID
  932. left join TMSTRUCK_WEIGHT_RESULT TWR --运输实绩计重
  933. on TWR.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID and ASM1.MATERIAL_ID =TWR.MATERIAL_ID
  934. left join RMS_MATERIAL RM
  935. on ASM1.MATERIAL_ID=RM.MATERIAL_ID
  936. where OO.ORDER_TYPE in (1) and TRR.INSERT_TIME IS NOT NULL
  937. <if test="oneDate != null">
  938. and to_date(#{oneDate}, 'yyyy-mm-dd hh24:mi:ss') &lt; = TRR.INSERT_TIME
  939. </if>
  940. <if test="startDate != null">
  941. and to_date(#{startDate}, 'yyyy-mm-dd hh24:mi:ss') &lt;= TRR.INSERT_TIME
  942. and to_date(#{endDate}, 'yyyy-mm-dd hh24:mi:ss') >= TRR.INSERT_TIME
  943. </if>
  944. <if test="con!=null">
  945. and (instr(RC.CAPACITY_NUMBER,#{con})>0 or instr(RM.MATERIAL_NAME,#{con})>0
  946. or instr(RCON.CONSIGNEE_COMPANY_NAME,#{con})>0)
  947. </if>
  948. )
  949. <where>
  950. <if test="orderNumbers !=null">
  951. and "orderNumber" like '${orderNumbers}'
  952. </if>
  953. <if test="capacityNumbers !=null">
  954. and "capacityNumber" like '${capacityNumbers}'
  955. </if>
  956. <if test="resultGrossWeightTimes !=null">
  957. and "resultGrossWeightTime" like '${resultGrossWeightTimes}'
  958. </if>
  959. <if test="resultGrossWeightTimes !=null">
  960. and "resultGrossWeightTime" like '${resultGrossWeightTimes}'
  961. </if>
  962. <if test="resultOutGateTimes !=null">
  963. and "resultOutGateTime" like '${resultOutGateTimes}'
  964. </if>
  965. <if test="resultNetWeights !=null">
  966. and "resultNetWeight" like '${resultNetWeights}'
  967. </if>
  968. <if test="resultOutGateTimes !=null">
  969. and "resultOutGateTime" like '${resultOutGateTimes}'
  970. </if>
  971. <if test="outGatepostNames !=null">
  972. and "outGatepostName" like '${outGatepostNames}'
  973. </if>
  974. <if test="carrierNames !=null">
  975. and "carrierName" like '${carrierNames}'
  976. </if>
  977. <if test="deliveryAddresss !=null">
  978. and "deliveryAddress" like '${deliveryAddresss}'
  979. </if>
  980. <if test="materialNames !=null">
  981. and "materialName" like '${materialNames}'
  982. </if>
  983. <if test="materialSpecifications !=null">
  984. and "materialSpecification" like '${materialSpecifications}'
  985. </if>
  986. <if test="materialModels !=null">
  987. and "materialModel" like '${materialModels}'
  988. </if>
  989. <if test="receiveNames !=null">
  990. and "receiveName" like '${receiveNames}'
  991. </if>
  992. <if test="orderNumber !=null">
  993. and "orderNumber" in
  994. <foreach collection="orderNumber" separator="," open="(" close=")" item="item" >
  995. #{item}
  996. </foreach>
  997. </if>
  998. <if test="capacityNumber !=null">
  999. and "capacityNumber" in
  1000. <foreach collection="capacityNumber" separator="," open="(" close=")" item="item" >
  1001. #{item}
  1002. </foreach>
  1003. </if>
  1004. <if test="resultGrossWeightTime !=null">
  1005. and "resultGrossWeightTime" in
  1006. <foreach collection="resultGrossWeightTime" separator="," open="(" close=")" item="item" >
  1007. #{item}
  1008. </foreach>
  1009. </if>
  1010. <if test="resultNetWeight !=null">
  1011. and "resultNetWeight" in
  1012. <foreach collection="resultNetWeight" separator="," open="(" close=")" item="item" >
  1013. #{item}
  1014. </foreach>
  1015. </if>
  1016. <if test="resultOutGateTime !=null">
  1017. and "resultOutGateTime" in
  1018. <foreach collection="resultOutGateTime" separator="," open="(" close=")" item="item" >
  1019. #{item}
  1020. </foreach>
  1021. </if>
  1022. <if test="outGatepostName !=null">
  1023. and "outGatepostName" in
  1024. <foreach collection="outGatepostName" separator="," open="(" close=")" item="item" >
  1025. #{item}
  1026. </foreach>
  1027. </if>
  1028. <if test="carrierName !=null">
  1029. and "carrierName" in
  1030. <foreach collection="carrierName" separator="," open="(" close=")" item="item" >
  1031. #{item}
  1032. </foreach>
  1033. </if>
  1034. <if test="deliveryAddress !=null">
  1035. and "deliveryAddress" in
  1036. <foreach collection="deliveryAddress" separator="," open="(" close=")" item="item" >
  1037. #{item}
  1038. </foreach>
  1039. </if>
  1040. <if test="materialSpecification !=null">
  1041. and "materialSpecification" in
  1042. <foreach collection="materialSpecification" separator="," open="(" close=")" item="item" >
  1043. #{item}
  1044. </foreach>
  1045. </if>
  1046. <if test="materialModel !=null">
  1047. and "materialModel" in
  1048. <foreach collection="materialModel" separator="," open="(" close=")" item="item" >
  1049. #{item}
  1050. </foreach>
  1051. </if>
  1052. <if test="receiveName !=null">
  1053. and "receiveName" in
  1054. <foreach collection="receiveName" separator="," open="(" close=")" item="item" >
  1055. #{item}
  1056. </foreach>
  1057. </if>
  1058. <if test="resultArrivalAddress !=null">
  1059. and "resultArrivalAddress" in
  1060. <foreach collection="resultArrivalAddress" separator="," open="(" close=")" item="item" >
  1061. #{item}
  1062. </foreach>
  1063. </if>
  1064. <if test="insertTime !=null">
  1065. and "insertTime" in
  1066. <foreach collection="insertTime" separator="," open="(" close=")" item="item" >
  1067. #{item}
  1068. </foreach>
  1069. </if>
  1070. <if test="orderMileage !=null">
  1071. and "orderMileage" in
  1072. <foreach collection="orderMileage" separator="," open="(" close=")" item="item" >
  1073. #{item}
  1074. </foreach>
  1075. </if>
  1076. </where>
  1077. <include refid="orderBy"></include>
  1078. </select>
  1079. <select id="getReceivingPhoto" parameterType="java.lang.String" resultType="map">
  1080. select trr.RESULT_EMPTY_CONTAINER_PHOTO "resultEmptyContainerPhoto",
  1081. trr.RESULT_SIGNED_NOTE_PHOTO "resultSignedNotePhoto"
  1082. from TMSTRUCK_RECEIPT_RESULT trr
  1083. left join TMSTRUCK_TOTAL_RESULT ttr
  1084. on ttr.RESULT_TOTAL_ID = trr.RESULT_TOTAL_ID
  1085. left join OMSTRUCK_ORDER oo
  1086. on oo.ORDER_ID = ttr.ORDER_ID
  1087. where oo.ORDER_NUMBER = #{orderNumber}
  1088. </select>
  1089. </mapper>