TmstruckUnloadResultMapper.xml 47 KB

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