| | |
| | | SELECT |
| | | T1.*, |
| | | t3.shipping_car_number, |
| | | CASE |
| | | WHEN (t2.qualitity - COALESCE(t2.locked_quantity, 0) )> T1.quantity THEN 1 |
| | | ELSE 0 |
| | | END as has_sufficient_stock, |
| | | t3.shipping_date |
| | | 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 |
| | | <where> |
| | | 1=1 |
| | | <if test="salesLedgerProduct.salesLedgerId != null and salesLedgerProduct.salesLedgerId != '' "> |
| | |
| | | |
| | | |
| | | </select> |
| | | <select id="selectProduct" resultType="com.ruoyi.sales.pojo.SalesLedgerProduct"> |
| | | select |
| | | p.product_name as product_category, |
| | | pm.model as specification_model, |
| | | pm.id as product_model_id |
| | | from product_model pm |
| | | left join product p on pm.product_id = p.id |
| | | </select> |
| | | </mapper> |