| | |
| | | <sql id="selectHazmatVo"> |
| | | select a.id, a.basic_id, a.warehouse_id, a.code,a.remaining, a.state,a.company_id,a.version, a.create_by, a.create_time, a.update_by, a.update_time, a.remark, |
| | | b.id as basic_id,b.name as basic_name,b.cas as basic_cas,b.hazmat_type as basic_hazmat_type,b.hazmat_character as basic_hazmat_character, |
| | | b.supplier as basic_supplier,b.manufacturer as basic_manufacturer,b.metering as basic_metering,b.unit as basic_unit,b.product_sn, |
| | | b.min_package as basic_min_package,c.name as warehouse_name,d.cupboard_name |
| | | b.supplier as basic_supplier,b.manufacturer as basic_manufacturer,b.metering as basic_metering,b.unit as basic_unit, |
| | | b.product_sn,b.min_package as basic_min_package,c.name as warehouse_name,d.cupboard_name as cupboard_name |
| | | from hz_hazmat a |
| | | left join hz_hazmat_basic b on b.id=a.basic_id |
| | | left join hz_warehouse c on c.id=a.warehouse_id |
| | |
| | | </select> |
| | | |
| | | <select id="selectHazmatGroupWareHouse" resultType="com.gkhy.hazmat.system.domain.vo.HzHazmatWarehouseVO"> |
| | | select a.basic_id,a.warehouse_id, |
| | | 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 |
| | | from hz_hazmat a |
| | |
| | | </if> |
| | | and a.del_flag=0 |
| | | </where> |
| | | group by a.basic_id,a.warehouse_id |
| | | group by a.basic_id,a.warehouse_id, a.cupboard_id |
| | | </select> |
| | | |
| | | |
| | |
| | | <select id="selectHazmatCountOfWarehouse" resultType="integer"> |
| | | select count(a.id) from hz_hazmat a |
| | | inner join hz_hazmat_basic b on b.id=basic_id |
| | | where a.warehouse_id=#{warehouseId} and b.id=#{basicId} and a.company_id=#{companyId} and b.company_id=#{companyId} and a.del_flag=0 and (a.state=0 or a.state=1) |
| | | where a.warehouse_id=#{warehouseId} and b.id=#{basicId} and a.company_id=#{companyId} and b.company_id=#{companyId} |
| | | and a.del_flag=0 and (a.state=0 or a.state=1) and a.cupboard_id = #{cupboardId} |
| | | </select> |
| | | |
| | | |
| | | <select id="selectHazmatWarehouseCheck" resultType="com.gkhy.hazmat.system.domain.vo.TabooDisVo"> |
| | | select DISTINCT b.peculiarity_number spNum ,b.id from hz_hazmat a |
| | | inner join hz_hazmat_basic b on b.id=basic_id |
| | | where a.warehouse_id=#{warehouseId} and a.company_id=#{companyId} and b.company_id=#{companyId} |
| | | and a.del_flag=0 and (a.state=0 or a.state=1) and a.cupboard_id = #{cupboardId} |
| | | </select> |
| | | |
| | | <select id="selectHazmatByCode" resultMap="HzHazmatResult"> |