SQL模糊查询 同时匹配多个字段
<select id="selectByTitleAndDocumentId" parameterType="java.lang.String" resultMap="BaseResultMap"> select * from guide where title like concat('%',#{title,jdbcType = VARCHAR},'%') and document_id like concat('%',#{documentId,jdbcType = VARCHAR},'%') and del_flag = 0 </select>
如果要查询不满足模糊匹配的字段,只需要将【like】替换为【not like】即可
[ 版权声明 ]:
本文所有权归作者本人,文中参考的部分已经做了标记!
商业用途转载请联系作者授权!
非商业用途转载,请标明本文链接及出处!