TmstruckEnfactoryResultMapper.xml 62 KB

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