| | |
| | | pm.model, |
| | | pm.unit, |
| | | p.product_name, |
| | | |
| | | GREATEST(s.last_in_time, o.last_out_time) AS create_time, |
| | | COALESCE(s.inboundNum, 0) AS inboundNum, |
| | | COALESCE(o.outboundNum, 0) AS outboundNum, |
| | | COALESCE(s.inboundNum, 0) - COALESCE(o.outboundNum, 0) AS stockQuantity |
| | | COALESCE(s.inboundNum, 0) - COALESCE(o.outboundNum, 0) AS stockQuantity, |
| | | COALESCE(s.is_frozen, 0) AS is_frozen |
| | | FROM product_model pm |
| | | LEFT JOIN product p ON pm.product_id = p.id |
| | | |
| | |
| | | SELECT |
| | | product_model_id, |
| | | SUM(inbound_num) AS inboundNum, |
| | | MAX(create_time) AS last_in_time |
| | | MAX(create_time) AS last_in_time, |
| | | MAX(is_frozen) AS is_frozen |
| | | FROM procurement_record_storage |
| | | <where> |
| | | <if test="req.timeStr != null and req.timeStr != ''"> |