| | |
| | | |
| | | <select id="selectHazmatGroupWareHouse" resultType="com.gkhy.hazmat.system.domain.vo.HzHazmatWarehouseVO"> |
| | | select a.basic_id,a.warehouse_id,a.cupboard_id, |
| | | (select count(1) from hz_hazmat where state=0 and basic_id=a.basic_id and warehouse_id=a.warehouse_id) as stock, |
| | | (select count(1) from hz_hazmat where state=1 and basic_id=a.basic_id and warehouse_id=a.warehouse_id) as miss_stock |
| | | SUM(CASE WHEN a.state = 0 THEN 1 ELSE 0 END) AS stock, |
| | | SUM(CASE WHEN a.state = 1 THEN 1 ELSE 0 END) AS miss_stock |
| | | from hz_hazmat a |
| | | left join hz_hazmat_basic b on b.id=a.basic_id |
| | | <where> |
| | |
| | | and a.del_flag=0 and b.del_flag = 0 |
| | | </where> |
| | | group by a.basic_id,a.warehouse_id, a.cupboard_id |
| | | HAVING stock > 0 OR miss_stock > 0 |
| | | </select> |
| | | |
| | | |