gongchunyi
2 天以前 1729474b4c7ffacb1790bb70981e64e7744bffb2
src/main/resources/mapper/sales/SalesLedgerProductMapper.xml
@@ -9,10 +9,16 @@
        T1.*,
        t3.shipping_car_number,
        t3.shipping_date,
        t3.status as shippingStatus
        t3.status as shippingStatus,
        t3.shipping_date,
        CASE
        WHEN t2.qualitity > T1.quantity THEN 1
        ELSE 0
        END as has_sufficient_stock
        FROM
        sales_ledger_product T1
        left join shipping_info t3 on T1.id = t3.sales_ledger_product_id
        LEFT JOIN stock_inventory t2 ON T1.product_model_id = t2.product_model_id
        LEFT JOIN shipping_info t3 ON T1.id = t3.sales_ledger_product_id
        <where>
            1=1
            <if test="salesLedgerProduct.salesLedgerId != null and salesLedgerProduct.salesLedgerId != '' ">
@@ -148,4 +154,12 @@
              WHERE sl.id = #{salesLedegerId}) A
        group by a.model, a.product_name, a.unit
    </select>
    <select id="selectProduct" resultType="com.ruoyi.sales.pojo.SalesLedgerProduct">
        select
            p.product_name as product_category,
            pm.model as specification_model,
            pm.id
        from product_model pm
        left join product p on pm.product_id = p.id
    </select>
</mapper>