Mybatis时间段查询xml写法

阅读 69

2021-09-26

一、涉及时间段筛选

<select id="queryTeacherList" parameterType="com.caiweiwei.eduservice.vo.QueryTeacher" resultType="EduTeacher">
    select * from edu_teacher
    <where>
    <if test="name != null  and name != ''"> and name like concat('%', #{name}, '%')</if>
    <if test="level!=null and level!='' "> and level = #{level}</if>
    <if test="begin!=null and begin!=''"> and gmt_create <![CDATA[>=]]>  #{begin} </if>
    <if test="end!=null and end!=''"> and gmt_create <![CDATA[<=]]>  #{end} </if>
        and is_deleted=0
</where>
</select>

精彩评论(0)

0 0 举报