name未配置视为不考虑name条件
select * from user where (( (ISNULL(name)) OR (name='') ) OR name = #{user.nameParam} )
三个or语句 推荐这个
select * from user where ISNULL(name) OR name='' OR name = #{user.nameParam}
sql
select * from user where ISNULL(name) OR name=''
<if test="user.nameParam != null and user.nameParam !=''">
OR name = #{user.nameParam}
</if>
数据库的name字段为空或为空字符串 ,nameParam 无论有无值都可以匹配到
数据库的name字段不为空也不为空字符串, 就要用nameParam匹配了(传参nameParam不为空, 和数据库的不为空的匹配; 传参nameParam为空, 数据库的为空的匹配, 即不考虑name条件的场景)