TmstruckUnloadResultMapper.xml 45 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010
  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.TmstruckUnloadResultMapper">
  4. <resultMap id="BaseResultMap" type="com.steerinfo.dil.model.TmstruckUnloadResult">
  5. <id column="RESULT_ID" jdbcType="DECIMAL" property="resultId" />
  6. <result column="RESULT_NUMBER" jdbcType="VARCHAR" property="resultNumber" />
  7. <result column="RESULT_TOTAL_ID" jdbcType="DECIMAL" property="resultTotalId" />
  8. <result column="RESULT_START_TIME" jdbcType="TIMESTAMP" property="resultStartTime" />
  9. <result column="RESULT_END_TIME" jdbcType="TIMESTAMP" property="resultEndTime" />
  10. <result column="RESULT_DURATION" jdbcType="DECIMAL" property="resultDuration" />
  11. <result column="UNLOAD_STATUS" jdbcType="VARCHAR" property="unloadStatus" />
  12. <result column="INSERT_USERNAME" jdbcType="VARCHAR" property="insertUsername" />
  13. <result column="INSERT_TIME" jdbcType="TIMESTAMP" property="insertTime" />
  14. <result column="UPDATE_USERNAME" jdbcType="VARCHAR" property="updateUsername" />
  15. <result column="UPDATE_TIME" jdbcType="TIMESTAMP" property="updateTime" />
  16. <result column="INSERT_UPDATE_REMARK" jdbcType="VARCHAR" property="insertUpdateRemark" />
  17. <result column="DELETE_NAME" jdbcType="VARCHAR" property="deleteName" />
  18. <result column="DELETE_TIME" jdbcType="TIMESTAMP" property="deleteTime" />
  19. <result column="RESULT_UNLOAD_PLACE_ID" jdbcType="DECIMAL" property="resultUnloadPlaceId" />
  20. <result column="SEGMENT_SQE" jdbcType="DECIMAL" property="segmentSqe" />
  21. <result column="MATERIAL_ID" jdbcType="DECIMAL" property="materialId" />
  22. </resultMap>
  23. <sql id="columns">
  24. RESULT_ID, RESULT_NUMBER, RESULT_TOTAL_ID, RESULT_START_TIME, RESULT_END_TIME, RESULT_DURATION,
  25. UNLOAD_STATUS, INSERT_USERNAME, INSERT_TIME, UPDATE_USERNAME, UPDATE_TIME, INSERT_UPDATE_REMARK,
  26. DELETE_NAME, DELETE_TIME, RESULT_UNLOAD_PLACE_ID, SEGMENT_SQE, MATERIAL_ID
  27. </sql>
  28. <sql id="columns_alias">
  29. t.RESULT_ID, t.RESULT_NUMBER, t.RESULT_TOTAL_ID, t.RESULT_START_TIME, t.RESULT_END_TIME,
  30. t.RESULT_DURATION, t.UNLOAD_STATUS, t.INSERT_USERNAME, t.INSERT_TIME, t.UPDATE_USERNAME,
  31. t.UPDATE_TIME, t.INSERT_UPDATE_REMARK, t.DELETE_NAME, t.DELETE_TIME, t.RESULT_UNLOAD_PLACE_ID,
  32. t.SEGMENT_SQE, t.MATERIAL_ID
  33. </sql>
  34. <sql id="select">
  35. SELECT <include refid="columns" /> FROM TMSTRUCK_UNLOAD_RESULT
  36. </sql>
  37. <sql id="select_alias">
  38. SELECT <include refid="columns_alias" /> FROM TMSTRUCK_UNLOAD_RESULT t
  39. </sql>
  40. <sql id="where">
  41. <where>
  42. <if test="resultId != null">
  43. and RESULT_ID = #{resultId}
  44. </if>
  45. <if test="resultNumber != null and resultNumber != ''">
  46. and RESULT_NUMBER = #{resultNumber}
  47. </if>
  48. <if test="resultTotalId != null">
  49. and RESULT_TOTAL_ID = #{resultTotalId}
  50. </if>
  51. <if test="resultStartTime != null">
  52. and TO_CHAR(RESULT_START_TIME,'yyyy-MM-dd') = #{resultStartTime}
  53. </if>
  54. <if test="resultEndTime != null">
  55. and TO_CHAR(RESULT_END_TIME,'yyyy-MM-dd') = #{resultEndTime}
  56. </if>
  57. <if test="resultDuration != null">
  58. and RESULT_DURATION = #{resultDuration}
  59. </if>
  60. <if test="unloadStatus != null and unloadStatus != ''">
  61. and UNLOAD_STATUS = #{unloadStatus}
  62. </if>
  63. <if test="insertUsername != null and insertUsername != ''">
  64. and INSERT_USERNAME = #{insertUsername}
  65. </if>
  66. <if test="insertTime != null">
  67. and TO_CHAR(INSERT_TIME,'yyyy-MM-dd') = #{insertTime}
  68. </if>
  69. <if test="updateUsername != null and updateUsername != ''">
  70. and UPDATE_USERNAME = #{updateUsername}
  71. </if>
  72. <if test="updateTime != null">
  73. and TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = #{updateTime}
  74. </if>
  75. <if test="insertUpdateRemark != null and insertUpdateRemark != ''">
  76. and INSERT_UPDATE_REMARK = #{insertUpdateRemark}
  77. </if>
  78. <if test="deleteName != null and deleteName != ''">
  79. and DELETE_NAME = #{deleteName}
  80. </if>
  81. <if test="deleteTime != null">
  82. and TO_CHAR(DELETE_TIME,'yyyy-MM-dd') = #{deleteTime}
  83. </if>
  84. <if test="resultUnloadPlaceId != null">
  85. and RESULT_UNLOAD_PLACE_ID = #{resultUnloadPlaceId}
  86. </if>
  87. <if test="segmentSqe != null">
  88. and SEGMENT_SQE = #{segmentSqe}
  89. </if>
  90. <if test="materialId != null">
  91. and MATERIAL_ID = #{materialId}
  92. </if>
  93. </where>
  94. </sql>
  95. <sql id="whereLike">
  96. <where>
  97. <if test="resultId != null">
  98. and RESULT_ID = #{resultId}
  99. </if>
  100. <if test="resultNumber != null and resultNumber != ''">
  101. and RESULT_NUMBER LIKE '%${resultNumber}%'
  102. </if>
  103. <if test="resultTotalId != null">
  104. and RESULT_TOTAL_ID = #{resultTotalId}
  105. </if>
  106. <if test="resultStartTime != null">
  107. and TO_CHAR(RESULT_START_TIME,'yyyy-MM-dd') = #{resultStartTime}
  108. </if>
  109. <if test="resultEndTime != null">
  110. and TO_CHAR(RESULT_END_TIME,'yyyy-MM-dd') = #{resultEndTime}
  111. </if>
  112. <if test="resultDuration != null">
  113. and RESULT_DURATION = #{resultDuration}
  114. </if>
  115. <if test="unloadStatus != null and unloadStatus != ''">
  116. and UNLOAD_STATUS LIKE '%${unloadStatus}%'
  117. </if>
  118. <if test="insertUsername != null and insertUsername != ''">
  119. and INSERT_USERNAME LIKE '%${insertUsername}%'
  120. </if>
  121. <if test="insertTime != null">
  122. and TO_CHAR(INSERT_TIME,'yyyy-MM-dd') = #{insertTime}
  123. </if>
  124. <if test="updateUsername != null and updateUsername != ''">
  125. and UPDATE_USERNAME LIKE '%${updateUsername}%'
  126. </if>
  127. <if test="updateTime != null">
  128. and TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = #{updateTime}
  129. </if>
  130. <if test="insertUpdateRemark != null and insertUpdateRemark != ''">
  131. and INSERT_UPDATE_REMARK LIKE '%${insertUpdateRemark}%'
  132. </if>
  133. <if test="deleteName != null and deleteName != ''">
  134. and DELETE_NAME LIKE '%${deleteName}%'
  135. </if>
  136. <if test="deleteTime != null">
  137. and TO_CHAR(DELETE_TIME,'yyyy-MM-dd') = #{deleteTime}
  138. </if>
  139. <if test="resultUnloadPlaceId != null">
  140. and RESULT_UNLOAD_PLACE_ID = #{resultUnloadPlaceId}
  141. </if>
  142. <if test="segmentSqe != null">
  143. and SEGMENT_SQE = #{segmentSqe}
  144. </if>
  145. <if test="materialId != null">
  146. and MATERIAL_ID = #{materialId}
  147. </if>
  148. </where>
  149. </sql>
  150. <delete id="deleteByPrimaryKey" parameterType="java.lang.Short">
  151. delete from TMSTRUCK_UNLOAD_RESULT
  152. where RESULT_ID = #{resultId,jdbcType=DECIMAL}
  153. </delete>
  154. <delete id="deleteBySelectiveElement" parameterType="java.util.HashMap">
  155. delete from TMSTRUCK_UNLOAD_RESULT
  156. where 1!=1
  157. <if test="resultNumber != null and resultNumber != ''">
  158. or RESULT_NUMBER = #{resultNumber}
  159. </if>
  160. <if test="resultTotalId != null">
  161. or RESULT_TOTAL_ID = #{resultTotalId}
  162. </if>
  163. <if test="resultStartTime != null">
  164. or TO_CHAR(RESULT_START_TIME,'yyyy-MM-dd') = '#{resultStartTime}'
  165. </if>
  166. <if test="resultEndTime != null">
  167. or TO_CHAR(RESULT_END_TIME,'yyyy-MM-dd') = '#{resultEndTime}'
  168. </if>
  169. <if test="resultDuration != null">
  170. or RESULT_DURATION = #{resultDuration}
  171. </if>
  172. <if test="unloadStatus != null and unloadStatus != ''">
  173. or UNLOAD_STATUS = #{unloadStatus}
  174. </if>
  175. <if test="insertUsername != null and insertUsername != ''">
  176. or INSERT_USERNAME = #{insertUsername}
  177. </if>
  178. <if test="insertTime != null">
  179. or TO_CHAR(INSERT_TIME,'yyyy-MM-dd') = '#{insertTime}'
  180. </if>
  181. <if test="updateUsername != null and updateUsername != ''">
  182. or UPDATE_USERNAME = #{updateUsername}
  183. </if>
  184. <if test="updateTime != null">
  185. or TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = '#{updateTime}'
  186. </if>
  187. <if test="insertUpdateRemark != null and insertUpdateRemark != ''">
  188. or INSERT_UPDATE_REMARK = #{insertUpdateRemark}
  189. </if>
  190. <if test="deleteName != null and deleteName != ''">
  191. or DELETE_NAME = #{deleteName}
  192. </if>
  193. <if test="deleteTime != null">
  194. or TO_CHAR(DELETE_TIME,'yyyy-MM-dd') = '#{deleteTime}'
  195. </if>
  196. <if test="resultUnloadPlaceId != null">
  197. or RESULT_UNLOAD_PLACE_ID = #{resultUnloadPlaceId}
  198. </if>
  199. <if test="segmentSqe != null">
  200. or SEGMENT_SQE = #{segmentSqe}
  201. </if>
  202. <if test="materialId != null">
  203. or MATERIAL_ID = #{materialId}
  204. </if>
  205. </delete>
  206. <insert id="insert" parameterType="com.steerinfo.dil.model.TmstruckUnloadResult">
  207. insert into TMSTRUCK_UNLOAD_RESULT (RESULT_ID, RESULT_NUMBER, RESULT_TOTAL_ID,
  208. RESULT_START_TIME, RESULT_END_TIME, RESULT_DURATION,
  209. UNLOAD_STATUS, INSERT_USERNAME, INSERT_TIME,
  210. UPDATE_USERNAME, UPDATE_TIME, INSERT_UPDATE_REMARK,
  211. DELETE_NAME, DELETE_TIME, RESULT_UNLOAD_PLACE_ID,
  212. SEGMENT_SQE, MATERIAL_ID)
  213. values (#{resultId,jdbcType=DECIMAL}, #{resultNumber,jdbcType=VARCHAR}, #{resultTotalId,jdbcType=DECIMAL},
  214. #{resultStartTime,jdbcType=TIMESTAMP}, #{resultEndTime,jdbcType=TIMESTAMP}, #{resultDuration,jdbcType=DECIMAL},
  215. #{unloadStatus,jdbcType=VARCHAR}, #{insertUsername,jdbcType=VARCHAR}, #{insertTime,jdbcType=TIMESTAMP},
  216. #{updateUsername,jdbcType=VARCHAR}, #{updateTime,jdbcType=TIMESTAMP}, #{insertUpdateRemark,jdbcType=VARCHAR},
  217. #{deleteName,jdbcType=VARCHAR}, #{deleteTime,jdbcType=TIMESTAMP}, #{resultUnloadPlaceId,jdbcType=DECIMAL},
  218. #{segmentSqe,jdbcType=DECIMAL}, #{materialId,jdbcType=DECIMAL})
  219. </insert>
  220. <insert id="insertSelective" parameterType="com.steerinfo.dil.model.TmstruckUnloadResult">
  221. insert into TMSTRUCK_UNLOAD_RESULT
  222. <trim prefix="(" suffix=")" suffixOverrides=",">
  223. <if test="resultId != null">
  224. RESULT_ID,
  225. </if>
  226. <if test="resultNumber != null">
  227. RESULT_NUMBER,
  228. </if>
  229. <if test="resultTotalId != null">
  230. RESULT_TOTAL_ID,
  231. </if>
  232. <if test="resultStartTime != null">
  233. RESULT_START_TIME,
  234. </if>
  235. <if test="resultEndTime != null">
  236. RESULT_END_TIME,
  237. </if>
  238. <if test="resultDuration != null">
  239. RESULT_DURATION,
  240. </if>
  241. <if test="unloadStatus != null">
  242. UNLOAD_STATUS,
  243. </if>
  244. <if test="insertUsername != null">
  245. INSERT_USERNAME,
  246. </if>
  247. <if test="insertTime != null">
  248. INSERT_TIME,
  249. </if>
  250. <if test="updateUsername != null">
  251. UPDATE_USERNAME,
  252. </if>
  253. <if test="updateTime != null">
  254. UPDATE_TIME,
  255. </if>
  256. <if test="insertUpdateRemark != null">
  257. INSERT_UPDATE_REMARK,
  258. </if>
  259. <if test="deleteName != null">
  260. DELETE_NAME,
  261. </if>
  262. <if test="deleteTime != null">
  263. DELETE_TIME,
  264. </if>
  265. <if test="resultUnloadPlaceId != null">
  266. RESULT_UNLOAD_PLACE_ID,
  267. </if>
  268. <if test="segmentSqe != null">
  269. SEGMENT_SQE,
  270. </if>
  271. <if test="materialId != null">
  272. MATERIAL_ID,
  273. </if>
  274. </trim>
  275. <trim prefix="values (" suffix=")" suffixOverrides=",">
  276. <if test="resultId != null">
  277. #{resultId,jdbcType=DECIMAL},
  278. </if>
  279. <if test="resultNumber != null">
  280. #{resultNumber,jdbcType=VARCHAR},
  281. </if>
  282. <if test="resultTotalId != null">
  283. #{resultTotalId,jdbcType=DECIMAL},
  284. </if>
  285. <if test="resultStartTime != null">
  286. #{resultStartTime,jdbcType=TIMESTAMP},
  287. </if>
  288. <if test="resultEndTime != null">
  289. #{resultEndTime,jdbcType=TIMESTAMP},
  290. </if>
  291. <if test="resultDuration != null">
  292. #{resultDuration,jdbcType=DECIMAL},
  293. </if>
  294. <if test="unloadStatus != null">
  295. #{unloadStatus,jdbcType=VARCHAR},
  296. </if>
  297. <if test="insertUsername != null">
  298. #{insertUsername,jdbcType=VARCHAR},
  299. </if>
  300. <if test="insertTime != null">
  301. #{insertTime,jdbcType=TIMESTAMP},
  302. </if>
  303. <if test="updateUsername != null">
  304. #{updateUsername,jdbcType=VARCHAR},
  305. </if>
  306. <if test="updateTime != null">
  307. #{updateTime,jdbcType=TIMESTAMP},
  308. </if>
  309. <if test="insertUpdateRemark != null">
  310. #{insertUpdateRemark,jdbcType=VARCHAR},
  311. </if>
  312. <if test="deleteName != null">
  313. #{deleteName,jdbcType=VARCHAR},
  314. </if>
  315. <if test="deleteTime != null">
  316. #{deleteTime,jdbcType=TIMESTAMP},
  317. </if>
  318. <if test="resultUnloadPlaceId != null">
  319. #{resultUnloadPlaceId,jdbcType=DECIMAL},
  320. </if>
  321. <if test="segmentSqe != null">
  322. #{segmentSqe,jdbcType=DECIMAL},
  323. </if>
  324. <if test="materialId != null">
  325. #{materialId,jdbcType=DECIMAL},
  326. </if>
  327. </trim>
  328. </insert>
  329. <update id="updateByPrimaryKey" parameterType="com.steerinfo.dil.model.TmstruckUnloadResult">
  330. update TMSTRUCK_UNLOAD_RESULT
  331. set RESULT_NUMBER = #{resultNumber,jdbcType=VARCHAR},
  332. RESULT_TOTAL_ID = #{resultTotalId,jdbcType=DECIMAL},
  333. RESULT_START_TIME = #{resultStartTime,jdbcType=TIMESTAMP},
  334. RESULT_END_TIME = #{resultEndTime,jdbcType=TIMESTAMP},
  335. RESULT_DURATION = #{resultDuration,jdbcType=DECIMAL},
  336. UNLOAD_STATUS = #{unloadStatus,jdbcType=VARCHAR},
  337. INSERT_USERNAME = #{insertUsername,jdbcType=VARCHAR},
  338. INSERT_TIME = #{insertTime,jdbcType=TIMESTAMP},
  339. UPDATE_USERNAME = #{updateUsername,jdbcType=VARCHAR},
  340. UPDATE_TIME = #{updateTime,jdbcType=TIMESTAMP},
  341. INSERT_UPDATE_REMARK = #{insertUpdateRemark,jdbcType=VARCHAR},
  342. DELETE_NAME = #{deleteName,jdbcType=VARCHAR},
  343. DELETE_TIME = #{deleteTime,jdbcType=TIMESTAMP},
  344. RESULT_UNLOAD_PLACE_ID = #{resultUnloadPlaceId,jdbcType=DECIMAL},
  345. SEGMENT_SQE = #{segmentSqe,jdbcType=DECIMAL},
  346. MATERIAL_ID = #{materialId,jdbcType=DECIMAL}
  347. where RESULT_ID = #{resultId,jdbcType=DECIMAL}
  348. </update>
  349. <update id="updateByPrimaryKeySelective" parameterType="com.steerinfo.dil.model.TmstruckUnloadResult">
  350. update TMSTRUCK_UNLOAD_RESULT
  351. <set>
  352. <if test="resultNumber != null">
  353. RESULT_NUMBER = #{resultNumber,jdbcType=VARCHAR},
  354. </if>
  355. <if test="resultTotalId != null">
  356. RESULT_TOTAL_ID = #{resultTotalId,jdbcType=DECIMAL},
  357. </if>
  358. <if test="resultStartTime != null">
  359. RESULT_START_TIME = #{resultStartTime,jdbcType=TIMESTAMP},
  360. </if>
  361. <if test="resultEndTime != null">
  362. RESULT_END_TIME = #{resultEndTime,jdbcType=TIMESTAMP},
  363. </if>
  364. <if test="resultDuration != null">
  365. RESULT_DURATION = #{resultDuration,jdbcType=DECIMAL},
  366. </if>
  367. <if test="unloadStatus != null">
  368. UNLOAD_STATUS = #{unloadStatus,jdbcType=VARCHAR},
  369. </if>
  370. <if test="insertUsername != null">
  371. INSERT_USERNAME = #{insertUsername,jdbcType=VARCHAR},
  372. </if>
  373. <if test="insertTime != null">
  374. INSERT_TIME = #{insertTime,jdbcType=TIMESTAMP},
  375. </if>
  376. <if test="updateUsername != null">
  377. UPDATE_USERNAME = #{updateUsername,jdbcType=VARCHAR},
  378. </if>
  379. <if test="updateTime != null">
  380. UPDATE_TIME = #{updateTime,jdbcType=TIMESTAMP},
  381. </if>
  382. <if test="insertUpdateRemark != null">
  383. INSERT_UPDATE_REMARK = #{insertUpdateRemark,jdbcType=VARCHAR},
  384. </if>
  385. <if test="deleteName != null">
  386. DELETE_NAME = #{deleteName,jdbcType=VARCHAR},
  387. </if>
  388. <if test="deleteTime != null">
  389. DELETE_TIME = #{deleteTime,jdbcType=TIMESTAMP},
  390. </if>
  391. <if test="resultUnloadPlaceId != null">
  392. RESULT_UNLOAD_PLACE_ID = #{resultUnloadPlaceId,jdbcType=DECIMAL},
  393. </if>
  394. <if test="segmentSqe != null">
  395. SEGMENT_SQE = #{segmentSqe,jdbcType=DECIMAL},
  396. </if>
  397. <if test="materialId != null">
  398. MATERIAL_ID = #{materialId,jdbcType=DECIMAL},
  399. </if>
  400. </set>
  401. where RESULT_ID = #{resultId,jdbcType=DECIMAL}
  402. </update>
  403. <select id="selectByPrimaryKey" parameterType="java.lang.Short" resultMap="BaseResultMap">
  404. <include refid="select" />
  405. where RESULT_ID = #{resultId,jdbcType=DECIMAL}
  406. </select>
  407. <select id="selectByParameters" parameterType="java.util.HashMap" resultMap="BaseResultMap">
  408. <include refid="select" />
  409. <include refid="where" />
  410. </select>
  411. <select id="selectLikeByParameters" parameterType="java.util.HashMap" resultMap="BaseResultMap">
  412. <include refid="select" />
  413. <include refid="whereLike" />
  414. </select>
  415. <insert id="batchInsert" parameterType="java.util.List">
  416. insert into TMSTRUCK_UNLOAD_RESULT
  417. (RESULT_ID,
  418. RESULT_NUMBER, RESULT_TOTAL_ID,
  419. RESULT_START_TIME, RESULT_END_TIME,
  420. RESULT_DURATION, UNLOAD_STATUS,
  421. INSERT_USERNAME, INSERT_TIME,
  422. UPDATE_USERNAME, UPDATE_TIME,
  423. INSERT_UPDATE_REMARK, DELETE_NAME,
  424. DELETE_TIME, RESULT_UNLOAD_PLACE_ID,
  425. SEGMENT_SQE, MATERIAL_ID)
  426. ( <foreach collection="list" item="item" separator="union all">
  427. select
  428. #{item.resultId,jdbcType=DECIMAL},
  429. #{item.resultNumber,jdbcType=VARCHAR}, #{item.resultTotalId,jdbcType=DECIMAL},
  430. #{item.resultStartTime,jdbcType=TIMESTAMP}, #{item.resultEndTime,jdbcType=TIMESTAMP},
  431. #{item.resultDuration,jdbcType=DECIMAL}, #{item.unloadStatus,jdbcType=VARCHAR},
  432. #{item.insertUsername,jdbcType=VARCHAR}, #{item.insertTime,jdbcType=TIMESTAMP},
  433. #{item.updateUsername,jdbcType=VARCHAR}, #{item.updateTime,jdbcType=TIMESTAMP},
  434. #{item.insertUpdateRemark,jdbcType=VARCHAR}, #{item.deleteName,jdbcType=VARCHAR},
  435. #{item.deleteTime,jdbcType=TIMESTAMP}, #{item.resultUnloadPlaceId,jdbcType=DECIMAL},
  436. #{item.segmentSqe,jdbcType=DECIMAL}, #{item.materialId,jdbcType=DECIMAL} from dual
  437. </foreach> )
  438. </insert>
  439. <update id="batchUpdate" parameterType="java.util.List">
  440. update TMSTRUCK_UNLOAD_RESULT
  441. set
  442. RESULT_ID=
  443. <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
  444. when #{item.resultId,jdbcType=DECIMAL} then #{item.resultId,jdbcType=DECIMAL}
  445. </foreach>
  446. ,RESULT_NUMBER=
  447. <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
  448. when #{item.resultId,jdbcType=DECIMAL} then #{item.resultNumber,jdbcType=VARCHAR}
  449. </foreach>
  450. ,RESULT_TOTAL_ID=
  451. <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
  452. when #{item.resultId,jdbcType=DECIMAL} then #{item.resultTotalId,jdbcType=DECIMAL}
  453. </foreach>
  454. ,RESULT_START_TIME=
  455. <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
  456. when #{item.resultId,jdbcType=DECIMAL} then #{item.resultStartTime,jdbcType=TIMESTAMP}
  457. </foreach>
  458. ,RESULT_END_TIME=
  459. <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
  460. when #{item.resultId,jdbcType=DECIMAL} then #{item.resultEndTime,jdbcType=TIMESTAMP}
  461. </foreach>
  462. ,RESULT_DURATION=
  463. <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
  464. when #{item.resultId,jdbcType=DECIMAL} then #{item.resultDuration,jdbcType=DECIMAL}
  465. </foreach>
  466. ,UNLOAD_STATUS=
  467. <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
  468. when #{item.resultId,jdbcType=DECIMAL} then #{item.unloadStatus,jdbcType=VARCHAR}
  469. </foreach>
  470. ,INSERT_USERNAME=
  471. <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
  472. when #{item.resultId,jdbcType=DECIMAL} then #{item.insertUsername,jdbcType=VARCHAR}
  473. </foreach>
  474. ,INSERT_TIME=
  475. <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
  476. when #{item.resultId,jdbcType=DECIMAL} then #{item.insertTime,jdbcType=TIMESTAMP}
  477. </foreach>
  478. ,UPDATE_USERNAME=
  479. <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
  480. when #{item.resultId,jdbcType=DECIMAL} then #{item.updateUsername,jdbcType=VARCHAR}
  481. </foreach>
  482. ,UPDATE_TIME=
  483. <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
  484. when #{item.resultId,jdbcType=DECIMAL} then #{item.updateTime,jdbcType=TIMESTAMP}
  485. </foreach>
  486. ,INSERT_UPDATE_REMARK=
  487. <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
  488. when #{item.resultId,jdbcType=DECIMAL} then #{item.insertUpdateRemark,jdbcType=VARCHAR}
  489. </foreach>
  490. ,DELETE_NAME=
  491. <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
  492. when #{item.resultId,jdbcType=DECIMAL} then #{item.deleteName,jdbcType=VARCHAR}
  493. </foreach>
  494. ,DELETE_TIME=
  495. <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
  496. when #{item.resultId,jdbcType=DECIMAL} then #{item.deleteTime,jdbcType=TIMESTAMP}
  497. </foreach>
  498. ,RESULT_UNLOAD_PLACE_ID=
  499. <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
  500. when #{item.resultId,jdbcType=DECIMAL} then #{item.resultUnloadPlaceId,jdbcType=DECIMAL}
  501. </foreach>
  502. ,SEGMENT_SQE=
  503. <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
  504. when #{item.resultId,jdbcType=DECIMAL} then #{item.segmentSqe,jdbcType=DECIMAL}
  505. </foreach>
  506. ,MATERIAL_ID=
  507. <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
  508. when #{item.resultId,jdbcType=DECIMAL} then #{item.materialId,jdbcType=DECIMAL}
  509. </foreach>
  510. where RESULT_ID in
  511. <foreach close=")" collection="list" index="index" item="item" open="(" separator=",">
  512. #{item.resultId,jdbcType=DECIMAL}
  513. </foreach>
  514. </update>
  515. <delete id="batchDelete" parameterType="java.util.List">
  516. delete from TMSTRUCK_UNLOAD_RESULT
  517. where RESULT_ID in
  518. <foreach close=")" collection="list" item="id" open="(" separator=",">
  519. #{id}
  520. </foreach>
  521. </delete>
  522. <!-- 友情提示!!!-->
  523. <!-- 请将自己写的代码放在此标签之下,方便以后粘贴复制。-->
  524. <!-- 排序 -->
  525. <sql id="orderBy">
  526. <if test="orderField != null and orderField != ''">
  527. order by "${orderField}"
  528. <if test="orderType != null and orderType != ''">
  529. ${orderType}
  530. </if>
  531. </if>
  532. <if test="orderField == null ">
  533. order by "resultEndTime" desc
  534. </if>
  535. </sql>
  536. <!-- 获取采购卸货实绩 -->
  537. <select id="getCGUnloadResult" parameterType="java.util.Map" resultType="java.util.LinkedHashMap">
  538. select *
  539. from (
  540. select
  541. TUR.RESULT_ID "resultId",
  542. APO.PURCHASE_ORDER_NO "purchaseOrderNo",
  543. OO.ORDER_NUMBER "orderNumber",
  544. RC.CAPACITY_NUMBER "capacityNumber",
  545. RM.MATERIAL_NAME "materialName",
  546. TWR.RESULT_NET_WEIGHT "resultNetWeight",
  547. RW.WAREHOUSE_NAME "warehouseName",
  548. TUR.RESULT_END_TIME "resultEndTime",
  549. TUR.INSERT_TIME "insertTime"
  550. from TMSTRUCK_UNLOAD_RESULT TUR
  551. left join TMSTRUCK_TOTAL_RESULT TTR
  552. on TUR.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
  553. left join TMSTRUCK_WEIGHT_RESULT TWR
  554. on TWR.RESULT_TOTAL_ID = TUR.RESULT_TOTAL_ID
  555. left join OMSTRUCK_ORDER OO
  556. on OO.ORDER_ID = TTR.ORDER_ID
  557. left join AMS_PURCHASE_ORDER APO
  558. on APO.PURCHASE_ORDER_ID = OO.ORDER_PLAN_ID
  559. left join OMSTRUCK_ORDER_MATERIAL OOM
  560. on OOM.ORDER_ID = OO.ORDER_ID
  561. left join RMS_MATERIAL RM
  562. on OOM.MATERIAL_ID = RM.MATERIAL_ID
  563. left join RMS_CAPACITY RC
  564. on RC.CAPACITY_ID = OO.CAPACITY_ID
  565. left join RMS_WAREHOUSE RW
  566. on RW.WAREHOUSE_ID = TUR.RESULT_UNLOAD_PLACE_ID
  567. where RESULT_END_TIME is not null and OO.ORDER_TYPE = #{orderTypee}
  568. )
  569. <where>
  570. <if test="purchaseOrderNo != null">
  571. <foreach collection="purchaseOrderNo" item="item" open="(" separator="or" close=")">
  572. "purchaseOrderNo" like '%${item}%'
  573. </foreach>
  574. </if>
  575. <if test="materialName != null">
  576. and
  577. <foreach collection="materialName" item="item" open="(" separator="or" close=")">
  578. "materialName" like '%${item}%'
  579. </foreach>
  580. </if>
  581. <if test="orderNumber != null">
  582. and
  583. <foreach collection="orderNumber" item="item" open="(" separator="or" close=")">
  584. "orderNumber" like '%${item}%'
  585. </foreach>
  586. </if>
  587. <if test="capacityNumber != null">
  588. and
  589. <foreach collection="capacityNumber" item="item" open="(" separator="or" close=")">
  590. "capacityNumber" like '%${item}%'
  591. </foreach>
  592. </if>
  593. <if test="warehouseName != null">
  594. and
  595. <foreach collection="warehouseName" item="item" open="(" separator="or" close=")">
  596. "warehouseName" like '%${item}%'
  597. </foreach>
  598. </if>
  599. <if test="resultNetWeight != null">
  600. and
  601. <foreach collection="resultNetWeight" item="item" open="(" separator="or" close=")">
  602. "resultNetWeight" like '%${item}%'
  603. </foreach>
  604. </if>
  605. <if test="orderMaterialWeight != null">
  606. and
  607. <foreach collection="orderMaterialWeight" item="item" open="(" separator="or" close=")">
  608. "orderMaterialWeight" like '%${item}%'
  609. </foreach>
  610. </if>
  611. <if test="resultStartTime != null">
  612. and
  613. <foreach collection="resultStartTime" item="item" open="(" separator="or" close=")">
  614. "resultStartTime" like '%${item}%'
  615. </foreach>
  616. </if>
  617. </where>
  618. <include refid="orderBy"></include>
  619. </select>
  620. <!-- 通过总实绩Id查询卸货实绩Id -->
  621. <select id="getResultIdByTotalId" parameterType="DECIMAL" resultType="DECIMAL">
  622. SELECT RESULT_ID
  623. FROM TMSTRUCK_UNLOAD_RESULT
  624. WHERE RESULT_TOTAL_ID = #{resultTotalId}
  625. </select>
  626. <!-- 通过运输订单号 查询实绩Id、总实绩ID -->
  627. <select id="selectTotalIdByOrderNo" parameterType="java.lang.String" resultType="java.util.Map">
  628. select OO.ORDER_ID "orderId",
  629. OO.ORDER_TYPE "orderTypee",
  630. TUR.RESULT_ID "resultId",
  631. TTR.RESULT_TOTAL_ID "resultTotalId",
  632. RC.CAPACITY_NUMBER "capacityNumber",
  633. TUR.SEGMENT_SQE "segmentSqe"
  634. from OMSTRUCK_ORDER OO
  635. left join TMSTRUCK_TOTAL_RESULT TTR
  636. on OO.ORDER_ID = TTR.ORDER_ID
  637. left join TMSTRUCK_UNLOAD_RESULT TUR
  638. on TTR.RESULT_TOTAL_ID = TUR.RESULT_TOTAL_ID
  639. left join RMS_CAPACITY RC
  640. on RC.CAPACITY_ID = OO.CAPACITY_ID
  641. where OO.ORDER_NUMBER = #{orderNumber}
  642. </select>
  643. <!-- 通过卸货地点查询 仓库ID-->
  644. <select id="getWarehouseIdByWName" parameterType="string" resultType="java.math.BigDecimal">
  645. select WAREHOUSE_ID
  646. from RMS_WAREHOUSE
  647. where WAREHOUSE_NAME = #{warehouseName}
  648. </select>
  649. <!-- 通过总实绩ID查询订单中卸货实绩 -->
  650. <select id="getUnloadPointId" resultType="java.math.BigDecimal" parameterType="java.util.Map">
  651. select OO.UNLOAD_POINT_ID from OMSTRUCK_ORDER OO
  652. left join TMSTRUCK_TOTAL_RESULT TTR
  653. on OO.ORDER_ID = TTR.ORDER_ID
  654. where TTR.RESULT_TOTAL_ID = #{resultTotalId}
  655. </select>
  656. <!-- 查询内转采购进口矿国产矿实绩 -->
  657. <select id="getImportedDomesticNzUnloadResult" parameterType="java.util.Map" resultType="java.util.Map">
  658. select *
  659. from (
  660. select TUR.RESULT_ID "resultId",
  661. APO.PURCHASE_ORDER_NO "purchaseOrderNo",
  662. OO.ORDER_NUMBER "orderNumber",
  663. RC.CAPACITY_NUMBER "capacityNumber",
  664. RM.MATERIAL_NAME "materialName",
  665. DB.RESULT_FOREIGN_SHIP_NAME "resultForeignShipName",
  666. TWR.RESULT_NET_WEIGHT "resultNetWeight",
  667. RW.WAREHOUSE_NAME "warehouseName",
  668. TUR.RESULT_START_TIME "resultStartTime",
  669. TUR.INSERT_TIME "insertTime"
  670. from TMSTRUCK_UNLOAD_RESULT TUR
  671. left join TMSTRUCK_TOTAL_RESULT TTR
  672. on TUR.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
  673. left join TMSTRUCK_WEIGHT_RESULT TWR
  674. on TWR.RESULT_TOTAL_ID = TUR.RESULT_TOTAL_ID
  675. left join OMSTRUCK_ORDER OO
  676. on OO.ORDER_ID = TTR.ORDER_ID
  677. left join AMS_PURCHASE_ORDER APO
  678. on APO.PURCHASE_ORDER_ID = OO.ORDER_PLAN_ID
  679. left join DIL_BATCH DB
  680. on DB.BATCH_ID = APO.BATCH_ID
  681. left join OMSTRUCK_ORDER_MATERIAL OOM
  682. on OOM.ORDER_ID = OO.ORDER_ID
  683. left join RMS_MATERIAL RM
  684. on OOM.MATERIAL_ID = RM.MATERIAL_ID
  685. left join RMS_CAPACITY RC
  686. on RC.CAPACITY_ID = OO.CAPACITY_ID
  687. left join RMS_WAREHOUSE RW
  688. on RW.WAREHOUSE_ID = TUR.RESULT_UNLOAD_PLACE_ID
  689. where RESULT_START_TIME is not null
  690. and OO.ORDER_TYPE = 9
  691. )
  692. <where>
  693. <if test="purchaseOrderNo != null">
  694. <foreach collection="purchaseOrderNo" item="item" open="(" separator="or" close=")">
  695. "purchaseOrderNo" like '%${item}%'
  696. </foreach>
  697. </if>
  698. <if test="materialName != null">
  699. and
  700. <foreach collection="materialName" item="item" open="(" separator="or" close=")">
  701. "materialName" like '%${item}%'
  702. </foreach>
  703. </if>
  704. <if test="orderNumber != null">
  705. and
  706. <foreach collection="orderNumber" item="item" open="(" separator="or" close=")">
  707. "orderNumber" like '%${item}%'
  708. </foreach>
  709. </if>
  710. <if test="capacityNumber != null">
  711. and
  712. <foreach collection="capacityNumber" item="item" open="(" separator="or" close=")">
  713. "capacityNumber" like '%${item}%'
  714. </foreach>
  715. </if>
  716. <if test="orderMaterialNumber != null">
  717. and
  718. <foreach collection="orderMaterialNumber" item="item" open="(" separator="or" close=")">
  719. "orderMaterialNumber" 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="orderMaterialWeight != null">
  729. and
  730. <foreach collection="orderMaterialWeight" item="item" open="(" separator="or" close=")">
  731. "orderMaterialWeight" 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="warehouseName != null">
  741. and
  742. <foreach collection="warehouseName" item="item" open="(" separator="or" close=")">
  743. "warehouseName" like '%${item}%'
  744. </foreach>
  745. </if>
  746. <if test="resultStartTime != null">
  747. and
  748. <foreach collection="resultStartTime" item="item" open="(" separator="or" close=")">
  749. "resultStartTime" like '%${item}%'
  750. </foreach>
  751. </if>
  752. </where>
  753. <include refid="orderBy"></include>
  754. </select>
  755. <!-- 查询内转采购进口矿国产矿实绩(老区-厂内) -->
  756. <select id="getImportedDomesticNzUnload2Result" parameterType="java.util.Map" resultType="java.util.Map">
  757. SELECT *
  758. FROM ( SELECT TUR.RESULT_ID "resultId",
  759. OO.ORDER_NUMBER "orderNumber",
  760. RC.CAPACITY_NUMBER "capacityNumber",
  761. RM.MATERIAL_NAME "materialName",
  762. TWR.RESULT_NET_WEIGHT "resultNetWeight",
  763. RW.WAREHOUSE_NAME "warehouseName",
  764. TUR.RESULT_END_TIME "resultEndTime"
  765. FROM TMSTRUCK_UNLOAD_RESULT TUR
  766. LEFT JOIN TMSTRUCK_TOTAL_RESULT TTR
  767. ON TTR.RESULT_TOTAL_ID = TUR.RESULT_TOTAL_ID
  768. LEFT JOIN OMSTRUCK_ORDER OO
  769. ON OO.ORDER_ID = TTR.ORDER_ID
  770. LEFT JOIN RMS_CAPACITY RC
  771. ON RC.CAPACITY_ID = OO.CAPACITY_ID
  772. LEFT JOIN OMSTRUCK_ORDER_MATERIAL OOM
  773. ON OOM.ORDER_ID = OO.ORDER_ID
  774. LEFT JOIN RMS_MATERIAL RM
  775. ON RM.MATERIAL_ID = OOM.MATERIAL_ID
  776. LEFT JOIN TMSTRUCK_WEIGHT_RESULT TWR
  777. ON TWR.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
  778. LEFT JOIN RMS_WAREHOUSE RW
  779. ON RW.WAREHOUSE_ID = TUR.RESULT_UNLOAD_PLACE_ID
  780. WHERE TUR.RESULT_END_TIME IS NOT NULL
  781. AND OO.ORDER_TYPE = 10
  782. )
  783. <where>
  784. <if test="orderNumber != null">
  785. <foreach collection="orderNumber" item="item" open="(" separator="or" close=")">
  786. "orderNumber" like '%${item}%'
  787. </foreach>
  788. </if>
  789. <if test="capacityNumber != null">
  790. and
  791. <foreach collection="capacityNumber" item="item" open="(" separator="or" close=")">
  792. "capacityNumber" like '%${item}%'
  793. </foreach>
  794. </if>
  795. <if test="materialName != null">
  796. and
  797. <foreach collection="materialName" item="item" open="(" separator="or" close=")">
  798. "materialName" like '%${item}%'
  799. </foreach>
  800. </if>
  801. <if test="resultNetWeight != null">
  802. and
  803. <foreach collection="resultNetWeight" item="item" open="(" separator="or" close=")">
  804. "resultNetWeight" like '%${item}%'
  805. </foreach>
  806. </if>
  807. <if test="warehouseName != null">
  808. and
  809. <foreach collection="warehouseName" item="item" open="(" separator="or" close=")">
  810. "warehouseName" like '%${item}%'
  811. </foreach>
  812. </if>
  813. <if test="resultEndTime != null">
  814. and
  815. <foreach collection="resultEndTime" item="item" open="(" separator="or" close=")">
  816. "resultEndTime" like '%${item}%'
  817. </foreach>
  818. </if>
  819. </where>
  820. <include refid="orderBy"></include>
  821. </select>
  822. <!-- 查询内转厂内卸货实绩 -->
  823. <select id="getInFactoryUnloadResult" parameterType="java.util.Map" resultType="java.util.Map">
  824. SELECT *
  825. FROM (
  826. SELECT TUR.RESULT_ID "resultId",
  827. OO.ORDER_NUMBER "orderNumber",
  828. RC.CAPACITY_NUMBER "capacityNumber",
  829. RM.MATERIAL_NAME "materialName",
  830. OOM.ORDER_MATERIAL_NUMBER "orderMaterialNumber",
  831. TUR.RESULT_START_TIME "resultStartTime",
  832. TUR.RESULT_END_TIME "resultEndTime",
  833. TUR.RESULT_DURATION "resultDuration",
  834. RW.WAREHOUSE_NAME "warehouseName"
  835. FROM TMSTRUCK_UNLOAD_RESULT TUR
  836. LEFT JOIN TMSTRUCK_TOTAL_RESULT TTR
  837. ON TTR.RESULT_TOTAL_ID = TUR.RESULT_TOTAL_ID
  838. LEFT JOIN OMSTRUCK_ORDER OO
  839. ON OO.ORDER_ID = TTR.ORDER_ID
  840. LEFT JOIN RMS_CAPACITY RC
  841. ON RC.CAPACITY_ID = OO.CAPACITY_ID
  842. LEFT JOIN OMSTRUCK_ORDER_MATERIAL OOM
  843. ON OOM.ORDER_ID = OO.ORDER_ID
  844. LEFT JOIN RMS_MATERIAL RM
  845. ON RM.MATERIAL_ID = OOM.MATERIAL_ID
  846. LEFT JOIN RMS_WAREHOUSE RW
  847. ON RW.WAREHOUSE_ID = TUR.RESULT_UNLOAD_PLACE_ID
  848. WHERE TUR.RESULT_START_TIME IS NOT NULL
  849. AND OO.ORDER_TYPE = 11
  850. )
  851. <where>
  852. <if test="orderNumber != null">
  853. <foreach collection="orderNumber" item="item" open="(" separator="or" close=")">
  854. "orderNumber" like '%${item}%'
  855. </foreach>
  856. </if>
  857. <if test="capacityNumber != null">
  858. and
  859. <foreach collection="capacityNumber" item="item" open="(" separator="or" close=")">
  860. "capacityNumber" like '%${item}%'
  861. </foreach>
  862. </if>
  863. <if test="materialName != null">
  864. and
  865. <foreach collection="materialName" item="item" open="(" separator="or" close=")">
  866. "materialName" like '%${item}%'
  867. </foreach>
  868. </if>
  869. <if test="orderMaterialNumber != null">
  870. and
  871. <foreach collection="orderMaterialNumber" item="item" open="(" separator="or" close=")">
  872. "orderMaterialNumber" like '%${item}%'
  873. </foreach>
  874. </if>
  875. <if test="warehouseName != null">
  876. and
  877. <foreach collection="warehouseName" item="item" open="(" separator="or" close=")">
  878. "warehouseName" like '%${item}%'
  879. </foreach>
  880. </if>
  881. <if test="resultStartTime != null">
  882. and
  883. <foreach collection="resultStartTime" item="item" open="(" separator="or" close=")">
  884. "resultStartTime" like '%${item}%'
  885. </foreach>
  886. </if>
  887. <if test="resultEndTime != null">
  888. and
  889. <foreach collection="resultEndTime" item="item" open="(" separator="or" close=")">
  890. "resultEndTime" like '%${item}%'
  891. </foreach>
  892. </if>
  893. <if test="resultDuration != null">
  894. and
  895. <foreach collection="resultDuration" item="item" open="(" separator="or" close=")">
  896. "resultDuration" like '%${item}%'
  897. </foreach>
  898. </if>
  899. </where>
  900. <include refid="orderBy"></include>
  901. </select>
  902. <!-- 根据总实绩ID查询卸货地点-->
  903. <select id="getSporadicSuppliesUnloadResult" resultType="java.util.Map">
  904. SELECT *
  905. FROM (
  906. SELECT
  907. TUR.RESULT_ID "resultId",
  908. OO.ORDER_NUMBER "orderNumber",
  909. RC.CAPACITY_NUMBER "capacityNumber",
  910. TUR.RESULT_START_TIME "resultStartTime",
  911. TUR.RESULT_END_TIME "resultEndTime",
  912. TUR.RESULT_DURATION "resultDuration",
  913. RW.WAREHOUSE_NAME "warehouseName",
  914. RM.MATERIAL_NAME "materialName",
  915. OOM.ORDER_MATERIAL_WEIGHT "materialWeight",
  916. OOM.ORDER_MATERIAL_NUMBER "materialNumber",
  917. TWR.RESULT_NET_WEIGHT "orderMaterialNetWeight"
  918. FROM TMSTRUCK_UNLOAD_RESULT TUR
  919. LEFT JOIN TMSTRUCK_TOTAL_RESULT TTR
  920. ON TTR.RESULT_TOTAL_ID = TUR.RESULT_TOTAL_ID
  921. LEFT JOIN TMSTRUCK_WEIGHT_RESULT TWR
  922. ON TWR.RESULT_TOTAL_ID=TTR.RESULT_TOTAL_ID
  923. LEFT JOIN OMSTRUCK_ORDER OO
  924. ON OO.ORDER_ID = TTR.ORDER_ID
  925. LEFT JOIN OMSTRUCK_ORDER_MATERIAL OOM
  926. ON OOM.ORDER_ID=OO.ORDER_ID
  927. LEFT JOIN RMS_MATERIAL RM
  928. ON RM.MATERIAL_ID=OOM.MATERIAL_ID
  929. LEFT JOIN AMSTRUCK_SPORADIC_ORDER ASO
  930. ON OO.ORDER_PLAN_ID = ASO.SPORADIC_ORDER_ID
  931. LEFT JOIN RMS_CAPACITY RC
  932. ON RC.CAPACITY_ID = OO.CAPACITY_ID
  933. LEFT JOIN RMS_WAREHOUSE RW
  934. ON RW.WAREHOUSE_ID = TUR.RESULT_UNLOAD_PLACE_ID
  935. WHERE TUR.RESULT_END_TIME IS NOT NULL
  936. AND OO.ORDER_TYPE = #{orderTypee}
  937. )
  938. <where>
  939. <if test="orderNumber != null">
  940. <foreach collection="orderNumber" item="item" open="(" separator="or" close=")">
  941. "orderNumber" like '%${item}%'
  942. </foreach>
  943. </if>
  944. <if test="capacityNumber != null">
  945. and
  946. <foreach collection="capacityNumber" item="item" open="(" separator="or" close=")">
  947. "capacityNumber" like '%${item}%'
  948. </foreach>
  949. </if>
  950. <if test="warehouseName != null">
  951. and
  952. <foreach collection="warehouseName" item="item" open="(" separator="or" close=")">
  953. "warehouseName" like '%${item}%'
  954. </foreach>
  955. </if>
  956. <if test="resultStartTime != null">
  957. and
  958. <foreach collection="resultStartTime" item="item" open="(" separator="or" close=")">
  959. "resultStartTime" like '%${item}%'
  960. </foreach>
  961. </if>
  962. <if test="resultEndTime != null">
  963. and
  964. <foreach collection="resultEndTime" item="item" open="(" separator="or" close=")">
  965. "resultEndTime" like '%${item}%'
  966. </foreach>
  967. </if>
  968. <if test="resultDuration != null">
  969. and
  970. <foreach collection="resultDuration" item="item" open="(" separator="or" close=")">
  971. "resultDuration" like '%${item}%'
  972. </foreach>
  973. </if>
  974. </where>
  975. <include refid="orderBy"></include>
  976. </select>
  977. <!-- 根据优先级查询物资 -->
  978. <select id="selectMaterialForUnload" resultType="java.util.Map">
  979. select OOM.MATERIAL_ID "materialId",
  980. OO.ORDER_ID "orderId"
  981. from OMSTRUCK_ORDER_MATERIAL OOM
  982. JOIN OMSTRUCK_ORDER OO
  983. ON OO.ORDER_ID=OOM.ORDER_ID
  984. where OO.ORDER_NUMBER=#{orderNumber}
  985. ORDER BY OOM.MATERIAL_PRIORITY
  986. </select>
  987. <!-- 根据物资是否计量 -->
  988. <select id="selectUnloadMaterialId" resultType="java.lang.Integer" parameterType="java.util.Map">
  989. SELECT
  990. COUNT( * )
  991. FROM
  992. OMSTRUCK_ORDER_MATERIAL OOM
  993. JOIN OMSTRUCK_ORDER OO ON OO.ORDER_ID = OOM.ORDER_ID
  994. LEFT JOIN TMSTRUCK_TOTAL_RESULT TTR ON TTR.ORDER_ID = OO.ORDER_ID
  995. LEFT JOIN TMSTRUCK_WEIGHT_RESULT TWR ON TWR.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
  996. WHERE OOM.MATERIAL_ID=#{materialId} AND OO.ORDER_ID=#{orderId}
  997. </select>
  998. </mapper>