change - 库存统计

master
yinq 9 months ago
parent 04bdc2125f
commit d4372fae2a

@ -71,18 +71,17 @@
</select> </select>
<select id="getInventoryStatistics" parameterType="BaseSpaceInfo" resultType="java.util.LinkedHashMap"> <select id="getInventoryStatistics" parameterType="BaseSpaceInfo" resultType="java.util.LinkedHashMap">
select si.store_code MATERIALCODE, SELECT si.STORE_CODE MATERIALCODE,
si.STORE_NAME MATERIALNAME, si.STORE_NAME MATERIALNAME,
sp.material_type STORECODE, ml.MATERIAL_SPECIFICATIONS STORENAME,
ml.MATERIAL_NAME STORENAME, SUM(MATERIAL_AMOUNT) SPACESTOCK
sum(sp.space_stock) SPACESTOCK FROM BASE_SPACEDETAIL sd
from base_spaceinfo sp left join base_storeinfo si on si.STORE_CODE = si.STORE_CODE
left join base_storeinfo si on si.STORE_CODE = sp.STORE_CODE left join BASE_MATERIALINFO ml on ml.MATERIAL_CODE = sd.MATERIAL_TYPE
left join BASE_MATERIALINFO ml on ml.MATERIAL_CODE = sp.MATERIAL_TYPE WHERE ml.MATERIAL_SPECIFICATIONS is not null
where sp.MATERIAL_TYPE is not null <if test="storeCode != null and storeCode != ''">and si.store_code = #{storeCode}</if>
<if test="storeCode != null and storeCode != ''">and sp.store_code = #{storeCode}</if> GROUP BY si.STORE_CODE, si.STORE_NAME, ml.MATERIAL_SPECIFICATIONS
group by si.store_code, si.STORE_NAME, sp.material_type, ml.MATERIAL_NAME ORDER BY si.STORE_CODE, si.STORE_NAME
order by si.store_code, sp.material_type
</select> </select>
<insert id="insertBaseSpaceInfo" parameterType="BaseSpaceInfo"> <insert id="insertBaseSpaceInfo" parameterType="BaseSpaceInfo">

Loading…
Cancel
Save