|
@@ -447,22 +447,23 @@
|
|
|
|
|
|
<select id="selectWmspInventoryClose" resultType="java.util.LinkedHashMap">
|
|
|
select
|
|
|
-rw.warehouse_name "warehouse_name",
|
|
|
-rm.material_name "material_name",
|
|
|
-wpic.close_lastmonth_inventory "close_lastmonth_inventory",
|
|
|
-wpic.close_thismonth_inbound "close_thismonth_inbound",
|
|
|
-wpic.close_thismonth_outbound "close_thismonth_outbound",
|
|
|
-wpic.close_thismonth_inventory "close_thismonth_inventory"
|
|
|
-from
|
|
|
-wmsp_inventory_close wpic
|
|
|
-join rms_material rm
|
|
|
-on rm.material_id=wpic.material_id
|
|
|
-join rms_warehouse rw
|
|
|
-on rw.warehouse_id=wpic.warehouse_id
|
|
|
-join rms_material_type rmt
|
|
|
-on rmt.material_type_id=rm.material_type_id
|
|
|
-join rms_warehouse_type rwt
|
|
|
-on rwt.warehouse_type_id=rw.warehouse_type_id
|
|
|
+ rw.warehouse_name "warehouse_name",
|
|
|
+ rm.material_name "material_name",
|
|
|
+ wpic.close_lastmonth_inventory "close_lastmonth_inventory",
|
|
|
+ wpic.close_thismonth_inbound "close_thismonth_inbound",
|
|
|
+ wpic.close_thismonth_outbound "close_thismonth_outbound",
|
|
|
+ wpic.close_thismonth_inventory "close_thismonth_inventory"
|
|
|
+ from
|
|
|
+ wmsp_inventory_close wpic
|
|
|
+ join rms_material rm
|
|
|
+ on rm.material_id=wpic.material_id
|
|
|
+ join rms_warehouse rw
|
|
|
+ on rw.warehouse_id=wpic.warehouse_id
|
|
|
+ where wpic.WAREHOUSE_ID = #{warehouseId}
|
|
|
+ <if test="value!=null">
|
|
|
+ and #{value}= to_char(wpic.INSERT_TIME,'yyyy-mm')
|
|
|
+ </if>
|
|
|
+
|
|
|
<where>
|
|
|
<if test="warehouse_name != null">
|
|
|
and "warehouse_name" in
|
|
@@ -511,4 +512,38 @@ on rwt.warehouse_type_id=rw.warehouse_type_id
|
|
|
</if>
|
|
|
</if>
|
|
|
</sql>
|
|
|
+
|
|
|
+ <select id="selectSendReceive" resultType="java.util.Map" parameterType="java.math.BigDecimal">
|
|
|
+ select distinct wsr.MATERIAL_ID "materialId"
|
|
|
+ from WMSP_SEND_RECEIVE wsr
|
|
|
+ left join RMS_WAREHOUSE rw
|
|
|
+ on wsr.WAREHOUSE_ID = rw.WAREHOUSE_ID
|
|
|
+ where wsr.WAREHOUSE_ID = #{warehouseId}
|
|
|
+ and wsr.INSERT_TIME BETWEEN add_months(sysdate,-1) and sysdate
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="selectCloseThismonthInbound" resultType="java.math.BigDecimal" parameterType="java.math.BigDecimal">
|
|
|
+ select sum(wsr.SEND_RECEIVE_THISDAY_INBOUND)
|
|
|
+ from WMSP_SEND_RECEIVE wsr
|
|
|
+ where wsr.MATERIAL_ID = #{materialId} and wsr.WAREHOUSE_ID = #{warehouseId}
|
|
|
+ and wsr.INSERT_TIME BETWEEN add_months(sysdate,-1) and sysdate
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="selectCloseThismonthOutbound" resultType="java.math.BigDecimal" parameterType="java.math.BigDecimal">
|
|
|
+ select sum(wsr.SEND_RECEIVE_THISDAY_OUTBOUND)
|
|
|
+ from WMSP_SEND_RECEIVE wsr
|
|
|
+ where wsr.MATERIAL_ID = #{materialId} and wsr.WAREHOUSE_ID = #{warehouseId}
|
|
|
+ and wsr.INSERT_TIME BETWEEN add_months(sysdate,-1) and sysdate
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="selectCloseLastmonthInventory" resultType="java.math.BigDecimal" parameterType="java.math.BigDecimal">
|
|
|
+ select sum(wic.CLOSE_THISMONTH_INVENTORY)
|
|
|
+ from WMSP_INVENTORY_CLOSE wic
|
|
|
+ where wic.MATERIAL_ID = #{materialId} and wic.WAREHOUSE_ID = #{warehouseId}
|
|
|
+ and wic.INSERT_TIME BETWEEN add_months(sysdate,-2) and sysdate
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="getClose" resultType="int">
|
|
|
+ select count(*) from WMSP_INVENTORY_CLOSE where to_char(insert_time,'YYYY-MM-DD')=TO_CHAR(SYSDATE,'YYYY-MM-DD')
|
|
|
+ </select>
|
|
|
</mapper>
|