<?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.template.mapper.SmartSemesterMapper">


    <select id="getAffiliateList" resultType="com.template.model.pojo.SmartUser">
        SELECT * FROM `smart_user`
        where deleted = 0 and is_cancel=0
        <if test="id != null and id != ''">
            and FIND_IN_SET(#{id},affiliate)
        </if>
    </select>


    <select id="getSemesterList" resultType="com.template.model.pojo.SmartSemester">
        select * from smart_semester
        where deleted = 0
        <if test="startTime != null and startTime != '' and endTime != null and endTime != ''">
            and ((start_time &lt;= #{startTime} and end_time &gt;= #{startTime})
            or (start_time &lt;= #{endTime} and end_time &gt;= #{endTime})
            or (start_time &lt;= #{startTime} and end_time &gt;= #{endTime}))
        </if>
    </select>

</mapper>
