package com.huimv.management.dao;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.huimv.management.entity.PigstyEntity;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.huimv.management.entity.vo.PigStyVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * 猪舍表
 * 
 * @author yinhao
 * @email yinhao@163.com
 * @date 2021-05-07 15:32:42
 */
@Mapper
@Repository
public interface PigstyDao extends BaseMapper<PigstyEntity> {

    @Select("SELECT id FROM mgt_pigsty WHERE number like CONCAT('%',#{pigstyName},'%') AND deleted = 0")
    List<Integer> selectIdListByPigstyName(@Param("pigstyName") String pigstyName);

    IPage<PigStyVo> page(@Param("page") IPage page,@Param("ew") QueryWrapper wrapper);
}
