WmspInventoryCloseMapper.xml 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548
  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.WmspInventoryCloseMapper">
  4. <resultMap id="BaseResultMap" type="com.steerinfo.dil.model.WmspInventoryClose">
  5. <id column="CLOSE_ID" jdbcType="DECIMAL" property="closeId" />
  6. <result column="CLOSE_PERIOD" jdbcType="VARCHAR" property="closePeriod" />
  7. <result column="MATERIAL_ID" jdbcType="DECIMAL" property="materialId" />
  8. <result column="WAREHOUSE_ID" jdbcType="DECIMAL" property="warehouseId" />
  9. <result column="CLOSE_LASTMONTH_INVENTORY" jdbcType="DECIMAL" property="closeLastmonthInventory" />
  10. <result column="CLOSE_THISMONTH_INBOUND" jdbcType="DECIMAL" property="closeThismonthInbound" />
  11. <result column="CLOSE_THISMONTH_OUTBOUND" jdbcType="DECIMAL" property="closeThismonthOutbound" />
  12. <result column="CLOSE_THISMONTH_INVENTORY" jdbcType="DECIMAL" property="closeThismonthInventory" />
  13. <result column="INSERT_USERNAME" jdbcType="VARCHAR" property="insertUsername" />
  14. <result column="INSERT_TIME" jdbcType="TIMESTAMP" property="insertTime" />
  15. <result column="UPDATE_USERNAME" jdbcType="VARCHAR" property="updateUsername" />
  16. <result column="UPDATE_TIME" jdbcType="TIMESTAMP" property="updateTime" />
  17. <result column="INSERT_UPDATE_REMARK" jdbcType="VARCHAR" property="insertUpdateRemark" />
  18. <result column="DELETED" jdbcType="DECIMAL" property="deleted" />
  19. </resultMap>
  20. <sql id="columns">
  21. CLOSE_ID, CLOSE_PERIOD, MATERIAL_ID, WAREHOUSE_ID, CLOSE_LASTMONTH_INVENTORY, CLOSE_THISMONTH_INBOUND,
  22. CLOSE_THISMONTH_OUTBOUND, CLOSE_THISMONTH_INVENTORY, INSERT_USERNAME, INSERT_TIME,
  23. UPDATE_USERNAME, UPDATE_TIME, INSERT_UPDATE_REMARK, DELETED
  24. </sql>
  25. <sql id="columns_alias">
  26. t.CLOSE_ID, t.CLOSE_PERIOD, t.MATERIAL_ID, t.WAREHOUSE_ID, t.CLOSE_LASTMONTH_INVENTORY,
  27. t.CLOSE_THISMONTH_INBOUND, t.CLOSE_THISMONTH_OUTBOUND, t.CLOSE_THISMONTH_INVENTORY,
  28. t.INSERT_USERNAME, t.INSERT_TIME, t.UPDATE_USERNAME, t.UPDATE_TIME, t.INSERT_UPDATE_REMARK,
  29. t.DELETED
  30. </sql>
  31. <sql id="select">
  32. SELECT <include refid="columns"/> FROM WMSP_INVENTORY_CLOSE
  33. </sql>
  34. <sql id="select_alias">
  35. SELECT <include refid="columns_alias"/> FROM WMSP_INVENTORY_CLOSE t
  36. </sql>
  37. <sql id="where">
  38. <where>
  39. <if test="closeId != null">
  40. and CLOSE_ID = #{closeId}
  41. </if>
  42. <if test="closePeriod != null and closePeriod != ''">
  43. and CLOSE_PERIOD = #{closePeriod}
  44. </if>
  45. <if test="materialId != null">
  46. and MATERIAL_ID = #{materialId}
  47. </if>
  48. <if test="warehouseId != null">
  49. and WAREHOUSE_ID = #{warehouseId}
  50. </if>
  51. <if test="closeLastmonthInventory != null">
  52. and CLOSE_LASTMONTH_INVENTORY = #{closeLastmonthInventory}
  53. </if>
  54. <if test="closeThismonthInbound != null">
  55. and CLOSE_THISMONTH_INBOUND = #{closeThismonthInbound}
  56. </if>
  57. <if test="closeThismonthOutbound != null">
  58. and CLOSE_THISMONTH_OUTBOUND = #{closeThismonthOutbound}
  59. </if>
  60. <if test="closeThismonthInventory != null">
  61. and CLOSE_THISMONTH_INVENTORY = #{closeThismonthInventory}
  62. </if>
  63. <if test="insertUsername != null and insertUsername != ''">
  64. and INSERT_USERNAME = #{insertUsername}
  65. </if>
  66. <if test="insertTime != null">
  67. and TO_CHAR(INSERT_TIME,'yyyy-MM-dd') = #{insertTime}
  68. </if>
  69. <if test="updateUsername != null and updateUsername != ''">
  70. and UPDATE_USERNAME = #{updateUsername}
  71. </if>
  72. <if test="updateTime != null">
  73. and TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = #{updateTime}
  74. </if>
  75. <if test="insertUpdateRemark != null and insertUpdateRemark != ''">
  76. and INSERT_UPDATE_REMARK = #{insertUpdateRemark}
  77. </if>
  78. <if test="deleted != null">
  79. and DELETED = #{deleted}
  80. </if>
  81. </where>
  82. </sql>
  83. <sql id="whereLike">
  84. <where>
  85. <if test="closeId != null">
  86. and CLOSE_ID = #{closeId}
  87. </if>
  88. <if test="closePeriod != null and closePeriod != ''">
  89. and CLOSE_PERIOD LIKE '%${closePeriod}%'
  90. </if>
  91. <if test="materialId != null">
  92. and MATERIAL_ID = #{materialId}
  93. </if>
  94. <if test="warehouseId != null">
  95. and WAREHOUSE_ID = #{warehouseId}
  96. </if>
  97. <if test="closeLastmonthInventory != null">
  98. and CLOSE_LASTMONTH_INVENTORY = #{closeLastmonthInventory}
  99. </if>
  100. <if test="closeThismonthInbound != null">
  101. and CLOSE_THISMONTH_INBOUND = #{closeThismonthInbound}
  102. </if>
  103. <if test="closeThismonthOutbound != null">
  104. and CLOSE_THISMONTH_OUTBOUND = #{closeThismonthOutbound}
  105. </if>
  106. <if test="closeThismonthInventory != null">
  107. and CLOSE_THISMONTH_INVENTORY = #{closeThismonthInventory}
  108. </if>
  109. <if test="insertUsername != null and insertUsername != ''">
  110. and INSERT_USERNAME LIKE '%${insertUsername}%'
  111. </if>
  112. <if test="insertTime != null">
  113. and TO_CHAR(INSERT_TIME,'yyyy-MM-dd') = #{insertTime}
  114. </if>
  115. <if test="updateUsername != null and updateUsername != ''">
  116. and UPDATE_USERNAME LIKE '%${updateUsername}%'
  117. </if>
  118. <if test="updateTime != null">
  119. and TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = #{updateTime}
  120. </if>
  121. <if test="insertUpdateRemark != null and insertUpdateRemark != ''">
  122. and INSERT_UPDATE_REMARK LIKE '%${insertUpdateRemark}%'
  123. </if>
  124. <if test="deleted != null">
  125. and DELETED = #{deleted}
  126. </if>
  127. </where>
  128. </sql>
  129. <delete id="deleteByPrimaryKey" parameterType="java.math.BigDecimal">
  130. delete from WMSP_INVENTORY_CLOSE
  131. where CLOSE_ID = #{closeId,jdbcType=DECIMAL}
  132. </delete>
  133. <delete id="deleteBySelectiveElement" parameterType="java.util.HashMap">
  134. delete from WMSP_INVENTORY_CLOSE
  135. where 1!=1
  136. <if test="closePeriod != null and closePeriod != ''">
  137. or CLOSE_PERIOD = #{closePeriod}
  138. </if>
  139. <if test="materialId != null">
  140. or MATERIAL_ID = #{materialId}
  141. </if>
  142. <if test="warehouseId != null">
  143. or WAREHOUSE_ID = #{warehouseId}
  144. </if>
  145. <if test="closeLastmonthInventory != null">
  146. or CLOSE_LASTMONTH_INVENTORY = #{closeLastmonthInventory}
  147. </if>
  148. <if test="closeThismonthInbound != null">
  149. or CLOSE_THISMONTH_INBOUND = #{closeThismonthInbound}
  150. </if>
  151. <if test="closeThismonthOutbound != null">
  152. or CLOSE_THISMONTH_OUTBOUND = #{closeThismonthOutbound}
  153. </if>
  154. <if test="closeThismonthInventory != null">
  155. or CLOSE_THISMONTH_INVENTORY = #{closeThismonthInventory}
  156. </if>
  157. <if test="insertUsername != null and insertUsername != ''">
  158. or INSERT_USERNAME = #{insertUsername}
  159. </if>
  160. <if test="insertTime != null">
  161. or TO_CHAR(INSERT_TIME,'yyyy-MM-dd') = '#{insertTime}'
  162. </if>
  163. <if test="updateUsername != null and updateUsername != ''">
  164. or UPDATE_USERNAME = #{updateUsername}
  165. </if>
  166. <if test="updateTime != null">
  167. or TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = '#{updateTime}'
  168. </if>
  169. <if test="insertUpdateRemark != null and insertUpdateRemark != ''">
  170. or INSERT_UPDATE_REMARK = #{insertUpdateRemark}
  171. </if>
  172. <if test="deleted != null">
  173. or DELETED = #{deleted}
  174. </if>
  175. </delete>
  176. <insert id="insert" parameterType="com.steerinfo.dil.model.WmspInventoryClose">
  177. insert into WMSP_INVENTORY_CLOSE (CLOSE_ID, CLOSE_PERIOD, MATERIAL_ID,
  178. WAREHOUSE_ID, CLOSE_LASTMONTH_INVENTORY, CLOSE_THISMONTH_INBOUND,
  179. CLOSE_THISMONTH_OUTBOUND, CLOSE_THISMONTH_INVENTORY,
  180. INSERT_USERNAME, INSERT_TIME, UPDATE_USERNAME,
  181. UPDATE_TIME, INSERT_UPDATE_REMARK, DELETED
  182. )
  183. values (#{closeId,jdbcType=DECIMAL}, #{closePeriod,jdbcType=VARCHAR}, #{materialId,jdbcType=DECIMAL},
  184. #{warehouseId,jdbcType=DECIMAL}, #{closeLastmonthInventory,jdbcType=DECIMAL}, #{closeThismonthInbound,jdbcType=DECIMAL},
  185. #{closeThismonthOutbound,jdbcType=DECIMAL}, #{closeThismonthInventory,jdbcType=DECIMAL},
  186. #{insertUsername,jdbcType=VARCHAR}, #{insertTime,jdbcType=TIMESTAMP}, #{updateUsername,jdbcType=VARCHAR},
  187. #{updateTime,jdbcType=TIMESTAMP}, #{insertUpdateRemark,jdbcType=VARCHAR}, #{deleted,jdbcType=DECIMAL}
  188. )
  189. </insert>
  190. <insert id="insertSelective" parameterType="com.steerinfo.dil.model.WmspInventoryClose">
  191. insert into WMSP_INVENTORY_CLOSE
  192. <trim prefix="(" suffix=")" suffixOverrides=",">
  193. <if test="closeId != null">
  194. CLOSE_ID,
  195. </if>
  196. <if test="closePeriod != null">
  197. CLOSE_PERIOD,
  198. </if>
  199. <if test="materialId != null">
  200. MATERIAL_ID,
  201. </if>
  202. <if test="warehouseId != null">
  203. WAREHOUSE_ID,
  204. </if>
  205. <if test="closeLastmonthInventory != null">
  206. CLOSE_LASTMONTH_INVENTORY,
  207. </if>
  208. <if test="closeThismonthInbound != null">
  209. CLOSE_THISMONTH_INBOUND,
  210. </if>
  211. <if test="closeThismonthOutbound != null">
  212. CLOSE_THISMONTH_OUTBOUND,
  213. </if>
  214. <if test="closeThismonthInventory != null">
  215. CLOSE_THISMONTH_INVENTORY,
  216. </if>
  217. <if test="insertUsername != null">
  218. INSERT_USERNAME,
  219. </if>
  220. <if test="insertTime != null">
  221. INSERT_TIME,
  222. </if>
  223. <if test="updateUsername != null">
  224. UPDATE_USERNAME,
  225. </if>
  226. <if test="updateTime != null">
  227. UPDATE_TIME,
  228. </if>
  229. <if test="insertUpdateRemark != null">
  230. INSERT_UPDATE_REMARK,
  231. </if>
  232. <if test="deleted != null">
  233. DELETED,
  234. </if>
  235. </trim>
  236. <trim prefix="values (" suffix=")" suffixOverrides=",">
  237. <if test="closeId != null">
  238. #{closeId,jdbcType=DECIMAL},
  239. </if>
  240. <if test="closePeriod != null">
  241. #{closePeriod,jdbcType=VARCHAR},
  242. </if>
  243. <if test="materialId != null">
  244. #{materialId,jdbcType=DECIMAL},
  245. </if>
  246. <if test="warehouseId != null">
  247. #{warehouseId,jdbcType=DECIMAL},
  248. </if>
  249. <if test="closeLastmonthInventory != null">
  250. #{closeLastmonthInventory,jdbcType=DECIMAL},
  251. </if>
  252. <if test="closeThismonthInbound != null">
  253. #{closeThismonthInbound,jdbcType=DECIMAL},
  254. </if>
  255. <if test="closeThismonthOutbound != null">
  256. #{closeThismonthOutbound,jdbcType=DECIMAL},
  257. </if>
  258. <if test="closeThismonthInventory != null">
  259. #{closeThismonthInventory,jdbcType=DECIMAL},
  260. </if>
  261. <if test="insertUsername != null">
  262. #{insertUsername,jdbcType=VARCHAR},
  263. </if>
  264. <if test="insertTime != null">
  265. #{insertTime,jdbcType=TIMESTAMP},
  266. </if>
  267. <if test="updateUsername != null">
  268. #{updateUsername,jdbcType=VARCHAR},
  269. </if>
  270. <if test="updateTime != null">
  271. #{updateTime,jdbcType=TIMESTAMP},
  272. </if>
  273. <if test="insertUpdateRemark != null">
  274. #{insertUpdateRemark,jdbcType=VARCHAR},
  275. </if>
  276. <if test="deleted != null">
  277. #{deleted,jdbcType=DECIMAL},
  278. </if>
  279. </trim>
  280. </insert>
  281. <update id="updateByPrimaryKey" parameterType="com.steerinfo.dil.model.WmspInventoryClose">
  282. update WMSP_INVENTORY_CLOSE
  283. set CLOSE_PERIOD = #{closePeriod,jdbcType=VARCHAR},
  284. MATERIAL_ID = #{materialId,jdbcType=DECIMAL},
  285. WAREHOUSE_ID = #{warehouseId,jdbcType=DECIMAL},
  286. CLOSE_LASTMONTH_INVENTORY = #{closeLastmonthInventory,jdbcType=DECIMAL},
  287. CLOSE_THISMONTH_INBOUND = #{closeThismonthInbound,jdbcType=DECIMAL},
  288. CLOSE_THISMONTH_OUTBOUND = #{closeThismonthOutbound,jdbcType=DECIMAL},
  289. CLOSE_THISMONTH_INVENTORY = #{closeThismonthInventory,jdbcType=DECIMAL},
  290. INSERT_USERNAME = #{insertUsername,jdbcType=VARCHAR},
  291. INSERT_TIME = #{insertTime,jdbcType=TIMESTAMP},
  292. UPDATE_USERNAME = #{updateUsername,jdbcType=VARCHAR},
  293. UPDATE_TIME = #{updateTime,jdbcType=TIMESTAMP},
  294. INSERT_UPDATE_REMARK = #{insertUpdateRemark,jdbcType=VARCHAR},
  295. DELETED = #{deleted,jdbcType=DECIMAL}
  296. where CLOSE_ID = #{closeId,jdbcType=DECIMAL}
  297. </update>
  298. <update id="updateByPrimaryKeySelective" parameterType="com.steerinfo.dil.model.WmspInventoryClose">
  299. update WMSP_INVENTORY_CLOSE
  300. <set>
  301. <if test="closePeriod != null">
  302. CLOSE_PERIOD = #{closePeriod,jdbcType=VARCHAR},
  303. </if>
  304. <if test="materialId != null">
  305. MATERIAL_ID = #{materialId,jdbcType=DECIMAL},
  306. </if>
  307. <if test="warehouseId != null">
  308. WAREHOUSE_ID = #{warehouseId,jdbcType=DECIMAL},
  309. </if>
  310. <if test="closeLastmonthInventory != null">
  311. CLOSE_LASTMONTH_INVENTORY = #{closeLastmonthInventory,jdbcType=DECIMAL},
  312. </if>
  313. <if test="closeThismonthInbound != null">
  314. CLOSE_THISMONTH_INBOUND = #{closeThismonthInbound,jdbcType=DECIMAL},
  315. </if>
  316. <if test="closeThismonthOutbound != null">
  317. CLOSE_THISMONTH_OUTBOUND = #{closeThismonthOutbound,jdbcType=DECIMAL},
  318. </if>
  319. <if test="closeThismonthInventory != null">
  320. CLOSE_THISMONTH_INVENTORY = #{closeThismonthInventory,jdbcType=DECIMAL},
  321. </if>
  322. <if test="insertUsername != null">
  323. INSERT_USERNAME = #{insertUsername,jdbcType=VARCHAR},
  324. </if>
  325. <if test="insertTime != null">
  326. INSERT_TIME = #{insertTime,jdbcType=TIMESTAMP},
  327. </if>
  328. <if test="updateUsername != null">
  329. UPDATE_USERNAME = #{updateUsername,jdbcType=VARCHAR},
  330. </if>
  331. <if test="updateTime != null">
  332. UPDATE_TIME = #{updateTime,jdbcType=TIMESTAMP},
  333. </if>
  334. <if test="insertUpdateRemark != null">
  335. INSERT_UPDATE_REMARK = #{insertUpdateRemark,jdbcType=VARCHAR},
  336. </if>
  337. <if test="deleted != null">
  338. DELETED = #{deleted,jdbcType=DECIMAL},
  339. </if>
  340. </set>
  341. where CLOSE_ID = #{closeId,jdbcType=DECIMAL}
  342. </update>
  343. <select id="selectByPrimaryKey" parameterType="java.math.BigDecimal" resultMap="BaseResultMap">
  344. <include refid="select"/>
  345. where CLOSE_ID = #{closeId,jdbcType=DECIMAL}
  346. </select>
  347. <select id="selectByParameters" parameterType="java.util.HashMap" resultMap="BaseResultMap">
  348. <include refid="select"/>
  349. <include refid="where"/>
  350. </select>
  351. <select id="selectLikeByParameters" parameterType="java.util.HashMap" resultMap="BaseResultMap">
  352. <include refid="select"/>
  353. <include refid="whereLike"/>
  354. </select>
  355. <insert id="batchInsert" parameterType="java.util.List">
  356. insert into WMSP_INVENTORY_CLOSE
  357. (CLOSE_ID,
  358. CLOSE_PERIOD, MATERIAL_ID, WAREHOUSE_ID,
  359. CLOSE_LASTMONTH_INVENTORY, CLOSE_THISMONTH_INBOUND,
  360. CLOSE_THISMONTH_OUTBOUND, CLOSE_THISMONTH_INVENTORY,
  361. INSERT_USERNAME, INSERT_TIME,
  362. UPDATE_USERNAME, UPDATE_TIME,
  363. INSERT_UPDATE_REMARK, DELETED)
  364. ( <foreach collection="list" item="item" separator="union all">
  365. select
  366. #{item.closeId,jdbcType=DECIMAL},
  367. #{item.closePeriod,jdbcType=VARCHAR}, #{item.materialId,jdbcType=DECIMAL}, #{item.warehouseId,jdbcType=DECIMAL},
  368. #{item.closeLastmonthInventory,jdbcType=DECIMAL}, #{item.closeThismonthInbound,jdbcType=DECIMAL},
  369. #{item.closeThismonthOutbound,jdbcType=DECIMAL}, #{item.closeThismonthInventory,jdbcType=DECIMAL},
  370. #{item.insertUsername,jdbcType=VARCHAR}, #{item.insertTime,jdbcType=TIMESTAMP},
  371. #{item.updateUsername,jdbcType=VARCHAR}, #{item.updateTime,jdbcType=TIMESTAMP},
  372. #{item.insertUpdateRemark,jdbcType=VARCHAR}, #{item.deleted,jdbcType=DECIMAL} from dual
  373. </foreach> )
  374. </insert>
  375. <update id="batchUpdate" parameterType="java.util.List">
  376. update WMSP_INVENTORY_CLOSE
  377. set
  378. CLOSE_ID=
  379. <foreach collection="list" item="item" index="index" separator=" " open="case CLOSE_ID" close="end">
  380. when #{item.closeId,jdbcType=DECIMAL} then #{item.closeId,jdbcType=DECIMAL}
  381. </foreach>
  382. ,CLOSE_PERIOD=
  383. <foreach collection="list" item="item" index="index" separator=" " open="case CLOSE_ID" close="end">
  384. when #{item.closeId,jdbcType=DECIMAL} then #{item.closePeriod,jdbcType=VARCHAR}
  385. </foreach>
  386. ,MATERIAL_ID=
  387. <foreach collection="list" item="item" index="index" separator=" " open="case CLOSE_ID" close="end">
  388. when #{item.closeId,jdbcType=DECIMAL} then #{item.materialId,jdbcType=DECIMAL}
  389. </foreach>
  390. ,WAREHOUSE_ID=
  391. <foreach collection="list" item="item" index="index" separator=" " open="case CLOSE_ID" close="end">
  392. when #{item.closeId,jdbcType=DECIMAL} then #{item.warehouseId,jdbcType=DECIMAL}
  393. </foreach>
  394. ,CLOSE_LASTMONTH_INVENTORY=
  395. <foreach collection="list" item="item" index="index" separator=" " open="case CLOSE_ID" close="end">
  396. when #{item.closeId,jdbcType=DECIMAL} then #{item.closeLastmonthInventory,jdbcType=DECIMAL}
  397. </foreach>
  398. ,CLOSE_THISMONTH_INBOUND=
  399. <foreach collection="list" item="item" index="index" separator=" " open="case CLOSE_ID" close="end">
  400. when #{item.closeId,jdbcType=DECIMAL} then #{item.closeThismonthInbound,jdbcType=DECIMAL}
  401. </foreach>
  402. ,CLOSE_THISMONTH_OUTBOUND=
  403. <foreach collection="list" item="item" index="index" separator=" " open="case CLOSE_ID" close="end">
  404. when #{item.closeId,jdbcType=DECIMAL} then #{item.closeThismonthOutbound,jdbcType=DECIMAL}
  405. </foreach>
  406. ,CLOSE_THISMONTH_INVENTORY=
  407. <foreach collection="list" item="item" index="index" separator=" " open="case CLOSE_ID" close="end">
  408. when #{item.closeId,jdbcType=DECIMAL} then #{item.closeThismonthInventory,jdbcType=DECIMAL}
  409. </foreach>
  410. ,INSERT_USERNAME=
  411. <foreach collection="list" item="item" index="index" separator=" " open="case CLOSE_ID" close="end">
  412. when #{item.closeId,jdbcType=DECIMAL} then #{item.insertUsername,jdbcType=VARCHAR}
  413. </foreach>
  414. ,INSERT_TIME=
  415. <foreach collection="list" item="item" index="index" separator=" " open="case CLOSE_ID" close="end">
  416. when #{item.closeId,jdbcType=DECIMAL} then #{item.insertTime,jdbcType=TIMESTAMP}
  417. </foreach>
  418. ,UPDATE_USERNAME=
  419. <foreach collection="list" item="item" index="index" separator=" " open="case CLOSE_ID" close="end">
  420. when #{item.closeId,jdbcType=DECIMAL} then #{item.updateUsername,jdbcType=VARCHAR}
  421. </foreach>
  422. ,UPDATE_TIME=
  423. <foreach collection="list" item="item" index="index" separator=" " open="case CLOSE_ID" close="end">
  424. when #{item.closeId,jdbcType=DECIMAL} then #{item.updateTime,jdbcType=TIMESTAMP}
  425. </foreach>
  426. ,INSERT_UPDATE_REMARK=
  427. <foreach collection="list" item="item" index="index" separator=" " open="case CLOSE_ID" close="end">
  428. when #{item.closeId,jdbcType=DECIMAL} then #{item.insertUpdateRemark,jdbcType=VARCHAR}
  429. </foreach>
  430. ,DELETED=
  431. <foreach collection="list" item="item" index="index" separator=" " open="case CLOSE_ID" close="end">
  432. when #{item.closeId,jdbcType=DECIMAL} then #{item.deleted,jdbcType=DECIMAL}
  433. </foreach>
  434. where CLOSE_ID in
  435. <foreach collection="list" index="index" item="item" separator="," open="(" close=")">
  436. #{item.closeId,jdbcType=DECIMAL}
  437. </foreach>
  438. </update>
  439. <delete id="batchDelete" parameterType="java.util.List">
  440. delete from WMSP_INVENTORY_CLOSE
  441. where CLOSE_ID in
  442. <foreach collection="list" item="id" open="(" close=")" separator=",">
  443. #{id}
  444. </foreach>
  445. </delete>
  446. <!-- 友情提示!!!-->
  447. <!-- 请将自己写的代码放在此标签之下,方便以后粘贴复制。-->
  448. <select id="selectWmspInventoryClose" resultType="java.util.LinkedHashMap">
  449. select * from (
  450. select
  451. rw.warehouse_name "warehouse_name",
  452. rm.MATERIAL_NAME || rm.MATERIAL_SPECIFICATION || '(' ||
  453. rm.MATERIAL_MODEL || ')' "material_name",
  454. wpic.close_lastmonth_inventory "close_lastmonth_inventory",
  455. wpic.close_thismonth_inbound "close_thismonth_inbound",
  456. wpic.close_thismonth_outbound "close_thismonth_outbound",
  457. wpic.close_thismonth_inventory "close_thismonth_inventory"
  458. from
  459. wmsp_inventory_close wpic
  460. join rms_material rm
  461. on rm.material_id=wpic.material_id
  462. join rms_warehouse rw
  463. on rw.warehouse_id=wpic.warehouse_id
  464. where #{value}= to_char(wpic.INSERT_TIME,'yyyy-mm')
  465. )
  466. <where>
  467. <if test="warehouse_name != null">
  468. and "warehouse_name" in
  469. <foreach collection="warehouse_name" item="item" open="(" separator="," close=")">
  470. #{item}
  471. </foreach>
  472. </if>
  473. <if test="material_name != null">
  474. and "material_name" in
  475. <foreach collection="material_name" item="item" open="(" separator="," close=")">
  476. #{item}
  477. </foreach>
  478. </if>
  479. <if test="close_lastmonth_inventory != null">
  480. and "close_lastmonth_inventory" in
  481. <foreach collection="close_lastmonth_inventory" item="item" open="(" separator="," close=")">
  482. #{item}
  483. </foreach>
  484. </if>
  485. <if test="close_thismonth_inbound != null">
  486. and "close_thismonth_inbound" in
  487. <foreach collection="close_thismonth_inbound" item="item" open="(" separator="," close=")">
  488. #{item}
  489. </foreach>
  490. </if>
  491. <if test="close_thismonth_outbound != null">
  492. and "close_thismonth_outbound" in
  493. <foreach collection="close_thismonth_outbound" item="item" open="(" separator="," close=")">
  494. #{item}
  495. </foreach>
  496. </if>
  497. <if test="close_thismonth_inventory != null">
  498. and "close_thismonth_inventory" in
  499. <foreach collection="close_thismonth_inventory" item="item" open="(" separator="," close=")">
  500. #{item}
  501. </foreach>
  502. </if>
  503. </where>
  504. <include refid="orderBy"></include>
  505. </select>
  506. <sql id="orderBy">
  507. <if test="orderField != null and orderField != ''">
  508. order by "${orderField}"
  509. <if test="orderType != null and orderType != ''">
  510. ${orderType}
  511. </if>
  512. </if>
  513. </sql>
  514. <select id="selectSendReceive" resultType="java.util.Map" parameterType="java.math.BigDecimal">
  515. select distinct wsr.MATERIAL_ID "materialId"
  516. from WMSP_SEND_RECEIVE wsr
  517. left join RMS_WAREHOUSE rw
  518. on wsr.WAREHOUSE_ID = rw.WAREHOUSE_ID
  519. where wsr.WAREHOUSE_ID = #{warehouseId}
  520. and wsr.INSERT_TIME BETWEEN add_months(sysdate,-1) and sysdate
  521. </select>
  522. <select id="selectCloseThismonthInbound" resultType="java.math.BigDecimal" parameterType="java.math.BigDecimal">
  523. select sum(wsr.SEND_RECEIVE_THISDAY_INBOUND)
  524. from WMSP_SEND_RECEIVE wsr
  525. where wsr.MATERIAL_ID = #{materialId} and wsr.WAREHOUSE_ID = #{warehouseId}
  526. and wsr.INSERT_TIME BETWEEN add_months(sysdate,-1) and sysdate
  527. </select>
  528. <select id="selectCloseThismonthOutbound" resultType="java.math.BigDecimal" parameterType="java.math.BigDecimal">
  529. select sum(wsr.SEND_RECEIVE_THISDAY_OUTBOUND)
  530. from WMSP_SEND_RECEIVE wsr
  531. where wsr.MATERIAL_ID = #{materialId} and wsr.WAREHOUSE_ID = #{warehouseId}
  532. and wsr.INSERT_TIME BETWEEN add_months(sysdate,-1) and sysdate
  533. </select>
  534. <select id="selectCloseLastmonthInventory" resultType="java.math.BigDecimal" parameterType="java.math.BigDecimal">
  535. select sum(wic.CLOSE_THISMONTH_INVENTORY)
  536. from WMSP_INVENTORY_CLOSE wic
  537. where wic.MATERIAL_ID = #{materialId} and wic.WAREHOUSE_ID = #{warehouseId}
  538. and wic.INSERT_TIME BETWEEN add_months(sysdate,-2) and sysdate
  539. </select>
  540. <select id="getClose" resultType="int">
  541. select count(*) from WMSP_INVENTORY_CLOSE where to_char(insert_time,'YYYY-MM-DD')=TO_CHAR(SYSDATE,'YYYY-MM-DD')
  542. </select>
  543. </mapper>