ibatis 模糊查询和多条件查询

    <select
        id="getList"
        parameterType="remotecollaborationDO"
        resultType="remotecollaborationDO" >
        SELECT  t1.id,t1.send_user_id,t1.status,t1.content,t1.profile,
        t1.contact_person,t1.contact_tel,t1.institute,t1.email,t1.comment,t2.real_name
        FROM remote_collaboration t1
        LEFT JOIN user_info t2 
        ON t1.send_user_id=t2.user_id
        where 1=1
        <if test="(status!=3 )" >
        and status=#{status}
        </if>

        <if test="real_name!=null and real_name!=''  " >
        and real_name  like CONCAT('%', trim(#{real_name}),'%')
        </if>

        <if test="(itemPerPage!=null and itemPerPage!=0 and startRow>=0)" >
            limit #{startRow}, #{itemPerPage} 
        </if>
    </select>


你可能感兴趣的:(ibatis 模糊查询和多条件查询)