xuhy
2025-10-15 49dd9ee3dea22203cd1a0cc53745cffb6607122c
ruoyi-system/src/main/resources/mapper/system/TErpSupplierWarehousingMapper.xml
@@ -34,8 +34,13 @@
        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_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
        from t_erp_goods t1
        left join t_erp_supplier_warehousing t2 on t1.id = t2.goods_id
        left join (
        select warehousing_id, sum(outbound_count) as outbound_count
        from t_erp_supplier_outbound_goods
        group by warehousing_id
        ) t3 on t2.id = t3.warehousing_id
        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},'%')
@@ -124,7 +129,7 @@
          <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},'%')
            and t4.goods_name like concat('%',#{query.name},'%')
        </if>
        <if test="query.quasiNumber != null and query.quasiNumber != ''">
            and t4.quasi_number like concat('%',#{query.quasiNumber},'%')