还得码农要用对吧。
1、比如#和$有区别。#{}是预编译,可以;${}不能。
https://aijishu.com/a/1060000000008622
https://blog.csdn.net/jqq_apple/article/details/50421103
2、尽量用下面这种,而不是自己拼串。
userExample.or().andDisplayNameLike("%" + keyword + "%");
userExample.or().andOrgLike(keyword + "%");
userExample.or().andStatusLike("%" + keyword + "%");
userExample.or().andIdLike(keyword + "%");
https://www.anquanke.com/post/id/190170
3、这帖子尾部也有总结
Always use MyBatis annotated mappers
Use the SqlProviderAdapter utility class in conjunction with the MyBatis provider annotations (@InsertProvider, @SelectProvider, etc.)
https://mybatis.org/mybatis-dynamic-sql/docs/howItWorks.html
--
FROM 123.118.64.*