package com.xhkjedu.sapi.mapper.system;

import com.xhkjedu.base.TkMapper;
import com.xhkjedu.sapi.model.system.TSchool;
import org.apache.ibatis.annotations.Param;

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

public interface SchoolMapper extends TkMapper<TSchool> {
    //删除
    Integer deleteById(@Param("schoolid") Integer schoolid);

    //列表
    List<Map<String,Object>> findAll();

    /**
     * 学年升级
     * @Param [schoolid]
     * @Author ywx
     * @Date 2020/6/12 13:54
     * @return java.lang.Integer
     **/
    Integer upgrade(@Param("schoolid") Integer schoolid);

    /**
     * 学年降级
     * @Param [schoolid, year]
     * @Author ywx
     * @Date 2020/6/16 13:51
     * @return java.lang.Integer
     **/
    Integer downgrade(@Param("schoolid") Integer schoolid, @Param("year") Integer year);

    //学校选择列表
    List<Map<String,Object>> listForSel(@Param("schoolname")String schoolname);

    TSchool getSchoolDetailById(@Param("schoolid") Integer schoolid);//获取区域码

    //更改学校是否绑定状态
    Integer updateSchoolDock(@Param("schoolid") Integer schoolid, @Param("docklc") Integer docklc);

    //根据学校名称查找学校数量
    Integer countBySchoolName(String schoolname);

    //获取学校当前年份
    Integer getYearById(Integer schoolid);

    //获取用户当前年份
    Integer getYearByUserId(Integer userid);

    //获取学校账号数量
    Integer getUserNumById(Integer schoolid);

    //修改
    Integer updateById(@Param("school") TSchool school);

    //根据域名获取学校id
    Integer getSchoolIdByDomain(String schooldomain, Integer schoolid);

    //获取准考证号长度限制
    Integer getLimiteNoLen(@Param("schoolid") Integer schoolid);

    //获取学年列表
    List<Integer> listYear(@Param("schoolid") Integer schoolid);

    //获取区域学年列表
    List<Integer> listCloudYear();

    //详情
    Map<String,Object> findById(@Param("schoolid") Integer schoolid);

    //伙伴学校列表
    List<Map<String,Object>> listSchool(@Param("schoolid") Integer schoolid);

    //加入学校列表
    List<Map<String,Object>> listJoinSchool(@Param("schoolid") Integer schoolid);

    //伙伴学校选择列表
    List<Map<String,Object>> listFriendForSel(@Param("school") TSchool school);

    //学校升级记录
    List<Map<String,Object>> listUpgrade(Integer schoolid);
}
