TmstruckReceiptResultMapper.xml 49 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235
  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. <select id="getReceivingResult" parameterType="java.util.Map" resultType="java.util.LinkedHashMap">
  979. select
  980. *
  981. from (
  982. select distinct OO.ORDER_NUMBER "orderNumber", --运单订单号
  983. RC.CAPACITY_NUMBER "capacityNumber",--车牌号
  984. TWR.RESULT_GROSS_WEIGHT_TIME "resultGrossWeightTime",--计毛时间
  985. TWR.RESULT_NET_WEIGHT "resultNetWeight",--净重
  986. TLFR.RESULT_OUT_GATE_TIME "resultOutGateTime",--出厂时间
  987. RGOUT.GATEPOST_NAME "outGatepostName",--出厂门禁
  988. RCR.CARRIER_NAME "carrierName" , --承运商名称
  989. RRP.ADDRESS_DELIVERY_ADDRESS "deliveryAddress", --详细收货地址
  990. RM.MATERIAL_NAME "materialName" , --"物质名称"
  991. RM.MATERIAL_SPECIFICATION "materialSpecification", -- "物质规格"
  992. RM.MATERIAL_MODEL "materialModel", --"物质型号"
  993. RCON.CONSIGNEE_COMPANY_NAME "receiveName",--客户名称
  994. TRR.RESULT_ARRIVAL_ADDRESS "resultArrivalAddress",--签收收货点的地址
  995. TRR.INSERT_TIME "insertTime",--签收作业时间
  996. TRR.ORDER_MILEAGE "orderMileage" --运输距离
  997. from OMSTRUCK_ORDER OO --运输订单
  998. left join AMS_SALE_ORDER_MATERIAL ASOM --销售订单物质表
  999. on ASOM.SALE_ORDER_MATERIAL_ID = OO.ORDER_PLAN_ID
  1000. left join AMS_SALE_ORDER ASO --销售订单
  1001. on ASO.SALE_ORDER_ID = ASOM.SALE_ORDER_ID
  1002. left join RMS_CONSIGNEE RCON --收货客户
  1003. on RCON.CONSIGNEE_ID = ASO.RECEIVE_ID
  1004. left join TMSTRUCK_TOTAL_RESULT TTR --运输总实绩
  1005. on TTR.ORDER_ID = OO.ORDER_ID
  1006. left join TMSTRUCK_LOAD_RESULT TLR --汽车运输实绩表
  1007. on TLR.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
  1008. left join TMSTRUCK_RECEIPT_RESULT TRR
  1009. on TRR.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
  1010. left join RMS_WAREHOUSE RW --装卸货仓库
  1011. on RW.WAREHOUSE_ID = TLR.LOADING_ID
  1012. left join TMSTRUCK_LEAVE_FACTORY_RESULT TLFR --离厂实绩
  1013. on TLFR.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
  1014. left join RMS_GATEPOST RGOUT --门岗
  1015. on RGOUT.GATEPOST_ID = TLFR.GATEPOST_ID
  1016. left join RMS_CAPACITY RC --运力
  1017. on RC.CAPACITY_ID = OO.CAPACITY_ID
  1018. left join AMS_DISPATCH_SALE_ORDER ADSO
  1019. on ASOM.SALE_ORDER_MATERIAL_ID=ADSO.SALE_ORDER_MATERIAL_ID
  1020. left join RMS_CARRIER RCR --承运单位
  1021. on ADSO.CARRIER_ID=RCR.CARRIER_ID
  1022. left join RMS_RECEIVE_PLACE RRP --收货地址
  1023. on ASOM.SALE_SHIPPING_ADDRESS_ID=RRP.PLACE_ID
  1024. left join RMS_RECEIVE_ADDRESS REA
  1025. on RRP.ADDRESS_ID=REA.ADDRESS_ID
  1026. left join AMS_SALE_TRUCKNO_MATERIAL ASTM
  1027. on ASOM.SALE_ORDER_MATERIAL_ID=ASTM.SALE_ORDER_MATERIAL_ID
  1028. left join AMS_SALE_MATERIAL ASM1
  1029. on ASTM.MATERIAL_ID =ASM1.SALE_MATERIAL_ID
  1030. left join TMSTRUCK_WEIGHT_RESULT TWR --运输实绩计重
  1031. on TWR.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID and ASM1.MATERIAL_ID =TWR.MATERIAL_ID
  1032. left join RMS_MATERIAL RM
  1033. on ASM1.MATERIAL_ID=RM.MATERIAL_ID
  1034. where OO.ORDER_TYPE in (1) and TRR.INSERT_TIME IS NOT NULL
  1035. <if test="oneDate != null">
  1036. and to_date(#{oneDate}, 'yyyy-mm-dd hh24:mi:ss') &lt; = TRR.INSERT_TIME
  1037. </if>
  1038. <if test="startDate != null">
  1039. and to_date(#{startDate}, 'yyyy-mm-dd hh24:mi:ss') &lt;= TRR.INSERT_TIME
  1040. and to_date(#{endDate}, 'yyyy-mm-dd hh24:mi:ss') >= TRR.INSERT_TIME
  1041. </if>
  1042. <if test="con!=null">
  1043. and (instr(RC.CAPACITY_NUMBER,#{con})>0 or instr(RM.MATERIAL_NAME,#{con})>0
  1044. or instr(RCON.CONSIGNEE_COMPANY_NAME,#{con})>0)
  1045. </if>
  1046. )
  1047. <where>
  1048. <if test="orderNumbers !=null">
  1049. and "orderNumber" like '${orderNumbers}'
  1050. </if>
  1051. <if test="capacityNumbers !=null">
  1052. and "capacityNumber" like '${capacityNumbers}'
  1053. </if>
  1054. <if test="resultGrossWeightTimes !=null">
  1055. and "resultGrossWeightTime" like '${resultGrossWeightTimes}'
  1056. </if>
  1057. <if test="resultGrossWeightTimes !=null">
  1058. and "resultGrossWeightTime" like '${resultGrossWeightTimes}'
  1059. </if>
  1060. <if test="resultOutGateTimes !=null">
  1061. and "resultOutGateTime" like '${resultOutGateTimes}'
  1062. </if>
  1063. <if test="resultNetWeights !=null">
  1064. and "resultNetWeight" like '${resultNetWeights}'
  1065. </if>
  1066. <if test="resultOutGateTimes !=null">
  1067. and "resultOutGateTime" like '${resultOutGateTimes}'
  1068. </if>
  1069. <if test="outGatepostNames !=null">
  1070. and "outGatepostName" like '${outGatepostNames}'
  1071. </if>
  1072. <if test="carrierNames !=null">
  1073. and "carrierName" like '${carrierNames}'
  1074. </if>
  1075. <if test="deliveryAddresss !=null">
  1076. and "deliveryAddress" like '${deliveryAddresss}'
  1077. </if>
  1078. <if test="materialNames !=null">
  1079. and "materialName" like '${materialNames}'
  1080. </if>
  1081. <if test="materialSpecifications !=null">
  1082. and "materialSpecification" like '${materialSpecifications}'
  1083. </if>
  1084. <if test="materialModels !=null">
  1085. and "materialModel" like '${materialModels}'
  1086. </if>
  1087. <if test="receiveNames !=null">
  1088. and "receiveName" like '${receiveNames}'
  1089. </if>
  1090. <if test="orderNumber !=null">
  1091. and "orderNumber" in
  1092. <foreach collection="orderNumber" separator="," open="(" close=")" item="item" >
  1093. #{item}
  1094. </foreach>
  1095. </if>
  1096. <if test="capacityNumber !=null">
  1097. and "capacityNumber" in
  1098. <foreach collection="capacityNumber" separator="," open="(" close=")" item="item" >
  1099. #{item}
  1100. </foreach>
  1101. </if>
  1102. <if test="resultGrossWeightTime !=null">
  1103. and "resultGrossWeightTime" in
  1104. <foreach collection="resultGrossWeightTime" separator="," open="(" close=")" item="item" >
  1105. #{item}
  1106. </foreach>
  1107. </if>
  1108. <if test="resultNetWeight !=null">
  1109. and "resultNetWeight" in
  1110. <foreach collection="resultNetWeight" separator="," open="(" close=")" item="item" >
  1111. #{item}
  1112. </foreach>
  1113. </if>
  1114. <if test="resultOutGateTime !=null">
  1115. and "resultOutGateTime" in
  1116. <foreach collection="resultOutGateTime" separator="," open="(" close=")" item="item" >
  1117. #{item}
  1118. </foreach>
  1119. </if>
  1120. <if test="outGatepostName !=null">
  1121. and "outGatepostName" in
  1122. <foreach collection="outGatepostName" separator="," open="(" close=")" item="item" >
  1123. #{item}
  1124. </foreach>
  1125. </if>
  1126. <if test="carrierName !=null">
  1127. and "carrierName" in
  1128. <foreach collection="carrierName" separator="," open="(" close=")" item="item" >
  1129. #{item}
  1130. </foreach>
  1131. </if>
  1132. <if test="deliveryAddress !=null">
  1133. and "deliveryAddress" in
  1134. <foreach collection="deliveryAddress" separator="," open="(" close=")" item="item" >
  1135. #{item}
  1136. </foreach>
  1137. </if>
  1138. <if test="materialSpecification !=null">
  1139. and "materialSpecification" in
  1140. <foreach collection="materialSpecification" separator="," open="(" close=")" item="item" >
  1141. #{item}
  1142. </foreach>
  1143. </if>
  1144. <if test="materialModel !=null">
  1145. and "materialModel" in
  1146. <foreach collection="materialModel" separator="," open="(" close=")" item="item" >
  1147. #{item}
  1148. </foreach>
  1149. </if>
  1150. <if test="receiveName !=null">
  1151. and "receiveName" in
  1152. <foreach collection="receiveName" separator="," open="(" close=")" item="item" >
  1153. #{item}
  1154. </foreach>
  1155. </if>
  1156. <if test="resultArrivalAddress !=null">
  1157. and "resultArrivalAddress" in
  1158. <foreach collection="resultArrivalAddress" separator="," open="(" close=")" item="item" >
  1159. #{item}
  1160. </foreach>
  1161. </if>
  1162. <if test="insertTime !=null">
  1163. and "insertTime" in
  1164. <foreach collection="insertTime" separator="," open="(" close=")" item="item" >
  1165. #{item}
  1166. </foreach>
  1167. </if>
  1168. <if test="orderMileage !=null">
  1169. and "orderMileage" in
  1170. <foreach collection="orderMileage" separator="," open="(" close=")" item="item" >
  1171. #{item}
  1172. </foreach>
  1173. </if>
  1174. </where>
  1175. <include refid="orderBy"></include>
  1176. </select>
  1177. <select id="getReceivingPhoto" parameterType="java.lang.String" resultType="java.util.Map">
  1178. select trr.RESULT_EMPTY_CONTAINER_PHOTO "resultEmptyContainerPhoto",
  1179. trr.RESULT_SIGNED_NOTE_PHOTO "resultSignedNotePhoto",
  1180. trr.RESULT_RECEIVE_NOTE_PHOTO "resultReceiveNotePhoto"
  1181. from TMSTRUCK_RECEIPT_RESULT trr
  1182. left join TMSTRUCK_TOTAL_RESULT ttr
  1183. on ttr.RESULT_TOTAL_ID = trr.RESULT_TOTAL_ID
  1184. left join OMSTRUCK_ORDER oo
  1185. on oo.ORDER_ID = ttr.ORDER_ID
  1186. where oo.ORDER_NUMBER = #{orderNumber}
  1187. </select>
  1188. <select id="getChildPhoto" parameterType="java.lang.String" resultType="java.util.Map">
  1189. select trrc.OTHER_PHOTO1 "otherPhoto1",
  1190. trrc.OTHER_PHOTO2 "otherPhoto2",
  1191. trrc.OTHER_PHOTO3 "otherPhoto3"
  1192. from TMSTRUCK_RECEIPT_RESULT trr
  1193. left join TMSTRUCK_TOTAL_RESULT ttr
  1194. on ttr.RESULT_TOTAL_ID = trr.RESULT_TOTAL_ID
  1195. left join OMSTRUCK_ORDER oo
  1196. on oo.ORDER_ID = ttr.ORDER_ID
  1197. left join TMSTRUCK_RECEIPT_RESULT_CHILD trrc
  1198. on trr.RESULT_ID = trrc.RECEIPT_RESULT_ID
  1199. where oo.ORDER_NUMBER = #{orderNumber}
  1200. </select>
  1201. </mapper>