TmstruckWeightResultMapper.xml 36 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756
  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.TmstruckWeightResultMapper">
  4. <resultMap id="BaseResultMap" type="com.steerinfo.dil.model.TmstruckWeightResult">
  5. <id column="WEIGHT_TASK_RESULT_ID" jdbcType="DECIMAL" property="weightTaskResultId" />
  6. <result column="RESULT_TOTAL_ID" jdbcType="DECIMAL" property="resultTotalId" />
  7. <result column="RESULT_POUND_NO" jdbcType="VARCHAR" property="resultPoundNo" />
  8. <result column="RESULT_GROSS_WEIGHT" jdbcType="DECIMAL" property="resultGrossWeight" />
  9. <result column="RESULT_GROSS_WEIGHT_TIME" jdbcType="TIMESTAMP" property="resultGrossWeightTime" />
  10. <result column="RESULT_TARE_WEIGHT" jdbcType="DECIMAL" property="resultTareWeight" />
  11. <result column="RESULT_TARE_WEIGHT_TIME" jdbcType="TIMESTAMP" property="resultTareWeightTime" />
  12. <result column="RESULT_NET_WEIGHT" jdbcType="DECIMAL" property="resultNetWeight" />
  13. <result column="INSERT_USERNAME" jdbcType="VARCHAR" property="insertUsername" />
  14. <result column="INSERT_TIME" jdbcType="TIMESTAMP" property="insertTime" />
  15. <result column="UPDATE_USERNAME" jdbcType="VARCHAR" property="updateUsername" />
  16. <result column="UPDATE_TIME" jdbcType="TIMESTAMP" property="updateTime" />
  17. <result column="INSERT_UPDATE_REMARK" jdbcType="VARCHAR" property="insertUpdateRemark" />
  18. <result column="DELETE_NAME" jdbcType="VARCHAR" property="deleteName" />
  19. <result column="DELETE_TIME" jdbcType="TIMESTAMP" property="deleteTime" />
  20. <result column="RESULT_GROSS_PLACE_ID" jdbcType="DECIMAL" property="resultGrossPlaceId" />
  21. <result column="RESULT_TARE_PLACE_ID" jdbcType="DECIMAL" property="resultTarePlaceId" />
  22. <result column="MATERIAL_ID" jdbcType="DECIMAL" property="materialId" />
  23. <result column="ISDEDUCT" jdbcType="DECIMAL" property="isdeduct" />
  24. <result column="ISQUALITY" jdbcType="DECIMAL" property="isquality" />
  25. </resultMap>
  26. <sql id="columns">
  27. WEIGHT_TASK_RESULT_ID, RESULT_TOTAL_ID, RESULT_POUND_NO, RESULT_GROSS_WEIGHT, RESULT_GROSS_WEIGHT_TIME,
  28. RESULT_TARE_WEIGHT, RESULT_TARE_WEIGHT_TIME, RESULT_NET_WEIGHT, INSERT_USERNAME,
  29. INSERT_TIME, UPDATE_USERNAME, UPDATE_TIME, INSERT_UPDATE_REMARK, DELETE_NAME, DELETE_TIME,
  30. RESULT_GROSS_PLACE_ID, RESULT_TARE_PLACE_ID, MATERIAL_ID, ISDEDUCT, ISQUALITY
  31. </sql>
  32. <sql id="columns_alias">
  33. t.WEIGHT_TASK_RESULT_ID, t.RESULT_TOTAL_ID, t.RESULT_POUND_NO, t.RESULT_GROSS_WEIGHT,
  34. t.RESULT_GROSS_WEIGHT_TIME, t.RESULT_TARE_WEIGHT, t.RESULT_TARE_WEIGHT_TIME, t.RESULT_NET_WEIGHT,
  35. t.INSERT_USERNAME, t.INSERT_TIME, t.UPDATE_USERNAME, t.UPDATE_TIME, t.INSERT_UPDATE_REMARK,
  36. t.DELETE_NAME, t.DELETE_TIME, t.RESULT_GROSS_PLACE_ID, t.RESULT_TARE_PLACE_ID, t.MATERIAL_ID,
  37. t.ISDEDUCT, t.ISQUALITY
  38. </sql>
  39. <sql id="select">
  40. SELECT <include refid="columns" /> FROM TMSTRUCK_WEIGHT_RESULT
  41. </sql>
  42. <sql id="select_alias">
  43. SELECT <include refid="columns_alias" /> FROM TMSTRUCK_WEIGHT_RESULT t
  44. </sql>
  45. <sql id="where">
  46. <where>
  47. <if test="weightTaskResultId != null">
  48. and WEIGHT_TASK_RESULT_ID = #{weightTaskResultId}
  49. </if>
  50. <if test="resultTotalId != null">
  51. and RESULT_TOTAL_ID = #{resultTotalId}
  52. </if>
  53. <if test="resultPoundNo != null and resultPoundNo != ''">
  54. and RESULT_POUND_NO = #{resultPoundNo}
  55. </if>
  56. <if test="resultGrossWeight != null">
  57. and RESULT_GROSS_WEIGHT = #{resultGrossWeight}
  58. </if>
  59. <if test="resultGrossWeightTime != null">
  60. and TO_CHAR(RESULT_GROSS_WEIGHT_TIME,'yyyy-MM-dd') = #{resultGrossWeightTime}
  61. </if>
  62. <if test="resultTareWeight != null">
  63. and RESULT_TARE_WEIGHT = #{resultTareWeight}
  64. </if>
  65. <if test="resultTareWeightTime != null">
  66. and TO_CHAR(RESULT_TARE_WEIGHT_TIME,'yyyy-MM-dd') = #{resultTareWeightTime}
  67. </if>
  68. <if test="resultNetWeight != null">
  69. and RESULT_NET_WEIGHT = #{resultNetWeight}
  70. </if>
  71. <if test="insertUsername != null and insertUsername != ''">
  72. and INSERT_USERNAME = #{insertUsername}
  73. </if>
  74. <if test="insertTime != null">
  75. and TO_CHAR(INSERT_TIME,'yyyy-MM-dd') = #{insertTime}
  76. </if>
  77. <if test="updateUsername != null and updateUsername != ''">
  78. and UPDATE_USERNAME = #{updateUsername}
  79. </if>
  80. <if test="updateTime != null">
  81. and TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = #{updateTime}
  82. </if>
  83. <if test="insertUpdateRemark != null and insertUpdateRemark != ''">
  84. and INSERT_UPDATE_REMARK = #{insertUpdateRemark}
  85. </if>
  86. <if test="deleteName != null and deleteName != ''">
  87. and DELETE_NAME = #{deleteName}
  88. </if>
  89. <if test="deleteTime != null">
  90. and TO_CHAR(DELETE_TIME,'yyyy-MM-dd') = #{deleteTime}
  91. </if>
  92. <if test="resultGrossPlaceId != null">
  93. and RESULT_GROSS_PLACE_ID = #{resultGrossPlaceId}
  94. </if>
  95. <if test="resultTarePlaceId != null">
  96. and RESULT_TARE_PLACE_ID = #{resultTarePlaceId}
  97. </if>
  98. <if test="materialId != null">
  99. and MATERIAL_ID = #{materialId}
  100. </if>
  101. <if test="isdeduct != null">
  102. and ISDEDUCT = #{isdeduct}
  103. </if>
  104. <if test="isquality != null">
  105. and ISQUALITY = #{isquality}
  106. </if>
  107. </where>
  108. </sql>
  109. <sql id="whereLike">
  110. <where>
  111. <if test="weightTaskResultId != null">
  112. and WEIGHT_TASK_RESULT_ID = #{weightTaskResultId}
  113. </if>
  114. <if test="resultTotalId != null">
  115. and RESULT_TOTAL_ID = #{resultTotalId}
  116. </if>
  117. <if test="resultPoundNo != null and resultPoundNo != ''">
  118. and RESULT_POUND_NO LIKE '%${resultPoundNo}%'
  119. </if>
  120. <if test="resultGrossWeight != null">
  121. and RESULT_GROSS_WEIGHT = #{resultGrossWeight}
  122. </if>
  123. <if test="resultGrossWeightTime != null">
  124. and TO_CHAR(RESULT_GROSS_WEIGHT_TIME,'yyyy-MM-dd') = #{resultGrossWeightTime}
  125. </if>
  126. <if test="resultTareWeight != null">
  127. and RESULT_TARE_WEIGHT = #{resultTareWeight}
  128. </if>
  129. <if test="resultTareWeightTime != null">
  130. and TO_CHAR(RESULT_TARE_WEIGHT_TIME,'yyyy-MM-dd') = #{resultTareWeightTime}
  131. </if>
  132. <if test="resultNetWeight != null">
  133. and RESULT_NET_WEIGHT = #{resultNetWeight}
  134. </if>
  135. <if test="insertUsername != null and insertUsername != ''">
  136. and INSERT_USERNAME LIKE '%${insertUsername}%'
  137. </if>
  138. <if test="insertTime != null">
  139. and TO_CHAR(INSERT_TIME,'yyyy-MM-dd') = #{insertTime}
  140. </if>
  141. <if test="updateUsername != null and updateUsername != ''">
  142. and UPDATE_USERNAME LIKE '%${updateUsername}%'
  143. </if>
  144. <if test="updateTime != null">
  145. and TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = #{updateTime}
  146. </if>
  147. <if test="insertUpdateRemark != null and insertUpdateRemark != ''">
  148. and INSERT_UPDATE_REMARK LIKE '%${insertUpdateRemark}%'
  149. </if>
  150. <if test="deleteName != null and deleteName != ''">
  151. and DELETE_NAME LIKE '%${deleteName}%'
  152. </if>
  153. <if test="deleteTime != null">
  154. and TO_CHAR(DELETE_TIME,'yyyy-MM-dd') = #{deleteTime}
  155. </if>
  156. <if test="resultGrossPlaceId != null">
  157. and RESULT_GROSS_PLACE_ID = #{resultGrossPlaceId}
  158. </if>
  159. <if test="resultTarePlaceId != null">
  160. and RESULT_TARE_PLACE_ID = #{resultTarePlaceId}
  161. </if>
  162. <if test="materialId != null">
  163. and MATERIAL_ID = #{materialId}
  164. </if>
  165. <if test="isdeduct != null">
  166. and ISDEDUCT = #{isdeduct}
  167. </if>
  168. <if test="isquality != null">
  169. and ISQUALITY = #{isquality}
  170. </if>
  171. </where>
  172. </sql>
  173. <delete id="deleteByPrimaryKey" parameterType="DECIMAL">
  174. delete from TMSTRUCK_WEIGHT_RESULT
  175. where WEIGHT_TASK_RESULT_ID = #{weightTaskResultId,jdbcType=DECIMAL}
  176. </delete>
  177. <delete id="deleteBySelectiveElement" parameterType="java.util.HashMap">
  178. delete from TMSTRUCK_WEIGHT_RESULT
  179. where 1!=1
  180. <if test="resultTotalId != null">
  181. or RESULT_TOTAL_ID = #{resultTotalId}
  182. </if>
  183. <if test="resultPoundNo != null and resultPoundNo != ''">
  184. or RESULT_POUND_NO = #{resultPoundNo}
  185. </if>
  186. <if test="resultGrossWeight != null">
  187. or RESULT_GROSS_WEIGHT = #{resultGrossWeight}
  188. </if>
  189. <if test="resultGrossWeightTime != null">
  190. or TO_CHAR(RESULT_GROSS_WEIGHT_TIME,'yyyy-MM-dd') = '#{resultGrossWeightTime}'
  191. </if>
  192. <if test="resultTareWeight != null">
  193. or RESULT_TARE_WEIGHT = #{resultTareWeight}
  194. </if>
  195. <if test="resultTareWeightTime != null">
  196. or TO_CHAR(RESULT_TARE_WEIGHT_TIME,'yyyy-MM-dd') = '#{resultTareWeightTime}'
  197. </if>
  198. <if test="resultNetWeight != null">
  199. or RESULT_NET_WEIGHT = #{resultNetWeight}
  200. </if>
  201. <if test="insertUsername != null and insertUsername != ''">
  202. or INSERT_USERNAME = #{insertUsername}
  203. </if>
  204. <if test="insertTime != null">
  205. or TO_CHAR(INSERT_TIME,'yyyy-MM-dd') = '#{insertTime}'
  206. </if>
  207. <if test="updateUsername != null and updateUsername != ''">
  208. or UPDATE_USERNAME = #{updateUsername}
  209. </if>
  210. <if test="updateTime != null">
  211. or TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = '#{updateTime}'
  212. </if>
  213. <if test="insertUpdateRemark != null and insertUpdateRemark != ''">
  214. or INSERT_UPDATE_REMARK = #{insertUpdateRemark}
  215. </if>
  216. <if test="deleteName != null and deleteName != ''">
  217. or DELETE_NAME = #{deleteName}
  218. </if>
  219. <if test="deleteTime != null">
  220. or TO_CHAR(DELETE_TIME,'yyyy-MM-dd') = '#{deleteTime}'
  221. </if>
  222. <if test="resultGrossPlaceId != null">
  223. or RESULT_GROSS_PLACE_ID = #{resultGrossPlaceId}
  224. </if>
  225. <if test="resultTarePlaceId != null">
  226. or RESULT_TARE_PLACE_ID = #{resultTarePlaceId}
  227. </if>
  228. <if test="materialId != null">
  229. or MATERIAL_ID = #{materialId}
  230. </if>
  231. <if test="isdeduct != null">
  232. or ISDEDUCT = #{isdeduct}
  233. </if>
  234. <if test="isquality != null">
  235. or ISQUALITY = #{isquality}
  236. </if>
  237. </delete>
  238. <insert id="insert" parameterType="com.steerinfo.dil.model.TmstruckWeightResult">
  239. insert into TMSTRUCK_WEIGHT_RESULT (WEIGHT_TASK_RESULT_ID, RESULT_TOTAL_ID,
  240. RESULT_POUND_NO, RESULT_GROSS_WEIGHT, RESULT_GROSS_WEIGHT_TIME,
  241. RESULT_TARE_WEIGHT, RESULT_TARE_WEIGHT_TIME,
  242. RESULT_NET_WEIGHT, INSERT_USERNAME, INSERT_TIME,
  243. UPDATE_USERNAME, UPDATE_TIME, INSERT_UPDATE_REMARK,
  244. DELETE_NAME, DELETE_TIME, RESULT_GROSS_PLACE_ID,
  245. RESULT_TARE_PLACE_ID, MATERIAL_ID, ISDEDUCT,
  246. ISQUALITY)
  247. values (#{weightTaskResultId,jdbcType=DECIMAL}, #{resultTotalId,jdbcType=DECIMAL},
  248. #{resultPoundNo,jdbcType=VARCHAR}, #{resultGrossWeight,jdbcType=DECIMAL}, #{resultGrossWeightTime,jdbcType=TIMESTAMP},
  249. #{resultTareWeight,jdbcType=DECIMAL}, #{resultTareWeightTime,jdbcType=TIMESTAMP},
  250. #{resultNetWeight,jdbcType=DECIMAL}, #{insertUsername,jdbcType=VARCHAR}, #{insertTime,jdbcType=TIMESTAMP},
  251. #{updateUsername,jdbcType=VARCHAR}, #{updateTime,jdbcType=TIMESTAMP}, #{insertUpdateRemark,jdbcType=VARCHAR},
  252. #{deleteName,jdbcType=VARCHAR}, #{deleteTime,jdbcType=TIMESTAMP}, #{resultGrossPlaceId,jdbcType=DECIMAL},
  253. #{resultTarePlaceId,jdbcType=DECIMAL}, #{materialId,jdbcType=DECIMAL}, #{isdeduct,jdbcType=DECIMAL},
  254. #{isquality,jdbcType=DECIMAL})
  255. </insert>
  256. <insert id="insertSelective" parameterType="com.steerinfo.dil.model.TmstruckWeightResult">
  257. insert into TMSTRUCK_WEIGHT_RESULT
  258. <trim prefix="(" suffix=")" suffixOverrides=",">
  259. <if test="weightTaskResultId != null">
  260. WEIGHT_TASK_RESULT_ID,
  261. </if>
  262. <if test="resultTotalId != null">
  263. RESULT_TOTAL_ID,
  264. </if>
  265. <if test="resultPoundNo != null">
  266. RESULT_POUND_NO,
  267. </if>
  268. <if test="resultGrossWeight != null">
  269. RESULT_GROSS_WEIGHT,
  270. </if>
  271. <if test="resultGrossWeightTime != null">
  272. RESULT_GROSS_WEIGHT_TIME,
  273. </if>
  274. <if test="resultTareWeight != null">
  275. RESULT_TARE_WEIGHT,
  276. </if>
  277. <if test="resultTareWeightTime != null">
  278. RESULT_TARE_WEIGHT_TIME,
  279. </if>
  280. <if test="resultNetWeight != null">
  281. RESULT_NET_WEIGHT,
  282. </if>
  283. <if test="insertUsername != null">
  284. INSERT_USERNAME,
  285. </if>
  286. <if test="insertTime != null">
  287. INSERT_TIME,
  288. </if>
  289. <if test="updateUsername != null">
  290. UPDATE_USERNAME,
  291. </if>
  292. <if test="updateTime != null">
  293. UPDATE_TIME,
  294. </if>
  295. <if test="insertUpdateRemark != null">
  296. INSERT_UPDATE_REMARK,
  297. </if>
  298. <if test="deleteName != null">
  299. DELETE_NAME,
  300. </if>
  301. <if test="deleteTime != null">
  302. DELETE_TIME,
  303. </if>
  304. <if test="resultGrossPlaceId != null">
  305. RESULT_GROSS_PLACE_ID,
  306. </if>
  307. <if test="resultTarePlaceId != null">
  308. RESULT_TARE_PLACE_ID,
  309. </if>
  310. <if test="materialId != null">
  311. MATERIAL_ID,
  312. </if>
  313. <if test="isdeduct != null">
  314. ISDEDUCT,
  315. </if>
  316. <if test="isquality != null">
  317. ISQUALITY,
  318. </if>
  319. </trim>
  320. <trim prefix="values (" suffix=")" suffixOverrides=",">
  321. <if test="weightTaskResultId != null">
  322. #{weightTaskResultId,jdbcType=DECIMAL},
  323. </if>
  324. <if test="resultTotalId != null">
  325. #{resultTotalId,jdbcType=DECIMAL},
  326. </if>
  327. <if test="resultPoundNo != null">
  328. #{resultPoundNo,jdbcType=VARCHAR},
  329. </if>
  330. <if test="resultGrossWeight != null">
  331. #{resultGrossWeight,jdbcType=DECIMAL},
  332. </if>
  333. <if test="resultGrossWeightTime != null">
  334. #{resultGrossWeightTime,jdbcType=TIMESTAMP},
  335. </if>
  336. <if test="resultTareWeight != null">
  337. #{resultTareWeight,jdbcType=DECIMAL},
  338. </if>
  339. <if test="resultTareWeightTime != null">
  340. #{resultTareWeightTime,jdbcType=TIMESTAMP},
  341. </if>
  342. <if test="resultNetWeight != null">
  343. #{resultNetWeight,jdbcType=DECIMAL},
  344. </if>
  345. <if test="insertUsername != null">
  346. #{insertUsername,jdbcType=VARCHAR},
  347. </if>
  348. <if test="insertTime != null">
  349. #{insertTime,jdbcType=TIMESTAMP},
  350. </if>
  351. <if test="updateUsername != null">
  352. #{updateUsername,jdbcType=VARCHAR},
  353. </if>
  354. <if test="updateTime != null">
  355. #{updateTime,jdbcType=TIMESTAMP},
  356. </if>
  357. <if test="insertUpdateRemark != null">
  358. #{insertUpdateRemark,jdbcType=VARCHAR},
  359. </if>
  360. <if test="deleteName != null">
  361. #{deleteName,jdbcType=VARCHAR},
  362. </if>
  363. <if test="deleteTime != null">
  364. #{deleteTime,jdbcType=TIMESTAMP},
  365. </if>
  366. <if test="resultGrossPlaceId != null">
  367. #{resultGrossPlaceId,jdbcType=DECIMAL},
  368. </if>
  369. <if test="resultTarePlaceId != null">
  370. #{resultTarePlaceId,jdbcType=DECIMAL},
  371. </if>
  372. <if test="materialId != null">
  373. #{materialId,jdbcType=DECIMAL},
  374. </if>
  375. <if test="isdeduct != null">
  376. #{isdeduct,jdbcType=DECIMAL},
  377. </if>
  378. <if test="isquality != null">
  379. #{isquality,jdbcType=DECIMAL},
  380. </if>
  381. </trim>
  382. </insert>
  383. <update id="updateByPrimaryKey" parameterType="com.steerinfo.dil.model.TmstruckWeightResult">
  384. update TMSTRUCK_WEIGHT_RESULT
  385. set RESULT_TOTAL_ID = #{resultTotalId,jdbcType=DECIMAL},
  386. RESULT_POUND_NO = #{resultPoundNo,jdbcType=VARCHAR},
  387. RESULT_GROSS_WEIGHT = #{resultGrossWeight,jdbcType=DECIMAL},
  388. RESULT_GROSS_WEIGHT_TIME = #{resultGrossWeightTime,jdbcType=TIMESTAMP},
  389. RESULT_TARE_WEIGHT = #{resultTareWeight,jdbcType=DECIMAL},
  390. RESULT_TARE_WEIGHT_TIME = #{resultTareWeightTime,jdbcType=TIMESTAMP},
  391. RESULT_NET_WEIGHT = #{resultNetWeight,jdbcType=DECIMAL},
  392. INSERT_USERNAME = #{insertUsername,jdbcType=VARCHAR},
  393. INSERT_TIME = #{insertTime,jdbcType=TIMESTAMP},
  394. UPDATE_USERNAME = #{updateUsername,jdbcType=VARCHAR},
  395. UPDATE_TIME = #{updateTime,jdbcType=TIMESTAMP},
  396. INSERT_UPDATE_REMARK = #{insertUpdateRemark,jdbcType=VARCHAR},
  397. DELETE_NAME = #{deleteName,jdbcType=VARCHAR},
  398. DELETE_TIME = #{deleteTime,jdbcType=TIMESTAMP},
  399. RESULT_GROSS_PLACE_ID = #{resultGrossPlaceId,jdbcType=DECIMAL},
  400. RESULT_TARE_PLACE_ID = #{resultTarePlaceId,jdbcType=DECIMAL},
  401. MATERIAL_ID = #{materialId,jdbcType=DECIMAL},
  402. ISDEDUCT = #{isdeduct,jdbcType=DECIMAL},
  403. ISQUALITY = #{isquality,jdbcType=DECIMAL}
  404. where WEIGHT_TASK_RESULT_ID = #{weightTaskResultId,jdbcType=DECIMAL}
  405. </update>
  406. <update id="updateByPrimaryKeySelective" parameterType="com.steerinfo.dil.model.TmstruckWeightResult">
  407. update TMSTRUCK_WEIGHT_RESULT
  408. <set>
  409. <if test="resultTotalId != null">
  410. RESULT_TOTAL_ID = #{resultTotalId,jdbcType=DECIMAL},
  411. </if>
  412. <if test="resultPoundNo != null">
  413. RESULT_POUND_NO = #{resultPoundNo,jdbcType=VARCHAR},
  414. </if>
  415. <if test="resultGrossWeight != null">
  416. RESULT_GROSS_WEIGHT = #{resultGrossWeight,jdbcType=DECIMAL},
  417. </if>
  418. <if test="resultGrossWeightTime != null">
  419. RESULT_GROSS_WEIGHT_TIME = #{resultGrossWeightTime,jdbcType=TIMESTAMP},
  420. </if>
  421. <if test="resultTareWeight != null">
  422. RESULT_TARE_WEIGHT = #{resultTareWeight,jdbcType=DECIMAL},
  423. </if>
  424. <if test="resultTareWeightTime != null">
  425. RESULT_TARE_WEIGHT_TIME = #{resultTareWeightTime,jdbcType=TIMESTAMP},
  426. </if>
  427. <if test="resultNetWeight != null">
  428. RESULT_NET_WEIGHT = #{resultNetWeight,jdbcType=DECIMAL},
  429. </if>
  430. <if test="insertUsername != null">
  431. INSERT_USERNAME = #{insertUsername,jdbcType=VARCHAR},
  432. </if>
  433. <if test="insertTime != null">
  434. INSERT_TIME = #{insertTime,jdbcType=TIMESTAMP},
  435. </if>
  436. <if test="updateUsername != null">
  437. UPDATE_USERNAME = #{updateUsername,jdbcType=VARCHAR},
  438. </if>
  439. <if test="updateTime != null">
  440. UPDATE_TIME = #{updateTime,jdbcType=TIMESTAMP},
  441. </if>
  442. <if test="insertUpdateRemark != null">
  443. INSERT_UPDATE_REMARK = #{insertUpdateRemark,jdbcType=VARCHAR},
  444. </if>
  445. <if test="deleteName != null">
  446. DELETE_NAME = #{deleteName,jdbcType=VARCHAR},
  447. </if>
  448. <if test="deleteTime != null">
  449. DELETE_TIME = #{deleteTime,jdbcType=TIMESTAMP},
  450. </if>
  451. <if test="resultGrossPlaceId != null">
  452. RESULT_GROSS_PLACE_ID = #{resultGrossPlaceId,jdbcType=DECIMAL},
  453. </if>
  454. <if test="resultTarePlaceId != null">
  455. RESULT_TARE_PLACE_ID = #{resultTarePlaceId,jdbcType=DECIMAL},
  456. </if>
  457. <if test="materialId != null">
  458. MATERIAL_ID = #{materialId,jdbcType=DECIMAL},
  459. </if>
  460. <if test="isdeduct != null">
  461. ISDEDUCT = #{isdeduct,jdbcType=DECIMAL},
  462. </if>
  463. <if test="isquality != null">
  464. ISQUALITY = #{isquality,jdbcType=DECIMAL},
  465. </if>
  466. </set>
  467. where WEIGHT_TASK_RESULT_ID = #{weightTaskResultId,jdbcType=DECIMAL}
  468. </update>
  469. <select id="selectByPrimaryKey" parameterType="DECIMAL" resultMap="BaseResultMap">
  470. <include refid="select" />
  471. where WEIGHT_TASK_RESULT_ID = #{weightTaskResultId,jdbcType=DECIMAL}
  472. </select>
  473. <select id="selectByParameters" parameterType="java.util.HashMap" resultMap="BaseResultMap">
  474. <include refid="select" />
  475. <include refid="where" />
  476. </select>
  477. <select id="selectLikeByParameters" parameterType="java.util.HashMap" resultMap="BaseResultMap">
  478. <include refid="select" />
  479. <include refid="whereLike" />
  480. </select>
  481. <insert id="batchInsert" parameterType="java.util.List">
  482. insert into TMSTRUCK_WEIGHT_RESULT
  483. (WEIGHT_TASK_RESULT_ID,
  484. RESULT_TOTAL_ID, RESULT_POUND_NO,
  485. RESULT_GROSS_WEIGHT, RESULT_GROSS_WEIGHT_TIME,
  486. RESULT_TARE_WEIGHT, RESULT_TARE_WEIGHT_TIME,
  487. RESULT_NET_WEIGHT, INSERT_USERNAME,
  488. INSERT_TIME, UPDATE_USERNAME,
  489. UPDATE_TIME, INSERT_UPDATE_REMARK,
  490. DELETE_NAME, DELETE_TIME, RESULT_GROSS_PLACE_ID,
  491. RESULT_TARE_PLACE_ID, MATERIAL_ID,
  492. ISDEDUCT, ISQUALITY)
  493. ( <foreach collection="list" item="item" separator="union all">
  494. select
  495. #{item.weightTaskResultId,jdbcType=DECIMAL},
  496. #{item.resultTotalId,jdbcType=DECIMAL}, #{item.resultPoundNo,jdbcType=VARCHAR},
  497. #{item.resultGrossWeight,jdbcType=DECIMAL}, #{item.resultGrossWeightTime,jdbcType=TIMESTAMP},
  498. #{item.resultTareWeight,jdbcType=DECIMAL}, #{item.resultTareWeightTime,jdbcType=TIMESTAMP},
  499. #{item.resultNetWeight,jdbcType=DECIMAL}, #{item.insertUsername,jdbcType=VARCHAR},
  500. #{item.insertTime,jdbcType=TIMESTAMP}, #{item.updateUsername,jdbcType=VARCHAR},
  501. #{item.updateTime,jdbcType=TIMESTAMP}, #{item.insertUpdateRemark,jdbcType=VARCHAR},
  502. #{item.deleteName,jdbcType=VARCHAR}, #{item.deleteTime,jdbcType=TIMESTAMP}, #{item.resultGrossPlaceId,jdbcType=DECIMAL},
  503. #{item.resultTarePlaceId,jdbcType=DECIMAL}, #{item.materialId,jdbcType=DECIMAL},
  504. #{item.isdeduct,jdbcType=DECIMAL}, #{item.isquality,jdbcType=DECIMAL} from dual
  505. </foreach> )
  506. </insert>
  507. <update id="batchUpdate" parameterType="java.util.List">
  508. update TMSTRUCK_WEIGHT_RESULT
  509. set
  510. WEIGHT_TASK_RESULT_ID=
  511. <foreach close="end" collection="list" index="index" item="item" open="case WEIGHT_TASK_RESULT_ID" separator=" ">
  512. when #{item.weightTaskResultId,jdbcType=DECIMAL} then #{item.weightTaskResultId,jdbcType=DECIMAL}
  513. </foreach>
  514. ,RESULT_TOTAL_ID=
  515. <foreach close="end" collection="list" index="index" item="item" open="case WEIGHT_TASK_RESULT_ID" separator=" ">
  516. when #{item.weightTaskResultId,jdbcType=DECIMAL} then #{item.resultTotalId,jdbcType=DECIMAL}
  517. </foreach>
  518. ,RESULT_POUND_NO=
  519. <foreach close="end" collection="list" index="index" item="item" open="case WEIGHT_TASK_RESULT_ID" separator=" ">
  520. when #{item.weightTaskResultId,jdbcType=DECIMAL} then #{item.resultPoundNo,jdbcType=VARCHAR}
  521. </foreach>
  522. ,RESULT_GROSS_WEIGHT=
  523. <foreach close="end" collection="list" index="index" item="item" open="case WEIGHT_TASK_RESULT_ID" separator=" ">
  524. when #{item.weightTaskResultId,jdbcType=DECIMAL} then #{item.resultGrossWeight,jdbcType=DECIMAL}
  525. </foreach>
  526. ,RESULT_GROSS_WEIGHT_TIME=
  527. <foreach close="end" collection="list" index="index" item="item" open="case WEIGHT_TASK_RESULT_ID" separator=" ">
  528. when #{item.weightTaskResultId,jdbcType=DECIMAL} then #{item.resultGrossWeightTime,jdbcType=TIMESTAMP}
  529. </foreach>
  530. ,RESULT_TARE_WEIGHT=
  531. <foreach close="end" collection="list" index="index" item="item" open="case WEIGHT_TASK_RESULT_ID" separator=" ">
  532. when #{item.weightTaskResultId,jdbcType=DECIMAL} then #{item.resultTareWeight,jdbcType=DECIMAL}
  533. </foreach>
  534. ,RESULT_TARE_WEIGHT_TIME=
  535. <foreach close="end" collection="list" index="index" item="item" open="case WEIGHT_TASK_RESULT_ID" separator=" ">
  536. when #{item.weightTaskResultId,jdbcType=DECIMAL} then #{item.resultTareWeightTime,jdbcType=TIMESTAMP}
  537. </foreach>
  538. ,RESULT_NET_WEIGHT=
  539. <foreach close="end" collection="list" index="index" item="item" open="case WEIGHT_TASK_RESULT_ID" separator=" ">
  540. when #{item.weightTaskResultId,jdbcType=DECIMAL} then #{item.resultNetWeight,jdbcType=DECIMAL}
  541. </foreach>
  542. ,INSERT_USERNAME=
  543. <foreach close="end" collection="list" index="index" item="item" open="case WEIGHT_TASK_RESULT_ID" separator=" ">
  544. when #{item.weightTaskResultId,jdbcType=DECIMAL} then #{item.insertUsername,jdbcType=VARCHAR}
  545. </foreach>
  546. ,INSERT_TIME=
  547. <foreach close="end" collection="list" index="index" item="item" open="case WEIGHT_TASK_RESULT_ID" separator=" ">
  548. when #{item.weightTaskResultId,jdbcType=DECIMAL} then #{item.insertTime,jdbcType=TIMESTAMP}
  549. </foreach>
  550. ,UPDATE_USERNAME=
  551. <foreach close="end" collection="list" index="index" item="item" open="case WEIGHT_TASK_RESULT_ID" separator=" ">
  552. when #{item.weightTaskResultId,jdbcType=DECIMAL} then #{item.updateUsername,jdbcType=VARCHAR}
  553. </foreach>
  554. ,UPDATE_TIME=
  555. <foreach close="end" collection="list" index="index" item="item" open="case WEIGHT_TASK_RESULT_ID" separator=" ">
  556. when #{item.weightTaskResultId,jdbcType=DECIMAL} then #{item.updateTime,jdbcType=TIMESTAMP}
  557. </foreach>
  558. ,INSERT_UPDATE_REMARK=
  559. <foreach close="end" collection="list" index="index" item="item" open="case WEIGHT_TASK_RESULT_ID" separator=" ">
  560. when #{item.weightTaskResultId,jdbcType=DECIMAL} then #{item.insertUpdateRemark,jdbcType=VARCHAR}
  561. </foreach>
  562. ,DELETE_NAME=
  563. <foreach close="end" collection="list" index="index" item="item" open="case WEIGHT_TASK_RESULT_ID" separator=" ">
  564. when #{item.weightTaskResultId,jdbcType=DECIMAL} then #{item.deleteName,jdbcType=VARCHAR}
  565. </foreach>
  566. ,DELETE_TIME=
  567. <foreach close="end" collection="list" index="index" item="item" open="case WEIGHT_TASK_RESULT_ID" separator=" ">
  568. when #{item.weightTaskResultId,jdbcType=DECIMAL} then #{item.deleteTime,jdbcType=TIMESTAMP}
  569. </foreach>
  570. ,RESULT_GROSS_PLACE_ID=
  571. <foreach close="end" collection="list" index="index" item="item" open="case WEIGHT_TASK_RESULT_ID" separator=" ">
  572. when #{item.weightTaskResultId,jdbcType=DECIMAL} then #{item.resultGrossPlaceId,jdbcType=DECIMAL}
  573. </foreach>
  574. ,RESULT_TARE_PLACE_ID=
  575. <foreach close="end" collection="list" index="index" item="item" open="case WEIGHT_TASK_RESULT_ID" separator=" ">
  576. when #{item.weightTaskResultId,jdbcType=DECIMAL} then #{item.resultTarePlaceId,jdbcType=DECIMAL}
  577. </foreach>
  578. ,MATERIAL_ID=
  579. <foreach close="end" collection="list" index="index" item="item" open="case WEIGHT_TASK_RESULT_ID" separator=" ">
  580. when #{item.weightTaskResultId,jdbcType=DECIMAL} then #{item.materialId,jdbcType=DECIMAL}
  581. </foreach>
  582. ,ISDEDUCT=
  583. <foreach close="end" collection="list" index="index" item="item" open="case WEIGHT_TASK_RESULT_ID" separator=" ">
  584. when #{item.weightTaskResultId,jdbcType=DECIMAL} then #{item.isdeduct,jdbcType=DECIMAL}
  585. </foreach>
  586. ,ISQUALITY=
  587. <foreach close="end" collection="list" index="index" item="item" open="case WEIGHT_TASK_RESULT_ID" separator=" ">
  588. when #{item.weightTaskResultId,jdbcType=DECIMAL} then #{item.isquality,jdbcType=DECIMAL}
  589. </foreach>
  590. where WEIGHT_TASK_RESULT_ID in
  591. <foreach close=")" collection="list" index="index" item="item" open="(" separator=",">
  592. #{item.weightTaskResultId,jdbcType=DECIMAL}
  593. </foreach>
  594. </update>
  595. <delete id="batchDelete" parameterType="java.util.List">
  596. delete from TMSTRUCK_WEIGHT_RESULT
  597. where WEIGHT_TASK_RESULT_ID in
  598. <foreach close=")" collection="list" item="id" open="(" separator=",">
  599. #{id}
  600. </foreach>
  601. </delete>
  602. <!-- 请将自己写的代码放在此标签之下,方便以后粘贴复制。-->
  603. <!-- 得到计重实绩主键id -->
  604. <!-- 得到汽车衡id -->
  605. <select id="getTruckCalculateId" parameterType="java.lang.String" resultType="DECIMAL">
  606. SELECT
  607. RTC.TRUCK_CALCULATE_ID AS "resultTarePlaceId"
  608. FROM RMS_TRUCK_CALCULATE RTC
  609. WHERE RTC.TRUCK_CALCULATE_NUMBER = #{resultCalculateNumber}
  610. </select>
  611. <select id="getWeightTaskResultId" resultType="DECIMAL" parameterType="java.util.Map">
  612. SELECT TWR.WEIGHT_TASK_RESULT_ID as "weightTaskResultId"
  613. FROM TMSTRUCK_WEIGHT_RESULT TWR
  614. LEFT JOIN TMSTRUCK_TOTAL_RESULT TTR
  615. ON TTR.RESULT_TOTAL_ID = TWR.RESULT_TOTAL_ID
  616. LEFT JOIN OMSTRUCK_ORDER OO
  617. ON OO.ORDER_ID = TTR.ORDER_ID
  618. WHERE OO.ORDER_NUMBER = #{orderNumber,jdbcType=VARCHAR}
  619. and TWR.MATERIAL_ID=#{materialId,jdbcType=DECIMAL}
  620. </select>
  621. <select id="selectWzInputId" resultType="java.util.Map">
  622. SELECT twr.RESULT_POUND_NO "WzInputId", twr.RESULT_TOTAL_ID "resultTotalId"
  623. from TMSTRUCK_WEIGHT_RESULT TWR
  624. LEFT JOIN TMSTRUCK_TOTAL_RESULT TTR
  625. ON TTR.RESULT_TOTAL_ID = TWR.RESULT_TOTAL_ID
  626. LEFT JOIN OMSTRUCK_ORDER OO
  627. ON OO.ORDER_ID = TTR.ORDER_ID
  628. WHERE OO.ORDER_TYPE IN (7, 10, 18)
  629. AND TWR.ISQUALITY IS NULL
  630. </select>
  631. <update id="updateWzInputId">
  632. update TMSTRUCK_WEIGHT_RESULT twr
  633. set twr.ISQUALITY=1
  634. where twr.RESULT_POUND_NO=#{wzInputId}
  635. </update>
  636. <update id="updateTruckWeightResult" parameterType="java.util.Map">
  637. UPDATE (
  638. SELECT
  639. *
  640. FROM
  641. TMSTRUCK_WEIGHT_RESULT twr
  642. WHERE
  643. twr.RESULT_TOTAL_ID = (
  644. SELECT
  645. ttr.RESULT_TOTAL_ID
  646. FROM
  647. TMSTRUCK_TOTAL_RESULT ttr
  648. WHERE
  649. ttr.ORDER_ID = ( SELECT oo.ORDER_ID FROM OMSTRUCK_ORDER oo WHERE oo.ORDER_NUMBER = #{orderNumber} )
  650. )
  651. ) tt
  652. SET
  653. tt.RESULT_TARE_WEIGHT = #{resultWeight},
  654. tt.RESULT_NET_WEIGHT = #{resultNetWeight},
  655. tt.RESULT_TARE_PLACE_ID = #{resultTarePlaceId},
  656. tt.RESULT_TARE_WEIGHT_TIME = TO_DATE( #{resultWeightTime}, 'yyyy-mm-dd hh24:mi:ss' )
  657. </update>
  658. <update id="updateTruckWeightResultGross" parameterType="java.util.Map">
  659. UPDATE (
  660. SELECT
  661. *
  662. FROM
  663. TMSTRUCK_WEIGHT_RESULT twr
  664. WHERE
  665. twr.RESULT_TOTAL_ID = (
  666. SELECT
  667. ttr.RESULT_TOTAL_ID
  668. FROM
  669. TMSTRUCK_TOTAL_RESULT ttr
  670. WHERE
  671. ttr.ORDER_ID = ( SELECT oo.ORDER_ID FROM OMSTRUCK_ORDER oo WHERE oo.ORDER_NUMBER = #{orderNumber} )
  672. )
  673. and
  674. twr.MATERIAL_ID = #{materialId}
  675. ) tt
  676. SET tt.RESULT_POUND_NO = #{resultPoundNo},
  677. tt.RESULT_GROSS_WEIGHT = #{resultWeight},
  678. tt.RESULT_NET_WEIGHT = #{resultNetWeight},
  679. tt.RESULT_GROSS_PLACE_ID = #{resultTarePlaceId},
  680. tt.RESULT_GROSS_WEIGHT_TIME = TO_DATE( #{resultWeightTime}, 'yyyy-mm-dd hh24:mi:ss' )
  681. </update>
  682. <!-- 通过运输订单号 查询实绩Id、总实绩ID -->
  683. <select id="selectTotalIdByOrderNo" parameterType="java.util.Map" resultType="java.util.Map">
  684. select *
  685. from (
  686. select OO.ORDER_ID "orderId",
  687. OO.ORDER_TYPE "orderTypee",
  688. TWR.WEIGHT_TASK_RESULT_ID "weightTaskResultId",
  689. TTR.RESULT_TOTAL_ID "resultTotalId",
  690. RC.CAPACITY_NUMBER "capacityNumber",
  691. TWR.TARE_SEGMENT_SQE "tareSegmentSqe",
  692. TWR.GROSS_SEGMENT_SQE "grossSegmentSqe"
  693. from OMSTRUCK_ORDER OO
  694. left join TMSTRUCK_TOTAL_RESULT TTR
  695. on OO.ORDER_ID = TTR.ORDER_ID
  696. left join TMSTRUCK_WEIGHT_RESULT TWR
  697. on TWR.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
  698. left join RMS_CAPACITY RC
  699. on RC.CAPACITY_ID = OO.CAPACITY_ID
  700. where OO.ORDER_NUMBER = #{orderNumber}
  701. <if test="materialId != null">
  702. and TWR.MATERIAL_ID = #{materialId}
  703. </if>
  704. )
  705. where rownum = 1
  706. </select>
  707. <!-- 通过汽车衡编号查询对应的汽车衡ID -->
  708. <select id="selectTruckCalculateId" parameterType="java.lang.String" resultType="int">
  709. select TRUCK_CALCULATE_ID
  710. from RMS_TRUCK_CALCULATE
  711. where TRUCK_CALCULATE_NUMBER = #{truckCalculateNumber}
  712. </select>
  713. <!-- 通过运输订单号查询计量实绩Id 条件 路段顺序号 和 净重 -->
  714. <select id="selectWeightIdByOrderId" parameterType="map" resultType="java.util.Map">
  715. select *
  716. from (
  717. select OO.ORDER_ID "orderId",
  718. OO.ORDER_TYPE "orderTypee",
  719. TWR.WEIGHT_TASK_RESULT_ID "weightTaskResultId",
  720. TTR.RESULT_TOTAL_ID "resultTotalId",
  721. RC.CAPACITY_NUMBER "capacityNumber",
  722. TWR.TARE_SEGMENT_SQE "tareSegmentSqe",
  723. TWR.GROSS_SEGMENT_SQE "grossSegmentSqe"
  724. from TMSTRUCK_WEIGHT_RESULT TWR
  725. left join TMSTRUCK_TOTAL_RESULT TTR
  726. on TTR.RESULT_TOTAL_ID = TWR.RESULT_TOTAL_ID
  727. left join OMSTRUCK_ORDER OO
  728. on OO.ORDER_ID = TTR.ORDER_ID
  729. left join RMS_CAPACITY RC
  730. on RC.CAPACITY_ID = OO.CAPACITY_ID
  731. where OO.ORDER_NUMBER = #{orderNumber}
  732. and TWR.RESULT_NET_WEIGHT is null
  733. order by "tareSegmentSqe"
  734. )
  735. where rownum = 1
  736. </select>
  737. <!-- 通过订单Id查询还没有净重的计量实绩 -->
  738. <select id="selectNoNetWeightResult" parameterType="string" resultType="int">
  739. select COUNT(TWR.WEIGHT_TASK_RESULT_ID)
  740. from TMSTRUCK_WEIGHT_RESULT TWR
  741. left join TMSTRUCK_TOTAL_RESULT TTR
  742. on TTR.RESULT_TOTAL_ID = TWR.RESULT_TOTAL_ID
  743. left join OMSTRUCK_ORDER OO
  744. on OO.ORDER_ID = TTR.ORDER_ID
  745. where OO.ORDER_NUMBER = #{orderNumber}
  746. and TWR.RESULT_NET_WEIGHT is null
  747. </select>
  748. </mapper>