| | |
| | | AND company_id = #{companyId} |
| | | </if> |
| | | </select> |
| | | <select id="selectByWarehouseAndCupboard" resultType="com.gkhy.hazmat.system.domain.HzHazmat"> |
| | | select a.id,a.entry_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 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 |
| | | left join hz_warehouse_cupboard d on d.id=a.cupboard_id |
| | | <where> |
| | | and a.del_flag=0 and a.state in (0,1) |
| | | <if test="cabinetId !=null"> |
| | | and a.warehouse_id=#{cabinetId} |
| | | </if> |
| | | <if test="auxiliaryCabinetId!=null"> |
| | | and a.cupboard_id=#{auxiliaryCabinetId} |
| | | </if> |
| | | <if test="time!=null"> |
| | | and a.create_time >= #{time} |
| | | </if> |
| | | |
| | | </where> |
| | | order by a.id desc |
| | | </select> |
| | | <!-- SELECT COUNT(*) AS count, DATE_FORMAT(create_time, '%H') AS hour--> |
| | | <!-- FROM hz_hazmat--> |
| | | <!-- WHERE create_time >= #{startDate} AND create_time < #{endDate}--> |