TmstruckLoadResultMapper.xml 73 KB

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