TmstruckLeaveFactoryResultMapper.xml 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600
  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="RESULT_TRUCK_SNAPSHOT_PICTURE" jdbcType="BLOB" property="resultTruckSnapshotPicture"/>
  18. </resultMap>
  19. <sql id="columns">
  20. RESULT_ID, RESULT_TOTAL_ID, GATEPOST_ID, RESULT_OUT_MODE, RESULT_OUT_GATE_TIME, INSERT_USERNAME,
  21. INSERT_TIME, UPDATE_USERNAME, UPDATE_TIME, INSERT_UPDATE_REMARK, DELETE_USERNAME,
  22. DELETE_TIME, RESULT_TRUCK_SNAPSHOT_PICTURE
  23. </sql>
  24. <sql id="columns_alias">
  25. t.RESULT_ID, t.RESULT_TOTAL_ID, t.GATEPOST_ID, t.RESULT_OUT_MODE, t.RESULT_OUT_GATE_TIME,
  26. t.INSERT_USERNAME, t.INSERT_TIME, t.UPDATE_USERNAME, t.UPDATE_TIME, t.INSERT_UPDATE_REMARK,
  27. t.DELETE_USERNAME, t.DELETE_TIME, t.RESULT_TRUCK_SNAPSHOT_PICTURE
  28. </sql>
  29. <sql id="select">
  30. SELECT
  31. <include refid="columns"/>
  32. FROM TMSTRUCK_LEAVE_FACTORY_RESULT
  33. </sql>
  34. <sql id="select_alias">
  35. SELECT
  36. <include refid="columns_alias"/>
  37. FROM TMSTRUCK_LEAVE_FACTORY_RESULT t
  38. </sql>
  39. <sql id="where">
  40. <where>
  41. <if test="resultId != null">
  42. and RESULT_ID = #{resultId}
  43. </if>
  44. <if test="resultTotalId != null">
  45. and RESULT_TOTAL_ID = #{resultTotalId}
  46. </if>
  47. <if test="gatepostId != null">
  48. and GATEPOST_ID = #{gatepostId}
  49. </if>
  50. <if test="resultOutMode != null and resultOutMode != ''">
  51. and RESULT_OUT_MODE = #{resultOutMode}
  52. </if>
  53. <if test="resultOutGateTime != null">
  54. and TO_CHAR(RESULT_OUT_GATE_TIME,'yyyy-MM-dd') = #{resultOutGateTime}
  55. </if>
  56. <if test="insertUsername != null and insertUsername != ''">
  57. and INSERT_USERNAME = #{insertUsername}
  58. </if>
  59. <if test="insertTime != null">
  60. and TO_CHAR(INSERT_TIME,'yyyy-MM-dd') = #{insertTime}
  61. </if>
  62. <if test="updateUsername != null and updateUsername != ''">
  63. and UPDATE_USERNAME = #{updateUsername}
  64. </if>
  65. <if test="updateTime != null">
  66. and TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = #{updateTime}
  67. </if>
  68. <if test="insertUpdateRemark != null and insertUpdateRemark != ''">
  69. and INSERT_UPDATE_REMARK = #{insertUpdateRemark}
  70. </if>
  71. <if test="deleteUsername != null and deleteUsername != ''">
  72. and DELETE_USERNAME = #{deleteUsername}
  73. </if>
  74. <if test="deleteTime != null">
  75. and TO_CHAR(DELETE_TIME,'yyyy-MM-dd') = #{deleteTime}
  76. </if>
  77. <if test="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="resultTruckSnapshotPicture != null">
  121. and RESULT_TRUCK_SNAPSHOT_PICTURE = #{resultTruckSnapshotPicture}
  122. </if>
  123. </where>
  124. </sql>
  125. <delete id="deleteByPrimaryKey" parameterType="java.math.BigDecimal">
  126. delete
  127. from TMSTRUCK_LEAVE_FACTORY_RESULT
  128. where RESULT_ID = #{resultId,jdbcType=DECIMAL}
  129. </delete>
  130. <delete id="deleteBySelectiveElement" parameterType="java.util.HashMap">
  131. delete from TMSTRUCK_LEAVE_FACTORY_RESULT
  132. where 1!=1
  133. <if test="resultTotalId != null">
  134. or RESULT_TOTAL_ID = #{resultTotalId}
  135. </if>
  136. <if test="gatepostId != null">
  137. or GATEPOST_ID = #{gatepostId}
  138. </if>
  139. <if test="resultOutMode != null and resultOutMode != ''">
  140. or RESULT_OUT_MODE = #{resultOutMode}
  141. </if>
  142. <if test="resultOutGateTime != null">
  143. or TO_CHAR(RESULT_OUT_GATE_TIME,'yyyy-MM-dd') = '#{resultOutGateTime}'
  144. </if>
  145. <if test="insertUsername != null and insertUsername != ''">
  146. or INSERT_USERNAME = #{insertUsername}
  147. </if>
  148. <if test="insertTime != null">
  149. or TO_CHAR(INSERT_TIME,'yyyy-MM-dd') = '#{insertTime}'
  150. </if>
  151. <if test="updateUsername != null and updateUsername != ''">
  152. or UPDATE_USERNAME = #{updateUsername}
  153. </if>
  154. <if test="updateTime != null">
  155. or TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = '#{updateTime}'
  156. </if>
  157. <if test="insertUpdateRemark != null and insertUpdateRemark != ''">
  158. or INSERT_UPDATE_REMARK = #{insertUpdateRemark}
  159. </if>
  160. <if test="deleteUsername != null and deleteUsername != ''">
  161. or DELETE_USERNAME = #{deleteUsername}
  162. </if>
  163. <if test="deleteTime != null">
  164. or TO_CHAR(DELETE_TIME,'yyyy-MM-dd') = '#{deleteTime}'
  165. </if>
  166. <if test="resultTruckSnapshotPicture != null">
  167. or RESULT_TRUCK_SNAPSHOT_PICTURE = #{resultTruckSnapshotPicture}
  168. </if>
  169. </delete>
  170. <insert id="insert" parameterType="com.steerinfo.dil.model.TmstruckLeaveFactoryResult">
  171. insert into TMSTRUCK_LEAVE_FACTORY_RESULT (RESULT_ID, RESULT_TOTAL_ID, GATEPOST_ID,
  172. RESULT_OUT_MODE, RESULT_OUT_GATE_TIME, INSERT_USERNAME,
  173. INSERT_TIME, UPDATE_USERNAME, UPDATE_TIME,
  174. INSERT_UPDATE_REMARK, DELETE_USERNAME, DELETE_TIME,
  175. RESULT_TRUCK_SNAPSHOT_PICTURE)
  176. values (#{resultId,jdbcType=DECIMAL}, #{resultTotalId,jdbcType=DECIMAL}, #{gatepostId,jdbcType=DECIMAL},
  177. #{resultOutMode,jdbcType=VARCHAR}, #{resultOutGateTime,jdbcType=TIMESTAMP},
  178. #{insertUsername,jdbcType=VARCHAR},
  179. #{insertTime,jdbcType=TIMESTAMP}, #{updateUsername,jdbcType=VARCHAR}, #{updateTime,jdbcType=TIMESTAMP},
  180. #{insertUpdateRemark,jdbcType=VARCHAR}, #{deleteUsername,jdbcType=VARCHAR},
  181. #{deleteTime,jdbcType=TIMESTAMP},
  182. #{resultTruckSnapshotPicture,jdbcType=BLOB})
  183. </insert>
  184. <insert id="insertSelective" parameterType="com.steerinfo.dil.model.TmstruckLeaveFactoryResult">
  185. insert into TMSTRUCK_LEAVE_FACTORY_RESULT
  186. <trim prefix="(" suffix=")" suffixOverrides=",">
  187. <if test="resultId != null">
  188. RESULT_ID,
  189. </if>
  190. <if test="resultTotalId != null">
  191. RESULT_TOTAL_ID,
  192. </if>
  193. <if test="gatepostId != null">
  194. GATEPOST_ID,
  195. </if>
  196. <if test="resultOutMode != null">
  197. RESULT_OUT_MODE,
  198. </if>
  199. <if test="resultOutGateTime != null">
  200. RESULT_OUT_GATE_TIME,
  201. </if>
  202. <if test="insertUsername != null">
  203. INSERT_USERNAME,
  204. </if>
  205. <if test="insertTime != null">
  206. INSERT_TIME,
  207. </if>
  208. <if test="updateUsername != null">
  209. UPDATE_USERNAME,
  210. </if>
  211. <if test="updateTime != null">
  212. UPDATE_TIME,
  213. </if>
  214. <if test="insertUpdateRemark != null">
  215. INSERT_UPDATE_REMARK,
  216. </if>
  217. <if test="deleteUsername != null">
  218. DELETE_USERNAME,
  219. </if>
  220. <if test="deleteTime != null">
  221. DELETE_TIME,
  222. </if>
  223. <if test="resultTruckSnapshotPicture != null">
  224. RESULT_TRUCK_SNAPSHOT_PICTURE,
  225. </if>
  226. </trim>
  227. <trim prefix="values (" suffix=")" suffixOverrides=",">
  228. <if test="resultId != null">
  229. #{resultId,jdbcType=DECIMAL},
  230. </if>
  231. <if test="resultTotalId != null">
  232. #{resultTotalId,jdbcType=DECIMAL},
  233. </if>
  234. <if test="gatepostId != null">
  235. #{gatepostId,jdbcType=DECIMAL},
  236. </if>
  237. <if test="resultOutMode != null">
  238. #{resultOutMode,jdbcType=VARCHAR},
  239. </if>
  240. <if test="resultOutGateTime != null">
  241. #{resultOutGateTime,jdbcType=TIMESTAMP},
  242. </if>
  243. <if test="insertUsername != null">
  244. #{insertUsername,jdbcType=VARCHAR},
  245. </if>
  246. <if test="insertTime != null">
  247. #{insertTime,jdbcType=TIMESTAMP},
  248. </if>
  249. <if test="updateUsername != null">
  250. #{updateUsername,jdbcType=VARCHAR},
  251. </if>
  252. <if test="updateTime != null">
  253. #{updateTime,jdbcType=TIMESTAMP},
  254. </if>
  255. <if test="insertUpdateRemark != null">
  256. #{insertUpdateRemark,jdbcType=VARCHAR},
  257. </if>
  258. <if test="deleteUsername != null">
  259. #{deleteUsername,jdbcType=VARCHAR},
  260. </if>
  261. <if test="deleteTime != null">
  262. #{deleteTime,jdbcType=TIMESTAMP},
  263. </if>
  264. <if test="resultTruckSnapshotPicture != null">
  265. #{resultTruckSnapshotPicture,jdbcType=BLOB},
  266. </if>
  267. </trim>
  268. </insert>
  269. <update id="updateByPrimaryKey" parameterType="com.steerinfo.dil.model.TmstruckLeaveFactoryResult">
  270. update TMSTRUCK_LEAVE_FACTORY_RESULT
  271. set RESULT_TOTAL_ID = #{resultTotalId,jdbcType=DECIMAL},
  272. GATEPOST_ID = #{gatepostId,jdbcType=DECIMAL},
  273. RESULT_OUT_MODE = #{resultOutMode,jdbcType=VARCHAR},
  274. RESULT_OUT_GATE_TIME = #{resultOutGateTime,jdbcType=TIMESTAMP},
  275. INSERT_USERNAME = #{insertUsername,jdbcType=VARCHAR},
  276. INSERT_TIME = #{insertTime,jdbcType=TIMESTAMP},
  277. UPDATE_USERNAME = #{updateUsername,jdbcType=VARCHAR},
  278. UPDATE_TIME = #{updateTime,jdbcType=TIMESTAMP},
  279. INSERT_UPDATE_REMARK = #{insertUpdateRemark,jdbcType=VARCHAR},
  280. DELETE_USERNAME = #{deleteUsername,jdbcType=VARCHAR},
  281. DELETE_TIME = #{deleteTime,jdbcType=TIMESTAMP},
  282. RESULT_TRUCK_SNAPSHOT_PICTURE = #{resultTruckSnapshotPicture,jdbcType=BLOB}
  283. where RESULT_ID = #{resultId,jdbcType=DECIMAL}
  284. </update>
  285. <update id="updateByPrimaryKeySelective" parameterType="com.steerinfo.dil.model.TmstruckLeaveFactoryResult">
  286. update TMSTRUCK_LEAVE_FACTORY_RESULT
  287. <set>
  288. <if test="resultTotalId != null">
  289. RESULT_TOTAL_ID = #{resultTotalId,jdbcType=DECIMAL},
  290. </if>
  291. <if test="gatepostId != null">
  292. GATEPOST_ID = #{gatepostId,jdbcType=DECIMAL},
  293. </if>
  294. <if test="resultOutMode != null">
  295. RESULT_OUT_MODE = #{resultOutMode,jdbcType=VARCHAR},
  296. </if>
  297. <if test="resultOutGateTime != null">
  298. RESULT_OUT_GATE_TIME = #{resultOutGateTime,jdbcType=TIMESTAMP},
  299. </if>
  300. <if test="insertUsername != null">
  301. INSERT_USERNAME = #{insertUsername,jdbcType=VARCHAR},
  302. </if>
  303. <if test="insertTime != null">
  304. INSERT_TIME = #{insertTime,jdbcType=TIMESTAMP},
  305. </if>
  306. <if test="updateUsername != null">
  307. UPDATE_USERNAME = #{updateUsername,jdbcType=VARCHAR},
  308. </if>
  309. <if test="updateTime != null">
  310. UPDATE_TIME = #{updateTime,jdbcType=TIMESTAMP},
  311. </if>
  312. <if test="insertUpdateRemark != null">
  313. INSERT_UPDATE_REMARK = #{insertUpdateRemark,jdbcType=VARCHAR},
  314. </if>
  315. <if test="deleteUsername != null">
  316. DELETE_USERNAME = #{deleteUsername,jdbcType=VARCHAR},
  317. </if>
  318. <if test="deleteTime != null">
  319. DELETE_TIME = #{deleteTime,jdbcType=TIMESTAMP},
  320. </if>
  321. <if test="resultTruckSnapshotPicture != null">
  322. RESULT_TRUCK_SNAPSHOT_PICTURE = #{resultTruckSnapshotPicture,jdbcType=BLOB},
  323. </if>
  324. </set>
  325. where RESULT_ID = #{resultId,jdbcType=DECIMAL}
  326. </update>
  327. <select id="selectByPrimaryKey" parameterType="java.math.BigDecimal" resultMap="BaseResultMap">
  328. <include refid="select"/>
  329. where RESULT_ID = #{resultId,jdbcType=DECIMAL}
  330. </select>
  331. <select id="selectByParameters" parameterType="java.util.HashMap" resultMap="BaseResultMap">
  332. <include refid="select"/>
  333. <include refid="where"/>
  334. </select>
  335. <select id="selectLikeByParameters" parameterType="java.util.HashMap" resultMap="BaseResultMap">
  336. <include refid="select"/>
  337. <include refid="whereLike"/>
  338. </select>
  339. <insert id="batchInsert" parameterType="java.util.List">
  340. insert into TMSTRUCK_LEAVE_FACTORY_RESULT
  341. (RESULT_ID,
  342. RESULT_TOTAL_ID, GATEPOST_ID, RESULT_OUT_MODE,
  343. RESULT_OUT_GATE_TIME, INSERT_USERNAME,
  344. INSERT_TIME, UPDATE_USERNAME,
  345. UPDATE_TIME, INSERT_UPDATE_REMARK,
  346. DELETE_USERNAME, DELETE_TIME,
  347. RESULT_TRUCK_SNAPSHOT_PICTURE)
  348. ( <foreach collection="list" item="item" separator="union all">
  349. select
  350. #{item.resultId,jdbcType=DECIMAL},
  351. #{item.resultTotalId,jdbcType=DECIMAL}, #{item.gatepostId,jdbcType=DECIMAL},
  352. #{item.resultOutMode,jdbcType=VARCHAR},
  353. #{item.resultOutGateTime,jdbcType=TIMESTAMP}, #{item.insertUsername,jdbcType=VARCHAR},
  354. #{item.insertTime,jdbcType=TIMESTAMP}, #{item.updateUsername,jdbcType=VARCHAR},
  355. #{item.updateTime,jdbcType=TIMESTAMP}, #{item.insertUpdateRemark,jdbcType=VARCHAR},
  356. #{item.deleteUsername,jdbcType=VARCHAR}, #{item.deleteTime,jdbcType=TIMESTAMP},
  357. #{item.resultTruckSnapshotPicture,jdbcType=BLOB} from dual
  358. </foreach> )
  359. </insert>
  360. <update id="batchUpdate" parameterType="java.util.List">
  361. update TMSTRUCK_LEAVE_FACTORY_RESULT
  362. set
  363. RESULT_ID=
  364. <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
  365. when #{item.resultId,jdbcType=DECIMAL} then #{item.resultId,jdbcType=DECIMAL}
  366. </foreach>
  367. ,RESULT_TOTAL_ID=
  368. <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
  369. when #{item.resultId,jdbcType=DECIMAL} then #{item.resultTotalId,jdbcType=DECIMAL}
  370. </foreach>
  371. ,GATEPOST_ID=
  372. <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
  373. when #{item.resultId,jdbcType=DECIMAL} then #{item.gatepostId,jdbcType=DECIMAL}
  374. </foreach>
  375. ,RESULT_OUT_MODE=
  376. <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
  377. when #{item.resultId,jdbcType=DECIMAL} then #{item.resultOutMode,jdbcType=VARCHAR}
  378. </foreach>
  379. ,RESULT_OUT_GATE_TIME=
  380. <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
  381. when #{item.resultId,jdbcType=DECIMAL} then #{item.resultOutGateTime,jdbcType=TIMESTAMP}
  382. </foreach>
  383. ,INSERT_USERNAME=
  384. <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
  385. when #{item.resultId,jdbcType=DECIMAL} then #{item.insertUsername,jdbcType=VARCHAR}
  386. </foreach>
  387. ,INSERT_TIME=
  388. <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
  389. when #{item.resultId,jdbcType=DECIMAL} then #{item.insertTime,jdbcType=TIMESTAMP}
  390. </foreach>
  391. ,UPDATE_USERNAME=
  392. <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
  393. when #{item.resultId,jdbcType=DECIMAL} then #{item.updateUsername,jdbcType=VARCHAR}
  394. </foreach>
  395. ,UPDATE_TIME=
  396. <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
  397. when #{item.resultId,jdbcType=DECIMAL} then #{item.updateTime,jdbcType=TIMESTAMP}
  398. </foreach>
  399. ,INSERT_UPDATE_REMARK=
  400. <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
  401. when #{item.resultId,jdbcType=DECIMAL} then #{item.insertUpdateRemark,jdbcType=VARCHAR}
  402. </foreach>
  403. ,DELETE_USERNAME=
  404. <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
  405. when #{item.resultId,jdbcType=DECIMAL} then #{item.deleteUsername,jdbcType=VARCHAR}
  406. </foreach>
  407. ,DELETE_TIME=
  408. <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
  409. when #{item.resultId,jdbcType=DECIMAL} then #{item.deleteTime,jdbcType=TIMESTAMP}
  410. </foreach>
  411. ,RESULT_TRUCK_SNAPSHOT_PICTURE=
  412. <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
  413. when #{item.resultId,jdbcType=DECIMAL} then #{item.resultTruckSnapshotPicture,jdbcType=BLOB}
  414. </foreach>
  415. where RESULT_ID in
  416. <foreach collection="list" index="index" item="item" separator="," open="(" close=")">
  417. #{item.resultId,jdbcType=DECIMAL}
  418. </foreach>
  419. </update>
  420. <delete id="batchDelete" parameterType="java.util.List">
  421. delete from TMSTRUCK_LEAVE_FACTORY_RESULT
  422. where RESULT_ID in
  423. <foreach collection="list" item="id" open="(" close=")" separator=",">
  424. #{id}
  425. </foreach>
  426. </delete>
  427. <!-- 友情提示!!!-->
  428. <!-- 请将自己写的代码放在此标签之下,方便以后粘贴复制。-->
  429. <sql id="orderByOutTime">
  430. <if test="orderField != null and orderField != ''">
  431. order by "${orderField}"
  432. <if test="orderType != null and orderType != ''">
  433. ${orderType}
  434. </if>
  435. </if>
  436. <if test="orderField == null ">
  437. order by "resultOutGateTime" desc
  438. </if>
  439. </sql>
  440. <!-- 查询所有的出厂实绩 -->
  441. <select id="getLeaveFactoryResult" parameterType="java.util.Map" resultType="java.util.LinkedHashMap">
  442. select *
  443. from (
  444. select
  445. TLFR.RESULT_ID "resultId",
  446. APO.PURCHASE_ORDER_NO "purchaseOrderNo",
  447. RM.MATERIAL_NAME "materialName",
  448. DB.RESULT_FOREIGN_SHIP_NAME "resultForeignShipName",
  449. OO.ORDER_NUMBER "orderNumber",
  450. RC.CAPACITY_NUMBER "capacityNumber",
  451. RG.GATEPOST_NAME "gatepostName",
  452. TLFR.RESULT_OUT_MODE "resultOutMode",
  453. TLFR.RESULT_OUT_GATE_TIME "resultOutGateTime",
  454. TLFR.RESULT_TRUCK_SNAPSHOT_PICTURE "resultTruckSnapshotPicture"
  455. from TMSTRUCK_LEAVE_FACTORY_RESULT TLFR
  456. left join TMSTRUCK_TOTAL_RESULT TTR
  457. on TTR.RESULT_TOTAL_ID = TLFR.RESULT_TOTAL_ID
  458. left join OMSTRUCK_ORDER OO
  459. on OO.ORDER_ID = TTR.ORDER_ID
  460. left join AMS_PURCHASE_ORDER APO
  461. on APO.PURCHASE_ORDER_ID = OO.ORDER_PLAN_ID
  462. left join DIL_BATCH DB
  463. on DB.BATCH_ID = APO.BATCH_ID
  464. left join OMSTRUCK_ORDER_MATERIAL OOM
  465. on OOM.ORDER_ID = OO.ORDER_ID
  466. left join RMS_MATERIAL RM
  467. on RM.MATERIAL_ID = OOM.MATERIAL_ID
  468. left join RMS_CAPACITY RC
  469. on RC.CAPACITY_ID = OO.CAPACITY_ID
  470. left join RMS_GATEPOST RG
  471. on RG.GATEPOST_ID = TLFR.GATEPOST_ID
  472. where RESULT_OUT_GATE_TIME is not null
  473. )
  474. <where>
  475. <if test="purchaseOrderNo != null">
  476. <foreach collection="purchaseOrderNo" item="item" open="(" separator="or" close=")">
  477. "purchaseOrderNo" like '%${item}%'
  478. </foreach>
  479. </if>
  480. <if test="materialName != null">
  481. and
  482. <foreach collection="materialName" item="item" open="(" separator="or" close=")">
  483. "materialName" like '%${item}%'
  484. </foreach>
  485. </if>
  486. <if test="resultForeignShipName != null">
  487. and
  488. <foreach collection="resultForeignShipName" item="item" open="(" separator="or" close=")">
  489. "resultForeignShipName" like '%${item}%'
  490. </foreach>
  491. </if>
  492. <if test="orderNumber != null">
  493. and
  494. <foreach collection="orderNumber" item="item" open="(" separator="or" close=")">
  495. "orderNumber" like '%${item}%'
  496. </foreach>
  497. </if>
  498. <if test="capacityNumber != null">
  499. and
  500. <foreach collection="capacityNumber" item="item" open="(" separator="or" close=")">
  501. "capacityNumber" like '%${item}%'
  502. </foreach>
  503. </if>
  504. <if test="gatepostName != null">
  505. and
  506. <foreach collection="gatepostName" item="item" open="(" separator="or" close=")">
  507. "gatepostName" like '%${item}%'
  508. </foreach>
  509. </if>
  510. <if test="resultOutMode != null">
  511. and
  512. <foreach collection="resultOutMode" item="item" open="(" separator="or" close=")">
  513. "resultOutMode" like '%${item}%'
  514. </foreach>
  515. </if>
  516. <if test="resultOutGateTime != null">
  517. and
  518. <foreach collection="resultOutGateTime" item="item" open="(" separator="or" close=")">
  519. "resultOutGateTime" like '%${item}%'
  520. </foreach>
  521. </if>
  522. <if test="resultTruckSnapshotPicture != null">
  523. and
  524. <foreach collection="resultTruckSnapshotPicture" item="item" open="(" separator="or" close=")">
  525. "resultTruckSnapshotPicture" like '%${item}%'
  526. </foreach>
  527. </if>
  528. </where>
  529. <include refid="orderByOutTime"></include>
  530. </select>
  531. <!-- 通过运输订单号查询 路段顺序号是否为 4 :已计皮-->
  532. <select id="selectTransportRoute" parameterType="string" resultType="int">
  533. select ORDER_LINE_SEQUENCE
  534. from OMSTRUCK_ORDER
  535. where ORDER_NUMBER = #{orderNumber}
  536. </select>
  537. <!-- 通过运输订单号查询 出厂门岗ID 和 实绩ID -->
  538. <select id="selectCnAndGnByOrderNumber" parameterType="string" resultType="java.util.Map">
  539. select RL.LINE_END_NODE_ID "lineEndNodeId",
  540. TTR.RESULT_TOTAL_ID "resultTotalId"
  541. from OMSTRUCK_ORDER OO
  542. left join TMSTRUCK_TOTAL_RESULT TTR
  543. on TTR.ORDER_ID = OO.ORDER_ID
  544. left join RMS_LINE RL
  545. on RL.LINE_ID = OO.LINE_ID
  546. where OO.ORDER_NUMBER = #{orderNumber}
  547. </select>
  548. <!-- 通过运输订单号获取实绩ID -->
  549. <select id="selectResultId" parameterType="string" resultType="java.util.Map">
  550. select TLFR.RESULT_ID "resultId",
  551. OO.ORDER_ID "orderId",
  552. OO.CAPACITY_ID "capacityId",
  553. OO.ORDER_TYPE "orderType",
  554. TTR.RESULT_TOTAL_ID "resultTotalId"
  555. from OMSTRUCK_ORDER OO
  556. left join TMSTRUCK_TOTAL_RESULT TTR
  557. on OO.ORDER_ID = TTR.ORDER_ID
  558. left join TMSTRUCK_LEAVE_FACTORY_RESULT TLFR
  559. on TLFR.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
  560. where OO.ORDER_NUMBER = #{orderNumber}
  561. </select>
  562. <!--销售物流查询所有的出厂实绩-->
  563. <select id="selectAllLeaveFacatoryForSale" resultType="java.util.Map">
  564. SELECT
  565. *
  566. FROM
  567. (
  568. SELECT
  569. TLFR.RESULT_ID "resultId",
  570. ARD.DAYPLAN_NO "dayplanNo",
  571. RM.MATERIAL_NAME "materialName",
  572. OO.ORDER_NUMBER "orderNumber",
  573. RC.CAPACITY_NUMBER "capacityNumber",
  574. RG.GATEPOST_NAME "gatepostName",
  575. ARD.DAYPLAN_MATERIAL_WEIGHT "materialWeight",
  576. TLFR.RESULT_OUT_MODE "resultOutMode",
  577. TLFR.RESULT_OUT_GATE_TIME "resultOutGateTime",
  578. TLFR.RESULT_TRUCK_SNAPSHOT_PICTURE "resultTruckSnapshotPicture"
  579. FROM
  580. TMSTRUCK_LEAVE_FACTORY_RESULT TLFR
  581. LEFT JOIN TMSTRUCK_TOTAL_RESULT TTR ON TTR.RESULT_TOTAL_ID = TLFR.RESULT_TOTAL_ID
  582. LEFT JOIN OMSTRUCK_ORDER OO ON OO.ORDER_ID = TTR.ORDER_ID
  583. LEFT JOIN OMSTRUCK_ORDER_MATERIAL OOM ON OOM.ORDER_ID = OO.ORDER_ID
  584. LEFT JOIN RMS_MATERIAL RM ON RM.MATERIAL_ID = OOM.MATERIAL_ID
  585. LEFT JOIN RMS_CAPACITY RC ON RC.CAPACITY_ID = OO.CAPACITY_ID
  586. LEFT JOIN RMS_GATEPOST RG ON RG.GATEPOST_ID = TLFR.GATEPOST_ID
  587. LEFT JOIN AMSTRUCK_RAIL_DAYPLAN ARD ON ARD.DAYPLAN_ID=OO.ORDER_PLAN_ID
  588. WHERE
  589. RESULT_OUT_GATE_TIME IS NOT NULL
  590. )
  591. </select>
  592. </mapper>