OyeRealtimeInventoryMapper.xml 41 KB

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