oracle mybaties sql like 语句
<select id="listPageUser" parameterType="com.znsq.project.biz.authority.dto.User" resultMap="userAndRoleResultMap">
select u.user_id,u.username,u.loginname,u.password,r.role_id,r.role_name ,u.last_login,u.position,u.company,u.user_type from znsq_web_user u left join znsq_web_role r on u.role_id=r.role_id where u.status=0 <if test="loginname!=null and loginname!=''"> and (u.loginname like ('%'||#{loginname}||'%') or u.username like ( '%'||#{loginname}||'%') ) </if> <if test="roleId!=null and roleId!=0"> and u.role_id=#{roleId} </if> <if test="lastLoginStart!=null"> and u.last_login>=#{lastLoginStart} </if> <if test="lastLoginEnd!=null"> and u.last_login<=#{lastLoginEnd} </if> </select>