<?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.winsun.mapper.SysUserMapper">

    <select id="schoolAllocationList" resultType="HashMap" parameterType="String">
        select a.account,a.name,c.id as schoolId, b.id, a.id as userId,
        c.sub_name as substName, c.school_name as schoolName
        from sys_user a,hhr_supervisor_school b,hhr_school c
        where a.id = b.user_id
        and b.school = c.id
        <if test="account != null and account != ''">
            AND a.account = #{account}
        </if>
        <if test="name != null and name != ''">
            AND a.name = #{name}
        </if>
        <if test="substName != null and substName != ''">
            AND c.sub_name = #{substName}
        </if>
        <if test="schoolName != null and schoolName != ''">
            AND c.school_name = #{schoolName}
        </if>
    </select>


</mapper>
