TmstruckEnfactoryResultMapper.xml 62 KB

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