refactor(database): 更新实体及Mapper中表名为gxwebsoft_core前缀

- 修改所有实体类@TableName注解的表名,添加gxwebsoft_core数据库前缀
- 更新各XML Mapper中的SQL语句表名,统一加上gxwebsoft_core前缀
- 调整关联查询和多个子查询中的表名对应关系,确保与实体类一致
- 涉及实体类包括Company、CompanyComment、Dict、User等多个核心业务表
- 保持代码逻辑和功能不变,确保数据库访问路径更新规范化
This commit is contained in:
2026-07-19 00:12:22 +08:00
parent 79b3575043
commit 07bc994eba
52 changed files with 225 additions and 63 deletions

View File

@@ -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;

View File

@@ -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;

View File

@@ -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;

View File

@@ -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;

View File

@@ -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;

View File

@@ -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;

View File

@@ -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;

View File

@@ -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;

View File

@@ -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;

View File

@@ -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;

View File

@@ -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;

View File

@@ -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;

View File

@@ -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;

View File

@@ -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; // 登录成功

View File

@@ -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;

View File

@@ -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;

View File

@@ -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;

View File

@@ -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; // 菜单类型

View File

@@ -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;

View File

@@ -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;

View File

@@ -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;

View File

@@ -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;

View File

@@ -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;

View File

@@ -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;

View File

@@ -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;

View File

@@ -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;

View File

@@ -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;

View File

@@ -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;

View File

@@ -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;

View File

@@ -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 {

View File

@@ -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;

View File

@@ -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}

View File

@@ -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}

View File

@@ -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}

View File

@@ -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>

View File

@@ -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}

View File

@@ -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}

View File

@@ -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}

View File

@@ -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}

View File

@@ -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}

View File

@@ -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>

View File

@@ -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">

View File

@@ -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}

View File

@@ -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

View File

@@ -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>

View File

@@ -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>

View File

@@ -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}

View File

@@ -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}

View File

@@ -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>

View File

@@ -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}