| | |
| | | import cn.hutool.core.collection.CollUtil; |
| | | import cn.hutool.core.io.IoUtil; |
| | | import cn.hutool.core.lang.Dict; |
| | | import cn.hutool.core.lang.Snowflake; |
| | | import cn.hutool.core.util.IdUtil; |
| | | import cn.hutool.core.util.ObjectUtil; |
| | | import com.baomidou.dynamic.datasource.annotation.DS; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | |
| | | return TableDataInfo.build(page); |
| | | } |
| | | |
| | | /** |
| | | * 查询业务列表 |
| | | * |
| | | * @param genTable 业务信息 |
| | | * @return 业务集合 |
| | | */ |
| | | @Override |
| | | public List<GenTable> selectGenTableList(GenTable genTable) { |
| | | return baseMapper.selectList(this.buildGenTableQueryWrapper(genTable)); |
| | | } |
| | | |
| | | private QueryWrapper<GenTable> buildGenTableQueryWrapper(GenTable genTable) { |
| | | Map<String, Object> params = genTable.getParams(); |
| | | QueryWrapper<GenTable> wrapper = Wrappers.query(); |
| | |
| | | public TableDataInfo<GenTable> selectPageDbTableList(GenTable genTable, PageQuery pageQuery) { |
| | | Page<GenTable> page = baseMapper.selectPageDbTableList(pageQuery.build(), genTable); |
| | | return TableDataInfo.build(page); |
| | | } |
| | | |
| | | /** |
| | | * 查询据库列表 |
| | | * |
| | | * @param genTable 业务信息 |
| | | * @return 数据库表集合 |
| | | */ |
| | | @Override |
| | | public List<GenTable> selectDbTableList(GenTable genTable) { |
| | | return baseMapper.selectDbTableList(genTable); |
| | | } |
| | | |
| | | /** |
| | |
| | | Map<String, String> dataMap = new LinkedHashMap<>(); |
| | | // 查询表信息 |
| | | GenTable table = baseMapper.selectGenTableById(tableId); |
| | | Snowflake snowflake = IdUtil.getSnowflake(); |
| | | List<Long> menuIds = new ArrayList<>(); |
| | | for (int i = 0; i < 6; i++) { |
| | | menuIds.add(snowflake.nextId()); |
| | | } |
| | | table.setMenuIds(menuIds); |
| | | // 设置主子表信息 |
| | | setSubTable(table); |
| | | // 设置主键列信息 |
| | |
| | | private void generatorCode(String tableName, ZipOutputStream zip) { |
| | | // 查询表信息 |
| | | GenTable table = baseMapper.selectGenTableByName(tableName); |
| | | Snowflake snowflake = IdUtil.getSnowflake(); |
| | | List<Long> menuIds = new ArrayList<>(); |
| | | for (int i = 0; i < 6; i++) { |
| | | menuIds.add(snowflake.nextId()); |
| | | } |
| | | table.setMenuIds(menuIds); |
| | | // 设置主子表信息 |
| | | setSubTable(table); |
| | | // 设置主键列信息 |