xuhy
2025-09-19 206fcf7d6afae27856f63cf0158f53b61fa1b86f
ruoyi-system/src/main/resources/mapper/system/TErpSupplierWarehousingMapper.xml
@@ -31,11 +31,12 @@
        select * from (
        select <include refid="Base_Column_List1"/>
        COALESCE(sum(t2.goods_count), 0) - COALESCE(sum(t3.outbound_count), 0) as allNum,
        COALESCE(sum(t2.total_price), 0) * ( COALESCE(sum(t2.goods_count), 0) - COALESCE(sum(t3.outbound_count), 0)) as allTotalPrice,
        SUM(t2.unit_amount * (t2.goods_count - COALESCE(t3.outbound_count, 0))) as allTotalPrice,
        COALESCE(sum(t3.outbound_count), 0) as outNum
        from t_erp_supplier_warehousing t2  left join t_erp_goods t1 on t1.id = t2.goods_id
        from t_erp_goods t1  left join  t_erp_supplier_warehousing t2  on t1.id = t2.goods_id
        left join  t_erp_supplier_outbound_goods t3 on t2.id = t3.warehousing_id
        where t1.disabled = 0
        where t1.disabled = 0 and t2.id is not null
        <if test="query.goodsName != null and query.goodsName != ''">
            and t1.goods_name like concat('%',#{query.goodsName},'%')
        </if>
@@ -57,7 +58,7 @@
        <if test="user.roleType != null and user.roleType == 5 ">
            and t1.goods_source =2 and t1.supplier_clinic_id =#{query.supplierClinicId}
        </if>
        GROUP BY t2.id
        GROUP BY t1.id
        ) o where 1=1
            <if test="query.type != null and query.type ==1">
                and  o.warning_inventory  > (o.allNum-o.outNum)
@@ -107,7 +108,7 @@
    <select id="validityPeriodWarning" resultType="com.ruoyi.system.vo.ValidityPeriodWarningVo">
        select t2.warehouse_no, t4.goods_name, t4.quasi_number, t1.batch_number, t1.expiry_date, t4.id as goodsId,t5.type_name,t6.unit_name packingUnitName,
        select t2.warehouse_id,t2.warehouse_no warehousingNo, t4.goods_name, t4.quasi_number, t1.batch_number, t1.expiry_date, t4.id as goodsId,t5.type_name,t6.unit_name packingUnitName,
               case
                  when t3.id is null then t1.warehousing_number
                  else t1.warehousing_number -t3.outbound_count