TmstruckLeaveFactoryResultMapper.xml 56 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218
  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.TmstruckLeaveFactoryResultMapper">
  4. <resultMap id="BaseResultMap" type="com.steerinfo.dil.model.TmstruckLeaveFactoryResult">
  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_OUT_MODE" jdbcType="VARCHAR" property="resultOutMode" />
  9. <result column="RESULT_OUT_GATE_TIME" jdbcType="TIMESTAMP" property="resultOutGateTime" />
  10. <result column="INSERT_USERNAME" jdbcType="VARCHAR" property="insertUsername" />
  11. <result column="INSERT_TIME" jdbcType="TIMESTAMP" property="insertTime" />
  12. <result column="UPDATE_USERNAME" jdbcType="VARCHAR" property="updateUsername" />
  13. <result column="UPDATE_TIME" jdbcType="TIMESTAMP" property="updateTime" />
  14. <result column="INSERT_UPDATE_REMARK" jdbcType="VARCHAR" property="insertUpdateRemark" />
  15. <result column="DELETE_USERNAME" jdbcType="VARCHAR" property="deleteUsername" />
  16. <result column="DELETE_TIME" jdbcType="TIMESTAMP" property="deleteTime" />
  17. <result column="SEGMENT_SQE" jdbcType="DECIMAL" property="segmentSqe" />
  18. <result column="RESULT_TRUCK_SNAPSHOT_PICTURE" jdbcType="BLOB" property="resultTruckSnapshotPicture" />
  19. </resultMap>
  20. <sql id="columns">
  21. RESULT_ID, RESULT_TOTAL_ID, GATEPOST_ID, RESULT_OUT_MODE, RESULT_OUT_GATE_TIME, INSERT_USERNAME,
  22. INSERT_TIME, UPDATE_USERNAME, UPDATE_TIME, INSERT_UPDATE_REMARK, DELETE_USERNAME,
  23. DELETE_TIME, SEGMENT_SQE, RESULT_TRUCK_SNAPSHOT_PICTURE
  24. </sql>
  25. <sql id="columns_alias">
  26. t.RESULT_ID, t.RESULT_TOTAL_ID, t.GATEPOST_ID, t.RESULT_OUT_MODE, t.RESULT_OUT_GATE_TIME,
  27. t.INSERT_USERNAME, t.INSERT_TIME, t.UPDATE_USERNAME, t.UPDATE_TIME, t.INSERT_UPDATE_REMARK,
  28. t.DELETE_USERNAME, t.DELETE_TIME, t.SEGMENT_SQE, t.RESULT_TRUCK_SNAPSHOT_PICTURE
  29. </sql>
  30. <sql id="select">
  31. SELECT <include refid="columns"/> FROM TMSTRUCK_LEAVE_FACTORY_RESULT
  32. </sql>
  33. <sql id="select_alias">
  34. SELECT <include refid="columns_alias"/> FROM TMSTRUCK_LEAVE_FACTORY_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="resultOutMode != null and resultOutMode != ''">
  48. and RESULT_OUT_MODE = #{resultOutMode}
  49. </if>
  50. <if test="resultOutGateTime != null">
  51. and TO_CHAR(RESULT_OUT_GATE_TIME,'yyyy-MM-dd') = #{resultOutGateTime}
  52. </if>
  53. <if test="insertUsername != null and insertUsername != ''">
  54. and INSERT_USERNAME = #{insertUsername}
  55. </if>
  56. <if test="insertTime != null">
  57. and TO_CHAR(INSERT_TIME,'yyyy-MM-dd') = #{insertTime}
  58. </if>
  59. <if test="updateUsername != null and updateUsername != ''">
  60. and UPDATE_USERNAME = #{updateUsername}
  61. </if>
  62. <if test="updateTime != null">
  63. and TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = #{updateTime}
  64. </if>
  65. <if test="insertUpdateRemark != null and insertUpdateRemark != ''">
  66. and INSERT_UPDATE_REMARK = #{insertUpdateRemark}
  67. </if>
  68. <if test="deleteUsername != null and deleteUsername != ''">
  69. and DELETE_USERNAME = #{deleteUsername}
  70. </if>
  71. <if test="deleteTime != null">
  72. and TO_CHAR(DELETE_TIME,'yyyy-MM-dd') = #{deleteTime}
  73. </if>
  74. <if test="segmentSqe != null">
  75. and SEGMENT_SQE = #{segmentSqe}
  76. </if>
  77. <if test="resultTruckSnapshotPicture != null">
  78. and RESULT_TRUCK_SNAPSHOT_PICTURE = #{resultTruckSnapshotPicture}
  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="resultOutMode != null and resultOutMode != ''">
  94. and RESULT_OUT_MODE LIKE '%${resultOutMode}%'
  95. </if>
  96. <if test="resultOutGateTime != null">
  97. and TO_CHAR(RESULT_OUT_GATE_TIME,'yyyy-MM-dd') = #{resultOutGateTime}
  98. </if>
  99. <if test="insertUsername != null and insertUsername != ''">
  100. and INSERT_USERNAME LIKE '%${insertUsername}%'
  101. </if>
  102. <if test="insertTime != null">
  103. and TO_CHAR(INSERT_TIME,'yyyy-MM-dd') = #{insertTime}
  104. </if>
  105. <if test="updateUsername != null and updateUsername != ''">
  106. and UPDATE_USERNAME LIKE '%${updateUsername}%'
  107. </if>
  108. <if test="updateTime != null">
  109. and TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = #{updateTime}
  110. </if>
  111. <if test="insertUpdateRemark != null and insertUpdateRemark != ''">
  112. and INSERT_UPDATE_REMARK LIKE '%${insertUpdateRemark}%'
  113. </if>
  114. <if test="deleteUsername != null and deleteUsername != ''">
  115. and DELETE_USERNAME LIKE '%${deleteUsername}%'
  116. </if>
  117. <if test="deleteTime != null">
  118. and TO_CHAR(DELETE_TIME,'yyyy-MM-dd') = #{deleteTime}
  119. </if>
  120. <if test="segmentSqe != null">
  121. and SEGMENT_SQE = #{segmentSqe}
  122. </if>
  123. <if test="resultTruckSnapshotPicture != null">
  124. and RESULT_TRUCK_SNAPSHOT_PICTURE = #{resultTruckSnapshotPicture}
  125. </if>
  126. </where>
  127. </sql>
  128. <delete id="deleteByPrimaryKey" parameterType="java.math.BigDecimal">
  129. delete from TMSTRUCK_LEAVE_FACTORY_RESULT
  130. where RESULT_ID = #{resultId,jdbcType=DECIMAL}
  131. </delete>
  132. <delete id="deleteBySelectiveElement" parameterType="java.util.HashMap">
  133. delete from TMSTRUCK_LEAVE_FACTORY_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="resultOutMode != null and resultOutMode != ''">
  142. or RESULT_OUT_MODE = #{resultOutMode}
  143. </if>
  144. <if test="resultOutGateTime != null">
  145. or TO_CHAR(RESULT_OUT_GATE_TIME,'yyyy-MM-dd') = '#{resultOutGateTime}'
  146. </if>
  147. <if test="insertUsername != null and insertUsername != ''">
  148. or INSERT_USERNAME = #{insertUsername}
  149. </if>
  150. <if test="insertTime != null">
  151. or TO_CHAR(INSERT_TIME,'yyyy-MM-dd') = '#{insertTime}'
  152. </if>
  153. <if test="updateUsername != null and updateUsername != ''">
  154. or UPDATE_USERNAME = #{updateUsername}
  155. </if>
  156. <if test="updateTime != null">
  157. or TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = '#{updateTime}'
  158. </if>
  159. <if test="insertUpdateRemark != null and insertUpdateRemark != ''">
  160. or INSERT_UPDATE_REMARK = #{insertUpdateRemark}
  161. </if>
  162. <if test="deleteUsername != null and deleteUsername != ''">
  163. or DELETE_USERNAME = #{deleteUsername}
  164. </if>
  165. <if test="deleteTime != null">
  166. or TO_CHAR(DELETE_TIME,'yyyy-MM-dd') = '#{deleteTime}'
  167. </if>
  168. <if test="segmentSqe != null">
  169. or SEGMENT_SQE = #{segmentSqe}
  170. </if>
  171. <if test="resultTruckSnapshotPicture != null">
  172. or RESULT_TRUCK_SNAPSHOT_PICTURE = #{resultTruckSnapshotPicture}
  173. </if>
  174. </delete>
  175. <insert id="insert" parameterType="com.steerinfo.dil.model.TmstruckLeaveFactoryResult">
  176. insert into TMSTRUCK_LEAVE_FACTORY_RESULT (RESULT_ID, RESULT_TOTAL_ID, GATEPOST_ID,
  177. RESULT_OUT_MODE, RESULT_OUT_GATE_TIME, INSERT_USERNAME,
  178. INSERT_TIME, UPDATE_USERNAME, UPDATE_TIME,
  179. INSERT_UPDATE_REMARK, DELETE_USERNAME, DELETE_TIME,
  180. SEGMENT_SQE, RESULT_TRUCK_SNAPSHOT_PICTURE)
  181. values (#{resultId,jdbcType=DECIMAL}, #{resultTotalId,jdbcType=DECIMAL}, #{gatepostId,jdbcType=DECIMAL},
  182. #{resultOutMode,jdbcType=VARCHAR}, #{resultOutGateTime,jdbcType=TIMESTAMP}, #{insertUsername,jdbcType=VARCHAR},
  183. #{insertTime,jdbcType=TIMESTAMP}, #{updateUsername,jdbcType=VARCHAR}, #{updateTime,jdbcType=TIMESTAMP},
  184. #{insertUpdateRemark,jdbcType=VARCHAR}, #{deleteUsername,jdbcType=VARCHAR}, #{deleteTime,jdbcType=TIMESTAMP},
  185. #{segmentSqe,jdbcType=DECIMAL}, #{resultTruckSnapshotPicture,jdbcType=BLOB})
  186. </insert>
  187. <insert id="insertSelective" parameterType="com.steerinfo.dil.model.TmstruckLeaveFactoryResult">
  188. insert into TMSTRUCK_LEAVE_FACTORY_RESULT
  189. <trim prefix="(" suffix=")" suffixOverrides=",">
  190. <if test="resultId != null">
  191. RESULT_ID,
  192. </if>
  193. <if test="resultTotalId != null">
  194. RESULT_TOTAL_ID,
  195. </if>
  196. <if test="gatepostId != null">
  197. GATEPOST_ID,
  198. </if>
  199. <if test="resultOutMode != null">
  200. RESULT_OUT_MODE,
  201. </if>
  202. <if test="resultOutGateTime != null">
  203. RESULT_OUT_GATE_TIME,
  204. </if>
  205. <if test="insertUsername != null">
  206. INSERT_USERNAME,
  207. </if>
  208. <if test="insertTime != null">
  209. INSERT_TIME,
  210. </if>
  211. <if test="updateUsername != null">
  212. UPDATE_USERNAME,
  213. </if>
  214. <if test="updateTime != null">
  215. UPDATE_TIME,
  216. </if>
  217. <if test="insertUpdateRemark != null">
  218. INSERT_UPDATE_REMARK,
  219. </if>
  220. <if test="deleteUsername != null">
  221. DELETE_USERNAME,
  222. </if>
  223. <if test="deleteTime != null">
  224. DELETE_TIME,
  225. </if>
  226. <if test="segmentSqe != null">
  227. SEGMENT_SQE,
  228. </if>
  229. <if test="resultTruckSnapshotPicture != null">
  230. RESULT_TRUCK_SNAPSHOT_PICTURE,
  231. </if>
  232. </trim>
  233. <trim prefix="values (" suffix=")" suffixOverrides=",">
  234. <if test="resultId != null">
  235. #{resultId,jdbcType=DECIMAL},
  236. </if>
  237. <if test="resultTotalId != null">
  238. #{resultTotalId,jdbcType=DECIMAL},
  239. </if>
  240. <if test="gatepostId != null">
  241. #{gatepostId,jdbcType=DECIMAL},
  242. </if>
  243. <if test="resultOutMode != null">
  244. #{resultOutMode,jdbcType=VARCHAR},
  245. </if>
  246. <if test="resultOutGateTime != null">
  247. #{resultOutGateTime,jdbcType=TIMESTAMP},
  248. </if>
  249. <if test="insertUsername != null">
  250. #{insertUsername,jdbcType=VARCHAR},
  251. </if>
  252. <if test="insertTime != null">
  253. #{insertTime,jdbcType=TIMESTAMP},
  254. </if>
  255. <if test="updateUsername != null">
  256. #{updateUsername,jdbcType=VARCHAR},
  257. </if>
  258. <if test="updateTime != null">
  259. #{updateTime,jdbcType=TIMESTAMP},
  260. </if>
  261. <if test="insertUpdateRemark != null">
  262. #{insertUpdateRemark,jdbcType=VARCHAR},
  263. </if>
  264. <if test="deleteUsername != null">
  265. #{deleteUsername,jdbcType=VARCHAR},
  266. </if>
  267. <if test="deleteTime != null">
  268. #{deleteTime,jdbcType=TIMESTAMP},
  269. </if>
  270. <if test="segmentSqe != null">
  271. #{segmentSqe,jdbcType=DECIMAL},
  272. </if>
  273. <if test="resultTruckSnapshotPicture != null">
  274. #{resultTruckSnapshotPicture,jdbcType=BLOB},
  275. </if>
  276. </trim>
  277. </insert>
  278. <update id="updateByPrimaryKey" parameterType="com.steerinfo.dil.model.TmstruckLeaveFactoryResult">
  279. update TMSTRUCK_LEAVE_FACTORY_RESULT
  280. set RESULT_TOTAL_ID = #{resultTotalId,jdbcType=DECIMAL},
  281. GATEPOST_ID = #{gatepostId,jdbcType=DECIMAL},
  282. RESULT_OUT_MODE = #{resultOutMode,jdbcType=VARCHAR},
  283. RESULT_OUT_GATE_TIME = #{resultOutGateTime,jdbcType=TIMESTAMP},
  284. INSERT_USERNAME = #{insertUsername,jdbcType=VARCHAR},
  285. INSERT_TIME = #{insertTime,jdbcType=TIMESTAMP},
  286. UPDATE_USERNAME = #{updateUsername,jdbcType=VARCHAR},
  287. UPDATE_TIME = #{updateTime,jdbcType=TIMESTAMP},
  288. INSERT_UPDATE_REMARK = #{insertUpdateRemark,jdbcType=VARCHAR},
  289. DELETE_USERNAME = #{deleteUsername,jdbcType=VARCHAR},
  290. DELETE_TIME = #{deleteTime,jdbcType=TIMESTAMP},
  291. SEGMENT_SQE = #{segmentSqe,jdbcType=DECIMAL},
  292. RESULT_TRUCK_SNAPSHOT_PICTURE = #{resultTruckSnapshotPicture,jdbcType=BLOB}
  293. where RESULT_ID = #{resultId,jdbcType=DECIMAL}
  294. </update>
  295. <update id="updateByPrimaryKeySelective" parameterType="com.steerinfo.dil.model.TmstruckLeaveFactoryResult">
  296. update TMSTRUCK_LEAVE_FACTORY_RESULT
  297. <set>
  298. <if test="resultTotalId != null">
  299. RESULT_TOTAL_ID = #{resultTotalId,jdbcType=DECIMAL},
  300. </if>
  301. <if test="gatepostId != null">
  302. GATEPOST_ID = #{gatepostId,jdbcType=DECIMAL},
  303. </if>
  304. <if test="resultOutMode != null">
  305. RESULT_OUT_MODE = #{resultOutMode,jdbcType=VARCHAR},
  306. </if>
  307. <if test="resultOutGateTime != null">
  308. RESULT_OUT_GATE_TIME = #{resultOutGateTime,jdbcType=TIMESTAMP},
  309. </if>
  310. <if test="insertUsername != null">
  311. INSERT_USERNAME = #{insertUsername,jdbcType=VARCHAR},
  312. </if>
  313. <if test="insertTime != null">
  314. INSERT_TIME = #{insertTime,jdbcType=TIMESTAMP},
  315. </if>
  316. <if test="updateUsername != null">
  317. UPDATE_USERNAME = #{updateUsername,jdbcType=VARCHAR},
  318. </if>
  319. <if test="updateTime != null">
  320. UPDATE_TIME = #{updateTime,jdbcType=TIMESTAMP},
  321. </if>
  322. <if test="insertUpdateRemark != null">
  323. INSERT_UPDATE_REMARK = #{insertUpdateRemark,jdbcType=VARCHAR},
  324. </if>
  325. <if test="deleteUsername != null">
  326. DELETE_USERNAME = #{deleteUsername,jdbcType=VARCHAR},
  327. </if>
  328. <if test="deleteTime != null">
  329. DELETE_TIME = #{deleteTime,jdbcType=TIMESTAMP},
  330. </if>
  331. <if test="segmentSqe != null">
  332. SEGMENT_SQE = #{segmentSqe,jdbcType=DECIMAL},
  333. </if>
  334. <if test="resultTruckSnapshotPicture != null">
  335. RESULT_TRUCK_SNAPSHOT_PICTURE = #{resultTruckSnapshotPicture,jdbcType=BLOB},
  336. </if>
  337. </set>
  338. where RESULT_ID = #{resultId,jdbcType=DECIMAL}
  339. </update>
  340. <select id="selectByPrimaryKey" parameterType="java.math.BigDecimal" resultMap="BaseResultMap">
  341. <include refid="select"/>
  342. where RESULT_ID = #{resultId,jdbcType=DECIMAL}
  343. </select>
  344. <select id="selectByParameters" parameterType="java.util.HashMap" resultMap="BaseResultMap">
  345. <include refid="select"/>
  346. <include refid="where"/>
  347. </select>
  348. <select id="selectLikeByParameters" parameterType="java.util.HashMap" resultMap="BaseResultMap">
  349. <include refid="select"/>
  350. <include refid="whereLike"/>
  351. </select>
  352. <insert id="batchInsert" parameterType="java.util.List">
  353. insert into TMSTRUCK_LEAVE_FACTORY_RESULT
  354. (RESULT_ID,
  355. RESULT_TOTAL_ID, GATEPOST_ID, RESULT_OUT_MODE,
  356. RESULT_OUT_GATE_TIME, INSERT_USERNAME,
  357. INSERT_TIME, UPDATE_USERNAME,
  358. UPDATE_TIME, INSERT_UPDATE_REMARK,
  359. DELETE_USERNAME, DELETE_TIME,
  360. SEGMENT_SQE, RESULT_TRUCK_SNAPSHOT_PICTURE
  361. )
  362. ( <foreach collection="list" item="item" separator="union all">
  363. select
  364. #{item.resultId,jdbcType=DECIMAL},
  365. #{item.resultTotalId,jdbcType=DECIMAL}, #{item.gatepostId,jdbcType=DECIMAL}, #{item.resultOutMode,jdbcType=VARCHAR},
  366. #{item.resultOutGateTime,jdbcType=TIMESTAMP}, #{item.insertUsername,jdbcType=VARCHAR},
  367. #{item.insertTime,jdbcType=TIMESTAMP}, #{item.updateUsername,jdbcType=VARCHAR},
  368. #{item.updateTime,jdbcType=TIMESTAMP}, #{item.insertUpdateRemark,jdbcType=VARCHAR},
  369. #{item.deleteUsername,jdbcType=VARCHAR}, #{item.deleteTime,jdbcType=TIMESTAMP},
  370. #{item.segmentSqe,jdbcType=DECIMAL}, #{item.resultTruckSnapshotPicture,jdbcType=BLOB}
  371. from dual
  372. </foreach> )
  373. </insert>
  374. <update id="batchUpdate" parameterType="java.util.List">
  375. update TMSTRUCK_LEAVE_FACTORY_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_OUT_MODE=
  390. <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
  391. when #{item.resultId,jdbcType=DECIMAL} then #{item.resultOutMode,jdbcType=VARCHAR}
  392. </foreach>
  393. ,RESULT_OUT_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.resultOutGateTime,jdbcType=TIMESTAMP}
  396. </foreach>
  397. ,INSERT_USERNAME=
  398. <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
  399. when #{item.resultId,jdbcType=DECIMAL} then #{item.insertUsername,jdbcType=VARCHAR}
  400. </foreach>
  401. ,INSERT_TIME=
  402. <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
  403. when #{item.resultId,jdbcType=DECIMAL} then #{item.insertTime,jdbcType=TIMESTAMP}
  404. </foreach>
  405. ,UPDATE_USERNAME=
  406. <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
  407. when #{item.resultId,jdbcType=DECIMAL} then #{item.updateUsername,jdbcType=VARCHAR}
  408. </foreach>
  409. ,UPDATE_TIME=
  410. <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
  411. when #{item.resultId,jdbcType=DECIMAL} then #{item.updateTime,jdbcType=TIMESTAMP}
  412. </foreach>
  413. ,INSERT_UPDATE_REMARK=
  414. <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
  415. when #{item.resultId,jdbcType=DECIMAL} then #{item.insertUpdateRemark,jdbcType=VARCHAR}
  416. </foreach>
  417. ,DELETE_USERNAME=
  418. <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
  419. when #{item.resultId,jdbcType=DECIMAL} then #{item.deleteUsername,jdbcType=VARCHAR}
  420. </foreach>
  421. ,DELETE_TIME=
  422. <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
  423. when #{item.resultId,jdbcType=DECIMAL} then #{item.deleteTime,jdbcType=TIMESTAMP}
  424. </foreach>
  425. ,SEGMENT_SQE=
  426. <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
  427. when #{item.resultId,jdbcType=DECIMAL} then #{item.segmentSqe,jdbcType=DECIMAL}
  428. </foreach>
  429. ,RESULT_TRUCK_SNAPSHOT_PICTURE=
  430. <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
  431. when #{item.resultId,jdbcType=DECIMAL} then #{item.resultTruckSnapshotPicture,jdbcType=BLOB}
  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_LEAVE_FACTORY_RESULT
  440. where RESULT_ID in
  441. <foreach collection="list" item="id" open="(" close=")" separator=",">
  442. #{id}
  443. </foreach>
  444. </delete>
  445. <!-- 友情提示!!!-->
  446. <!-- 请将自己写的代码放在此标签之下,方便以后粘贴复制。-->
  447. <sql id="orderByOutTime">
  448. <if test="orderField != null and orderField != ''">
  449. order by "${orderField}"
  450. <if test="orderType != null and orderType != ''">
  451. ${orderType}
  452. </if>
  453. </if>
  454. <if test="orderField == null ">
  455. order by "resultOutGateTime" desc
  456. </if>
  457. </sql>
  458. <!-- 查询采购所有的出厂实绩 -->
  459. <select id="getCGLeaveFactoryResult" parameterType="java.util.Map" resultType="java.util.LinkedHashMap">
  460. select *
  461. from (
  462. select
  463. TLFR.RESULT_ID "resultId",
  464. APO.PURCHASE_ORDER_NO "purchaseOrderNo",
  465. RM.MATERIAL_NAME "materialName",
  466. DB.RESULT_FOREIGN_SHIP_NAME "resultForeignShipName",
  467. OO.ORDER_NUMBER "orderNumber",
  468. RC.CAPACITY_NUMBER "capacityNumber",
  469. RG.GATEPOST_NAME "gatepostName",
  470. TLFR.RESULT_OUT_MODE "resultOutMode",
  471. TLFR.RESULT_OUT_GATE_TIME "resultOutGateTime",
  472. TLFR.RESULT_TRUCK_SNAPSHOT_PICTURE "resultTruckSnapshotPicture"
  473. from TMSTRUCK_LEAVE_FACTORY_RESULT TLFR
  474. left join TMSTRUCK_TOTAL_RESULT TTR
  475. on TTR.RESULT_TOTAL_ID = TLFR.RESULT_TOTAL_ID
  476. left join OMSTRUCK_ORDER OO
  477. on OO.ORDER_ID = TTR.ORDER_ID
  478. left join AMS_PURCHASE_ORDER APO
  479. on APO.PURCHASE_ORDER_ID = OO.ORDER_PLAN_ID
  480. left join DIL_BATCH DB
  481. on DB.BATCH_ID = APO.BATCH_ID
  482. left join OMSTRUCK_ORDER_MATERIAL OOM
  483. on OOM.ORDER_ID = OO.ORDER_ID
  484. left join RMS_MATERIAL RM
  485. on RM.MATERIAL_ID = OOM.MATERIAL_ID
  486. left join RMS_CAPACITY RC
  487. on RC.CAPACITY_ID = OO.CAPACITY_ID
  488. left join RMS_GATEPOST RG
  489. on RG.GATEPOST_ID = TLFR.GATEPOST_ID
  490. where RESULT_OUT_GATE_TIME is not null and OO.ORDER_TYPE = #{orderTypee}
  491. )
  492. <where>
  493. <if test="purchaseOrderNo != null">
  494. <foreach collection="purchaseOrderNo" item="item" open="(" separator="or" close=")">
  495. "purchaseOrderNo" like '%${item}%'
  496. </foreach>
  497. </if>
  498. <if test="materialName != null">
  499. and
  500. <foreach collection="materialName" item="item" open="(" separator="or" close=")">
  501. "materialName" like '%${item}%'
  502. </foreach>
  503. </if>
  504. <if test="resultForeignShipName != null">
  505. and
  506. <foreach collection="resultForeignShipName" item="item" open="(" separator="or" close=")">
  507. "resultForeignShipName" like '%${item}%'
  508. </foreach>
  509. </if>
  510. <if test="orderNumber != null">
  511. and
  512. <foreach collection="orderNumber" item="item" open="(" separator="or" close=")">
  513. "orderNumber" like '%${item}%'
  514. </foreach>
  515. </if>
  516. <if test="capacityNumber != null">
  517. and
  518. <foreach collection="capacityNumber" item="item" open="(" separator="or" close=")">
  519. "capacityNumber" like '%${item}%'
  520. </foreach>
  521. </if>
  522. <if test="gatepostName != null">
  523. and
  524. <foreach collection="gatepostName" item="item" open="(" separator="or" close=")">
  525. "gatepostName" like '%${item}%'
  526. </foreach>
  527. </if>
  528. <if test="resultOutMode != null">
  529. and
  530. <foreach collection="resultOutMode" item="item" open="(" separator="or" close=")">
  531. "resultOutMode" like '%${item}%'
  532. </foreach>
  533. </if>
  534. <if test="resultOutGateTime != null">
  535. and
  536. <foreach collection="resultOutGateTime" item="item" open="(" separator="or" close=")">
  537. "resultOutGateTime" like '%${item}%'
  538. </foreach>
  539. </if>
  540. <if test="resultTruckSnapshotPicture != null">
  541. and
  542. <foreach collection="resultTruckSnapshotPicture" item="item" open="(" separator="or" close=")">
  543. "resultTruckSnapshotPicture" like '%${item}%'
  544. </foreach>
  545. </if>
  546. </where>
  547. <include refid="orderByOutTime"></include>
  548. </select>
  549. <!-- 通过运输订单号查询 路段顺序号是否为 4 :已计皮-->
  550. <select id="selectTransportRoute" parameterType="string" resultType="int">
  551. select ORDER_LINE_SEQUENCE
  552. from OMSTRUCK_ORDER
  553. where ORDER_NUMBER = #{orderNumber}
  554. </select>
  555. <!-- 通过运输订单号查询 出厂门岗ID 和 实绩ID -->
  556. <select id="selectCnAndGnByOrderNumber" parameterType="string" resultType="java.util.Map">
  557. select RL.LINE_END_NODE_ID "lineEndNodeId",
  558. TTR.RESULT_TOTAL_ID "resultTotalId"
  559. from OMSTRUCK_ORDER OO
  560. left join TMSTRUCK_TOTAL_RESULT TTR
  561. on TTR.ORDER_ID = OO.ORDER_ID
  562. left join RMS_LINE RL
  563. on RL.LINE_ID = OO.LINE_ID
  564. where OO.ORDER_NUMBER = #{orderNumber}
  565. </select>
  566. <!-- 通过运输订单号获取实绩ID -->
  567. <select id="selectResultId" parameterType="string" resultType="java.util.Map">
  568. select *
  569. from (
  570. select TLFR.RESULT_ID "resultId",
  571. OO.ORDER_ID "orderId",
  572. OO.ORDER_TYPE "orderTypee",
  573. TTR.RESULT_TOTAL_ID "resultTotalId",
  574. OO.CAPACITY_ID "capacityId",
  575. RC.CAPACITY_NUMBER "capacityNumber",
  576. TLFR.SEGMENT_SQE "segmentSqe"
  577. from OMSTRUCK_ORDER OO
  578. left join TMSTRUCK_TOTAL_RESULT TTR
  579. on OO.ORDER_ID = TTR.ORDER_ID
  580. left join TMSTRUCK_LEAVE_FACTORY_RESULT TLFR
  581. on TLFR.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
  582. left join RMS_CAPACITY RC
  583. on RC.CAPACITY_ID = OO.CAPACITY_ID
  584. where OO.ORDER_NUMBER = #{orderNumber} and TLFR.RESULT_OUT_GATE_TIME is null
  585. order by TLFR.SEGMENT_SQE
  586. )
  587. where rownum = 1
  588. </select>
  589. <!--销售物流查询所有的出厂实绩-->
  590. <select id="selectAllLeaveFacatoryForSale" resultType="java.util.Map">
  591. SELECT
  592. *
  593. FROM
  594. (
  595. SELECT
  596. -- 出厂时间
  597. TLFR.RESULT_OUT_GATE_TIME "resultOutGateTime",
  598. --出厂抓拍图片
  599. TLFR.RESULT_TRUCK_SNAPSHOT_PICTURE "resultTruckSnapshotPicture",
  600. -- 出厂方式
  601. TLFR.RESULT_OUT_MODE "resultOutMode",
  602. -- 门岗名称
  603. RG.GATEPOST_NAME "gatepostName",
  604. -- 运输订单号
  605. OO.ORDER_NUMBER "orderNumber",
  606. -- 车牌号
  607. RC.CAPACITY_NUMBER "capacityNumber",
  608. -- 运输订单id
  609. OO.ORDER_ID "orderId",
  610. -- 根据订单类型查询销售订单号/发运计划号
  611. ( CASE
  612. -- 运输订单类型等于1的查询销售订单表
  613. WHEN OO.ORDER_TYPE = 1
  614. THEN (
  615. SELECT
  616. -- 销售订单号
  617. ASO.SALE_NUMBER
  618. FROM
  619. -- 销售订单
  620. AMS_SALE_ORDER ASO
  621. WHERE OO.ORDER_PLAN_ID = ASO.SALE_ORDER_ID
  622. )
  623. -- 运输订单类型等于2,3的查询发运计划表
  624. WHEN OO.ORDER_TYPE IN ( 2, 3 )
  625. THEN(
  626. SELECT
  627. -- 发运计划号
  628. ARD.DAYPLAN_NO
  629. -- 发运计划
  630. FROM AMSTRUCK_RAIL_DAYPLAN ARD
  631. WHERE OO.ORDER_PLAN_ID = ARD.DAYPLAN_ID
  632. )
  633. END) "saleNum",
  634. --根据订单类型查询发货单位
  635. (CASE
  636. WHEN OO.ORDER_TYPE = 1
  637. THEN (
  638. SELECT
  639. -- 发货单位
  640. RS.SHIPPER_NAME
  641. FROM
  642. --销售订单
  643. AMS_SALE_ORDER ASO --托运人
  644. LEFT JOIN RMS_SHIPPER RS ON ASO.SHIPPER_ID = RS.SHIPPER_ID
  645. WHERE OO.ORDER_PLAN_ID = ASO.SALE_ORDER_ID
  646. )
  647. -- 运输订单类型等于2,3的查询发运计划表
  648. WHEN OO.ORDER_TYPE IN ( 2, 3 )
  649. THEN (
  650. SELECT
  651. --发货单位
  652. RS.SHIPPER_NAME
  653. --发运计划
  654. FROM
  655. AMSTRUCK_RAIL_DAYPLAN ARD
  656. -- 托运人
  657. LEFT JOIN RMS_SHIPPER RS ON ARD.SHIPMENT_UNIT_ID = RS.SHIPPER_ID
  658. WHERE OO.ORDER_PLAN_ID = ARD.DAYPLAN_ID
  659. )
  660. END) "shipperName",
  661. --根据订单类型查询收货单位
  662. ( CASE
  663. WHEN OO.ORDER_TYPE = 1
  664. THEN (
  665. SELECT
  666. --收货单位
  667. RS.SUPPLIER_NAME
  668. FROM
  669. -- 销售订单
  670. AMS_SALE_ORDER ASO
  671. -- 托运人
  672. LEFT JOIN RMS_SUPPLIER RS ON ASO.SHIPPER_ID = RS.SUPPLIER_ID
  673. WHERE OO.ORDER_PLAN_ID = ASO.SALE_ORDER_ID
  674. ) -- 运输订单类型等于2,3的查询发运计划表
  675. WHEN OO.ORDER_TYPE IN ( 2, 3 )
  676. THEN (
  677. SELECT
  678. --发货单位
  679. RS.SUPPLIER_NAME --发运计划
  680. FROM
  681. AMSTRUCK_RAIL_DAYPLAN ARD
  682. --托运人
  683. LEFT JOIN RMS_SUPPLIER RS ON ARD.SHIPMENT_UNIT_ID = RS.SUPPLIER_ID
  684. WHERE OO.ORDER_PLAN_ID = ARD.DAYPLAN_ID
  685. )
  686. END) "supplierName"
  687. FROM
  688. -- 出厂实绩
  689. TMSTRUCK_LEAVE_FACTORY_RESULT TLFR
  690. -- 门岗
  691. LEFT JOIN RMS_GATEPOST RG ON TLFR.GATEPOST_ID = RG.GATEPOST_ID
  692. -- 总实绩
  693. LEFT JOIN TMSTRUCK_TOTAL_RESULT TTR ON TLFR.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
  694. -- 运输订单
  695. LEFT JOIN OMSTRUCK_ORDER OO ON TTR.ORDER_ID = OO.ORDER_ID
  696. -- 运力信息
  697. LEFT JOIN RMS_CAPACITY RC ON OO.CAPACITY_ID = RC.CAPACITY_ID
  698. WHERE
  699. -- 判断出厂实绩的出厂时间不为空
  700. TLFR.RESULT_OUT_GATE_TIME IS NOT NULL
  701. -- 并且订单类型等于1(销售订单),2(焦炭发运计划),3(水渣发运计划)
  702. AND OO.ORDER_TYPE IN ( 1, 2, 3 )
  703. )
  704. <where>
  705. <if test="resultOutGateTime != null">
  706. <foreach collection="resultOutGateTime" item="item" open="(" separator="or" close=")">
  707. "resultOutGateTime" like '%${item}%'
  708. </foreach>
  709. </if>
  710. <if test="resultTruckSnapshotPicture != null">
  711. and
  712. <foreach collection="resultTruckSnapshotPicture" item="item" open="(" separator="or" close=")">
  713. "resultTruckSnapshotPicture" like '%${item}%'
  714. </foreach>
  715. </if>
  716. <if test="resultOutMode != null">
  717. and
  718. <foreach collection="resultOutMode" item="item" open="(" separator="or" close=")">
  719. "resultOutMode" like '%${item}%'
  720. </foreach>
  721. </if>
  722. <if test="gatepostName != null">
  723. and
  724. <foreach collection="gatepostName" item="item" open="(" separator="or" close=")">
  725. "gatepostName" like '%${item}%'
  726. </foreach>
  727. </if>
  728. <if test="orderNumber != null">
  729. and
  730. <foreach collection="orderNumber" item="item" open="(" separator="or" close=")">
  731. "orderNumber" like '%${item}%'
  732. </foreach>
  733. </if>
  734. <if test="capacityNumber != null">
  735. and
  736. <foreach collection="capacityNumber" item="item" open="(" separator="or" close=")">
  737. "capacityNumber" like '%${item}%'
  738. </foreach>
  739. </if>
  740. <if test="saleNum != null">
  741. and
  742. <foreach collection="saleNum" item="item" open="(" separator="or" close=")">
  743. "saleNum" like '%${item}%'
  744. </foreach>
  745. </if>
  746. <if test="shipperName != null">
  747. and
  748. <foreach collection="shipperName" item="item" open="(" separator="or" close=")">
  749. "shipperName" like '%${item}%'
  750. </foreach>
  751. </if>
  752. <if test="supplierName != null">
  753. and
  754. <foreach collection="supplierName" item="item" open="(" separator="or" close=")">
  755. "supplierName" like '%${item}%'
  756. </foreach>
  757. </if>
  758. </where>
  759. <include refid="orderByOutTime"></include>
  760. </select>
  761. <!-- 通过总实绩Id 查询出厂实绩ID -->
  762. <select id="getResultIdByTotalId" parameterType="int" resultType="java.math.BigDecimal">
  763. select TLFR.RESULT_ID
  764. from TMSTRUCK_LEAVE_FACTORY_RESULT TLFR
  765. where TLFR.RESULT_TOTAL_ID = #{resultTotalId}
  766. </select>
  767. <select id="getTruckFactoryResult" resultType="java.util.Map">
  768. SELECT * from(
  769. SELECT
  770. -- 出厂时间
  771. to_char(TLFR.RESULT_OUT_GATE_TIME,'yyyy-mm-dd hh24:mi:ss') "resultOutGateTime",
  772. --出厂抓拍图片
  773. TLFR.RESULT_TRUCK_SNAPSHOT_PICTURE "resultTruckSnapshotPicture",
  774. --出厂方式
  775. TLFR.RESULT_OUT_MODE "resultOutMode",
  776. --门岗名称
  777. RG.GATEPOST_NAME "gatepostName",
  778. -- 运输订单号
  779. OO.ORDER_NUMBER "orderNumber",
  780. -- 车牌号
  781. RC.CAPACITY_NUMBER "capacityNumber",
  782. -- 运输订单id
  783. OO.ORDER_ID "orderId",
  784. -- 订单类型
  785. OO.ORDER_TYPE "orderType",
  786. -- 销售订单号
  787. ASO.SALE_NUMBER "saleNum",
  788. -- 收货地址
  789. RRA.ADDRESS_DELIVERY_ADDRESS "receiveAddress",
  790. -- 收货单位
  791. RS.SUPPLIER_NAME "supplierName" ,
  792. -- 发货单位
  793. RS2.SHIPPER_NAME "shipperName"
  794. FROM
  795. -- 出厂实绩
  796. TMSTRUCK_LEAVE_FACTORY_RESULT TLFR
  797. -- 总实绩
  798. LEFT JOIN TMSTRUCK_TOTAL_RESULT TTR ON TLFR.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
  799. -- 运输订单
  800. LEFT JOIN OMSTRUCK_ORDER OO ON TTR.ORDER_ID = OO.ORDER_ID
  801. -- 销售订单信息
  802. LEFT JOIN AMS_SALE_ORDER ASO ON OO.ORDER_PLAN_ID = ASO.SALE_ORDER_ID
  803. -- 托运人
  804. LEFT JOIN RMS_SUPPLIER RS ON ASO.SHIPPER_ID = RS.SUPPLIER_ID
  805. -- 门岗
  806. LEFT JOIN RMS_GATEPOST RG ON TLFR.GATEPOST_ID = RG.GATEPOST_ID
  807. -- 运力信息
  808. LEFT JOIN RMS_CAPACITY RC ON OO.CAPACITY_ID = RC.CAPACITY_ID
  809. -- 销售订单中间表
  810. LEFT JOIN AMS_SALE_ORDER_MATERIAL ASOM ON ASOM.SALE_ORDER_MATERIAL_ID =OO.ORDER_PLAN_ID
  811. -- 收货地址
  812. LEFT JOIN RMS_RECEIVE_ADDRESS RRA ON ASOM.SALE_SHIPPING_ADDRESS_ID =RRA.ADDRESS_ID
  813. -- 收货单位
  814. LEFT JOIN RMS_SHIPPER RS2 ON ASO.SHIPPER_ID = RS2.SHIPPER_ID
  815. WHERE
  816. -- 判断出厂实绩的出厂时间不为空
  817. TLFR.RESULT_OUT_GATE_TIME IS NOT NULL
  818. -- 并且订单类型等于1(销售订单),2(焦炭发运计划),3(水渣发运计划)
  819. AND OO.ORDER_TYPE =1 AND OO.ORDER_NUMBER=#{orderNumber}
  820. )
  821. </select>
  822. <!-- 查询内转钢材到异地库出厂实绩 -->
  823. <select id="selectSteelNzLeaveFactory" parameterType="java.util.Map" resultType="java.util.Map">
  824. SELECT
  825. *
  826. FROM (
  827. SELECT
  828. OO.ORDER_ID "orderId",
  829. TLFR.RESULT_ID "resultId",
  830. AROD.DAYPLAN_NO "dayplanNo",
  831. OO.ORDER_NUMBER "orderNumber",
  832. RG.GATEPOST_NAME "gatepostName",
  833. TLFR.RESULT_OUT_MODE "resultOutMode",
  834. RC.CAPACITY_NUMBER "capacityNumber",
  835. TLFR.RESULT_OUT_GATE_TIME "resultOutGateTime",
  836. TLFR.RESULT_TRUCK_SNAPSHOT_PICTURE "resultTruckSnapshotPicture"
  837. FROM TMSTRUCK_LEAVE_FACTORY_RESULT TLFR
  838. LEFT JOIN TMSTRUCK_TOTAL_RESULT TTR
  839. ON TTR.RESULT_TOTAL_ID = TLFR.RESULT_TOTAL_ID
  840. LEFT JOIN OMSTRUCK_ORDER OO
  841. ON OO.ORDER_ID = TTR.ORDER_ID
  842. LEFT JOIN AMS_RAIL_OFFSET_DAYPLAN AROD
  843. ON AROD.DAYPLAN_ID = OO.ORDER_PLAN_ID
  844. LEFT JOIN RMS_CAPACITY RC
  845. ON RC.CAPACITY_ID = OO.CAPACITY_ID
  846. LEFT JOIN RMS_GATEPOST RG
  847. ON RG.GATEPOST_ID = TLFR.GATEPOST_ID
  848. WHERE OO.ORDER_TYPE = 4
  849. AND TLFR.RESULT_OUT_GATE_TIME IS NOT NULL
  850. )
  851. <where>
  852. <if test="dayplanNo != null">
  853. <foreach collection="dayplanNo" item="item" open="(" separator="or" close=")">
  854. "dayplanNo" like '%${item}%'
  855. </foreach>
  856. </if>
  857. <if test="orderNumber != null">
  858. and
  859. <foreach collection="orderNumber" item="item" open="(" separator="or" close=")">
  860. "orderNumber" like '%${item}%'
  861. </foreach>
  862. </if>
  863. <if test="gatepostName != null">
  864. and
  865. <foreach collection="gatepostName" item="item" open="(" separator="or" close=")">
  866. "gatepostName" like '%${item}%'
  867. </foreach>
  868. </if>
  869. <if test="resultOutMode != null">
  870. and
  871. <foreach collection="resultOutMode" item="item" open="(" separator="or" close=")">
  872. "resultOutMode" like '%${item}%'
  873. </foreach>
  874. </if>
  875. <if test="capacityNumber != null">
  876. and
  877. <foreach collection="capacityNumber" item="item" open="(" separator="or" close=")">
  878. "dayplanNo" like '%${item}%'
  879. </foreach>
  880. </if>
  881. <if test="resultOutGateTime != null">
  882. and
  883. <foreach collection="resultOutGateTime" item="item" open="(" separator="or" close=")">
  884. "resultOutGateTime" like '%${item}%'
  885. </foreach>
  886. </if>
  887. <if test="resultTruckSnapshotPicture != null">
  888. and
  889. <foreach collection="resultTruckSnapshotPicture" item="item" open="(" separator="or" close=")">
  890. "resultTruckSnapshotPicture" like '%${item}%'
  891. </foreach>
  892. </if>
  893. </where>
  894. <include refid="orderByOutTime"></include>
  895. </select>
  896. <!-- 查询内转国产矿进口矿 -->
  897. <select id="getImportedDomesticNzEnFactoryResult" resultType="java.util.Map">
  898. select *
  899. from (
  900. select TLFR.RESULT_ID "resultId",
  901. APO.PURCHASE_ORDER_NO "purchaseOrderNo",
  902. RM.MATERIAL_NAME "materialName",
  903. DB.RESULT_FOREIGN_SHIP_NAME "resultForeignShipName",
  904. OO.ORDER_NUMBER "orderNumber",
  905. RC.CAPACITY_NUMBER "capacityNumber",
  906. RG.GATEPOST_NAME "gatepostName",
  907. TLFR.RESULT_OUT_MODE "resultOutMode",
  908. TLFR.RESULT_OUT_GATE_TIME "resultOutGateTime",
  909. TLFR.RESULT_TRUCK_SNAPSHOT_PICTURE "resultTruckSnapshotPicture"
  910. from TMSTRUCK_LEAVE_FACTORY_RESULT TLFR
  911. left join TMSTRUCK_TOTAL_RESULT TTR
  912. on TTR.RESULT_TOTAL_ID = TLFR.RESULT_TOTAL_ID
  913. left join OMSTRUCK_ORDER OO
  914. on OO.ORDER_ID = TTR.ORDER_ID
  915. left join AMS_PURCHASE_ORDER APO
  916. on APO.PURCHASE_ORDER_ID = OO.ORDER_PLAN_ID
  917. left join DIL_BATCH DB
  918. on DB.BATCH_ID = APO.BATCH_ID
  919. left join OMSTRUCK_ORDER_MATERIAL OOM
  920. on OOM.ORDER_ID = OO.ORDER_ID
  921. left join RMS_MATERIAL RM
  922. on RM.MATERIAL_ID = OOM.MATERIAL_ID
  923. left join RMS_CAPACITY RC
  924. on RC.CAPACITY_ID = OO.CAPACITY_ID
  925. left join RMS_GATEPOST RG
  926. on RG.GATEPOST_ID = TLFR.GATEPOST_ID
  927. where RESULT_OUT_GATE_TIME is not null
  928. and OO.ORDER_TYPE = 9
  929. )
  930. <where>
  931. <if test="purchaseOrderNo != null">
  932. <foreach collection="purchaseOrderNo" item="item" open="(" separator="or" close=")">
  933. "purchaseOrderNo" like '%${item}%'
  934. </foreach>
  935. </if>
  936. <if test="materialName != null">
  937. and
  938. <foreach collection="materialName" item="item" open="(" separator="or" close=")">
  939. "materialName" like '%${item}%'
  940. </foreach>
  941. </if>
  942. <if test="resultForeignShipName != null">
  943. and
  944. <foreach collection="resultForeignShipName" item="item" open="(" separator="or" close=")">
  945. "resultForeignShipName" like '%${item}%'
  946. </foreach>
  947. </if>
  948. <if test="orderNumber != null">
  949. and
  950. <foreach collection="orderNumber" item="item" open="(" separator="or" close=")">
  951. "orderNumber" like '%${item}%'
  952. </foreach>
  953. </if>
  954. <if test="capacityNumber != null">
  955. and
  956. <foreach collection="capacityNumber" item="item" open="(" separator="or" close=")">
  957. "capacityNumber" like '%${item}%'
  958. </foreach>
  959. </if>
  960. <if test="gatepostName != null">
  961. and
  962. <foreach collection="gatepostName" item="item" open="(" separator="or" close=")">
  963. "gatepostName" like '%${item}%'
  964. </foreach>
  965. </if>
  966. <if test="resultOutMode != null">
  967. and
  968. <foreach collection="resultOutMode" item="item" open="(" separator="or" close=")">
  969. "resultOutMode" like '%${item}%'
  970. </foreach>
  971. </if>
  972. <if test="resultOutGateTime != null">
  973. and
  974. <foreach collection="resultOutGateTime" item="item" open="(" separator="or" close=")">
  975. "resultOutGateTime" like '%${item}%'
  976. </foreach>
  977. </if>
  978. <if test="resultTruckSnapshotPicture != null">
  979. and
  980. <foreach collection="resultTruckSnapshotPicture" item="item" open="(" separator="or" close=")">
  981. "resultTruckSnapshotPicture" like '%${item}%'
  982. </foreach>
  983. </if>
  984. </where>
  985. <include refid="orderByOutTime"></include>
  986. </select>
  987. <!-- 查询内转厂内物资出厂实绩 -->
  988. <select id="getInFactoryOutFactoryResult" parameterType="java.util.Map" resultType="java.util.Map">
  989. select *
  990. from (
  991. select TLFR.RESULT_ID "resultId",
  992. OO.ORDER_NUMBER "orderNumber",
  993. RC.CAPACITY_NUMBER "capacityNumber",
  994. RG.GATEPOST_NAME "gatepostName",
  995. TLFR.RESULT_OUT_MODE "resultOutMode",
  996. TLFR.RESULT_OUT_GATE_TIME "resultOutGateTime",
  997. TLFR.RESULT_TRUCK_SNAPSHOT_PICTURE "resultTruckSnapshotPicture"
  998. from TMSTRUCK_LEAVE_FACTORY_RESULT TLFR
  999. left join TMSTRUCK_TOTAL_RESULT TTR
  1000. on TTR.RESULT_TOTAL_ID = TLFR.RESULT_TOTAL_ID
  1001. left join OMSTRUCK_ORDER OO
  1002. on OO.ORDER_ID = TTR.ORDER_ID
  1003. left join RMS_CAPACITY RC
  1004. on RC.CAPACITY_ID = OO.CAPACITY_ID
  1005. left join RMS_GATEPOST RG
  1006. on RG.GATEPOST_ID = TLFR.GATEPOST_ID
  1007. where RESULT_OUT_GATE_TIME is not null
  1008. and OO.ORDER_TYPE = 11
  1009. )
  1010. <where>
  1011. <if test="orderNumber != null">
  1012. <foreach collection="orderNumber" item="item" open="(" separator="or" close=")">
  1013. "orderNumber" like '%${item}%'
  1014. </foreach>
  1015. </if>
  1016. <if test="capacityNumber != null">
  1017. and
  1018. <foreach collection="capacityNumber" item="item" open="(" separator="or" close=")">
  1019. "capacityNumber" like '%${item}%'
  1020. </foreach>
  1021. </if>
  1022. <if test="gatepostName != null">
  1023. and
  1024. <foreach collection="gatepostName" item="item" open="(" separator="or" close=")">
  1025. "gatepostName" like '%${item}%'
  1026. </foreach>
  1027. </if>
  1028. <if test="resultOutMode != null">
  1029. and
  1030. <foreach collection="resultOutMode" item="item" open="(" separator="or" close=")">
  1031. "resultOutMode" like '%${item}%'
  1032. </foreach>
  1033. </if>
  1034. <if test="resultOutGateTime != null">
  1035. and
  1036. <foreach collection="resultOutGateTime" item="item" open="(" separator="or" close=")">
  1037. "resultOutGateTime" like '%${item}%'
  1038. </foreach>
  1039. </if>
  1040. <if test="resultTruckSnapshotPicture != null">
  1041. and
  1042. <foreach collection="resultTruckSnapshotPicture" item="item" open="(" separator="or" close=")">
  1043. "resultTruckSnapshotPicture" like '%${item}%'
  1044. </foreach>
  1045. </if>
  1046. </where>
  1047. <include refid="orderByOutTime"></include>
  1048. </select>
  1049. <select id="getDeliveryOrder" parameterType="java.lang.String" resultType="java.util.Map">
  1050. select
  1051. aso.sale_number "saleNo" ,
  1052. oo.order_number "orderNumber",
  1053. rc.capacity_number "capacityNumber",
  1054. rce.consignee_company_name "consigeeName",
  1055. rcr.carrier_name "carrierName",
  1056. rca.address_province "province",
  1057. rca.address_district "district",
  1058. rca.address_town "town",
  1059. rca.address_delivery_address "deliveryAddress",
  1060. asom.sale_order_consignee "consignee",
  1061. asom.sale_order_consignee_tel "consigneeTel",
  1062. asom.sale_date_of_receipt "receiptDate",
  1063. rsh.SHIPPER_NAME "shippername",
  1064. sysdate "sendDate"
  1065. from omstruck_order oo
  1066. left join
  1067. rms_capacity rc
  1068. on
  1069. rc.capacity_id = oo.capacity_id
  1070. left join
  1071. ams_sale_order_material asom
  1072. on
  1073. asom.sale_order_material_id = oo.order_plan_id
  1074. left join
  1075. ams_sale_order aso
  1076. on
  1077. aso.sale_order_id = asom.sale_order_id
  1078. left join
  1079. rms_consignee rce
  1080. on
  1081. rce.consignee_id = aso.receive_id
  1082. left join
  1083. ams_dispatch_sale_order adso
  1084. on
  1085. adso.sale_order_material_id = asom.sale_order_material_id
  1086. left join
  1087. rms_carrier rcr
  1088. on
  1089. rcr.carrier_id = adso.carrier_id
  1090. left join
  1091. rms_receive_address rca
  1092. on
  1093. rca.address_id = asom.sale_shipping_address_id
  1094. left join RMS_SHIPPER rsh
  1095. on rsh.SHIPPER_ID = aso.SHIPPER_ID
  1096. where oo.order_number =#{orderNumber}
  1097. </select>
  1098. <select id="getDeliveryOrderMaterial" parameterType="java.lang.String" resultType="java.util.LinkedHashMap">
  1099. select
  1100. rm.material_name "materialName",
  1101. rm.material_specification "materialSpe",
  1102. rm.material_model "materialModel",
  1103. oom.order_material_number "materialNumber",
  1104. oom.order_material_weight "materialWeight",
  1105. ruom.unit_of_measure_name "measureName",
  1106. twr.RESULT_NET_WEIGHT "resultWeight"
  1107. from omstruck_order oo
  1108. left join
  1109. omstruck_order_material oom
  1110. on
  1111. oom.order_id = oo.order_id
  1112. left join
  1113. rms_material rm
  1114. on
  1115. rm.material_id = oom.order_material_id
  1116. left join
  1117. rms_unit_of_measure ruom
  1118. on
  1119. ruom.unit_of_measure_id = rm.unit_of_measure_id
  1120. left join
  1121. TMSTRUCK_TOTAL_RESULT ttr
  1122. on ttr.ORDER_ID = oo.ORDER_ID
  1123. left join
  1124. TMSTRUCK_WEIGHT_RESULT twr
  1125. on
  1126. twr.RESULT_TOTAL_ID = ttr.ORDER_ID
  1127. and twr.MATERIAL_ID = oom.MATERIAL_ID
  1128. where oo.order_number = #{orderNumber}
  1129. </select>
  1130. <!-- 根据订单id获取零星物资出厂实绩-->
  1131. <select id="getSporadicSuppliesOutFactoryResult" parameterType="java.util.Map" resultType="java.util.Map">
  1132. select *
  1133. from (
  1134. select
  1135. TLFR.RESULT_ID "resultId",
  1136. OO.ORDER_NUMBER "orderNumber",
  1137. RC.CARRIER_NAME "carrierName",
  1138. RG.GATEPOST_NAME "gatepostName",
  1139. TLFR.RESULT_OUT_MODE "resultOutMode",
  1140. TLFR.RESULT_OUT_GATE_TIME "resultOutGateTime",
  1141. TLFR.RESULT_TRUCK_SNAPSHOT_PICTURE "resultTruckSnapshotPicture"
  1142. from TMSTRUCK_LEAVE_FACTORY_RESULT TLFR
  1143. left join TMSTRUCK_TOTAL_RESULT TTR
  1144. on TTR.RESULT_TOTAL_ID = TLFR.RESULT_TOTAL_ID
  1145. left join OMSTRUCK_ORDER OO
  1146. on OO.ORDER_ID = TTR.ORDER_ID
  1147. left join RMS_CARRIER RC
  1148. on RC.CARRIER_ID = OO.CAPACITY_ID
  1149. left join RMS_GATEPOST RG
  1150. on RG.GATEPOST_ID = TLFR.GATEPOST_ID
  1151. where RESULT_OUT_GATE_TIME is not null
  1152. and OO.ORDER_TYPE = 12
  1153. )
  1154. <where>
  1155. <if test="orderNumber != null">
  1156. <foreach collection="orderNumber" item="item" open="(" separator="or" close=")">
  1157. "orderNumber" like '%${item}%'
  1158. </foreach>
  1159. </if>
  1160. <if test="carrierName != null">
  1161. and
  1162. <foreach collection="carrierName" item="item" open="(" separator="or" close=")">
  1163. "carrierName" like '%${item}%'
  1164. </foreach>
  1165. </if>
  1166. <if test="gatepostName != null">
  1167. and
  1168. <foreach collection="gatepostName" item="item" open="(" separator="or" close=")">
  1169. "gatepostName" like '%${item}%'
  1170. </foreach>
  1171. </if>
  1172. <if test="resultOutMode != null">
  1173. and
  1174. <foreach collection="resultOutMode" item="item" open="(" separator="or" close=")">
  1175. "resultOutMode" like '%${item}%'
  1176. </foreach>
  1177. </if>
  1178. <if test="resultOutGateTime != null">
  1179. and
  1180. <foreach collection="resultOutGateTime" item="item" open="(" separator="or" close=")">
  1181. "resultOutGateTime" like '%${item}%'
  1182. </foreach>
  1183. </if>
  1184. <if test="resultTruckSnapshotPicture != null">
  1185. and
  1186. <foreach collection="resultTruckSnapshotPicture" item="item" open="(" separator="or" close=")">
  1187. "resultTruckSnapshotPicture" like '%${item}%'
  1188. </foreach>
  1189. </if>
  1190. </where>
  1191. <include refid="orderByOutTime"></include>
  1192. </select>
  1193. </mapper>