update 优化 规范化mapper命名
This commit is contained in:
+7
-7
@@ -52,7 +52,7 @@ import java.util.zip.ZipOutputStream;
|
||||
@Service
|
||||
public class GenTableServiceImpl implements IGenTableService {
|
||||
|
||||
private final GenTableMapper baseMapper;
|
||||
private final GenTableMapper tableMapper;
|
||||
private final GenTableColumnMapper genTableColumnMapper;
|
||||
|
||||
private static final String[] TABLE_IGNORE = new String[]{"sj_", "flow_", "gen_"};
|
||||
@@ -93,7 +93,7 @@ public class GenTableServiceImpl implements IGenTableService {
|
||||
*/
|
||||
@Override
|
||||
public PageResult<GenTable> selectPageGenTableList(GenTable genTable, PageQuery pageQuery) {
|
||||
Page<GenTable> page = baseMapper.selectPage(pageQuery.build(), this.buildGenTableQueryWrapper(genTable));
|
||||
Page<GenTable> page = tableMapper.selectPage(pageQuery.build(), this.buildGenTableQueryWrapper(genTable));
|
||||
return PageResult.build(page.getRecords(), page.getTotal());
|
||||
}
|
||||
|
||||
@@ -134,7 +134,7 @@ public class GenTableServiceImpl implements IGenTableService {
|
||||
if (CollUtil.isEmpty(tablesMap)) {
|
||||
return PageResult.build();
|
||||
}
|
||||
List<String> tableNames = baseMapper.selectTableNameList(genTable.getDataName());
|
||||
List<String> tableNames = tableMapper.selectTableNameList(genTable.getDataName());
|
||||
String[] tableArrays;
|
||||
if (CollUtil.isNotEmpty(tableNames)) {
|
||||
tableArrays = tableNames.toArray(new String[0]);
|
||||
@@ -230,7 +230,7 @@ public class GenTableServiceImpl implements IGenTableService {
|
||||
normalizeColumnOptions(genTable.getColumns());
|
||||
String options = JsonUtils.toJsonString(genTable.getParams());
|
||||
genTable.setOptions(options);
|
||||
int row = baseMapper.updateById(genTable);
|
||||
int row = tableMapper.updateById(genTable);
|
||||
if (row > 0) {
|
||||
genTableColumnMapper.updateBatchById(genTable.getColumns());
|
||||
}
|
||||
@@ -245,7 +245,7 @@ public class GenTableServiceImpl implements IGenTableService {
|
||||
@Override
|
||||
public void deleteGenTableByIds(Long[] tableIds) {
|
||||
List<Long> ids = Arrays.asList(tableIds);
|
||||
baseMapper.deleteByIds(ids);
|
||||
tableMapper.deleteByIds(ids);
|
||||
genTableColumnMapper.lambda()
|
||||
.in(GenTableColumn::getTableId, ids)
|
||||
.deleteCount();
|
||||
@@ -265,7 +265,7 @@ public class GenTableServiceImpl implements IGenTableService {
|
||||
String tableName = table.getTableName();
|
||||
GenUtils.initTable(table);
|
||||
table.setDataName(dataName);
|
||||
int row = baseMapper.insert(table);
|
||||
int row = tableMapper.insert(table);
|
||||
if (row > 0) {
|
||||
// 保存列信息
|
||||
List<GenTableColumn> genTableColumns = SpringUtils.getAopProxy(this).selectDbTableColumnsByName(tableName, dataName);
|
||||
@@ -534,7 +534,7 @@ public class GenTableServiceImpl implements IGenTableService {
|
||||
* @return 包含字段集合的业务表实体
|
||||
*/
|
||||
private GenTable getGenTable(Long tableId) {
|
||||
GenTable table = baseMapper.selectById(tableId);
|
||||
GenTable table = tableMapper.selectById(tableId);
|
||||
if (ObjectUtil.isNull(table)) {
|
||||
throw new ServiceException("业务表不存在");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user