
SQL
Javaの神
这个作者很懒,什么都没留下…
展开
-
Sql调优学习笔记
EXPLAIN #可以打印sql的执行计划 EPPLAIN EXTENDED #可以打印执行计划并列出警告 新版本中,连续执行原句的基础上添加一句SHOW WARNINGS可以起到同样的效果 WARNINGS: Cannot use ref access on index ‘mobile’ due to type or collation conversion on field ‘mobile’ Cannot use range access on index ‘mobile’ due to type o原创 2021-10-25 16:23:19 · 511 阅读 · 0 评论 -
Mybatis使用模糊查询预编译占位符以及%的故事
模糊查询的时候使用%表示模糊位置;正常sql没什么问题 但是一设计到字符串拼接就出问题了 <if test='country!=null'> AND '#{country}%')</if> 这里会提示传入了一个参数但是只找到0个占位符,因为‘ ’单引号直接把里面转换成了字符导致无法找到对应的占位符 后来改成了: <if test='country!=null'> AND #{country}'%')</if> 这样虽然不报错,但是无论如何都搜不出数据来;原创 2021-05-19 16:18:02 · 387 阅读 · 0 评论 -
SpringBoot集成分页助手的使用
分页助手依赖 <dependency> <groupId>com.github.pagehelper</groupId> <artifactId>pagehelper</artifactId> <version>5.1.2</version> </dependency> 导入后需要对助手进行配置,必须指定语言,其他可以使用默认值 配置类版: @Configuration public class PageHel原创 2021-05-18 13:21:16 · 357 阅读 · 0 评论