37cc8ee0d5
- gxmu_module_registry 增加 has_college(4 张在跑表置 1,含已有库补列与补数据语句) - 种子补 gxmu_tygl_form / gxmu_tygl(enabled=0,团员管理,sort 11/12), 同步修正末尾「执行后校验」:12 行未删除、5 行启用、has_college 4 行 - GET /api/gxmu/module-registry/list 支持 all=true(默认只返回启用), 改为返回 ModuleRegistryDTO,不再外泄 tenantId / userId / 时间戳 - ModuleRegistryService:删掉无生产调用的 titleOf(String)/allModules, 标题回退收敛成唯一的静态 titleOf(Map, module);getByModule 改由 hasCollege 使用 - listAll 只保留 SQL 排序(sort_number 升序,NULL 排最前,与 MySQL ASC 口径一致), 删掉内存二次排序 - ModuleRegistryIntegrityChecker 增加反向告警:review_flow_config 里有、注册表里没有的 module 打 warn,不阻断启动 refs #58
43 lines
1.5 KiB
Java
43 lines
1.5 KiB
Java
package com.gxwebsoft.gxmu.module.mapper;
|
|
|
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
|
import com.gxwebsoft.gxmu.module.entity.ModuleRegistry;
|
|
import org.apache.ibatis.annotations.Param;
|
|
import org.apache.ibatis.annotations.Select;
|
|
|
|
import java.util.Collection;
|
|
import java.util.List;
|
|
|
|
/**
|
|
* 模块注册表 Mapper
|
|
*
|
|
* @author Codex
|
|
* @since 2026-11-10
|
|
*/
|
|
public interface ModuleRegistryMapper extends BaseMapper<ModuleRegistry> {
|
|
|
|
/**
|
|
* 查询当前库中真实存在的表名,用于启动期校验注册表引用的业务表。
|
|
*
|
|
* @param names 待校验的表名集合
|
|
* @return 存在的表名
|
|
*/
|
|
@Select("<script>"
|
|
+ "SELECT TABLE_NAME FROM information_schema.TABLES "
|
|
+ "WHERE TABLE_SCHEMA = DATABASE() AND TABLE_NAME IN "
|
|
+ "<foreach collection='names' item='name' open='(' separator=',' close=')'>#{name}</foreach>"
|
|
+ "</script>")
|
|
List<String> selectExistingTableNames(@Param("names") Collection<String> names);
|
|
|
|
/**
|
|
* 审批链配置里出现过的模块名,用于反向校验「有审批链但注册表没登记」的模块。
|
|
*
|
|
* <p>只用于启动期告警,不阻断启动:存量脏数据不该挡住上线。
|
|
*
|
|
* @return 审批链配置里的模块名(去重)
|
|
*/
|
|
@Select("SELECT DISTINCT module FROM gxmu_review_flow_config "
|
|
+ "WHERE deleted = 0 AND module IS NOT NULL AND module <> ''")
|
|
List<String> selectConfiguredModules();
|
|
}
|