TmstruckLeaveFactoryResultMapper.xml 55 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236
  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_MATERIAL ASOM
  621. LEFT JOIN AMS_SALE_ORDER ASO
  622. ON ASOM.SALE_ORDER_ID = ASO.SALE_ORDER_ID
  623. WHERE OO.ORDER_PLAN_ID = ASOM.SALE_ORDER_MATERIAL_ID
  624. )
  625. -- 运输订单类型等于2,3的查询发运计划表
  626. WHEN OO.ORDER_TYPE IN ( 2, 3 )
  627. THEN(
  628. SELECT
  629. -- 发运计划号
  630. ARD.DAYPLAN_NO
  631. -- 发运计划
  632. FROM AMSTRUCK_RAIL_DAYPLAN ARD
  633. WHERE OO.ORDER_PLAN_ID = ARD.DAYPLAN_ID
  634. )
  635. END) "saleNum",
  636. --根据订单类型查询发货单位
  637. (CASE
  638. WHEN OO.ORDER_TYPE = 1
  639. THEN (
  640. SELECT
  641. -- 发货单位
  642. RS.SHIPPER_NAME
  643. -- 销售订单
  644. FROM
  645. AMS_SALE_ORDER_MATERIAL ASOM
  646. LEFT JOIN AMS_SALE_ORDER ASO
  647. ON ASOM.SALE_ORDER_ID = ASO.SALE_ORDER_ID
  648. LEFT JOIN RMS_SHIPPER RS ON ASO.SHIPPER_ID = RS.SHIPPER_ID
  649. WHERE OO.ORDER_PLAN_ID = ASOM.SALE_ORDER_MATERIAL_ID
  650. )
  651. -- 运输订单类型等于2,3的查询发运计划表
  652. WHEN OO.ORDER_TYPE IN ( 2, 3 )
  653. THEN (
  654. SELECT
  655. --发货单位
  656. RS.SHIPPER_NAME
  657. --发运计划
  658. FROM
  659. AMSTRUCK_RAIL_DAYPLAN ARD
  660. -- 托运人
  661. LEFT JOIN RMS_SHIPPER RS ON ARD.SHIPMENT_UNIT_ID = RS.SHIPPER_ID
  662. WHERE OO.ORDER_PLAN_ID = ARD.DAYPLAN_ID
  663. )
  664. END) "shipperName",
  665. --根据订单类型查询收货单位
  666. ( CASE
  667. WHEN OO.ORDER_TYPE = 1
  668. THEN (
  669. SELECT
  670. --收货单位
  671. RC.CONSIGNEE_COMPANY_NAME
  672. FROM
  673. AMS_SALE_ORDER_MATERIAL ASOM
  674. LEFT JOIN AMS_SALE_ORDER ASO
  675. ON ASOM.SALE_ORDER_ID = ASO.SALE_ORDER_ID
  676. -- 托运人
  677. LEFT JOIN RMS_CONSIGNEE RC ON ASO.RECEIVE_ID = RC.CONSIGNEE_ID
  678. WHERE OO.ORDER_PLAN_ID = ASOM.SALE_ORDER_MATERIAL_ID
  679. ) -- 运输订单类型等于2,3的查询发运计划表
  680. WHEN OO.ORDER_TYPE IN ( 2, 3 )
  681. THEN (
  682. SELECT
  683. --发货单位
  684. RS.SUPPLIER_NAME --发运计划
  685. FROM
  686. AMSTRUCK_RAIL_DAYPLAN ARD
  687. --托运人
  688. LEFT JOIN RMS_SUPPLIER RS ON ARD.SHIPMENT_UNIT_ID = RS.SUPPLIER_ID
  689. WHERE OO.ORDER_PLAN_ID = ARD.DAYPLAN_ID
  690. )
  691. END) "supplierName"
  692. FROM
  693. -- 出厂实绩
  694. TMSTRUCK_LEAVE_FACTORY_RESULT TLFR
  695. -- 门岗
  696. LEFT JOIN RMS_GATEPOST RG ON TLFR.GATEPOST_ID = RG.GATEPOST_ID
  697. -- 总实绩
  698. LEFT JOIN TMSTRUCK_TOTAL_RESULT TTR ON TLFR.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
  699. -- 运输订单
  700. LEFT JOIN OMSTRUCK_ORDER OO ON TTR.ORDER_ID = OO.ORDER_ID
  701. -- 运力信息
  702. LEFT JOIN RMS_CAPACITY RC ON OO.CAPACITY_ID = RC.CAPACITY_ID
  703. WHERE
  704. -- 判断出厂实绩的出厂时间不为空
  705. TLFR.RESULT_OUT_GATE_TIME IS NOT NULL
  706. -- 并且订单类型等于1(销售订单),2(焦炭发运计划),3(水渣发运计划)
  707. AND OO.ORDER_TYPE IN ( 1, 2, 3 )
  708. )
  709. <where>
  710. <if test="resultOutGateTime != null">
  711. <foreach collection="resultOutGateTime" item="item" open="(" separator="or" close=")">
  712. "resultOutGateTime" like '%${item}%'
  713. </foreach>
  714. </if>
  715. <if test="resultTruckSnapshotPicture != null">
  716. and
  717. <foreach collection="resultTruckSnapshotPicture" item="item" open="(" separator="or" close=")">
  718. "resultTruckSnapshotPicture" like '%${item}%'
  719. </foreach>
  720. </if>
  721. <if test="resultOutMode != null">
  722. and
  723. <foreach collection="resultOutMode" item="item" open="(" separator="or" close=")">
  724. "resultOutMode" like '%${item}%'
  725. </foreach>
  726. </if>
  727. <if test="gatepostName != null">
  728. and
  729. <foreach collection="gatepostName" item="item" open="(" separator="or" close=")">
  730. "gatepostName" like '%${item}%'
  731. </foreach>
  732. </if>
  733. <if test="orderNumber != null">
  734. and
  735. <foreach collection="orderNumber" item="item" open="(" separator="or" close=")">
  736. "orderNumber" like '%${item}%'
  737. </foreach>
  738. </if>
  739. <if test="capacityNumber != null">
  740. and
  741. <foreach collection="capacityNumber" item="item" open="(" separator="or" close=")">
  742. "capacityNumber" like '%${item}%'
  743. </foreach>
  744. </if>
  745. <if test="saleNum != null">
  746. and
  747. <foreach collection="saleNum" item="item" open="(" separator="or" close=")">
  748. "saleNum" like '%${item}%'
  749. </foreach>
  750. </if>
  751. <if test="shipperName != null">
  752. and
  753. <foreach collection="shipperName" item="item" open="(" separator="or" close=")">
  754. "shipperName" like '%${item}%'
  755. </foreach>
  756. </if>
  757. <if test="supplierName != null">
  758. and
  759. <foreach collection="supplierName" item="item" open="(" separator="or" close=")">
  760. "supplierName" like '%${item}%'
  761. </foreach>
  762. </if>
  763. </where>
  764. <include refid="orderByOutTime"></include>
  765. </select>
  766. <!-- 通过总实绩Id 查询出厂实绩ID -->
  767. <select id="getResultIdByTotalId" parameterType="int" resultType="java.math.BigDecimal">
  768. select *
  769. from (
  770. select TLFR.RESULT_ID
  771. from TMSTRUCK_LEAVE_FACTORY_RESULT TLFR
  772. where TLFR.RESULT_TOTAL_ID = #{resultTotalId}
  773. and TLFR.RESULT_OUT_GATE_TIME is null
  774. order by TLFR.SEGMENT_SQE
  775. )
  776. where rownum = 1
  777. </select>
  778. <select id="getTruckFactoryResult" resultType="java.util.Map">
  779. SELECT * from(
  780. SELECT
  781. -- 出厂时间
  782. to_char(TLFR.RESULT_OUT_GATE_TIME,'yyyy-mm-dd hh24:mi:ss') "resultOutGateTime",
  783. --出厂抓拍图片
  784. TLFR.RESULT_TRUCK_SNAPSHOT_PICTURE "resultTruckSnapshotPicture",
  785. --出厂方式
  786. TLFR.RESULT_OUT_MODE "resultOutMode",
  787. --门岗名称
  788. RG.GATEPOST_NAME "gatepostName",
  789. -- 运输订单号
  790. OO.ORDER_NUMBER "orderNumber",
  791. -- 车牌号
  792. RC.CAPACITY_NUMBER "capacityNumber",
  793. -- 运输订单id
  794. OO.ORDER_ID "orderId",
  795. -- 订单类型
  796. OO.ORDER_TYPE "orderType",
  797. -- 销售订单号
  798. ASO.SALE_NUMBER "saleNum",
  799. -- 收货地址
  800. RRA.ADDRESS_DELIVERY_ADDRESS "receiveAddress",
  801. -- 收货单位
  802. RS.SUPPLIER_NAME "supplierName" ,
  803. -- 发货单位
  804. RS2.SHIPPER_NAME "shipperName"
  805. FROM
  806. -- 出厂实绩
  807. TMSTRUCK_LEAVE_FACTORY_RESULT TLFR
  808. -- 总实绩
  809. LEFT JOIN TMSTRUCK_TOTAL_RESULT TTR ON TLFR.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
  810. -- 运输订单
  811. LEFT JOIN OMSTRUCK_ORDER OO ON TTR.ORDER_ID = OO.ORDER_ID
  812. -- 销售订单信息
  813. LEFT JOIN AMS_SALE_ORDER ASO ON OO.ORDER_PLAN_ID = ASO.SALE_ORDER_ID
  814. -- 托运人
  815. LEFT JOIN RMS_SUPPLIER RS ON ASO.SHIPPER_ID = RS.SUPPLIER_ID
  816. -- 门岗
  817. LEFT JOIN RMS_GATEPOST RG ON TLFR.GATEPOST_ID = RG.GATEPOST_ID
  818. -- 运力信息
  819. LEFT JOIN RMS_CAPACITY RC ON OO.CAPACITY_ID = RC.CAPACITY_ID
  820. -- 销售订单中间表
  821. LEFT JOIN AMS_SALE_ORDER_MATERIAL ASOM ON ASOM.SALE_ORDER_MATERIAL_ID =OO.ORDER_PLAN_ID
  822. -- 收货地址
  823. LEFT JOIN RMS_RECEIVE_ADDRESS RRA ON ASOM.SALE_SHIPPING_ADDRESS_ID =RRA.ADDRESS_ID
  824. -- 收货单位
  825. LEFT JOIN RMS_SHIPPER RS2 ON ASO.SHIPPER_ID = RS2.SHIPPER_ID
  826. WHERE
  827. -- 判断出厂实绩的出厂时间不为空
  828. TLFR.RESULT_OUT_GATE_TIME IS NOT NULL
  829. -- 并且订单类型等于1(销售订单),2(焦炭发运计划),3(水渣发运计划)
  830. AND OO.ORDER_TYPE =1 AND OO.ORDER_NUMBER=#{orderNumber}
  831. )
  832. </select>
  833. <!-- 查询内转钢材到异地库出厂实绩 -->
  834. <select id="selectSteelNzLeaveFactory" parameterType="java.util.Map" resultType="java.util.Map">
  835. SELECT
  836. *
  837. FROM (
  838. SELECT
  839. OO.ORDER_ID "orderId",
  840. TLFR.RESULT_ID "resultId",
  841. AROD.DAYPLAN_NO "dayplanNo",
  842. OO.ORDER_NUMBER "orderNumber",
  843. RG.GATEPOST_NAME "gatepostName",
  844. TLFR.RESULT_OUT_MODE "resultOutMode",
  845. RC.CAPACITY_NUMBER "capacityNumber",
  846. TLFR.RESULT_OUT_GATE_TIME "resultOutGateTime",
  847. TLFR.RESULT_TRUCK_SNAPSHOT_PICTURE "resultTruckSnapshotPicture"
  848. FROM TMSTRUCK_LEAVE_FACTORY_RESULT TLFR
  849. LEFT JOIN TMSTRUCK_TOTAL_RESULT TTR
  850. ON TTR.RESULT_TOTAL_ID = TLFR.RESULT_TOTAL_ID
  851. LEFT JOIN OMSTRUCK_ORDER OO
  852. ON OO.ORDER_ID = TTR.ORDER_ID
  853. LEFT JOIN AMS_RAIL_OFFSET_DAYPLAN AROD
  854. ON AROD.DAYPLAN_ID = OO.ORDER_PLAN_ID
  855. LEFT JOIN RMS_CAPACITY RC
  856. ON RC.CAPACITY_ID = OO.CAPACITY_ID
  857. LEFT JOIN RMS_GATEPOST RG
  858. ON RG.GATEPOST_ID = TLFR.GATEPOST_ID
  859. WHERE OO.ORDER_TYPE = 4
  860. AND TLFR.RESULT_OUT_GATE_TIME IS NOT NULL
  861. )
  862. <where>
  863. <if test="dayplanNo != null">
  864. <foreach collection="dayplanNo" item="item" open="(" separator="or" close=")">
  865. "dayplanNo" like '%${item}%'
  866. </foreach>
  867. </if>
  868. <if test="orderNumber != null">
  869. and
  870. <foreach collection="orderNumber" item="item" open="(" separator="or" close=")">
  871. "orderNumber" like '%${item}%'
  872. </foreach>
  873. </if>
  874. <if test="gatepostName != null">
  875. and
  876. <foreach collection="gatepostName" item="item" open="(" separator="or" close=")">
  877. "gatepostName" like '%${item}%'
  878. </foreach>
  879. </if>
  880. <if test="resultOutMode != null">
  881. and
  882. <foreach collection="resultOutMode" item="item" open="(" separator="or" close=")">
  883. "resultOutMode" like '%${item}%'
  884. </foreach>
  885. </if>
  886. <if test="capacityNumber != null">
  887. and
  888. <foreach collection="capacityNumber" item="item" open="(" separator="or" close=")">
  889. "dayplanNo" like '%${item}%'
  890. </foreach>
  891. </if>
  892. <if test="resultOutGateTime != null">
  893. and
  894. <foreach collection="resultOutGateTime" item="item" open="(" separator="or" close=")">
  895. "resultOutGateTime" like '%${item}%'
  896. </foreach>
  897. </if>
  898. <if test="resultTruckSnapshotPicture != null">
  899. and
  900. <foreach collection="resultTruckSnapshotPicture" item="item" open="(" separator="or" close=")">
  901. "resultTruckSnapshotPicture" like '%${item}%'
  902. </foreach>
  903. </if>
  904. </where>
  905. <include refid="orderByOutTime"></include>
  906. </select>
  907. <!-- 查询内转国产矿进口矿 -->
  908. <select id="getImportedDomesticNzEnFactoryResult" resultType="java.util.Map">
  909. select *
  910. from (
  911. select TLFR.RESULT_ID "resultId",
  912. APO.PURCHASE_ORDER_NO "purchaseOrderNo",
  913. RM.MATERIAL_NAME "materialName",
  914. DB.RESULT_FOREIGN_SHIP_NAME "resultForeignShipName",
  915. OO.ORDER_NUMBER "orderNumber",
  916. RC.CAPACITY_NUMBER "capacityNumber",
  917. RG.GATEPOST_NAME "gatepostName",
  918. TLFR.RESULT_OUT_MODE "resultOutMode",
  919. TLFR.RESULT_OUT_GATE_TIME "resultOutGateTime",
  920. TLFR.RESULT_TRUCK_SNAPSHOT_PICTURE "resultTruckSnapshotPicture"
  921. from TMSTRUCK_LEAVE_FACTORY_RESULT TLFR
  922. left join TMSTRUCK_TOTAL_RESULT TTR
  923. on TTR.RESULT_TOTAL_ID = TLFR.RESULT_TOTAL_ID
  924. left join OMSTRUCK_ORDER OO
  925. on OO.ORDER_ID = TTR.ORDER_ID
  926. left join AMS_PURCHASE_ORDER APO
  927. on APO.PURCHASE_ORDER_ID = OO.ORDER_PLAN_ID
  928. left join DIL_BATCH DB
  929. on DB.BATCH_ID = APO.BATCH_ID
  930. left join OMSTRUCK_ORDER_MATERIAL OOM
  931. on OOM.ORDER_ID = OO.ORDER_ID
  932. left join RMS_MATERIAL RM
  933. on RM.MATERIAL_ID = OOM.MATERIAL_ID
  934. left join RMS_CAPACITY RC
  935. on RC.CAPACITY_ID = OO.CAPACITY_ID
  936. left join RMS_GATEPOST RG
  937. on RG.GATEPOST_ID = TLFR.GATEPOST_ID
  938. where RESULT_OUT_GATE_TIME is not null
  939. and OO.ORDER_TYPE = 9
  940. )
  941. <where>
  942. <if test="purchaseOrderNo != null">
  943. <foreach collection="purchaseOrderNo" item="item" open="(" separator="or" close=")">
  944. "purchaseOrderNo" like '%${item}%'
  945. </foreach>
  946. </if>
  947. <if test="materialName != null">
  948. and
  949. <foreach collection="materialName" item="item" open="(" separator="or" close=")">
  950. "materialName" like '%${item}%'
  951. </foreach>
  952. </if>
  953. <if test="resultForeignShipName != null">
  954. and
  955. <foreach collection="resultForeignShipName" item="item" open="(" separator="or" close=")">
  956. "resultForeignShipName" like '%${item}%'
  957. </foreach>
  958. </if>
  959. <if test="orderNumber != null">
  960. and
  961. <foreach collection="orderNumber" item="item" open="(" separator="or" close=")">
  962. "orderNumber" like '%${item}%'
  963. </foreach>
  964. </if>
  965. <if test="capacityNumber != null">
  966. and
  967. <foreach collection="capacityNumber" item="item" open="(" separator="or" close=")">
  968. "capacityNumber" like '%${item}%'
  969. </foreach>
  970. </if>
  971. <if test="gatepostName != null">
  972. and
  973. <foreach collection="gatepostName" item="item" open="(" separator="or" close=")">
  974. "gatepostName" like '%${item}%'
  975. </foreach>
  976. </if>
  977. <if test="resultOutMode != null">
  978. and
  979. <foreach collection="resultOutMode" item="item" open="(" separator="or" close=")">
  980. "resultOutMode" like '%${item}%'
  981. </foreach>
  982. </if>
  983. <if test="resultOutGateTime != null">
  984. and
  985. <foreach collection="resultOutGateTime" item="item" open="(" separator="or" close=")">
  986. "resultOutGateTime" like '%${item}%'
  987. </foreach>
  988. </if>
  989. <if test="resultTruckSnapshotPicture != null">
  990. and
  991. <foreach collection="resultTruckSnapshotPicture" item="item" open="(" separator="or" close=")">
  992. "resultTruckSnapshotPicture" like '%${item}%'
  993. </foreach>
  994. </if>
  995. </where>
  996. <include refid="orderByOutTime"></include>
  997. </select>
  998. <!-- 查询内转厂内物资出厂实绩 -->
  999. <select id="getInFactoryOutFactoryResult" parameterType="java.util.Map" resultType="java.util.Map">
  1000. select *
  1001. from (
  1002. select TLFR.RESULT_ID "resultId",
  1003. OO.ORDER_NUMBER "orderNumber",
  1004. RC.CAPACITY_NUMBER "capacityNumber",
  1005. RG.GATEPOST_NAME "gatepostName",
  1006. TLFR.RESULT_OUT_MODE "resultOutMode",
  1007. TLFR.RESULT_OUT_GATE_TIME "resultOutGateTime",
  1008. TLFR.RESULT_TRUCK_SNAPSHOT_PICTURE "resultTruckSnapshotPicture"
  1009. from TMSTRUCK_LEAVE_FACTORY_RESULT TLFR
  1010. left join TMSTRUCK_TOTAL_RESULT TTR
  1011. on TTR.RESULT_TOTAL_ID = TLFR.RESULT_TOTAL_ID
  1012. left join OMSTRUCK_ORDER OO
  1013. on OO.ORDER_ID = TTR.ORDER_ID
  1014. left join RMS_CAPACITY RC
  1015. on RC.CAPACITY_ID = OO.CAPACITY_ID
  1016. left join RMS_GATEPOST RG
  1017. on RG.GATEPOST_ID = TLFR.GATEPOST_ID
  1018. where RESULT_OUT_GATE_TIME is not null
  1019. and OO.ORDER_TYPE = 11
  1020. )
  1021. <where>
  1022. <if test="orderNumber != null">
  1023. <foreach collection="orderNumber" item="item" open="(" separator="or" close=")">
  1024. "orderNumber" like '%${item}%'
  1025. </foreach>
  1026. </if>
  1027. <if test="capacityNumber != null">
  1028. and
  1029. <foreach collection="capacityNumber" item="item" open="(" separator="or" close=")">
  1030. "capacityNumber" like '%${item}%'
  1031. </foreach>
  1032. </if>
  1033. <if test="gatepostName != null">
  1034. and
  1035. <foreach collection="gatepostName" item="item" open="(" separator="or" close=")">
  1036. "gatepostName" like '%${item}%'
  1037. </foreach>
  1038. </if>
  1039. <if test="resultOutMode != null">
  1040. and
  1041. <foreach collection="resultOutMode" item="item" open="(" separator="or" close=")">
  1042. "resultOutMode" like '%${item}%'
  1043. </foreach>
  1044. </if>
  1045. <if test="resultOutGateTime != null">
  1046. and
  1047. <foreach collection="resultOutGateTime" item="item" open="(" separator="or" close=")">
  1048. "resultOutGateTime" like '%${item}%'
  1049. </foreach>
  1050. </if>
  1051. <if test="resultTruckSnapshotPicture != null">
  1052. and
  1053. <foreach collection="resultTruckSnapshotPicture" item="item" open="(" separator="or" close=")">
  1054. "resultTruckSnapshotPicture" like '%${item}%'
  1055. </foreach>
  1056. </if>
  1057. </where>
  1058. <include refid="orderByOutTime"></include>
  1059. </select>
  1060. <select id="getDeliveryOrder" parameterType="java.lang.String" resultType="java.util.Map">
  1061. select
  1062. aso.sale_number "saleNo" ,
  1063. oo.order_number "orderNumber",
  1064. rc.capacity_number "capacityNumber",
  1065. rce.consignee_company_name "consigeeName",
  1066. rcr.carrier_name "carrierName",
  1067. rca.address_province "province",
  1068. rca.address_district "district",
  1069. rca.address_town "town",
  1070. rca.address_delivery_address "deliveryAddress",
  1071. asom.sale_order_consignee "consignee",
  1072. asom.sale_order_consignee_tel "consigneeTel",
  1073. asom.sale_date_of_receipt "receiptDate",
  1074. rsh.SHIPPER_NAME "shippername",
  1075. sysdate "sendDate"
  1076. from omstruck_order oo
  1077. left join
  1078. rms_capacity rc
  1079. on
  1080. rc.capacity_id = oo.capacity_id
  1081. left join
  1082. ams_sale_order_material asom
  1083. on
  1084. asom.sale_order_material_id = oo.order_plan_id
  1085. left join
  1086. ams_sale_order aso
  1087. on
  1088. aso.sale_order_id = asom.sale_order_id
  1089. left join
  1090. rms_consignee rce
  1091. on
  1092. rce.consignee_id = aso.receive_id
  1093. left join
  1094. ams_dispatch_sale_order adso
  1095. on
  1096. adso.sale_order_material_id = asom.sale_order_material_id
  1097. left join
  1098. rms_carrier rcr
  1099. on
  1100. rcr.carrier_id = adso.carrier_id
  1101. left join
  1102. rms_receive_address rca
  1103. on
  1104. rca.address_id = asom.sale_shipping_address_id
  1105. left join RMS_SHIPPER rsh
  1106. on rsh.SHIPPER_ID = aso.SHIPPER_ID
  1107. where oo.order_number =#{orderNumber}
  1108. </select>
  1109. <select id="getDeliveryOrderMaterial" parameterType="java.lang.String" resultType="java.util.LinkedHashMap">
  1110. select
  1111. rm.material_name "materialName",
  1112. rm.material_specification "materialSpe",
  1113. rm.material_model "materialModel",
  1114. oom.order_material_number "materialNumber",
  1115. oom.order_material_weight "materialWeight",
  1116. ruom.unit_of_measure_name "measureName",
  1117. twr.RESULT_NET_WEIGHT "resultWeight"
  1118. from omstruck_order oo
  1119. left join
  1120. omstruck_order_material oom
  1121. on
  1122. oom.order_id = oo.order_id
  1123. left join
  1124. rms_material rm
  1125. on
  1126. rm.material_id = oom.order_material_id
  1127. left join
  1128. rms_unit_of_measure ruom
  1129. on
  1130. ruom.unit_of_measure_id = rm.unit_of_measure_id
  1131. left join
  1132. TMSTRUCK_TOTAL_RESULT ttr
  1133. on ttr.ORDER_ID = oo.ORDER_ID
  1134. left join
  1135. TMSTRUCK_WEIGHT_RESULT twr
  1136. on
  1137. twr.RESULT_TOTAL_ID = ttr.ORDER_ID
  1138. and twr.MATERIAL_ID = oom.MATERIAL_ID
  1139. where oo.order_number = #{orderNumber}
  1140. </select>
  1141. <!--零星物资 -->
  1142. <select id="getSporadicLeaveFactory" parameterType="java.util.Map" resultType="java.util.Map">
  1143. select *
  1144. from (
  1145. select TLFR.RESULT_ID "resultId",
  1146. OO.ORDER_NUMBER "orderNumber",
  1147. RC.CAPACITY_NUMBER "capacityNumber",
  1148. RG.GATEPOST_NAME "gatepostName",
  1149. TLFR.RESULT_OUT_MODE "resultOutMode",
  1150. TLFR.RESULT_OUT_GATE_TIME "resultOutGateTime",
  1151. TLFR.RESULT_TRUCK_SNAPSHOT_PICTURE "resultTruckSnapshotPicture",
  1152. RM.MATERIAL_NAME "materialName",
  1153. OOM.ORDER_MATERIAL_WEIGHT "materialWeight",
  1154. OOM.ORDER_MATERIAL_NUMBER "materialNumber"
  1155. from TMSTRUCK_LEAVE_FACTORY_RESULT TLFR
  1156. left join TMSTRUCK_TOTAL_RESULT TTR
  1157. on TTR.RESULT_TOTAL_ID = TLFR.RESULT_TOTAL_ID
  1158. left join OMSTRUCK_ORDER OO
  1159. on OO.ORDER_ID = TTR.ORDER_ID
  1160. left join OMSTRUCK_ORDER_MATERIAL OOM
  1161. on OO.ORDER_ID=OOM.ORDER_ID
  1162. left join RMS_MATERIAL RM
  1163. on RM.MATERIAL_ID=OOM.MATERIAL_ID
  1164. left join AMSTRUCK_SPORADIC_ORDER ASO
  1165. on ASO.SPORADIC_ORDER_ID = OO.ORDER_PLAN_ID
  1166. left join RMS_CAPACITY RC
  1167. on RC.CAPACITY_ID = OO.CAPACITY_ID
  1168. left join RMS_GATEPOST RG
  1169. on RG.GATEPOST_ID = TLFR.GATEPOST_ID
  1170. where RESULT_OUT_GATE_TIME is not null
  1171. and OO.ORDER_TYPE = #{orderTypee}
  1172. )
  1173. <where>
  1174. <if test="orderNumber != null">
  1175. <foreach collection="orderNumber" item="item" open="(" separator="or" close=")">
  1176. "orderNumber" like '%${item}%'
  1177. </foreach>
  1178. </if>
  1179. <if test="capacityNumber != null">
  1180. and
  1181. <foreach collection="capacityNumber" item="item" open="(" separator="or" close=")">
  1182. "capacityNumber" like '%${item}%'
  1183. </foreach>
  1184. </if>
  1185. <if test="gatepostName != null">
  1186. and
  1187. <foreach collection="gatepostName" item="item" open="(" separator="or" close=")">
  1188. "gatepostName" like '%${item}%'
  1189. </foreach>
  1190. </if>
  1191. <if test="resultOutMode != null">
  1192. and
  1193. <foreach collection="resultOutMode" item="item" open="(" separator="or" close=")">
  1194. "resultOutMode" like '%${item}%'
  1195. </foreach>
  1196. </if>
  1197. <if test="resultOutGateTime != null">
  1198. and
  1199. <foreach collection="resultOutGateTime" item="item" open="(" separator="or" close=")">
  1200. "resultOutGateTime" like '%${item}%'
  1201. </foreach>
  1202. </if>
  1203. <if test="resultTruckSnapshotPicture != null">
  1204. and
  1205. <foreach collection="resultTruckSnapshotPicture" item="item" open="(" separator="or" close=")">
  1206. "resultTruckSnapshotPicture" like '%${item}%'
  1207. </foreach>
  1208. </if>
  1209. </where>
  1210. <include refid="orderByOutTime"></include>
  1211. </select>
  1212. </mapper>