TmstruckWeightResultMapper.xml 40 KB

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