package com.huimv.environ.eco.mapper;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.huimv.environ.eco.entity.EcoDevice;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;
import java.util.Map;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author zn
 * @since 2022-11-09
 */
public interface EcoDeviceMapper extends BaseMapper<EcoDevice> {

//    List<Map> selectList2(@Param("ew") QueryWrapper<EcoDevice> queryWrapper);
//    List<Map> selectList2();

    @Select("SELECT ed.*,bp.pigpen_name FROM `eco_device` ed LEFT JOIN  `base_pigpen` bp ON ed.unit_id=bp.id")
    List<Map> selectList4();

    @Select("SELECT ed.*,bp.pigpen_name FROM `eco_device` ed LEFT JOIN  `base_pigpen` bp ON ed.unit_id=bp.id WHERE ed.device_type=#{dryDeivceType}")
    List<Map> getDryDevice(@Param("dryDeivceType") int dryDeivceType);
}
