TmstruckUnloadResultMapper.xml 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607
  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.TmstruckUnloadResultMapper">
  4. <resultMap id="BaseResultMap" type="com.steerinfo.dil.model.TmstruckUnloadResult">
  5. <id column="RESULT_ID" jdbcType="DECIMAL" property="resultId"/>
  6. <result column="RESULT_NUMBER" jdbcType="VARCHAR" property="resultNumber"/>
  7. <result column="RESULT_TOTAL_ID" jdbcType="DECIMAL" property="resultTotalId"/>
  8. <result column="RESULT_START_TIME" jdbcType="TIMESTAMP" property="resultStartTime"/>
  9. <result column="RESULT_END_TIME" jdbcType="TIMESTAMP" property="resultEndTime"/>
  10. <result column="RESULT_DURATION" jdbcType="DECIMAL" property="resultDuration"/>
  11. <result column="UNLOAD_STATUS" jdbcType="DECIMAL" property="unloadStatus"/>
  12. <result column="INSERT_USERNAME" jdbcType="VARCHAR" property="insertUsername"/>
  13. <result column="INSERT_TIME" jdbcType="TIMESTAMP" property="insertTime"/>
  14. <result column="UPDATE_USERNAME" jdbcType="VARCHAR" property="updateUsername"/>
  15. <result column="UPDATE_TIME" jdbcType="TIMESTAMP" property="updateTime"/>
  16. <result column="INSERT_UPDATE_REMARK" jdbcType="VARCHAR" property="insertUpdateRemark"/>
  17. <result column="DELETE_NAME" jdbcType="VARCHAR" property="deleteName"/>
  18. <result column="DELETE_TIME" jdbcType="TIMESTAMP" property="deleteTime"/>
  19. <result column="RESULT_UNLOAD_PLACE_ID" jdbcType="DECIMAL" property="resultUnloadPlaceId"/>
  20. </resultMap>
  21. <sql id="columns">
  22. RESULT_ID, RESULT_NUMBER, RESULT_TOTAL_ID, RESULT_START_TIME, RESULT_END_TIME, RESULT_DURATION,
  23. UNLOAD_STATUS, INSERT_USERNAME, INSERT_TIME, UPDATE_USERNAME, UPDATE_TIME, INSERT_UPDATE_REMARK,
  24. DELETE_NAME, DELETE_TIME, RESULT_UNLOAD_PLACE_ID
  25. </sql>
  26. <sql id="columns_alias">
  27. t.RESULT_ID, t.RESULT_NUMBER, t.RESULT_TOTAL_ID, t.RESULT_START_TIME, t.RESULT_END_TIME,
  28. t.RESULT_DURATION, t.UNLOAD_STATUS, t.INSERT_USERNAME, t.INSERT_TIME, t.UPDATE_USERNAME,
  29. t.UPDATE_TIME, t.INSERT_UPDATE_REMARK, t.DELETE_NAME, t.DELETE_TIME, t.RESULT_UNLOAD_PLACE_ID
  30. </sql>
  31. <sql id="select">
  32. SELECT
  33. <include refid="columns"/>
  34. FROM TMSTRUCK_UNLOAD_RESULT
  35. </sql>
  36. <sql id="select_alias">
  37. SELECT
  38. <include refid="columns_alias"/>
  39. FROM TMSTRUCK_UNLOAD_RESULT t
  40. </sql>
  41. <sql id="where">
  42. <where>
  43. <if test="resultId != null">
  44. and RESULT_ID = #{resultId}
  45. </if>
  46. <if test="resultNumber != null and resultNumber != ''">
  47. and RESULT_NUMBER = #{resultNumber}
  48. </if>
  49. <if test="resultTotalId != null">
  50. and RESULT_TOTAL_ID = #{resultTotalId}
  51. </if>
  52. <if test="resultStartTime != null">
  53. and TO_CHAR(RESULT_START_TIME,'yyyy-MM-dd') = #{resultStartTime}
  54. </if>
  55. <if test="resultEndTime != null">
  56. and TO_CHAR(RESULT_END_TIME,'yyyy-MM-dd') = #{resultEndTime}
  57. </if>
  58. <if test="resultDuration != null">
  59. and RESULT_DURATION = #{resultDuration}
  60. </if>
  61. <if test="unloadStatus != null">
  62. and UNLOAD_STATUS = #{unloadStatus}
  63. </if>
  64. <if test="insertUsername != null and insertUsername != ''">
  65. and INSERT_USERNAME = #{insertUsername}
  66. </if>
  67. <if test="insertTime != null">
  68. and TO_CHAR(INSERT_TIME,'yyyy-MM-dd') = #{insertTime}
  69. </if>
  70. <if test="updateUsername != null and updateUsername != ''">
  71. and UPDATE_USERNAME = #{updateUsername}
  72. </if>
  73. <if test="updateTime != null">
  74. and TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = #{updateTime}
  75. </if>
  76. <if test="insertUpdateRemark != null and insertUpdateRemark != ''">
  77. and INSERT_UPDATE_REMARK = #{insertUpdateRemark}
  78. </if>
  79. <if test="deleteName != null and deleteName != ''">
  80. and DELETE_NAME = #{deleteName}
  81. </if>
  82. <if test="deleteTime != null">
  83. and TO_CHAR(DELETE_TIME,'yyyy-MM-dd') = #{deleteTime}
  84. </if>
  85. <if test="resultUnloadPlaceId != null">
  86. and RESULT_UNLOAD_PLACE_ID = #{resultUnloadPlaceId}
  87. </if>
  88. </where>
  89. </sql>
  90. <sql id="whereLike">
  91. <where>
  92. <if test="resultId != null">
  93. and RESULT_ID = #{resultId}
  94. </if>
  95. <if test="resultNumber != null and resultNumber != ''">
  96. and RESULT_NUMBER LIKE '%${resultNumber}%'
  97. </if>
  98. <if test="resultTotalId != null">
  99. and RESULT_TOTAL_ID = #{resultTotalId}
  100. </if>
  101. <if test="resultStartTime != null">
  102. and TO_CHAR(RESULT_START_TIME,'yyyy-MM-dd') = #{resultStartTime}
  103. </if>
  104. <if test="resultEndTime != null">
  105. and TO_CHAR(RESULT_END_TIME,'yyyy-MM-dd') = #{resultEndTime}
  106. </if>
  107. <if test="resultDuration != null">
  108. and RESULT_DURATION = #{resultDuration}
  109. </if>
  110. <if test="unloadStatus != null">
  111. and UNLOAD_STATUS = #{unloadStatus}
  112. </if>
  113. <if test="insertUsername != null and insertUsername != ''">
  114. and INSERT_USERNAME LIKE '%${insertUsername}%'
  115. </if>
  116. <if test="insertTime != null">
  117. and TO_CHAR(INSERT_TIME,'yyyy-MM-dd') = #{insertTime}
  118. </if>
  119. <if test="updateUsername != null and updateUsername != ''">
  120. and UPDATE_USERNAME LIKE '%${updateUsername}%'
  121. </if>
  122. <if test="updateTime != null">
  123. and TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = #{updateTime}
  124. </if>
  125. <if test="insertUpdateRemark != null and insertUpdateRemark != ''">
  126. and INSERT_UPDATE_REMARK LIKE '%${insertUpdateRemark}%'
  127. </if>
  128. <if test="deleteName != null and deleteName != ''">
  129. and DELETE_NAME LIKE '%${deleteName}%'
  130. </if>
  131. <if test="deleteTime != null">
  132. and TO_CHAR(DELETE_TIME,'yyyy-MM-dd') = #{deleteTime}
  133. </if>
  134. <if test="resultUnloadPlaceId != null">
  135. and RESULT_UNLOAD_PLACE_ID = #{resultUnloadPlaceId}
  136. </if>
  137. </where>
  138. </sql>
  139. <delete id="deleteByPrimaryKey" parameterType="java.lang.Short">
  140. delete
  141. from TMSTRUCK_UNLOAD_RESULT
  142. where RESULT_ID = #{resultId,jdbcType=DECIMAL}
  143. </delete>
  144. <delete id="deleteBySelectiveElement" parameterType="java.util.HashMap">
  145. delete from TMSTRUCK_UNLOAD_RESULT
  146. where 1!=1
  147. <if test="resultNumber != null and resultNumber != ''">
  148. or RESULT_NUMBER = #{resultNumber}
  149. </if>
  150. <if test="resultTotalId != null">
  151. or RESULT_TOTAL_ID = #{resultTotalId}
  152. </if>
  153. <if test="resultStartTime != null">
  154. or TO_CHAR(RESULT_START_TIME,'yyyy-MM-dd') = '#{resultStartTime}'
  155. </if>
  156. <if test="resultEndTime != null">
  157. or TO_CHAR(RESULT_END_TIME,'yyyy-MM-dd') = '#{resultEndTime}'
  158. </if>
  159. <if test="resultDuration != null">
  160. or RESULT_DURATION = #{resultDuration}
  161. </if>
  162. <if test="unloadStatus != null">
  163. or UNLOAD_STATUS = #{unloadStatus}
  164. </if>
  165. <if test="insertUsername != null and insertUsername != ''">
  166. or INSERT_USERNAME = #{insertUsername}
  167. </if>
  168. <if test="insertTime != null">
  169. or TO_CHAR(INSERT_TIME,'yyyy-MM-dd') = '#{insertTime}'
  170. </if>
  171. <if test="updateUsername != null and updateUsername != ''">
  172. or UPDATE_USERNAME = #{updateUsername}
  173. </if>
  174. <if test="updateTime != null">
  175. or TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = '#{updateTime}'
  176. </if>
  177. <if test="insertUpdateRemark != null and insertUpdateRemark != ''">
  178. or INSERT_UPDATE_REMARK = #{insertUpdateRemark}
  179. </if>
  180. <if test="deleteName != null and deleteName != ''">
  181. or DELETE_NAME = #{deleteName}
  182. </if>
  183. <if test="deleteTime != null">
  184. or TO_CHAR(DELETE_TIME,'yyyy-MM-dd') = '#{deleteTime}'
  185. </if>
  186. <if test="resultUnloadPlaceId != null">
  187. or RESULT_UNLOAD_PLACE_ID = #{resultUnloadPlaceId}
  188. </if>
  189. </delete>
  190. <insert id="insert" parameterType="com.steerinfo.dil.model.TmstruckUnloadResult">
  191. insert into TMSTRUCK_UNLOAD_RESULT (RESULT_ID, RESULT_NUMBER, RESULT_TOTAL_ID,
  192. RESULT_START_TIME, RESULT_END_TIME, RESULT_DURATION,
  193. UNLOAD_STATUS, INSERT_USERNAME, INSERT_TIME,
  194. UPDATE_USERNAME, UPDATE_TIME, INSERT_UPDATE_REMARK,
  195. DELETE_NAME, DELETE_TIME, RESULT_UNLOAD_PLACE_ID)
  196. values (#{resultId,jdbcType=DECIMAL}, #{resultNumber,jdbcType=VARCHAR}, #{resultTotalId,jdbcType=DECIMAL},
  197. #{resultStartTime,jdbcType=TIMESTAMP}, #{resultEndTime,jdbcType=TIMESTAMP},
  198. #{resultDuration,jdbcType=DECIMAL},
  199. #{unloadStatus,jdbcType=DECIMAL}, #{insertUsername,jdbcType=VARCHAR}, #{insertTime,jdbcType=TIMESTAMP},
  200. #{updateUsername,jdbcType=VARCHAR}, #{updateTime,jdbcType=TIMESTAMP},
  201. #{insertUpdateRemark,jdbcType=VARCHAR},
  202. #{deleteName,jdbcType=VARCHAR}, #{deleteTime,jdbcType=TIMESTAMP},
  203. #{resultUnloadPlaceId,jdbcType=DECIMAL})
  204. </insert>
  205. <insert id="insertSelective" parameterType="com.steerinfo.dil.model.TmstruckUnloadResult">
  206. insert into TMSTRUCK_UNLOAD_RESULT
  207. <trim prefix="(" suffix=")" suffixOverrides=",">
  208. <if test="resultId != null">
  209. RESULT_ID,
  210. </if>
  211. <if test="resultNumber != null">
  212. RESULT_NUMBER,
  213. </if>
  214. <if test="resultTotalId != null">
  215. RESULT_TOTAL_ID,
  216. </if>
  217. <if test="resultStartTime != null">
  218. RESULT_START_TIME,
  219. </if>
  220. <if test="resultEndTime != null">
  221. RESULT_END_TIME,
  222. </if>
  223. <if test="resultDuration != null">
  224. RESULT_DURATION,
  225. </if>
  226. <if test="unloadStatus != null">
  227. UNLOAD_STATUS,
  228. </if>
  229. <if test="insertUsername != null">
  230. INSERT_USERNAME,
  231. </if>
  232. <if test="insertTime != null">
  233. INSERT_TIME,
  234. </if>
  235. <if test="updateUsername != null">
  236. UPDATE_USERNAME,
  237. </if>
  238. <if test="updateTime != null">
  239. UPDATE_TIME,
  240. </if>
  241. <if test="insertUpdateRemark != null">
  242. INSERT_UPDATE_REMARK,
  243. </if>
  244. <if test="deleteName != null">
  245. DELETE_NAME,
  246. </if>
  247. <if test="deleteTime != null">
  248. DELETE_TIME,
  249. </if>
  250. <if test="resultUnloadPlaceId != null">
  251. RESULT_UNLOAD_PLACE_ID,
  252. </if>
  253. </trim>
  254. <trim prefix="values (" suffix=")" suffixOverrides=",">
  255. <if test="resultId != null">
  256. #{resultId,jdbcType=DECIMAL},
  257. </if>
  258. <if test="resultNumber != null">
  259. #{resultNumber,jdbcType=VARCHAR},
  260. </if>
  261. <if test="resultTotalId != null">
  262. #{resultTotalId,jdbcType=DECIMAL},
  263. </if>
  264. <if test="resultStartTime != null">
  265. #{resultStartTime,jdbcType=TIMESTAMP},
  266. </if>
  267. <if test="resultEndTime != null">
  268. #{resultEndTime,jdbcType=TIMESTAMP},
  269. </if>
  270. <if test="resultDuration != null">
  271. #{resultDuration,jdbcType=DECIMAL},
  272. </if>
  273. <if test="unloadStatus != null">
  274. #{unloadStatus,jdbcType=DECIMAL},
  275. </if>
  276. <if test="insertUsername != null">
  277. #{insertUsername,jdbcType=VARCHAR},
  278. </if>
  279. <if test="insertTime != null">
  280. #{insertTime,jdbcType=TIMESTAMP},
  281. </if>
  282. <if test="updateUsername != null">
  283. #{updateUsername,jdbcType=VARCHAR},
  284. </if>
  285. <if test="updateTime != null">
  286. #{updateTime,jdbcType=TIMESTAMP},
  287. </if>
  288. <if test="insertUpdateRemark != null">
  289. #{insertUpdateRemark,jdbcType=VARCHAR},
  290. </if>
  291. <if test="deleteName != null">
  292. #{deleteName,jdbcType=VARCHAR},
  293. </if>
  294. <if test="deleteTime != null">
  295. #{deleteTime,jdbcType=TIMESTAMP},
  296. </if>
  297. <if test="resultUnloadPlaceId != null">
  298. #{resultUnloadPlaceId,jdbcType=DECIMAL},
  299. </if>
  300. </trim>
  301. </insert>
  302. <update id="updateByPrimaryKey" parameterType="com.steerinfo.dil.model.TmstruckUnloadResult">
  303. update TMSTRUCK_UNLOAD_RESULT
  304. set RESULT_NUMBER = #{resultNumber,jdbcType=VARCHAR},
  305. RESULT_TOTAL_ID = #{resultTotalId,jdbcType=DECIMAL},
  306. RESULT_START_TIME = #{resultStartTime,jdbcType=TIMESTAMP},
  307. RESULT_END_TIME = #{resultEndTime,jdbcType=TIMESTAMP},
  308. RESULT_DURATION = #{resultDuration,jdbcType=DECIMAL},
  309. UNLOAD_STATUS = #{unloadStatus,jdbcType=DECIMAL},
  310. INSERT_USERNAME = #{insertUsername,jdbcType=VARCHAR},
  311. INSERT_TIME = #{insertTime,jdbcType=TIMESTAMP},
  312. UPDATE_USERNAME = #{updateUsername,jdbcType=VARCHAR},
  313. UPDATE_TIME = #{updateTime,jdbcType=TIMESTAMP},
  314. INSERT_UPDATE_REMARK = #{insertUpdateRemark,jdbcType=VARCHAR},
  315. DELETE_NAME = #{deleteName,jdbcType=VARCHAR},
  316. DELETE_TIME = #{deleteTime,jdbcType=TIMESTAMP},
  317. RESULT_UNLOAD_PLACE_ID = #{resultUnloadPlaceId,jdbcType=DECIMAL}
  318. where RESULT_ID = #{resultId,jdbcType=DECIMAL}
  319. </update>
  320. <update id="updateByPrimaryKeySelective" parameterType="com.steerinfo.dil.model.TmstruckUnloadResult">
  321. update TMSTRUCK_UNLOAD_RESULT
  322. <set>
  323. <if test="resultNumber != null">
  324. RESULT_NUMBER = #{resultNumber,jdbcType=VARCHAR},
  325. </if>
  326. <if test="resultTotalId != null">
  327. RESULT_TOTAL_ID = #{resultTotalId,jdbcType=DECIMAL},
  328. </if>
  329. <if test="resultStartTime != null">
  330. RESULT_START_TIME = #{resultStartTime,jdbcType=TIMESTAMP},
  331. </if>
  332. <if test="resultEndTime != null">
  333. RESULT_END_TIME = #{resultEndTime,jdbcType=TIMESTAMP},
  334. </if>
  335. <if test="resultDuration != null">
  336. RESULT_DURATION = #{resultDuration,jdbcType=DECIMAL},
  337. </if>
  338. <if test="unloadStatus != null">
  339. UNLOAD_STATUS = #{unloadStatus,jdbcType=DECIMAL},
  340. </if>
  341. <if test="insertUsername != null">
  342. INSERT_USERNAME = #{insertUsername,jdbcType=VARCHAR},
  343. </if>
  344. <if test="insertTime != null">
  345. INSERT_TIME = #{insertTime,jdbcType=TIMESTAMP},
  346. </if>
  347. <if test="updateUsername != null">
  348. UPDATE_USERNAME = #{updateUsername,jdbcType=VARCHAR},
  349. </if>
  350. <if test="updateTime != null">
  351. UPDATE_TIME = #{updateTime,jdbcType=TIMESTAMP},
  352. </if>
  353. <if test="insertUpdateRemark != null">
  354. INSERT_UPDATE_REMARK = #{insertUpdateRemark,jdbcType=VARCHAR},
  355. </if>
  356. <if test="deleteName != null">
  357. DELETE_NAME = #{deleteName,jdbcType=VARCHAR},
  358. </if>
  359. <if test="deleteTime != null">
  360. DELETE_TIME = #{deleteTime,jdbcType=TIMESTAMP},
  361. </if>
  362. <if test="resultUnloadPlaceId != null">
  363. RESULT_UNLOAD_PLACE_ID = #{resultUnloadPlaceId,jdbcType=DECIMAL},
  364. </if>
  365. </set>
  366. where RESULT_ID = #{resultId,jdbcType=DECIMAL}
  367. </update>
  368. <select id="selectByPrimaryKey" parameterType="java.lang.Short" resultMap="BaseResultMap">
  369. <include refid="select"/>
  370. where RESULT_ID = #{resultId,jdbcType=DECIMAL}
  371. </select>
  372. <select id="selectByParameters" parameterType="java.util.HashMap" resultMap="BaseResultMap">
  373. <include refid="select"/>
  374. <include refid="where"/>
  375. </select>
  376. <select id="selectLikeByParameters" parameterType="java.util.HashMap" resultMap="BaseResultMap">
  377. <include refid="select"/>
  378. <include refid="whereLike"/>
  379. </select>
  380. <insert id="batchInsert" parameterType="java.util.List">
  381. insert into TMSTRUCK_UNLOAD_RESULT
  382. (RESULT_ID,
  383. RESULT_NUMBER, RESULT_TOTAL_ID,
  384. RESULT_START_TIME, RESULT_END_TIME,
  385. RESULT_DURATION, UNLOAD_STATUS,
  386. INSERT_USERNAME, INSERT_TIME,
  387. UPDATE_USERNAME, UPDATE_TIME,
  388. INSERT_UPDATE_REMARK, DELETE_NAME,
  389. DELETE_TIME, RESULT_UNLOAD_PLACE_ID
  390. )
  391. ( <foreach collection="list" item="item" separator="union all">
  392. select
  393. #{item.resultId,jdbcType=DECIMAL},
  394. #{item.resultNumber,jdbcType=VARCHAR}, #{item.resultTotalId,jdbcType=DECIMAL},
  395. #{item.resultStartTime,jdbcType=TIMESTAMP}, #{item.resultEndTime,jdbcType=TIMESTAMP},
  396. #{item.resultDuration,jdbcType=DECIMAL}, #{item.unloadStatus,jdbcType=DECIMAL},
  397. #{item.insertUsername,jdbcType=VARCHAR}, #{item.insertTime,jdbcType=TIMESTAMP},
  398. #{item.updateUsername,jdbcType=VARCHAR}, #{item.updateTime,jdbcType=TIMESTAMP},
  399. #{item.insertUpdateRemark,jdbcType=VARCHAR}, #{item.deleteName,jdbcType=VARCHAR},
  400. #{item.deleteTime,jdbcType=TIMESTAMP}, #{item.resultUnloadPlaceId,jdbcType=DECIMAL}
  401. from dual
  402. </foreach> )
  403. </insert>
  404. <update id="batchUpdate" parameterType="java.util.List">
  405. update TMSTRUCK_UNLOAD_RESULT
  406. set
  407. RESULT_ID=
  408. <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
  409. when #{item.resultId,jdbcType=DECIMAL} then #{item.resultId,jdbcType=DECIMAL}
  410. </foreach>
  411. ,RESULT_NUMBER=
  412. <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
  413. when #{item.resultId,jdbcType=DECIMAL} then #{item.resultNumber,jdbcType=VARCHAR}
  414. </foreach>
  415. ,RESULT_TOTAL_ID=
  416. <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
  417. when #{item.resultId,jdbcType=DECIMAL} then #{item.resultTotalId,jdbcType=DECIMAL}
  418. </foreach>
  419. ,RESULT_START_TIME=
  420. <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
  421. when #{item.resultId,jdbcType=DECIMAL} then #{item.resultStartTime,jdbcType=TIMESTAMP}
  422. </foreach>
  423. ,RESULT_END_TIME=
  424. <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
  425. when #{item.resultId,jdbcType=DECIMAL} then #{item.resultEndTime,jdbcType=TIMESTAMP}
  426. </foreach>
  427. ,RESULT_DURATION=
  428. <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
  429. when #{item.resultId,jdbcType=DECIMAL} then #{item.resultDuration,jdbcType=DECIMAL}
  430. </foreach>
  431. ,UNLOAD_STATUS=
  432. <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
  433. when #{item.resultId,jdbcType=DECIMAL} then #{item.unloadStatus,jdbcType=DECIMAL}
  434. </foreach>
  435. ,INSERT_USERNAME=
  436. <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
  437. when #{item.resultId,jdbcType=DECIMAL} then #{item.insertUsername,jdbcType=VARCHAR}
  438. </foreach>
  439. ,INSERT_TIME=
  440. <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
  441. when #{item.resultId,jdbcType=DECIMAL} then #{item.insertTime,jdbcType=TIMESTAMP}
  442. </foreach>
  443. ,UPDATE_USERNAME=
  444. <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
  445. when #{item.resultId,jdbcType=DECIMAL} then #{item.updateUsername,jdbcType=VARCHAR}
  446. </foreach>
  447. ,UPDATE_TIME=
  448. <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
  449. when #{item.resultId,jdbcType=DECIMAL} then #{item.updateTime,jdbcType=TIMESTAMP}
  450. </foreach>
  451. ,INSERT_UPDATE_REMARK=
  452. <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
  453. when #{item.resultId,jdbcType=DECIMAL} then #{item.insertUpdateRemark,jdbcType=VARCHAR}
  454. </foreach>
  455. ,DELETE_NAME=
  456. <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
  457. when #{item.resultId,jdbcType=DECIMAL} then #{item.deleteName,jdbcType=VARCHAR}
  458. </foreach>
  459. ,DELETE_TIME=
  460. <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
  461. when #{item.resultId,jdbcType=DECIMAL} then #{item.deleteTime,jdbcType=TIMESTAMP}
  462. </foreach>
  463. ,RESULT_UNLOAD_PLACE_ID=
  464. <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
  465. when #{item.resultId,jdbcType=DECIMAL} then #{item.resultUnloadPlaceId,jdbcType=DECIMAL}
  466. </foreach>
  467. where RESULT_ID in
  468. <foreach collection="list" index="index" item="item" separator="," open="(" close=")">
  469. #{item.resultId,jdbcType=DECIMAL}
  470. </foreach>
  471. </update>
  472. <delete id="batchDelete" parameterType="java.util.List">
  473. delete from TMSTRUCK_UNLOAD_RESULT
  474. where RESULT_ID in
  475. <foreach collection="list" item="id" open="(" close=")" separator=",">
  476. #{id}
  477. </foreach>
  478. </delete>
  479. <!-- 友情提示!!!-->
  480. <!-- 请将自己写的代码放在此标签之下,方便以后粘贴复制。-->
  481. <!-- 排序 -->
  482. <sql id="orderBy">
  483. <if test="orderField != null and orderField != ''">
  484. order by "${orderField}"
  485. <if test="orderType != null and orderType != ''">
  486. ${orderType}
  487. </if>
  488. </if>
  489. <if test="orderField == null ">
  490. order by "insertTime" desc
  491. </if>
  492. </sql>
  493. <!-- 获取卸货实绩 -->
  494. <select id="getUnloadResult" parameterType="java.util.Map" resultType="java.util.LinkedHashMap">
  495. select *
  496. from (
  497. select
  498. TUR.RESULT_ID "resultId",
  499. APO.PURCHASE_ORDER_NO "purchaseOrderNo",
  500. OO.ORDER_NUMBER "orderNumber",
  501. RC.CAPACITY_NUMBER "capacityNumber",
  502. RM.MATERIAL_NAME "materialName",
  503. TWR.RESULT_NET_WEIGHT "resultNetWeight",
  504. RW.WAREHOUSE_NAME "warehouseName",
  505. TUR.RESULT_START_TIME "resultStartTime",
  506. TUR.INSERT_TIME "insertTime"
  507. from TMSTRUCK_UNLOAD_RESULT TUR
  508. left join TMSTRUCK_TOTAL_RESULT TTR
  509. on TUR.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
  510. left join TMSTRUCK_WEIGHT_RESULT TWR
  511. on TWR.RESULT_TOTAL_ID = TUR.RESULT_TOTAL_ID
  512. left join OMSTRUCK_ORDER OO
  513. on OO.ORDER_ID = TTR.ORDER_ID
  514. left join AMS_PURCHASE_ORDER APO
  515. on APO.PURCHASE_ORDER_ID = OO.ORDER_PLAN_ID
  516. left join OMSTRUCK_ORDER_MATERIAL OOM
  517. on OOM.ORDER_ID = OO.ORDER_ID
  518. left join RMS_MATERIAL RM
  519. on OOM.MATERIAL_ID = RM.MATERIAL_ID
  520. left join RMS_CAPACITY RC
  521. on RC.CAPACITY_ID = OO.CAPACITY_ID
  522. left join RMS_WAREHOUSE RW
  523. on RW.WAREHOUSE_ID = TUR.RESULT_UNLOAD_PLACE_ID
  524. where RESULT_START_TIME is not null
  525. )
  526. <where>
  527. <if test="purchaseOrderNo != null">
  528. <foreach collection="purchaseOrderNo" item="item" open="(" separator="or" close=")">
  529. "purchaseOrderNo" like '%${item}%'
  530. </foreach>
  531. </if>
  532. <if test="materialName != null">
  533. and
  534. <foreach collection="materialName" item="item" open="(" separator="or" close=")">
  535. "materialName" like '%${item}%'
  536. </foreach>
  537. </if>
  538. <if test="orderNumber != null">
  539. and
  540. <foreach collection="orderNumber" item="item" open="(" separator="or" close=")">
  541. "orderNumber" like '%${item}%'
  542. </foreach>
  543. </if>
  544. <if test="capacityNumber != null">
  545. and
  546. <foreach collection="capacityNumber" item="item" open="(" separator="or" close=")">
  547. "capacityNumber" like '%${item}%'
  548. </foreach>
  549. </if>
  550. <if test="orderMaterialNumber != null">
  551. and
  552. <foreach collection="orderMaterialNumber" item="item" open="(" separator="or" close=")">
  553. "orderMaterialNumber" like '%${item}%'
  554. </foreach>
  555. </if>
  556. <if test="commssionType != null">
  557. and
  558. <foreach collection="commssionType" item="item" open="(" separator="or" close=")">
  559. "commssionType" like '%${item}%'
  560. </foreach>
  561. </if>
  562. <if test="supplierName != null">
  563. and
  564. <foreach collection="supplierName" item="item" open="(" separator="or" close=")">
  565. "supplierName" like '%${item}%'
  566. </foreach>
  567. </if>
  568. <if test="orderMaterialWeight != null">
  569. and
  570. <foreach collection="orderMaterialWeight" item="item" open="(" separator="or" close=")">
  571. "orderMaterialWeight" like '%${item}%'
  572. </foreach>
  573. </if>
  574. </where>
  575. <include refid="orderBy"></include>
  576. </select>
  577. <!-- 通过总实绩Id查询卸货实绩Id -->
  578. <select id="getResultIdByTotalId" parameterType="DECIMAL" resultType="DECIMAL">
  579. SELECT RESULT_ID
  580. FROM TMSTRUCK_UNLOAD_RESULT
  581. WHERE RESULT_TOTAL_ID = #{resultTotalId}
  582. </select>
  583. <!-- 通过运输订单号 查询实绩Id、总实绩ID -->
  584. <select id="selectTotalIdByOrderNo" parameterType="java.lang.String" resultType="java.util.Map">
  585. select OO.ORDER_ID "orderId",
  586. TUR.RESULT_ID "resultId",
  587. TTR.RESULT_TOTAL_ID "resultTotalId"
  588. from OMSTRUCK_ORDER OO
  589. left join TMSTRUCK_TOTAL_RESULT TTR
  590. on OO.ORDER_ID = TTR.ORDER_ID
  591. left join TMSTRUCK_UNLOAD_RESULT TUR
  592. on TTR.RESULT_TOTAL_ID = TUR.RESULT_TOTAL_ID
  593. where OO.ORDER_NUMBER = #{orderNumber}
  594. </select>
  595. <!-- 通过卸货地点查询 仓库ID-->
  596. <select id="getWarehouseIdByWName" parameterType="string" resultType="java.math.BigDecimal">
  597. select WAREHOUSE_ID
  598. from RMS_WAREHOUSE
  599. where WAREHOUSE_NAME = #{warehouseName}
  600. </select>
  601. </mapper>