|
|
|
@ -62,6 +62,7 @@
|
|
|
|
|
<if test="updatedBy != null and updatedBy != ''">and sp.updated_by = #{updatedBy}</if>
|
|
|
|
|
<if test="updatedTime != null ">and sp.updated_time = #{updatedTime}</if>
|
|
|
|
|
</where>
|
|
|
|
|
order by sp.store_code,sp.space_code
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<select id="selectBaseSpaceInfoByObjId" parameterType="Long" resultMap="BaseSpaceInfoResult">
|
|
|
|
@ -69,6 +70,21 @@
|
|
|
|
|
where sp.obj_id = #{objId}
|
|
|
|
|
</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>
|
|
|
|
|
|
|
|
|
|
<insert id="insertBaseSpaceInfo" parameterType="BaseSpaceInfo">
|
|
|
|
|
<selectKey keyProperty="objId" resultType="long" order="BEFORE">
|
|
|
|
|
SELECT seq_base_spaceinfo.NEXTVAL as objId FROM DUAL
|
|
|
|
|