mirror of
https://gitee.com/best_handsome/mybatis-plus-join
synced 2025-07-11 00:02:22 +08:00
跟新别名用法
This commit is contained in:
parent
252105fd73
commit
600786c121
@ -23,8 +23,10 @@
|
||||
<version>1.1.1</version>
|
||||
</dependency>
|
||||
```
|
||||
或者clone代码到本地,执行mvn install,再引入以上依赖
|
||||
<br><br>
|
||||
或者clone代码到本地,执行mvn install,再引入以上依赖
|
||||
<br>
|
||||
注:需要mybatis-plus版本号大于等于 3.4.0
|
||||
<br>
|
||||
|
||||
2. 添加配置文件
|
||||
|
||||
@ -38,8 +40,11 @@ public class MybatisPlusConfig {
|
||||
@Bean
|
||||
public MybatisPlusInterceptor paginationInterceptor() {
|
||||
MybatisPlusInterceptor interceptor = new MybatisPlusInterceptor();
|
||||
//分页插件
|
||||
interceptor.addInnerInterceptor(new PaginationInnerInterceptor());
|
||||
//连表插件
|
||||
interceptor.addInnerInterceptor(new MPJInterceptor());
|
||||
//其他mp插件......
|
||||
return interceptor;
|
||||
}
|
||||
|
||||
|
@ -12,8 +12,8 @@ import com.baomidou.mybatisplus.core.toolkit.support.SFunction;
|
||||
* select t.* from table t ${ew.customSqlSegment("t")}
|
||||
* <p>
|
||||
* 注意:
|
||||
* 官方的自定义sql是ew.customSqlSegment,不带括号,是属性
|
||||
* 带别名的是 ew.customSqlSegment("t") 带括号,是方法
|
||||
* 官方的自定义sql是ew.customSqlSegment,不带括号,会调用getCustomSqlSegment方法
|
||||
* 带别名的是 ew.customSqlSegment("t") 带括号
|
||||
* 括号中的别名必须带双引号
|
||||
*
|
||||
* @author yulichang
|
||||
|
Loading…
x
Reference in New Issue
Block a user