随笔分类 - Mybaties
摘要:<!--mybatis-plus--> <dependency> <groupId>com.baomidou</groupId> <artifactId>mybatis-plus-boot-starter</artifactId> <version>3.4.0</version> </depende
阅读全文
摘要:queryWrapper.and(wrapper -> { // 拼接sqlwrapper.like("user_name", name) .or() .like("user_admin_name",name); }); where (user_id='1' and (user_name like
阅读全文
摘要:mybaties自定义sql参数引用有两种#{}和${}。 ${}将变量原样输出不能防止sql注入。 #{}采用PreparedStatement将sql进行了预编译可以防止sql注入。预编译的原理就是将传递进来的变量中的引号用反斜杠(\)转义。在变量外面加上了双引号。 表个字段名当作变量的时候是不
阅读全文