OyeInboundResultMapper.xml 40 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941
  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.OyeInboundResultMapper">
  4. <resultMap id="BaseResultMap" type="com.steerinfo.dil.model.OyeInboundResult">
  5. <id column="RESULT_ID" jdbcType="DECIMAL" property="resultId" />
  6. <result column="INVENTORY_ID" jdbcType="DECIMAL" property="inventoryId" />
  7. <result column="SALE_NO" jdbcType="VARCHAR" property="saleNo" />
  8. <result column="ORDER_ID" jdbcType="DECIMAL" property="orderId" />
  9. <result column="SALE_MATERIAL_ID" jdbcType="DECIMAL" property="saleMaterialId" />
  10. <result column="CONSIGNEE_ID" jdbcType="DECIMAL" property="consigneeId" />
  11. <result column="CAPACITY_NUMBHER" jdbcType="VARCHAR" property="capacityNumbher" />
  12. <result column="CAPACITY_ID" jdbcType="DECIMAL" property="capacityId" />
  13. <result column="MATERIAL_ID" jdbcType="DECIMAL" property="materialId" />
  14. <result column="METER" jdbcType="DECIMAL" property="meter" />
  15. <result column="MATERIAL_NUMBER" jdbcType="DECIMAL" property="materialNumber" />
  16. <result column="THEORY_WEIGHT" jdbcType="DECIMAL" property="theoryWeight" />
  17. <result column="SINGLE_WEIGHT" jdbcType="DECIMAL" property="singleWeight" />
  18. <result column="SALE_AREA" jdbcType="VARCHAR" property="saleArea" />
  19. <result column="NET_WEIGHT" jdbcType="DECIMAL" property="netWeight" />
  20. <result column="INBOUND_WAREHOUSE" jdbcType="VARCHAR" property="inboundWarehouse" />
  21. <result column="INBOUND_AREA" jdbcType="VARCHAR" property="inboundArea" />
  22. <result column="INSERT_TIME" jdbcType="TIMESTAMP" property="insertTime" />
  23. <result column="INSERT_USERNAME" jdbcType="VARCHAR" property="insertUsername" />
  24. <result column="UPDATE_TIME" jdbcType="TIMESTAMP" property="updateTime" />
  25. <result column="UPDATE_USERNAME" jdbcType="VARCHAR" property="updateUsername" />
  26. <result column="DELETED" jdbcType="VARCHAR" property="deleted" />
  27. <result column="ALTERNATE_FIELDS2" jdbcType="VARCHAR" property="alternateFields2" />
  28. <result column="ALTERNATE_FIELDS3" jdbcType="VARCHAR" property="alternateFields3" />
  29. <result column="ALTERNATE_FIELDS4" jdbcType="VARCHAR" property="alternateFields4" />
  30. <result column="ALTERNATE_FIELDS5" jdbcType="VARCHAR" property="alternateFields5" />
  31. <result column="ALTERNATE_FIELDS6" jdbcType="VARCHAR" property="alternateFields6" />
  32. <result column="ALTERNATE_FIELDS7" jdbcType="VARCHAR" property="alternateFields7" />
  33. <result column="ALTERNATE_FIELDS8" jdbcType="VARCHAR" property="alternateFields8" />
  34. </resultMap>
  35. <sql id="columns">
  36. RESULT_ID, INVENTORY_ID, SALE_NO, ORDER_ID, SALE_MATERIAL_ID, CONSIGNEE_ID, CAPACITY_NUMBHER,
  37. CAPACITY_ID, MATERIAL_ID, METER, MATERIAL_NUMBER, THEORY_WEIGHT, SINGLE_WEIGHT, SALE_AREA,
  38. NET_WEIGHT, INBOUND_WAREHOUSE, INBOUND_AREA, INSERT_TIME, INSERT_USERNAME, UPDATE_TIME,
  39. UPDATE_USERNAME, DELETED, ALTERNATE_FIELDS2, ALTERNATE_FIELDS3, ALTERNATE_FIELDS4,
  40. ALTERNATE_FIELDS5, ALTERNATE_FIELDS6, ALTERNATE_FIELDS7, ALTERNATE_FIELDS8
  41. </sql>
  42. <sql id="columns_alias">
  43. t.RESULT_ID, t.INVENTORY_ID, t.SALE_NO, t.ORDER_ID, t.SALE_MATERIAL_ID, t.CONSIGNEE_ID,
  44. t.CAPACITY_NUMBHER, t.CAPACITY_ID, t.MATERIAL_ID, t.METER, t.MATERIAL_NUMBER, t.THEORY_WEIGHT,
  45. t.SINGLE_WEIGHT, t.SALE_AREA, t.NET_WEIGHT, t.INBOUND_WAREHOUSE, t.INBOUND_AREA,
  46. t.INSERT_TIME, t.INSERT_USERNAME, t.UPDATE_TIME, t.UPDATE_USERNAME, t.DELETED, t.ALTERNATE_FIELDS2,
  47. t.ALTERNATE_FIELDS3, t.ALTERNATE_FIELDS4, t.ALTERNATE_FIELDS5, t.ALTERNATE_FIELDS6,
  48. t.ALTERNATE_FIELDS7, t.ALTERNATE_FIELDS8
  49. </sql>
  50. <sql id="select">
  51. SELECT <include refid="columns"/> FROM OYE_INBOUND_RESULT
  52. </sql>
  53. <sql id="select_alias">
  54. SELECT <include refid="columns_alias"/> FROM OYE_INBOUND_RESULT t
  55. </sql>
  56. <sql id="where">
  57. <where>
  58. <if test="resultId != null">
  59. and RESULT_ID = #{resultId}
  60. </if>
  61. <if test="inventoryId != null">
  62. and INVENTORY_ID = #{inventoryId}
  63. </if>
  64. <if test="saleNo != null and saleNo != ''">
  65. and SALE_NO = #{saleNo}
  66. </if>
  67. <if test="orderId != null">
  68. and ORDER_ID = #{orderId}
  69. </if>
  70. <if test="saleMaterialId != null">
  71. and SALE_MATERIAL_ID = #{saleMaterialId}
  72. </if>
  73. <if test="consigneeId != null">
  74. and CONSIGNEE_ID = #{consigneeId}
  75. </if>
  76. <if test="capacityNumbher != null and capacityNumbher != ''">
  77. and CAPACITY_NUMBHER = #{capacityNumbher}
  78. </if>
  79. <if test="capacityId != null">
  80. and CAPACITY_ID = #{capacityId}
  81. </if>
  82. <if test="materialId != null">
  83. and MATERIAL_ID = #{materialId}
  84. </if>
  85. <if test="meter != null">
  86. and METER = #{meter}
  87. </if>
  88. <if test="materialNumber != null">
  89. and MATERIAL_NUMBER = #{materialNumber}
  90. </if>
  91. <if test="theoryWeight != null">
  92. and THEORY_WEIGHT = #{theoryWeight}
  93. </if>
  94. <if test="singleWeight != null">
  95. and SINGLE_WEIGHT = #{singleWeight}
  96. </if>
  97. <if test="saleArea != null and saleArea != ''">
  98. and SALE_AREA = #{saleArea}
  99. </if>
  100. <if test="netWeight != null">
  101. and NET_WEIGHT = #{netWeight}
  102. </if>
  103. <if test="inboundWarehouse != null and inboundWarehouse != ''">
  104. and INBOUND_WAREHOUSE = #{inboundWarehouse}
  105. </if>
  106. <if test="inboundArea != null and inboundArea != ''">
  107. and INBOUND_AREA = #{inboundArea}
  108. </if>
  109. <if test="insertTime != null">
  110. and TO_CHAR(INSERT_TIME,'yyyy-MM-dd') = #{insertTime}
  111. </if>
  112. <if test="insertUsername != null and insertUsername != ''">
  113. and INSERT_USERNAME = #{insertUsername}
  114. </if>
  115. <if test="updateTime != null">
  116. and TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = #{updateTime}
  117. </if>
  118. <if test="updateUsername != null and updateUsername != ''">
  119. and UPDATE_USERNAME = #{updateUsername}
  120. </if>
  121. <if test="deleted != null and deleted != ''">
  122. and DELETED = #{deleted}
  123. </if>
  124. <if test="alternateFields2 != null and alternateFields2 != ''">
  125. and ALTERNATE_FIELDS2 = #{alternateFields2}
  126. </if>
  127. <if test="alternateFields3 != null and alternateFields3 != ''">
  128. and ALTERNATE_FIELDS3 = #{alternateFields3}
  129. </if>
  130. <if test="alternateFields4 != null and alternateFields4 != ''">
  131. and ALTERNATE_FIELDS4 = #{alternateFields4}
  132. </if>
  133. <if test="alternateFields5 != null and alternateFields5 != ''">
  134. and ALTERNATE_FIELDS5 = #{alternateFields5}
  135. </if>
  136. <if test="alternateFields6 != null and alternateFields6 != ''">
  137. and ALTERNATE_FIELDS6 = #{alternateFields6}
  138. </if>
  139. <if test="alternateFields7 != null and alternateFields7 != ''">
  140. and ALTERNATE_FIELDS7 = #{alternateFields7}
  141. </if>
  142. <if test="alternateFields8 != null and alternateFields8 != ''">
  143. and ALTERNATE_FIELDS8 = #{alternateFields8}
  144. </if>
  145. </where>
  146. </sql>
  147. <sql id="whereLike">
  148. <where>
  149. <if test="resultId != null">
  150. and RESULT_ID = #{resultId}
  151. </if>
  152. <if test="inventoryId != null">
  153. and INVENTORY_ID = #{inventoryId}
  154. </if>
  155. <if test="saleNo != null and saleNo != ''">
  156. and SALE_NO LIKE '%${saleNo}%'
  157. </if>
  158. <if test="orderId != null">
  159. and ORDER_ID = #{orderId}
  160. </if>
  161. <if test="saleMaterialId != null">
  162. and SALE_MATERIAL_ID = #{saleMaterialId}
  163. </if>
  164. <if test="consigneeId != null">
  165. and CONSIGNEE_ID = #{consigneeId}
  166. </if>
  167. <if test="capacityNumbher != null and capacityNumbher != ''">
  168. and CAPACITY_NUMBHER LIKE '%${capacityNumbher}%'
  169. </if>
  170. <if test="capacityId != null">
  171. and CAPACITY_ID = #{capacityId}
  172. </if>
  173. <if test="materialId != null">
  174. and MATERIAL_ID = #{materialId}
  175. </if>
  176. <if test="meter != null">
  177. and METER = #{meter}
  178. </if>
  179. <if test="materialNumber != null">
  180. and MATERIAL_NUMBER = #{materialNumber}
  181. </if>
  182. <if test="theoryWeight != null">
  183. and THEORY_WEIGHT = #{theoryWeight}
  184. </if>
  185. <if test="singleWeight != null">
  186. and SINGLE_WEIGHT = #{singleWeight}
  187. </if>
  188. <if test="saleArea != null and saleArea != ''">
  189. and SALE_AREA LIKE '%${saleArea}%'
  190. </if>
  191. <if test="netWeight != null">
  192. and NET_WEIGHT = #{netWeight}
  193. </if>
  194. <if test="inboundWarehouse != null and inboundWarehouse != ''">
  195. and INBOUND_WAREHOUSE LIKE '%${inboundWarehouse}%'
  196. </if>
  197. <if test="inboundArea != null and inboundArea != ''">
  198. and INBOUND_AREA LIKE '%${inboundArea}%'
  199. </if>
  200. <if test="insertTime != null">
  201. and TO_CHAR(INSERT_TIME,'yyyy-MM-dd') = #{insertTime}
  202. </if>
  203. <if test="insertUsername != null and insertUsername != ''">
  204. and INSERT_USERNAME LIKE '%${insertUsername}%'
  205. </if>
  206. <if test="updateTime != null">
  207. and TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = #{updateTime}
  208. </if>
  209. <if test="updateUsername != null and updateUsername != ''">
  210. and UPDATE_USERNAME LIKE '%${updateUsername}%'
  211. </if>
  212. <if test="deleted != null and deleted != ''">
  213. and DELETED LIKE '%${deleted}%'
  214. </if>
  215. <if test="alternateFields2 != null and alternateFields2 != ''">
  216. and ALTERNATE_FIELDS2 LIKE '%${alternateFields2}%'
  217. </if>
  218. <if test="alternateFields3 != null and alternateFields3 != ''">
  219. and ALTERNATE_FIELDS3 LIKE '%${alternateFields3}%'
  220. </if>
  221. <if test="alternateFields4 != null and alternateFields4 != ''">
  222. and ALTERNATE_FIELDS4 LIKE '%${alternateFields4}%'
  223. </if>
  224. <if test="alternateFields5 != null and alternateFields5 != ''">
  225. and ALTERNATE_FIELDS5 LIKE '%${alternateFields5}%'
  226. </if>
  227. <if test="alternateFields6 != null and alternateFields6 != ''">
  228. and ALTERNATE_FIELDS6 LIKE '%${alternateFields6}%'
  229. </if>
  230. <if test="alternateFields7 != null and alternateFields7 != ''">
  231. and ALTERNATE_FIELDS7 LIKE '%${alternateFields7}%'
  232. </if>
  233. <if test="alternateFields8 != null and alternateFields8 != ''">
  234. and ALTERNATE_FIELDS8 LIKE '%${alternateFields8}%'
  235. </if>
  236. </where>
  237. </sql>
  238. <delete id="deleteByPrimaryKey" parameterType="java.math.BigDecimal">
  239. delete from OYE_INBOUND_RESULT
  240. where RESULT_ID = #{resultId,jdbcType=DECIMAL}
  241. </delete>
  242. <delete id="deleteBySelectiveElement" parameterType="java.util.HashMap">
  243. delete from OYE_INBOUND_RESULT
  244. where 1!=1
  245. <if test="inventoryId != null">
  246. or INVENTORY_ID = #{inventoryId}
  247. </if>
  248. <if test="saleNo != null and saleNo != ''">
  249. or SALE_NO = #{saleNo}
  250. </if>
  251. <if test="orderId != null">
  252. or ORDER_ID = #{orderId}
  253. </if>
  254. <if test="saleMaterialId != null">
  255. or SALE_MATERIAL_ID = #{saleMaterialId}
  256. </if>
  257. <if test="consigneeId != null">
  258. or CONSIGNEE_ID = #{consigneeId}
  259. </if>
  260. <if test="capacityNumbher != null and capacityNumbher != ''">
  261. or CAPACITY_NUMBHER = #{capacityNumbher}
  262. </if>
  263. <if test="capacityId != null">
  264. or CAPACITY_ID = #{capacityId}
  265. </if>
  266. <if test="materialId != null">
  267. or MATERIAL_ID = #{materialId}
  268. </if>
  269. <if test="meter != null">
  270. or METER = #{meter}
  271. </if>
  272. <if test="materialNumber != null">
  273. or MATERIAL_NUMBER = #{materialNumber}
  274. </if>
  275. <if test="theoryWeight != null">
  276. or THEORY_WEIGHT = #{theoryWeight}
  277. </if>
  278. <if test="singleWeight != null">
  279. or SINGLE_WEIGHT = #{singleWeight}
  280. </if>
  281. <if test="saleArea != null and saleArea != ''">
  282. or SALE_AREA = #{saleArea}
  283. </if>
  284. <if test="netWeight != null">
  285. or NET_WEIGHT = #{netWeight}
  286. </if>
  287. <if test="inboundWarehouse != null and inboundWarehouse != ''">
  288. or INBOUND_WAREHOUSE = #{inboundWarehouse}
  289. </if>
  290. <if test="inboundArea != null and inboundArea != ''">
  291. or INBOUND_AREA = #{inboundArea}
  292. </if>
  293. <if test="insertTime != null">
  294. or TO_CHAR(INSERT_TIME,'yyyy-MM-dd') = '#{insertTime}'
  295. </if>
  296. <if test="insertUsername != null and insertUsername != ''">
  297. or INSERT_USERNAME = #{insertUsername}
  298. </if>
  299. <if test="updateTime != null">
  300. or TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = '#{updateTime}'
  301. </if>
  302. <if test="updateUsername != null and updateUsername != ''">
  303. or UPDATE_USERNAME = #{updateUsername}
  304. </if>
  305. <if test="deleted != null and deleted != ''">
  306. or DELETED = #{deleted}
  307. </if>
  308. <if test="alternateFields2 != null and alternateFields2 != ''">
  309. or ALTERNATE_FIELDS2 = #{alternateFields2}
  310. </if>
  311. <if test="alternateFields3 != null and alternateFields3 != ''">
  312. or ALTERNATE_FIELDS3 = #{alternateFields3}
  313. </if>
  314. <if test="alternateFields4 != null and alternateFields4 != ''">
  315. or ALTERNATE_FIELDS4 = #{alternateFields4}
  316. </if>
  317. <if test="alternateFields5 != null and alternateFields5 != ''">
  318. or ALTERNATE_FIELDS5 = #{alternateFields5}
  319. </if>
  320. <if test="alternateFields6 != null and alternateFields6 != ''">
  321. or ALTERNATE_FIELDS6 = #{alternateFields6}
  322. </if>
  323. <if test="alternateFields7 != null and alternateFields7 != ''">
  324. or ALTERNATE_FIELDS7 = #{alternateFields7}
  325. </if>
  326. <if test="alternateFields8 != null and alternateFields8 != ''">
  327. or ALTERNATE_FIELDS8 = #{alternateFields8}
  328. </if>
  329. </delete>
  330. <insert id="insert" parameterType="com.steerinfo.dil.model.OyeInboundResult">
  331. insert into OYE_INBOUND_RESULT (RESULT_ID, INVENTORY_ID, SALE_NO,
  332. ORDER_ID, SALE_MATERIAL_ID, CONSIGNEE_ID,
  333. CAPACITY_NUMBHER, CAPACITY_ID, MATERIAL_ID,
  334. METER, MATERIAL_NUMBER, THEORY_WEIGHT,
  335. SINGLE_WEIGHT, SALE_AREA, NET_WEIGHT,
  336. INBOUND_WAREHOUSE, INBOUND_AREA, INSERT_TIME,
  337. INSERT_USERNAME, UPDATE_TIME, UPDATE_USERNAME,
  338. DELETED, ALTERNATE_FIELDS2, ALTERNATE_FIELDS3,
  339. ALTERNATE_FIELDS4, ALTERNATE_FIELDS5, ALTERNATE_FIELDS6,
  340. ALTERNATE_FIELDS7, ALTERNATE_FIELDS8)
  341. values (#{resultId,jdbcType=DECIMAL}, #{inventoryId,jdbcType=DECIMAL}, #{saleNo,jdbcType=VARCHAR},
  342. #{orderId,jdbcType=DECIMAL}, #{saleMaterialId,jdbcType=DECIMAL}, #{consigneeId,jdbcType=DECIMAL},
  343. #{capacityNumbher,jdbcType=VARCHAR}, #{capacityId,jdbcType=DECIMAL}, #{materialId,jdbcType=DECIMAL},
  344. #{meter,jdbcType=DECIMAL}, #{materialNumber,jdbcType=DECIMAL}, #{theoryWeight,jdbcType=DECIMAL},
  345. #{singleWeight,jdbcType=DECIMAL}, #{saleArea,jdbcType=VARCHAR}, #{netWeight,jdbcType=DECIMAL},
  346. #{inboundWarehouse,jdbcType=VARCHAR}, #{inboundArea,jdbcType=VARCHAR}, #{insertTime,jdbcType=TIMESTAMP},
  347. #{insertUsername,jdbcType=VARCHAR}, #{updateTime,jdbcType=TIMESTAMP}, #{updateUsername,jdbcType=VARCHAR},
  348. #{deleted,jdbcType=VARCHAR}, #{alternateFields2,jdbcType=VARCHAR}, #{alternateFields3,jdbcType=VARCHAR},
  349. #{alternateFields4,jdbcType=VARCHAR}, #{alternateFields5,jdbcType=VARCHAR}, #{alternateFields6,jdbcType=VARCHAR},
  350. #{alternateFields7,jdbcType=VARCHAR}, #{alternateFields8,jdbcType=VARCHAR})
  351. </insert>
  352. <insert id="insertSelective" parameterType="com.steerinfo.dil.model.OyeInboundResult">
  353. insert into OYE_INBOUND_RESULT
  354. <trim prefix="(" suffix=")" suffixOverrides=",">
  355. <if test="resultId != null">
  356. RESULT_ID,
  357. </if>
  358. <if test="inventoryId != null">
  359. INVENTORY_ID,
  360. </if>
  361. <if test="saleNo != null">
  362. SALE_NO,
  363. </if>
  364. <if test="orderId != null">
  365. ORDER_ID,
  366. </if>
  367. <if test="saleMaterialId != null">
  368. SALE_MATERIAL_ID,
  369. </if>
  370. <if test="consigneeId != null">
  371. CONSIGNEE_ID,
  372. </if>
  373. <if test="capacityNumbher != null">
  374. CAPACITY_NUMBHER,
  375. </if>
  376. <if test="capacityId != null">
  377. CAPACITY_ID,
  378. </if>
  379. <if test="materialId != null">
  380. MATERIAL_ID,
  381. </if>
  382. <if test="meter != null">
  383. METER,
  384. </if>
  385. <if test="materialNumber != null">
  386. MATERIAL_NUMBER,
  387. </if>
  388. <if test="theoryWeight != null">
  389. THEORY_WEIGHT,
  390. </if>
  391. <if test="singleWeight != null">
  392. SINGLE_WEIGHT,
  393. </if>
  394. <if test="saleArea != null">
  395. SALE_AREA,
  396. </if>
  397. <if test="netWeight != null">
  398. NET_WEIGHT,
  399. </if>
  400. <if test="inboundWarehouse != null">
  401. INBOUND_WAREHOUSE,
  402. </if>
  403. <if test="inboundArea != null">
  404. INBOUND_AREA,
  405. </if>
  406. <if test="insertTime != null">
  407. INSERT_TIME,
  408. </if>
  409. <if test="insertUsername != null">
  410. INSERT_USERNAME,
  411. </if>
  412. <if test="updateTime != null">
  413. UPDATE_TIME,
  414. </if>
  415. <if test="updateUsername != null">
  416. UPDATE_USERNAME,
  417. </if>
  418. <if test="deleted != null">
  419. DELETED,
  420. </if>
  421. <if test="alternateFields2 != null">
  422. ALTERNATE_FIELDS2,
  423. </if>
  424. <if test="alternateFields3 != null">
  425. ALTERNATE_FIELDS3,
  426. </if>
  427. <if test="alternateFields4 != null">
  428. ALTERNATE_FIELDS4,
  429. </if>
  430. <if test="alternateFields5 != null">
  431. ALTERNATE_FIELDS5,
  432. </if>
  433. <if test="alternateFields6 != null">
  434. ALTERNATE_FIELDS6,
  435. </if>
  436. <if test="alternateFields7 != null">
  437. ALTERNATE_FIELDS7,
  438. </if>
  439. <if test="alternateFields8 != null">
  440. ALTERNATE_FIELDS8,
  441. </if>
  442. </trim>
  443. <trim prefix="values (" suffix=")" suffixOverrides=",">
  444. <if test="resultId != null">
  445. #{resultId,jdbcType=DECIMAL},
  446. </if>
  447. <if test="inventoryId != null">
  448. #{inventoryId,jdbcType=DECIMAL},
  449. </if>
  450. <if test="saleNo != null">
  451. #{saleNo,jdbcType=VARCHAR},
  452. </if>
  453. <if test="orderId != null">
  454. #{orderId,jdbcType=DECIMAL},
  455. </if>
  456. <if test="saleMaterialId != null">
  457. #{saleMaterialId,jdbcType=DECIMAL},
  458. </if>
  459. <if test="consigneeId != null">
  460. #{consigneeId,jdbcType=DECIMAL},
  461. </if>
  462. <if test="capacityNumbher != null">
  463. #{capacityNumbher,jdbcType=VARCHAR},
  464. </if>
  465. <if test="capacityId != null">
  466. #{capacityId,jdbcType=DECIMAL},
  467. </if>
  468. <if test="materialId != null">
  469. #{materialId,jdbcType=DECIMAL},
  470. </if>
  471. <if test="meter != null">
  472. #{meter,jdbcType=DECIMAL},
  473. </if>
  474. <if test="materialNumber != null">
  475. #{materialNumber,jdbcType=DECIMAL},
  476. </if>
  477. <if test="theoryWeight != null">
  478. #{theoryWeight,jdbcType=DECIMAL},
  479. </if>
  480. <if test="singleWeight != null">
  481. #{singleWeight,jdbcType=DECIMAL},
  482. </if>
  483. <if test="saleArea != null">
  484. #{saleArea,jdbcType=VARCHAR},
  485. </if>
  486. <if test="netWeight != null">
  487. #{netWeight,jdbcType=DECIMAL},
  488. </if>
  489. <if test="inboundWarehouse != null">
  490. #{inboundWarehouse,jdbcType=VARCHAR},
  491. </if>
  492. <if test="inboundArea != null">
  493. #{inboundArea,jdbcType=VARCHAR},
  494. </if>
  495. <if test="insertTime != null">
  496. #{insertTime,jdbcType=TIMESTAMP},
  497. </if>
  498. <if test="insertUsername != null">
  499. #{insertUsername,jdbcType=VARCHAR},
  500. </if>
  501. <if test="updateTime != null">
  502. #{updateTime,jdbcType=TIMESTAMP},
  503. </if>
  504. <if test="updateUsername != null">
  505. #{updateUsername,jdbcType=VARCHAR},
  506. </if>
  507. <if test="deleted != null">
  508. #{deleted,jdbcType=VARCHAR},
  509. </if>
  510. <if test="alternateFields2 != null">
  511. #{alternateFields2,jdbcType=VARCHAR},
  512. </if>
  513. <if test="alternateFields3 != null">
  514. #{alternateFields3,jdbcType=VARCHAR},
  515. </if>
  516. <if test="alternateFields4 != null">
  517. #{alternateFields4,jdbcType=VARCHAR},
  518. </if>
  519. <if test="alternateFields5 != null">
  520. #{alternateFields5,jdbcType=VARCHAR},
  521. </if>
  522. <if test="alternateFields6 != null">
  523. #{alternateFields6,jdbcType=VARCHAR},
  524. </if>
  525. <if test="alternateFields7 != null">
  526. #{alternateFields7,jdbcType=VARCHAR},
  527. </if>
  528. <if test="alternateFields8 != null">
  529. #{alternateFields8,jdbcType=VARCHAR},
  530. </if>
  531. </trim>
  532. </insert>
  533. <update id="updateByPrimaryKey" parameterType="com.steerinfo.dil.model.OyeInboundResult">
  534. update OYE_INBOUND_RESULT
  535. set INVENTORY_ID = #{inventoryId,jdbcType=DECIMAL},
  536. SALE_NO = #{saleNo,jdbcType=VARCHAR},
  537. ORDER_ID = #{orderId,jdbcType=DECIMAL},
  538. SALE_MATERIAL_ID = #{saleMaterialId,jdbcType=DECIMAL},
  539. CONSIGNEE_ID = #{consigneeId,jdbcType=DECIMAL},
  540. CAPACITY_NUMBHER = #{capacityNumbher,jdbcType=VARCHAR},
  541. CAPACITY_ID = #{capacityId,jdbcType=DECIMAL},
  542. MATERIAL_ID = #{materialId,jdbcType=DECIMAL},
  543. METER = #{meter,jdbcType=DECIMAL},
  544. MATERIAL_NUMBER = #{materialNumber,jdbcType=DECIMAL},
  545. THEORY_WEIGHT = #{theoryWeight,jdbcType=DECIMAL},
  546. SINGLE_WEIGHT = #{singleWeight,jdbcType=DECIMAL},
  547. SALE_AREA = #{saleArea,jdbcType=VARCHAR},
  548. NET_WEIGHT = #{netWeight,jdbcType=DECIMAL},
  549. INBOUND_WAREHOUSE = #{inboundWarehouse,jdbcType=VARCHAR},
  550. INBOUND_AREA = #{inboundArea,jdbcType=VARCHAR},
  551. INSERT_TIME = #{insertTime,jdbcType=TIMESTAMP},
  552. INSERT_USERNAME = #{insertUsername,jdbcType=VARCHAR},
  553. UPDATE_TIME = #{updateTime,jdbcType=TIMESTAMP},
  554. UPDATE_USERNAME = #{updateUsername,jdbcType=VARCHAR},
  555. DELETED = #{deleted,jdbcType=VARCHAR},
  556. ALTERNATE_FIELDS2 = #{alternateFields2,jdbcType=VARCHAR},
  557. ALTERNATE_FIELDS3 = #{alternateFields3,jdbcType=VARCHAR},
  558. ALTERNATE_FIELDS4 = #{alternateFields4,jdbcType=VARCHAR},
  559. ALTERNATE_FIELDS5 = #{alternateFields5,jdbcType=VARCHAR},
  560. ALTERNATE_FIELDS6 = #{alternateFields6,jdbcType=VARCHAR},
  561. ALTERNATE_FIELDS7 = #{alternateFields7,jdbcType=VARCHAR},
  562. ALTERNATE_FIELDS8 = #{alternateFields8,jdbcType=VARCHAR}
  563. where RESULT_ID = #{resultId,jdbcType=DECIMAL}
  564. </update>
  565. <update id="updateByPrimaryKeySelective" parameterType="com.steerinfo.dil.model.OyeInboundResult">
  566. update OYE_INBOUND_RESULT
  567. <set>
  568. <if test="inventoryId != null">
  569. INVENTORY_ID = #{inventoryId,jdbcType=DECIMAL},
  570. </if>
  571. <if test="saleNo != null">
  572. SALE_NO = #{saleNo,jdbcType=VARCHAR},
  573. </if>
  574. <if test="orderId != null">
  575. ORDER_ID = #{orderId,jdbcType=DECIMAL},
  576. </if>
  577. <if test="saleMaterialId != null">
  578. SALE_MATERIAL_ID = #{saleMaterialId,jdbcType=DECIMAL},
  579. </if>
  580. <if test="consigneeId != null">
  581. CONSIGNEE_ID = #{consigneeId,jdbcType=DECIMAL},
  582. </if>
  583. <if test="capacityNumbher != null">
  584. CAPACITY_NUMBHER = #{capacityNumbher,jdbcType=VARCHAR},
  585. </if>
  586. <if test="capacityId != null">
  587. CAPACITY_ID = #{capacityId,jdbcType=DECIMAL},
  588. </if>
  589. <if test="materialId != null">
  590. MATERIAL_ID = #{materialId,jdbcType=DECIMAL},
  591. </if>
  592. <if test="meter != null">
  593. METER = #{meter,jdbcType=DECIMAL},
  594. </if>
  595. <if test="materialNumber != null">
  596. MATERIAL_NUMBER = #{materialNumber,jdbcType=DECIMAL},
  597. </if>
  598. <if test="theoryWeight != null">
  599. THEORY_WEIGHT = #{theoryWeight,jdbcType=DECIMAL},
  600. </if>
  601. <if test="singleWeight != null">
  602. SINGLE_WEIGHT = #{singleWeight,jdbcType=DECIMAL},
  603. </if>
  604. <if test="saleArea != null">
  605. SALE_AREA = #{saleArea,jdbcType=VARCHAR},
  606. </if>
  607. <if test="netWeight != null">
  608. NET_WEIGHT = #{netWeight,jdbcType=DECIMAL},
  609. </if>
  610. <if test="inboundWarehouse != null">
  611. INBOUND_WAREHOUSE = #{inboundWarehouse,jdbcType=VARCHAR},
  612. </if>
  613. <if test="inboundArea != null">
  614. INBOUND_AREA = #{inboundArea,jdbcType=VARCHAR},
  615. </if>
  616. <if test="insertTime != null">
  617. INSERT_TIME = #{insertTime,jdbcType=TIMESTAMP},
  618. </if>
  619. <if test="insertUsername != null">
  620. INSERT_USERNAME = #{insertUsername,jdbcType=VARCHAR},
  621. </if>
  622. <if test="updateTime != null">
  623. UPDATE_TIME = #{updateTime,jdbcType=TIMESTAMP},
  624. </if>
  625. <if test="updateUsername != null">
  626. UPDATE_USERNAME = #{updateUsername,jdbcType=VARCHAR},
  627. </if>
  628. <if test="deleted != null">
  629. DELETED = #{deleted,jdbcType=VARCHAR},
  630. </if>
  631. <if test="alternateFields2 != null">
  632. ALTERNATE_FIELDS2 = #{alternateFields2,jdbcType=VARCHAR},
  633. </if>
  634. <if test="alternateFields3 != null">
  635. ALTERNATE_FIELDS3 = #{alternateFields3,jdbcType=VARCHAR},
  636. </if>
  637. <if test="alternateFields4 != null">
  638. ALTERNATE_FIELDS4 = #{alternateFields4,jdbcType=VARCHAR},
  639. </if>
  640. <if test="alternateFields5 != null">
  641. ALTERNATE_FIELDS5 = #{alternateFields5,jdbcType=VARCHAR},
  642. </if>
  643. <if test="alternateFields6 != null">
  644. ALTERNATE_FIELDS6 = #{alternateFields6,jdbcType=VARCHAR},
  645. </if>
  646. <if test="alternateFields7 != null">
  647. ALTERNATE_FIELDS7 = #{alternateFields7,jdbcType=VARCHAR},
  648. </if>
  649. <if test="alternateFields8 != null">
  650. ALTERNATE_FIELDS8 = #{alternateFields8,jdbcType=VARCHAR},
  651. </if>
  652. </set>
  653. where RESULT_ID = #{resultId,jdbcType=DECIMAL}
  654. </update>
  655. <select id="selectByPrimaryKey" parameterType="java.math.BigDecimal" resultMap="BaseResultMap">
  656. <include refid="select"/>
  657. where RESULT_ID = #{resultId,jdbcType=DECIMAL}
  658. </select>
  659. <select id="selectByParameters" parameterType="java.util.HashMap" resultMap="BaseResultMap">
  660. <include refid="select"/>
  661. <include refid="where"/>
  662. </select>
  663. <select id="selectLikeByParameters" parameterType="java.util.HashMap" resultMap="BaseResultMap">
  664. <include refid="select"/>
  665. <include refid="whereLike"/>
  666. </select>
  667. <insert id="batchInsert" parameterType="java.util.List">
  668. insert into OYE_INBOUND_RESULT
  669. (RESULT_ID,
  670. INVENTORY_ID, SALE_NO, ORDER_ID,
  671. SALE_MATERIAL_ID, CONSIGNEE_ID,
  672. CAPACITY_NUMBHER, CAPACITY_ID,
  673. MATERIAL_ID, METER, MATERIAL_NUMBER,
  674. THEORY_WEIGHT, SINGLE_WEIGHT, SALE_AREA,
  675. NET_WEIGHT, INBOUND_WAREHOUSE,
  676. INBOUND_AREA, INSERT_TIME, INSERT_USERNAME,
  677. UPDATE_TIME, UPDATE_USERNAME,
  678. DELETED, ALTERNATE_FIELDS2, ALTERNATE_FIELDS3,
  679. ALTERNATE_FIELDS4, ALTERNATE_FIELDS5,
  680. ALTERNATE_FIELDS6, ALTERNATE_FIELDS7,
  681. ALTERNATE_FIELDS8)
  682. ( <foreach collection="list" item="item" separator="union all">
  683. select
  684. #{item.resultId,jdbcType=DECIMAL},
  685. #{item.inventoryId,jdbcType=DECIMAL}, #{item.saleNo,jdbcType=VARCHAR}, #{item.orderId,jdbcType=DECIMAL},
  686. #{item.saleMaterialId,jdbcType=DECIMAL}, #{item.consigneeId,jdbcType=DECIMAL},
  687. #{item.capacityNumbher,jdbcType=VARCHAR}, #{item.capacityId,jdbcType=DECIMAL},
  688. #{item.materialId,jdbcType=DECIMAL}, #{item.meter,jdbcType=DECIMAL}, #{item.materialNumber,jdbcType=DECIMAL},
  689. #{item.theoryWeight,jdbcType=DECIMAL}, #{item.singleWeight,jdbcType=DECIMAL}, #{item.saleArea,jdbcType=VARCHAR},
  690. #{item.netWeight,jdbcType=DECIMAL}, #{item.inboundWarehouse,jdbcType=VARCHAR},
  691. #{item.inboundArea,jdbcType=VARCHAR}, #{item.insertTime,jdbcType=TIMESTAMP}, #{item.insertUsername,jdbcType=VARCHAR},
  692. #{item.updateTime,jdbcType=TIMESTAMP}, #{item.updateUsername,jdbcType=VARCHAR},
  693. #{item.deleted,jdbcType=VARCHAR}, #{item.alternateFields2,jdbcType=VARCHAR}, #{item.alternateFields3,jdbcType=VARCHAR},
  694. #{item.alternateFields4,jdbcType=VARCHAR}, #{item.alternateFields5,jdbcType=VARCHAR},
  695. #{item.alternateFields6,jdbcType=VARCHAR}, #{item.alternateFields7,jdbcType=VARCHAR},
  696. #{item.alternateFields8,jdbcType=VARCHAR} from dual
  697. </foreach> )
  698. </insert>
  699. <update id="batchUpdate" parameterType="java.util.List">
  700. update OYE_INBOUND_RESULT
  701. set
  702. RESULT_ID=
  703. <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
  704. when #{item.resultId,jdbcType=DECIMAL} then #{item.resultId,jdbcType=DECIMAL}
  705. </foreach>
  706. ,INVENTORY_ID=
  707. <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
  708. when #{item.resultId,jdbcType=DECIMAL} then #{item.inventoryId,jdbcType=DECIMAL}
  709. </foreach>
  710. ,SALE_NO=
  711. <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
  712. when #{item.resultId,jdbcType=DECIMAL} then #{item.saleNo,jdbcType=VARCHAR}
  713. </foreach>
  714. ,ORDER_ID=
  715. <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
  716. when #{item.resultId,jdbcType=DECIMAL} then #{item.orderId,jdbcType=DECIMAL}
  717. </foreach>
  718. ,SALE_MATERIAL_ID=
  719. <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
  720. when #{item.resultId,jdbcType=DECIMAL} then #{item.saleMaterialId,jdbcType=DECIMAL}
  721. </foreach>
  722. ,CONSIGNEE_ID=
  723. <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
  724. when #{item.resultId,jdbcType=DECIMAL} then #{item.consigneeId,jdbcType=DECIMAL}
  725. </foreach>
  726. ,CAPACITY_NUMBHER=
  727. <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
  728. when #{item.resultId,jdbcType=DECIMAL} then #{item.capacityNumbher,jdbcType=VARCHAR}
  729. </foreach>
  730. ,CAPACITY_ID=
  731. <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
  732. when #{item.resultId,jdbcType=DECIMAL} then #{item.capacityId,jdbcType=DECIMAL}
  733. </foreach>
  734. ,MATERIAL_ID=
  735. <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
  736. when #{item.resultId,jdbcType=DECIMAL} then #{item.materialId,jdbcType=DECIMAL}
  737. </foreach>
  738. ,METER=
  739. <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
  740. when #{item.resultId,jdbcType=DECIMAL} then #{item.meter,jdbcType=DECIMAL}
  741. </foreach>
  742. ,MATERIAL_NUMBER=
  743. <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
  744. when #{item.resultId,jdbcType=DECIMAL} then #{item.materialNumber,jdbcType=DECIMAL}
  745. </foreach>
  746. ,THEORY_WEIGHT=
  747. <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
  748. when #{item.resultId,jdbcType=DECIMAL} then #{item.theoryWeight,jdbcType=DECIMAL}
  749. </foreach>
  750. ,SINGLE_WEIGHT=
  751. <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
  752. when #{item.resultId,jdbcType=DECIMAL} then #{item.singleWeight,jdbcType=DECIMAL}
  753. </foreach>
  754. ,SALE_AREA=
  755. <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
  756. when #{item.resultId,jdbcType=DECIMAL} then #{item.saleArea,jdbcType=VARCHAR}
  757. </foreach>
  758. ,NET_WEIGHT=
  759. <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
  760. when #{item.resultId,jdbcType=DECIMAL} then #{item.netWeight,jdbcType=DECIMAL}
  761. </foreach>
  762. ,INBOUND_WAREHOUSE=
  763. <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
  764. when #{item.resultId,jdbcType=DECIMAL} then #{item.inboundWarehouse,jdbcType=VARCHAR}
  765. </foreach>
  766. ,INBOUND_AREA=
  767. <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
  768. when #{item.resultId,jdbcType=DECIMAL} then #{item.inboundArea,jdbcType=VARCHAR}
  769. </foreach>
  770. ,INSERT_TIME=
  771. <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
  772. when #{item.resultId,jdbcType=DECIMAL} then #{item.insertTime,jdbcType=TIMESTAMP}
  773. </foreach>
  774. ,INSERT_USERNAME=
  775. <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
  776. when #{item.resultId,jdbcType=DECIMAL} then #{item.insertUsername,jdbcType=VARCHAR}
  777. </foreach>
  778. ,UPDATE_TIME=
  779. <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
  780. when #{item.resultId,jdbcType=DECIMAL} then #{item.updateTime,jdbcType=TIMESTAMP}
  781. </foreach>
  782. ,UPDATE_USERNAME=
  783. <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
  784. when #{item.resultId,jdbcType=DECIMAL} then #{item.updateUsername,jdbcType=VARCHAR}
  785. </foreach>
  786. ,DELETED=
  787. <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
  788. when #{item.resultId,jdbcType=DECIMAL} then #{item.deleted,jdbcType=VARCHAR}
  789. </foreach>
  790. ,ALTERNATE_FIELDS2=
  791. <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
  792. when #{item.resultId,jdbcType=DECIMAL} then #{item.alternateFields2,jdbcType=VARCHAR}
  793. </foreach>
  794. ,ALTERNATE_FIELDS3=
  795. <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
  796. when #{item.resultId,jdbcType=DECIMAL} then #{item.alternateFields3,jdbcType=VARCHAR}
  797. </foreach>
  798. ,ALTERNATE_FIELDS4=
  799. <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
  800. when #{item.resultId,jdbcType=DECIMAL} then #{item.alternateFields4,jdbcType=VARCHAR}
  801. </foreach>
  802. ,ALTERNATE_FIELDS5=
  803. <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
  804. when #{item.resultId,jdbcType=DECIMAL} then #{item.alternateFields5,jdbcType=VARCHAR}
  805. </foreach>
  806. ,ALTERNATE_FIELDS6=
  807. <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
  808. when #{item.resultId,jdbcType=DECIMAL} then #{item.alternateFields6,jdbcType=VARCHAR}
  809. </foreach>
  810. ,ALTERNATE_FIELDS7=
  811. <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
  812. when #{item.resultId,jdbcType=DECIMAL} then #{item.alternateFields7,jdbcType=VARCHAR}
  813. </foreach>
  814. ,ALTERNATE_FIELDS8=
  815. <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
  816. when #{item.resultId,jdbcType=DECIMAL} then #{item.alternateFields8,jdbcType=VARCHAR}
  817. </foreach>
  818. where RESULT_ID in
  819. <foreach collection="list" index="index" item="item" separator="," open="(" close=")">
  820. #{item.resultId,jdbcType=DECIMAL}
  821. </foreach>
  822. </update>
  823. <delete id="batchDelete" parameterType="java.util.List">
  824. delete from OYE_INBOUND_RESULT
  825. where RESULT_ID in
  826. <foreach collection="list" item="id" open="(" close=")" separator=",">
  827. #{id}
  828. </foreach>
  829. </delete>
  830. <!-- 友情提示!!!-->
  831. <!-- 请将自己写的代码放在此标签之下,方便以后粘贴复制。-->
  832. <select id="getOyeInboundResult" resultType="java.util.Map">
  833. SELECT OIR.SINGLE_WEIGHT "singleWeight",
  834. OIR.METER "meter",
  835. OIR.MATERIAL_ID "materialId",
  836. OIR.CAPACITY_NUMBHER "capacityNumber",
  837. OIR.MATERIAL_NUMBER "materialNumber",
  838. OIR.THEORY_WEIGHT "theoryWeight",
  839. OIR.NET_WEIGHT "netWeight",
  840. TWB.BATCH_NET_WEIGHT "orderNetWeight",
  841. OIR.SALE_NO "saleNo",
  842. OIR.SALE_AREA "saleArea",
  843. OIR.INVENTORY_ID "inventoryId",
  844. OIR.INBOUND_WAREHOUSE "inboundWarehouse",
  845. OIR.INBOUND_AREA "inboundArea",
  846. OIR.SALE_MATERIAL_ID "saleMaterialId",
  847. OIR.INSERT_TIME "insertTime",
  848. RC.CONSIGNEE_ID "consigneeId",
  849. RC.CONSIGNEE_COMPANY_NAME "consigneeName",
  850. RM.MATERIAL_NAME "materialName",
  851. RM.MATERIAL_SPECIFICATION "materialSpe",
  852. RM.MATERIAL_MODEL "materialModel",
  853. OO.ORDER_ID "orderId",
  854. OO.ORDER_NUMBER "orderNumber",
  855. OO.CAPACITY_ID "capacityId"
  856. FROM OYE_INBOUND_RESULT OIR
  857. LEFT JOIN RMS_MATERIAL RM on OIR.MATERIAL_ID = RM.MATERIAL_ID
  858. LEFT JOIN RMS_CONSIGNEE RC on OIR.CONSIGNEE_ID = RC.CONSIGNEE_ID
  859. LEFT JOIN OMSTRUCK_ORDER OO on OIR.ORDER_ID = OO.ORDER_ID
  860. LEFT JOIN AMS_SALE_MATERIAL ASM ON ASM.SALE_MATERIAL_ID = OIR.SALE_MATERIAL_ID
  861. LEFT JOIN TMSTRUCK_WEIGHT_BATCH TWB ON TWB.WEIGHT_BATCH_ID = ASM.WEIGHT_BATCH_ID
  862. <where>
  863. <if test="oneDate != null">
  864. and to_date(#{oneDate}, 'yyyy-mm-dd hh24:mi:ss') &lt;= OIR.INSERT_TIME
  865. </if>
  866. <if test="startDate != null">
  867. and to_date(#{startDate}, 'yyyy-mm-dd hh24:mi:ss') &lt;= OIR.INSERT_TIME
  868. and to_date(#{endDate}, 'yyyy-mm-dd hh24:mi:ss') >= OIR.INSERT_TIME
  869. </if>
  870. <if test="consigneeName != null and consigneeName != ''">
  871. AND RC.CONSIGNEE_COMPANY_NAME LIKE '%${consigneeName}%'
  872. </if>
  873. <if test="capacityNumber != null and capacityNumber != ''">
  874. AND OIR.CAPACITY_NUMBHER LIKE '%${capacityNumber}%'
  875. </if>
  876. <if test="saleArea != null and saleArea != ''">
  877. AND OIR.SALE_AREA LIKE '%${saleArea}%'
  878. </if>
  879. <if test="inboundWarehouse != null and inboundWarehouse != ''">
  880. AND OIR.INBOUND_WAREHOUSE LIKE '%${inboundWarehouse}%'
  881. </if>
  882. <if test="inboundArea != null and inboundArea != ''">
  883. AND OIR.inbound_Area LIKE '%${inboundArea}%'
  884. </if>
  885. <if test="materialName != null and materialName != ''">
  886. AND RM.material_Name LIKE '%${materialName}%'
  887. </if>
  888. <if test="materialSpe != null and materialSpe != ''">
  889. AND RM.MATERIAL_SPECIFICATION LIKE '%${materialSpe}%'
  890. </if>
  891. <if test="saleAreaRemark != null">
  892. and
  893. <foreach collection="saleAreaRemark" item="item" open="(" separator="or" close=")">
  894. OIR.SALE_AREA like '%${item}%'
  895. </foreach>
  896. </if>
  897. </where>
  898. ORDER BY OIR.INSERT_TIME DESC
  899. </select>
  900. <select id="selectSaleMaterialID" resultType="java.math.BigDecimal">
  901. SELECT OIR.SALE_MATERIAL_ID FROM OYE_INBOUND_RESULT OIR
  902. WHERE OIR.SALE_MATERIAL_ID = #{saleMaterialId}
  903. </select>
  904. <update id="updateOrderStatus">
  905. UPDATE TMSTRUCK_TOTAL_RESULT
  906. SET ORDER_STATUS = '已入库'
  907. WHERE ORDER_ID = #{orderId}
  908. </update>
  909. <select id="getPlaceId" resultType="java.math.BigDecimal">
  910. SELECT RRP.PLACE_ID FROM RMS_RECEIVE_PLACE RRP
  911. LEFT JOIN RMS_RECEIVE_ADDRESS RRA
  912. ON RRA.ADDRESS_ID = RRP.ADDRESS_ID
  913. WHERE RRP.ADDRESS_DELIVERY_ADDRESS = #{inboundWarehouse}
  914. AND RRA.INSERT_UPDATE_REMARK = '厂外库'
  915. FETCH NEXT 1 ROWS ONLY
  916. </select>
  917. <update id="updateAddressPlace">
  918. UPDATE AMS_SALE_ORDER_MATERIAL ASOM
  919. SET ASOM.SALE_SHIPPING_ADDRESS_ID = #{newPlaceId},
  920. ASOM.HISTORY_SHIPPING_ADDRESS_ID = #{placeId},
  921. ASOM.INSERT_UPDATE_REMARK = '入库修改地址'
  922. WHERE ASOM.SALE_ORDER_MATERIAL_ID = (
  923. SELECT ASTM.SALE_ORDER_MATERIAL_ID FROM AMS_SALE_TRUCKNO_MATERIAL ASTM
  924. WHERE ASTM.MATERIAL_ID = #{saleMaterialId}
  925. )
  926. </update>
  927. <select id="selectReceiptResultId" resultType="java.lang.String">
  928. SELECT TRR.RESULT_ARRIVAL_ADDRESS
  929. FROM TMSTRUCK_TOTAL_RESULT TTR
  930. LEFT JOIN TMStRUCK_RECEIPT_RESULT TRR
  931. ON TTR.RESULT_TOTAL_ID = TRR.RESULT_TOTAL_ID
  932. WHERE TTR.ORDER_ID = #{orderId}
  933. fetch next 1 rows only
  934. </select>
  935. <update id="updateOOOrderStatus">
  936. UPDATE OMSTRUCK_ORDER OO
  937. SET OO.ORDER_STATUS = 2
  938. WHERE OO.ORDER_ID = #{orderId}
  939. </update>
  940. </mapper>