1.時間參數比較
2.mybatis中if–else if
沒有if–else
<select id="getMyAbsentList" resultType="com.dayou.cloud.sys.entity.BscAbsent">
select a.* from bsc_absent a,map_student_class b
where a.partyid = b.studentid and b.classid = #{classid} and a.state='nor'
<if test="type!=null and type!=''">
and a.type=#{type}
</if>
<if test="starttime!=null and starttime!=''">
and a.starttime>=#{starttime}
</if>
<choose>
<when test="endtime!=null and endtime!=''">
and a.endtime<=#{endtime}
</when>
<otherwise>
and a.endtime>=now()
</otherwise>
</choose>
</select>