TmstruckLeaveFactoryResultMapper.xml 56 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233
  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. TWR.RESULT_NET_WEIGHT "netWeight",
  467. DB.RESULT_FOREIGN_SHIP_NAME "resultForeignShipName",
  468. OO.ORDER_NUMBER "orderNumber",
  469. RC.CAPACITY_NUMBER "capacityNumber",
  470. RG.GATEPOST_NAME "gatepostName",
  471. TLFR.RESULT_OUT_MODE "resultOutMode",
  472. TLFR.RESULT_OUT_GATE_TIME "resultOutGateTime",
  473. TLFR.RESULT_TRUCK_SNAPSHOT_PICTURE "resultTruckSnapshotPicture"
  474. from TMSTRUCK_LEAVE_FACTORY_RESULT TLFR
  475. left join TMSTRUCK_TOTAL_RESULT TTR
  476. on TTR.RESULT_TOTAL_ID = TLFR.RESULT_TOTAL_ID
  477. left join TMSTRUCK_WEIGHT_RESULT TWR
  478. on TWR.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
  479. left join OMSTRUCK_ORDER OO
  480. on OO.ORDER_ID = TTR.ORDER_ID
  481. left join AMS_PURCHASE_ORDER APO
  482. on APO.PURCHASE_ORDER_ID = OO.ORDER_PLAN_ID
  483. left join DIL_BATCH DB
  484. on DB.BATCH_ID = APO.BATCH_ID
  485. left join OMSTRUCK_ORDER_MATERIAL OOM
  486. on OOM.ORDER_ID = OO.ORDER_ID
  487. left join RMS_MATERIAL RM
  488. on RM.MATERIAL_ID = OOM.MATERIAL_ID
  489. left join RMS_CAPACITY RC
  490. on RC.CAPACITY_ID = OO.CAPACITY_ID
  491. <if test="carrierSsoId != null">
  492. left join RMS_CARRIER RCA
  493. on RCA.CARRIER_ID = OO.CARRIER_ID
  494. </if>
  495. left join RMS_GATEPOST RG
  496. on RG.GATEPOST_ID = TLFR.GATEPOST_ID
  497. where RESULT_OUT_GATE_TIME is not null and OO.ORDER_TYPE = #{orderTypee}
  498. <if test="carrierSsoId != null">
  499. and RCA.CARRIER_SSO_ID = #{carrierSsoId}
  500. </if>
  501. <if test="oneDate != null">
  502. and to_date(#{oneDate}, 'yyyy-mm-dd hh24:mi:ss') &lt;= TLFR.RESULT_OUT_GATE_TIME
  503. </if>
  504. <if test="startDate != null">
  505. and to_date(#{startDate}, 'yyyy-mm-dd hh24:mi:ss') &lt;= TLFR.RESULT_OUT_GATE_TIME
  506. and to_date(#{endDate}, 'yyyy-mm-dd hh24:mi:ss') >= TLFR.RESULT_OUT_GATE_TIME
  507. </if>
  508. )
  509. <where>
  510. <if test="purchaseOrderNo != null">
  511. <foreach collection="purchaseOrderNo" item="item" open="(" separator="or" close=")">
  512. "purchaseOrderNo" like '%${item}%'
  513. </foreach>
  514. </if>
  515. <if test="materialName != null">
  516. and
  517. <foreach collection="materialName" item="item" open="(" separator="or" close=")">
  518. "materialName" like '%${item}%'
  519. </foreach>
  520. </if>
  521. <if test="netWeight != null">
  522. and
  523. <foreach collection="netWeight" item="item" open="(" separator="or" close=")">
  524. "netWeight" like '%${item}%'
  525. </foreach>
  526. </if>
  527. <if test="resultForeignShipName != null">
  528. and
  529. <foreach collection="resultForeignShipName" item="item" open="(" separator="or" close=")">
  530. "resultForeignShipName" like '%${item}%'
  531. </foreach>
  532. </if>
  533. <if test="orderNumber != null">
  534. and
  535. <foreach collection="orderNumber" item="item" open="(" separator="or" close=")">
  536. "orderNumber" like '%${item}%'
  537. </foreach>
  538. </if>
  539. <if test="capacityNumber != null">
  540. and
  541. <foreach collection="capacityNumber" item="item" open="(" separator="or" close=")">
  542. "capacityNumber" like '%${item}%'
  543. </foreach>
  544. </if>
  545. <if test="gatepostName != null">
  546. and
  547. <foreach collection="gatepostName" item="item" open="(" separator="or" close=")">
  548. "gatepostName" like '%${item}%'
  549. </foreach>
  550. </if>
  551. <if test="resultOutMode != null">
  552. and
  553. <foreach collection="resultOutMode" item="item" open="(" separator="or" close=")">
  554. "resultOutMode" like '%${item}%'
  555. </foreach>
  556. </if>
  557. <if test="resultOutGateTime != null">
  558. and
  559. <foreach collection="resultOutGateTime" item="item" open="(" separator="or" close=")">
  560. "resultOutGateTime" like '%${item}%'
  561. </foreach>
  562. </if>
  563. <if test="resultTruckSnapshotPicture != null">
  564. and
  565. <foreach collection="resultTruckSnapshotPicture" item="item" open="(" separator="or" close=")">
  566. "resultTruckSnapshotPicture" like '%${item}%'
  567. </foreach>
  568. </if>
  569. </where>
  570. <include refid="orderByOutTime"></include>
  571. </select>
  572. <!-- 通过运输订单号查询 路段顺序号是否为 4 :已计皮-->
  573. <select id="selectTransportRoute" parameterType="string" resultType="int">
  574. select ORDER_LINE_SEQUENCE
  575. from OMSTRUCK_ORDER
  576. where ORDER_NUMBER = #{orderNumber}
  577. </select>
  578. <!-- 通过运输订单号查询 出厂门岗ID 和 实绩ID -->
  579. <select id="selectCnAndGnByOrderNumber" parameterType="string" resultType="java.util.Map">
  580. select RL.LINE_END_NODE_ID "lineEndNodeId",
  581. TTR.RESULT_TOTAL_ID "resultTotalId"
  582. from OMSTRUCK_ORDER OO
  583. left join TMSTRUCK_TOTAL_RESULT TTR
  584. on TTR.ORDER_ID = OO.ORDER_ID
  585. left join RMS_LINE RL
  586. on RL.LINE_ID = OO.LINE_ID
  587. where OO.ORDER_NUMBER = #{orderNumber}
  588. </select>
  589. <!-- 通过运输订单号获取实绩ID -->
  590. <select id="selectResultId" parameterType="java.math.BigDecimal" resultType="java.util.Map">
  591. select *
  592. from (
  593. select TLFR.RESULT_ID "resultId",
  594. TLFR.SEGMENT_SQE "segmentSqe"
  595. from TMSTRUCK_LEAVE_FACTORY_RESULT TLFR
  596. where TLFR.RESULT_TOTAL_ID = #{resultTotalId} and TLFR.RESULT_OUT_GATE_TIME is null
  597. order by TLFR.SEGMENT_SQE
  598. )
  599. where rownum = 1
  600. </select>
  601. <!--销售物流查询所有的出厂实绩-->
  602. <select id="selectAllLeaveFacatoryForSale" resultType="java.util.Map">
  603. select *
  604. from (
  605. select
  606. TLFR.RESULT_OUT_GATE_TIME "resultOutGateTime",
  607. TLFR.RESULT_OUT_MODE "resultOutMode",
  608. RG.GATEPOST_NAME "gatepostName",
  609. OO.ORDER_NUMBER "orderNumber",
  610. RC.CAPACITY_NUMBER "capacityNumber",
  611. OO.ORDER_ID "orderId",
  612. ASO.SALE_NUMBER "saleNum",
  613. RS.SUPPLIER_NAME "shipperName",
  614. RCON.CONSIGNEE_COMPANY_NAME "supplierName"
  615. FROM TMSTRUCK_LEAVE_FACTORY_RESULT TLFR
  616. LEFT JOIN TMSTRUCK_TOTAL_RESULT TTR
  617. ON TTR.RESULT_TOTAL_ID = TLFR.RESULT_TOTAL_ID
  618. LEFT JOIN OMSTRUCK_ORDER OO
  619. ON OO.ORDER_ID = TTR.ORDER_ID
  620. LEFT JOIN AMS_SALE_ORDER_MATERIAL ASOM
  621. ON ASOM.SALE_ORDER_MATERIAL_ID = OO.ORDER_PLAN_ID
  622. LEFT JOIN AMS_SALE_ORDER ASO
  623. ON ASO.SALE_ORDER_ID = ASOM.SALE_ORDER_ID
  624. LEFT JOIN RMS_GATEPOST RG
  625. ON RG.GATEPOST_ID = TLFR.GATEPOST_ID
  626. LEFT JOIN RMS_CAPACITY RC
  627. ON RC.CAPACITY_ID = OO.CAPACITY_ID
  628. LEFT JOIN RMS_SUPPLIER RS
  629. ON RS.SUPPLIER_ID = ASO.SHIPPER_ID
  630. LEFT JOIN RMS_CONSIGNEE RCON
  631. ON RCON.CONSIGNEE_ID = ASO.RECEIVE_ID
  632. WHERE TLFR.RESULT_OUT_GATE_TIME IS NOT NULL
  633. AND OO.ORDER_TYPE IN (1, 2, 3)
  634. <if test="oneDate != null">
  635. and to_date(#{oneDate}, 'yyyy-mm-dd hh24:mi:ss') &lt;= TLFR.RESULT_OUT_GATE_TIME
  636. </if>
  637. <if test="startDate != null">
  638. and to_date(#{startDate}, 'yyyy-mm-dd hh24:mi:ss') &lt;= TLFR.RESULT_OUT_GATE_TIME
  639. and to_date(#{endDate}, 'yyyy-mm-dd hh24:mi:ss') >= TLFR.RESULT_OUT_GATE_TIME
  640. </if>
  641. )
  642. <where>
  643. <if test="saleNum != null">
  644. <foreach collection="saleNum" item="item" open="(" separator="or" close=")">
  645. "saleNum" like '%${item}%'
  646. </foreach>
  647. </if>
  648. <if test="gatepostName != null">
  649. and
  650. <foreach collection="gatepostName" item="item" open="(" separator="or" close=")">
  651. "gatepostName" like '%${item}%'
  652. </foreach>
  653. </if>
  654. <if test="orderNumber != null">
  655. and
  656. <foreach collection="orderNumber" item="item" open="(" separator="or" close=")">
  657. "orderNumber" like '%${item}%'
  658. </foreach>
  659. </if>
  660. <if test="capacityNumber != null">
  661. and
  662. <foreach collection="capacityNumber" item="item" open="(" separator="or" close=")">
  663. "capacityNumber" like '%${item}%'
  664. </foreach>
  665. </if>
  666. <if test="shipperName != null">
  667. and
  668. <foreach collection="shipperName" item="item" open="(" separator="or" close=")">
  669. "shipperName" like '%${item}%'
  670. </foreach>
  671. </if>
  672. <if test="resultEntryMode != null">
  673. and
  674. <foreach collection="resultEntryMode" item="item" open="(" separator="or" close=")">
  675. "resultEntryMode" like '%${item}%'
  676. </foreach>
  677. </if>
  678. <if test="resultEntryGateTime != null">
  679. and
  680. <foreach collection="resultEntryGateTime" item="item" open="(" separator="or" close=")">
  681. "resultEntryGateTime" like '%${item}%'
  682. </foreach>
  683. </if>
  684. <if test="supplierName != null">
  685. and
  686. <foreach collection="supplierName" item="item" open="(" separator="or" close=")">
  687. "supplierName" like '%${item}%'
  688. </foreach>
  689. </if>
  690. </where>
  691. <include refid="orderByOutTime"></include>
  692. </select>
  693. <!-- 通过总实绩Id 查询出厂实绩ID -->
  694. <select id="getResultIdByTotalId" parameterType="int" resultType="java.math.BigDecimal">
  695. select *
  696. from (
  697. select TLFR.RESULT_ID
  698. from TMSTRUCK_LEAVE_FACTORY_RESULT TLFR
  699. where TLFR.RESULT_TOTAL_ID = #{resultTotalId}
  700. and TLFR.RESULT_OUT_GATE_TIME is null
  701. order by TLFR.SEGMENT_SQE
  702. )
  703. where rownum = 1
  704. </select>
  705. <select id="getTruckFactoryResult" resultType="java.util.Map">
  706. SELECT * from(
  707. SELECT
  708. -- 出厂时间
  709. to_char(TLFR.RESULT_OUT_GATE_TIME,'yyyy-mm-dd hh24:mi:ss') "resultOutGateTime",
  710. --出厂抓拍图片
  711. TLFR.RESULT_TRUCK_SNAPSHOT_PICTURE "resultTruckSnapshotPicture",
  712. --出厂方式
  713. TLFR.RESULT_OUT_MODE "resultOutMode",
  714. --门岗名称
  715. RG.GATEPOST_NAME "gatepostName",
  716. -- 运输订单号
  717. OO.ORDER_NUMBER "orderNumber",
  718. -- 车牌号
  719. RC.CAPACITY_NUMBER "capacityNumber",
  720. -- 运输订单id
  721. OO.ORDER_ID "orderId",
  722. -- 订单类型
  723. OO.ORDER_TYPE "orderType",
  724. -- 销售订单号
  725. ASO.SALE_NUMBER "saleNum",
  726. -- 收货地址
  727. RRA.ADDRESS_DELIVERY_ADDRESS "receiveAddress",
  728. -- 收货单位
  729. RS.SUPPLIER_NAME "supplierName" ,
  730. -- 发货单位
  731. RS2.SHIPPER_NAME "shipperName"
  732. FROM
  733. -- 出厂实绩
  734. TMSTRUCK_LEAVE_FACTORY_RESULT TLFR
  735. -- 总实绩
  736. LEFT JOIN TMSTRUCK_TOTAL_RESULT TTR ON TLFR.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
  737. -- 运输订单
  738. LEFT JOIN OMSTRUCK_ORDER OO ON TTR.ORDER_ID = OO.ORDER_ID
  739. -- 销售订单信息
  740. LEFT JOIN AMS_SALE_ORDER ASO ON OO.ORDER_PLAN_ID = ASO.SALE_ORDER_ID
  741. -- 托运人
  742. LEFT JOIN RMS_SUPPLIER RS ON ASO.SHIPPER_ID = RS.SUPPLIER_ID
  743. -- 门岗
  744. LEFT JOIN RMS_GATEPOST RG ON TLFR.GATEPOST_ID = RG.GATEPOST_ID
  745. -- 运力信息
  746. LEFT JOIN RMS_CAPACITY RC ON OO.CAPACITY_ID = RC.CAPACITY_ID
  747. -- 销售订单中间表
  748. LEFT JOIN AMS_SALE_ORDER_MATERIAL ASOM ON ASOM.SALE_ORDER_MATERIAL_ID =OO.ORDER_PLAN_ID
  749. -- 收货地址
  750. LEFT JOIN RMS_RECEIVE_ADDRESS RRA ON ASOM.SALE_SHIPPING_ADDRESS_ID =RRA.ADDRESS_ID
  751. -- 收货单位
  752. LEFT JOIN RMS_SHIPPER RS2 ON ASO.SHIPPER_ID = RS2.SHIPPER_ID
  753. WHERE
  754. -- 判断出厂实绩的出厂时间不为空
  755. TLFR.RESULT_OUT_GATE_TIME IS NOT NULL
  756. -- 并且订单类型等于1(销售订单),2(焦炭发运计划),3(水渣发运计划)
  757. AND OO.ORDER_TYPE =1 AND OO.ORDER_NUMBER=#{orderNumber}
  758. )
  759. </select>
  760. <!-- 查询内转钢材到异地库出厂实绩 -->
  761. <select id="selectSteelNzLeaveFactory" parameterType="java.util.Map" resultType="java.util.Map">
  762. SELECT
  763. *
  764. FROM (
  765. SELECT
  766. OO.ORDER_ID "orderId",
  767. TLFR.RESULT_ID "resultId",
  768. AROD.DAYPLAN_NO "dayplanNo",
  769. OO.ORDER_NUMBER "orderNumber",
  770. RG.GATEPOST_NAME "gatepostName",
  771. TLFR.RESULT_OUT_MODE "resultOutMode",
  772. RC.CAPACITY_NUMBER "capacityNumber",
  773. TLFR.RESULT_OUT_GATE_TIME "resultOutGateTime",
  774. TLFR.RESULT_TRUCK_SNAPSHOT_PICTURE "resultTruckSnapshotPicture"
  775. FROM TMSTRUCK_LEAVE_FACTORY_RESULT TLFR
  776. LEFT JOIN TMSTRUCK_TOTAL_RESULT TTR
  777. ON TTR.RESULT_TOTAL_ID = TLFR.RESULT_TOTAL_ID
  778. LEFT JOIN OMSTRUCK_ORDER OO
  779. ON OO.ORDER_ID = TTR.ORDER_ID
  780. LEFT JOIN AMS_RAIL_OFFSET_DAYPLAN AROD
  781. ON AROD.DAYPLAN_ID = OO.ORDER_PLAN_ID
  782. LEFT JOIN RMS_CAPACITY RC
  783. ON RC.CAPACITY_ID = OO.CAPACITY_ID
  784. LEFT JOIN RMS_GATEPOST RG
  785. ON RG.GATEPOST_ID = TLFR.GATEPOST_ID
  786. WHERE OO.ORDER_TYPE = 4
  787. AND TLFR.RESULT_OUT_GATE_TIME IS NOT NULL
  788. <if test="oneDate != null">
  789. and to_date(#{oneDate}, 'yyyy-mm-dd hh24:mi:ss') &lt;= TLFR.RESULT_OUT_GATE_TIME
  790. </if>
  791. <if test="startDate != null">
  792. and to_date(#{startDate}, 'yyyy-mm-dd hh24:mi:ss') &lt;= TLFR.RESULT_OUT_GATE_TIME
  793. and to_date(#{endDate}, 'yyyy-mm-dd hh24:mi:ss') >= TLFR.RESULT_OUT_GATE_TIME
  794. </if>
  795. )
  796. <where>
  797. <if test="dayplanNo != null">
  798. <foreach collection="dayplanNo" item="item" open="(" separator="or" close=")">
  799. "dayplanNo" like '%${item}%'
  800. </foreach>
  801. </if>
  802. <if test="orderNumber != null">
  803. and
  804. <foreach collection="orderNumber" item="item" open="(" separator="or" close=")">
  805. "orderNumber" like '%${item}%'
  806. </foreach>
  807. </if>
  808. <if test="gatepostName != null">
  809. and
  810. <foreach collection="gatepostName" item="item" open="(" separator="or" close=")">
  811. "gatepostName" like '%${item}%'
  812. </foreach>
  813. </if>
  814. <if test="resultOutMode != null">
  815. and
  816. <foreach collection="resultOutMode" item="item" open="(" separator="or" close=")">
  817. "resultOutMode" like '%${item}%'
  818. </foreach>
  819. </if>
  820. <if test="capacityNumber != null">
  821. and
  822. <foreach collection="capacityNumber" item="item" open="(" separator="or" close=")">
  823. "dayplanNo" like '%${item}%'
  824. </foreach>
  825. </if>
  826. <if test="resultOutGateTime != null">
  827. and
  828. <foreach collection="resultOutGateTime" item="item" open="(" separator="or" close=")">
  829. "resultOutGateTime" like '%${item}%'
  830. </foreach>
  831. </if>
  832. <if test="resultTruckSnapshotPicture != null">
  833. and
  834. <foreach collection="resultTruckSnapshotPicture" item="item" open="(" separator="or" close=")">
  835. "resultTruckSnapshotPicture" like '%${item}%'
  836. </foreach>
  837. </if>
  838. </where>
  839. <include refid="orderByOutTime"></include>
  840. </select>
  841. <!-- 查询内转国产矿进口矿 -->
  842. <select id="getImportedDomesticNzEnFactoryResult" resultType="java.util.Map">
  843. select *
  844. from (
  845. select TLFR.RESULT_ID "resultId",
  846. APO.PURCHASE_ORDER_NO "purchaseOrderNo",
  847. RM.MATERIAL_NAME "materialName",
  848. DB.RESULT_FOREIGN_SHIP_NAME "resultForeignShipName",
  849. OO.ORDER_NUMBER "orderNumber",
  850. RC.CAPACITY_NUMBER "capacityNumber",
  851. RG.GATEPOST_NAME "gatepostName",
  852. TLFR.RESULT_OUT_MODE "resultOutMode",
  853. TLFR.RESULT_OUT_GATE_TIME "resultOutGateTime",
  854. TLFR.RESULT_TRUCK_SNAPSHOT_PICTURE "resultTruckSnapshotPicture"
  855. from TMSTRUCK_LEAVE_FACTORY_RESULT TLFR
  856. left join TMSTRUCK_TOTAL_RESULT TTR
  857. on TTR.RESULT_TOTAL_ID = TLFR.RESULT_TOTAL_ID
  858. left join OMSTRUCK_ORDER OO
  859. on OO.ORDER_ID = TTR.ORDER_ID
  860. left join AMS_PURCHASE_ORDER APO
  861. on APO.PURCHASE_ORDER_ID = OO.ORDER_PLAN_ID
  862. left join DIL_BATCH DB
  863. on DB.BATCH_ID = APO.BATCH_ID
  864. left join OMSTRUCK_ORDER_MATERIAL OOM
  865. on OOM.ORDER_ID = OO.ORDER_ID
  866. left join RMS_MATERIAL RM
  867. on RM.MATERIAL_ID = OOM.MATERIAL_ID
  868. left join RMS_CAPACITY RC
  869. on RC.CAPACITY_ID = OO.CAPACITY_ID
  870. left join RMS_GATEPOST RG
  871. on RG.GATEPOST_ID = TLFR.GATEPOST_ID
  872. where RESULT_OUT_GATE_TIME is not null
  873. and OO.ORDER_TYPE = 9
  874. <if test="oneDate != null">
  875. and to_date(#{oneDate}, 'yyyy-mm-dd hh24:mi:ss') &lt;= TLFR.RESULT_OUT_GATE_TIME
  876. </if>
  877. <if test="startDate != null">
  878. and to_date(#{startDate}, 'yyyy-mm-dd hh24:mi:ss') &lt;= TLFR.RESULT_OUT_GATE_TIME
  879. and to_date(#{endDate}, 'yyyy-mm-dd hh24:mi:ss') >= TLFR.RESULT_OUT_GATE_TIME
  880. </if>
  881. )
  882. <where>
  883. <if test="purchaseOrderNo != null">
  884. <foreach collection="purchaseOrderNo" item="item" open="(" separator="or" close=")">
  885. "purchaseOrderNo" like '%${item}%'
  886. </foreach>
  887. </if>
  888. <if test="materialName != null">
  889. and
  890. <foreach collection="materialName" item="item" open="(" separator="or" close=")">
  891. "materialName" like '%${item}%'
  892. </foreach>
  893. </if>
  894. <if test="resultForeignShipName != null">
  895. and
  896. <foreach collection="resultForeignShipName" item="item" open="(" separator="or" close=")">
  897. "resultForeignShipName" like '%${item}%'
  898. </foreach>
  899. </if>
  900. <if test="orderNumber != null">
  901. and
  902. <foreach collection="orderNumber" item="item" open="(" separator="or" close=")">
  903. "orderNumber" like '%${item}%'
  904. </foreach>
  905. </if>
  906. <if test="capacityNumber != null">
  907. and
  908. <foreach collection="capacityNumber" item="item" open="(" separator="or" close=")">
  909. "capacityNumber" like '%${item}%'
  910. </foreach>
  911. </if>
  912. <if test="gatepostName != null">
  913. and
  914. <foreach collection="gatepostName" item="item" open="(" separator="or" close=")">
  915. "gatepostName" like '%${item}%'
  916. </foreach>
  917. </if>
  918. <if test="resultOutMode != null">
  919. and
  920. <foreach collection="resultOutMode" item="item" open="(" separator="or" close=")">
  921. "resultOutMode" like '%${item}%'
  922. </foreach>
  923. </if>
  924. <if test="resultOutGateTime != null">
  925. and
  926. <foreach collection="resultOutGateTime" item="item" open="(" separator="or" close=")">
  927. "resultOutGateTime" like '%${item}%'
  928. </foreach>
  929. </if>
  930. <if test="resultTruckSnapshotPicture != null">
  931. and
  932. <foreach collection="resultTruckSnapshotPicture" item="item" open="(" separator="or" close=")">
  933. "resultTruckSnapshotPicture" like '%${item}%'
  934. </foreach>
  935. </if>
  936. </where>
  937. <include refid="orderByOutTime"></include>
  938. </select>
  939. <!-- 查询内转厂内物资出厂实绩 -->
  940. <select id="getInFactoryOutFactoryResult" parameterType="java.util.Map" resultType="java.util.Map">
  941. select *
  942. from (
  943. select TLFR.RESULT_ID "resultId",
  944. OO.ORDER_NUMBER "orderNumber",
  945. RC.CAPACITY_NUMBER "capacityNumber",
  946. RG.GATEPOST_NAME "gatepostName",
  947. TLFR.RESULT_OUT_MODE "resultOutMode",
  948. TLFR.RESULT_OUT_GATE_TIME "resultOutGateTime",
  949. TLFR.RESULT_TRUCK_SNAPSHOT_PICTURE "resultTruckSnapshotPicture"
  950. from TMSTRUCK_LEAVE_FACTORY_RESULT TLFR
  951. left join TMSTRUCK_TOTAL_RESULT TTR
  952. on TTR.RESULT_TOTAL_ID = TLFR.RESULT_TOTAL_ID
  953. left join OMSTRUCK_ORDER OO
  954. on OO.ORDER_ID = TTR.ORDER_ID
  955. left join RMS_CAPACITY RC
  956. on RC.CAPACITY_ID = OO.CAPACITY_ID
  957. left join RMS_GATEPOST RG
  958. on RG.GATEPOST_ID = TLFR.GATEPOST_ID
  959. where RESULT_OUT_GATE_TIME is not null
  960. and OO.ORDER_TYPE = 11
  961. <if test="oneDate != null">
  962. and to_date(#{oneDate}, 'yyyy-mm-dd hh24:mi:ss') &lt;= TLFR.RESULT_OUT_GATE_TIME
  963. </if>
  964. <if test="startDate != null">
  965. and to_date(#{startDate}, 'yyyy-mm-dd hh24:mi:ss') &lt;= TLFR.RESULT_OUT_GATE_TIME
  966. and to_date(#{endDate}, 'yyyy-mm-dd hh24:mi:ss') >= TLFR.RESULT_OUT_GATE_TIME
  967. </if>
  968. )
  969. <where>
  970. <if test="orderNumber != null">
  971. <foreach collection="orderNumber" item="item" open="(" separator="or" close=")">
  972. "orderNumber" like '%${item}%'
  973. </foreach>
  974. </if>
  975. <if test="capacityNumber != null">
  976. and
  977. <foreach collection="capacityNumber" item="item" open="(" separator="or" close=")">
  978. "capacityNumber" like '%${item}%'
  979. </foreach>
  980. </if>
  981. <if test="gatepostName != null">
  982. and
  983. <foreach collection="gatepostName" item="item" open="(" separator="or" close=")">
  984. "gatepostName" like '%${item}%'
  985. </foreach>
  986. </if>
  987. <if test="resultOutMode != null">
  988. and
  989. <foreach collection="resultOutMode" item="item" open="(" separator="or" close=")">
  990. "resultOutMode" like '%${item}%'
  991. </foreach>
  992. </if>
  993. <if test="resultOutGateTime != null">
  994. and
  995. <foreach collection="resultOutGateTime" item="item" open="(" separator="or" close=")">
  996. "resultOutGateTime" like '%${item}%'
  997. </foreach>
  998. </if>
  999. <if test="resultTruckSnapshotPicture != null">
  1000. and
  1001. <foreach collection="resultTruckSnapshotPicture" item="item" open="(" separator="or" close=")">
  1002. "resultTruckSnapshotPicture" like '%${item}%'
  1003. </foreach>
  1004. </if>
  1005. </where>
  1006. <include refid="orderByOutTime"></include>
  1007. </select>
  1008. <select id="getDeliveryOrder" parameterType="java.lang.String" resultType="java.util.Map">
  1009. select
  1010. aso.sale_number "saleNo" ,
  1011. oo.order_number "orderNumber",
  1012. rc.capacity_number "capacityNumber",
  1013. rce.consignee_company_name "consigeeName",
  1014. rcr.carrier_name "carrierName",
  1015. rca.address_province "province",
  1016. rca.address_district "district",
  1017. rca.address_town "town",
  1018. rca.address_delivery_address "deliveryAddress",
  1019. asom.sale_order_consignee "consignee",
  1020. asom.sale_order_consignee_tel "consigneeTel",
  1021. asom.sale_date_of_receipt "receiptDate",
  1022. rsh.SHIPPER_NAME "shippername",
  1023. sysdate "sendDate"
  1024. from omstruck_order oo
  1025. left join
  1026. rms_capacity rc
  1027. on
  1028. rc.capacity_id = oo.capacity_id
  1029. left join
  1030. ams_sale_order_material asom
  1031. on
  1032. asom.sale_order_material_id = oo.order_plan_id
  1033. left join
  1034. ams_sale_order aso
  1035. on
  1036. aso.sale_order_id = asom.sale_order_id
  1037. left join
  1038. rms_consignee rce
  1039. on
  1040. rce.consignee_id = aso.receive_id
  1041. left join
  1042. ams_dispatch_sale_order adso
  1043. on
  1044. adso.sale_order_material_id = asom.sale_order_material_id
  1045. left join
  1046. rms_carrier rcr
  1047. on
  1048. rcr.carrier_id = adso.carrier_id
  1049. left join
  1050. rms_receive_address rca
  1051. on
  1052. rca.address_id = asom.sale_shipping_address_id
  1053. left join RMS_SHIPPER rsh
  1054. on rsh.SHIPPER_ID = aso.SHIPPER_ID
  1055. where oo.order_number =#{orderNumber}
  1056. </select>
  1057. <select id="getDeliveryOrderMaterial" parameterType="java.lang.String" resultType="java.util.LinkedHashMap">
  1058. select
  1059. rm.material_name "materialName",
  1060. rm.material_specification "materialSpe",
  1061. rm.material_model "materialModel",
  1062. oom.order_material_number "materialNumber",
  1063. oom.order_material_weight "materialWeight",
  1064. ruom.unit_of_measure_name "measureName",
  1065. twr.RESULT_NET_WEIGHT "resultWeight"
  1066. from omstruck_order oo
  1067. left join
  1068. omstruck_order_material oom
  1069. on
  1070. oom.order_id = oo.order_id
  1071. left join
  1072. rms_material rm
  1073. on
  1074. rm.material_id = oom.order_material_id
  1075. left join
  1076. rms_unit_of_measure ruom
  1077. on
  1078. ruom.unit_of_measure_id = rm.unit_of_measure_id
  1079. left join
  1080. TMSTRUCK_TOTAL_RESULT ttr
  1081. on ttr.ORDER_ID = oo.ORDER_ID
  1082. left join
  1083. TMSTRUCK_WEIGHT_RESULT twr
  1084. on
  1085. twr.RESULT_TOTAL_ID = ttr.ORDER_ID
  1086. and twr.MATERIAL_ID = oom.MATERIAL_ID
  1087. where oo.order_number = #{orderNumber}
  1088. </select>
  1089. <!--零星物资出厂实绩列表 -->
  1090. <select id="getSporadicLeaveFactory" parameterType="java.util.Map" resultType="java.util.Map">
  1091. select *
  1092. from (
  1093. select distinct TLFR.RESULT_ID "resultId",
  1094. OO.ORDER_NUMBER "orderNumber",
  1095. RC.CAPACITY_NUMBER "capacityNumber",
  1096. RG.GATEPOST_NAME "gatepostName",
  1097. TLFR.RESULT_OUT_MODE "resultOutMode",
  1098. TLFR.RESULT_OUT_GATE_TIME "resultOutGateTime",
  1099. TLFR.RESULT_TRUCK_SNAPSHOT_PICTURE "resultTruckSnapshotPicture",
  1100. RM.MATERIAL_NAME "materialName",
  1101. OOM.ORDER_MATERIAL_WEIGHT "materialWeight",
  1102. OOM.ORDER_MATERIAL_NUMBER "materialNumber",
  1103. TWR.RESULT_NET_WEIGHT "netWeight"
  1104. from TMSTRUCK_LEAVE_FACTORY_RESULT TLFR
  1105. left join TMSTRUCK_TOTAL_RESULT TTR
  1106. on TTR.RESULT_TOTAL_ID = TLFR.RESULT_TOTAL_ID
  1107. left join TMSTRUCK_WEIGHT_RESULT TWR
  1108. on TWR.RESULT_TOTAL_ID=TTR.RESULT_TOTAL_ID
  1109. left join OMSTRUCK_ORDER OO
  1110. on OO.ORDER_ID = TTR.ORDER_ID
  1111. left join OMSTRUCK_ORDER_MATERIAL OOM
  1112. on OO.ORDER_ID=OOM.ORDER_ID
  1113. left join RMS_MATERIAL RM
  1114. on RM.MATERIAL_ID=OOM.MATERIAL_ID
  1115. left join AMSTRUCK_SPORADIC_ORDER ASO
  1116. on ASO.SPORADIC_ORDER_ID = OO.ORDER_PLAN_ID
  1117. left join RMS_CAPACITY RC
  1118. on RC.CAPACITY_ID = OO.CAPACITY_ID
  1119. left join RMS_GATEPOST RG
  1120. on RG.GATEPOST_ID = TLFR.GATEPOST_ID
  1121. where RESULT_OUT_GATE_TIME is not null
  1122. <if test="orderTypee != 100">
  1123. AND OO.ORDER_TYPE = #{orderTypee}
  1124. </if>
  1125. <if test="orderTypee == 100">
  1126. AND OO.ORDER_TYPE in (12, 13 ,14,19)
  1127. </if>
  1128. <if test="userId!=null">
  1129. AND ASO.INSERT_USERNAME=#{userId}
  1130. </if>
  1131. <if test="userIds!=null">
  1132. AND ASO.UPDATE_USERNAME=#{userIds}
  1133. </if>
  1134. <if test="con!=null">
  1135. where "orderNumber" like #{con} or "capacityNumber" like #{con}
  1136. or "gatepostName" like #{con} or "materialName" like #{con}
  1137. </if>
  1138. <if test="oneDate != null">
  1139. and to_date(#{oneDate}, 'yyyy-mm-dd hh24:mi:ss') &lt;= TLFR.RESULT_OUT_GATE_TIME
  1140. </if>
  1141. <if test="startDate != null">
  1142. and to_date(#{startDate}, 'yyyy-mm-dd hh24:mi:ss') &lt;= TLFR.RESULT_OUT_GATE_TIME
  1143. and to_date(#{endDate}, 'yyyy-mm-dd hh24:mi:ss') >= TLFR.RESULT_OUT_GATE_TIME
  1144. </if>
  1145. )
  1146. <where>
  1147. <if test="orderNumber != null">
  1148. <foreach collection="orderNumber" item="item" open="(" separator="or" close=")">
  1149. "orderNumber" like '%${item}%'
  1150. </foreach>
  1151. </if>
  1152. <if test="capacityNumber != null">
  1153. and
  1154. <foreach collection="capacityNumber" item="item" open="(" separator="or" close=")">
  1155. "capacityNumber" like '%${item}%'
  1156. </foreach>
  1157. </if>
  1158. <if test="gatepostName != null">
  1159. and
  1160. <foreach collection="gatepostName" item="item" open="(" separator="or" close=")">
  1161. "gatepostName" like '%${item}%'
  1162. </foreach>
  1163. </if>
  1164. <if test="resultOutMode != null">
  1165. and
  1166. <foreach collection="resultOutMode" item="item" open="(" separator="or" close=")">
  1167. "resultOutMode" like '%${item}%'
  1168. </foreach>
  1169. </if>
  1170. <if test="resultOutGateTime != null">
  1171. and
  1172. <foreach collection="resultOutGateTime" item="item" open="(" separator="or" close=")">
  1173. "resultOutGateTime" like '%${item}%'
  1174. </foreach>
  1175. </if>
  1176. <if test="resultTruckSnapshotPicture != null">
  1177. and
  1178. <foreach collection="resultTruckSnapshotPicture" item="item" open="(" separator="or" close=")">
  1179. "resultTruckSnapshotPicture" like '%${item}%'
  1180. </foreach>
  1181. </if>
  1182. </where>
  1183. <include refid="orderByOutTime"></include>
  1184. </select>
  1185. <!-- 根据采购订单ID查询是否为一车多趟 -->
  1186. <select id="getIsMoreTripsStatus" parameterType="java.math.BigDecimal" resultType="java.lang.Integer">
  1187. select APO.IS_MORE_TRIPS
  1188. from OMSTRUCK_ORDER OO
  1189. left join AMS_PURCHASE_ORDER APO
  1190. on APO.PURCHASE_ORDER_ID = OO.ORDER_PLAN_ID
  1191. where OO.ORDER_ID = #{orderId}
  1192. </select>
  1193. <select id="getPlanEnable" resultType="java.lang.Integer">
  1194. select aip.plan_eable_status
  1195. from omstruck_order oo
  1196. left join amstruck_inward_plan aip
  1197. on aip.plan_id = oo.order_plan_id
  1198. where oo.order_id = #{orderId}
  1199. </select>
  1200. <select id="getSeq" resultType="java.lang.Integer">
  1201. select oo.order_line_sequence from omstruck_order oo
  1202. where oo.order_id =#{orderId}
  1203. </select>
  1204. <select id="getLeaveFactoryList" resultType="java.util.Map"></select>
  1205. </mapper>