TmstruckEnfactoryResultMapper.xml 62 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405
  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. from OMSTRUCK_ORDER OO
  629. left join TMSTRUCK_TOTAL_RESULT TTR
  630. on TTR.ORDER_ID = OO.ORDER_ID
  631. left join RMS_CAPACITY RC
  632. on RC.CAPACITY_ID = OO.CAPACITY_ID
  633. <where>
  634. <if test="orderId != null">
  635. OO.ORDER_ID = #{orderId}
  636. </if>
  637. <if test="orderNumber != null and orderId == null">
  638. and OO.ORDER_NUMBER = #{orderNumber}
  639. </if>
  640. </where>
  641. </select>
  642. <!-- 通过门岗名称查询门岗Id-->
  643. <select id="selectGatepostIdByGatepostName" parameterType="java.lang.String" resultType="int">
  644. select GATEPOST_ID "gatepostId"
  645. from RMS_GATEPOST
  646. where GATEPOST_NAME = #{gatepostName}
  647. </select>
  648. <!-- 通过运输订单号查找实绩Id -->
  649. <select id="selectEnFactoryResultId" parameterType="string" resultType="java.util.Map">
  650. select * from (select TER.RESULT_ID "resultId",
  651. OO.ORDER_ID "orderId",
  652. OO.ORDER_TYPE "orderTypee", --避免与筛选条件重名
  653. OO.ORDER_TYPE "orderType",
  654. TER.RESULT_TOTAL_ID "resultTotalId",
  655. RC.CAPACITY_NUMBER "capacityNumber",
  656. TER.SEGMEN_SQE "segmentSqe", --进厂的路段顺序号
  657. OO.ORDER_LINE_SEQUENCE "orderSegmentSqe",
  658. ter.result_entry_gate_time
  659. from OMSTRUCK_ORDER OO
  660. left join TMSTRUCK_TOTAL_RESULT TTR
  661. on OO.ORDER_ID = TTR.ORDER_ID
  662. left join TMSTRUCK_ENFACTORY_RESULT TER
  663. on TER.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
  664. left join RMS_CAPACITY RC
  665. on RC.CAPACITY_ID = OO.CAPACITY_ID
  666. where OO.ORDER_NUMBER = #{orderNumber}
  667. and ter.result_entry_gate_time is null
  668. order by TER.SEGMEN_SQE)
  669. where rownum=1
  670. </select>
  671. <!-- 查找排队序号 -->
  672. <select id="selectNodeNumber" resultType="int" parameterType="string">
  673. select (
  674. <![CDATA[
  675. select count(*)
  676. from QMS_QUEUE_LIST QQL2
  677. join QMS_QUEUE_GRID QQG2
  678. on QQG2.GRID_ID = QQL2.GRID_ID
  679. where QQL2.LIST_NODE_ORDER <= QQL.LIST_NODE_ORDER
  680. and QQL2.GRID_ID = QQL.GRID_ID
  681. and QQL2.DELETED = 0
  682. ]]>
  683. ) "listNodeOrder"
  684. from OMSTRUCK_ORDER OO
  685. left join QMS_QUEUE_LIST QQL
  686. on OO.CAPACITY_ID = QQL.CAPACITY_ID
  687. where OO.ORDER_NUMBER = #{orderNumber}
  688. and QQL.DELETED = 1
  689. </select>
  690. <!--查询销售进厂实绩 -->
  691. <select id="getXSEnFactoryResult" parameterType="java.util.Map" resultType="java.util.Map">
  692. select *
  693. from (
  694. select
  695. TER.RESULT_ENTRY_GATE_TIME "resultEntryGateTime",
  696. TER.RESULT_ENTRY_MODE "resultEntryMode",
  697. RG.GATEPOST_NAME "gatepostName",
  698. OO.ORDER_NUMBER "orderNumber",
  699. RC.CAPACITY_NUMBER "capacityNumber",
  700. OO.ORDER_ID "orderId",
  701. ASO.SALE_NUMBER "saleNum",
  702. RS.SUPPLIER_NAME "shipperName",
  703. RCON.CONSIGNEE_COMPANY_NAME "supplierName"
  704. FROM TMSTRUCK_ENFACTORY_RESULT TER
  705. LEFT JOIN TMSTRUCK_TOTAL_RESULT TTR
  706. ON TTR.RESULT_TOTAL_ID = TER.RESULT_TOTAL_ID
  707. LEFT JOIN OMSTRUCK_ORDER OO
  708. ON OO.ORDER_ID = TTR.ORDER_ID
  709. LEFT JOIN AMS_SALE_ORDER_MATERIAL ASOM
  710. ON ASOM.SALE_ORDER_MATERIAL_ID = OO.ORDER_PLAN_ID
  711. LEFT JOIN AMS_SALE_ORDER ASO
  712. ON ASO.SALE_ORDER_ID = ASOM.SALE_ORDER_ID
  713. LEFT JOIN RMS_GATEPOST RG
  714. ON RG.GATEPOST_ID = TER.GATEPOST_ID
  715. LEFT JOIN RMS_CAPACITY RC
  716. ON RC.CAPACITY_ID = OO.CAPACITY_ID
  717. LEFT JOIN RMS_SUPPLIER RS
  718. ON RS.SUPPLIER_ID = ASO.SHIPPER_ID
  719. LEFT JOIN RMS_CONSIGNEE RCON
  720. ON RCON.CONSIGNEE_ID = ASO.RECEIVE_ID
  721. WHERE TER.RESULT_ENTRY_GATE_TIME IS NOT NULL
  722. AND OO.ORDER_TYPE IN (1, 2, 3)
  723. )
  724. <where>
  725. <if test="saleNum != null">
  726. <foreach collection="saleNum" item="item" open="(" separator="or" close=")">
  727. "saleNum" like '%${item}%'
  728. </foreach>
  729. </if>
  730. <if test="gatepostName != null">
  731. and
  732. <foreach collection="gatepostName" item="item" open="(" separator="or" close=")">
  733. "gatepostName" like '%${item}%'
  734. </foreach>
  735. </if>
  736. <if test="orderNumber != null">
  737. and
  738. <foreach collection="orderNumber" item="item" open="(" separator="or" close=")">
  739. "orderNumber" like '%${item}%'
  740. </foreach>
  741. </if>
  742. <if test="capacityNumber != null">
  743. and
  744. <foreach collection="capacityNumber" item="item" open="(" separator="or" close=")">
  745. "capacityNumber" like '%${item}%'
  746. </foreach>
  747. </if>
  748. <if test="shipperName != null">
  749. and
  750. <foreach collection="shipperName" item="item" open="(" separator="or" close=")">
  751. "shipperName" like '%${item}%'
  752. </foreach>
  753. </if>
  754. <if test="resultEntryMode != null">
  755. and
  756. <foreach collection="resultEntryMode" item="item" open="(" separator="or" close=")">
  757. "resultEntryMode" like '%${item}%'
  758. </foreach>
  759. </if>
  760. <if test="resultEntryGateTime != null">
  761. and
  762. <foreach collection="resultEntryGateTime" item="item" open="(" separator="or" close=")">
  763. "resultEntryGateTime" like '%${item}%'
  764. </foreach>
  765. </if>
  766. <if test="supplierName != null">
  767. and
  768. <foreach collection="supplierName" item="item" open="(" separator="or" close=")">
  769. "supplierName" like '%${item}%'
  770. </foreach>
  771. </if>
  772. </where>
  773. <include refid="orderByEnterTime"></include>
  774. </select>
  775. <select id="ads">
  776. </select>
  777. <select id="getMaterial" parameterType="int" resultType="java.util.Map">
  778. SELECT RM.MATERIAL_NAME "materialName",
  779. CONCAT(CONCAT(RM.MATERIAL_SPECIFICATION, '('), CONCAT(RM.MATERIAL_MODEL, ')')) "specificationModel",
  780. OM.ORDER_MATERIAL_NUMBER "orderMaterialNumber",
  781. OM.ORDER_MATERIAL_WEIGHT "orderMaterialWeight"
  782. FROM OMSTRUCK_ORDER OO
  783. LEFT JOIN OMSTRUCK_ORDER_MATERIAL OM
  784. ON OO.ORDER_ID = OM.ORDER_ID
  785. LEFT JOIN RMS_MATERIAL RM
  786. ON OM.MATERIAL_ID = RM.MATERIAL_ID
  787. WHERE OO.ORDER_ID = #{orderId}
  788. </select>
  789. <!-- APP查询进厂实绩 -->
  790. <select id="getEnfactoryResultList" resultType="java.util.Map">
  791. SELECT OO.ORDER_NUMBER AS "orderNumber",
  792. TER.RESULT_ENTRY_GATE_TIME AS "resultEntryGateTime",
  793. RC.CAPACITY_NUMBER AS "capacityNumber"
  794. FROM OMSTRUCK_ORDER OO
  795. LEFT JOIN TMSTRUCK_TOTAL_RESULT TTR
  796. ON TTR.ORDER_ID = OO.ORDER_ID
  797. LEFT JOIN TMSTRUCK_ENFACTORY_RESULT TER
  798. ON TER.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
  799. LEFT JOIN RMS_CAPACITY RC
  800. ON RC.CAPACITY_ID = OO.CAPACITY_ID
  801. -- WHERE TER
  802. </select>
  803. <!-- APP通过运输订单id查询进厂实绩 -->
  804. <select id="getEnfactoryMessageByOrderId" parameterType="java.lang.String" resultType="java.util.Map">
  805. SELECT OO.ORDER_NUMBER AS "orderNumber",
  806. RCA.CAPACITY_NUMBER AS "capacityNumber"
  807. FROM OMSTRUCK_ORDER OO
  808. LEFT JOIN RMS_CAPACITY RCA
  809. ON RCA.CAPACITY_ID = OO.CAPACITY_ID
  810. WHERE OO.ORDER_NUMBER = #{orderNumber}
  811. </select>
  812. <!-- 查询内转钢材到异地库进厂实绩 -->
  813. <select id="getSteelNZEnFactoryResult" parameterType="java.util.Map" resultType="java.util.Map">
  814. SELECT *
  815. FROM (
  816. SELECT
  817. OO.ORDER_ID "orderId",
  818. AROD.DAYPLAN_NO "dayplanNo",
  819. OO.ORDER_NUMBER "orderNumber",
  820. RG.GATEPOST_NAME "gatepostName",
  821. TER.RESULT_ENTRY_MODE "resultEntryMode",
  822. RC.CAPACITY_NUMBER "capacityNumber",
  823. TER.RESULT_ENTRY_GATE_TIME "resultEntryGateTime",
  824. RS.SHIPPER_NAME "shipperName",
  825. RW.WAREHOUSE_NAME "warehouseName"
  826. FROM OMSTRUCK_ORDER OO
  827. LEFT JOIN TMSTRUCK_TOTAL_RESULT TTR
  828. ON TTR.ORDER_ID = OO.ORDER_ID
  829. LEFT JOIN AMS_RAIL_OFFSET_DAYPLAN AROD
  830. ON AROD.DAYPLAN_ID = OO.ORDER_PLAN_ID
  831. LEFT JOIN TMSTRUCK_ENFACTORY_RESULT TER
  832. ON TER.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
  833. LEFT JOIN RMS_GATEPOST RG
  834. ON RG.GATEPOST_ID = TER.GATEPOST_ID
  835. LEFT JOIN RMS_SHIPPER RS
  836. ON RS.SHIPPER_ID = AROD.SHIPPER_ID
  837. LEFT JOIN RMS_WAREHOUSE RW
  838. ON RW.WAREHOUSE_ID = AROD.RECEIVING_UNIT_ID
  839. LEFT JOIN RMS_CAPACITY RC
  840. ON RC.CAPACITY_ID = OO.CAPACITY_ID
  841. WHERE OO.ORDER_TYPE = 4
  842. AND TER.RESULT_ENTRY_GATE_TIME IS NOT NULL
  843. )
  844. <where>
  845. <if test="dayplanNo != null">
  846. <foreach collection="dayplanNo" item="item" open="(" separator="or" close=")">
  847. "dayplanNo" like '%${item}%'
  848. </foreach>
  849. </if>
  850. <if test="orderNumber != null">
  851. and
  852. <foreach collection="orderNumber" item="item" open="(" separator="or" close=")">
  853. "orderNumber" like '%${item}%'
  854. </foreach>
  855. </if>
  856. <if test="gatepostName != null">
  857. and
  858. <foreach collection="gatepostName" item="item" open="(" separator="or" close=")">
  859. "gatepostName" like '%${item}%'
  860. </foreach>
  861. </if>
  862. <if test="resultEntryMode != null">
  863. and
  864. <foreach collection="resultEntryMode" item="item" open="(" separator="or" close=")">
  865. "resultEntryMode" like '%${item}%'
  866. </foreach>
  867. </if>
  868. <if test="capacityNumber != null">
  869. and
  870. <foreach collection="capacityNumber" item="item" open="(" separator="or" close=")">
  871. "capacityNumber" like '%${item}%'
  872. </foreach>
  873. </if>
  874. <if test="resultEntryGateTime != null">
  875. and
  876. <foreach collection="resultEntryGateTime" item="item" open="(" separator="or" close=")">
  877. "resultEntryGateTime" like '%${item}%'
  878. </foreach>
  879. </if>
  880. <if test="shipperName != null">
  881. and
  882. <foreach collection="shipperName" item="item" open="(" separator="or" close=")">
  883. "shipperName" like '%${item}%'
  884. </foreach>
  885. </if>
  886. <if test="warehouseName != null">
  887. and
  888. <foreach collection="warehouseName" item="item" open="(" separator="or" close=")">
  889. "warehouseName" like '%${item}%'
  890. </foreach>
  891. </if>
  892. </where>
  893. <include refid="orderByEnterTime"></include>
  894. </select>
  895. <!-- 查询内转国产矿进口矿 进厂实绩 -->
  896. <select id="getImportedDomesticNzLoadResult" parameterType="java.util.Map" resultType="java.util.Map">
  897. select *
  898. from (
  899. select TER.RESULT_ID "resultId",
  900. APO.PURCHASE_ORDER_NO "purchaseOrderNo",
  901. RM.MATERIAL_NAME "materialName",
  902. DB.RESULT_FOREIGN_SHIP_NAME "resultForeignShipName",
  903. OO.ORDER_NUMBER "orderNumber",
  904. RC.CAPACITY_NUMBER "capacityNumber",
  905. RG.GATEPOST_NAME "gatepostName",
  906. TER.RESULT_ENTRY_MODE "resultEntryMode",
  907. TER.RESULT_ENTRY_GATE_TIME "resultEntryGateTime",
  908. RS.SUPPLIER_NAME "supplierName",
  909. OOM.ORDER_MATERIAL_WEIGHT "orderMaterialWeight",
  910. TER.INSERT_TIME "insertTime",
  911. RCON.CONSIGNEE_COMPANY_NAME "consigneeCompanyName"
  912. from TMSTRUCK_ENFACTORY_RESULT TER
  913. left join TMSTRUCK_TOTAL_RESULT TTR
  914. on TER.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
  915. left join OMSTRUCK_ORDER OO
  916. on TTR.ORDER_ID = OO.ORDER_ID
  917. left join AMS_PURCHASE_ORDER APO
  918. on APO.PURCHASE_ORDER_ID = OO.ORDER_PLAN_ID
  919. left join DIL_BATCH DB
  920. on DB.BATCH_ID = APO.BATCH_ID
  921. left join RMS_CAPACITY RC
  922. on RC.CAPACITY_ID = OO.CAPACITY_ID
  923. left join RMS_SUPPLIER RS
  924. on RS.SUPPLIER_ID = APO.SUPPLIER_UNIT_ID
  925. left join RMS_CONSIGNEE RCON
  926. on RCON.CONSIGNEE_ID = APO.RECEIVE_UNIT_ID
  927. left join OMSTRUCK_ORDER_MATERIAL OOM
  928. on OOM.ORDER_ID = OO.ORDER_ID
  929. left join RMS_MATERIAL RM
  930. on RM.MATERIAL_ID = OOM.MATERIAL_ID
  931. left join RMS_GATEPOST RG
  932. on RG.GATEPOST_ID = TER.GATEPOST_ID
  933. where TER.RESULT_ENTRY_GATE_TIME is not null
  934. and OO.ORDER_TYPE = 9
  935. )
  936. <where>
  937. <if test="purchaseOrderId != null">
  938. <foreach collection="purchaseOrderId" item="item" open="(" separator="or" close=")">
  939. "purchaseOrderId" like '%${item}%'
  940. </foreach>
  941. </if>
  942. <if test="materialName != null">
  943. and
  944. <foreach collection="materialName" item="item" open="(" separator="or" close=")">
  945. "materialName" like '%${item}%'
  946. </foreach>
  947. </if>
  948. <if test="resultForeignShipName != null">
  949. and
  950. <foreach collection="resultForeignShipName" item="item" open="(" separator="or" close=")">
  951. "resultForeignShipName" like '%${item}%'
  952. </foreach>
  953. </if>
  954. <if test="orderNumber != null">
  955. and
  956. <foreach collection="orderNumber" item="item" open="(" separator="or" close=")">
  957. "orderNumber" like '%${item}%'
  958. </foreach>
  959. </if>
  960. <if test="capacityNumber != null">
  961. and
  962. <foreach collection="capacityNumber" item="item" open="(" separator="or" close=")">
  963. "capacityNumber" like '%${item}%'
  964. </foreach>
  965. </if>
  966. <if test="warehouseName != null">
  967. and
  968. <foreach collection="warehouseName" item="item" open="(" separator="or" close=")">
  969. "warehouseName" like '%${item}%'
  970. </foreach>
  971. </if>
  972. <if test="resultEntryMode != null">
  973. and
  974. <foreach collection="resultEntryMode" item="item" open="(" separator="or" close=")">
  975. "resultEntryMode" like '%${item}%'
  976. </foreach>
  977. </if>
  978. <if test="supplierName != null">
  979. and
  980. <foreach collection="supplierName" item="item" open="(" separator="or" close=")">
  981. "supplierName" like '%${item}%'
  982. </foreach>
  983. </if>
  984. <if test="orderMaterialWeight != null">
  985. and
  986. <foreach collection="orderMaterialWeight" item="item" open="(" separator="or" close=")">
  987. "orderMaterialWeight" like '%${item}%'
  988. </foreach>
  989. </if>
  990. </where>
  991. <include refid="orderByEnterTime"></include>
  992. </select>
  993. <!-- 查询内转厂内物资进厂实绩 -->
  994. <select id="getInFactoryMaterialEnFactoryResult" parameterType="java.util.Map" resultType="java.util.Map">
  995. select *
  996. from (
  997. select TER.RESULT_ID "resultId",
  998. RM.MATERIAL_NAME "materialName",
  999. OO.ORDER_NUMBER "orderNumber",
  1000. RC.CAPACITY_NUMBER "capacityNumber",
  1001. RG.GATEPOST_NAME "gatepostName",
  1002. TER.RESULT_ENTRY_MODE "resultEntryMode",
  1003. TER.RESULT_ENTRY_GATE_TIME "resultEntryGateTime",
  1004. OOM.ORDER_MATERIAL_WEIGHT "orderMaterialWeight",
  1005. RW1.WAREHOUSE_NAME "loadingName",
  1006. RW2.WAREHOUSE_NAME "unloadingName"
  1007. from TMSTRUCK_ENFACTORY_RESULT TER
  1008. left join TMSTRUCK_TOTAL_RESULT TTR
  1009. on TER.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
  1010. LEFT JOIN TMSTRUCK_LOAD_RESULT TLR
  1011. ON TLR.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
  1012. LEFT JOIN TMSTRUCK_UNLOAD_RESULT TUR
  1013. ON TUR.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
  1014. LEFT JOIN RMS_WAREHOUSE RW1
  1015. ON RW1.WAREHOUSE_ID = TLR.LOADING_ID
  1016. LEFT JOIN RMS_WAREHOUSE RW2
  1017. ON RW2.WAREHOUSE_ID = TUR.RESULT_UNLOAD_PLACE_ID
  1018. left join OMSTRUCK_ORDER OO
  1019. on TTR.ORDER_ID = OO.ORDER_ID
  1020. left join RMS_CAPACITY RC
  1021. on RC.CAPACITY_ID = OO.CAPACITY_ID
  1022. left join OMSTRUCK_ORDER_MATERIAL OOM
  1023. on OOM.ORDER_ID = OO.ORDER_ID
  1024. left join RMS_MATERIAL RM
  1025. on RM.MATERIAL_ID = OOM.MATERIAL_ID
  1026. left join RMS_GATEPOST RG
  1027. on RG.GATEPOST_ID = TER.GATEPOST_ID
  1028. where TER.RESULT_ENTRY_GATE_TIME is not null
  1029. and OO.ORDER_TYPE = 11
  1030. )
  1031. <where>
  1032. <if test="materialName != null">
  1033. <foreach collection="materialName" item="item" open="(" separator="or" close=")">
  1034. "materialName" like '%${item}%'
  1035. </foreach>
  1036. </if>
  1037. <if test="loadingName != null">
  1038. and
  1039. <foreach collection="loadingName" item="item" open="(" separator="or" close=")">
  1040. "loadingName" like '%${item}%'
  1041. </foreach>
  1042. </if>
  1043. <if test="orderNumber != null">
  1044. and
  1045. <foreach collection="orderNumber" item="item" open="(" separator="or" close=")">
  1046. "orderNumber" like '%${item}%'
  1047. </foreach>
  1048. </if>
  1049. <if test="capacityNumber != null">
  1050. and
  1051. <foreach collection="capacityNumber" item="item" open="(" separator="or" close=")">
  1052. "capacityNumber" like '%${item}%'
  1053. </foreach>
  1054. </if>
  1055. <if test="unloadingName != null">
  1056. and
  1057. <foreach collection="unloadingName" item="item" open="(" separator="or" close=")">
  1058. "unloadingName" like '%${item}%'
  1059. </foreach>
  1060. </if>
  1061. <if test="resultEntryMode != null">
  1062. and
  1063. <foreach collection="resultEntryMode" item="item" open="(" separator="or" close=")">
  1064. "resultEntryMode" like '%${item}%'
  1065. </foreach>
  1066. </if>
  1067. <if test="orderMaterialWeight != null">
  1068. and
  1069. <foreach collection="orderMaterialWeight" item="item" open="(" separator="or" close=")">
  1070. "orderMaterialWeight" like '%${item}%'
  1071. </foreach>
  1072. </if>
  1073. <if test="loadingName != null">
  1074. and
  1075. <foreach collection="loadingName" item="item" open="(" separator="or" close=")">
  1076. "loadingName" like '%${item}%'
  1077. </foreach>
  1078. </if>
  1079. <if test="resultEntryGateTime != null">
  1080. and
  1081. <foreach collection="resultEntryGateTime" item="item" open="(" separator="or" close=")">
  1082. "resultEntryGateTime" like '%${item}%'
  1083. </foreach>
  1084. </if>
  1085. </where>
  1086. <include refid="orderByEnterTime"></include>
  1087. </select>
  1088. <select id="getBillOrder" parameterType="java.lang.String" resultType="java.util.Map">
  1089. select
  1090. oo.order_number "orderNumber",
  1091. rc.capacity_number "capacityNumber",
  1092. rce.consignee_company_name "consigeeName",
  1093. rcr.carrier_name "carrierName",
  1094. TO_CHAR(SYSDATE,'YYYY-MM-DD') "billDate"
  1095. from omstruck_order oo
  1096. left join
  1097. rms_capacity rc
  1098. on
  1099. rc.capacity_id = oo.capacity_id
  1100. left join
  1101. ams_sale_order_material asom
  1102. on
  1103. asom.sale_order_material_id = oo.order_plan_id
  1104. left join
  1105. ams_sale_order aso
  1106. on
  1107. aso.sale_order_id = asom.sale_order_id
  1108. left join
  1109. rms_consignee rce
  1110. on
  1111. rce.consignee_id = aso.receive_id
  1112. left join
  1113. ams_dispatch_sale_order adso
  1114. on
  1115. adso.sale_order_material_id = asom.sale_order_material_id
  1116. left join
  1117. rms_carrier rcr
  1118. on
  1119. rcr.carrier_id = adso.carrier_id
  1120. where oo.order_number = #{orderNumber}
  1121. </select>
  1122. <select id="getBillOrderMaterial" parameterType="java.lang.String" resultType="java.util.Map" >
  1123. select
  1124. rm.material_name "materialName",
  1125. rm.material_specification "materialSpe",
  1126. rm.material_model "materialModel",
  1127. oom.order_material_number "materialNumber",
  1128. oom.order_material_weight "materialWeight"
  1129. from omstruck_order oo
  1130. left join
  1131. omstruck_order_material oom
  1132. on
  1133. oom.order_id = oo.order_id
  1134. left join
  1135. rms_material rm
  1136. on
  1137. rm.material_id = oom.order_material_id
  1138. where oo.order_number = #{orderNumber}
  1139. </select>
  1140. <!-- 通过id获取零星物资id-->
  1141. <select id="getSporadicSuppliesEnFactoryResult" parameterType="java.util.Map" resultType="java.util.Map">
  1142. select *
  1143. from (
  1144. select TER.RESULT_ID "resultId",
  1145. OO.ORDER_ID "orderId",
  1146. OO.ORDER_NUMBER "orderNumber",
  1147. RC.CAPACITY_NUMBER "capacityNumber",
  1148. RG.GATEPOST_NAME "gatepostName",
  1149. TER.RESULT_ENTRY_MODE "resultEntryMode",
  1150. TER.RESULT_ENTRY_GATE_TIME "resultEntryGateTime",
  1151. RM.MATERIAL_NAME "materialName",
  1152. OOM.ORDER_MATERIAL_NUMBER "materialNumber",
  1153. OOM.ORDER_MATERIAL_WEIGHT "materialWeight",
  1154. TWR.RESULT_NET_WEIGHT "netWeight"
  1155. from TMSTRUCK_ENFACTORY_RESULT TER
  1156. left join TMSTRUCK_TOTAL_RESULT TTR
  1157. on TER.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
  1158. left join TMSTRUCK_WEIGHT_RESULT TWR
  1159. on TWR.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
  1160. left join OMSTRUCK_ORDER OO
  1161. on TTR.ORDER_ID = OO.ORDER_ID
  1162. left join OMSTRUCK_ORDER_MATERIAL OOM
  1163. ON OOM.ORDER_ID=OO.ORDER_ID
  1164. left join RMS_MATERIAL RM
  1165. ON RM.MATERIAL_ID=OOM.MATERIAL_ID
  1166. left join AMSTRUCK_SPORADIC_ORDER ASO
  1167. on OO.ORDER_PLAN_ID = ASO.SPORADIC_ORDER_ID
  1168. left join AMSTRUCK_SPORADIC_MATERIAL ASM
  1169. on ASM.SPORADIC_ORDER_ID=ASO.SPORADIC_ORDER_ID
  1170. left join RMS_GATEPOST RG
  1171. on RG.GATEPOST_ID = TER.GATEPOST_ID
  1172. left join RMS_CAPACITY RC
  1173. on RC.CAPACITY_ID = OO.CAPACITY_ID
  1174. WHERE OO.ORDER_TYPE = #{orderTypee} and TER.RESULT_ENTRY_GATE_TIME IS NOT NULL
  1175. <if test="userId!=null">
  1176. and ASO.INSERT_USERNAME=#{userId}
  1177. </if>
  1178. <if test="userIds!=null">
  1179. and ASO.UPDATE_USERNAME=#{userIds}
  1180. </if>
  1181. <if test="con!=null">
  1182. where "orderNumber" like #{con} or "capacityNumber" like #{con}
  1183. or "gatepostName" like #{con} or "materialName" like #{con}
  1184. </if>
  1185. )
  1186. <where>
  1187. <if test="orderNumber != null">
  1188. and
  1189. <foreach collection="orderNumber" item="item" open="(" separator="or" close=")">
  1190. "orderNumber" like '%${item}%'
  1191. </foreach>
  1192. </if>
  1193. <if test="capacityNumber != null">
  1194. and
  1195. <foreach collection="capacityNumber" item="item" open="(" separator="or" close=")">
  1196. "capacityNumber" like '%${item}%'
  1197. </foreach>
  1198. </if>
  1199. <if test="gatepostName != null">
  1200. and
  1201. <foreach collection="gatepostName" item="item" open="(" separator="or" close=")">
  1202. "capacityNumber" like '%${item}%'
  1203. </foreach>
  1204. </if>
  1205. <if test="gatepostName != null">
  1206. and
  1207. <foreach collection="resultEntryMode" item="item" open="(" separator="or" close=")">
  1208. "resultEntryMode" like '%${item}%'
  1209. </foreach>
  1210. </if>
  1211. <if test="resultEntryGateTime != null">
  1212. and
  1213. <foreach collection="resultEntryGateTime" item="item" open="(" separator="or" close=")">
  1214. "resultEntryGateTime" like '%${item}%'
  1215. </foreach>
  1216. </if>
  1217. </where>
  1218. <include refid="orderByEnterTime"></include>
  1219. </select>
  1220. <select id="getCGNZEnFactory" resultType="java.util.Map" parameterType="map">
  1221. select
  1222. *
  1223. from(
  1224. select TER.RESULT_ID "resultId",
  1225. APO.PURCHASE_ORDER_NO "purchaseOrderNo",
  1226. RM.MATERIAL_NAME "materialName",
  1227. OO.ORDER_NUMBER "orderNumber",
  1228. RC.CAPACITY_NUMBER "capacityNumber",
  1229. RG.GATEPOST_NAME "gatepostName",
  1230. TER.RESULT_ENTRY_MODE "resultEntryMode",
  1231. TER.RESULT_ENTRY_GATE_TIME "resultEntryGateTime",
  1232. RS.SUPPLIER_NAME "supplierName",
  1233. TER.INSERT_TIME "insertTime",
  1234. RCON.CONSIGNEE_COMPANY_NAME "consigneeCompanyName"
  1235. from TMSTRUCK_ENFACTORY_RESULT TER
  1236. left join TMSTRUCK_TOTAL_RESULT TTR
  1237. on TER.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
  1238. left join OMSTRUCK_ORDER OO
  1239. on TTR.ORDER_ID = OO.ORDER_ID
  1240. left join amstruck_inward_plan aip
  1241. on aip.plan_id = oo.order_plan_id
  1242. left join amstruck_requirement_plan arp
  1243. on arp.plan_id = aip.plan_id
  1244. left join amstruck_inward_requirement air
  1245. on air.requirement_id = arp.requirement_id
  1246. left join AMS_PURCHASE_ORDER APO
  1247. on apo.purchase_order_id = air.purchase_order_id
  1248. left join DIL_BATCH DB
  1249. on DB.BATCH_ID = APO.BATCH_ID
  1250. left join RMS_CAPACITY RC
  1251. on RC.CAPACITY_ID = OO.CAPACITY_ID
  1252. left join RMS_SUPPLIER RS
  1253. on RS.SUPPLIER_ID = APO.SUPPLIER_UNIT_ID
  1254. left join RMS_CONSIGNEE RCON
  1255. on RCON.CONSIGNEE_ID = APO.RECEIVE_UNIT_ID
  1256. left join OMSTRUCK_ORDER_MATERIAL OOM
  1257. on OOM.ORDER_ID = OO.ORDER_ID
  1258. left join RMS_MATERIAL RM
  1259. on RM.MATERIAL_ID = OOM.MATERIAL_ID
  1260. left join RMS_GATEPOST RG
  1261. on RG.GATEPOST_ID = TER.GATEPOST_ID
  1262. where TER.RESULT_ENTRY_GATE_TIME is not null
  1263. and OO.ORDER_TYPE = 10
  1264. <if test="userId">
  1265. and air.INSERT_USERNAME=#{userId}
  1266. </if>
  1267. )
  1268. <where>
  1269. <if test="purchaseOrderId != null">
  1270. <foreach collection="purchaseOrderId" item="item" open="(" separator="or" close=")">
  1271. "purchaseOrderId" like '%${item}%'
  1272. </foreach>
  1273. </if>
  1274. <if test="materialName != null">
  1275. and
  1276. <foreach collection="materialName" item="item" open="(" separator="or" close=")">
  1277. "materialName" like '%${item}%'
  1278. </foreach>
  1279. </if>
  1280. <if test="resultForeignShipName != null">
  1281. and
  1282. <foreach collection="resultForeignShipName" item="item" open="(" separator="or" close=")">
  1283. "resultForeignShipName" like '%${item}%'
  1284. </foreach>
  1285. </if>
  1286. <if test="orderNumber != null">
  1287. and
  1288. <foreach collection="orderNumber" item="item" open="(" separator="or" close=")">
  1289. "orderNumber" like '%${item}%'
  1290. </foreach>
  1291. </if>
  1292. <if test="capacityNumber != null">
  1293. and
  1294. <foreach collection="capacityNumber" item="item" open="(" separator="or" close=")">
  1295. "capacityNumber" like '%${item}%'
  1296. </foreach>
  1297. </if>
  1298. <if test="warehouseName != null">
  1299. and
  1300. <foreach collection="warehouseName" item="item" open="(" separator="or" close=")">
  1301. "warehouseName" like '%${item}%'
  1302. </foreach>
  1303. </if>
  1304. <if test="resultEntryMode != null">
  1305. and
  1306. <foreach collection="resultEntryMode" item="item" open="(" separator="or" close=")">
  1307. "resultEntryMode" like '%${item}%'
  1308. </foreach>
  1309. </if>
  1310. <if test="supplierName != null">
  1311. and
  1312. <foreach collection="supplierName" item="item" open="(" separator="or" close=")">
  1313. "supplierName" like '%${item}%'
  1314. </foreach>
  1315. </if>
  1316. <if test="orderMaterialWeight != null">
  1317. and
  1318. <foreach collection="orderMaterialWeight" item="item" open="(" separator="or" close=")">
  1319. "orderMaterialWeight" like '%${item}%'
  1320. </foreach>
  1321. </if>
  1322. </where>
  1323. <include refid="orderByEnterTime"></include>
  1324. </select>
  1325. <select id="getCgNzOutFactory" resultType="java.util.Map">
  1326. select TLFR.RESULT_ID "resultId",
  1327. APO.PURCHASE_ORDER_NO "purchaseOrderNo",
  1328. RM.MATERIAL_NAME "materialName",
  1329. OO.ORDER_NUMBER "orderNumber",
  1330. RC.CAPACITY_NUMBER "capacityNumber",
  1331. RG.GATEPOST_NAME "gatepostName",
  1332. TLFR.RESULT_OUT_MODE "resultOutMode",
  1333. TLFR.RESULT_OUT_GATE_TIME "resultOutGateTime",
  1334. TLFR.RESULT_TRUCK_SNAPSHOT_PICTURE "resultTruckSnapshotPicture"
  1335. from TMSTRUCK_LEAVE_FACTORY_RESULT TLFR
  1336. left join TMSTRUCK_TOTAL_RESULT TTR
  1337. on TTR.RESULT_TOTAL_ID = TLFR.RESULT_TOTAL_ID
  1338. left join OMSTRUCK_ORDER OO
  1339. on OO.ORDER_ID = TTR.ORDER_ID
  1340. left join amstruck_inward_plan aip
  1341. on aip.plan_id = oo.order_plan_id
  1342. left join amstruck_requirement_plan arp
  1343. on arp.plan_id = aip.plan_id
  1344. left join amstruck_inward_requirement air
  1345. on air.requirement_id = arp.requirement_id
  1346. left join AMS_PURCHASE_ORDER APO
  1347. on APO.PURCHASE_ORDER_ID = air.PURCHASE_ORDER_ID
  1348. left join DIL_BATCH DB
  1349. on DB.BATCH_ID = APO.BATCH_ID
  1350. left join OMSTRUCK_ORDER_MATERIAL OOM
  1351. on OOM.ORDER_ID = OO.ORDER_ID
  1352. left join RMS_MATERIAL RM
  1353. on RM.MATERIAL_ID = OOM.MATERIAL_ID
  1354. left join RMS_CAPACITY RC
  1355. on RC.CAPACITY_ID = OO.CAPACITY_ID
  1356. left join RMS_GATEPOST RG
  1357. on RG.GATEPOST_ID = TLFR.GATEPOST_ID
  1358. where RESULT_OUT_GATE_TIME is not null
  1359. and OO.ORDER_TYPE = 10
  1360. <if test="userId !=null">
  1361. and AIR.INSERT_USERNAME = #{userId}
  1362. </if>
  1363. order by tlfr.result_out_gate_time desc
  1364. <where>
  1365. <if test="capacityNumber != null">
  1366. <foreach collection="capacityNumber" item="item" open="(" separator="or" close=")">
  1367. "capacityNumber" like '%${item}%'
  1368. </foreach>
  1369. </if>
  1370. <if test="materialName != null">
  1371. <foreach collection="materialName" item="item" open="(" separator="or" close=")">
  1372. "materialName" like '%${item}%'
  1373. </foreach>
  1374. </if>
  1375. <if test="gatepostName != null">
  1376. <foreach collection="gatepostName" item="item" open="(" separator="or" close=")">
  1377. "gatepostName" like '%${item}%'
  1378. </foreach>
  1379. </if>
  1380. </where>
  1381. </select>
  1382. </mapper>