⬆️ Upgrading dependencies. close #3547 up mybatis-plus 升级到3.5.1
⬆️ Upgrading dependencies. close #3547 up mybatis-plus 升级到3.5.1
This commit is contained in:
1 parent
847e739fc9
commit
57ec2a5e1e
5 files changed
+16
-3
No files matched your search
@@ -18,7 +18,7 @@
|
||||
|
||||
<properties>
|
||||
<pigx.version>4.3.0-SNAPSHOT</pigx.version>
|
||||
<mybatis-plus.version>3.4.3</mybatis-plus.version>
|
||||
<mybatis-plus.version>3.5.1</mybatis-plus.version>
|
||||
<dynamic-ds.version>3.4.1</dynamic-ds.version>
|
||||
<druid.version>1.2.8</druid.version>
|
||||
<mysql.connector.version>8.0.27</mysql.connector.version>
|
||||
|
||||
+3
-2
@@ -2,6 +2,7 @@ package com.pig4cloud.pigx.common.data.datascope;
|
||||
|
||||
import com.baomidou.mybatisplus.core.injector.AbstractMethod;
|
||||
import com.baomidou.mybatisplus.core.injector.DefaultSqlInjector;
|
||||
import com.baomidou.mybatisplus.core.metadata.TableInfo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -14,8 +15,8 @@ import java.util.List;
|
||||
public class DataScopeSqlInjector extends DefaultSqlInjector {
|
||||
|
||||
@Override
|
||||
public List<AbstractMethod> getMethodList(Class<?> mapperClass) {
|
||||
List<AbstractMethod> methodList = super.getMethodList(mapperClass);
|
||||
public List<AbstractMethod> getMethodList(Class<?> mapperClass, TableInfo tableInfo) {
|
||||
List<AbstractMethod> methodList = super.getMethodList(mapperClass, tableInfo);
|
||||
methodList.add(new SelectListByScope());
|
||||
methodList.add(new SelectPageByScope());
|
||||
methodList.add(new SelectCountByScope());
|
||||
|
||||
+6
@@ -18,6 +18,7 @@
|
||||
package com.pig4cloud.pigx.codegen.mapper;
|
||||
|
||||
import com.baomidou.dynamic.datasource.annotation.DS;
|
||||
import com.baomidou.mybatisplus.annotation.InterceptorIgnore;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.pig4cloud.pigx.codegen.entity.ColumnEntity;
|
||||
@@ -41,6 +42,7 @@ public interface GeneratorMapper extends PigxBaseMapper<ColumnEntity> {
|
||||
* @param tableName 表名称
|
||||
* @return
|
||||
*/
|
||||
@InterceptorIgnore(tenantLine = "true")
|
||||
IPage<Map<String, Object>> queryTable(Page page, @Param("tableName") String tableName);
|
||||
|
||||
/**
|
||||
@@ -50,6 +52,7 @@ public interface GeneratorMapper extends PigxBaseMapper<ColumnEntity> {
|
||||
* @return
|
||||
*/
|
||||
@DS("#last")
|
||||
@InterceptorIgnore(tenantLine = "true")
|
||||
Map<String, String> queryTable(@Param("tableName") String tableName, String dsName);
|
||||
|
||||
/**
|
||||
@@ -60,6 +63,7 @@ public interface GeneratorMapper extends PigxBaseMapper<ColumnEntity> {
|
||||
* @return
|
||||
*/
|
||||
@DS("#last")
|
||||
@InterceptorIgnore(tenantLine = "true")
|
||||
IPage<ColumnEntity> selectTableColumn(Page page, @Param("tableName") String tableName,
|
||||
@Param("dsName") String dsName);
|
||||
|
||||
@@ -70,6 +74,7 @@ public interface GeneratorMapper extends PigxBaseMapper<ColumnEntity> {
|
||||
* @return
|
||||
*/
|
||||
@DS("#last")
|
||||
@InterceptorIgnore(tenantLine = "true")
|
||||
List<ColumnEntity> selectTableColumn(@Param("tableName") String tableName, @Param("dsName") String dsName);
|
||||
|
||||
/**
|
||||
@@ -79,6 +84,7 @@ public interface GeneratorMapper extends PigxBaseMapper<ColumnEntity> {
|
||||
* @return
|
||||
*/
|
||||
@DS("#last")
|
||||
@InterceptorIgnore(tenantLine = "true")
|
||||
List<Map<String, String>> selectMapTableColumn(@Param("tableName") String tableName, String dsName);
|
||||
|
||||
}
|
||||
+3
@@ -26,6 +26,9 @@ public class GenTableColumnServiceImpl implements GenTableColumnService {
|
||||
@Override
|
||||
public IPage<ColumnEntity> listTable(Page page, GenConfig genConfig) {
|
||||
GeneratorMapper mapper = GenUtils.getMapper(genConfig.getDsName());
|
||||
|
||||
// 关闭sql 优化
|
||||
page.setOptimizeCountSql(false);
|
||||
IPage<ColumnEntity> columnPage = mapper.selectTableColumn(page, genConfig.getTableName(),
|
||||
genConfig.getDsName());
|
||||
|
||||
|
||||
+3
@@ -62,6 +62,9 @@ public class GeneratorServiceImpl implements GeneratorService {
|
||||
GeneratorMapper mapper = GenUtils.getMapper(dsName);
|
||||
// 手动切换数据源
|
||||
DynamicDataSourceContextHolder.push(dsName);
|
||||
|
||||
// 关闭SQL 优化
|
||||
page.setOptimizeCountSql(false);
|
||||
return mapper.queryTable(page, tableName);
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user