1.模糊查询like的使用:e.name like "%"#{employee.name}"%"或 e.age like CONCAT(#{employee.age},'%')
2.字符串进行比较单引号在外,双引号在内<if test='employee.getSex() != null and employee.getSex() !="无"'>
3.多条sql语句一起执行加上allowMultiQueries=true<property name="url" value="jdbc:mysql://localhost:3306/company?useUnicode=true&characterEncoding=UTF-8&allowMultiQueries=true" />,然后多条sql语句之间用;间隔就可以
本文介绍如何在MyBatis中实现模糊查询,包括使用like关键字进行部分匹配及通过CONCAT进行精确匹配的方法。同时讲解了如何配置允许执行多条SQL语句,并通过分号分隔的方式实现批量操作。
1410

被折叠的 条评论
为什么被折叠?



