<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.xhkjedu.suser.mapper.gradeclass.SchoolMapper">
    <!--获取学校当前年份-->
    <select id="getYearById" resultType="java.lang.Integer">
        select year from t_school where schoolid=#{schoolid}
    </select>
    <!--获取用户当前年份-->
    <select id="getYearByUserId" resultType="java.lang.Integer">
        select s.year from t_user u left join t_school s on u.schoolid=s.schoolid
        where u.userid=#{userid}
    </select>
    <!--获取学校账号数量-->
    <select id="getUserNumById" resultType="java.lang.Integer">
        select usernum from t_school where schoolid=#{schoolid}
    </select>

    <!--更加用户id获取当前学校id和年份-->
    <select id="getSchoolInfoByUserid" resultType="com.xhkjedu.suser.model.gradeclass.TSchool">
        select s.schoolid,s.year,limitenolen from t_user u left join t_school s on u.schoolid=s.schoolid
        where u.userid=#{userid}
    </select>
    <!--获取学校基本信息-->
    <select id="getSchoolInfoById" resultType="com.xhkjedu.suser.model.gradeclass.TSchool">
        select usernum,limitenolen,schoolname from t_school where schoolid=#{schoolid}
    </select>
</mapper>
