TmstruckReceiptResultMapper.xml 40 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002
  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="getCGReceiptResult" parameterType="java.util.Map" resultType="java.util.Map">
  501. select
  502. *
  503. from (
  504. select
  505. OO.ORDER_ID "orderId",
  506. TRR.RESULT_ID "resultId",
  507. APO.PURCHASE_ORDER_NO "purchaseOrderNo",
  508. RM.MATERIAL_NAME "materialName",
  509. OO.ORDER_NUMBER "orderNumber",
  510. RC.CAPACITY_NUMBER "capacityNumber",
  511. DB.RESULT_FOREIGN_SHIP_NAME "resultForeignShipName",
  512. TUR.UNLOAD_STATUS "unloadStatus",
  513. TWR.RESULT_NET_WEIGHT "resultNetWeight",
  514. RW.WAREHOUSE_NAME "warehouseName",
  515. TRR.INSERT_USERNAME "insertUsername",
  516. TRR.INSERT_TIME "insertTime"
  517. from TMSTRUCK_RECEIPT_RESULT TRR
  518. left join TMSTRUCK_TOTAL_RESULT TTR
  519. on TTR.RESULT_TOTAL_ID = TRR.RESULT_TOTAL_ID
  520. left join OMSTRUCK_ORDER OO
  521. on OO.ORDER_ID = TTR.ORDER_ID
  522. left join AMS_PURCHASE_ORDER APO
  523. on APO.PURCHASE_ORDER_ID = OO.ORDER_PLAN_ID
  524. left join DIL_BATCH DB
  525. on DB.BATCH_ID = APO.BATCH_ID
  526. left join RMS_CAPACITY RC
  527. on RC.CAPACITY_ID = OO.CAPACITY_ID
  528. left join TMSTRUCK_WEIGHT_RESULT TWR
  529. on TWR.RESULT_TOTAL_ID = TRR.RESULT_TOTAL_ID
  530. left join TMSTRUCK_UNLOAD_RESULT TUR
  531. on TUR.RESULT_TOTAL_ID = TRR.RESULT_TOTAL_ID
  532. left join OMSTRUCK_ORDER_MATERIAL OOM
  533. on OOM.ORDER_ID = OO.ORDER_ID
  534. left join RMS_MATERIAL RM
  535. on OOM.MATERIAL_ID = RM.MATERIAL_ID
  536. left join RMS_WAREHOUSE RW
  537. on RW.WAREHOUSE_ID = TUR.RESULT_UNLOAD_PLACE_ID
  538. where TRR.STATUS = 1 and OO.ORDER_TYPE = #{orderTypee}
  539. )
  540. <where>
  541. <if test="purchaseOrderNo != null">
  542. <foreach collection="purchaseOrderNo" item="item" open="(" separator="or" close=")">
  543. "purchaseOrderNo" like '%${item}%'
  544. </foreach>
  545. </if>
  546. <if test="materialName != null">
  547. and
  548. <foreach collection="materialName" item="item" open="(" separator="or" close=")">
  549. "materialName" like '%${item}%'
  550. </foreach>
  551. </if>
  552. <if test="orderNumber != null">
  553. and
  554. <foreach collection="orderNumber" item="item" open="(" separator="or" close=")">
  555. "orderNumber" like '%${item}%'
  556. </foreach>
  557. </if>
  558. <if test="capacityNumber != null">
  559. and
  560. <foreach collection="capacityNumber" item="item" open="(" separator="or" close=")">
  561. "capacityNumber" like '%${item}%'
  562. </foreach>
  563. </if>
  564. <if test="resultForeignShipName != null">
  565. and
  566. <foreach collection="resultForeignShipName" item="item" open="(" separator="or" close=")">
  567. "resultForeignShipName" like '%${item}%'
  568. </foreach>
  569. </if>
  570. <if test="unloadStatus != null">
  571. and
  572. <foreach collection="unloadStatus" item="item" open="(" separator="or" close=")">
  573. "unloadStatus" like '%${item}%'
  574. </foreach>
  575. </if>
  576. <if test="resultNetWeight != null">
  577. and
  578. <foreach collection="resultNetWeight" item="item" open="(" separator="or" close=")">
  579. "resultNetWeight" 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="insertUsername != null">
  589. and
  590. <foreach collection="insertUsername" item="item" open="(" separator="or" close=")">
  591. "insertUsername" like '%${item}%'
  592. </foreach>
  593. </if>
  594. </where>
  595. <include refid="orderBy"></include>
  596. </select>
  597. <!-- 查询内转钢材到异地库收货实绩-->
  598. <select id="getSteelNzReceiptResult" parameterType="java.util.Map" resultType="java.util.Map">
  599. SELECT *
  600. FROM (
  601. SELECT TRR.RESULT_ID "resultId",
  602. OO.ORDER_NUMBER "orderNumber",
  603. RC.CAPACITY_NUMBER "capacityNumber",
  604. RW.WAREHOUSE_NAME "warehouseName",
  605. TRR.INSERT_TIME "insertTime",
  606. TRR.INSERT_USERNAME "insertUsername"
  607. FROM TMSTRUCK_RECEIPT_RESULT TRR
  608. LEFT JOIN TMSTRUCK_TOTAL_RESULT TTR
  609. ON TTR.RESULT_TOTAL_ID = TRR.RESULT_TOTAL_ID
  610. LEFT JOIN OMSTRUCK_ORDER OO
  611. ON OO.ORDER_ID = TTR.ORDER_ID
  612. LEFT JOIN RMS_WAREHOUSE RW
  613. ON RW.WAREHOUSE_ID = TRR.WAREHOUSE_ID
  614. LEFT JOIN RMS_CAPACITY RC
  615. ON RC.CAPACITY_ID = OO.CAPACITY_ID
  616. WHERE OO.ORDER_TYPE = 4 AND TRR.STATUS = 1
  617. )
  618. <where>
  619. <if test="orderNumber != null">
  620. <foreach collection="orderNumber" item="item" open="(" separator="or" close=")">
  621. "orderNumber" like '%${item}%'
  622. </foreach>
  623. </if>
  624. <if test="capacityNumber != null">
  625. and
  626. <foreach collection="capacityNumber" item="item" open="(" separator="or" close=")">
  627. "capacityNumber" like '%${item}%'
  628. </foreach>
  629. </if>
  630. <if test="warehouseName != null">
  631. and
  632. <foreach collection="warehouseName" item="item" open="(" separator="or" close=")">
  633. "warehouseName" like '%${item}%'
  634. </foreach>
  635. </if>
  636. <if test="insertTime != null">
  637. and
  638. <foreach collection="insertTime" item="item" open="(" separator="or" close=")">
  639. "insertTime" like '%${item}%'
  640. </foreach>
  641. </if>
  642. <if test="insertUsername != null">
  643. and
  644. <foreach collection="insertUsername" item="item" open="(" separator="or" close=")">
  645. "insertUsername" like '%${item}%'
  646. </foreach>
  647. </if>
  648. </where>
  649. <include refid="orderBy"></include>
  650. </select>
  651. <select id="getInwardReceipt" parameterType="java.util.Map" resultType="java.util.Map">
  652. select *
  653. from (
  654. select TRR.RESULT_ID "resultId",
  655. APO.PURCHASE_ORDER_NO "purchaseOrderNo",
  656. RM.MATERIAL_NAME "materialName",
  657. OO.ORDER_NUMBER "orderNumber",
  658. RC.CAPACITY_NUMBER "capacityNumber",
  659. DB.RESULT_FOREIGN_SHIP_NAME "resultForeignShipName",
  660. TUR.UNLOAD_STATUS "unloadStatus",
  661. TWR.RESULT_NET_WEIGHT "resultNetWeight",
  662. tqr.result_issampling "issampling",
  663. TRR.INSERT_USERNAME "insertUsername",
  664. TRR.INSERT_TIME "insertTime",
  665. RW.WAREHOUSE_NAME "warehouseName"
  666. from TMSTRUCK_RECEIPT_RESULT TRR
  667. left join TMSTRUCK_TOTAL_RESULT TTR
  668. on TTR.RESULT_TOTAL_ID = TRR.RESULT_TOTAL_ID
  669. left join OMSTRUCK_ORDER OO
  670. on OO.ORDER_ID = TTR.ORDER_ID
  671. left join AMSTRUCK_INWARD_PLAN AIP
  672. on AIP.PLAN_ID = OO.ORDER_PLAN_ID
  673. left join AMSTRUCK_REQUIREMENT_PLAN ARP
  674. on ARP.PLAN_ID = AIP.PLAN_ID
  675. left join AMSTRUCK_INWARD_REQUIREMENT AIR
  676. on AIR.REQUIREMENT_ID = ARP.REQUIREMENT_ID
  677. left join AMS_PURCHASE_ORDER APO
  678. on APO.PURCHASE_ORDER_ID = AIR.PURCHASE_ORDER_ID
  679. left join DIL_BATCH DB
  680. on DB.BATCH_ID = APO.BATCH_ID
  681. left join RMS_CAPACITY RC
  682. on RC.CAPACITY_ID = OO.CAPACITY_ID
  683. left join TMSTRUCK_WEIGHT_RESULT TWR
  684. on TWR.RESULT_TOTAL_ID = TRR.RESULT_TOTAL_ID
  685. left join TMSTRUCK_UNLOAD_RESULT TUR
  686. on TUR.RESULT_TOTAL_ID = TRR.RESULT_TOTAL_ID
  687. left join OMSTRUCK_ORDER_MATERIAL OOM
  688. on OOM.ORDER_ID = OO.ORDER_ID
  689. left join RMS_MATERIAL RM
  690. on OOM.MATERIAL_ID = RM.MATERIAL_ID
  691. left join tmstruck_quality_result tqr
  692. on tqr.total_result_id = ttr.result_total_id
  693. left join RMS_WAREHOUSE RW
  694. on TUR.RESULT_UNLOAD_PLACE_ID = RW.WAREHOUSE_ID
  695. where TRR.STATUS = 1
  696. and OO.ORDER_TYPE = #{orderTypee}
  697. )
  698. <where>
  699. <if test="materialName != null">
  700. <foreach collection="materialName" item="item" open="(" separator="or" close=")">
  701. "materialName" like '%${item}%'
  702. </foreach>
  703. </if>
  704. <if test="purchaseOrderNo != null">
  705. and
  706. <foreach collection="purchaseOrderNo" item="item" open="(" separator="or" close=")">
  707. "purchaseOrderNo" like '%${item}%'
  708. </foreach>
  709. </if>
  710. <if test="orderNumber != null">
  711. and
  712. <foreach collection="orderNumber" item="item" open="(" separator="or" close=")">
  713. "orderNumber" like '%${item}%'
  714. </foreach>
  715. </if>
  716. <if test="capacityNumber != null">
  717. and
  718. <foreach collection="capacityNumber" item="item" open="(" separator="or" close=")">
  719. "capacityNumber" like '%${item}%'
  720. </foreach>
  721. </if>
  722. <if test="resultForeignShipName != null">
  723. and
  724. <foreach collection="resultForeignShipName" item="item" open="(" separator="or" close=")">
  725. "resultForeignShipName" like '%${item}%'
  726. </foreach>
  727. </if>
  728. <if test="unloadStatus != null">
  729. and
  730. <foreach collection="unloadStatus" item="item" open="(" separator="or" close=")">
  731. "unloadStatus" like '%${item}%'
  732. </foreach>
  733. </if>
  734. <if test="resultNetWeight != null">
  735. and
  736. <foreach collection="resultNetWeight" item="item" open="(" separator="or" close=")">
  737. "resultNetWeight" like '%${item}%'
  738. </foreach>
  739. </if>
  740. <if test="issampling != null">
  741. and
  742. <foreach collection="issampling" item="item" open="(" separator="or" close=")">
  743. "issampling" like '%${item}%'
  744. </foreach>
  745. </if>
  746. <if test="insertUsername != null">
  747. and
  748. <foreach collection="insertUsername" item="item" open="(" separator="or" close=")">
  749. "insertUsername" like '%${item}%'
  750. </foreach>
  751. </if>
  752. <if test="insertTime != null">
  753. and
  754. <foreach collection="insertTime" item="item" open="(" separator="or" close=")">
  755. "insertTime" like '%${item}%'
  756. </foreach>
  757. </if>
  758. </where>
  759. <include refid="orderBy"></include>
  760. </select>
  761. <!-- 查询是否已收过货 -->
  762. <select id="getReceiptResult" parameterType="java.math.BigDecimal" resultType="java.lang.Integer">
  763. select TRR.RESULT_ID
  764. from TMSTRUCK_RECEIPT_RESULT TRR
  765. where TRR.RESULT_TOTAL_ID = #{resultTotalId}
  766. </select>
  767. <!-- <select id="selectMaxId" resultType="java.math.BigDecimal">-->
  768. <!-- select max(RESULT_ID) from TMSTRUCK_RECEIPT_RESULT-->
  769. <!-- </select>-->
  770. <select id="getReceiptResultInfo" parameterType="java.util.Map" resultType="java.util.LinkedHashMap">
  771. select
  772. *
  773. from (
  774. select distinct OO.ORDER_NUMBER "orderNumber", --运单订单号
  775. RC.CAPACITY_NUMBER "capacityNumber",--车牌号
  776. TWR.RESULT_GROSS_WEIGHT_TIME "resultGrossWeightTime",--计毛时间
  777. TWR.RESULT_NET_WEIGHT "resultNetWeight",--净重
  778. TLFR.RESULT_OUT_GATE_TIME "resultOutGateTime",--出厂时间
  779. RGOUT.GATEPOST_NAME "outGatepostName",--出厂门禁
  780. RCR.CARRIER_NAME "carrierName" , --承运商名称
  781. RRP.ADDRESS_DELIVERY_ADDRESS "deliveryAddress", --详细收货地址
  782. RM.MATERIAL_NAME "materialName" , --"物质名称"
  783. RM.MATERIAL_SPECIFICATION "materialSpecification", -- "物质规格"
  784. RM.MATERIAL_MODEL "materialModel", --"物质型号"
  785. RCON.CONSIGNEE_COMPANY_NAME "receiveName",--客户名称
  786. TAR.RESULT_ARRIVAL_ADDRESS "resultArrivalAddress",--抵达收货点的地址
  787. TAR.INSERT_TIME "insertTime",--抵达作业时间
  788. TAR.RESULT_FULL_CONTAINER_PHOTO "resultFullContainerPhoto" --车箱照片
  789. from OMSTRUCK_ORDER OO --运输订单
  790. left join AMS_SALE_ORDER_MATERIAL ASOM --销售订单物质表
  791. on ASOM.SALE_ORDER_MATERIAL_ID = OO.ORDER_PLAN_ID
  792. left join AMS_SALE_ORDER ASO --销售订单
  793. on ASO.SALE_ORDER_ID = ASOM.SALE_ORDER_ID
  794. left join RMS_CONSIGNEE RCON --收货客户
  795. on RCON.CONSIGNEE_ID = ASO.RECEIVE_ID
  796. left join TMSTRUCK_TOTAL_RESULT TTR --运输总实绩
  797. on TTR.ORDER_ID = OO.ORDER_ID
  798. left join TMSTRUCK_LOAD_RESULT TLR --汽车运输实绩表
  799. on TLR.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
  800. left join TMSTRUCK_ARRIVAL_RESULT TAR
  801. on TAR.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
  802. left join RMS_WAREHOUSE RW --装卸货仓库
  803. on RW.WAREHOUSE_ID = TLR.LOADING_ID
  804. left join TMSTRUCK_LEAVE_FACTORY_RESULT TLFR --离厂实绩
  805. on TLFR.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
  806. left join RMS_GATEPOST RGOUT --门岗
  807. on RGOUT.GATEPOST_ID = TLFR.GATEPOST_ID
  808. left join RMS_CAPACITY RC --运力
  809. on RC.CAPACITY_ID = OO.CAPACITY_ID
  810. left join AMS_DISPATCH_SALE_ORDER ADSO
  811. on ASOM.SALE_ORDER_MATERIAL_ID=ADSO.SALE_ORDER_MATERIAL_ID
  812. left join RMS_CARRIER RCR --承运单位
  813. on ADSO.CARRIER_ID=RCR.CARRIER_ID
  814. left join RMS_RECEIVE_PLACE RRP --收货地址
  815. on ASOM.SALE_SHIPPING_ADDRESS_ID=RRP.PLACE_ID
  816. left join RMS_RECEIVE_ADDRESS REA
  817. on RRP.ADDRESS_ID=REA.ADDRESS_ID
  818. left join AMS_SALE_TRUCKNO_MATERIAL ASTM
  819. on ASOM.SALE_ORDER_MATERIAL_ID=ASTM.SALE_ORDER_MATERIAL_ID
  820. left join AMS_SALE_MATERIAL ASM1
  821. on ASTM.MATERIAL_ID =ASM1.SALE_MATERIAL_ID
  822. left join TMSTRUCK_WEIGHT_RESULT TWR --运输实绩计重
  823. on TWR.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID and ASM1.MATERIAL_ID =TWR.MATERIAL_ID
  824. left join RMS_MATERIAL RM
  825. on ASM1.MATERIAL_ID=RM.MATERIAL_ID
  826. where OO.ORDER_TYPE in (1) and TAR.INSERT_TIME IS NOT NULL
  827. <if test="oneDate != null">
  828. and to_date(#{oneDate}, 'yyyy-mm-dd hh24:mi:ss') &lt; = TAR.INSERT_TIME
  829. </if>
  830. <if test="startDate != null">
  831. and to_date(#{startDate}, 'yyyy-mm-dd hh24:mi:ss') &lt;= TAR.INSERT_TIME
  832. and to_date(#{endDate}, 'yyyy-mm-dd hh24:mi:ss') >= TAR.INSERT_TIME
  833. </if>
  834. <if test="con!=null">
  835. and (instr(RC.CAPACITY_NUMBER,#{con})>0 or instr(RM.MATERIAL_NAME,#{con})>0
  836. or instr(RCON.CONSIGNEE_COMPANY_NAME,#{con})>0)
  837. </if>
  838. )
  839. <where>
  840. <if test="orderNumbers !=null">
  841. and "orderNumber" like '${orderNumbers}'
  842. </if>
  843. <if test="capacityNumbers !=null">
  844. and "capacityNumber" like '${capacityNumbers}'
  845. </if>
  846. <if test="resultGrossWeightTimes !=null">
  847. and "resultGrossWeightTime" like '${resultGrossWeightTimes}'
  848. </if>
  849. <if test="resultGrossWeightTimes !=null">
  850. and "resultGrossWeightTime" like '${resultGrossWeightTimes}'
  851. </if>
  852. <if test="resultOutGateTimes !=null">
  853. and "resultOutGateTime" like '${resultOutGateTimes}'
  854. </if>
  855. <if test="resultNetWeights !=null">
  856. and "resultNetWeight" like '${resultNetWeights}'
  857. </if>
  858. <if test="resultOutGateTimes !=null">
  859. and "resultOutGateTime" like '${resultOutGateTimes}'
  860. </if>
  861. <if test="outGatepostNames !=null">
  862. and "outGatepostName" like '${outGatepostNames}'
  863. </if>
  864. <if test="carrierNames !=null">
  865. and "carrierName" like '${carrierNames}'
  866. </if>
  867. <if test="deliveryAddresss !=null">
  868. and "deliveryAddress" like '${deliveryAddresss}'
  869. </if>
  870. <if test="materialNames !=null">
  871. and "materialName" like '${materialNames}'
  872. </if>
  873. <if test="materialSpecifications !=null">
  874. and "materialSpecification" like '${materialSpecifications}'
  875. </if>
  876. <if test="materialModels !=null">
  877. and "materialModel" like '${materialModels}'
  878. </if>
  879. <if test="receiveNames !=null">
  880. and "receiveName" like '${receiveNames}'
  881. </if>
  882. <if test="orderNumber !=null">
  883. and "orderNumber" in
  884. <foreach collection="orderNumber" separator="," open="(" close=")" item="item" >
  885. #{item}
  886. </foreach>
  887. </if>
  888. <if test="capacityNumber !=null">
  889. and "capacityNumber" in
  890. <foreach collection="capacityNumber" separator="," open="(" close=")" item="item" >
  891. #{item}
  892. </foreach>
  893. </if>
  894. <if test="resultGrossWeightTime !=null">
  895. and "resultGrossWeightTime" in
  896. <foreach collection="resultGrossWeightTime" separator="," open="(" close=")" item="item" >
  897. #{item}
  898. </foreach>
  899. </if>
  900. <if test="resultNetWeight !=null">
  901. and "resultNetWeight" in
  902. <foreach collection="resultNetWeight" separator="," open="(" close=")" item="item" >
  903. #{item}
  904. </foreach>
  905. </if>
  906. <if test="resultOutGateTime !=null">
  907. and "resultOutGateTime" in
  908. <foreach collection="resultOutGateTime" separator="," open="(" close=")" item="item" >
  909. #{item}
  910. </foreach>
  911. </if>
  912. <if test="outGatepostName !=null">
  913. and "outGatepostName" in
  914. <foreach collection="outGatepostName" separator="," open="(" close=")" item="item" >
  915. #{item}
  916. </foreach>
  917. </if>
  918. <if test="carrierName !=null">
  919. and "carrierName" in
  920. <foreach collection="carrierName" separator="," open="(" close=")" item="item" >
  921. #{item}
  922. </foreach>
  923. </if>
  924. <if test="deliveryAddress !=null">
  925. and "deliveryAddress" in
  926. <foreach collection="deliveryAddress" separator="," open="(" close=")" item="item" >
  927. #{item}
  928. </foreach>
  929. </if>
  930. <if test="materialSpecification !=null">
  931. and "materialSpecification" in
  932. <foreach collection="materialSpecification" separator="," open="(" close=")" item="item" >
  933. #{item}
  934. </foreach>
  935. </if>
  936. <if test="materialModel !=null">
  937. and "materialModel" in
  938. <foreach collection="materialModel" separator="," open="(" close=")" item="item" >
  939. #{item}
  940. </foreach>
  941. </if>
  942. <if test="receiveName !=null">
  943. and "receiveName" in
  944. <foreach collection="receiveName" separator="," open="(" close=")" item="item" >
  945. #{item}
  946. </foreach>
  947. </if>
  948. <if test="resultArrivalAddress !=null">
  949. and "resultArrivalAddress" in
  950. <foreach collection="resultArrivalAddress" separator="," open="(" close=")" item="item" >
  951. #{item}
  952. </foreach>
  953. </if>
  954. <if test="insertTime !=null">
  955. and "insertTime" in
  956. <foreach collection="insertTime" separator="," open="(" close=")" item="item" >
  957. #{item}
  958. </foreach>
  959. </if>
  960. <if test="resultFullContainerPhoto !=null">
  961. and "resultFullContainerPhoto" in
  962. <foreach collection="resultFullContainerPhoto" separator="," open="(" close=")" item="item" >
  963. #{item}
  964. </foreach>
  965. </if>
  966. </where>
  967. <include refid="orderBy"></include>
  968. </select>
  969. <select id="getReceiptPhoto" parameterType="java.lang.String" resultType="java.lang.String">
  970. select tar.RESULT_FULL_CONTAINER_PHOTO
  971. from TMSTRUCK_ARRIVAL_RESULT tar
  972. left join TMSTRUCK_TOTAL_RESULT ttr
  973. on ttr.RESULT_TOTAL_ID = tar.RESULT_TOTAL_ID
  974. left join OMSTRUCK_ORDER oo
  975. on oo.ORDER_ID = ttr.ORDER_ID
  976. where oo.ORDER_NUMBER = #{orderNumber}
  977. </select>
  978. </mapper>