<?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.smarking.mapper.system.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>

    <!--获取考试对应区域码和学校id-->
    <select id="getSchoolCloudcode" resultType="com.xhkjedu.smarking.vo.system.SchoolCloudVo">
        select distinct e.schoolid,(select cloudcode from t_cloud order by cloudid limit 1) cloudcode from ms_paper p
        left join ms_exam e on p.examid=e.examid where p.mpid=#{mpid}
    </select>
</mapper>
