对于传一个参数去数据库里匹配多个字段的数据查询

举个例子:

<if test="customName != null and customName != ''">
    and t.customName like '%'+#{customName}+'%'
    or t.customType = #{customName}
    or t.deptType = #{customName}
    or t.province = #{customName}
    or t.city = #{customName}
    or t.direct = #{customName}
    or t.principalName = #{customName}
</if>
传了一个customName 去匹配多个字段 ,前端页面就一个搜索框实现多个字段的查询

猜你喜欢

转载自blog.csdn.net/qq_37461349/article/details/79677309