TmstruckLoadResultMapper.xml 67 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439
  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.TmstruckLoadResultMapper">
  4. <resultMap id="BaseResultMap" type="com.steerinfo.dil.model.TmstruckLoadResult">
  5. <id column="RESULT_ID" jdbcType="DECIMAL" property="resultId" />
  6. <result column="RESULT_TOTAL_ID" jdbcType="DECIMAL" property="resultTotalId" />
  7. <result column="RESULT_LOAD_START_TIME" jdbcType="TIMESTAMP" property="resultLoadStartTime" />
  8. <result column="RESULT_LOAD_END_TIME" jdbcType="TIMESTAMP" property="resultLoadEndTime" />
  9. <result column="RESULT_LOAD_DURATION" jdbcType="DECIMAL" property="resultLoadDuration" />
  10. <result column="LOAD_STANDARD_TIME_ID" jdbcType="DECIMAL" property="loadStandardTimeId" />
  11. <result column="LOADER_ID" jdbcType="DECIMAL" property="loaderId" />
  12. <result column="RESULT_ISCLEAR" jdbcType="VARCHAR" property="resultIsclear" />
  13. <result column="DELETE_NAME" jdbcType="VARCHAR" property="deleteName" />
  14. <result column="DELETE_TIME" jdbcType="TIMESTAMP" property="deleteTime" />
  15. <result column="INSERT_USERNAME" jdbcType="VARCHAR" property="insertUsername" />
  16. <result column="INSERT_TIME" jdbcType="TIMESTAMP" property="insertTime" />
  17. <result column="UPDATE_USERNAME" jdbcType="VARCHAR" property="updateUsername" />
  18. <result column="UPDATE_TIME" jdbcType="TIMESTAMP" property="updateTime" />
  19. <result column="INSERT_UPDATE_REMARK" jdbcType="VARCHAR" property="insertUpdateRemark" />
  20. <result column="STATUS" jdbcType="DECIMAL" property="status" />
  21. <result column="RESULT_MEASURED_TONNAGE" jdbcType="DECIMAL" property="resultMeasuredTonnage" />
  22. <result column="LOADING_ID" jdbcType="DECIMAL" property="loadingId" />
  23. <result column="MATERIAL_ID" jdbcType="DECIMAL" property="materialId" />
  24. <result column="LOADING_SEQUENCE" jdbcType="DECIMAL" property="loadingSequence" />
  25. </resultMap>
  26. <sql id="columns">
  27. RESULT_ID, RESULT_TOTAL_ID, RESULT_LOAD_START_TIME, RESULT_LOAD_END_TIME, RESULT_LOAD_DURATION,
  28. LOAD_STANDARD_TIME_ID, LOADER_ID, RESULT_ISCLEAR, DELETE_NAME, DELETE_TIME, INSERT_USERNAME,
  29. INSERT_TIME, UPDATE_USERNAME, UPDATE_TIME, INSERT_UPDATE_REMARK, STATUS, RESULT_MEASURED_TONNAGE,
  30. LOADING_ID, MATERIAL_ID, LOADING_SEQUENCE
  31. </sql>
  32. <sql id="columns_alias">
  33. t.RESULT_ID, t.RESULT_TOTAL_ID, t.RESULT_LOAD_START_TIME, t.RESULT_LOAD_END_TIME,
  34. t.RESULT_LOAD_DURATION, t.LOAD_STANDARD_TIME_ID, t.LOADER_ID, t.RESULT_ISCLEAR, t.DELETE_NAME,
  35. t.DELETE_TIME, t.INSERT_USERNAME, t.INSERT_TIME, t.UPDATE_USERNAME, t.UPDATE_TIME,
  36. t.INSERT_UPDATE_REMARK, t.STATUS, t.RESULT_MEASURED_TONNAGE, t.LOADING_ID, t.MATERIAL_ID,
  37. t.LOADING_SEQUENCE
  38. </sql>
  39. <sql id="select">
  40. SELECT <include refid="columns" /> FROM TMSTRUCK_LOAD_RESULT
  41. </sql>
  42. <sql id="select_alias">
  43. SELECT <include refid="columns_alias" /> FROM TMSTRUCK_LOAD_RESULT t
  44. </sql>
  45. <sql id="where">
  46. <where>
  47. <if test="resultId != null">
  48. and RESULT_ID = #{resultId}
  49. </if>
  50. <if test="resultTotalId != null">
  51. and RESULT_TOTAL_ID = #{resultTotalId}
  52. </if>
  53. <if test="resultLoadStartTime != null">
  54. and TO_CHAR(RESULT_LOAD_START_TIME,'yyyy-MM-dd') = #{resultLoadStartTime}
  55. </if>
  56. <if test="resultLoadEndTime != null">
  57. and TO_CHAR(RESULT_LOAD_END_TIME,'yyyy-MM-dd') = #{resultLoadEndTime}
  58. </if>
  59. <if test="resultLoadDuration != null">
  60. and RESULT_LOAD_DURATION = #{resultLoadDuration}
  61. </if>
  62. <if test="loadStandardTimeId != null">
  63. and LOAD_STANDARD_TIME_ID = #{loadStandardTimeId}
  64. </if>
  65. <if test="loaderId != null">
  66. and LOADER_ID = #{loaderId}
  67. </if>
  68. <if test="resultIsclear != null and resultIsclear != ''">
  69. and RESULT_ISCLEAR = #{resultIsclear}
  70. </if>
  71. <if test="deleteName != null and deleteName != ''">
  72. and DELETE_NAME = #{deleteName}
  73. </if>
  74. <if test="deleteTime != null">
  75. and TO_CHAR(DELETE_TIME,'yyyy-MM-dd') = #{deleteTime}
  76. </if>
  77. <if test="insertUsername != null and insertUsername != ''">
  78. and INSERT_USERNAME = #{insertUsername}
  79. </if>
  80. <if test="insertTime != null">
  81. and TO_CHAR(INSERT_TIME,'yyyy-MM-dd') = #{insertTime}
  82. </if>
  83. <if test="updateUsername != null and updateUsername != ''">
  84. and UPDATE_USERNAME = #{updateUsername}
  85. </if>
  86. <if test="updateTime != null">
  87. and TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = #{updateTime}
  88. </if>
  89. <if test="insertUpdateRemark != null and insertUpdateRemark != ''">
  90. and INSERT_UPDATE_REMARK = #{insertUpdateRemark}
  91. </if>
  92. <if test="status != null">
  93. and STATUS = #{status}
  94. </if>
  95. <if test="resultMeasuredTonnage != null">
  96. and RESULT_MEASURED_TONNAGE = #{resultMeasuredTonnage}
  97. </if>
  98. <if test="loadingId != null">
  99. and LOADING_ID = #{loadingId}
  100. </if>
  101. <if test="materialId != null">
  102. and MATERIAL_ID = #{materialId}
  103. </if>
  104. <if test="loadingSequence != null">
  105. and LOADING_SEQUENCE = #{loadingSequence}
  106. </if>
  107. </where>
  108. </sql>
  109. <sql id="whereLike">
  110. <where>
  111. <if test="resultId != null">
  112. and RESULT_ID = #{resultId}
  113. </if>
  114. <if test="resultTotalId != null">
  115. and RESULT_TOTAL_ID = #{resultTotalId}
  116. </if>
  117. <if test="resultLoadStartTime != null">
  118. and TO_CHAR(RESULT_LOAD_START_TIME,'yyyy-MM-dd') = #{resultLoadStartTime}
  119. </if>
  120. <if test="resultLoadEndTime != null">
  121. and TO_CHAR(RESULT_LOAD_END_TIME,'yyyy-MM-dd') = #{resultLoadEndTime}
  122. </if>
  123. <if test="resultLoadDuration != null">
  124. and RESULT_LOAD_DURATION = #{resultLoadDuration}
  125. </if>
  126. <if test="loadStandardTimeId != null">
  127. and LOAD_STANDARD_TIME_ID = #{loadStandardTimeId}
  128. </if>
  129. <if test="loaderId != null">
  130. and LOADER_ID = #{loaderId}
  131. </if>
  132. <if test="resultIsclear != null and resultIsclear != ''">
  133. and RESULT_ISCLEAR LIKE '%${resultIsclear}%'
  134. </if>
  135. <if test="deleteName != null and deleteName != ''">
  136. and DELETE_NAME LIKE '%${deleteName}%'
  137. </if>
  138. <if test="deleteTime != null">
  139. and TO_CHAR(DELETE_TIME,'yyyy-MM-dd') = #{deleteTime}
  140. </if>
  141. <if test="insertUsername != null and insertUsername != ''">
  142. and INSERT_USERNAME LIKE '%${insertUsername}%'
  143. </if>
  144. <if test="insertTime != null">
  145. and TO_CHAR(INSERT_TIME,'yyyy-MM-dd') = #{insertTime}
  146. </if>
  147. <if test="updateUsername != null and updateUsername != ''">
  148. and UPDATE_USERNAME LIKE '%${updateUsername}%'
  149. </if>
  150. <if test="updateTime != null">
  151. and TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = #{updateTime}
  152. </if>
  153. <if test="insertUpdateRemark != null and insertUpdateRemark != ''">
  154. and INSERT_UPDATE_REMARK LIKE '%${insertUpdateRemark}%'
  155. </if>
  156. <if test="status != null">
  157. and STATUS = #{status}
  158. </if>
  159. <if test="resultMeasuredTonnage != null">
  160. and RESULT_MEASURED_TONNAGE = #{resultMeasuredTonnage}
  161. </if>
  162. <if test="loadingId != null">
  163. and LOADING_ID = #{loadingId}
  164. </if>
  165. <if test="materialId != null">
  166. and MATERIAL_ID = #{materialId}
  167. </if>
  168. <if test="loadingSequence != null">
  169. and LOADING_SEQUENCE = #{loadingSequence}
  170. </if>
  171. </where>
  172. </sql>
  173. <delete id="deleteByPrimaryKey" parameterType="java.math.BigDecimal">
  174. delete from TMSTRUCK_LOAD_RESULT
  175. where RESULT_ID = #{resultId,jdbcType=DECIMAL}
  176. </delete>
  177. <delete id="deleteBySelectiveElement" parameterType="java.util.HashMap">
  178. delete from TMSTRUCK_LOAD_RESULT
  179. where 1!=1
  180. <if test="resultTotalId != null">
  181. or RESULT_TOTAL_ID = #{resultTotalId}
  182. </if>
  183. <if test="resultLoadStartTime != null">
  184. or TO_CHAR(RESULT_LOAD_START_TIME,'yyyy-MM-dd') = '#{resultLoadStartTime}'
  185. </if>
  186. <if test="resultLoadEndTime != null">
  187. or TO_CHAR(RESULT_LOAD_END_TIME,'yyyy-MM-dd') = '#{resultLoadEndTime}'
  188. </if>
  189. <if test="resultLoadDuration != null">
  190. or RESULT_LOAD_DURATION = #{resultLoadDuration}
  191. </if>
  192. <if test="loadStandardTimeId != null">
  193. or LOAD_STANDARD_TIME_ID = #{loadStandardTimeId}
  194. </if>
  195. <if test="loaderId != null">
  196. or LOADER_ID = #{loaderId}
  197. </if>
  198. <if test="resultIsclear != null and resultIsclear != ''">
  199. or RESULT_ISCLEAR = #{resultIsclear}
  200. </if>
  201. <if test="deleteName != null and deleteName != ''">
  202. or DELETE_NAME = #{deleteName}
  203. </if>
  204. <if test="deleteTime != null">
  205. or TO_CHAR(DELETE_TIME,'yyyy-MM-dd') = '#{deleteTime}'
  206. </if>
  207. <if test="insertUsername != null and insertUsername != ''">
  208. or INSERT_USERNAME = #{insertUsername}
  209. </if>
  210. <if test="insertTime != null">
  211. or TO_CHAR(INSERT_TIME,'yyyy-MM-dd') = '#{insertTime}'
  212. </if>
  213. <if test="updateUsername != null and updateUsername != ''">
  214. or UPDATE_USERNAME = #{updateUsername}
  215. </if>
  216. <if test="updateTime != null">
  217. or TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = '#{updateTime}'
  218. </if>
  219. <if test="insertUpdateRemark != null and insertUpdateRemark != ''">
  220. or INSERT_UPDATE_REMARK = #{insertUpdateRemark}
  221. </if>
  222. <if test="status != null">
  223. or STATUS = #{status}
  224. </if>
  225. <if test="resultMeasuredTonnage != null">
  226. or RESULT_MEASURED_TONNAGE = #{resultMeasuredTonnage}
  227. </if>
  228. <if test="loadingId != null">
  229. or LOADING_ID = #{loadingId}
  230. </if>
  231. <if test="materialId != null">
  232. or MATERIAL_ID = #{materialId}
  233. </if>
  234. <if test="loadingSequence != null">
  235. or LOADING_SEQUENCE = #{loadingSequence}
  236. </if>
  237. </delete>
  238. <insert id="insert" parameterType="com.steerinfo.dil.model.TmstruckLoadResult">
  239. insert into TMSTRUCK_LOAD_RESULT (RESULT_ID, RESULT_TOTAL_ID, RESULT_LOAD_START_TIME,
  240. RESULT_LOAD_END_TIME, RESULT_LOAD_DURATION,
  241. LOAD_STANDARD_TIME_ID, LOADER_ID, RESULT_ISCLEAR,
  242. DELETE_NAME, DELETE_TIME, INSERT_USERNAME,
  243. INSERT_TIME, UPDATE_USERNAME, UPDATE_TIME,
  244. INSERT_UPDATE_REMARK, STATUS, RESULT_MEASURED_TONNAGE,
  245. LOADING_ID, MATERIAL_ID, LOADING_SEQUENCE
  246. )
  247. values (#{resultId,jdbcType=DECIMAL}, #{resultTotalId,jdbcType=DECIMAL}, #{resultLoadStartTime,jdbcType=TIMESTAMP},
  248. #{resultLoadEndTime,jdbcType=TIMESTAMP}, #{resultLoadDuration,jdbcType=DECIMAL},
  249. #{loadStandardTimeId,jdbcType=DECIMAL}, #{loaderId,jdbcType=DECIMAL}, #{resultIsclear,jdbcType=VARCHAR},
  250. #{deleteName,jdbcType=VARCHAR}, #{deleteTime,jdbcType=TIMESTAMP}, #{insertUsername,jdbcType=VARCHAR},
  251. #{insertTime,jdbcType=TIMESTAMP}, #{updateUsername,jdbcType=VARCHAR}, #{updateTime,jdbcType=TIMESTAMP},
  252. #{insertUpdateRemark,jdbcType=VARCHAR}, #{status,jdbcType=DECIMAL}, #{resultMeasuredTonnage,jdbcType=DECIMAL},
  253. #{loadingId,jdbcType=DECIMAL}, #{materialId,jdbcType=DECIMAL}, #{loadingSequence,jdbcType=DECIMAL}
  254. )
  255. </insert>
  256. <insert id="insertSelective" parameterType="com.steerinfo.dil.model.TmstruckLoadResult">
  257. insert into TMSTRUCK_LOAD_RESULT
  258. <trim prefix="(" suffix=")" suffixOverrides=",">
  259. <if test="resultId != null">
  260. RESULT_ID,
  261. </if>
  262. <if test="resultTotalId != null">
  263. RESULT_TOTAL_ID,
  264. </if>
  265. <if test="resultLoadStartTime != null">
  266. RESULT_LOAD_START_TIME,
  267. </if>
  268. <if test="resultLoadEndTime != null">
  269. RESULT_LOAD_END_TIME,
  270. </if>
  271. <if test="resultLoadDuration != null">
  272. RESULT_LOAD_DURATION,
  273. </if>
  274. <if test="loadStandardTimeId != null">
  275. LOAD_STANDARD_TIME_ID,
  276. </if>
  277. <if test="loaderId != null">
  278. LOADER_ID,
  279. </if>
  280. <if test="resultIsclear != null">
  281. RESULT_ISCLEAR,
  282. </if>
  283. <if test="deleteName != null">
  284. DELETE_NAME,
  285. </if>
  286. <if test="deleteTime != null">
  287. DELETE_TIME,
  288. </if>
  289. <if test="insertUsername != null">
  290. INSERT_USERNAME,
  291. </if>
  292. <if test="insertTime != null">
  293. INSERT_TIME,
  294. </if>
  295. <if test="updateUsername != null">
  296. UPDATE_USERNAME,
  297. </if>
  298. <if test="updateTime != null">
  299. UPDATE_TIME,
  300. </if>
  301. <if test="insertUpdateRemark != null">
  302. INSERT_UPDATE_REMARK,
  303. </if>
  304. <if test="status != null">
  305. STATUS,
  306. </if>
  307. <if test="resultMeasuredTonnage != null">
  308. RESULT_MEASURED_TONNAGE,
  309. </if>
  310. <if test="loadingId != null">
  311. LOADING_ID,
  312. </if>
  313. <if test="materialId != null">
  314. MATERIAL_ID,
  315. </if>
  316. <if test="loadingSequence != null">
  317. LOADING_SEQUENCE,
  318. </if>
  319. </trim>
  320. <trim prefix="values (" suffix=")" suffixOverrides=",">
  321. <if test="resultId != null">
  322. #{resultId,jdbcType=DECIMAL},
  323. </if>
  324. <if test="resultTotalId != null">
  325. #{resultTotalId,jdbcType=DECIMAL},
  326. </if>
  327. <if test="resultLoadStartTime != null">
  328. #{resultLoadStartTime,jdbcType=TIMESTAMP},
  329. </if>
  330. <if test="resultLoadEndTime != null">
  331. #{resultLoadEndTime,jdbcType=TIMESTAMP},
  332. </if>
  333. <if test="resultLoadDuration != null">
  334. #{resultLoadDuration,jdbcType=DECIMAL},
  335. </if>
  336. <if test="loadStandardTimeId != null">
  337. #{loadStandardTimeId,jdbcType=DECIMAL},
  338. </if>
  339. <if test="loaderId != null">
  340. #{loaderId,jdbcType=DECIMAL},
  341. </if>
  342. <if test="resultIsclear != null">
  343. #{resultIsclear,jdbcType=VARCHAR},
  344. </if>
  345. <if test="deleteName != null">
  346. #{deleteName,jdbcType=VARCHAR},
  347. </if>
  348. <if test="deleteTime != null">
  349. #{deleteTime,jdbcType=TIMESTAMP},
  350. </if>
  351. <if test="insertUsername != null">
  352. #{insertUsername,jdbcType=VARCHAR},
  353. </if>
  354. <if test="insertTime != null">
  355. #{insertTime,jdbcType=TIMESTAMP},
  356. </if>
  357. <if test="updateUsername != null">
  358. #{updateUsername,jdbcType=VARCHAR},
  359. </if>
  360. <if test="updateTime != null">
  361. #{updateTime,jdbcType=TIMESTAMP},
  362. </if>
  363. <if test="insertUpdateRemark != null">
  364. #{insertUpdateRemark,jdbcType=VARCHAR},
  365. </if>
  366. <if test="status != null">
  367. #{status,jdbcType=DECIMAL},
  368. </if>
  369. <if test="resultMeasuredTonnage != null">
  370. #{resultMeasuredTonnage,jdbcType=DECIMAL},
  371. </if>
  372. <if test="loadingId != null">
  373. #{loadingId,jdbcType=DECIMAL},
  374. </if>
  375. <if test="materialId != null">
  376. #{materialId,jdbcType=DECIMAL},
  377. </if>
  378. <if test="loadingSequence != null">
  379. #{loadingSequence,jdbcType=DECIMAL},
  380. </if>
  381. </trim>
  382. </insert>
  383. <update id="updateByPrimaryKey" parameterType="com.steerinfo.dil.model.TmstruckLoadResult">
  384. update TMSTRUCK_LOAD_RESULT
  385. set RESULT_TOTAL_ID = #{resultTotalId,jdbcType=DECIMAL},
  386. RESULT_LOAD_START_TIME = #{resultLoadStartTime,jdbcType=TIMESTAMP},
  387. RESULT_LOAD_END_TIME = #{resultLoadEndTime,jdbcType=TIMESTAMP},
  388. RESULT_LOAD_DURATION = #{resultLoadDuration,jdbcType=DECIMAL},
  389. LOAD_STANDARD_TIME_ID = #{loadStandardTimeId,jdbcType=DECIMAL},
  390. LOADER_ID = #{loaderId,jdbcType=DECIMAL},
  391. RESULT_ISCLEAR = #{resultIsclear,jdbcType=VARCHAR},
  392. DELETE_NAME = #{deleteName,jdbcType=VARCHAR},
  393. DELETE_TIME = #{deleteTime,jdbcType=TIMESTAMP},
  394. INSERT_USERNAME = #{insertUsername,jdbcType=VARCHAR},
  395. INSERT_TIME = #{insertTime,jdbcType=TIMESTAMP},
  396. UPDATE_USERNAME = #{updateUsername,jdbcType=VARCHAR},
  397. UPDATE_TIME = #{updateTime,jdbcType=TIMESTAMP},
  398. INSERT_UPDATE_REMARK = #{insertUpdateRemark,jdbcType=VARCHAR},
  399. STATUS = #{status,jdbcType=DECIMAL},
  400. RESULT_MEASURED_TONNAGE = #{resultMeasuredTonnage,jdbcType=DECIMAL},
  401. LOADING_ID = #{loadingId,jdbcType=DECIMAL},
  402. MATERIAL_ID = #{materialId,jdbcType=DECIMAL},
  403. LOADING_SEQUENCE = #{loadingSequence,jdbcType=DECIMAL}
  404. where RESULT_ID = #{resultId,jdbcType=DECIMAL}
  405. </update>
  406. <update id="updateByPrimaryKeySelective" parameterType="com.steerinfo.dil.model.TmstruckLoadResult">
  407. update TMSTRUCK_LOAD_RESULT
  408. <set>
  409. <if test="resultTotalId != null">
  410. RESULT_TOTAL_ID = #{resultTotalId,jdbcType=DECIMAL},
  411. </if>
  412. <if test="resultLoadStartTime != null">
  413. RESULT_LOAD_START_TIME = #{resultLoadStartTime,jdbcType=TIMESTAMP},
  414. </if>
  415. <if test="resultLoadEndTime != null">
  416. RESULT_LOAD_END_TIME = #{resultLoadEndTime,jdbcType=TIMESTAMP},
  417. </if>
  418. <if test="resultLoadDuration != null">
  419. RESULT_LOAD_DURATION = #{resultLoadDuration,jdbcType=DECIMAL},
  420. </if>
  421. <if test="loadStandardTimeId != null">
  422. LOAD_STANDARD_TIME_ID = #{loadStandardTimeId,jdbcType=DECIMAL},
  423. </if>
  424. <if test="loaderId != null">
  425. LOADER_ID = #{loaderId,jdbcType=DECIMAL},
  426. </if>
  427. <if test="resultIsclear != null">
  428. RESULT_ISCLEAR = #{resultIsclear,jdbcType=VARCHAR},
  429. </if>
  430. <if test="deleteName != null">
  431. DELETE_NAME = #{deleteName,jdbcType=VARCHAR},
  432. </if>
  433. <if test="deleteTime != null">
  434. DELETE_TIME = #{deleteTime,jdbcType=TIMESTAMP},
  435. </if>
  436. <if test="insertUsername != null">
  437. INSERT_USERNAME = #{insertUsername,jdbcType=VARCHAR},
  438. </if>
  439. <if test="insertTime != null">
  440. INSERT_TIME = #{insertTime,jdbcType=TIMESTAMP},
  441. </if>
  442. <if test="updateUsername != null">
  443. UPDATE_USERNAME = #{updateUsername,jdbcType=VARCHAR},
  444. </if>
  445. <if test="updateTime != null">
  446. UPDATE_TIME = #{updateTime,jdbcType=TIMESTAMP},
  447. </if>
  448. <if test="insertUpdateRemark != null">
  449. INSERT_UPDATE_REMARK = #{insertUpdateRemark,jdbcType=VARCHAR},
  450. </if>
  451. <if test="status != null">
  452. STATUS = #{status,jdbcType=DECIMAL},
  453. </if>
  454. <if test="resultMeasuredTonnage != null">
  455. RESULT_MEASURED_TONNAGE = #{resultMeasuredTonnage,jdbcType=DECIMAL},
  456. </if>
  457. <if test="loadingId != null">
  458. LOADING_ID = #{loadingId,jdbcType=DECIMAL},
  459. </if>
  460. <if test="materialId != null">
  461. MATERIAL_ID = #{materialId,jdbcType=DECIMAL},
  462. </if>
  463. <if test="loadingSequence != null">
  464. LOADING_SEQUENCE = #{loadingSequence,jdbcType=DECIMAL},
  465. </if>
  466. </set>
  467. where RESULT_ID = #{resultId,jdbcType=DECIMAL}
  468. </update>
  469. <select id="selectByPrimaryKey" parameterType="java.math.BigDecimal" resultMap="BaseResultMap">
  470. <include refid="select" />
  471. where RESULT_ID = #{resultId,jdbcType=DECIMAL}
  472. </select>
  473. <select id="selectByParameters" parameterType="java.util.HashMap" resultMap="BaseResultMap">
  474. <include refid="select" />
  475. <include refid="where" />
  476. </select>
  477. <select id="selectLikeByParameters" parameterType="java.util.HashMap" resultMap="BaseResultMap">
  478. <include refid="select" />
  479. <include refid="whereLike" />
  480. </select>
  481. <insert id="batchInsert" parameterType="java.util.List">
  482. insert into TMSTRUCK_LOAD_RESULT
  483. (RESULT_ID,
  484. RESULT_TOTAL_ID, RESULT_LOAD_START_TIME,
  485. RESULT_LOAD_END_TIME, RESULT_LOAD_DURATION,
  486. LOAD_STANDARD_TIME_ID, LOADER_ID,
  487. RESULT_ISCLEAR, DELETE_NAME, DELETE_TIME,
  488. INSERT_USERNAME, INSERT_TIME,
  489. UPDATE_USERNAME, UPDATE_TIME,
  490. INSERT_UPDATE_REMARK, STATUS, RESULT_MEASURED_TONNAGE,
  491. LOADING_ID, MATERIAL_ID, LOADING_SEQUENCE
  492. )
  493. ( <foreach collection="list" item="item" separator="union all">
  494. select
  495. #{item.resultId,jdbcType=DECIMAL},
  496. #{item.resultTotalId,jdbcType=DECIMAL}, #{item.resultLoadStartTime,jdbcType=TIMESTAMP},
  497. #{item.resultLoadEndTime,jdbcType=TIMESTAMP}, #{item.resultLoadDuration,jdbcType=DECIMAL},
  498. #{item.loadStandardTimeId,jdbcType=DECIMAL}, #{item.loaderId,jdbcType=DECIMAL},
  499. #{item.resultIsclear,jdbcType=VARCHAR}, #{item.deleteName,jdbcType=VARCHAR}, #{item.deleteTime,jdbcType=TIMESTAMP},
  500. #{item.insertUsername,jdbcType=VARCHAR}, #{item.insertTime,jdbcType=TIMESTAMP},
  501. #{item.updateUsername,jdbcType=VARCHAR}, #{item.updateTime,jdbcType=TIMESTAMP},
  502. #{item.insertUpdateRemark,jdbcType=VARCHAR}, #{item.status,jdbcType=DECIMAL}, #{item.resultMeasuredTonnage,jdbcType=DECIMAL},
  503. #{item.loadingId,jdbcType=DECIMAL}, #{item.materialId,jdbcType=DECIMAL}, #{item.loadingSequence,jdbcType=DECIMAL}
  504. from dual
  505. </foreach> )
  506. </insert>
  507. <update id="batchUpdate" parameterType="java.util.List">
  508. update TMSTRUCK_LOAD_RESULT
  509. set
  510. RESULT_ID=
  511. <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
  512. when #{item.resultId,jdbcType=DECIMAL} then #{item.resultId,jdbcType=DECIMAL}
  513. </foreach>
  514. ,RESULT_TOTAL_ID=
  515. <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
  516. when #{item.resultId,jdbcType=DECIMAL} then #{item.resultTotalId,jdbcType=DECIMAL}
  517. </foreach>
  518. ,RESULT_LOAD_START_TIME=
  519. <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
  520. when #{item.resultId,jdbcType=DECIMAL} then #{item.resultLoadStartTime,jdbcType=TIMESTAMP}
  521. </foreach>
  522. ,RESULT_LOAD_END_TIME=
  523. <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
  524. when #{item.resultId,jdbcType=DECIMAL} then #{item.resultLoadEndTime,jdbcType=TIMESTAMP}
  525. </foreach>
  526. ,RESULT_LOAD_DURATION=
  527. <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
  528. when #{item.resultId,jdbcType=DECIMAL} then #{item.resultLoadDuration,jdbcType=DECIMAL}
  529. </foreach>
  530. ,LOAD_STANDARD_TIME_ID=
  531. <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
  532. when #{item.resultId,jdbcType=DECIMAL} then #{item.loadStandardTimeId,jdbcType=DECIMAL}
  533. </foreach>
  534. ,LOADER_ID=
  535. <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
  536. when #{item.resultId,jdbcType=DECIMAL} then #{item.loaderId,jdbcType=DECIMAL}
  537. </foreach>
  538. ,RESULT_ISCLEAR=
  539. <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
  540. when #{item.resultId,jdbcType=DECIMAL} then #{item.resultIsclear,jdbcType=VARCHAR}
  541. </foreach>
  542. ,DELETE_NAME=
  543. <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
  544. when #{item.resultId,jdbcType=DECIMAL} then #{item.deleteName,jdbcType=VARCHAR}
  545. </foreach>
  546. ,DELETE_TIME=
  547. <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
  548. when #{item.resultId,jdbcType=DECIMAL} then #{item.deleteTime,jdbcType=TIMESTAMP}
  549. </foreach>
  550. ,INSERT_USERNAME=
  551. <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
  552. when #{item.resultId,jdbcType=DECIMAL} then #{item.insertUsername,jdbcType=VARCHAR}
  553. </foreach>
  554. ,INSERT_TIME=
  555. <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
  556. when #{item.resultId,jdbcType=DECIMAL} then #{item.insertTime,jdbcType=TIMESTAMP}
  557. </foreach>
  558. ,UPDATE_USERNAME=
  559. <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
  560. when #{item.resultId,jdbcType=DECIMAL} then #{item.updateUsername,jdbcType=VARCHAR}
  561. </foreach>
  562. ,UPDATE_TIME=
  563. <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
  564. when #{item.resultId,jdbcType=DECIMAL} then #{item.updateTime,jdbcType=TIMESTAMP}
  565. </foreach>
  566. ,INSERT_UPDATE_REMARK=
  567. <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
  568. when #{item.resultId,jdbcType=DECIMAL} then #{item.insertUpdateRemark,jdbcType=VARCHAR}
  569. </foreach>
  570. ,STATUS=
  571. <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
  572. when #{item.resultId,jdbcType=DECIMAL} then #{item.status,jdbcType=DECIMAL}
  573. </foreach>
  574. ,RESULT_MEASURED_TONNAGE=
  575. <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
  576. when #{item.resultId,jdbcType=DECIMAL} then #{item.resultMeasuredTonnage,jdbcType=DECIMAL}
  577. </foreach>
  578. ,LOADING_ID=
  579. <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
  580. when #{item.resultId,jdbcType=DECIMAL} then #{item.loadingId,jdbcType=DECIMAL}
  581. </foreach>
  582. ,MATERIAL_ID=
  583. <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
  584. when #{item.resultId,jdbcType=DECIMAL} then #{item.materialId,jdbcType=DECIMAL}
  585. </foreach>
  586. ,LOADING_SEQUENCE=
  587. <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
  588. when #{item.resultId,jdbcType=DECIMAL} then #{item.loadingSequence,jdbcType=DECIMAL}
  589. </foreach>
  590. where RESULT_ID in
  591. <foreach close=")" collection="list" index="index" item="item" open="(" separator=",">
  592. #{item.resultId,jdbcType=DECIMAL}
  593. </foreach>
  594. </update>
  595. <delete id="batchDelete" parameterType="java.util.List">
  596. delete from TMSTRUCK_LOAD_RESULT
  597. where RESULT_ID in
  598. <foreach close=")" collection="list" item="id" open="(" separator=",">
  599. #{id}
  600. </foreach>
  601. </delete>
  602. <!-- 友情提示!!!-->
  603. <!-- 请将自己写的代码放在此标签之下,方便以后粘贴复制。-->
  604. <sql id="orderBy">
  605. <if test="orderField != null and orderField != ''">
  606. order by "${orderField}"
  607. <if test="orderType != null and orderType != ''">
  608. ${orderType}
  609. </if>
  610. </if>
  611. </sql>
  612. <!-- 获取所有装车实绩 -->
  613. <select id="getCGJKLoadResult" parameterType="java.util.Map" resultType="java.util.LinkedHashMap">
  614. select *
  615. from (
  616. select TLR.RESULT_ID "resultId",
  617. APO.PURCHASE_ORDER_NO "purchaseOrderNo",
  618. RM.MATERIAL_NAME "materialName",
  619. OO.ORDER_NUMBER "orderNumber",
  620. RC.CAPACITY_NUMBER "capacityNumber",
  621. TLR.RESULT_MEASURED_TONNAGE "resultMeasuredTonnage",
  622. TLR.RESULT_ISCLEAR "resultIsclear",
  623. to_char(TLR.RESULT_LOAD_START_TIME, 'yyyy-mm-dd') "resultLoadStartTime",
  624. TLR.INSERT_UPDATE_REMARK "insertUpdateRemark",
  625. TLR.INSERT_TIME "insertTime",
  626. RCON. CONSIGNEE_COMPANY_NAME "consigneeCompanyName",
  627. RS.SUPPLIER_NAME "supplierName"
  628. from TMSTRUCK_LOAD_RESULT TLR
  629. left join TMSTRUCK_TOTAL_RESULT TTR
  630. on TLR.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
  631. left join OMSTRUCK_ORDER OO
  632. on TTR.ORDER_ID = OO.ORDER_ID
  633. left join OMSTRUCK_ORDER_MATERIAL OOM
  634. on OO.ORDER_ID = OOM.ORDER_ID
  635. left join AMS_PURCHASE_ORDER APO
  636. on OO.ORDER_PLAN_ID = APO.PURCHASE_ORDER_ID
  637. left join DIL_BATCH DB
  638. on DB.BATCH_ID = APO.BATCH_ID
  639. left join RMS_MATERIAL RM
  640. on OOM.MATERIAL_ID = RM.MATERIAL_ID
  641. left join RMS_DRIVER_CAPACITY RDC
  642. on RDC.DRIVER_CAPACITY_ID = OO.DRIVER_CAPACITY_ID
  643. left join RMS_CAPACITY RC
  644. on RC.CAPACITY_ID = RDC.CAPACITY_ID
  645. left join RMS_SUPPLIER RS
  646. on RS.SUPPLIER_ID = APO.SUPPLIER_UNIT_ID
  647. left join RMS_CONSIGNEE RCON
  648. on RCON.CONSIGNEE_ID = APO.RECEIVE_UNIT_ID
  649. where TLR.STATUS = #{status} and OO.ORDER_TYPE = #{orderTypee}
  650. )
  651. <where>
  652. <if test="purchaseOrderId != null">
  653. <foreach collection="purchaseOrderId" item="item" open="(" separator="or" close=")">
  654. "purchaseOrderId" like '%${item}%'
  655. </foreach>
  656. </if>
  657. <if test="materialName != null">
  658. and
  659. <foreach collection="materialName" item="item" open="(" separator="or" close=")">
  660. "materialName" like '%${item}%'
  661. </foreach>
  662. </if>
  663. <if test="orderNumber != null">
  664. and
  665. <foreach collection="orderNumber" item="item" open="(" separator="or" close=")">
  666. "orderNumber" like '%${item}%'
  667. </foreach>
  668. </if>
  669. <if test="capacityNumber != null">
  670. and
  671. <foreach collection="capacityNumber" item="item" open="(" separator="or" close=")">
  672. "capacityNumber" like '%${item}%'
  673. </foreach>
  674. </if>
  675. <if test="orderMaterialWeight != null">
  676. and
  677. <foreach collection="orderMaterialWeight" item="item" open="(" separator="or" close=")">
  678. "orderMaterialWeight" like '%${item}%'
  679. </foreach>
  680. </if>
  681. <if test="resultIsclear != null">
  682. and
  683. <foreach collection="resultIsclear" item="item" open="(" separator="or" close=")">
  684. "resultIsclear" like '%${item}%'
  685. </foreach>
  686. </if>
  687. <if test="resultLoadStartTime != null">
  688. and
  689. <foreach collection="resultLoadStartTime" item="item" open="(" separator="or" close=")">
  690. "resultLoadStartTime" like '%${item}%'
  691. </foreach>
  692. </if>
  693. <if test="insertUpdateRemark != null">
  694. and
  695. <foreach collection="insertUpdateRemark" item="item" open="(" separator="or" close=")">
  696. "insertUpdateRemark" like '%${item}%'
  697. </foreach>
  698. </if>
  699. </where>
  700. <include refid="orderBy"></include>
  701. <if test="orderField == null ">
  702. order by "resultLoadStartTime" desc
  703. </if>
  704. </select>
  705. <!-- 通过Id获取装车实绩 数据 用于修改-->
  706. <select id="getLoadResultById" parameterType="int" resultType="java.util.LinkedHashMap">
  707. select TLR.RESULT_ISCLEAR "resultIsclear",
  708. TLR.RESULT_LOAD_START_TIME "resultLoadStartTime",
  709. TLR.INSERT_UPDATE_REMARK "insertUpdateRemark"
  710. from TMSTRUCK_LOAD_RESULT TLR
  711. where RESULT_ID = #{resultId}
  712. </select>
  713. <!-- 通过发站查询所属港口 -->
  714. <select id="getPortIdBySendStationId" parameterType="java.math.BigDecimal" resultType="java.math.BigDecimal">
  715. select RAS.OWNED_PORT_ID
  716. from RMSTRAIN_ARRIVAL_SEND RAS
  717. where RAS.ARRIVAL_ID = #{sendStationId}
  718. </select>
  719. <!-- 通过运输订单查询批次 -->
  720. <select id="getBatchIdByOrderId" parameterType="java.math.BigDecimal" resultType="java.math.BigDecimal">
  721. select APO.BATCH_ID
  722. from OMSTRUCK_ORDER OO
  723. left join AMS_PURCHASE_ORDER APO
  724. on APO.PURCHASE_ORDER_ID = OO.ORDER_PLAN_ID
  725. where OO.ORDER_ID = #{orderId}
  726. </select>
  727. <!--通过运输订单号查找运输订单类型-->
  728. <select id="selectOrderTypeByOrderNumber" resultType="java.lang.Integer" parameterType="java.lang.String">
  729. select OO.ORDER_TYPE "orderType"
  730. from OMSTRUCK_ORDER OO
  731. where OO.ORDER_NUMBER = #{oderNumber}
  732. </select>
  733. <!-- 通过运输订单号查询 出库实绩 最小Id(第一件扫描时间) 0 成功 1 失败-->
  734. <select id="getMinScanIdByOrderNum" parameterType="java.util.Map" resultType="java.util.Map">
  735. select *
  736. from (
  737. select WOSR.RESULT_ID "resultId",
  738. WOSR.LOAD_ID "loadId"
  739. from WMSP_OUTBOUND_RESULT WOR
  740. left join WMSP_OUTBOUND_SCAN_RESULT WOSR
  741. on WOSR.OUTBOUND_RESULT_ID = WOR.RESULT_ID
  742. left join OMSTRUCK_ORDER OO
  743. on OO.ORDER_ID = WOR.BILL_LADING_ID
  744. WHERE OO.ORDER_NUMBER = #{orderNumber}
  745. and WOR.MATERIAL_ID = #{materialId}
  746. and WOSR.RESULT_CHECK = 0
  747. ORDER BY WOSR.RESULT_LOAD_TIME
  748. )
  749. where rownum = 1
  750. </select>
  751. <!-- 根据运输订单号查找 -->
  752. <select id="selectResultIdByOrderNumber" resultType="java.lang.Integer" parameterType="java.lang.String">
  753. select WOSR.RESULT_ID "resultId"
  754. from OMSTRUCK_ORDER OO
  755. left join WMSP_OUTBOUND_RESULT WOR
  756. on OO.ORDER_ID = WOR.BILL_LADING_ID
  757. left join WMSP_OUTBOUND_SCAN_RESULT WOSR
  758. on WOSR.OUTBOUND_RESULT_ID = WOR.RESULT_ID
  759. WHERE OO.ORDER_NUMBER = #{orderNumber}
  760. and WOSR.RESULT_CHECK = 0
  761. </select>
  762. <!-- 根据实绩id查找扫描时间 -->
  763. <select id="selectLoadTimeByResultId" resultType="java.util.Date" parameterType="java.math.BigDecimal">
  764. select WOSR.RESULT_LOAD_TIME "loadTime"
  765. from WMSP_OUTBOUND_SCAN_RESULT WOSR
  766. where WOSR.RESULT_ID = #{resultId}
  767. </select>
  768. <!-- 根据扫描实绩id查询装卸工id -->
  769. <select id="selecLoadIdByresultId" resultType="java.lang.Integer">
  770. select WOSR.LOAD_ID "loadId"
  771. from WMSP_OUTBOUND_SCAN_RESULT WOSR
  772. where WOSR.RESULT_ID = #{resultId}
  773. </select>
  774. <!-- 销售装车实绩查询-->
  775. <select id="selectLoadResultForSale" resultType="java.util.Map" parameterType="java.lang.Integer">
  776. SELECT (SELECT ORDER_MATERIAL_NUMBER
  777. FROM OMSTRUCK_ORDER_MATERIAL OOM
  778. WHERE OOM.ORDER_ID = OO.ORDER_ID
  779. AND TLR.MATERIAL_ID = OOM.MATERIAL_ID) "orderMaterialNumber",
  780. TLR.RESULT_LOAD_START_TIME "startTime",
  781. TLR.RESULT_LOAD_END_TIME "endTime",
  782. TLR.RESULT_LOAD_DURATION "loadDuration",
  783. RM.MATERIAL_NAME "materialName",
  784. RP.PERSONNEL_NAME "name",
  785. RMS.MATERIAL_THEORETICAL_WEIGHT "theoreticalWeight",
  786. OO.ORDER_NUMBER "orderNumber",
  787. ASO.SALE_NUMBER "saleNumber",
  788. RC.CAPACITY_NUMBER "capacityNumber"
  789. FROM TMSTRUCK_LOAD_RESULT TLR
  790. LEFT JOIN TMSTRUCK_TOTAL_RESULT TTR ON TTR.RESULT_TOTAL_ID = TLR.RESULT_TOTAL_ID
  791. LEFT JOIN OMSTRUCK_ORDER OO ON OO.ORDER_ID = TTR.ORDER_ID
  792. LEFT JOIN RMS_MATERIAL_STEEL RMS ON RMS.MATERIAL_STEEL_ID = TLR.MATERIAL_ID
  793. LEFT JOIN RMS_MATERIAL RM ON RM.MATERIAL_ID = RMS.MATERIAL_ID
  794. LEFT JOIN RMS_PERSONNEL RP ON TLR.LOADER_ID = RP.PERSONNEL_ID
  795. LEFT JOIN AMS_SALE_ORDER ASO ON OO.ORDER_PLAN_ID = ASO.SALE_ORDER_ID
  796. LEFT JOIN AMS_SALE_ORDER_MATERIAL ASOM ON ASOM.SALE_ORDER_ID = ASO.SALE_ORDER_ID
  797. LEFT JOIN RMS_CAPACITY RC ON RC.CAPACITY_ID = OO.CAPACITY_ID
  798. where TLR.STATUS = #{status}
  799. and OO.ORDER_TYPE = 1
  800. </select>
  801. <!--通过运输订单号查找物资id-->
  802. <select id="selectMaterialIdByOrderNumber" parameterType="java.lang.String" resultType="java.util.Map">
  803. SELECT
  804. OOM.MATERIAL_ID "materialId"
  805. FROM
  806. OMSTRUCK_ORDER OO
  807. LEFT JOIN OMSTRUCK_ORDER_MATERIAL OOM ON OO.ORDER_ID = OOM.ORDER_ID
  808. WHERE
  809. <if test="orderNumber != null">
  810. OO.ORDER_NUMBER = #{orderNumber}
  811. </if>
  812. <if test="orderId != null">
  813. and OO.ORDER_ID = #{orderId}
  814. </if>
  815. </select>
  816. <!-- 通过订单ID 和物资Id 查询装车实绩ID 可能会有多条-->
  817. <select id="getLoadResultId" parameterType="java.util.Map" resultType="java.lang.Integer">
  818. select TLR.RESULT_ID
  819. from OMSTRUCK_ORDER OO
  820. left join TMSTRUCK_TOTAL_RESULT TTR
  821. on TTR.ORDER_ID = OO.ORDER_ID
  822. left join TMSTRUCK_LOAD_RESULT TLR
  823. on TLR.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
  824. where OO.ORDER_ID = #{orderId}
  825. and TLR.MATERIAL_ID = #{materialId}
  826. </select>
  827. <!--通过运输订单号查找装车实绩id-->
  828. <select id="selectLoadResultIdByOrderNumber" resultType="java.lang.Integer" parameterType="java.util.Map">
  829. SELECT TLR.RESULT_ID "loadResultId",
  830. TLR.RESULT_LOAD_START_TIME "startTime"
  831. FROM OMSTRUCK_ORDER OO
  832. LEFT JOIN TMSTRUCK_TOTAL_RESULT TTR
  833. ON OO.ORDER_ID = TTR.ORDER_ID
  834. LEFT JOIN TMSTRUCK_LOAD_RESULT TLR
  835. ON TLR.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
  836. WHERE OO.ORDER_NUMBER = #{orderNumber}
  837. </select>
  838. <!--内转物流查询汽车装车实绩 -->
  839. <select id="selectLoadResultForConverted" resultType="java.util.LinkedHashMap">
  840. select APO.PURCHASE_ORDER_NO "orderNo",
  841. TLR.INSERT_TIME "insertTime",
  842. RC.CAPACITY_NUMBER "capacityNumber",
  843. TLR.RESULT_MEASURED_TONNAGE "toggage",
  844. RAS.ARRIVAL_NAME "arrivelName",
  845. DB.RESULT_FOREIGN_SHIP_NAME "foreignShipName",
  846. OO.ORDER_NUMBER "orderNumber",
  847. RM.MATERIAL_NAME "materialName"
  848. from TMSTRUCK_LOAD_RESULT TLR
  849. LEFT JOIN TMSTRUCK_TOTAL_RESULT TTR
  850. ON TTR.RESULT_TOTAL_ID = TLR.RESULT_TOTAL_ID
  851. LEFT JOIN OMSTRUCK_ORDER OO
  852. ON OO.ORDER_ID = TTR.ORDER_ID
  853. left join AMS_PURCHASE_ORDER APO
  854. ON oo.ORDER_PLAN_ID = APO.PURCHASE_ORDER_ID
  855. LEFT JOIN DIL_BATCH DB
  856. ON DB.BATCH_ID = APO.BATCH_ID
  857. LEFT JOIN RMS_MATERIAL RM
  858. ON RM.MATERIAL_ID = TLR.MATERIAL_ID
  859. LEFT JOIN RMS_CAPACITY RC
  860. ON OO.CAPACITY_ID = RC.CAPACITY_ID
  861. LEFT JOIN TMSTRAIN_LOADING_RESULT TLR2
  862. ON TLR2.PURCHASE_ORDER_RAIL_PLAN_ID = OO.ORDER_PLAN_ID
  863. LEFT JOIN RMSTRAIN_ARRIVAL_SEND RAS
  864. ON RAS.ARRIVAL_ID = TLR.LOADING_ID
  865. </select>
  866. <!-- 根据实绩id渲染数据 -->
  867. <select id="selectLoadResultByResultId" resultType="java.lang.Integer">
  868. SELECT TLR.LOADING_ID "loadingId",
  869. TLR.MATERIAL_ID "materialId",
  870. TLR.RESULT_TOTAL_ID "totalId"
  871. FROM TMSTRUCK_LOAD_RESULT TLR
  872. WHERE TLR.RESULT_ID = #{resultId}
  873. </select>
  874. <!--通过车牌号号查找物资id和运力id以及总实绩id-->
  875. <select id="selectMaterialIdAndCapacityId" resultType="java.util.Map" parameterType="java.lang.Integer">
  876. select OOM.MATERIAL_ID "materialId",
  877. OO.CAPACITY_ID "capacityId",
  878. TTR.RESULT_TOTAL_ID "resultTotalId"
  879. from TMSTRUCK_TOTAL_RESULT TTR
  880. left join OMSTRUCK_ORDER OO
  881. on OO.ORDER_ID = TTR.ORDER_ID
  882. left join OMSTRUCK_ORDER_MATERIAL OOM
  883. on OOM.ORDER_ID = OO.ORDER_ID
  884. LEFT JOIN RMS_CAPACITY RC
  885. ON RC.CAPACITY_ID = OO.CAPACITY_ID
  886. where RC.CAPACITY_NUMBER = #{capacityNumber}
  887. </select>
  888. <!--根据id查找用户名 -->
  889. <select id="selectPersonNameByPersonnelId" resultType="java.lang.String" parameterType="java.lang.Integer">
  890. select RP.PERSONNEL_NAME "personnelName"
  891. from RMS_PERSONNEL RP
  892. where RP.PERSONNEL_ID = #{personnelId}
  893. </select>
  894. <select id="selectMaterialTypeByMaterialId" parameterType="java.lang.Integer" resultType="java.lang.Integer">
  895. select RMT.MATERIAL_TYPE_ID "materialTypeId"
  896. FROM RMS_MATERIAL RM
  897. LEFT JOIN RMS_MATERIAL_TYPE RMT
  898. ON RMT.MATERIAL_TYPE_ID = RM.MATERIAL_TYPE_ID
  899. where RM.MATERIAL_ID = #{materialId}
  900. </select>
  901. <!-- 查询销售装车实绩 -->
  902. <select id="getXSLoadResult" parameterType="java.util.Map" resultType="java.util.Map">
  903. SELECT *
  904. FROM (
  905. SELECT OO.ORDER_NUMBER "orderNumber",
  906. RC.CAPACITY_NUMBER "capacityNumber",
  907. TLR.RESULT_LOAD_START_TIME "resultLoadStartTime",
  908. TLR.RESULT_LOAD_END_TIME "resultLoadEndTime",
  909. TLR.RESULT_LOAD_DURATION "resultLoadDuration",
  910. RSD.STANDARD_DATA_MAX "standardDataMax",
  911. RP.PERSONNEL_NAME "personnelName",
  912. RM.MATERIAL_THEORETICAL_WEIGHT "materialTheoreticalWeight",
  913. RM.MATERIAL_NAME "materialName",
  914. (CASE WHEN OO.ORDER_TYPE = 1
  915. THEN (
  916. SELECT ASO.SALE_NUMBER
  917. FROM AMS_SALE_ORDER_MATERIAL ASOM
  918. LEFT JOIN AMS_SALE_ORDER ASO ON ASO.SALE_ORDER_ID = ASOM.SALE_ORDER_ID
  919. WHERE ASOM.SALE_ORDER_MATERIAL_ID = OO.ORDER_PLAN_ID
  920. )
  921. WHEN OO.ORDER_TYPE IN (2, 3)
  922. THEN (
  923. SELECT ARD.DAYPLAN_NO
  924. FROM AMSTRUCK_RAIL_DAYPLAN ARD
  925. WHERE ARD.DAYPLAN_ID = OO.ORDER_PLAN_ID
  926. )
  927. END) "no",
  928. (CASE WHEN OO.ORDER_TYPE = 1
  929. THEN OOM.ORDER_MATERIAL_NUMBER
  930. WHEN OO.ORDER_TYPE IN (2, 3)
  931. THEN OOM.ORDER_MATERIAL_WEIGHT
  932. END) "materialNumWei"
  933. FROM TMSTRUCK_LOAD_RESULT TLR
  934. LEFT JOIN TMSTRUCK_TOTAL_RESULT TTR
  935. ON TLR.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
  936. LEFT JOIN OMSTRUCK_ORDER OO
  937. ON OO.ORDER_ID = TTR.ORDER_ID
  938. LEFT JOIN OMSTRUCK_ORDER_MATERIAL OOM
  939. ON OOM.ORDER_ID = OO.ORDER_ID
  940. LEFT JOIN RMS_MATERIAL RM
  941. ON RM.MATERIAL_ID = OOM.MATERIAL_ID
  942. LEFT JOIN RMS_DRIVER_CAPACITY RDC
  943. ON RDC.DRIVER_CAPACITY_ID = OO.DRIVER_CAPACITY_ID
  944. LEFT JOIN RMS_CAPACITY RC
  945. ON RC.CAPACITY_ID = RDC.CAPACITY_ID
  946. LEFT JOIN RMS_STANDARD_DATA RSD
  947. ON RSD.STANDARD_DATA_ID = TLR.LOAD_STANDARD_TIME_ID
  948. LEFT JOIN RMS_PERSONNEL RP
  949. ON TLR.LOADER_ID = RP.PERSONNEL_ID
  950. where
  951. OO.ORDER_TYPE in (1, 2, 3)
  952. and TLR.STATUS = #{status}
  953. )
  954. <where>
  955. <if test="orderNumber != null">
  956. <foreach collection="orderNumber" item="item" open="(" separator="or" close=")">
  957. "orderNumber" like '%${item}%'
  958. </foreach>
  959. </if>
  960. <if test="materialName != null">
  961. and
  962. <foreach collection="materialName" item="item" open="(" separator="or" close=")">
  963. "materialName" like '%${item}%'
  964. </foreach>
  965. </if>
  966. <if test="no != null">
  967. and
  968. <foreach collection="no" item="item" open="(" separator="or" close=")">
  969. "no" like '%${item}%'
  970. </foreach>
  971. </if>
  972. <if test="materialNumWei != null">
  973. and
  974. <foreach collection="materialNumWei" item="item" open="(" separator="or" close=")">
  975. "materialNumWei" like '%${item}%'
  976. </foreach>
  977. </if>
  978. <if test="materialTheoreticalWeight != null">
  979. and
  980. <foreach collection="materialTheoreticalWeight" item="item" open="(" separator="or" close=")">
  981. "materialTheoreticalWeight" like '%${item}%'
  982. </foreach>
  983. </if>
  984. <if test="capacityNumber != null">
  985. and
  986. <foreach collection="capacityNumber" item="item" open="(" separator="or" close=")">
  987. "capacityNumber" like '%${item}%'
  988. </foreach>
  989. </if>
  990. <if test="resultLoadStartTime != null">
  991. and
  992. <foreach collection="resultLoadStartTime" item="item" open="(" separator="or" close=")">
  993. "resultLoadStartTime" like '%${item}%'
  994. </foreach>
  995. </if>
  996. <if test="resultLoadEndTime != null">
  997. and
  998. <foreach collection="resultLoadEndTime" item="item" open="(" separator="or" close=")">
  999. "resultLoadEndTime" like '%${item}%'
  1000. </foreach>
  1001. </if>
  1002. <if test="resultLoadDuration != null">
  1003. and
  1004. <foreach collection="resultLoadDuration" item="item" open="(" separator="or" close=")">
  1005. "resultLoadDuration" like '%${item}%'
  1006. </foreach>
  1007. </if>
  1008. <if test="standardDataMax != null">
  1009. and
  1010. <foreach collection="standardDataMax" item="item" open="(" separator="or" close=")">
  1011. "standardDataMax" like '%${item}%'
  1012. </foreach>
  1013. </if>
  1014. <if test="personnelName != null">
  1015. and
  1016. <foreach collection="personnelName" item="item" open="(" separator="or" close=")">
  1017. "personnelName" like '%${item}%'
  1018. </foreach>
  1019. </if>
  1020. </where>
  1021. <include refid="orderBy"></include>
  1022. <if test="orderField == null ">
  1023. order by "resultLoadStartTime" desc
  1024. </if>
  1025. </select>
  1026. <!-- 通过港口ID获取仓库ID -->
  1027. <select id="getWarehouseIdByPortId" parameterType="java.math.BigDecimal" resultType="java.math.BigDecimal">
  1028. select RW.WAREHOUSE_ID
  1029. from RMS_WAREHOUSE RW
  1030. where RW.WAREHOUSE_TYPE_ID = 4 and RW.PORT_ID = #{portId}
  1031. </select>
  1032. <!-- 通过物资ID和总实绩Id查询唯一的装车实绩Id -->
  1033. <select id="getLoadResultIdByMIdAndTotalId" parameterType="int" resultType="java.lang.Integer">
  1034. select TLR.RESULT_ID
  1035. from TMSTRUCK_LOAD_RESULT TLR
  1036. <where>
  1037. TLR.RESULT_TOTAL_ID = #{resultTotalId}
  1038. <if test="materialId != null">
  1039. and TLR.MATERIAL_ID = #{materialId}
  1040. </if>
  1041. </where>
  1042. </select>
  1043. <!-- 通过物资唯一编码 查找物资ID -->
  1044. <select id="getMaterialIdByMaterialCode" parameterType="string" resultType="java.math.BigDecimal">
  1045. select MATERIAL_ID
  1046. from RMS_MATERIAL_STEEL
  1047. where MATERIAL_ONLY_CODE = #{materialOnlyCode}
  1048. </select>
  1049. <!-- 查询所有正在进行进厂排队的销售订单 -->
  1050. <select id="getSaleOrderOnQueue" parameterType="java.util.Map" resultType="java.util.Map">
  1051. select *
  1052. from (
  1053. select OO.ORDER_ID "orderId",
  1054. OO.ORDER_NUMBER "orderNumber",
  1055. ASO.SALE_NUMBER "saleNumber",
  1056. RCD.DRIVER_NAME "driverName",
  1057. RC.CAPACITY_NUMBER "capacityNumber",
  1058. OO.ORDER_ISSUE_TIME "orderIssueTime"
  1059. from OMSTRUCK_ORDER OO
  1060. left join AMS_SALE_ORDER_MATERIAL ASOM
  1061. on ASOM.SALE_ORDER_MATERIAL_ID = OO.ORDER_PLAN_ID
  1062. left join AMS_SALE_ORDER ASO
  1063. on ASO.SALE_ORDER_ID = ASOM.SALE_ORDER_ID
  1064. left join RMS_DRIVER_CAPACITY RDC
  1065. on RDC.DRIVER_CAPACITY_ID = OO.DRIVER_CAPACITY_ID
  1066. left join RMS_CAR_DRIVER RCD
  1067. on RCD.DRIVER_ID = RDC.DRIVER_ID
  1068. left join RMS_CAPACITY RC
  1069. on RDC.CAPACITY_ID = RC.CAPACITY_ID
  1070. where OO.ORDER_ID in (select OO.ORDER_ID
  1071. from QMS_QUEUE_RESULT QQR
  1072. left join TMSTRUCK_TOTAL_RESULT TTR
  1073. on TTR.RESULT_TOTAL_ID = QQR.RESULT_TOTAL_ID
  1074. left join OMSTRUCK_ORDER OO
  1075. on OO.ORDER_ID = TTR.ORDER_ID
  1076. where QQR.RESULT_START_TIME is not null
  1077. and QQR.RESULT_END_TIME is null
  1078. and OO.ORDER_TYPE = 1)
  1079. )
  1080. <where>
  1081. <if test="orderNumber != null">
  1082. <foreach collection="orderNumber" item="item" open="(" separator="or" close=")">
  1083. "orderNumber" like '%${item}%'
  1084. </foreach>
  1085. </if>
  1086. <if test="saleNumber != null">
  1087. and
  1088. <foreach collection="saleNumber" item="item" open="(" separator="or" close=")">
  1089. "saleNumber" like '%${item}%'
  1090. </foreach>
  1091. </if>
  1092. <if test="driverName != null">
  1093. and
  1094. <foreach collection="driverName" item="item" open="(" separator="or" close=")">
  1095. "driverName" like '%${item}%'
  1096. </foreach>
  1097. </if>
  1098. <if test="capacityNumber != null">
  1099. and
  1100. <foreach collection="capacityNumber" item="item" open="(" separator="or" close=")">
  1101. "capacityNumber" like '%${item}%'
  1102. </foreach>
  1103. </if>
  1104. </where>
  1105. <include refid="orderBy"></include>
  1106. <if test="orderField == null ">
  1107. order by "orderIssueTime" desc
  1108. </if>
  1109. </select>
  1110. <!-- 通过订单Id和物资Id确定唯一的装车实绩Id -->
  1111. <select id="getLoadIdByOrderIdAndMId" parameterType="java.util.Map" resultType="java.lang.Integer">
  1112. select TLR.RESULT_ID
  1113. from OMSTRUCK_ORDER OO
  1114. left join TMSTRUCK_TOTAL_RESULT TTR
  1115. on TTR.ORDER_ID = OO.ORDER_ID
  1116. left join TMSTRUCK_LOAD_RESULT TLR
  1117. on TLR.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
  1118. where OO.ORDER_ID = #{orderId}
  1119. and TLR.MATERIAL_ID = #{materialId}
  1120. </select>
  1121. <!-- 查询内转钢材到异地库装车实绩 -->
  1122. <select id="getSteelNzLoadResult" parameterType="java.util.Map" resultType="java.util.Map">
  1123. SELECT *
  1124. FROM (
  1125. select TLR.RESULT_ID "resultId",
  1126. AROD.DAYPLAN_NO "dayplanNo",
  1127. OO.ORDER_NUMBER "orderNumber",
  1128. RC.CAPACITY_NUMBER "capacityNumber",
  1129. TLR.RESULT_LOAD_START_TIME "resultLoadStartTime",
  1130. TLR.RESULT_LOAD_END_TIME "resultLoadEndTime",
  1131. TLR.RESULT_LOAD_DURATION "resultLoadDuration",
  1132. RSD.STANDARD_DATA_MIN "standardDataMin",
  1133. RM.MATERIAL_NAME "materialName",
  1134. OOM.ORDER_MATERIAL_NUMBER "orderMaterialNumber",
  1135. RM.MATERIAL_THEORETICAL_WEIGHT "materialTheoreticalWeight",
  1136. RP.PERSONNEL_NAME "personnelName"
  1137. from TMSTRUCK_LOAD_RESULT TLR
  1138. left join TMSTRUCK_TOTAL_RESULT TTR
  1139. ON TLR.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
  1140. LEFT JOIN OMSTRUCK_ORDER OO
  1141. ON OO.ORDER_ID = TTR.ORDER_ID
  1142. LEFT JOIN AMS_RAIL_OFFSET_DAYPLAN AROD
  1143. ON AROD.DAYPLAN_ID = OO.ORDER_PLAN_ID
  1144. LEFT JOIN RMS_DRIVER_CAPACITY RDC
  1145. ON RDC.DRIVER_CAPACITY_ID = OO.DRIVER_CAPACITY_ID
  1146. LEFT JOIN RMS_CAPACITY RC
  1147. ON RC.CAPACITY_ID = RDC.CAPACITY_ID
  1148. LEFT JOIN RMS_PERSONNEL RP
  1149. ON RP.PERSONNEL_ID = TLR.LOADER_ID
  1150. LEFT JOIN OMSTRUCK_ORDER_MATERIAL OOM
  1151. ON OO.ORDER_ID = OOM.ORDER_ID AND OOM.MATERIAL_ID = TLR.MATERIAL_ID
  1152. LEFT JOIN RMS_MATERIAL RM
  1153. ON RM.MATERIAL_ID = OOM.MATERIAL_ID
  1154. LEFT JOIN RMS_STANDARD_DATA RSD
  1155. ON RSD.STANDARD_DATA_ID = TLR.LOAD_STANDARD_TIME_ID
  1156. WHERE OO.ORDER_TYPE = 4
  1157. AND TLR.RESULT_LOAD_START_TIME IS NOT NULL
  1158. AND TLR.STATUS = 0
  1159. )
  1160. <where>
  1161. <if test="dayplanNo != null">
  1162. <foreach collection="dayplanNo" item="item" open="(" separator="or" close=")">
  1163. "dayplanNo" like '%${item}%'
  1164. </foreach>
  1165. <if test="orderNumber != null">
  1166. and
  1167. <foreach collection="orderNumber" item="item" open="(" separator="or" close=")">
  1168. "orderNumber" like '%${item}%'
  1169. </foreach>
  1170. </if>
  1171. <if test="capacityNumber != null">
  1172. and
  1173. <foreach collection="capacityNumber" item="item" open="(" separator="or" close=")">
  1174. "capacityNumber" like '%${item}%'
  1175. </foreach>
  1176. </if>
  1177. <if test="resultLoadStartTime != null">
  1178. and
  1179. <foreach collection="resultLoadStartTime" item="item" open="(" separator="or" close=")">
  1180. "resultLoadStartTime" like '%${item}%'
  1181. </foreach>
  1182. </if>
  1183. <if test="resultLoadEndTime != null">
  1184. and
  1185. <foreach collection="resultLoadEndTime" item="item" open="(" separator="or" close=")">
  1186. "resultLoadEndTime" like '%${item}%'
  1187. </foreach>
  1188. </if>
  1189. <if test="resultLoadDuration != null">
  1190. and
  1191. <foreach collection="resultLoadDuration" item="item" open="(" separator="or" close=")">
  1192. "resultLoadDuration" like '%${item}%'
  1193. </foreach>
  1194. </if>
  1195. <if test="standardDataMin != null">
  1196. and
  1197. <foreach collection="standardDataMin" item="item" open="(" separator="or" close=")">
  1198. "standardDataMin" like '%${item}%'
  1199. </foreach>
  1200. </if>
  1201. <if test="materialName != null">
  1202. and
  1203. <foreach collection="materialName" item="item" open="(" separator="or" close=")">
  1204. "materialName" like '%${item}%'
  1205. </foreach>
  1206. </if>
  1207. <if test="orderMaterialNumber != null">
  1208. and
  1209. <foreach collection="orderMaterialNumber" item="item" open="(" separator="or" close=")">
  1210. "orderMaterialNumber" like '%${item}%'
  1211. </foreach>
  1212. </if>
  1213. <if test="materialTheoreticalWeight != null">
  1214. and
  1215. <foreach collection="materialTheoreticalWeight" item="item" open="(" separator="or" close=")">
  1216. "materialTheoreticalWeight" like '%${item}%'
  1217. </foreach>
  1218. </if>
  1219. <if test="personnelName != null">
  1220. and
  1221. <foreach collection="personnelName" item="item" open="(" separator="or" close=")">
  1222. "personnelName" like '%${item}%'
  1223. </foreach>
  1224. </if>
  1225. </if>
  1226. </where>
  1227. <include refid="orderBy"></include>
  1228. <if test="orderField == null ">
  1229. order by "resultLoadStartTime" desc
  1230. </if>
  1231. </select>
  1232. <!-- 查询内转进口矿/国产矿装车实绩 -->
  1233. <select id="getImportedDomesticNzLoadResult" parameterType="java.util.Map" resultType="java.util.Map">
  1234. SELECT *
  1235. FROM (
  1236. SELECT APO.PURCHASE_ORDER_NO "purchaseOrderNo",
  1237. RM.MATERIAL_NAME "materialName",
  1238. DB.RESULT_FOREIGN_SHIP_NAME "resultForeignShipName",
  1239. OO.ORDER_NUMBER "orderNumber",
  1240. RC.CAPACITY_NUMBER "capacityNumber",
  1241. OOM.ORDER_MATERIAL_WEIGHT "orderMaterialWeight",
  1242. TLR.RESULT_LOAD_START_TIME "resultLoadStartTime",
  1243. RW.WAREHOUSE_NAME "warehouseName"
  1244. FROM TMSTRUCK_LOAD_RESULT TLR
  1245. LEFT JOIN TMSTRUCK_TOTAL_RESULT TTR
  1246. ON TTR.RESULT_TOTAL_ID = TLR.RESULT_TOTAL_ID
  1247. LEFT JOIN OMSTRUCK_ORDER OO
  1248. ON OO.ORDER_ID = TTR.ORDER_ID
  1249. LEFT JOIN AMS_PURCHASE_ORDER APO
  1250. ON APO.PURCHASE_ORDER_ID = OO.ORDER_PLAN_ID
  1251. LEFT JOIN DIL_BATCH DB
  1252. ON DB.BATCH_ID = APO.BATCH_ID
  1253. LEFT JOIN OMSTRUCK_ORDER_MATERIAL OOM
  1254. ON OOM.ORDER_ID = OO.ORDER_ID
  1255. LEFT JOIN RMS_MATERIAL RM
  1256. ON RM.MATERIAL_ID = OOM.MATERIAL_ID
  1257. LEFT JOIN RMS_DRIVER_CAPACITY RDC
  1258. ON RDC.DRIVER_CAPACITY_ID = OO.DRIVER_CAPACITY_ID
  1259. LEFT JOIN RMS_CAPACITY RC
  1260. ON RC.CAPACITY_ID = RDC.CAPACITY_ID
  1261. LEFT JOIN RMS_WAREHOUSE RW
  1262. ON RW.WAREHOUSE_ID = TLR.LOADING_ID
  1263. WHERE OO.ORDER_TYPE = #{orderTypee}
  1264. AND TLR.RESULT_LOAD_START_TIME IS NOT NULL
  1265. )
  1266. <where>
  1267. <if test="purchaseOrderNo != null">
  1268. <foreach collection="purchaseOrderNo" item="item" open="(" separator="or" close=")">
  1269. "purchaseOrderNo" like '%${item}%'
  1270. </foreach>
  1271. </if>
  1272. <if test="materialName != null">
  1273. and
  1274. <foreach collection="materialName" item="item" open="(" separator="or" close=")">
  1275. "materialName" like '%${item}%'
  1276. </foreach>
  1277. </if>
  1278. <if test="resultForeignShipName != null">
  1279. and
  1280. <foreach collection="resultForeignShipName" item="item" open="(" separator="or" close=")">
  1281. "resultForeignShipName" like '%${item}%'
  1282. </foreach>
  1283. </if>
  1284. <if test="orderNumber != null">
  1285. and
  1286. <foreach collection="orderNumber" item="item" open="(" separator="or" close=")">
  1287. "orderNumber" like '%${item}%'
  1288. </foreach>
  1289. </if>
  1290. <if test="capacityNumber != null">
  1291. and
  1292. <foreach collection="capacityNumber" item="item" open="(" separator="or" close=")">
  1293. "capacityNumber" like '%${item}%'
  1294. </foreach>
  1295. </if>
  1296. <if test="orderMaterialWeight != null">
  1297. and
  1298. <foreach collection="orderMaterialWeight" item="item" open="(" separator="or" close=")">
  1299. "orderMaterialWeight" like '%${item}%'
  1300. </foreach>
  1301. </if>
  1302. <if test="resultLoadStartTime != null">
  1303. and
  1304. <foreach collection="resultLoadStartTime" item="item" open="(" separator="or" close=")">
  1305. "resultLoadStartTime" like '%${item}%'
  1306. </foreach>
  1307. </if>
  1308. <if test="warehouseName != null">
  1309. and
  1310. <foreach collection="warehouseName" item="item" open="(" separator="or" close=")">
  1311. "warehouseName" like '%${item}%'
  1312. </foreach>
  1313. </if>
  1314. </where>
  1315. <include refid="orderBy"></include>
  1316. <if test="orderField == null ">
  1317. order by "resultLoadStartTime" desc
  1318. </if>
  1319. </select>
  1320. <!-- 查询内转厂内物资装车实绩 -->
  1321. <select id="getInFactoryLoadResult" parameterType="java.util.Map" resultType="java.util.Map">
  1322. SELECT *
  1323. FROM (
  1324. SELECT RM.MATERIAL_NAME "materialName",
  1325. OO.ORDER_NUMBER "orderNumber",
  1326. RC.CAPACITY_NUMBER "capacityNumber",
  1327. OOM.ORDER_MATERIAL_NUMBER "orderMaterialNumber",
  1328. TLR.RESULT_LOAD_START_TIME "resultLoadStartTime",
  1329. TLR.RESULT_LOAD_END_TIME "resultLoadEndTime",
  1330. TLR.RESULT_LOAD_DURATION "resultLoadDuration",
  1331. RW.WAREHOUSE_NAME "warehouseName"
  1332. FROM TMSTRUCK_LOAD_RESULT TLR
  1333. LEFT JOIN TMSTRUCK_TOTAL_RESULT TTR
  1334. ON TTR.RESULT_TOTAL_ID = TLR.RESULT_TOTAL_ID
  1335. LEFT JOIN OMSTRUCK_ORDER OO
  1336. ON OO.ORDER_ID = TTR.ORDER_ID
  1337. LEFT JOIN OMSTRUCK_ORDER_MATERIAL OOM
  1338. ON OOM.ORDER_ID = OO.ORDER_ID
  1339. LEFT JOIN RMS_MATERIAL RM
  1340. ON RM.MATERIAL_ID = OOM.MATERIAL_ID
  1341. LEFT JOIN RMS_DRIVER_CAPACITY RDC
  1342. ON RDC.DRIVER_CAPACITY_ID = OO.DRIVER_CAPACITY_ID
  1343. LEFT JOIN RMS_CAPACITY RC
  1344. ON RC.CAPACITY_ID = RDC.CAPACITY_ID
  1345. LEFT JOIN RMS_WAREHOUSE RW
  1346. ON RW.WAREHOUSE_ID = TLR.LOADING_ID
  1347. WHERE OO.ORDER_TYPE = 11
  1348. AND TLR.RESULT_LOAD_START_TIME IS NOT NULL
  1349. )
  1350. <where>
  1351. <if test="resultLoadEndTime != null">
  1352. <foreach collection="resultLoadEndTime" item="item" open="(" separator="or" close=")">
  1353. "resultLoadEndTime" like '%${item}%'
  1354. </foreach>
  1355. </if>
  1356. <if test="materialName != null">
  1357. and
  1358. <foreach collection="materialName" item="item" open="(" separator="or" close=")">
  1359. "materialName" like '%${item}%'
  1360. </foreach>
  1361. </if>
  1362. <if test="resultLoadDuration != null">
  1363. and
  1364. <foreach collection="resultLoadDuration" item="item" open="(" separator="or" close=")">
  1365. "resultLoadDuration" like '%${item}%'
  1366. </foreach>
  1367. </if>
  1368. <if test="orderNumber != null">
  1369. and
  1370. <foreach collection="orderNumber" item="item" open="(" separator="or" close=")">
  1371. "orderNumber" like '%${item}%'
  1372. </foreach>
  1373. </if>
  1374. <if test="capacityNumber != null">
  1375. and
  1376. <foreach collection="capacityNumber" item="item" open="(" separator="or" close=")">
  1377. "capacityNumber" like '%${item}%'
  1378. </foreach>
  1379. </if>
  1380. <if test="orderMaterialWeight != null">
  1381. and
  1382. <foreach collection="orderMaterialWeight" item="item" open="(" separator="or" close=")">
  1383. "orderMaterialWeight" like '%${item}%'
  1384. </foreach>
  1385. </if>
  1386. <if test="resultLoadStartTime != null">
  1387. and
  1388. <foreach collection="resultLoadStartTime" item="item" open="(" separator="or" close=")">
  1389. "resultLoadStartTime" like '%${item}%'
  1390. </foreach>
  1391. </if>
  1392. <if test="warehouseName != null">
  1393. and
  1394. <foreach collection="warehouseName" item="item" open="(" separator="or" close=")">
  1395. "warehouseName" like '%${item}%'
  1396. </foreach>
  1397. </if>
  1398. </where>
  1399. <include refid="orderBy"></include>
  1400. <if test="orderField == null ">
  1401. order by "resultLoadStartTime" desc
  1402. </if>
  1403. </select>
  1404. </mapper>