refactor(database): 更新实体及Mapper中表名为gxwebsoft_core前缀
- 修改所有实体类@TableName注解的表名,添加gxwebsoft_core数据库前缀 - 更新各XML Mapper中的SQL语句表名,统一加上gxwebsoft_core前缀 - 调整关联查询和多个子查询中的表名对应关系,确保与实体类一致 - 涉及实体类包括Company、CompanyComment、Dict、User等多个核心业务表 - 保持代码逻辑和功能不变,确保数据库访问路径更新规范化
This commit is contained in:
38
.workbuddy/memory/2026-07-18.md
Normal file
38
.workbuddy/memory/2026-07-18.md
Normal file
@@ -0,0 +1,38 @@
|
||||
# 2026-07-18
|
||||
|
||||
## 生产日志报错分析(cms-api)
|
||||
|
||||
用户贴了一段 cms-api 容器日志,三类信息,结论如下:
|
||||
|
||||
1. **`Table 'modules.sys_user' doesn't exist`(真 bug,影响功能)**
|
||||
- 根因:部署的 MySQL 库名是 `modules`(`application-prod.yml`/`application-cms.yml` 中 `jdbc:mysql://.../modules`),而 `common.system.entity.User` 实体 `@TableName("sys_user")`,且 cms 模块多处使用 `UserService`(`CmsNavigationController`、`CmsArticleController`、`LeadReferralServiceImpl` 等)。`modules` 库里缺 `sys_user` 系统表 → 任何依赖查 `sys_user` 的请求抛 `SQLSyntaxErrorException` → 500。
|
||||
- 性质:数据库初始化/迁移遗漏,**不是代码逻辑 bug**(代码正确,库缺表)。仓库内无 `sys_user` 建表 SQL,说明系统基础表由外部初始化脚本/主 server 工程提供。
|
||||
- 修复方向:在 `modules` 库执行系统基础 schema(建 `sys_user` 等系统表)。需找到对应 init SQL。
|
||||
|
||||
2. **`参数类型转换异常: 参数名=id, 传入值=resolveDomain/getByDomain/submitForm/.../NaN`(噪音,不影响)**
|
||||
- 来源:`BaseController.handleMethodArgumentTypeMismatch`(`@ExceptionHandler(MethodArgumentTypeMismatchException)`),扫描器/爬虫用方法名字符串(resolveDomain、submitForm 等)和 NaN 探测 `id`(Integer) 参数,被拦截并返回友好错误。属公网 API 被扫描,无功能影响。建议:改用 logger 替代 `System.err.println`,必要时加限流/WAF。
|
||||
|
||||
3. **`定时任务需要查询所有租户的超时订单 list = 0`(正常,不影响)**
|
||||
- 来源:`OrderCancelServiceImpl.findExpiredUnpaidOrders` 的 `System.out.println`,表示当前无超时未支付订单。正常运维日志。
|
||||
|
||||
## 修复:sys_ 系统表改指 gxwebsoft_core schema
|
||||
|
||||
用户确认架构意图:系统表(sys_ 前缀)本就在中央库 `gxwebsoft_core`(与 `modules` 同实例 `1Panel-mysql-Bqdt`),pwl 模块 Mapper XML 早就在用 `gxwebsoft_core.sys_user`/`gxwebsoft_core.sys_dict_data`。原报错是实体 `@TableName("sys_xxx")` 默认落到数据源默认库 `modules` 导致表缺失。
|
||||
|
||||
已用脚本批量修改(精确、白名单防误伤):
|
||||
- 33 个实体 `@TableName("sys_xxx")` → `"gxwebsoft_core.sys_xxx"`(全部在 `common/system/entity`)。
|
||||
- 19 个 Mapper XML 里 `FROM/JOIN` 后的 `sys_` 表名加 `gxwebsoft_core.` 前缀(31 处,全在 `common/system/mapper/xml`)。
|
||||
- 其他模块(pwl/shop/app)对 sys_ 表的引用本来就是 `gxwebsoft_core.` 开头,未动。
|
||||
- `MybatisPlusConfig` 无全局表前缀,无冲突。
|
||||
|
||||
校验:裸 `@TableName("sys_`=0、裸 `FROM/JOIN sys_`=0、重复前缀=0。`UserInfo`/`EmailRecord`/`Payment` 等 sys_ 实体也已覆盖。
|
||||
|
||||
注意点(已告知用户):
|
||||
- 需重新编译/重启 cms-api 容器生效。
|
||||
- 确认 `modules` 库的连接账号对 `gxwebsoft_core` 有读写权限,且 `gxwebsoft_core` 里确实建齐了这些 sys_ 表。
|
||||
- 多租户插件会给查询加 `tenant_id`,表结构/字段不变则行为不变。
|
||||
|
||||
## 生成 gxwebsoft_core 缺失系统表检查 SQL
|
||||
|
||||
从实体 `@TableName` 精确提取共 **31 张** `sys_` 表,生成 `docs/check_gxwebsoft_core_sys_tables.sql`。
|
||||
含四种查法:① 只列缺失表(结果空=齐全)② 逐张 EXISTS/MISSING 状态 ③ 期望31/实际/缺失数量统计 ④ 确认 gxwebsoft_core 库存在+账号有权限。基于 `information_schema.tables` 比对,无副作用只读。
|
||||
124
docs/check_gxwebsoft_core_sys_tables.sql
Normal file
124
docs/check_gxwebsoft_core_sys_tables.sql
Normal file
@@ -0,0 +1,124 @@
|
||||
-- =====================================================================
|
||||
-- 检查 gxwebsoft_core 库缺失的系统表(sys_ 前缀)
|
||||
-- 用途:代码已把所有 @TableName / Mapper SQL 指向 gxwebsoft_core.sys_xxx,
|
||||
-- 本脚本用于确认 gxwebsoft_core 库里这 31 张系统表是否都已建好。
|
||||
-- 用法:在能访问 gxwebsoft_core 的 MySQL 连接里执行。
|
||||
-- =====================================================================
|
||||
|
||||
-- ---------------------------------------------------------------------
|
||||
-- 方式一(推荐):一次性列出「缺失的表」。结果集为空 = 全部齐全。
|
||||
-- ---------------------------------------------------------------------
|
||||
SELECT t.table_name AS missing_table
|
||||
FROM (
|
||||
SELECT 'sys_company' AS table_name UNION ALL
|
||||
SELECT 'sys_company_comment' UNION ALL
|
||||
SELECT 'sys_company_content' UNION ALL
|
||||
SELECT 'sys_company_git' UNION ALL
|
||||
SELECT 'sys_company_parameter' UNION ALL
|
||||
SELECT 'sys_company_url' UNION ALL
|
||||
SELECT 'sys_dict' UNION ALL
|
||||
SELECT 'sys_dict_data' UNION ALL
|
||||
SELECT 'sys_dictionary' UNION ALL
|
||||
SELECT 'sys_dictionary_data' UNION ALL
|
||||
SELECT 'sys_domain' UNION ALL
|
||||
SELECT 'sys_email_record' UNION ALL
|
||||
SELECT 'sys_file_record' UNION ALL
|
||||
SELECT 'sys_login_record' UNION ALL
|
||||
SELECT 'sys_menu' UNION ALL
|
||||
SELECT 'sys_operation_record' UNION ALL
|
||||
SELECT 'sys_organization' UNION ALL
|
||||
SELECT 'sys_payment' UNION ALL
|
||||
SELECT 'sys_plug' UNION ALL
|
||||
SELECT 'sys_role' UNION ALL
|
||||
SELECT 'sys_role_menu' UNION ALL
|
||||
SELECT 'sys_setting' UNION ALL
|
||||
SELECT 'sys_tenant' UNION ALL
|
||||
SELECT 'sys_user' UNION ALL
|
||||
SELECT 'sys_user_balance_log' UNION ALL
|
||||
SELECT 'sys_user_collection' UNION ALL
|
||||
SELECT 'sys_user_file' UNION ALL
|
||||
SELECT 'sys_user_referee' UNION ALL
|
||||
SELECT 'sys_user_role' UNION ALL
|
||||
SELECT 'sys_user_role_extend' UNION ALL
|
||||
SELECT 'sys_user_verify'
|
||||
) t
|
||||
LEFT JOIN information_schema.tables ist
|
||||
ON ist.table_schema = 'gxwebsoft_core'
|
||||
AND ist.table_name = t.table_name
|
||||
WHERE ist.table_name IS NULL
|
||||
ORDER BY t.table_name;
|
||||
|
||||
|
||||
-- ---------------------------------------------------------------------
|
||||
-- 方式二:逐张列出状态(EXISTS / MISSING),一目了然看全貌。
|
||||
-- ---------------------------------------------------------------------
|
||||
SELECT
|
||||
t.table_name,
|
||||
CASE WHEN ist.table_name IS NULL THEN 'MISSING' ELSE 'EXISTS' END AS status
|
||||
FROM (
|
||||
SELECT 'sys_company' AS table_name UNION ALL
|
||||
SELECT 'sys_company_comment' UNION ALL
|
||||
SELECT 'sys_company_content' UNION ALL
|
||||
SELECT 'sys_company_git' UNION ALL
|
||||
SELECT 'sys_company_parameter' UNION ALL
|
||||
SELECT 'sys_company_url' UNION ALL
|
||||
SELECT 'sys_dict' UNION ALL
|
||||
SELECT 'sys_dict_data' UNION ALL
|
||||
SELECT 'sys_dictionary' UNION ALL
|
||||
SELECT 'sys_dictionary_data' UNION ALL
|
||||
SELECT 'sys_domain' UNION ALL
|
||||
SELECT 'sys_email_record' UNION ALL
|
||||
SELECT 'sys_file_record' UNION ALL
|
||||
SELECT 'sys_login_record' UNION ALL
|
||||
SELECT 'sys_menu' UNION ALL
|
||||
SELECT 'sys_operation_record' UNION ALL
|
||||
SELECT 'sys_organization' UNION ALL
|
||||
SELECT 'sys_payment' UNION ALL
|
||||
SELECT 'sys_plug' UNION ALL
|
||||
SELECT 'sys_role' UNION ALL
|
||||
SELECT 'sys_role_menu' UNION ALL
|
||||
SELECT 'sys_setting' UNION ALL
|
||||
SELECT 'sys_tenant' UNION ALL
|
||||
SELECT 'sys_user' UNION ALL
|
||||
SELECT 'sys_user_balance_log' UNION ALL
|
||||
SELECT 'sys_user_collection' UNION ALL
|
||||
SELECT 'sys_user_file' UNION ALL
|
||||
SELECT 'sys_user_referee' UNION ALL
|
||||
SELECT 'sys_user_role' UNION ALL
|
||||
SELECT 'sys_user_role_extend' UNION ALL
|
||||
SELECT 'sys_user_verify'
|
||||
) t
|
||||
LEFT JOIN information_schema.tables ist
|
||||
ON ist.table_schema = 'gxwebsoft_core'
|
||||
AND ist.table_name = t.table_name
|
||||
ORDER BY status DESC, t.table_name;
|
||||
|
||||
|
||||
-- ---------------------------------------------------------------------
|
||||
-- 方式三:统计汇总(应有 31 张,看实际存在几张)。
|
||||
-- ---------------------------------------------------------------------
|
||||
SELECT
|
||||
31 AS expected_count,
|
||||
COUNT(*) AS existing_count,
|
||||
31 - COUNT(*) AS missing_count
|
||||
FROM information_schema.tables
|
||||
WHERE table_schema = 'gxwebsoft_core'
|
||||
AND table_name IN (
|
||||
'sys_company','sys_company_comment','sys_company_content','sys_company_git',
|
||||
'sys_company_parameter','sys_company_url','sys_dict','sys_dict_data',
|
||||
'sys_dictionary','sys_dictionary_data','sys_domain','sys_email_record',
|
||||
'sys_file_record','sys_login_record','sys_menu','sys_operation_record',
|
||||
'sys_organization','sys_payment','sys_plug','sys_role','sys_role_menu',
|
||||
'sys_setting','sys_tenant','sys_user','sys_user_balance_log',
|
||||
'sys_user_collection','sys_user_file','sys_user_referee','sys_user_role',
|
||||
'sys_user_role_extend','sys_user_verify'
|
||||
);
|
||||
|
||||
|
||||
-- ---------------------------------------------------------------------
|
||||
-- 附:确认连接账号能访问 gxwebsoft_core(库是否存在 + 是否有权限)。
|
||||
-- 若这条查不到结果,说明库不存在或当前账号无权限。
|
||||
-- ---------------------------------------------------------------------
|
||||
SELECT schema_name
|
||||
FROM information_schema.schemata
|
||||
WHERE schema_name = 'gxwebsoft_core';
|
||||
@@ -22,7 +22,7 @@ import java.util.List;
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Schema(name = "Company对象", description = "企业信息")
|
||||
@TableName("sys_company")
|
||||
@TableName("gxwebsoft_core.sys_company")
|
||||
public class Company implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@ import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Schema(name = "CompanyComment对象", description = "应用评论")
|
||||
@TableName("sys_company_comment")
|
||||
@TableName("gxwebsoft_core.sys_company_comment")
|
||||
public class CompanyComment implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Schema(name = "CompanyContent对象", description = "应用详情")
|
||||
@TableName("sys_company_content")
|
||||
@TableName("gxwebsoft_core.sys_company_content")
|
||||
public class CompanyContent implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@ import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Schema(name = "CompanyGit对象", description = "代码仓库")
|
||||
@TableName("sys_company_git")
|
||||
@TableName("gxwebsoft_core.sys_company_git")
|
||||
public class CompanyGit implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@@ -74,7 +74,7 @@ public class CompanyGit implements Serializable {
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Schema(name = "UserBalanceLog对象", description = "用户余额变动明细表")
|
||||
@TableName("sys_user_balance_log")
|
||||
@TableName("gxwebsoft_core.sys_user_balance_log")
|
||||
public static class UserBalanceLog implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Schema(name = "CompanyParameter对象", description = "应用参数")
|
||||
@TableName("sys_company_parameter")
|
||||
@TableName("gxwebsoft_core.sys_company_parameter")
|
||||
public class CompanyParameter implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Schema(name = "CompanyUrl对象", description = "应用域名")
|
||||
@TableName("sys_company_url")
|
||||
@TableName("gxwebsoft_core.sys_company_url")
|
||||
public class CompanyUrl implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@ import java.util.Set;
|
||||
*/
|
||||
@Data
|
||||
@Schema(description = "字典(业务类)")
|
||||
@TableName("sys_dict")
|
||||
@TableName("gxwebsoft_core.sys_dict")
|
||||
public class Dict implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
*/
|
||||
@Data
|
||||
@Schema(description = "字典数据(业务类)")
|
||||
@TableName("sys_dict_data")
|
||||
@TableName("gxwebsoft_core.sys_dict_data")
|
||||
public class DictData implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ import lombok.Data;
|
||||
*/
|
||||
@Data
|
||||
@Schema(description = "字典(系统类)")
|
||||
@TableName("sys_dictionary")
|
||||
@TableName("gxwebsoft_core.sys_dictionary")
|
||||
public class Dictionary implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@ import lombok.Data;
|
||||
*/
|
||||
@Data
|
||||
@Schema(description = "字典数据(系统类)")
|
||||
@TableName("sys_dictionary_data")
|
||||
@TableName("gxwebsoft_core.sys_dictionary_data")
|
||||
public class DictionaryData implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@ import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Schema(name = "Domain对象", description = "授权域名")
|
||||
@TableName("sys_domain")
|
||||
@TableName("gxwebsoft_core.sys_domain")
|
||||
public class Domain implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@ import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
*/
|
||||
@Data
|
||||
@Schema(description = "邮件发送记录")
|
||||
@TableName("sys_email_record")
|
||||
@TableName("gxwebsoft_core.sys_email_record")
|
||||
public class EmailRecord implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
*/
|
||||
@Data
|
||||
@Schema(description = "文件上传记录")
|
||||
@TableName("sys_file_record")
|
||||
@TableName("gxwebsoft_core.sys_file_record")
|
||||
public class FileRecord implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@ import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
*/
|
||||
@Data
|
||||
@Schema(description = "登录日志")
|
||||
@TableName("sys_login_record")
|
||||
@TableName("gxwebsoft_core.sys_login_record")
|
||||
public class LoginRecord implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
public static final int TYPE_LOGIN = 0; // 登录成功
|
||||
|
||||
@@ -17,7 +17,7 @@ import java.util.List;
|
||||
*/
|
||||
@Data
|
||||
@Schema(description = "菜单")
|
||||
@TableName("sys_menu")
|
||||
@TableName("gxwebsoft_core.sys_menu")
|
||||
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||
public class Menu implements GrantedAuthority {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@@ -18,7 +18,7 @@ import lombok.Data;
|
||||
*/
|
||||
@Data
|
||||
@Schema(description = "组织机构")
|
||||
@TableName("sys_organization")
|
||||
@TableName("gxwebsoft_core.sys_organization")
|
||||
public class Organization implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@ import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Schema(name = "Payment对象", description = "支付方式")
|
||||
@TableName("sys_payment")
|
||||
@TableName("gxwebsoft_core.sys_payment")
|
||||
public class Payment implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ import java.util.List;
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Schema(name = "Plug对象", description = "插件扩展")
|
||||
@TableName("sys_plug")
|
||||
@TableName("gxwebsoft_core.sys_plug")
|
||||
public class Plug implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
public static final int TYPE_MENU = 0; // 菜单类型
|
||||
|
||||
@@ -17,7 +17,7 @@ import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
*/
|
||||
@Data
|
||||
@Schema(description = "角色")
|
||||
@TableName("sys_role")
|
||||
@TableName("gxwebsoft_core.sys_role")
|
||||
public class Role implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@ import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
*/
|
||||
@Data
|
||||
@Schema(description = "角色权限")
|
||||
@TableName("sys_role_menu")
|
||||
@TableName("gxwebsoft_core.sys_role_menu")
|
||||
public class RoleMenu implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@ import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Schema(name = "Setting对象", description = "系统设置")
|
||||
@TableName("sys_setting")
|
||||
@TableName("gxwebsoft_core.sys_setting")
|
||||
public class Setting implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@ import java.util.List;
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Schema(name = "Tenant对象", description = "租户")
|
||||
@TableName("sys_tenant")
|
||||
@TableName("gxwebsoft_core.sys_tenant")
|
||||
public class Tenant implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ import java.util.List;
|
||||
*/
|
||||
@Data
|
||||
@Schema(description = "用户")
|
||||
@TableName("sys_user")
|
||||
@TableName("gxwebsoft_core.sys_user")
|
||||
public class User implements UserDetails {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@ import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Schema(name = "UserBalanceLog对象", description = "用户余额变动明细表")
|
||||
@TableName("sys_user_balance_log")
|
||||
@TableName("gxwebsoft_core.sys_user_balance_log")
|
||||
public class UserBalanceLog implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Schema(name = "UserCollection对象", description = "我的收藏")
|
||||
@TableName("sys_user_collection")
|
||||
@TableName("gxwebsoft_core.sys_user_collection")
|
||||
public class UserCollection implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@ import lombok.EqualsAndHashCode;
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Schema(name = "UserFile对象", description = "用户文件")
|
||||
@TableName("sys_user_file")
|
||||
@TableName("gxwebsoft_core.sys_user_file")
|
||||
public class UserFile implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@ import java.util.List;
|
||||
*/
|
||||
@Data
|
||||
@Schema(description = "用户")
|
||||
@TableName("sys_user")
|
||||
@TableName("gxwebsoft_core.sys_user")
|
||||
public class UserInfo {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@ import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Schema(name = "UserReferee对象", description = "用户推荐关系表")
|
||||
@TableName("sys_user_referee")
|
||||
@TableName("gxwebsoft_core.sys_user_referee")
|
||||
public class UserReferee implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@ import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
*/
|
||||
@Data
|
||||
@Schema(description = "用户角色")
|
||||
@TableName("sys_user_role")
|
||||
@TableName("gxwebsoft_core.sys_user_role")
|
||||
public class UserRole implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@ import java.time.LocalDateTime;
|
||||
* @since 2026-04-14
|
||||
*/
|
||||
@Data
|
||||
@TableName("sys_user_role_extend")
|
||||
@TableName("gxwebsoft_core.sys_user_role_extend")
|
||||
@Schema(name = "UserRoleExtend", description = "用户角色扩展")
|
||||
public class UserRoleExtend implements Serializable {
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@ import java.util.Date;
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Schema(name = "UserVerify对象", description = "实名认证")
|
||||
@TableName("sys_user_verify")
|
||||
@TableName("gxwebsoft_core.sys_user_verify")
|
||||
public class UserVerify implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
<!-- 关联查询sql -->
|
||||
<sql id="selectSql">
|
||||
SELECT a.*
|
||||
FROM sys_company_comment a
|
||||
FROM gxwebsoft_core.sys_company_comment a
|
||||
<where>
|
||||
<if test="param.id != null">
|
||||
AND a.id = #{param.id}
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
<!-- 关联查询sql -->
|
||||
<sql id="selectSql">
|
||||
SELECT a.*
|
||||
FROM sys_company_content a
|
||||
FROM gxwebsoft_core.sys_company_content a
|
||||
<where>
|
||||
<if test="param.id != null">
|
||||
AND a.id = #{param.id}
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
<!-- 关联查询sql -->
|
||||
<sql id="selectSql">
|
||||
SELECT a.*
|
||||
FROM sys_company_git a
|
||||
FROM gxwebsoft_core.sys_company_git a
|
||||
<where>
|
||||
<if test="param.id != null">
|
||||
AND a.id = #{param.id}
|
||||
|
||||
@@ -156,8 +156,8 @@
|
||||
<!-- 企业查询不限租户 -->
|
||||
<select id="getCompanyAll" resultType="com.gxwebsoft.common.system.entity.Company">
|
||||
SELECT a.*,b.tenant_id,b.tenant_name,b.tenant_code
|
||||
FROM sys_company a
|
||||
LEFT JOIN sys_tenant b ON a.tenant_id = b.tenant_id
|
||||
FROM gxwebsoft_core.sys_company a
|
||||
LEFT JOIN gxwebsoft_core.sys_tenant b ON a.tenant_id = b.tenant_id
|
||||
<where>
|
||||
<if test="companyId != null">
|
||||
AND a.company_id = #{companyId}
|
||||
@@ -177,22 +177,22 @@
|
||||
|
||||
<!-- 更新企业信息-->
|
||||
<update id="updateByCompanyId">
|
||||
UPDATE sys_company SET storage = #{param.storage} WHERE company_id = #{param.companyId}
|
||||
UPDATE gxwebsoft_core.sys_company SET storage = #{param.storage} WHERE company_id = #{param.companyId}
|
||||
</update>
|
||||
|
||||
<!-- 删除企业信息-->
|
||||
<update id="removeCompanyAll">
|
||||
UPDATE sys_company SET deleted = 1 WHERE company_id = #{param.companyId}
|
||||
UPDATE gxwebsoft_core.sys_company SET deleted = 1 WHERE company_id = #{param.companyId}
|
||||
</update>
|
||||
|
||||
<update id="undeleteAll">
|
||||
UPDATE sys_company SET deleted = 0 WHERE company_id = #{param.companyId}
|
||||
UPDATE gxwebsoft_core.sys_company SET deleted = 0 WHERE company_id = #{param.companyId}
|
||||
</update>
|
||||
|
||||
<!-- 按租户ID检查企业 -->
|
||||
<select id="getByTenantId" resultType="com.gxwebsoft.common.system.entity.Company">
|
||||
SELECT a.*
|
||||
FROM sys_company a WHERE a.tenant_id = #{tenantId} and a.deleted = 0
|
||||
FROM gxwebsoft_core.sys_company a WHERE a.tenant_id = #{tenantId} and a.deleted = 0
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
<!-- 关联查询sql -->
|
||||
<sql id="selectSql">
|
||||
SELECT a.*
|
||||
FROM sys_company_parameter a
|
||||
FROM gxwebsoft_core.sys_company_parameter a
|
||||
<where>
|
||||
<if test="param.id != null">
|
||||
AND a.id = #{param.id}
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
<!-- 关联查询sql -->
|
||||
<sql id="selectSql">
|
||||
SELECT a.*
|
||||
FROM sys_company_url a
|
||||
FROM gxwebsoft_core.sys_company_url a
|
||||
<where>
|
||||
<if test="param.id != null">
|
||||
AND a.id = #{param.id}
|
||||
|
||||
@@ -62,7 +62,7 @@
|
||||
SELECT a.*,
|
||||
b.dict_code,
|
||||
b.dict_name
|
||||
FROM sys_dict_data a
|
||||
FROM gxwebsoft_core.sys_dict_data a
|
||||
LEFT JOIN gxwebsoft_core.sys_dict b ON a.dict_id = b.dict_id
|
||||
WHERE a.dict_data_name = #{dictDataName}
|
||||
AND b.dict_code = #{dictCode}
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
SELECT a.*,
|
||||
b.dict_code,
|
||||
b.dict_name
|
||||
FROM sys_dictionary_data a
|
||||
FROM gxwebsoft_core.sys_dictionary_data a
|
||||
LEFT JOIN gxwebsoft_core.sys_dictionary b ON a.dict_id = b.dict_id
|
||||
<where>
|
||||
AND a.deleted = 0
|
||||
@@ -62,7 +62,7 @@
|
||||
SELECT a.*,
|
||||
b.dict_code,
|
||||
b.dict_name
|
||||
FROM sys_dictionary_data a
|
||||
FROM gxwebsoft_core.sys_dictionary_data a
|
||||
LEFT JOIN gxwebsoft_core.sys_dictionary b ON a.dict_id = b.dict_id
|
||||
WHERE a.dict_data_name = #{dictDataName}
|
||||
AND b.dict_code = #{dictCode}
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
<!-- 关联查询sql -->
|
||||
<sql id="selectSql">
|
||||
SELECT a.*
|
||||
FROM sys_domain a
|
||||
FROM gxwebsoft_core.sys_domain a
|
||||
<where>
|
||||
<if test="param.id != null">
|
||||
AND a.id = #{param.id}
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
b.nickname create_nickname,
|
||||
b.avatar,
|
||||
c.merchant_code
|
||||
FROM sys_file_record a
|
||||
FROM gxwebsoft_core.sys_file_record a
|
||||
LEFT JOIN gxwebsoft_core.sys_user b ON a.create_user_id = b.user_id
|
||||
LEFT JOIN shop_merchant c ON a.merchant_code = c.merchant_code
|
||||
<where>
|
||||
@@ -68,7 +68,7 @@
|
||||
<!-- 根据path查询 -->
|
||||
<select id="getByIdPath" resultType="com.gxwebsoft.common.system.entity.FileRecord">
|
||||
SELECT *
|
||||
FROM sys_file_record
|
||||
FROM gxwebsoft_core.sys_file_record
|
||||
WHERE path = #{path}
|
||||
</select>
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
SELECT a.*,
|
||||
b.user_id,
|
||||
b.nickname
|
||||
FROM sys_login_record a
|
||||
FROM gxwebsoft_core.sys_login_record a
|
||||
LEFT JOIN gxwebsoft_core.sys_user b ON a.username = b.username
|
||||
<where>
|
||||
<if test="param.id != null">
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
<!-- 关联查询sql -->
|
||||
<sql id="selectSql">
|
||||
SELECT a.*
|
||||
FROM sys_menu a
|
||||
FROM gxwebsoft_core.sys_menu a
|
||||
<where>
|
||||
<if test="param.menuId != null">
|
||||
AND a.menu_id = #{param.menuId}
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
<!-- 机构类型字典查询sql -->
|
||||
<sql id="selectOrgTypeDictSql">
|
||||
SELECT ta.*
|
||||
FROM sys_dictionary_data ta
|
||||
FROM gxwebsoft_core.sys_dictionary_data ta
|
||||
LEFT JOIN gxwebsoft_core.sys_dictionary tb
|
||||
ON ta.dict_id = tb.dict_id
|
||||
AND tb.deleted = 0
|
||||
@@ -19,7 +19,7 @@
|
||||
b.dict_data_name organization_type_name,
|
||||
c.nickname leader_nickname,
|
||||
c.username leader_username
|
||||
FROM sys_organization a
|
||||
FROM gxwebsoft_core.sys_organization a
|
||||
LEFT JOIN (
|
||||
<include refid="selectOrgTypeDictSql"/>
|
||||
) b ON a.organization_type = b.dict_data_code
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
<!-- 关联查询sql -->
|
||||
<sql id="selectSql">
|
||||
SELECT a.*,b.tenant_name,c.company_name,c.short_name,c.domain
|
||||
FROM sys_plug a
|
||||
FROM gxwebsoft_core.sys_plug a
|
||||
LEFT JOIN gxwebsoft_core.sys_tenant b ON a.tenant_id = b.tenant_id
|
||||
LEFT JOIN gxwebsoft_core.sys_company c ON a.tenant_id = c.tenant_id
|
||||
<where>
|
||||
|
||||
@@ -5,11 +5,11 @@
|
||||
<!-- 查询用户的菜单 -->
|
||||
<select id="listMenuByUserId" resultType="com.gxwebsoft.common.system.entity.Menu">
|
||||
SELECT a.*
|
||||
FROM sys_menu a
|
||||
FROM gxwebsoft_core.sys_menu a
|
||||
<where>
|
||||
AND a.menu_id IN (
|
||||
SELECT menu_id FROM sys_role_menu WHERE role_id IN (
|
||||
SELECT ta.role_id FROM sys_user_role ta LEFT JOIN gxwebsoft_core.sys_role tb ON ta.role_id = tb.role_id
|
||||
SELECT menu_id FROM gxwebsoft_core.sys_role_menu WHERE role_id IN (
|
||||
SELECT ta.role_id FROM gxwebsoft_core.sys_user_role ta LEFT JOIN gxwebsoft_core.sys_role tb ON ta.role_id = tb.role_id
|
||||
WHERE ta.user_id = #{userId} AND tb.deleted = 0
|
||||
)
|
||||
)
|
||||
@@ -24,9 +24,9 @@
|
||||
<!-- 根据角色id查询菜单 -->
|
||||
<select id="listMenuByRoleIds" resultType="com.gxwebsoft.common.system.entity.Menu">
|
||||
SELECT a.*
|
||||
FROM sys_menu a
|
||||
FROM gxwebsoft_core.sys_menu a
|
||||
<where>
|
||||
AND a.menu_id IN (SELECT menu_id FROM sys_role_menu WHERE role_id IN
|
||||
AND a.menu_id IN (SELECT menu_id FROM gxwebsoft_core.sys_role_menu WHERE role_id IN
|
||||
<foreach collection="roleIds" item="roleId" separator="," open="(" close=")">
|
||||
#{roleId}
|
||||
</foreach>
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
<!-- 关联查询sql -->
|
||||
<sql id="selectSql">
|
||||
SELECT a.*
|
||||
FROM sys_tenant a
|
||||
FROM gxwebsoft_core.sys_tenant a
|
||||
<where>
|
||||
<if test="param.tenantId != null">
|
||||
AND a.tenant_id = #{param.tenantId}
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
<!-- 关联查询sql -->
|
||||
<sql id="selectSql">
|
||||
SELECT a.*
|
||||
FROM sys_user_collection a
|
||||
FROM gxwebsoft_core.sys_user_collection a
|
||||
<where>
|
||||
<if test="param.id != null">
|
||||
AND a.id = #{param.id}
|
||||
|
||||
@@ -145,7 +145,7 @@
|
||||
)
|
||||
</if>
|
||||
<if test="param.parentId != null">
|
||||
AND a.organization_id IN (SELECT organization_id FROM sys_organization WHERE parent_id=#{param.parentId})
|
||||
AND a.organization_id IN (SELECT organization_id FROM gxwebsoft_core.sys_organization WHERE parent_id=#{param.parentId})
|
||||
</if>
|
||||
</where>
|
||||
</sql>
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
<!-- 关联查询sql -->
|
||||
<sql id="selectSql">
|
||||
SELECT a.*
|
||||
FROM sys_user_referee a
|
||||
FROM gxwebsoft_core.sys_user_referee a
|
||||
<where>
|
||||
<if test="param.id != null">
|
||||
AND a.id = #{param.id}
|
||||
|
||||
Reference in New Issue
Block a user