package com.base.biz.mapper;


import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.base.api.model.AntennaRpcDTO;
import com.base.biz.model.entity.AntennaInfo;
import org.apache.commons.lang3.StringUtils;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.stereotype.Repository;

import java.util.List;

@Mapper
@Repository
public interface AntennaInfoMapper extends BaseMapper<AntennaInfo> {

    default List<AntennaInfo> getInfoList(AntennaRpcDTO antennaRpcDTO) {
        QueryWrapper<AntennaInfo> queryWrapper = new QueryWrapper();
        if (!StringUtils.isEmpty(antennaRpcDTO.getDmzdh())){
            queryWrapper.eq("dmzdh", antennaRpcDTO.getDmzdh());
        }
        if (!StringUtils.isEmpty(antennaRpcDTO.getTxkj())){
            queryWrapper.eq("txkj", antennaRpcDTO.getTxkj());
        }
        return this.selectList(queryWrapper);
    }


    default List<AntennaInfo> selAntenaInfoByIds(List<String> ids){
        QueryWrapper queryWrapper = new QueryWrapper();
        queryWrapper.in("dmzdh",ids);
        return this.selectList(queryWrapper);
    }
}
