| | |
| | | </select> |
| | | <select id="getByModelId" resultType="com.ruoyi.stock.dto.StockInventoryDto"> |
| | | select si.id, si.batch_no, si.locked_quantity, (si.qualitity - IFNULL(sd.qualitity, 0)) as qualitity, |
| | | p.product_name, pm.model, pm.unit |
| | | p.product_name, pm.model, pm.unit,si.create_time |
| | | from stock_inventory si |
| | | left join ( |
| | | select spd.stock_inventory_id, sum(spd.quantity) as qualitity |
| | |
| | | left join product p on pm.product_id = p.id |
| | | where si.product_model_id = #{productModelId} |
| | | and si.qualitity > IFNULL(sd.qualitity, 0) |
| | | order by si.create_time asc |
| | | </select> |
| | | |
| | | <select id="getBatchNoQty" resultType="com.ruoyi.stock.dto.StockInventoryDto"> |