TmstruckWeightResultMapper.xml 50 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061
  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. <result column="MATERIAL_NUM" jdbcType="DECIMAL" property="materialNum" />
  28. </resultMap>
  29. <sql id="columns">
  30. WEIGHT_TASK_RESULT_ID, RESULT_TOTAL_ID, RESULT_POUND_NO, RESULT_GROSS_WEIGHT, RESULT_GROSS_WEIGHT_TIME,
  31. RESULT_TARE_WEIGHT, RESULT_TARE_WEIGHT_TIME, RESULT_NET_WEIGHT, INSERT_USERNAME,
  32. INSERT_TIME, UPDATE_USERNAME, UPDATE_TIME, INSERT_UPDATE_REMARK, DELETE_NAME, DELETE_TIME,
  33. RESULT_GROSS_PLACE_ID, RESULT_TARE_PLACE_ID, MATERIAL_ID, ISDEDUCT, ISQUALITY, GROSS_SEGMENT_SQE,
  34. TARE_SEGMENT_SQE, MATERIAL_NUM
  35. </sql>
  36. <sql id="columns_alias">
  37. t.WEIGHT_TASK_RESULT_ID, t.RESULT_TOTAL_ID, t.RESULT_POUND_NO, t.RESULT_GROSS_WEIGHT,
  38. t.RESULT_GROSS_WEIGHT_TIME, t.RESULT_TARE_WEIGHT, t.RESULT_TARE_WEIGHT_TIME, t.RESULT_NET_WEIGHT,
  39. t.INSERT_USERNAME, t.INSERT_TIME, t.UPDATE_USERNAME, t.UPDATE_TIME, t.INSERT_UPDATE_REMARK,
  40. t.DELETE_NAME, t.DELETE_TIME, t.RESULT_GROSS_PLACE_ID, t.RESULT_TARE_PLACE_ID, t.MATERIAL_ID,
  41. t.ISDEDUCT, t.ISQUALITY, t.GROSS_SEGMENT_SQE, t.TARE_SEGMENT_SQE, t.MATERIAL_NUM
  42. </sql>
  43. <sql id="select">
  44. SELECT <include refid="columns" /> FROM TMSTRUCK_WEIGHT_RESULT
  45. </sql>
  46. <sql id="select_alias">
  47. SELECT <include refid="columns_alias" /> FROM TMSTRUCK_WEIGHT_RESULT t
  48. </sql>
  49. <sql id="where">
  50. <where>
  51. <if test="weightTaskResultId != null">
  52. and WEIGHT_TASK_RESULT_ID = #{weightTaskResultId}
  53. </if>
  54. <if test="resultTotalId != null">
  55. and RESULT_TOTAL_ID = #{resultTotalId}
  56. </if>
  57. <if test="resultPoundNo != null and resultPoundNo != ''">
  58. and RESULT_POUND_NO = #{resultPoundNo}
  59. </if>
  60. <if test="resultGrossWeight != null">
  61. and RESULT_GROSS_WEIGHT = #{resultGrossWeight}
  62. </if>
  63. <if test="resultGrossWeightTime != null">
  64. and TO_CHAR(RESULT_GROSS_WEIGHT_TIME,'yyyy-MM-dd') = #{resultGrossWeightTime}
  65. </if>
  66. <if test="resultTareWeight != null">
  67. and RESULT_TARE_WEIGHT = #{resultTareWeight}
  68. </if>
  69. <if test="resultTareWeightTime != null">
  70. and TO_CHAR(RESULT_TARE_WEIGHT_TIME,'yyyy-MM-dd') = #{resultTareWeightTime}
  71. </if>
  72. <if test="resultNetWeight != null">
  73. and RESULT_NET_WEIGHT = #{resultNetWeight}
  74. </if>
  75. <if test="insertUsername != null and insertUsername != ''">
  76. and INSERT_USERNAME = #{insertUsername}
  77. </if>
  78. <if test="insertTime != null">
  79. and TO_CHAR(INSERT_TIME,'yyyy-MM-dd') = #{insertTime}
  80. </if>
  81. <if test="updateUsername != null and updateUsername != ''">
  82. and UPDATE_USERNAME = #{updateUsername}
  83. </if>
  84. <if test="updateTime != null">
  85. and TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = #{updateTime}
  86. </if>
  87. <if test="insertUpdateRemark != null and insertUpdateRemark != ''">
  88. and INSERT_UPDATE_REMARK = #{insertUpdateRemark}
  89. </if>
  90. <if test="deleteName != null and deleteName != ''">
  91. and DELETE_NAME = #{deleteName}
  92. </if>
  93. <if test="deleteTime != null">
  94. and TO_CHAR(DELETE_TIME,'yyyy-MM-dd') = #{deleteTime}
  95. </if>
  96. <if test="resultGrossPlaceId != null">
  97. and RESULT_GROSS_PLACE_ID = #{resultGrossPlaceId}
  98. </if>
  99. <if test="resultTarePlaceId != null">
  100. and RESULT_TARE_PLACE_ID = #{resultTarePlaceId}
  101. </if>
  102. <if test="materialId != null">
  103. and MATERIAL_ID = #{materialId}
  104. </if>
  105. <if test="isdeduct != null">
  106. and ISDEDUCT = #{isdeduct}
  107. </if>
  108. <if test="isquality != null">
  109. and ISQUALITY = #{isquality}
  110. </if>
  111. <if test="grossSegmentSqe != null">
  112. and GROSS_SEGMENT_SQE = #{grossSegmentSqe}
  113. </if>
  114. <if test="tareSegmentSqe != null">
  115. and TARE_SEGMENT_SQE = #{tareSegmentSqe}
  116. </if>
  117. <if test="materialNum != null">
  118. and MATERIAL_NUM = #{materialNum}
  119. </if>
  120. </where>
  121. </sql>
  122. <sql id="whereLike">
  123. <where>
  124. <if test="weightTaskResultId != null">
  125. and WEIGHT_TASK_RESULT_ID = #{weightTaskResultId}
  126. </if>
  127. <if test="resultTotalId != null">
  128. and RESULT_TOTAL_ID = #{resultTotalId}
  129. </if>
  130. <if test="resultPoundNo != null and resultPoundNo != ''">
  131. and RESULT_POUND_NO LIKE '%${resultPoundNo}%'
  132. </if>
  133. <if test="resultGrossWeight != null">
  134. and RESULT_GROSS_WEIGHT = #{resultGrossWeight}
  135. </if>
  136. <if test="resultGrossWeightTime != null">
  137. and TO_CHAR(RESULT_GROSS_WEIGHT_TIME,'yyyy-MM-dd') = #{resultGrossWeightTime}
  138. </if>
  139. <if test="resultTareWeight != null">
  140. and RESULT_TARE_WEIGHT = #{resultTareWeight}
  141. </if>
  142. <if test="resultTareWeightTime != null">
  143. and TO_CHAR(RESULT_TARE_WEIGHT_TIME,'yyyy-MM-dd') = #{resultTareWeightTime}
  144. </if>
  145. <if test="resultNetWeight != null">
  146. and RESULT_NET_WEIGHT = #{resultNetWeight}
  147. </if>
  148. <if test="insertUsername != null and insertUsername != ''">
  149. and INSERT_USERNAME LIKE '%${insertUsername}%'
  150. </if>
  151. <if test="insertTime != null">
  152. and TO_CHAR(INSERT_TIME,'yyyy-MM-dd') = #{insertTime}
  153. </if>
  154. <if test="updateUsername != null and updateUsername != ''">
  155. and UPDATE_USERNAME LIKE '%${updateUsername}%'
  156. </if>
  157. <if test="updateTime != null">
  158. and TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = #{updateTime}
  159. </if>
  160. <if test="insertUpdateRemark != null and insertUpdateRemark != ''">
  161. and INSERT_UPDATE_REMARK LIKE '%${insertUpdateRemark}%'
  162. </if>
  163. <if test="deleteName != null and deleteName != ''">
  164. and DELETE_NAME LIKE '%${deleteName}%'
  165. </if>
  166. <if test="deleteTime != null">
  167. and TO_CHAR(DELETE_TIME,'yyyy-MM-dd') = #{deleteTime}
  168. </if>
  169. <if test="resultGrossPlaceId != null">
  170. and RESULT_GROSS_PLACE_ID = #{resultGrossPlaceId}
  171. </if>
  172. <if test="resultTarePlaceId != null">
  173. and RESULT_TARE_PLACE_ID = #{resultTarePlaceId}
  174. </if>
  175. <if test="materialId != null">
  176. and MATERIAL_ID = #{materialId}
  177. </if>
  178. <if test="isdeduct != null">
  179. and ISDEDUCT = #{isdeduct}
  180. </if>
  181. <if test="isquality != null">
  182. and ISQUALITY = #{isquality}
  183. </if>
  184. <if test="grossSegmentSqe != null">
  185. and GROSS_SEGMENT_SQE = #{grossSegmentSqe}
  186. </if>
  187. <if test="tareSegmentSqe != null">
  188. and TARE_SEGMENT_SQE = #{tareSegmentSqe}
  189. </if>
  190. <if test="materialNum != null">
  191. and MATERIAL_NUM = #{materialNum}
  192. </if>
  193. </where>
  194. </sql>
  195. <delete id="deleteByPrimaryKey" parameterType="DECIMAL">
  196. delete from TMSTRUCK_WEIGHT_RESULT
  197. where WEIGHT_TASK_RESULT_ID = #{weightTaskResultId,jdbcType=DECIMAL}
  198. </delete>
  199. <delete id="deleteBySelectiveElement" parameterType="java.util.HashMap">
  200. delete from TMSTRUCK_WEIGHT_RESULT
  201. where 1!=1
  202. <if test="resultTotalId != null">
  203. or RESULT_TOTAL_ID = #{resultTotalId}
  204. </if>
  205. <if test="resultPoundNo != null and resultPoundNo != ''">
  206. or RESULT_POUND_NO = #{resultPoundNo}
  207. </if>
  208. <if test="resultGrossWeight != null">
  209. or RESULT_GROSS_WEIGHT = #{resultGrossWeight}
  210. </if>
  211. <if test="resultGrossWeightTime != null">
  212. or TO_CHAR(RESULT_GROSS_WEIGHT_TIME,'yyyy-MM-dd') = '#{resultGrossWeightTime}'
  213. </if>
  214. <if test="resultTareWeight != null">
  215. or RESULT_TARE_WEIGHT = #{resultTareWeight}
  216. </if>
  217. <if test="resultTareWeightTime != null">
  218. or TO_CHAR(RESULT_TARE_WEIGHT_TIME,'yyyy-MM-dd') = '#{resultTareWeightTime}'
  219. </if>
  220. <if test="resultNetWeight != null">
  221. or RESULT_NET_WEIGHT = #{resultNetWeight}
  222. </if>
  223. <if test="insertUsername != null and insertUsername != ''">
  224. or INSERT_USERNAME = #{insertUsername}
  225. </if>
  226. <if test="insertTime != null">
  227. or TO_CHAR(INSERT_TIME,'yyyy-MM-dd') = '#{insertTime}'
  228. </if>
  229. <if test="updateUsername != null and updateUsername != ''">
  230. or UPDATE_USERNAME = #{updateUsername}
  231. </if>
  232. <if test="updateTime != null">
  233. or TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = '#{updateTime}'
  234. </if>
  235. <if test="insertUpdateRemark != null and insertUpdateRemark != ''">
  236. or INSERT_UPDATE_REMARK = #{insertUpdateRemark}
  237. </if>
  238. <if test="deleteName != null and deleteName != ''">
  239. or DELETE_NAME = #{deleteName}
  240. </if>
  241. <if test="deleteTime != null">
  242. or TO_CHAR(DELETE_TIME,'yyyy-MM-dd') = '#{deleteTime}'
  243. </if>
  244. <if test="resultGrossPlaceId != null">
  245. or RESULT_GROSS_PLACE_ID = #{resultGrossPlaceId}
  246. </if>
  247. <if test="resultTarePlaceId != null">
  248. or RESULT_TARE_PLACE_ID = #{resultTarePlaceId}
  249. </if>
  250. <if test="materialId != null">
  251. or MATERIAL_ID = #{materialId}
  252. </if>
  253. <if test="isdeduct != null">
  254. or ISDEDUCT = #{isdeduct}
  255. </if>
  256. <if test="isquality != null">
  257. or ISQUALITY = #{isquality}
  258. </if>
  259. <if test="grossSegmentSqe != null">
  260. or GROSS_SEGMENT_SQE = #{grossSegmentSqe}
  261. </if>
  262. <if test="tareSegmentSqe != null">
  263. or TARE_SEGMENT_SQE = #{tareSegmentSqe}
  264. </if>
  265. <if test="materialNum != null">
  266. or MATERIAL_NUM = #{materialNum}
  267. </if>
  268. </delete>
  269. <insert id="insert" parameterType="com.steerinfo.dil.model.TmstruckWeightResult">
  270. insert into TMSTRUCK_WEIGHT_RESULT (WEIGHT_TASK_RESULT_ID, RESULT_TOTAL_ID,
  271. RESULT_POUND_NO, RESULT_GROSS_WEIGHT, RESULT_GROSS_WEIGHT_TIME,
  272. RESULT_TARE_WEIGHT, RESULT_TARE_WEIGHT_TIME,
  273. RESULT_NET_WEIGHT, INSERT_USERNAME, INSERT_TIME,
  274. UPDATE_USERNAME, UPDATE_TIME, INSERT_UPDATE_REMARK,
  275. DELETE_NAME, DELETE_TIME, RESULT_GROSS_PLACE_ID,
  276. RESULT_TARE_PLACE_ID, MATERIAL_ID, ISDEDUCT,
  277. ISQUALITY, GROSS_SEGMENT_SQE, TARE_SEGMENT_SQE,
  278. MATERIAL_NUM)
  279. values (#{weightTaskResultId,jdbcType=DECIMAL}, #{resultTotalId,jdbcType=DECIMAL},
  280. #{resultPoundNo,jdbcType=VARCHAR}, #{resultGrossWeight,jdbcType=DECIMAL}, #{resultGrossWeightTime,jdbcType=TIMESTAMP},
  281. #{resultTareWeight,jdbcType=DECIMAL}, #{resultTareWeightTime,jdbcType=TIMESTAMP},
  282. #{resultNetWeight,jdbcType=DECIMAL}, #{insertUsername,jdbcType=VARCHAR}, #{insertTime,jdbcType=TIMESTAMP},
  283. #{updateUsername,jdbcType=VARCHAR}, #{updateTime,jdbcType=TIMESTAMP}, #{insertUpdateRemark,jdbcType=VARCHAR},
  284. #{deleteName,jdbcType=VARCHAR}, #{deleteTime,jdbcType=TIMESTAMP}, #{resultGrossPlaceId,jdbcType=DECIMAL},
  285. #{resultTarePlaceId,jdbcType=DECIMAL}, #{materialId,jdbcType=DECIMAL}, #{isdeduct,jdbcType=DECIMAL},
  286. #{isquality,jdbcType=DECIMAL}, #{grossSegmentSqe,jdbcType=DECIMAL}, #{tareSegmentSqe,jdbcType=DECIMAL},
  287. #{materialNum,jdbcType=DECIMAL})
  288. </insert>
  289. <insert id="insertSelective" parameterType="com.steerinfo.dil.model.TmstruckWeightResult">
  290. insert into TMSTRUCK_WEIGHT_RESULT
  291. <trim prefix="(" suffix=")" suffixOverrides=",">
  292. <if test="weightTaskResultId != null">
  293. WEIGHT_TASK_RESULT_ID,
  294. </if>
  295. <if test="resultTotalId != null">
  296. RESULT_TOTAL_ID,
  297. </if>
  298. <if test="resultPoundNo != null">
  299. RESULT_POUND_NO,
  300. </if>
  301. <if test="resultGrossWeight != null">
  302. RESULT_GROSS_WEIGHT,
  303. </if>
  304. <if test="resultGrossWeightTime != null">
  305. RESULT_GROSS_WEIGHT_TIME,
  306. </if>
  307. <if test="resultTareWeight != null">
  308. RESULT_TARE_WEIGHT,
  309. </if>
  310. <if test="resultTareWeightTime != null">
  311. RESULT_TARE_WEIGHT_TIME,
  312. </if>
  313. <if test="resultNetWeight != null">
  314. RESULT_NET_WEIGHT,
  315. </if>
  316. <if test="insertUsername != null">
  317. INSERT_USERNAME,
  318. </if>
  319. <if test="insertTime != null">
  320. INSERT_TIME,
  321. </if>
  322. <if test="updateUsername != null">
  323. UPDATE_USERNAME,
  324. </if>
  325. <if test="updateTime != null">
  326. UPDATE_TIME,
  327. </if>
  328. <if test="insertUpdateRemark != null">
  329. INSERT_UPDATE_REMARK,
  330. </if>
  331. <if test="deleteName != null">
  332. DELETE_NAME,
  333. </if>
  334. <if test="deleteTime != null">
  335. DELETE_TIME,
  336. </if>
  337. <if test="resultGrossPlaceId != null">
  338. RESULT_GROSS_PLACE_ID,
  339. </if>
  340. <if test="resultTarePlaceId != null">
  341. RESULT_TARE_PLACE_ID,
  342. </if>
  343. <if test="materialId != null">
  344. MATERIAL_ID,
  345. </if>
  346. <if test="isdeduct != null">
  347. ISDEDUCT,
  348. </if>
  349. <if test="isquality != null">
  350. ISQUALITY,
  351. </if>
  352. <if test="grossSegmentSqe != null">
  353. GROSS_SEGMENT_SQE,
  354. </if>
  355. <if test="tareSegmentSqe != null">
  356. TARE_SEGMENT_SQE,
  357. </if>
  358. <if test="materialNum != null">
  359. MATERIAL_NUM,
  360. </if>
  361. </trim>
  362. <trim prefix="values (" suffix=")" suffixOverrides=",">
  363. <if test="weightTaskResultId != null">
  364. #{weightTaskResultId,jdbcType=DECIMAL},
  365. </if>
  366. <if test="resultTotalId != null">
  367. #{resultTotalId,jdbcType=DECIMAL},
  368. </if>
  369. <if test="resultPoundNo != null">
  370. #{resultPoundNo,jdbcType=VARCHAR},
  371. </if>
  372. <if test="resultGrossWeight != null">
  373. #{resultGrossWeight,jdbcType=DECIMAL},
  374. </if>
  375. <if test="resultGrossWeightTime != null">
  376. #{resultGrossWeightTime,jdbcType=TIMESTAMP},
  377. </if>
  378. <if test="resultTareWeight != null">
  379. #{resultTareWeight,jdbcType=DECIMAL},
  380. </if>
  381. <if test="resultTareWeightTime != null">
  382. #{resultTareWeightTime,jdbcType=TIMESTAMP},
  383. </if>
  384. <if test="resultNetWeight != null">
  385. #{resultNetWeight,jdbcType=DECIMAL},
  386. </if>
  387. <if test="insertUsername != null">
  388. #{insertUsername,jdbcType=VARCHAR},
  389. </if>
  390. <if test="insertTime != null">
  391. #{insertTime,jdbcType=TIMESTAMP},
  392. </if>
  393. <if test="updateUsername != null">
  394. #{updateUsername,jdbcType=VARCHAR},
  395. </if>
  396. <if test="updateTime != null">
  397. #{updateTime,jdbcType=TIMESTAMP},
  398. </if>
  399. <if test="insertUpdateRemark != null">
  400. #{insertUpdateRemark,jdbcType=VARCHAR},
  401. </if>
  402. <if test="deleteName != null">
  403. #{deleteName,jdbcType=VARCHAR},
  404. </if>
  405. <if test="deleteTime != null">
  406. #{deleteTime,jdbcType=TIMESTAMP},
  407. </if>
  408. <if test="resultGrossPlaceId != null">
  409. #{resultGrossPlaceId,jdbcType=DECIMAL},
  410. </if>
  411. <if test="resultTarePlaceId != null">
  412. #{resultTarePlaceId,jdbcType=DECIMAL},
  413. </if>
  414. <if test="materialId != null">
  415. #{materialId,jdbcType=DECIMAL},
  416. </if>
  417. <if test="isdeduct != null">
  418. #{isdeduct,jdbcType=DECIMAL},
  419. </if>
  420. <if test="isquality != null">
  421. #{isquality,jdbcType=DECIMAL},
  422. </if>
  423. <if test="grossSegmentSqe != null">
  424. #{grossSegmentSqe,jdbcType=DECIMAL},
  425. </if>
  426. <if test="tareSegmentSqe != null">
  427. #{tareSegmentSqe,jdbcType=DECIMAL},
  428. </if>
  429. <if test="materialNum != null">
  430. #{materialNum,jdbcType=DECIMAL},
  431. </if>
  432. </trim>
  433. </insert>
  434. <update id="updateByPrimaryKey" parameterType="com.steerinfo.dil.model.TmstruckWeightResult">
  435. update TMSTRUCK_WEIGHT_RESULT
  436. set RESULT_TOTAL_ID = #{resultTotalId,jdbcType=DECIMAL},
  437. RESULT_POUND_NO = #{resultPoundNo,jdbcType=VARCHAR},
  438. RESULT_GROSS_WEIGHT = #{resultGrossWeight,jdbcType=DECIMAL},
  439. RESULT_GROSS_WEIGHT_TIME = #{resultGrossWeightTime,jdbcType=TIMESTAMP},
  440. RESULT_TARE_WEIGHT = #{resultTareWeight,jdbcType=DECIMAL},
  441. RESULT_TARE_WEIGHT_TIME = #{resultTareWeightTime,jdbcType=TIMESTAMP},
  442. RESULT_NET_WEIGHT = #{resultNetWeight,jdbcType=DECIMAL},
  443. INSERT_USERNAME = #{insertUsername,jdbcType=VARCHAR},
  444. INSERT_TIME = #{insertTime,jdbcType=TIMESTAMP},
  445. UPDATE_USERNAME = #{updateUsername,jdbcType=VARCHAR},
  446. UPDATE_TIME = #{updateTime,jdbcType=TIMESTAMP},
  447. INSERT_UPDATE_REMARK = #{insertUpdateRemark,jdbcType=VARCHAR},
  448. DELETE_NAME = #{deleteName,jdbcType=VARCHAR},
  449. DELETE_TIME = #{deleteTime,jdbcType=TIMESTAMP},
  450. RESULT_GROSS_PLACE_ID = #{resultGrossPlaceId,jdbcType=DECIMAL},
  451. RESULT_TARE_PLACE_ID = #{resultTarePlaceId,jdbcType=DECIMAL},
  452. MATERIAL_ID = #{materialId,jdbcType=DECIMAL},
  453. ISDEDUCT = #{isdeduct,jdbcType=DECIMAL},
  454. ISQUALITY = #{isquality,jdbcType=DECIMAL},
  455. GROSS_SEGMENT_SQE = #{grossSegmentSqe,jdbcType=DECIMAL},
  456. TARE_SEGMENT_SQE = #{tareSegmentSqe,jdbcType=DECIMAL},
  457. MATERIAL_NUM = #{materialNum,jdbcType=DECIMAL}
  458. where WEIGHT_TASK_RESULT_ID = #{weightTaskResultId,jdbcType=DECIMAL}
  459. </update>
  460. <update id="updateByPrimaryKeySelective" parameterType="com.steerinfo.dil.model.TmstruckWeightResult">
  461. update TMSTRUCK_WEIGHT_RESULT
  462. <set>
  463. <if test="resultTotalId != null">
  464. RESULT_TOTAL_ID = #{resultTotalId,jdbcType=DECIMAL},
  465. </if>
  466. <if test="resultPoundNo != null">
  467. RESULT_POUND_NO = #{resultPoundNo,jdbcType=VARCHAR},
  468. </if>
  469. <if test="resultGrossWeight != null">
  470. RESULT_GROSS_WEIGHT = #{resultGrossWeight,jdbcType=DECIMAL},
  471. </if>
  472. <if test="resultGrossWeightTime != null">
  473. RESULT_GROSS_WEIGHT_TIME = #{resultGrossWeightTime,jdbcType=TIMESTAMP},
  474. </if>
  475. <if test="resultTareWeight != null">
  476. RESULT_TARE_WEIGHT = #{resultTareWeight,jdbcType=DECIMAL},
  477. </if>
  478. <if test="resultTareWeightTime != null">
  479. RESULT_TARE_WEIGHT_TIME = #{resultTareWeightTime,jdbcType=TIMESTAMP},
  480. </if>
  481. <if test="resultNetWeight != null">
  482. RESULT_NET_WEIGHT = #{resultNetWeight,jdbcType=DECIMAL},
  483. </if>
  484. <if test="insertUsername != null">
  485. INSERT_USERNAME = #{insertUsername,jdbcType=VARCHAR},
  486. </if>
  487. <if test="insertTime != null">
  488. INSERT_TIME = #{insertTime,jdbcType=TIMESTAMP},
  489. </if>
  490. <if test="updateUsername != null">
  491. UPDATE_USERNAME = #{updateUsername,jdbcType=VARCHAR},
  492. </if>
  493. <if test="updateTime != null">
  494. UPDATE_TIME = #{updateTime,jdbcType=TIMESTAMP},
  495. </if>
  496. <if test="insertUpdateRemark != null">
  497. INSERT_UPDATE_REMARK = #{insertUpdateRemark,jdbcType=VARCHAR},
  498. </if>
  499. <if test="deleteName != null">
  500. DELETE_NAME = #{deleteName,jdbcType=VARCHAR},
  501. </if>
  502. <if test="deleteTime != null">
  503. DELETE_TIME = #{deleteTime,jdbcType=TIMESTAMP},
  504. </if>
  505. <if test="resultGrossPlaceId != null">
  506. RESULT_GROSS_PLACE_ID = #{resultGrossPlaceId,jdbcType=DECIMAL},
  507. </if>
  508. <if test="resultTarePlaceId != null">
  509. RESULT_TARE_PLACE_ID = #{resultTarePlaceId,jdbcType=DECIMAL},
  510. </if>
  511. <if test="materialId != null">
  512. MATERIAL_ID = #{materialId,jdbcType=DECIMAL},
  513. </if>
  514. <if test="isdeduct != null">
  515. ISDEDUCT = #{isdeduct,jdbcType=DECIMAL},
  516. </if>
  517. <if test="isquality != null">
  518. ISQUALITY = #{isquality,jdbcType=DECIMAL},
  519. </if>
  520. <if test="grossSegmentSqe != null">
  521. GROSS_SEGMENT_SQE = #{grossSegmentSqe,jdbcType=DECIMAL},
  522. </if>
  523. <if test="tareSegmentSqe != null">
  524. TARE_SEGMENT_SQE = #{tareSegmentSqe,jdbcType=DECIMAL},
  525. </if>
  526. <if test="materialNum != null">
  527. MATERIAL_NUM = #{materialNum,jdbcType=DECIMAL},
  528. </if>
  529. </set>
  530. where WEIGHT_TASK_RESULT_ID = #{weightTaskResultId,jdbcType=DECIMAL}
  531. </update>
  532. <select id="selectByPrimaryKey" parameterType="DECIMAL" resultMap="BaseResultMap">
  533. <include refid="select" />
  534. where WEIGHT_TASK_RESULT_ID = #{weightTaskResultId,jdbcType=DECIMAL}
  535. </select>
  536. <select id="selectByParameters" parameterType="java.util.HashMap" resultMap="BaseResultMap">
  537. <include refid="select" />
  538. <include refid="where" />
  539. </select>
  540. <select id="selectLikeByParameters" parameterType="java.util.HashMap" resultMap="BaseResultMap">
  541. <include refid="select" />
  542. <include refid="whereLike" />
  543. </select>
  544. <insert id="batchInsert" parameterType="java.util.List">
  545. insert into TMSTRUCK_WEIGHT_RESULT
  546. (WEIGHT_TASK_RESULT_ID,
  547. RESULT_TOTAL_ID, RESULT_POUND_NO,
  548. RESULT_GROSS_WEIGHT, RESULT_GROSS_WEIGHT_TIME,
  549. RESULT_TARE_WEIGHT, RESULT_TARE_WEIGHT_TIME,
  550. RESULT_NET_WEIGHT, INSERT_USERNAME,
  551. INSERT_TIME, UPDATE_USERNAME,
  552. UPDATE_TIME, INSERT_UPDATE_REMARK,
  553. DELETE_NAME, DELETE_TIME, RESULT_GROSS_PLACE_ID,
  554. RESULT_TARE_PLACE_ID, MATERIAL_ID,
  555. ISDEDUCT, ISQUALITY, GROSS_SEGMENT_SQE,
  556. TARE_SEGMENT_SQE, MATERIAL_NUM)
  557. ( <foreach collection="list" item="item" separator="union all">
  558. select
  559. #{item.weightTaskResultId,jdbcType=DECIMAL},
  560. #{item.resultTotalId,jdbcType=DECIMAL}, #{item.resultPoundNo,jdbcType=VARCHAR},
  561. #{item.resultGrossWeight,jdbcType=DECIMAL}, #{item.resultGrossWeightTime,jdbcType=TIMESTAMP},
  562. #{item.resultTareWeight,jdbcType=DECIMAL}, #{item.resultTareWeightTime,jdbcType=TIMESTAMP},
  563. #{item.resultNetWeight,jdbcType=DECIMAL}, #{item.insertUsername,jdbcType=VARCHAR},
  564. #{item.insertTime,jdbcType=TIMESTAMP}, #{item.updateUsername,jdbcType=VARCHAR},
  565. #{item.updateTime,jdbcType=TIMESTAMP}, #{item.insertUpdateRemark,jdbcType=VARCHAR},
  566. #{item.deleteName,jdbcType=VARCHAR}, #{item.deleteTime,jdbcType=TIMESTAMP}, #{item.resultGrossPlaceId,jdbcType=DECIMAL},
  567. #{item.resultTarePlaceId,jdbcType=DECIMAL}, #{item.materialId,jdbcType=DECIMAL},
  568. #{item.isdeduct,jdbcType=DECIMAL}, #{item.isquality,jdbcType=DECIMAL}, #{item.grossSegmentSqe,jdbcType=DECIMAL},
  569. #{item.tareSegmentSqe,jdbcType=DECIMAL}, #{item.materialNum,jdbcType=DECIMAL} from dual
  570. </foreach> )
  571. </insert>
  572. <update id="batchUpdate" parameterType="java.util.List">
  573. update TMSTRUCK_WEIGHT_RESULT
  574. set
  575. WEIGHT_TASK_RESULT_ID=
  576. <foreach close="end" collection="list" index="index" item="item" open="case WEIGHT_TASK_RESULT_ID" separator=" ">
  577. when #{item.weightTaskResultId,jdbcType=DECIMAL} then #{item.weightTaskResultId,jdbcType=DECIMAL}
  578. </foreach>
  579. ,RESULT_TOTAL_ID=
  580. <foreach close="end" collection="list" index="index" item="item" open="case WEIGHT_TASK_RESULT_ID" separator=" ">
  581. when #{item.weightTaskResultId,jdbcType=DECIMAL} then #{item.resultTotalId,jdbcType=DECIMAL}
  582. </foreach>
  583. ,RESULT_POUND_NO=
  584. <foreach close="end" collection="list" index="index" item="item" open="case WEIGHT_TASK_RESULT_ID" separator=" ">
  585. when #{item.weightTaskResultId,jdbcType=DECIMAL} then #{item.resultPoundNo,jdbcType=VARCHAR}
  586. </foreach>
  587. ,RESULT_GROSS_WEIGHT=
  588. <foreach close="end" collection="list" index="index" item="item" open="case WEIGHT_TASK_RESULT_ID" separator=" ">
  589. when #{item.weightTaskResultId,jdbcType=DECIMAL} then #{item.resultGrossWeight,jdbcType=DECIMAL}
  590. </foreach>
  591. ,RESULT_GROSS_WEIGHT_TIME=
  592. <foreach close="end" collection="list" index="index" item="item" open="case WEIGHT_TASK_RESULT_ID" separator=" ">
  593. when #{item.weightTaskResultId,jdbcType=DECIMAL} then #{item.resultGrossWeightTime,jdbcType=TIMESTAMP}
  594. </foreach>
  595. ,RESULT_TARE_WEIGHT=
  596. <foreach close="end" collection="list" index="index" item="item" open="case WEIGHT_TASK_RESULT_ID" separator=" ">
  597. when #{item.weightTaskResultId,jdbcType=DECIMAL} then #{item.resultTareWeight,jdbcType=DECIMAL}
  598. </foreach>
  599. ,RESULT_TARE_WEIGHT_TIME=
  600. <foreach close="end" collection="list" index="index" item="item" open="case WEIGHT_TASK_RESULT_ID" separator=" ">
  601. when #{item.weightTaskResultId,jdbcType=DECIMAL} then #{item.resultTareWeightTime,jdbcType=TIMESTAMP}
  602. </foreach>
  603. ,RESULT_NET_WEIGHT=
  604. <foreach close="end" collection="list" index="index" item="item" open="case WEIGHT_TASK_RESULT_ID" separator=" ">
  605. when #{item.weightTaskResultId,jdbcType=DECIMAL} then #{item.resultNetWeight,jdbcType=DECIMAL}
  606. </foreach>
  607. ,INSERT_USERNAME=
  608. <foreach close="end" collection="list" index="index" item="item" open="case WEIGHT_TASK_RESULT_ID" separator=" ">
  609. when #{item.weightTaskResultId,jdbcType=DECIMAL} then #{item.insertUsername,jdbcType=VARCHAR}
  610. </foreach>
  611. ,INSERT_TIME=
  612. <foreach close="end" collection="list" index="index" item="item" open="case WEIGHT_TASK_RESULT_ID" separator=" ">
  613. when #{item.weightTaskResultId,jdbcType=DECIMAL} then #{item.insertTime,jdbcType=TIMESTAMP}
  614. </foreach>
  615. ,UPDATE_USERNAME=
  616. <foreach close="end" collection="list" index="index" item="item" open="case WEIGHT_TASK_RESULT_ID" separator=" ">
  617. when #{item.weightTaskResultId,jdbcType=DECIMAL} then #{item.updateUsername,jdbcType=VARCHAR}
  618. </foreach>
  619. ,UPDATE_TIME=
  620. <foreach close="end" collection="list" index="index" item="item" open="case WEIGHT_TASK_RESULT_ID" separator=" ">
  621. when #{item.weightTaskResultId,jdbcType=DECIMAL} then #{item.updateTime,jdbcType=TIMESTAMP}
  622. </foreach>
  623. ,INSERT_UPDATE_REMARK=
  624. <foreach close="end" collection="list" index="index" item="item" open="case WEIGHT_TASK_RESULT_ID" separator=" ">
  625. when #{item.weightTaskResultId,jdbcType=DECIMAL} then #{item.insertUpdateRemark,jdbcType=VARCHAR}
  626. </foreach>
  627. ,DELETE_NAME=
  628. <foreach close="end" collection="list" index="index" item="item" open="case WEIGHT_TASK_RESULT_ID" separator=" ">
  629. when #{item.weightTaskResultId,jdbcType=DECIMAL} then #{item.deleteName,jdbcType=VARCHAR}
  630. </foreach>
  631. ,DELETE_TIME=
  632. <foreach close="end" collection="list" index="index" item="item" open="case WEIGHT_TASK_RESULT_ID" separator=" ">
  633. when #{item.weightTaskResultId,jdbcType=DECIMAL} then #{item.deleteTime,jdbcType=TIMESTAMP}
  634. </foreach>
  635. ,RESULT_GROSS_PLACE_ID=
  636. <foreach close="end" collection="list" index="index" item="item" open="case WEIGHT_TASK_RESULT_ID" separator=" ">
  637. when #{item.weightTaskResultId,jdbcType=DECIMAL} then #{item.resultGrossPlaceId,jdbcType=DECIMAL}
  638. </foreach>
  639. ,RESULT_TARE_PLACE_ID=
  640. <foreach close="end" collection="list" index="index" item="item" open="case WEIGHT_TASK_RESULT_ID" separator=" ">
  641. when #{item.weightTaskResultId,jdbcType=DECIMAL} then #{item.resultTarePlaceId,jdbcType=DECIMAL}
  642. </foreach>
  643. ,MATERIAL_ID=
  644. <foreach close="end" collection="list" index="index" item="item" open="case WEIGHT_TASK_RESULT_ID" separator=" ">
  645. when #{item.weightTaskResultId,jdbcType=DECIMAL} then #{item.materialId,jdbcType=DECIMAL}
  646. </foreach>
  647. ,ISDEDUCT=
  648. <foreach close="end" collection="list" index="index" item="item" open="case WEIGHT_TASK_RESULT_ID" separator=" ">
  649. when #{item.weightTaskResultId,jdbcType=DECIMAL} then #{item.isdeduct,jdbcType=DECIMAL}
  650. </foreach>
  651. ,ISQUALITY=
  652. <foreach close="end" collection="list" index="index" item="item" open="case WEIGHT_TASK_RESULT_ID" separator=" ">
  653. when #{item.weightTaskResultId,jdbcType=DECIMAL} then #{item.isquality,jdbcType=DECIMAL}
  654. </foreach>
  655. ,GROSS_SEGMENT_SQE=
  656. <foreach close="end" collection="list" index="index" item="item" open="case WEIGHT_TASK_RESULT_ID" separator=" ">
  657. when #{item.weightTaskResultId,jdbcType=DECIMAL} then #{item.grossSegmentSqe,jdbcType=DECIMAL}
  658. </foreach>
  659. ,TARE_SEGMENT_SQE=
  660. <foreach close="end" collection="list" index="index" item="item" open="case WEIGHT_TASK_RESULT_ID" separator=" ">
  661. when #{item.weightTaskResultId,jdbcType=DECIMAL} then #{item.tareSegmentSqe,jdbcType=DECIMAL}
  662. </foreach>
  663. ,MATERIAL_NUM=
  664. <foreach close="end" collection="list" index="index" item="item" open="case WEIGHT_TASK_RESULT_ID" separator=" ">
  665. when #{item.weightTaskResultId,jdbcType=DECIMAL} then #{item.materialNum,jdbcType=DECIMAL}
  666. </foreach>
  667. where WEIGHT_TASK_RESULT_ID in
  668. <foreach close=")" collection="list" index="index" item="item" open="(" separator=",">
  669. #{item.weightTaskResultId,jdbcType=DECIMAL}
  670. </foreach>
  671. </update>
  672. <delete id="batchDelete" parameterType="java.util.List">
  673. delete from TMSTRUCK_WEIGHT_RESULT
  674. where WEIGHT_TASK_RESULT_ID in
  675. <foreach close=")" collection="list" item="id" open="(" separator=",">
  676. #{id}
  677. </foreach>
  678. </delete>
  679. <!-- 友情提示!!!-->
  680. <!-- 请将自己写的代码放在此标签之下,方便以后粘贴复制。-->
  681. <!-- 请将自己写的代码放在此标签之下,方便以后粘贴复制。-->
  682. <!-- 得到计重实绩主键id -->
  683. <!-- 得到汽车衡id -->
  684. <select id="getTruckCalculateId" parameterType="java.lang.String" resultType="DECIMAL">
  685. SELECT
  686. RTC.TRUCK_CALCULATE_ID AS "resultTarePlaceId"
  687. FROM RMS_TRUCK_CALCULATE RTC
  688. WHERE RTC.TRUCK_CALCULATE_NUMBER = #{resultCalculateNumber}
  689. </select>
  690. <select id="getWeightTaskResultId" resultType="DECIMAL" parameterType="java.util.Map">
  691. SELECT TWR.WEIGHT_TASK_RESULT_ID as "weightTaskResultId"
  692. FROM TMSTRUCK_WEIGHT_RESULT TWR
  693. LEFT JOIN TMSTRUCK_TOTAL_RESULT TTR
  694. ON TTR.RESULT_TOTAL_ID = TWR.RESULT_TOTAL_ID
  695. LEFT JOIN OMSTRUCK_ORDER OO
  696. ON OO.ORDER_ID = TTR.ORDER_ID
  697. WHERE OO.ORDER_NUMBER = #{orderNumber,jdbcType=VARCHAR}
  698. and TWR.MATERIAL_ID=#{materialId,jdbcType=DECIMAL}
  699. </select>
  700. <select id="selectWzInputId" resultType="java.util.Map">
  701. --采购内转
  702. SELECT
  703. *
  704. FROM
  705. (
  706. (
  707. SELECT DISTINCT
  708. twr.RESULT_TOTAL_ID "resultTotalId",
  709. RC.CAPACITY_NUMBER "capacityNumber",
  710. to_char( TWR.RESULT_GROSS_WEIGHT_TIME, 'YYYYMMDDHH24MISS' ) "grossWeightTime",
  711. oo.order_id "orderId"
  712. FROM
  713. TMSTRUCK_WEIGHT_RESULT TWR
  714. LEFT JOIN TMSTRUCK_TOTAL_RESULT TTR ON TTR.RESULT_TOTAL_ID = TWR.RESULT_TOTAL_ID
  715. LEFT JOIN OMSTRUCK_ORDER OO ON OO.ORDER_ID = TTR.ORDER_ID
  716. LEFT JOIN RMS_CAPACITY RC ON RC.CAPACITY_ID = OO.CAPACITY_ID
  717. LEFT JOIN TMSTRUCK_ENFACTORY_RESULT TER ON TER.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
  718. LEFT JOIN TMSTRUCK_QUALITY_RESULT TQR ON TQR.TOTAL_RESULT_ID = TTR.RESULT_TOTAL_ID
  719. WHERE
  720. TWR.GROSS_SEGMENT_SQE = 7
  721. AND TWR.tare_SEGMENT_SQE = 9
  722. AND TER.SEGMEN_SQE = 6
  723. AND twr.RESULT_NET_WEIGHT IS NOT NULL
  724. AND TQR.RESULT_ID IS NULL
  725. AND OO.ORDER_STATUS = 2
  726. AND OO.ORDER_TYPE IN ( 10, 20 )
  727. ) UNION ALL--普通采购
  728. SELECT DISTINCT
  729. twr.RESULT_TOTAL_ID "resultTotalId",
  730. RC.CAPACITY_NUMBER "capacityNumber",
  731. to_char( TWR.RESULT_GROSS_WEIGHT_TIME, 'YYYYMMDDHH24MISS' ) "grossWeightTime",
  732. oo.order_id "orderId"
  733. FROM
  734. TMSTRUCK_WEIGHT_RESULT TWR
  735. LEFT JOIN TMSTRUCK_TOTAL_RESULT TTR ON TTR.RESULT_TOTAL_ID = TWR.RESULT_TOTAL_ID
  736. LEFT JOIN OMSTRUCK_ORDER OO ON OO.ORDER_ID = TTR.ORDER_ID
  737. LEFT JOIN RMS_CAPACITY RC ON RC.CAPACITY_ID = OO.CAPACITY_ID
  738. LEFT JOIN TMSTRUCK_ENFACTORY_RESULT TER ON TER.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
  739. LEFT JOIN TMSTRUCK_QUALITY_RESULT TQR ON TQR.TOTAL_RESULT_ID = TTR.RESULT_TOTAL_ID
  740. WHERE
  741. twr.RESULT_NET_WEIGHT IS NOT NULL
  742. AND TQR.RESULT_ID IS NULL
  743. AND OO.ORDER_STATUS = 2
  744. AND OO.ORDER_TYPE IN ( 5, 6, 7, 17, 18,15, 16, 23, 24 )
  745. )
  746. ORDER BY
  747. "orderId" DESC
  748. </select>
  749. <update id="updateWzInputId" parameterType="decimal">
  750. update TMSTRUCK_WEIGHT_RESULT twr
  751. set twr.ISQUALITY=1
  752. where twr.RESULT_TOTAL_ID=#{resultTotalId}
  753. </update>
  754. <update id="updateTruckWeightResult" parameterType="java.util.Map">
  755. UPDATE (
  756. SELECT
  757. *
  758. FROM
  759. TMSTRUCK_WEIGHT_RESULT twr
  760. WHERE
  761. twr.RESULT_TOTAL_ID = (
  762. SELECT
  763. ttr.RESULT_TOTAL_ID
  764. FROM
  765. TMSTRUCK_TOTAL_RESULT ttr
  766. WHERE
  767. ttr.ORDER_ID = ( SELECT oo.ORDER_ID FROM OMSTRUCK_ORDER oo WHERE oo.ORDER_NUMBER = #{orderNumber} )
  768. )
  769. ) tt
  770. SET
  771. tt.RESULT_TARE_WEIGHT = #{resultWeight},
  772. tt.RESULT_NET_WEIGHT = #{resultNetWeight},
  773. tt.RESULT_TARE_PLACE_ID = #{resultTarePlaceId},
  774. tt.RESULT_TARE_WEIGHT_TIME = TO_DATE( #{resultWeightTime}, 'yyyy-mm-dd hh24:mi:ss' )
  775. </update>
  776. <update id="updateTruckWeightResultGross" parameterType="java.util.Map">
  777. UPDATE (
  778. SELECT
  779. *
  780. FROM
  781. TMSTRUCK_WEIGHT_RESULT twr
  782. WHERE
  783. twr.RESULT_TOTAL_ID = (
  784. SELECT
  785. ttr.RESULT_TOTAL_ID
  786. FROM
  787. TMSTRUCK_TOTAL_RESULT ttr
  788. WHERE
  789. ttr.ORDER_ID = ( SELECT oo.ORDER_ID FROM OMSTRUCK_ORDER oo WHERE oo.ORDER_NUMBER = #{orderNumber} )
  790. )
  791. and
  792. twr.MATERIAL_ID = #{materialId}
  793. ) tt
  794. SET tt.RESULT_POUND_NO = #{resultPoundNo},
  795. tt.RESULT_GROSS_WEIGHT = #{resultWeight},
  796. tt.RESULT_NET_WEIGHT = #{resultNetWeight},
  797. tt.RESULT_GROSS_PLACE_ID = #{resultTarePlaceId},
  798. tt.RESULT_GROSS_WEIGHT_TIME = TO_DATE( #{resultWeightTime}, 'yyyy-mm-dd hh24:mi:ss' )
  799. </update>
  800. <update id="linkageDeleteTransportOrder" parameterType="string">
  801. update OMSTRUCK_ORDER OO
  802. set OO.ORDER_STATUS = 8,
  803. OO.INSERT_UPDATE_REMARK = '计量联动删除'
  804. where OO.ORDER_NUMBER = #{orderNumber}
  805. </update>
  806. <!-- 通过运输订单号 查询实绩Id、总实绩ID -->
  807. <select id="selectTotalIdByOrderNo" parameterType="java.util.Map" resultType="java.util.Map">
  808. select *
  809. from (
  810. select OO.ORDER_ID "orderId",
  811. OO.ORDER_TYPE "orderTypee",
  812. TWR.WEIGHT_TASK_RESULT_ID "weightTaskResultId",
  813. TTR.RESULT_TOTAL_ID "resultTotalId",
  814. RC.CAPACITY_NUMBER "capacityNumber",
  815. TWR.TARE_SEGMENT_SQE "tareSegmentSqe",
  816. TWR.GROSS_SEGMENT_SQE "grossSegmentSqe"
  817. from OMSTRUCK_ORDER OO
  818. left join TMSTRUCK_TOTAL_RESULT TTR
  819. on OO.ORDER_ID = TTR.ORDER_ID
  820. left join TMSTRUCK_WEIGHT_RESULT TWR
  821. on TWR.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
  822. left join RMS_CAPACITY RC
  823. on RC.CAPACITY_ID = OO.CAPACITY_ID
  824. where OO.ORDER_NUMBER = #{orderNumber}
  825. <if test="materialId != null">
  826. and TWR.MATERIAL_ID = #{materialId}
  827. </if>
  828. )
  829. where rownum = 1
  830. </select>
  831. <!-- 通过汽车衡编号查询对应的汽车衡ID -->
  832. <select id="selectTruckCalculateId" parameterType="java.lang.String" resultType="int">
  833. select TRUCK_CALCULATE_ID
  834. from RMS_TRUCK_CALCULATE
  835. where TRUCK_CALCULATE_NUMBER = #{truckCalculateNumber}
  836. </select>
  837. <!-- 通过运输订单号查询计量实绩Id 条件 路段顺序号 和 净重 -->
  838. <select id="selectWeightIdByOrderId" parameterType="map" resultType="java.util.Map">
  839. select *
  840. from (
  841. select OO.ORDER_ID "orderId",
  842. OO.ORDER_TYPE "orderTypee",
  843. TWR.WEIGHT_TASK_RESULT_ID "weightTaskResultId",
  844. TTR.RESULT_TOTAL_ID "resultTotalId",
  845. TWR.TARE_SEGMENT_SQE "tareSegmentSqe",
  846. TWR.GROSS_SEGMENT_SQE "grossSegmentSqe"
  847. from TMSTRUCK_WEIGHT_RESULT TWR
  848. left join TMSTRUCK_TOTAL_RESULT TTR
  849. on TTR.RESULT_TOTAL_ID = TWR.RESULT_TOTAL_ID
  850. left join OMSTRUCK_ORDER OO
  851. on OO.ORDER_ID = TTR.ORDER_ID
  852. where OO.ORDER_NUMBER = #{orderNumber}
  853. and TWR.RESULT_NET_WEIGHT is null
  854. order by "tareSegmentSqe"
  855. )
  856. where rownum = 1
  857. </select>
  858. <!-- 通过订单Id查询还没有净重的计量实绩 -->
  859. <select id="selectNoNetWeightResult" parameterType="string" resultType="int">
  860. select COUNT(TWR.WEIGHT_TASK_RESULT_ID)
  861. from TMSTRUCK_WEIGHT_RESULT TWR
  862. left join TMSTRUCK_TOTAL_RESULT TTR
  863. on TTR.RESULT_TOTAL_ID = TWR.RESULT_TOTAL_ID
  864. left join OMSTRUCK_ORDER OO
  865. on OO.ORDER_ID = TTR.ORDER_ID
  866. where OO.ORDER_NUMBER = #{orderNumber}
  867. and TWR.RESULT_NET_WEIGHT is null
  868. </select>
  869. <!-- 查询采购订单信息给金蝶 -->
  870. <select id="getPurOrderMesToKD" parameterType="string" resultType="java.util.Map">
  871. select APO.PURCHASE_ORDER_NO "No",
  872. APO.EAS_ENTRY_ID "easEntryId",
  873. RC.CAPACITY_NUMBER "capacityNumber",
  874. OO.ORDER_ID "orderId"
  875. from OMSTRUCK_ORDER OO
  876. left join AMS_PURCHASE_ORDER APO
  877. on OO.ORDER_PLAN_ID = APO.PURCHASE_ORDER_ID
  878. left join RMS_CAPACITY RC
  879. on RC.CAPACITY_ID = OO.CAPACITY_ID
  880. where OO.ORDER_NUMBER = #{orderNumber}
  881. </select>
  882. <select id="getMaterialNumber" parameterType="java.math.BigDecimal" resultType="java.util.Map">
  883. select OOM.MATERIAL_ID "materialId"
  884. from TMSTRUCK_TOTAL_RESULT TTR
  885. LEFT JOIN OMSTRUCK_ORDER OO
  886. ON OO.ORDER_ID = TTR.ORDER_ID
  887. LEFT JOIN OMSTRUCK_ORDER_MATERIAL OOM
  888. ON OOM.ORDER_ID = OO.ORDER_ID
  889. WHERE TTR.RESULT_TOTAL_ID =#{resultTotalId}
  890. </select>
  891. <!-- 查询采购内转总厂到老区的订单信息 -->
  892. <select id="get20PurOrderMesToKD" parameterType="string" resultType="java.util.Map">
  893. SELECT
  894. APO.PURCHASE_ORDER_NO "No",
  895. APO.EAS_ENTRY_ID "easEntryId",
  896. RC.CAPACITY_NUMBER "capacityNumber",
  897. OO.ORDER_ID "orderId"
  898. FROM
  899. OMSTRUCK_ORDER OO
  900. LEFT JOIN AMSTRUCK_INWARD_PLAN AIP ON AIP.PLAN_ID = OO.ORDER_PLAN_ID
  901. LEFT JOIN AMSTRUCK_REQUIREMENT_PLAN ARP ON ARP.PLAN_ID = AIP.PLAN_ID
  902. LEFT JOIN AMSTRUCK_INWARD_REQUIREMENT AIR ON AIR.REQUIREMENT_ID = ARP.REQUIREMENT_ID
  903. LEFT JOIN AMS_PURCHASE_ORDER APO ON APO.PURCHASE_ORDER_ID = AIR.PURCHASE_ORDER_ID
  904. LEFT JOIN RMS_CAPACITY RC ON RC.CAPACITY_ID = OO.CAPACITY_ID
  905. WHERE
  906. OO.ORDER_NUMBER = #{orderNumber}
  907. </select>
  908. <select id="selectResultIdByOrderNoAndMaterialId" parameterType="map" resultType="java.util.Map">
  909. select TWR.WEIGHT_TASK_RESULT_ID "weightTaskResultId",
  910. TWR.RESULT_TARE_WEIGHT "resultTareWeight",
  911. TWR.TARE_SEGMENT_SQE "tareSegmentSqe",
  912. TWR.RESULT_NET_WEIGHT "netWeight"
  913. from OMSTRUCK_ORDER OO
  914. left join TMSTRUCK_TOTAL_RESULT TTR
  915. on TTR.ORDER_ID = OO.ORDER_ID
  916. left join TMSTRUCK_WEIGHT_RESULT TWR
  917. on TWR.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
  918. where
  919. OO.ORDER_NUMBER = #{orderNumber}
  920. and TWR.MATERIAL_ID = #{materialId}
  921. </select>
  922. <select id="getNoNetWeightResultId" parameterType="java.math.BigDecimal" resultType="java.util.Map">
  923. SELECT *
  924. FROM (
  925. SELECT TWR.WEIGHT_TASK_RESULT_ID "weightTaskResultId",
  926. TWR.TARE_SEGMENT_SQE "tareSegmentSqe"
  927. FROM TMSTRUCK_WEIGHT_RESULT TWR
  928. WHERE TWR.RESULT_TOTAL_ID = #{resultTotalId}
  929. AND TWR.RESULT_NET_WEIGHT IS NULL
  930. ORDER BY TWR.TARE_SEGMENT_SQE
  931. )
  932. WHERE ROWNUM &lt;= 2
  933. </select>
  934. <select id="getNoNetWeightResultForSaleReturn" parameterType="java.math.BigDecimal" resultType="java.util.Map">
  935. SELECT *
  936. FROM (
  937. SELECT TWR.WEIGHT_TASK_RESULT_ID "weightTaskResultId",
  938. TWR.GROSS_SEGMENT_SQE "tareSegmentSqe"
  939. FROM TMSTRUCK_WEIGHT_RESULT TWR
  940. WHERE TWR.RESULT_TOTAL_ID = #{resultTotalId}
  941. AND TWR.RESULT_NET_WEIGHT IS NULL
  942. ORDER BY TWR.GROSS_SEGMENT_SQE
  943. )
  944. WHERE ROWNUM &lt;= 2
  945. </select>
  946. <select id="getAPOMes" parameterType="string" resultType="map">
  947. select APO.PURCHASE_ORDER_ID "purchaseOrderId",
  948. DB.MATERIAL_ID "materialId"
  949. from AMS_PURCHASE_ORDER APO
  950. left join DIL_BATCH DB on APO.BATCH_ID = DB.BATCH_ID
  951. where APO.PURCHASE_ORDER_NO = #{arrivalBillNo}
  952. </select>
  953. <select id="getOrderMes" resultType="java.util.Map">
  954. select *
  955. from (
  956. select OO.ORDER_ID "orderId",
  957. OO.ORDER_TYPE "orderTypee",
  958. OO.ORDER_NUMBER "orderNumber",
  959. TWR.WEIGHT_TASK_RESULT_ID "weightTaskResultId",
  960. TTR.RESULT_TOTAL_ID "resultTotalId",
  961. TWR.TARE_SEGMENT_SQE "tareSegmentSqe",
  962. TWR.GROSS_SEGMENT_SQE "grossSegmentSqe"
  963. from TMSTRUCK_WEIGHT_RESULT TWR
  964. left join TMSTRUCK_TOTAL_RESULT TTR
  965. on TTR.RESULT_TOTAL_ID = TWR.RESULT_TOTAL_ID
  966. left join OMSTRUCK_ORDER OO
  967. on OO.ORDER_ID = TTR.ORDER_ID
  968. left join RMS_CAPACITY RC
  969. ON RC.CAPACITY_ID = OO.CAPACITY_ID
  970. where RC.CAPACITY_NUMBER = #{carNo}
  971. and TWR.RESULT_NET_WEIGHT is null
  972. and oo.order_status = 5
  973. order by "tareSegmentSqe"
  974. )
  975. where rownum = 1
  976. </select>
  977. <select id="getHaveNetWeightByMaterial" resultType="java.lang.Integer">
  978. select count(TWR.WEIGHT_TASK_RESULT_ID) from TMSTRUCK_WEIGHT_RESULT TWR
  979. where twr.RESULT_TOTAL_ID = #{resultTotalId}
  980. and twr.material_id = #{materialId}
  981. and TWR.RESULT_NET_WEIGHT is not null
  982. </select>
  983. <select id="getMaterialId" resultType="java.math.BigDecimal" parameterType="java.util.Map">
  984. select RM.MATERIAL_ID from RMS_MATERIAL RM
  985. WHERE RM.MATERIAL_NAME = #{good}
  986. AND RM.MATERIAL_SPECIFICATION || '(' || RM.MATERIAL_MODEL || ')' = #{goodspa}
  987. </select>
  988. <select id="getSaleOrderMaterialNum" resultType="java.util.Map" parameterType="map">
  989. select OOM.ORDER_MATERIAL_NUMBER "orderMaterialNumber",
  990. ASM.MATERIAL_WEIGHT "materialWeight",
  991. ASM.SALE_MATERIAL_ID "saleMaterialId",
  992. ASM.MATERIAL_NUMBER "materialNumber"
  993. from AMS_SALE_ORDER_MATERIAL ASOM
  994. left join OMSTRUCK_ORDER OO on OO.ORDER_PLAN_ID = ASOM.SALE_ORDER_MATERIAL_ID
  995. left join AMS_SALE_TRUCKNO_MATERIAL ASTM on ASOM.SALE_ORDER_MATERIAL_ID = ASTM.SALE_ORDER_MATERIAL_ID
  996. left join AMS_SALE_MATERIAL ASM on ASTM.MATERIAL_ID = ASM.SALE_MATERIAL_ID
  997. left join OMSTRUCK_ORDER_MATERIAL OOM on OO.ORDER_ID = OOM.ORDER_ID
  998. where ASM.MATERIAL_ID = #{materialId}
  999. AND OO.ORDER_ID = #{orderId}
  1000. AND OOM.MATERIAL_ID = #{materialId}
  1001. </select>
  1002. <update id="updateOmsTruckPlanId" parameterType="map">
  1003. update OMSTRUCK_ORDER
  1004. set ORDER_PLAN_ID = #{purchaseOrderId}
  1005. where ORDER_NUMBER = #{orderNumber}
  1006. </update>
  1007. <update id="updateOmsTruckMaterialId" parameterType="map">
  1008. update OMSTRUCK_ORDER_MATERIAL
  1009. set MATERIAL_ID = #{materialId}
  1010. where ORDER_ID = (select ORDER_ID from OMSTRUCK_ORDER where ORDER_NUMBER = #{orderNumber})
  1011. </update>
  1012. <update id="updatePurchaseInwordAPOId" parameterType="map">
  1013. update AMSTRUCK_INWARD_REQUIREMENT AIR
  1014. set AIR.PURCHASE_ORDER_ID = #{purchaseOrderId}
  1015. where AIR.REQUIREMENT_ID = (
  1016. select air.REQUIREMENT_ID
  1017. from OMSTRUCK_ORDER OO
  1018. left join AMSTRUCK_INWARD_PLAN AIP on aip.plan_id = oo.order_plan_id
  1019. LEFT JOIN amstruck_requirement_plan arp ON arp.plan_id = aip.plan_id
  1020. LEFT JOIN amstruck_inward_requirement air ON air.requirement_id = arp.requirement_id
  1021. where OO.ORDER_NUMBER = #{orderNumber}
  1022. )
  1023. </update>
  1024. <update id="updateOrderMaterial" parameterType="map">
  1025. update OMSTRUCK_ORDER_MATERIAL OOM
  1026. SET OOM.ORDER_MATERIAL_NUMBER = #{goodNum}
  1027. <if test="newWeight != null">
  1028. , OOM.ORDER_MATERIAL_WEIGHT = #{newWeight}
  1029. </if>
  1030. WHERE OOM.ORDER_ID = #{orderId}
  1031. and OOM.MATERIAL_ID = #{materialId}
  1032. </update>
  1033. <update id="updateSaleMaterialId">
  1034. update AMS_SALE_MATERIAL
  1035. set MATERIAL_NUMBER = #{materialNum}
  1036. <if test="newWeight != null">
  1037. , MATERIAL_WEIGHT = #{newWeight}
  1038. </if>
  1039. where SALE_MATERIAL_ID = #{saleMaterialId}
  1040. </update>
  1041. </mapper>