OyeRealtimeInventoryMapper.xml 45 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053
  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 ORI.SINGLE_WEIGHT "singleWeight",
  678. ORI.METER "meter",
  679. ORI.MATERIAL_ID "materialId",
  680. ORI.MATERIAL_NUMBER "materialNumber",
  681. ORI.THEORY_WEIGHT "theoryWeight",
  682. ORI.NET_WEIGHT "netWeight",
  683. ORI.SALE_AREA "saleArea",
  684. ORI.INVENTORY_ID "inventoryId",
  685. ORI.INBOUND_WAREHOUSE "inboundWarehouse",
  686. ORI.INBOUND_AREA "inboundArea",
  687. nvl(ORI.UPDATE_TIME, ORI.INSERT_TIME) "insertTime",
  688. ORI.UPDATE_TIME "updateTime",
  689. RC.CONSIGNEE_ID "consigneeId",
  690. RC.CONSIGNEE_COMPANY_NAME "consigneeName",
  691. RM.MATERIAL_NAME "materialName",
  692. RM.MATERIAL_SPECIFICATION "materialSpe",
  693. RM.MATERIAL_MODEL "materialModel"
  694. FROM OYE_REALTIME_INVENTORY ORI
  695. LEFT JOIN RMS_MATERIAL RM on ORI.MATERIAL_ID = RM.MATERIAL_ID
  696. LEFT JOIN RMS_CONSIGNEE RC on ORI.CONSIGNEE_ID = RC.CONSIGNEE_ID
  697. <where>
  698. <if test="inboundAreaSide != null and inboundAreaSide != ''">
  699. AND ORI.inbound_Area = #{inboundAreaSide}
  700. </if>
  701. <if test="startDate != null">
  702. and to_date(#{startDate}, 'yyyy-mm-dd hh24:mi:ss') &lt;= ORI.INSERT_TIME
  703. and to_date(#{endDate}, 'yyyy-mm-dd hh24:mi:ss') >= ORI.INSERT_TIME
  704. </if>
  705. <if test="filterFlag != null">
  706. and ORI.MATERIAL_NUMBER > 0
  707. </if>
  708. <if test="consigneeName != null and consigneeName != ''">
  709. AND RC.CONSIGNEE_COMPANY_NAME LIKE '%${consigneeName}%'
  710. </if>
  711. <if test="saleArea != null and saleArea != ''">
  712. AND ORI.SALE_AREA LIKE '%${saleArea}%'
  713. </if>
  714. <if test="inboundWarehouse != null and inboundWarehouse != ''">
  715. AND ORI.INBOUND_WAREHOUSE LIKE '%${inboundWarehouse}%'
  716. </if>
  717. <if test="inboundArea != null and inboundArea != ''">
  718. AND ORI.inbound_Area LIKE '%${inboundArea}%'
  719. </if>
  720. <if test="materialName != null and materialName != ''">
  721. AND RM.material_Name LIKE '%${materialName}%'
  722. </if>
  723. <if test="materialNameText != null and materialNameText != ''">
  724. AND RM.material_Name || RM.MATERIAL_MODEL LIKE '%${materialNameText}%'
  725. </if>
  726. <if test="materialSpe != null and materialSpe != ''">
  727. AND RM.MATERIAL_SPECIFICATION LIKE '%${materialSpe}%'
  728. </if>
  729. <if test="saleRemark != null and saleRemark != ''">
  730. AND ORI.SALE_AREA LIKE '%${saleRemark}%'
  731. </if>
  732. <if test="receiveCompanyId != null and receiveCompanyId != ''">
  733. AND RC.CONSIGNEE_ID LIKE '%${receiveCompanyId}%'
  734. </if>
  735. <if test="saleAreaRemark != null">
  736. and
  737. <foreach collection="saleAreaRemark" item="item" open="(" separator="or" close=")">
  738. ORI.SALE_AREA like '%${item}%'
  739. </foreach>
  740. </if>
  741. <if test="isExcludeZero != null and isExcludeZero == true">
  742. AND NVL(ORI.MATERIAL_NUMBER, 0) > 0
  743. </if>
  744. </where>
  745. ORDER BY RC.CONSIGNEE_COMPANY_NAME desc, ORI.SALE_AREA desc, RM.MATERIAL_NAME desc, RM.MATERIAL_SPECIFICATION
  746. </select>
  747. <!--以下条件删除 AND ORI.SINGLE_WEIGHT = #{singleWeight,jdbcType=DECIMAL}-->
  748. <select id="getInventoryId" resultType="java.math.BigDecimal" parameterType="java.util.Map">
  749. SELECT ORI.INVENTORY_ID FROM OYE_REALTIME_INVENTORY ORI
  750. WHERE ORI.CONSIGNEE_ID = #{consigneeId,jdbcType=DECIMAL}
  751. AND ORI.SALE_AREA = #{saleArea,jdbcType=VARCHAR}
  752. AND ORI.material_Id = #{materialId,jdbcType=DECIMAL}
  753. AND ORI.INBOUND_WAREHOUSE = #{inboundWarehouse,jdbcType=VARCHAR}
  754. <!-- <if test="meter != null">
  755. AND ORI.meter = #{meter,jdbcType=DECIMAL}
  756. </if> -->
  757. AND ORI.INBOUND_AREA = #{inboundArea,jdbcType=VARCHAR}
  758. fetch next 1 rows only
  759. </select>
  760. <select id="seleOtmsParams" resultType="java.util.Map">
  761. SELECT *
  762. from (
  763. SELECT
  764. -- 出厂时间
  765. to_char(OOR.INSERT_TIME, 'yyyy-mm-dd hh24:mi:ss') "resultOutGateTime",
  766. --出厂抓拍图片
  767. '无' "resultTruckSnapshotPicture",
  768. --出厂方式
  769. '厂外库房出库' "resultOutMode",
  770. --门岗名称
  771. '厂外库房' "gatepostName",
  772. -- 运输订单号
  773. OO.ORDER_NUMBER "orderNumber",
  774. -- 车牌号
  775. RC.CAPACITY_NUMBER "capacityNumber",
  776. -- 运输订单id
  777. OO.ORDER_ID "orderId",
  778. -- 订单类型
  779. OO.ORDER_TYPE "orderType",
  780. -- 销售订单号
  781. ASO.SALE_NUMBER "saleNum",
  782. -- 收货地址
  783. CONCAT(CONCAT(RRA.ADDRESS_PROVINCE, RRA.ADDRESS_DISTRICT), RRA.Address_Town) "receiveAddress",
  784. -- 收货单位
  785. RS.SUPPLIER_NAME "supplierName",
  786. -- 发货单位
  787. RS2.SHIPPER_NAME "shipperName"
  788. FROM
  789. -- 出厂实绩
  790. OYE_OUTBOUND_RESULT OOR
  791. -- 运输订单
  792. LEFT JOIN OMSTRUCK_ORDER OO ON OOR.ORDER_ID = OO.ORDER_ID
  793. -- 销售订单信息
  794. LEFT JOIN AMS_SALE_ORDER ASO ON OO.ORDER_PLAN_ID = ASO.SALE_ORDER_ID
  795. -- 托运人
  796. LEFT JOIN RMS_SUPPLIER RS ON ASO.SHIPPER_ID = RS.SUPPLIER_ID
  797. -- 运力信息
  798. LEFT JOIN RMS_CAPACITY RC ON OO.CAPACITY_ID = RC.CAPACITY_ID
  799. -- 销售订单中间表
  800. LEFT JOIN AMS_SALE_ORDER_MATERIAL ASOM ON ASOM.SALE_ORDER_MATERIAL_ID = OO.ORDER_PLAN_ID
  801. --收货地址
  802. left join RMS_RECEIVE_PLACE RRP on ASOM.SALE_SHIPPING_ADDRESS_ID = RRP.PLACE_ID
  803. left join RMS_RECEIVE_ADDRESS RRA on RRP.ADDRESS_ID = RRA.ADDRESS_ID
  804. -- 收货单位
  805. LEFT JOIN RMS_SHIPPER RS2 ON ASO.SHIPPER_ID = RS2.SHIPPER_ID
  806. WHERE
  807. OO.ORDER_TYPE = 1
  808. AND OO.ORDER_ID = #{orderId}
  809. FETCH NEXT 1 ROWS ONLY
  810. )
  811. </select>
  812. <select id="receiveSendReport" resultType="java.util.Map">
  813. SELECT
  814. TT."inboundWarehouse",
  815. TT."materialModel",
  816. TT."materialSpe",
  817. TT."materialName",
  818. TT."companyName",
  819. TT."saleArea",
  820. TT."meter",
  821. TT."singleWeight",
  822. SUM(TT."inboundMaterialNumber") "inboundMaterialNumber",
  823. SUM(TT."inboundMaterialWeight") "inboundMaterialWeight",
  824. SUM(TT."outboundMaterialNumber") "outboundMaterialNumber",
  825. SUM(TT."outboundMaterialWeight") "outboundMaterialWeight",
  826. SUM(TT."currentInboundMaterialNumber") "currentInboundMaterialNumber",
  827. SUM(TT."currentInboundTheoryWeight") "currentInboundTheoryWeight",
  828. SUM(TT."currentOutboundMaterialNumber") "currentOutboundMaterialNumber",
  829. SUM(TT."currentOutboundTheoryWeight") "currentOutboundTheoryWeight",
  830. SUM(TT."materialNumber") "materialNumber",
  831. SUM(TT."materialWeight") "materialWeight"
  832. FROM (
  833. SELECT
  834. NVL(T1."inboundMaterialNumber",0) "inboundMaterialNumber",
  835. NVL(T1."inboundMaterialWeight",0) "inboundMaterialWeight",
  836. NVL(T2."outboundMaterialNumber",0) "outboundMaterialNumber",
  837. NVL(T2."outboundMaterialWeight",0) "outboundMaterialWeight",
  838. ORI.INVENTORY_ID,
  839. ORI.SALE_AREA "saleArea",
  840. ORI.METER "meter",
  841. ORI.SINGLE_WEIGHT "singleWeight",
  842. RC.CONSIGNEE_COMPANY_NAME "companyName",
  843. RM.MATERIAL_NAME "materialName",
  844. RM.MATERIAL_SPECIFICATION "materialSpe",
  845. RM.MATERIAL_MODEL "materialModel",
  846. ORI.INBOUND_WAREHOUSE "inboundWarehouse",
  847. NVL(T3."currentInboundMaterialNumber",0) "currentInboundMaterialNumber",
  848. NVL(T3."currentInboundTheoryWeight",0) "currentInboundTheoryWeight",
  849. NVL(T4."currentOutboundMaterialNumber",0) "currentOutboundMaterialNumber",
  850. NVL(T4."currentOutboundTheoryWeight",0) "currentOutboundTheoryWeight",
  851. NVL(ORI.MATERIAL_NUMBER,0) "materialNumber",
  852. NVL(ORI.THEORY_WEIGHT,0) "materialWeight"
  853. FROM
  854. OYE_REALTIME_INVENTORY ORI
  855. LEFT JOIN
  856. (
  857. SELECT
  858. oir.INVENTORY_ID "INVENTORY_ID",
  859. NVL( SUM( OIR.MATERIAL_NUMBER ), 0 ) "inboundMaterialNumber",
  860. NVL( SUM( OIR.THEORY_WEIGHT ), 0 ) "inboundMaterialWeight"
  861. FROM
  862. OYE_REALTIME_INVENTORY ORI
  863. LEFT JOIN OYE_INBOUND_RESULT OIR ON OIR.INVENTORY_ID = ORI.INVENTORY_ID
  864. WHERE OIR.SALE_MATERIAL_ID IS NOT NULL
  865. GROUP BY
  866. oir.INVENTORY_ID
  867. ) T1 ON T1.INVENTORY_ID = ORI.INVENTORY_ID
  868. LEFT JOIN (
  869. SELECT
  870. oor.INVENTORY_ID "INVENTORY_ID",
  871. NVL( SUM( OOR.MATERIAL_NUMBER ), 0 ) "outboundMaterialNumber",
  872. NVL( SUM( OOR.THEORY_WEIGHT ), 0 ) "outboundMaterialWeight"
  873. FROM
  874. OYE_REALTIME_INVENTORY ORI
  875. LEFT JOIN OYE_OutBOUND_RESULT OOR ON OOR.INVENTORY_ID = ORI.INVENTORY_ID
  876. WHERE OOR.SALE_MATERIAL_ID IS NOT NULL
  877. GROUP BY
  878. oor.INVENTORY_ID
  879. ) T2 ON T2.INVENTORY_ID = ORI.INVENTORY_ID
  880. LEFT JOIN (
  881. SELECT
  882. OIR.INVENTORY_ID "INVENTORY_ID",
  883. NVL( sum( OIR.MATERIAL_NUMBER ), 0 ) "currentInboundMaterialNumber",
  884. NVL( SUM( OIR.THEORY_WEIGHT ), 0 ) "currentInboundTheoryWeight"
  885. FROM
  886. OYE_INBOUND_RESULT OIR
  887. WHERE
  888. OIR.SALE_MATERIAL_ID IS NOT NULL
  889. <if test="oneDate != null">
  890. AND to_date(#{oneDate}, 'yyyy-mm-dd hh24:mi:ss') &lt; = OIR.INSERT_TIME
  891. </if>
  892. <if test="startDate != null">
  893. AND to_date(#{startDate}, 'yyyy-mm-dd hh24:mi:ss') &lt;= OIR.INSERT_TIME
  894. and to_date(#{endDate}, 'yyyy-mm-dd hh24:mi:ss') >= OIR.INSERT_TIME
  895. </if>
  896. GROUP BY
  897. OIR.INVENTORY_ID
  898. ) T3 ON T3."INVENTORY_ID" = ORI."INVENTORY_ID"
  899. LEFT JOIN (
  900. SELECT
  901. OOR.INVENTORY_ID "INVENTORY_ID",
  902. NVL( SUM( OOR.MATERIAL_NUMBER ), 0 ) "currentOutboundMaterialNumber",
  903. NVL( SUM( OOR.THEORY_WEIGHT ), 0 ) "currentOutboundTheoryWeight"
  904. FROM
  905. OYE_OUTBOUND_RESULT OOR
  906. WHERE
  907. OOR.SALE_MATERIAL_ID IS NOT NULL
  908. <if test="oneDate != null">
  909. AND to_date(#{oneDate}, 'yyyy-mm-dd hh24:mi:ss') &lt; = OOR.INSERT_TIME
  910. </if>
  911. <if test="startDate != null">
  912. and to_date(#{startDate}, 'yyyy-mm-dd hh24:mi:ss') &lt;= OOR.INSERT_TIME
  913. and to_date(#{endDate}, 'yyyy-mm-dd hh24:mi:ss') >= OOR.INSERT_TIME
  914. </if>
  915. GROUP BY
  916. OOR.INVENTORY_ID
  917. ) T4 ON T4."INVENTORY_ID" = ORI."INVENTORY_ID"
  918. LEFT JOIN RMS_CONSIGNEE RC ON RC.CONSIGNEE_ID = ORI.CONSIGNEE_ID
  919. LEFT JOIN RMS_MATERIAL RM ON RM.MATERIAL_ID = ORI.MATERIAL_ID
  920. <where>
  921. <if test="companyName != null and companyName != ''">
  922. AND RC.CONSIGNEE_COMPANY_NAME LIKE '%${companyName}%'
  923. </if>
  924. <if test="saleArea != null and saleArea != ''">
  925. AND ORI.SALE_AREA LIKE '%${saleArea}%'
  926. </if>
  927. <if test="inboundWarehouse != null and inboundWarehouse != ''">
  928. AND ORI.INBOUND_WAREHOUSE LIKE '%${inboundWarehouse}%'
  929. </if>
  930. <if test="inboundAreaSide != null and inboundAreaSide != ''">
  931. AND ORI.INBOUND_AREA = #{inboundAreaSide}
  932. </if>
  933. <if test="materialName != null and materialName != ''">
  934. AND RM.MATERIAL_NAME LIKE '%${materialName}%'
  935. </if>
  936. <if test="materialSpe != null and materialSpe != ''">
  937. AND RM.MATERIAL_SPECIFICATION LIKE '%${materialSpe}%'
  938. </if>
  939. <if test="materialModel != null and materialModel != ''">
  940. AND RM.MATERIAL_MODEL LIKE '%${materialModel}%'
  941. </if>
  942. <if test="saleAreaRemark != null">
  943. and
  944. <foreach collection="saleAreaRemark" item="item" open="(" separator="or" close=")">
  945. ORI.SALE_AREA like '%${item}%'
  946. </foreach>
  947. </if>
  948. </where>
  949. ) TT
  950. GROUP BY TT."inboundWarehouse",
  951. TT."materialModel",
  952. TT."materialSpe",
  953. TT."materialName",
  954. TT."companyName",
  955. TT."saleArea",
  956. TT."meter",
  957. TT."singleWeight"
  958. ORDER BY TT."companyName" DESC,TT."inboundWarehouse" DESC,TT."saleArea" DESC
  959. </select>
  960. <select id="getSaleAreaRemark" resultType="java.lang.String">
  961. SELECT RSR.SALE_REMARK FROM RMS_SALER_REMAR RSR
  962. WHERE RSR.SALER_NAME = #{saler}
  963. </select>
  964. <select id="getTheoryWeight" resultType="java.math.BigDecimal" parameterType="java.math.BigDecimal">
  965. SELECT
  966. ASM.MATERIAL_WEIGHT
  967. FROM AMS_SALE_MATERIAL ASM
  968. LEFT JOIN TMSTRUCK_WEIGHT_BATCH TWB
  969. ON TWB.WEIGHT_BATCH_ID = ASM.WEIGHT_BATCH_ID
  970. WHERE ASM.SALE_MATERIAL_ID = #{saleMaterialId}
  971. </select>
  972. <select id="getSingleWeight" resultType="java.math.BigDecimal">
  973. SELECT ORI.SINGLE_WEIGHT FROM OYE_REALTIME_INVENTORY ORI
  974. WHERE ORI.INVENTORY_ID = #{inventoryId}
  975. </select>
  976. <select id="selectCompareValue" resultType="java.lang.String">
  977. SELECT VERSION_VALUE FROM DIL_VERSION
  978. WHERE VERSION_ID = 16
  979. </select>
  980. <select id="getInventoryIds" resultType="java.math.BigDecimal">
  981. select ori.INVENTORY_ID from OYE_REALTIME_INVENTORY ori
  982. left join RMS_MATERIAL rm
  983. on rm.MATERIAL_ID = ori.MATERIAL_ID
  984. where rm.MATERIAL_NAME like '%盘螺%'
  985. and ori.MATERIAL_NUMBER > 0
  986. </select>
  987. <select id="getSingleWeightByOIR" resultType="java.math.BigDecimal">
  988. SELECT OIR.SINGLE_WEIGHT FROM OYE_INBOUND_RESULT OIR
  989. WHERE OIR.INVENTORY_ID = #{inventoryId}
  990. </select>
  991. <select id="getRealTimeGroupBy" resultType="java.util.Map" parameterType="java.util.Map">
  992. SELECT
  993. COUNT( * ) "num",
  994. ORI.CONSIGNEE_ID "consigneeId",
  995. ORI.SALE_AREA "saleArea",
  996. ORI.INBOUND_WAREHOUSE "inboundWarehouse",
  997. ORI.MATERIAL_ID "materialId",
  998. ORI.METER "meter",
  999. ORI.SINGLE_WEIGHT "singleWeight"
  1000. FROM
  1001. OYE_REALTIME_INVENTORY ORI
  1002. LEFT JOIN RMS_CONSIGNEE RC ON RC.CONSIGNEE_ID = ORI.CONSIGNEE_ID
  1003. WHERE RC.CONSIGNEE_COMPANY_NAME LIKE '%${consigneeName}%'
  1004. AND ORI.SALE_AREA LIKE '%${saleArea}%'
  1005. and ori.MATERIAL_NUMBER > 0
  1006. GROUP BY
  1007. ORI.CONSIGNEE_ID,
  1008. ORI.SALE_AREA,
  1009. ORI.INBOUND_WAREHOUSE,
  1010. ORI.MATERIAL_ID,
  1011. ORI.METER,
  1012. ORI.SINGLE_WEIGHT
  1013. </select>
  1014. <select id="getInventoryInfo" resultType="java.util.Map">
  1015. SELECT ORI.INVENTORY_ID "inventoryId",
  1016. ORI.THEORY_WEIGHT "theoryWeight",
  1017. ORI.NET_WEIGHT "netWeight",
  1018. ORI.MATERIAL_NUMBER "materialNumber",
  1019. ORI.SINGLE_WEIGHT "singleWeight",
  1020. ORI.METER "meter",
  1021. ORI.INBOUND_WAREHOUSE "inboundWarehouse",
  1022. ORI.INBOUND_AREA "inboundArea",
  1023. ORI.SALE_AREA "saleArea",
  1024. ORI.MATERIAL_ID "materialId"
  1025. FROM OYE_REALTIME_INVENTORY ORI
  1026. WHERE ORI.CONSIGNEE_ID = #{consigneeId,jdbcType=DECIMAL}
  1027. AND ORI.SINGLE_WEIGHT = #{singleWeight,jdbcType=DECIMAL}
  1028. AND ORI.SALE_AREA = #{saleArea,jdbcType=VARCHAR}
  1029. AND ORI.material_Id = #{materialId,jdbcType=DECIMAL}
  1030. AND ORI.INBOUND_WAREHOUSE = #{inboundWarehouse,jdbcType=VARCHAR}
  1031. <if test="meter != null">
  1032. AND ORI.meter = #{meter,jdbcType=DECIMAL}
  1033. </if>
  1034. AND ORI.INBOUND_AREA = '欧冶库'
  1035. </select>
  1036. <select id="getUnReceiveOrder" resultType="java.math.BigDecimal" parameterType="decimal">
  1037. SELECT OO.ORDER_ID FROM OMSTRUCK_ORDER OO
  1038. LEFT JOIN AMS_SALE_ORDER_MATERIAL ASOM
  1039. ON ASOM.SALE_ORDER_MATERIAL_ID = OO.ORDER_PLAN_ID
  1040. LEFT JOIN AMS_SALE_ORDER ASO
  1041. ON ASO.SALE_ORDER_ID = ASOM.SALE_ORDER_ID
  1042. WHERE ASO.SALE_TYPE = 50
  1043. AND OO.ORDER_TYPE = 1
  1044. AND OO.ORDER_STATUS = 4
  1045. AND OO.CAPACITY_ID = (SELECT CAPACITY_ID FROM OMSTRUCK_ORDER WHERE ORDER_ID = #{orderId})
  1046. </select>
  1047. <update id="closeOrder">
  1048. UPDATE OMSTRUCK_ORDER OO
  1049. SET OO.ORDER_STATUS = 2,
  1050. OO.INSERT_UPDATE_REMARK = '出库关闭运单'
  1051. where oo.ORDER_ID = #{orderId}
  1052. </update>
  1053. </mapper>