change - 库存统计

master
yinq 11 months ago
parent 04bdc2125f
commit d4372fae2a

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

Loading…
Cancel
Save