cc 4 mesi fa
parent
commit
a61389859d

+ 8 - 0
src/main/java/com/qingjian/module/plat/controller/TableInfoController.java

@@ -9,6 +9,8 @@ import com.qingjian.common.model.plat.entity.TableInfo;
 import com.qingjian.module.plat.service.TableInfoService;
 import org.noear.solon.annotation.*;
 
+import java.util.List;
+
 @Mapping("/tpl")
 @Controller
 public class TableInfoController {
@@ -37,6 +39,12 @@ public class TableInfoController {
         return one != null ? 1 : 0;
     }
 
+    @Get
+    @Mapping("/cag")
+    public List<String> cag() {
+        return tableInfoService.cag();
+    }
+
     /**
      * 获取模板详情
      */

+ 5 - 0
src/main/java/com/qingjian/module/plat/mapper/TableInfoMapper.java

@@ -4,6 +4,8 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.qingjian.common.model.plat.entity.TableInfo;
 import org.apache.ibatis.annotations.Mapper;
 
+import java.util.List;
+
 /**
 * @author cc
 * @description 针对表【table_info】的数据库操作Mapper
@@ -14,6 +16,9 @@ import org.apache.ibatis.annotations.Mapper;
 public interface TableInfoMapper extends BaseMapper<TableInfo> {
 
     int getMaxId();
+
+    List<String> cag();
+
 }
 
 

+ 6 - 1
src/main/java/com/qingjian/module/plat/service/TableInfoService.java

@@ -93,7 +93,7 @@ public class TableInfoService extends ServiceImpl<TableInfoMapper, TableInfo> {
     }
 
     private List<TableField> convertTableField(TableInfo tableInfo) {
-       return tableInfo.getTableFields()
+        return tableInfo.getTableFields()
                 .stream()
                 .filter(tableField -> StrUtil.isNotEmpty(tableField.getFieldNameCn()))
                 .peek(tableField -> {
@@ -116,4 +116,9 @@ public class TableInfoService extends ServiceImpl<TableInfoMapper, TableInfo> {
         removeById(id);
         tableFieldMapper.delete(Wrappers.lambdaQuery(TableField.class).eq(TableField::getTableId, id));
     }
+
+    public List<String> cag() {
+
+        return this.baseMapper.cag();
+    }
 }

+ 4 - 0
src/main/resources/mappers/plat/TableInfoMapper.xml

@@ -22,4 +22,8 @@
     <select id="getMaxId" resultType="java.lang.Integer">
         SELECT MAX(id) AS max_id FROM table_info;
     </select>
+
+    <select id="cag" resultType="java.lang.String">
+        SELECT DISTINCT classify FROM table_info;
+    </select>
 </mapper>