OCT 1. 重构数据字典详细内容返回数据结构

2. 修改字典表,统一数据库表状态字段数据类型
This commit is contained in:
黄昕 2024-02-07 10:31:27 +08:00
parent 04ea233333
commit 0ff040bb7a
13 changed files with 187 additions and 69 deletions

View File

@ -26,7 +26,9 @@ public class DictProviderConfigure implements DictProvider {
dictTypeMapper.selectAllWithRelations().forEach(k -> { dictTypeMapper.selectAllWithRelations().forEach(k -> {
DictTypeVo.DictTypeBuilder builder = DictTypeVo.newBuilder(k.getDictType(), k.getDictName(), k.getRemark()); DictTypeVo.DictTypeBuilder builder = DictTypeVo.newBuilder(k.getDictType(), k.getDictName(), k.getRemark());
k.getDictDataList().forEach(v -> builder.add(v.getDictValue(), v.getDictLabel(), v.getDictSort())); k.getDictDataList()
.stream().filter(m -> "0".equals(m.getStatus()))
.forEach(v -> builder.add(v.getDictValue(), v.getDictLabel(), v.getDictSort()));
dictItems.add(builder.build()); dictItems.add(builder.build());
}); });

View File

@ -87,9 +87,9 @@ public class SystemDictController {
// 如果校验通过validate为空否则validate包含未校验通过项 // 如果校验通过validate为空否则validate包含未校验通过项
if (validate.isEmpty()) { if (validate.isEmpty()) {
NewUserDictReq req = mr.getMsgContent(); NewUserDictReq req = mr.getMsgContent();
dictionaryService.addNewDbDictionary(req.getDictType(), req.getDictName(), req.getRemark()); dictionaryService.addNewUserDictionary(req.getDictName(), req.getDictAlias(), req.getDictRemark());
return ProtocolResp.result(NewUserDictResp.builder() return ProtocolResp.result(NewUserDictResp.builder()
.dictType(req.getDictType()) .dictName(req.getDictName())
.build()); .build());
} else { } else {
return ProtocolResp.result(ErrorCode.ERR_PARAMEXCEPTION, ErrorCode.ERR_PARAMEXCEPTION.getHttpCode(), return ProtocolResp.result(ErrorCode.ERR_PARAMEXCEPTION, ErrorCode.ERR_PARAMEXCEPTION.getHttpCode(),
@ -107,9 +107,9 @@ public class SystemDictController {
// 如果校验通过validate为空否则validate包含未校验通过项 // 如果校验通过validate为空否则validate包含未校验通过项
if (validate.isEmpty()) { if (validate.isEmpty()) {
NewUserDictReq req = mr.getMsgContent(); NewUserDictReq req = mr.getMsgContent();
dictionaryService.addNewDbDictionary(req.getDictType(), req.getDictName(), req.getRemark()); dictionaryService.upgradeUserDictionary(req.getDictName(), req.getDictAlias(), req.getDictRemark());
return ProtocolResp.result(NewUserDictResp.builder() return ProtocolResp.result(NewUserDictResp.builder()
.dictType(req.getDictType()) .dictName(req.getDictName())
.build()); .build());
} else { } else {
return ProtocolResp.result(ErrorCode.ERR_PARAMEXCEPTION, ErrorCode.ERR_PARAMEXCEPTION.getHttpCode(), return ProtocolResp.result(ErrorCode.ERR_PARAMEXCEPTION, ErrorCode.ERR_PARAMEXCEPTION.getHttpCode(),

View File

@ -83,9 +83,9 @@ public class DictData {
/** /**
* 状态0正常 1停用 * 状态0正常 1停用
*/ */
@Schema(description = "状态0正常 1停用") @Schema(description = "状态 (CommonStatus):0-->正常1-->锁定2-->禁用,3-->删除")
@Column(value = "status") @Column(value = "status")
private String status; private Integer status;
/** /**
* 创建者 * 创建者

View File

@ -46,9 +46,9 @@ public class DictType {
/** /**
* 状态0正常 1停用 * 状态0正常 1停用
*/ */
@Schema(description = "状态0正常 1停用") @Schema(description = "状态 (CommonStatus):0-->正常1-->锁定2-->禁用,3-->删除")
@Column(value = "status") @Column(value = "status")
private String status; private Integer status;
/** /**
* 创建者 * 创建者
@ -62,7 +62,7 @@ public class DictType {
*/ */
@Schema(description = "创建时间") @Schema(description = "创建时间")
@Column(value = "create_time") @Column(value = "create_time")
private java.util.Date createTime; private Timestamp createTime;
/** /**
* 更新者 * 更新者
@ -76,7 +76,7 @@ public class DictType {
*/ */
@Schema(description = "更新时间") @Schema(description = "更新时间")
@Column(value = "update_time") @Column(value = "update_time")
private java.util.Date updateTime; private Timestamp updateTime;
/** /**
* 备注 * 备注

View File

@ -17,15 +17,15 @@ import lombok.NoArgsConstructor;
@JsonInclude(JsonInclude.Include.NON_NULL) @JsonInclude(JsonInclude.Include.NON_NULL)
@Schema(name = "NewUserDictReq", description = "新增用户字典请求参数") @Schema(name = "NewUserDictReq", description = "新增用户字典请求参数")
public class NewUserDictReq { public class NewUserDictReq {
@Schema(description = "字典类别,用于标识各个不同的字典") @Schema(description = "字典名,用于标识各个不同的字典")
@NotEmpty(message = "dictType 字典类别不能为空", groups = ValidGroups.DictReqValid.class) @NotEmpty(message = "dictName 字典类别不能为空", groups = ValidGroups.DictReqValid.class)
private String dictType;
@Schema(description = "字典名称,用于显示字典别名")
@NotNull(message = "dictName 字典类别不能为NULL", groups = ValidGroups.DictReqValid.class)
private String dictName; private String dictName;
@Schema(description = "字典别名,用于显示字典别名")
@NotNull(message = "dictAlias 字典类别不能为NULL", groups = ValidGroups.DictReqValid.class)
private String dictAlias;
@Schema(description = "字典备注信息") @Schema(description = "字典备注信息")
@NotNull(message = "remark 字典类别不能为NULL", groups = ValidGroups.DictReqValid.class) @NotNull(message = "dictRemark 字典类别不能为NULL", groups = ValidGroups.DictReqValid.class)
private String remark; private String dictRemark;
} }

View File

@ -0,0 +1,28 @@
package com.cmhi.cf.restapi.pojo.dto;
import com.cmhi.cf.validation.group.ValidGroups;
import com.fasterxml.jackson.annotation.JsonInclude;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotEmpty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@JsonInclude(JsonInclude.Include.NON_NULL)
@Schema(name = "UpgradeUserDictReq", description = "修改用户字典请求参数")
public class UpgradeUserDictReq {
@Schema(description = "字典类别,用于标识各个不同的字典")
@NotEmpty(message = "dictType 字典类别不能为空", groups = ValidGroups.DictReqValid.class)
private String dictName;
@Schema(description = "新的字典别名不修改时置为NULL")
private String newDictAlias;
@Schema(description = "新的字典备注不修改时置为NULL")
private String newDictRemark;
}

View File

@ -3,21 +3,25 @@ package com.cmhi.cf.restapi.pojo.po;
import com.cmhi.cf.restapi.pojo.base.BaseRespStatus; import com.cmhi.cf.restapi.pojo.base.BaseRespStatus;
import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import com.houkunlin.system.dict.starter.bean.DictTypeVo;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Builder; import lombok.Builder;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor; import lombok.NoArgsConstructor;
import java.util.List;
@EqualsAndHashCode(callSuper = true) @EqualsAndHashCode(callSuper = true)
@Data @Data
@Builder @Builder
@AllArgsConstructor @AllArgsConstructor
@NoArgsConstructor @NoArgsConstructor
@JsonPropertyOrder({"dictName", "dictContent", "status", "message"}) @JsonPropertyOrder({"dictId", "dictName", "dictAlias", "dictRemark", "children", "status", "message"})
@JsonInclude(JsonInclude.Include.NON_NULL) @JsonInclude(JsonInclude.Include.NON_NULL)
public class DictContent extends BaseRespStatus { public class DictContent extends BaseRespStatus {
private String dictName; private Long dictId;
private DictTypeVo dictContent; private String dictName;
private String dictAlias;
private String dictRemark;
private List<DictDetails> children;
} }

View File

@ -0,0 +1,20 @@
package com.cmhi.cf.restapi.pojo.po;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
@JsonPropertyOrder({"id", "title", "value", "sorted", "disabled"})
public class DictDetails {
private Long id;
private String title;
private Integer value;
private Integer sorted;
private Boolean disabled;
}

View File

@ -8,12 +8,8 @@ import lombok.EqualsAndHashCode;
@EqualsAndHashCode(callSuper = true) @EqualsAndHashCode(callSuper = true)
@Data @Data
@JsonPropertyOrder({"version", "status", "message"}) @Builder
@JsonPropertyOrder({"dictName", "status", "message"})
public class NewUserDictResp extends BaseRespStatus { public class NewUserDictResp extends BaseRespStatus {
private String dictType; private String dictName;
@Builder
public NewUserDictResp(String dictType) {
this.dictType = dictType;
}
} }

View File

@ -12,7 +12,9 @@ public interface DictionaryService {
List<DictContent> getEnumDictionaryContent(List<String> dictType); List<DictContent> getEnumDictionaryContent(List<String> dictType);
void addNewDbDictionary(String type, String name, String remark); void addNewUserDictionary(String type, String name, String remark);
void upgradeUserDictionary(String type, String name, String remark);
PageResults<UserDictionary> getUserDictionary(Long pageNumber, Long pageSize, Long totalSize); PageResults<UserDictionary> getUserDictionary(Long pageNumber, Long pageSize, Long totalSize);

View File

@ -1,11 +1,13 @@
package com.cmhi.cf.service.impl; package com.cmhi.cf.service.impl;
import com.cmhi.cf.common.CommonStatus;
import com.cmhi.cf.common.ErrorCode; import com.cmhi.cf.common.ErrorCode;
import com.cmhi.cf.database.common.entity.DictType; import com.cmhi.cf.database.common.entity.DictType;
import com.cmhi.cf.database.common.mapper.DictTypeMapper; import com.cmhi.cf.database.common.mapper.DictTypeMapper;
import com.cmhi.cf.exception.CommonErrorCodeException; import com.cmhi.cf.exception.CommonErrorCodeException;
import com.cmhi.cf.restapi.misc.ApiContextUtils; import com.cmhi.cf.restapi.misc.ApiContextUtils;
import com.cmhi.cf.restapi.pojo.po.DictContent; import com.cmhi.cf.restapi.pojo.po.DictContent;
import com.cmhi.cf.restapi.pojo.po.DictDetails;
import com.cmhi.cf.restapi.pojo.po.PageResults; import com.cmhi.cf.restapi.pojo.po.PageResults;
import com.cmhi.cf.restapi.pojo.po.UserDictionary; import com.cmhi.cf.restapi.pojo.po.UserDictionary;
import com.cmhi.cf.service.DictionaryService; import com.cmhi.cf.service.DictionaryService;
@ -23,6 +25,7 @@ import org.springframework.dao.DataAccessException;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import java.sql.Timestamp;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Set; import java.util.Set;
@ -49,9 +52,17 @@ public class DictionaryServiceImpl implements DictionaryService {
SystemDictStarter.getBean(SystemDictProvider.class).dictTypeIterator().forEachRemaining(k -> { SystemDictStarter.getBean(SystemDictProvider.class).dictTypeIterator().forEachRemaining(k -> {
if (dictType.contains(k.getType())) { if (dictType.contains(k.getType())) {
List<DictDetails> children = new ArrayList<>();
k.getChildren().forEach(m -> {
children.add(DictDetails.builder()
.title(m.getTitle())
.value((Integer) m.getValue())
.disabled(false)
.build());
});
sysDictList.add(DictContent.builder() sysDictList.add(DictContent.builder()
.dictName(k.getType()) .dictName(k.getType())
.dictContent(k) .children(children)
.build()); .build());
} }
allSysDict.add(k.getType()); allSysDict.add(k.getType());
@ -61,7 +72,6 @@ public class DictionaryServiceImpl implements DictionaryService {
dictType.forEach(k -> sysDictList.add(DictContent.builder() dictType.forEach(k -> sysDictList.add(DictContent.builder()
.dictName(k) .dictName(k)
.dictContent(null)
.build())); .build()));
return sysDictList; return sysDictList;
@ -69,12 +79,12 @@ public class DictionaryServiceImpl implements DictionaryService {
@Override @Override
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public void addNewDbDictionary(String type, String name, String remark) { public void addNewUserDictionary(String type, String name, String remark) {
DictType dt = new DictType(); DictType dt = new DictType();
dt.setRemark(remark); dt.setRemark(remark);
dt.setDictName(name); dt.setDictName(name);
dt.setDictType(type); dt.setDictType(type);
dt.setStatus("0"); dt.setStatus(CommonStatus.NORMAL.getValue());
dt.setCreateBy(ApiContextUtils.get().getUsername()); dt.setCreateBy(ApiContextUtils.get().getUsername());
try { try {
@ -90,6 +100,45 @@ public class DictionaryServiceImpl implements DictionaryService {
} }
} }
@Override
public void upgradeUserDictionary(String type, String name, String remark) {
boolean changed = false;
DictType dt = dictTypeMapper.selectOneByCondition(DICT_TYPE.DICT_TYPE_.eq(type));
// 找不到对应的字典供修改
if (dt == null) {
throw new CommonErrorCodeException(ErrorCode.ERR_NOSUCHITEM,
type + ": " + ErrorCode.ERR_NOSUCHITEM.getDescription());
}
if (name != null) {
dt.setDictName(name);
changed = true;
}
if (remark != null) {
dt.setRemark(remark);
changed = true;
}
// 确认执行过修改
if (changed) {
dt.setUpdateBy(ApiContextUtils.get().getUsername());
dt.setUpdateTime(new Timestamp(System.currentTimeMillis()));
if (dictTypeMapper.update(dt) != 1) {
throw new CommonErrorCodeException(ErrorCode.ERR_DATABASE);
} else {
// 数据库操作成功后更新缓存字典数据
DictTypeVo dv = DictUtil.getDictType(dt.getDictType());
dv.setRemark(dt.getRemark());
dv.setTitle(dt.getDictName());
publisher.publishEvent(new RefreshDictTypeEvent(dv));
}
}
}
@Override @Override
public PageResults<UserDictionary> getUserDictionary(Long pageNumber, Long pageSize, Long totalSize) { public PageResults<UserDictionary> getUserDictionary(Long pageNumber, Long pageSize, Long totalSize) {
if (totalSize == 0) { if (totalSize == 0) {
@ -122,10 +171,27 @@ public class DictionaryServiceImpl implements DictionaryService {
List<DictType> ret = dictTypeMapper.selectListWithRelationsByQuery(wrapper); List<DictType> ret = dictTypeMapper.selectListWithRelationsByQuery(wrapper);
ret.forEach(k -> resp.add(DictContent.builder() ret.forEach(k -> {
.dictName(k.getDictType()) List<DictDetails> children = new ArrayList<>();
.dictContent(DictUtil.getDictType(k.getDictType()))
.build())); k.getDictDataList().forEach(m -> {
children.add(DictDetails.builder()
.id(m.getId())
.title(m.getDictLabel())
.value(m.getDictValue())
.sorted(m.getDictSort())
.disabled(m.getStatus() != 0)
.build());
});
resp.add(DictContent.builder()
.dictId(k.getId())
.dictName(k.getDictType())
.dictAlias(k.getDictName())
.dictRemark(k.getRemark())
.children(children)
.build());
});
dictName.stream() dictName.stream()
.filter(k -> ret.stream().noneMatch(v -> v.getDictType().equals(k))) .filter(k -> ret.stream().noneMatch(v -> v.getDictType().equals(k)))

View File

@ -175,18 +175,18 @@ INSERT IGNORE INTO rbac_role_resource VALUES (1, 405, 1);
#insert into sys_dict_type values(1, '用户性别', 'sys_user_sex', '0', 'admin', sysdate(), '', null, '用户性别列表'); #insert into sys_dict_type values(1, '用户性别', 'sys_user_sex', '0', 'admin', sysdate(), '', null, '用户性别列表');
#INSERT IGNORE INTO rbac_user (id, uid, username, gender, role_id) VALUES (3, '44ede496-d538-4a1d-afb9-bc409f752738', 'guest', 0, 4); #INSERT IGNORE INTO rbac_user (id, uid, username, gender, role_id) VALUES (3, '44ede496-d538-4a1d-afb9-bc409f752738', 'guest', 0, 4);
INSERT IGNORE INTO sys_dict_type (id, dict_name, dict_type, status, create_by, remark) VALUES (1, '资源类型', 'sys_res_type', '0', 'admin', '资源类型列表'); INSERT IGNORE INTO sys_dict_type (id, dict_name, dict_type, create_by, remark) VALUES (1, '资源类型', 'sys_res_type', 'admin', '资源类型列表');
INSERT IGNORE INTO sys_dict_type (id, dict_name, dict_type, status, create_by, remark) VALUES (2, '用户组', 'sys_role_group', '0', 'admin', '用户组列表'); INSERT IGNORE INTO sys_dict_type (id, dict_name, dict_type, create_by, remark) VALUES (2, '用户组', 'sys_role_group', 'admin', '用户组列表');
INSERT IGNORE INTO sys_dict_data VALUES (1, 1, '路由', 0, 1, '', '','Y', '0', 'admin', CURRENT_TIMESTAMP(6), '', null, 'URI 路由资源', null); INSERT IGNORE INTO sys_dict_data VALUES (1, 1, '路由', 0, 1, '', '','Y', 0, 'admin', CURRENT_TIMESTAMP(6), '', null, 'URI 路由资源', null);
INSERT IGNORE INTO sys_dict_data VALUES (2, 2, '菜单', 1, 1, '', '','N', '0', 'admin', CURRENT_TIMESTAMP(6), '', null, 'UI 菜单资源', null); INSERT IGNORE INTO sys_dict_data VALUES (2, 2, '菜单', 1, 1, '', '','N', 0, 'admin', CURRENT_TIMESTAMP(6), '', null, 'UI 菜单资源', null);
INSERT IGNORE INTO sys_dict_data VALUES (3, 3, '按钮', 2, 1, '', '','N', '0', 'admin', CURRENT_TIMESTAMP(6), '', null, 'UI 按钮资源', null); INSERT IGNORE INTO sys_dict_data VALUES (3, 3, '按钮', 2, 1, '', '','N', 0, 'admin', CURRENT_TIMESTAMP(6), '', null, 'UI 按钮资源', null);
INSERT IGNORE INTO sys_dict_data VALUES (4, 1, 'ADMIN', 1, 2, '', '','N', '0', 'admin', CURRENT_TIMESTAMP(6), '', null, '超级管理员可以对企业内的所有用户进行管理,请谨慎修改超管权限', null); INSERT IGNORE INTO sys_dict_data VALUES (4, 1, 'ADMIN', 1, 2, '', '','N', 0, 'admin', CURRENT_TIMESTAMP(6), '', null, '超级管理员可以对企业内的所有用户进行管理,请谨慎修改超管权限', null);
INSERT IGNORE INTO sys_dict_data VALUES (5, 2, 'DEVELOPMENT', 2, 2, '', '','N', '0', 'admin', CURRENT_TIMESTAMP(6), '', null, '项目开发人员', null); INSERT IGNORE INTO sys_dict_data VALUES (5, 2, 'DEVELOPMENT', 2, 2, '', '','N', 0, 'admin', CURRENT_TIMESTAMP(6), '', null, '项目开发人员', null);
INSERT IGNORE INTO sys_dict_data VALUES (6, 3, 'USER', 3, 2, '', '','N', '0', 'admin', CURRENT_TIMESTAMP(6), '', null, '普通的用户', null); INSERT IGNORE INTO sys_dict_data VALUES (6, 3, 'USER', 3, 2, '', '','N', 0, 'admin', CURRENT_TIMESTAMP(6), '', null, '普通的用户', null);
INSERT IGNORE INTO sys_dict_data VALUES (7, 4, 'GUEST', 4, 2, '', '','N', '0', 'admin', CURRENT_TIMESTAMP(6), '', null, '系统访客,不需要认证,最小权限', null); INSERT IGNORE INTO sys_dict_data VALUES (7, 4, 'GUEST', 4, 2, '', '','N', 0, 'admin', CURRENT_TIMESTAMP(6), '', null, '系统访客,不需要认证,最小权限', null);
# INSERT IGNORE INTO sys_dict_data VALUES (4, 1, '正常', '0', 'sys_common_status', '', '','Y', '0', 'admin', CURRENT_TIMESTAMP(6), '', null, 'UI 按钮资源', null); # INSERT IGNORE INTO sys_dict_data VALUES (4, 1, '正常', '0', 'sys_common_status', '', '','Y', '0', 'admin', CURRENT_TIMESTAMP(6), '', null, 'UI 按钮资源', null);
# INSERT IGNORE INTO sys_dict_data VALUES (5, 2, '已锁定', '1', 'sys_common_status', '', '','N', '0', 'admin', CURRENT_TIMESTAMP(6), '', null, 'UI 按钮资源', null); # INSERT IGNORE INTO sys_dict_data VALUES (5, 2, '已锁定', '1', 'sys_common_status', '', '','N', '0', 'admin', CURRENT_TIMESTAMP(6), '', null, 'UI 按钮资源', null);

View File

@ -177,20 +177,20 @@ CREATE TABLE IF NOT EXISTS `sys_operation_log`
CREATE TABLE IF NOT EXISTS `sys_dict_data` CREATE TABLE IF NOT EXISTS `sys_dict_data`
( (
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '字典编码', `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '字典编码',
`dict_sort` int(4) NULL DEFAULT 0 COMMENT '字典排序', `dict_sort` int(4) NULL DEFAULT 0 COMMENT '字典排序',
`dict_label` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '字典标签', `dict_label` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '字典标签',
`dict_value` smallint NOT NULL COMMENT '字典键值', `dict_value` smallint NOT NULL COMMENT '字典键值',
`type_id` bigint(20) NOT NULL COMMENT '字典类型', `type_id` bigint(20) NOT NULL COMMENT '字典类型',
`css_class` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '样式属性(其他样式扩展)', `css_class` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '样式属性(其他样式扩展)',
`list_class` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '表格回显样式', `list_class` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '表格回显样式',
`is_default` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT 'N' COMMENT '是否默认Y是 N否', `is_default` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT 'N' COMMENT '是否默认Y是 N否',
`status` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '0' COMMENT '状态0正常 1停用', `status` smallint NOT NULL DEFAULT 0 COMMENT '当前状态(CommonStatus):0-->正常1-->锁定2-->禁用,3-->删除',
`create_by` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '创建者', `create_by` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '创建者',
`create_time` datetime(6) NULL DEFAULT CURRENT_TIMESTAMP(6) COMMENT '创建时间', `create_time` datetime(6) NULL DEFAULT CURRENT_TIMESTAMP(6) COMMENT '创建时间',
`update_by` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '更新者', `update_by` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '更新者',
`update_time` datetime NULL DEFAULT NULL COMMENT '更新时间', `update_time` datetime NULL DEFAULT NULL COMMENT '更新时间',
`remark` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '备注', `remark` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '备注',
`delete_time` datetime NULL DEFAULT NULL COMMENT '逻辑删除标记', `delete_time` datetime NULL DEFAULT NULL COMMENT '逻辑删除标记',
CONSTRAINT `FKa68196081fvovjhkekdicttype` FOREIGN KEY (`type_id`) REFERENCES `sys_dict_type` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT, CONSTRAINT `FKa68196081fvovjhkekdicttype` FOREIGN KEY (`type_id`) REFERENCES `sys_dict_type` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
PRIMARY KEY (`id`) USING BTREE PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB ) ENGINE = InnoDB
@ -202,15 +202,15 @@ CREATE TABLE IF NOT EXISTS `sys_dict_data`
CREATE TABLE IF NOT EXISTS `sys_dict_type` CREATE TABLE IF NOT EXISTS `sys_dict_type`
( (
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '字典主键', `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '字典主键',
`dict_name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '字典名称', `dict_name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '字典名称',
`dict_type` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '字典类型', `dict_type` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '字典类型',
`status` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '0' COMMENT '状态0正常 1停用', `status` smallint NOT NULL DEFAULT 0 COMMENT '当前状态(CommonStatus):0-->正常1-->锁定2-->禁用,3-->删除',
`create_by` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '创建者', `create_by` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '创建者',
`create_time` datetime(6) NULL DEFAULT CURRENT_TIMESTAMP(6) COMMENT '创建时间', `create_time` datetime(6) NULL DEFAULT CURRENT_TIMESTAMP(6) COMMENT '创建时间',
`update_by` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '更新者', `update_by` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '更新者',
`update_time` datetime(6) NULL DEFAULT NULL COMMENT '更新时间', `update_time` datetime(6) NULL DEFAULT NULL COMMENT '更新时间',
`remark` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '备注', `remark` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '备注',
`delete_time` datetime NULL DEFAULT NULL COMMENT '逻辑删除标记', `delete_time` datetime NULL DEFAULT NULL COMMENT '逻辑删除标记',
PRIMARY KEY (`id`) USING BTREE, PRIMARY KEY (`id`) USING BTREE,
UNIQUE INDEX `dict_type` (`dict_type`) USING BTREE UNIQUE INDEX `dict_type` (`dict_type`) USING BTREE
) ENGINE = InnoDB ) ENGINE = InnoDB