xuhy
2025-10-14 14f55cd77189bae10627277a2a3dab9cec5fcada
ruoyi-system/src/main/resources/mapper/system/TErpSupplierWarehousingMapper.xml
@@ -108,21 +108,20 @@
    <select id="validityPeriodWarning" resultType="com.ruoyi.system.vo.ValidityPeriodWarningVo">
        select t2.warehouse_id,t2.warehouse_no warehousingNo, t4.goods_name, t4.quasi_number, t1.batch_number, t1.id as batchId,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
               end as num
        select * from (select t2.warehouse_id,t2.warehouse_no warehousingNo, t4.goods_name, t4.quasi_number,
        t1.batch_number, t1.id as batchId,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
        end as num,t3.id as ogid
        from t_erp_supplier_warehousing_batch t1
                 left join t_erp_supplier_warehousing t2 on t1.warehousing_id = t2.id
                 LEFT JOIN t_erp_supplier_outbound_goods t3 on t3.warehousing_batch_id = t1.id
                 LEFT JOIN t_erp_goods t4 on t2.goods_id = t4.id
                left join t_erp_goods_type t5 on t4.type_id = t5.id
        left join t_erp_supplier_warehousing t2 on t1.warehousing_id = t2.id
        LEFT JOIN t_erp_supplier_outbound_goods t3 on t3.warehousing_batch_id = t1.id
        LEFT JOIN t_erp_goods t4 on t2.goods_id = t4.id
        left join t_erp_goods_type t5 on t4.type_id = t5.id
        left join t_erp_goods_unit t6 on t4.packing_unit_id = t6.id
        where #{time} > t1.expiry_date
          and (t1.warehousing_number - t3.outbound_count > 0 or t3.id is null)
          <if test="user.roleType !=null and user.roleType ==4">
              and t2.supplier_id =#{supplierClinicId}
          <if test="user.roleType !=null and user.roleType ==4">  and t2.supplier_id =#{supplierClinicId}
          </if>
        <if test="query.name != null and query.name != ''">
            and t4.goods_name like concat('%',#{query.goodsName},'%')
@@ -136,7 +135,9 @@
        <if test="query.typeId != null and query.typeId != ''">
            and t4.type_id = #{query.typeId}
        </if>
        order by t1.expiry_date
        group by t1.id
        ) as o where (o.num > 0 or o.ogid is null)
        order by o.expiry_date
    </select>
    <select id="pageInventoryList" resultType="com.ruoyi.system.vo.PageInventoryListVo">