mybatis多條件模糊查詢
阿新 • • 發佈:2019-02-11
<select id="selectUserList" parameterType="cn.vipkes.dao.dto.param.UserListDto" resultType="cn.vipkes.dao.dto.result.UserListResult"> SELECT USER_NAME as userName FROM USER WHERE DEL_FLG = 0 <if test="userName != null and userName != ''"> AND USER_NAME LIKE '%'||#{userName}||'%' </if> <if test="address != null and address != ''"> AND ADDRESS LIKE '%'||#{address}||'%' </if> </select>