package com.yida.data.system.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yida.data.common.core.entity.system.Dept;
import com.yida.data.common.core.entity.system.DeptSchoolInformation;
import com.yida.data.system.dto.SchoolInformationDTO;
import com.yida.data.system.dto.SchoolPageDTO;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @author ccl
 */
public interface DeptSchoolInformationMapper extends BaseMapper<DeptSchoolInformation> {

    /**
     * 分页查询学校
     * @param deptId 教育局或代理商id
     * @param schoolName 学校名称
     * @param schoolType 学校类型
     * @param natureType 学校性质
     * @param areaId 区域id
     * @param tag 标签
     * @return
     */
    Page<SchoolInformationDTO> findSchoolListByDeptId(@Param("deptId") Long deptId, @Param("schoolName") String schoolName,
                                                      @Param("schoolType") Integer schoolType, @Param("natureType") Integer natureType,
                                                      @Param("address") String address, @Param("tag") String tag,
                                                      @Param("page") Page<SchoolInformationDTO> page, @Param("schoolOwnership") Integer schoolOwnership);

    Page<SchoolInformationDTO> findSchoolPageList(@Param("schoolName") String schoolName, @Param("schoolType") List<Integer> schoolType,
                                                  @Param("natureType") List<Integer> natureType, @Param("deptSchoolId") List<Long> deptSchoolId,
                                                  @Param("page") Page<SchoolInformationDTO> page, @Param("deptId") Long deptId,
                                                  @Param("schoolOwnership") List<Integer> schoolOwnership);

    Page<SchoolInformationDTO> findSchoolByAddress(@Param("page") Page<SchoolInformationDTO> page, @Param("address") String address, @Param("deptId") Long deptId);

    List<Long> findDeptSchoolId(@Param("tags") String[] tags);

    IPage<SchoolInformationDTO> listSchoolPage(Page<Dept> page, @Param("dto") SchoolPageDTO dto);
}
