package com.app.mapper.basics;

import com.app.dto.basics.ResponseSchoolDto;
import com.app.dto.basics.search.SearchSchoolDto;
import com.app.dto.report.SearchReportDto;
import com.app.entity.basics.School;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

@Mapper
@Repository
public interface SchoolMapper extends BaseMapper<School> {

    IPage<ResponseSchoolDto> getList(@Param("dto") SearchSchoolDto searchSchoolDto, Page page);

    List<School> getSchoolList(@Param("reportDto") SearchReportDto searchReportDto);

    /**
     * 功能描述：查询城市下的所有有效的学校
     *
     * @param city 城市名称
     * @return
     */
    List<School> findByCityAndIsDelFalse(String city);
}
