From d6682b6fd2a3b6fd21209090a002125cb954bf46 Mon Sep 17 00:00:00 2001 From: qinjie <463333974@qq.com> Date: Fri, 22 Nov 2024 17:57:39 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=AD=97=E5=85=B8=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/DictionaryController.java | 56 ++++++++++++ .../isu/gaswellwatch/dao/DictionaryDao.java | 13 +++ .../isu/gaswellwatch/entity/Dictionary.java | 45 ++++++++++ .../service/DictionaryService.java | 21 +++++ .../service/impl/DictionaryServiceImpl.java | 77 ++++++++++++++++ src/main/resources/gaswellwatch.sql | 89 +++++++++++++------ src/main/resources/mapper/DictionaryDao.xml | 7 ++ 7 files changed, 282 insertions(+), 26 deletions(-) create mode 100644 src/main/java/com/isu/gaswellwatch/controller/DictionaryController.java create mode 100644 src/main/java/com/isu/gaswellwatch/dao/DictionaryDao.java create mode 100644 src/main/java/com/isu/gaswellwatch/entity/Dictionary.java create mode 100644 src/main/java/com/isu/gaswellwatch/service/DictionaryService.java create mode 100644 src/main/java/com/isu/gaswellwatch/service/impl/DictionaryServiceImpl.java create mode 100644 src/main/resources/mapper/DictionaryDao.xml diff --git a/src/main/java/com/isu/gaswellwatch/controller/DictionaryController.java b/src/main/java/com/isu/gaswellwatch/controller/DictionaryController.java new file mode 100644 index 0000000..0eef847 --- /dev/null +++ b/src/main/java/com/isu/gaswellwatch/controller/DictionaryController.java @@ -0,0 +1,56 @@ +package com.isu.gaswellwatch.controller; + + +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.isu.gaswellwatch.annotation.OperationLog; +import com.isu.gaswellwatch.dto.DepartmentDTO; +import com.isu.gaswellwatch.dto.DepartmentEditDTO; +import com.isu.gaswellwatch.entity.Department; +import com.isu.gaswellwatch.entity.Dictionary; +import com.isu.gaswellwatch.entity.Response; +import com.isu.gaswellwatch.enums.LogType; +import com.isu.gaswellwatch.service.DepartmentService; +import com.isu.gaswellwatch.service.DictionaryService; +import com.isu.gaswellwatch.vo.DepartmentVO; +import jakarta.annotation.Resource; +import jakarta.validation.Valid; +import org.springframework.web.bind.annotation.*; + +import java.util.List; + + +@RestController +@RequestMapping("dictionary") +public class DictionaryController { + /** + * 服务对象 + */ + @Resource + private DictionaryService dictionaryService; + + + @PostMapping("/add") + public Response add(@RequestBody @Valid Dictionary dictionary){ + dictionaryService.add(dictionary); + return Response.succeed(); + } + + @PostMapping("/edit") + public Response edit(@RequestBody @Valid Dictionary dictionary){ + dictionaryService.edit(dictionary); + return Response.succeed(); + } + + @GetMapping("/delete") + public Response delete(@RequestParam Long id){ + dictionaryService.delete(id); + return Response.succeed(); + } + + @GetMapping("/getByType") + public Response> getByType(@RequestParam String type){ + return Response.succeed(dictionaryService.getByType(type)); + } + +} + diff --git a/src/main/java/com/isu/gaswellwatch/dao/DictionaryDao.java b/src/main/java/com/isu/gaswellwatch/dao/DictionaryDao.java new file mode 100644 index 0000000..759c24b --- /dev/null +++ b/src/main/java/com/isu/gaswellwatch/dao/DictionaryDao.java @@ -0,0 +1,13 @@ +package com.isu.gaswellwatch.dao; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.isu.gaswellwatch.entity.Dictionary; +import org.apache.ibatis.annotations.Mapper; +import org.springframework.stereotype.Repository; + +@Mapper +@Repository +public interface DictionaryDao extends BaseMapper { + +} + diff --git a/src/main/java/com/isu/gaswellwatch/entity/Dictionary.java b/src/main/java/com/isu/gaswellwatch/entity/Dictionary.java new file mode 100644 index 0000000..d24d2b3 --- /dev/null +++ b/src/main/java/com/isu/gaswellwatch/entity/Dictionary.java @@ -0,0 +1,45 @@ +package com.isu.gaswellwatch.entity; + +import com.baomidou.mybatisplus.extension.activerecord.Model; +import com.fasterxml.jackson.annotation.JsonFormat; +import jakarta.validation.constraints.NotBlank; +import jakarta.validation.constraints.NotNull; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.Date; + +@Data +@Builder +@AllArgsConstructor +@NoArgsConstructor +public class Dictionary extends Model { + + private Long id; + //字典数据类型 + @NotBlank(message = "类型不能为空") + private String type; + //字典编码 + @NotBlank(message = "编码不能为空") + private String code; + //字典数据中文名称 + @NotBlank(message = "名称不能为空") + private String name; + //字典数据值 + @NotBlank(message = "值不能为空") + private String value; + //字典数据排序 + @NotNull(message = "排序字段不能为空") + private Integer sort; + //创建时间 + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date createTime; + //更新时间 + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date updateTime; + + +} + diff --git a/src/main/java/com/isu/gaswellwatch/service/DictionaryService.java b/src/main/java/com/isu/gaswellwatch/service/DictionaryService.java new file mode 100644 index 0000000..8d0a06e --- /dev/null +++ b/src/main/java/com/isu/gaswellwatch/service/DictionaryService.java @@ -0,0 +1,21 @@ +package com.isu.gaswellwatch.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.isu.gaswellwatch.entity.Dictionary; + +import java.util.List; + +public interface DictionaryService extends IService { + + + void add(Dictionary dictionary); + + void edit(Dictionary dictionary); + + void delete(Long id); + + List getByType(String type); + + Dictionary getByTypeAndCode(String type,String code); +} + diff --git a/src/main/java/com/isu/gaswellwatch/service/impl/DictionaryServiceImpl.java b/src/main/java/com/isu/gaswellwatch/service/impl/DictionaryServiceImpl.java new file mode 100644 index 0000000..c40e559 --- /dev/null +++ b/src/main/java/com/isu/gaswellwatch/service/impl/DictionaryServiceImpl.java @@ -0,0 +1,77 @@ +package com.isu.gaswellwatch.service.impl; + +import cn.hutool.core.collection.CollectionUtil; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.isu.gaswellwatch.config.SnowflakeConfig; +import com.isu.gaswellwatch.dao.DepartmentDao; +import com.isu.gaswellwatch.dao.DictionaryDao; +import com.isu.gaswellwatch.dto.DepartmentDTO; +import com.isu.gaswellwatch.dto.DepartmentEditDTO; +import com.isu.gaswellwatch.entity.Department; +import com.isu.gaswellwatch.entity.Dictionary; +import com.isu.gaswellwatch.exception.BusinessException; +import com.isu.gaswellwatch.service.DepartmentService; +import com.isu.gaswellwatch.service.DictionaryService; +import com.isu.gaswellwatch.utils.ConverterUtil; +import com.isu.gaswellwatch.vo.DepartmentVO; +import jakarta.annotation.Resource; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.List; + +@Service("dictionaryService") +@Transactional(rollbackFor = Exception.class) +public class DictionaryServiceImpl extends ServiceImpl implements DictionaryService { + + @Resource + private SnowflakeConfig snowflakeConfig; + + @Resource + private DictionaryDao dictionaryDao; + + @Override + public void add(Dictionary dictionary){ + //查重 同一个类型下不能有重复code + List list = list(new LambdaQueryWrapper().eq(Dictionary::getType, dictionary.getType()) + .eq(Dictionary::getCode,dictionary.getCode())); + if(CollectionUtil.isNotEmpty(list)) { + throw new BusinessException(dictionary.getType()+"类型下已有相同code,请重新输入"); + } + Long dictionaryId = snowflakeConfig.snowflakeId(); + save(Dictionary.builder().id(dictionaryId).type(dictionary.getType()).code(dictionary.getCode()).name(dictionary.getName()) + .value(dictionary.getValue()).sort(dictionary.getSort()).build()); + } + + @Override + public void edit(Dictionary dictionary){ + //查重 同一个类型下不能有重复code + List list = list(new LambdaQueryWrapper().eq(Dictionary::getType, dictionary.getType()) + .eq(Dictionary::getCode,dictionary.getCode())); + if(CollectionUtil.isNotEmpty(list)) { + throw new BusinessException(dictionary.getType()+"类型下已有相同code,请重新输入"); + } + updateById(dictionary); + } + + @Override + public void delete(Long id){ + //删除 + removeById(id); + } + + @Override + public List getByType(String type) { + return list(new LambdaQueryWrapper().eq(Dictionary::getType, type).orderByAsc(Dictionary::getSort)); + } + + @Override + public Dictionary getByTypeAndCode(String type, String code) { + return getOne(new LambdaQueryWrapper().eq(Dictionary::getType, type).eq(Dictionary::getCode, code)); + } + + +} + diff --git a/src/main/resources/gaswellwatch.sql b/src/main/resources/gaswellwatch.sql index 12f77d6..7bb45b5 100644 --- a/src/main/resources/gaswellwatch.sql +++ b/src/main/resources/gaswellwatch.sql @@ -11,7 +11,7 @@ Target Server Version : 80034 File Encoding : 65001 - Date: 17/11/2024 02:45:52 + Date: 22/11/2024 17:54:19 */ SET NAMES utf8mb4; @@ -105,6 +105,7 @@ CREATE TABLE `department` ( BEGIN; INSERT INTO `department` (`id`, `name`, `description`, `create_time`, `update_time`, `code`) VALUES (1, '第一业务部', '无', '2024-11-17 01:11:07', '2024-11-17 01:11:07', '0001'); INSERT INTO `department` (`id`, `name`, `description`, `create_time`, `update_time`, `code`) VALUES (2, '第二业务部', '无', '2024-11-17 01:11:21', '2024-11-17 01:11:21', '0002'); +INSERT INTO `department` (`id`, `name`, `description`, `create_time`, `update_time`, `code`) VALUES (1859299142728155136, 'dasd', '2', '2024-11-21 02:13:54', '2024-11-21 02:13:54', '2'); COMMIT; -- ---------------------------- @@ -155,6 +156,33 @@ CREATE TABLE `devices` ( BEGIN; COMMIT; +-- ---------------------------- +-- Table structure for dictionary +-- ---------------------------- +DROP TABLE IF EXISTS `dictionary`; +CREATE TABLE `dictionary` ( + `id` bigint NOT NULL, + `type` varchar(50) NOT NULL COMMENT '字典数据类型', + `code` varchar(50) NOT NULL COMMENT '编码', + `name` varchar(50) NOT NULL COMMENT '中文名称', + `value` varchar(50) NOT NULL COMMENT '字典值', + `sort` smallint NOT NULL COMMENT '排序', + `create_time` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', + `update_time` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间', + PRIMARY KEY (`id`), + KEY `type_index` (`type`) USING BTREE, + KEY `type_code_index` (`type`,`code`) USING BTREE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci ROW_FORMAT=DYNAMIC COMMENT='字典表'; + +-- ---------------------------- +-- Records of dictionary +-- ---------------------------- +BEGIN; +INSERT INTO `dictionary` (`id`, `type`, `code`, `name`, `value`, `sort`, `create_time`, `update_time`) VALUES (1859896918377758720, 'testType', 'code1', 'name1', '1', 1, '2024-11-22 17:49:15', '2024-11-22 17:49:15'); +INSERT INTO `dictionary` (`id`, `type`, `code`, `name`, `value`, `sort`, `create_time`, `update_time`) VALUES (1859897057574125568, 'testType', 'code2', 'name2', '2', 2, '2024-11-22 17:49:48', '2024-11-22 17:49:48'); +INSERT INTO `dictionary` (`id`, `type`, `code`, `name`, `value`, `sort`, `create_time`, `update_time`) VALUES (1859897370766999552, 'testType1', 'code1', 'name1', '1', 1, '2024-11-22 17:51:03', '2024-11-22 17:51:03'); +COMMIT; + -- ---------------------------- -- Table structure for gas_wells -- ---------------------------- @@ -192,20 +220,20 @@ CREATE TABLE `menu` ( `create_time` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', `update_time` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间', PRIMARY KEY (`id`) USING BTREE -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='菜单管理'; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC COMMENT='菜单管理'; -- ---------------------------- -- Records of menu -- ---------------------------- BEGIN; -INSERT INTO `menu` (`id`, `parent`, `name`, `code`, `icon`, `sort`, `extra`, `create_time`, `update_time`) VALUES (1834499936926826496, 0, '设备管理', 'Device', NULL, 1, '{\"url\":\"device\",\"menuType\":{\"key\":\"4\",\"value\":\"\"}}', '2024-09-13 15:50:42', '2024-09-13 15:50:42'); -INSERT INTO `menu` (`id`, `parent`, `name`, `code`, `icon`, `sort`, `extra`, `create_time`, `update_time`) VALUES (1834500910013743104, 0, '系统管理', 'System', NULL, 11, '{\"url\":\"system\",\"menuType\":{\"key\":\"4\",\"value\":\"\"}}', '2024-09-13 15:54:34', '2024-09-24 16:23:28'); -INSERT INTO `menu` (`id`, `parent`, `name`, `code`, `icon`, `sort`, `extra`, `create_time`, `update_time`) VALUES (1834500987037941760, 1834500910013743104, '用户管理', 'SystemUser', NULL, 1, '{\"url\":\"user\",\"menuType\":{\"key\":\"4\",\"value\":\"\"}}', '2024-09-13 15:54:53', '2024-09-13 15:54:53'); -INSERT INTO `menu` (`id`, `parent`, `name`, `code`, `icon`, `sort`, `extra`, `create_time`, `update_time`) VALUES (1834501029547212800, 1834500910013743104, '角色权限', 'SystemRole', NULL, 2, '{\"url\":\"role\",\"menuType\":{\"key\":\"4\",\"value\":\"\"}}', '2024-09-13 15:55:03', '2024-09-13 15:55:03'); -INSERT INTO `menu` (`id`, `parent`, `name`, `code`, `icon`, `sort`, `extra`, `create_time`, `update_time`) VALUES (1834501061923045376, 1834500910013743104, '自定义菜单', 'SystemMenus', NULL, 3, '{\"url\":\"menus\",\"menuType\":{\"key\":\"4\",\"value\":\"\"}}', '2024-09-13 15:55:11', '2024-09-13 15:55:11'); -INSERT INTO `menu` (`id`, `parent`, `name`, `code`, `icon`, `sort`, `extra`, `create_time`, `update_time`) VALUES (1834501113332629504, 1834500910013743104, '系统日志', 'SystemRecords', NULL, 4, '{\"url\":\"records\",\"menuType\":{\"key\":\"4\",\"value\":\"\"}}', '2024-09-13 15:55:23', '2024-09-13 15:55:23'); -INSERT INTO `menu` (`id`, `parent`, `name`, `code`, `icon`, `sort`, `extra`, `create_time`, `update_time`) VALUES (1834501151140085760, 1834500910013743104, '个性化设置', 'SystemPersonal', NULL, 5, '{\"url\":\"personal\",\"menuType\":{\"key\":\"4\",\"value\":\"\"}}', '2024-09-13 15:55:32', '2024-09-13 15:55:32'); -INSERT INTO `menu` (`id`, `parent`, `name`, `code`, `icon`, `sort`, `extra`, `create_time`, `update_time`) VALUES (1834501183620775936, 1834500910013743104, '图标管理', 'SystemIcons', NULL, 6, '{\"url\":\"icons\",\"menuType\":{\"key\":\"4\",\"value\":\"\"}}', '2024-09-13 15:55:40', '2024-09-13 15:55:40'); +INSERT INTO `menu` (`id`, `parent`, `name`, `code`, `icon`, `sort`, `extra`, `create_time`, `update_time`) VALUES (1834499936926826496, 0, '数据统计', 'summary', NULL, 2, '{\"url\":\"summary\",\"menuType\":{\"key\":\"4\",\"value\":\"\"}}', '2024-09-13 15:50:42', '2024-11-22 17:39:45'); +INSERT INTO `menu` (`id`, `parent`, `name`, `code`, `icon`, `sort`, `extra`, `create_time`, `update_time`) VALUES (1834500910013743104, 0, '角色管理', 'roleManageList', NULL, 6, '{\"url\":\"roleManageList\",\"menuType\":{\"key\":\"4\",\"value\":\"\"}}', '2024-09-13 15:54:34', '2024-11-22 17:39:35'); +INSERT INTO `menu` (`id`, `parent`, `name`, `code`, `icon`, `sort`, `extra`, `create_time`, `update_time`) VALUES (1834500987037941760, 0, '用户管理', 'userManage', NULL, 3, '{\"url\":\"userManage\",\"menuType\":{\"key\":\"4\",\"value\":\"\"}}', '2024-09-13 15:54:53', '2024-11-22 17:39:20'); +INSERT INTO `menu` (`id`, `parent`, `name`, `code`, `icon`, `sort`, `extra`, `create_time`, `update_time`) VALUES (1834501029547212800, 0, '气井管理', 'gasManage', NULL, 1, '{\"url\":\"gasManage\",\"menuType\":{\"key\":\"4\",\"value\":\"\"}}', '2024-09-13 15:55:03', '2024-11-22 17:39:03'); +INSERT INTO `menu` (`id`, `parent`, `name`, `code`, `icon`, `sort`, `extra`, `create_time`, `update_time`) VALUES (1834501061923045376, 0, '部门管理', 'agencyManage', NULL, 4, '{\"url\":\"agencyManage\",\"menuType\":{\"key\":\"4\",\"value\":\"\"}}', '2024-09-13 15:55:11', '2024-11-22 17:37:59'); +INSERT INTO `menu` (`id`, `parent`, `name`, `code`, `icon`, `sort`, `extra`, `create_time`, `update_time`) VALUES (1834501113332629504, 0, '日志管理', 'logManage', NULL, 7, '{\"url\":\"logManage\",\"menuType\":{\"key\":\"4\",\"value\":\"\"}}', '2024-09-13 15:55:23', '2024-11-22 17:38:35'); +INSERT INTO `menu` (`id`, `parent`, `name`, `code`, `icon`, `sort`, `extra`, `create_time`, `update_time`) VALUES (1834501151140085760, 0, '区块管理', 'areaManage', NULL, 5, '{\"url\":\"areaManage\",\"menuType\":{\"key\":\"4\",\"value\":\"\"}}', '2024-09-13 15:55:32', '2024-11-22 17:38:45'); +INSERT INTO `menu` (`id`, `parent`, `name`, `code`, `icon`, `sort`, `extra`, `create_time`, `update_time`) VALUES (1834501183620775936, 0, '提醒记录', 'recordingManage', NULL, 8, '{\"url\":\"recordingManage\",\"menuType\":{\"key\":\"4\",\"value\":\"\"}}', '2024-09-13 15:55:40', '2024-11-22 17:37:46'); COMMIT; -- ---------------------------- @@ -219,19 +247,19 @@ CREATE TABLE `role` ( `create_time` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', `update_time` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间', PRIMARY KEY (`id`) USING BTREE -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='角色管理'; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC COMMENT='角色管理'; -- ---------------------------- -- Records of role -- ---------------------------- BEGIN; -INSERT INTO `role` (`id`, `name`, `description`, `create_time`, `update_time`) VALUES (1, '超级管理员', '内置', '2024-08-20 11:36:35', '2024-08-26 16:29:02'); +INSERT INTO `role` (`id`, `name`, `description`, `create_time`, `update_time`) VALUES (1, '超级管理员', '', '2024-08-20 11:36:35', '2024-11-22 17:53:40'); INSERT INTO `role` (`id`, `name`, `description`, `create_time`, `update_time`) VALUES (1836575681450868736, '测试角色', '', '2024-09-19 09:18:59', '2024-09-19 09:18:59'); INSERT INTO `role` (`id`, `name`, `description`, `create_time`, `update_time`) VALUES (1836581703372505088, '测试角色22', '测试角色2', '2024-09-19 09:42:54', '2024-09-19 09:55:03'); INSERT INTO `role` (`id`, `name`, `description`, `create_time`, `update_time`) VALUES (1836581757135093760, '测试角色234', '测试角色2', '2024-09-19 09:43:07', '2024-09-19 09:46:25'); INSERT INTO `role` (`id`, `name`, `description`, `create_time`, `update_time`) VALUES (1851162080074268672, '测试角色123', 'test', '2024-10-29 15:20:07', '2024-10-29 15:20:07'); INSERT INTO `role` (`id`, `name`, `description`, `create_time`, `update_time`) VALUES (1854116823323115520, '22222', '', '2024-11-06 19:01:13', '2024-11-06 19:01:13'); -INSERT INTO `role` (`id`, `name`, `description`, `create_time`, `update_time`) VALUES (1854121363019661312, '33333', '', '2024-11-06 19:19:15', '2024-11-06 19:19:15'); +INSERT INTO `role` (`id`, `name`, `description`, `create_time`, `update_time`) VALUES (1854121363019661312, '3333', '', '2024-11-06 19:19:15', '2024-11-21 00:22:44'); COMMIT; -- ---------------------------- @@ -246,23 +274,25 @@ CREATE TABLE `role_menu` ( `create_time` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', `update_time` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间', PRIMARY KEY (`id`) USING BTREE -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='角色菜单关联表'; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC COMMENT='角色菜单关联表'; -- ---------------------------- -- Records of role_menu -- ---------------------------- BEGIN; -INSERT INTO `role_menu` (`id`, `role_id`, `menu_id`, `identifier`, `create_time`, `update_time`) VALUES (1, 1, 1834500910013743104, NULL, '2024-10-29 14:48:13', '2024-10-29 14:48:26'); INSERT INTO `role_menu` (`id`, `role_id`, `menu_id`, `identifier`, `create_time`, `update_time`) VALUES (2, 1836575681450868736, 1834500910013743104, NULL, '2024-10-29 14:48:57', '2024-10-29 14:49:01'); -INSERT INTO `role_menu` (`id`, `role_id`, `menu_id`, `identifier`, `create_time`, `update_time`) VALUES (3, 1, 1834500987037941760, NULL, '2024-10-29 15:29:06', '2024-10-29 15:29:59'); -INSERT INTO `role_menu` (`id`, `role_id`, `menu_id`, `identifier`, `create_time`, `update_time`) VALUES (4, 1, 1834501029547212800, NULL, '2024-10-29 15:30:53', '2024-10-29 15:30:53'); -INSERT INTO `role_menu` (`id`, `role_id`, `menu_id`, `identifier`, `create_time`, `update_time`) VALUES (5, 1, 1834501061923045376, NULL, '2024-10-29 15:31:16', '2024-10-29 15:31:16'); -INSERT INTO `role_menu` (`id`, `role_id`, `menu_id`, `identifier`, `create_time`, `update_time`) VALUES (6, 1, 1834501113332629504, NULL, '2024-10-29 15:31:35', '2024-10-29 15:31:35'); -INSERT INTO `role_menu` (`id`, `role_id`, `menu_id`, `identifier`, `create_time`, `update_time`) VALUES (7, 1, 1834501151140085760, NULL, '2024-10-29 15:31:51', '2024-10-29 15:31:51'); INSERT INTO `role_menu` (`id`, `role_id`, `menu_id`, `identifier`, `create_time`, `update_time`) VALUES (1851162080078462976, 1851162080074268672, 1834500910013743104, NULL, '2024-10-29 15:20:07', '2024-10-29 15:20:07'); INSERT INTO `role_menu` (`id`, `role_id`, `menu_id`, `identifier`, `create_time`, `update_time`) VALUES (1854116823335698432, 1854116823323115520, 1834499936926826496, NULL, '2024-11-06 19:01:13', '2024-11-06 19:01:13'); INSERT INTO `role_menu` (`id`, `role_id`, `menu_id`, `identifier`, `create_time`, `update_time`) VALUES (1854116823335698433, 1854116823323115520, 1834501029547212800, NULL, '2024-11-06 19:01:13', '2024-11-06 19:01:13'); INSERT INTO `role_menu` (`id`, `role_id`, `menu_id`, `identifier`, `create_time`, `update_time`) VALUES (1854116823335698434, 1854116823323115520, 1834501061923045376, NULL, '2024-11-06 19:01:13', '2024-11-06 19:01:13'); +INSERT INTO `role_menu` (`id`, `role_id`, `menu_id`, `identifier`, `create_time`, `update_time`) VALUES (1859271166338793472, 1854121363019661312, 1834500987037941760, NULL, '2024-11-21 00:22:44', '2024-11-21 00:22:44'); +INSERT INTO `role_menu` (`id`, `role_id`, `menu_id`, `identifier`, `create_time`, `update_time`) VALUES (1859271166338793473, 1854121363019661312, 1834501029547212800, NULL, '2024-11-21 00:22:44', '2024-11-21 00:22:44'); +INSERT INTO `role_menu` (`id`, `role_id`, `menu_id`, `identifier`, `create_time`, `update_time`) VALUES (1859271166338793474, 1854121363019661312, 1834501061923045376, NULL, '2024-11-21 00:22:44', '2024-11-21 00:22:44'); +INSERT INTO `role_menu` (`id`, `role_id`, `menu_id`, `identifier`, `create_time`, `update_time`) VALUES (1859898030757511168, 1, 1834501029547212800, NULL, '2024-11-22 17:53:40', '2024-11-22 17:53:40'); +INSERT INTO `role_menu` (`id`, `role_id`, `menu_id`, `identifier`, `create_time`, `update_time`) VALUES (1859898030757511169, 1, 1834500987037941760, NULL, '2024-11-22 17:53:40', '2024-11-22 17:53:40'); +INSERT INTO `role_menu` (`id`, `role_id`, `menu_id`, `identifier`, `create_time`, `update_time`) VALUES (1859898030757511170, 1, 1834501061923045376, NULL, '2024-11-22 17:53:40', '2024-11-22 17:53:40'); +INSERT INTO `role_menu` (`id`, `role_id`, `menu_id`, `identifier`, `create_time`, `update_time`) VALUES (1859898030757511171, 1, 1834501151140085760, NULL, '2024-11-22 17:53:40', '2024-11-22 17:53:40'); +INSERT INTO `role_menu` (`id`, `role_id`, `menu_id`, `identifier`, `create_time`, `update_time`) VALUES (1859898030757511172, 1, 1834500910013743104, NULL, '2024-11-22 17:53:40', '2024-11-22 17:53:40'); COMMIT; -- ---------------------------- @@ -280,7 +310,7 @@ CREATE TABLE `user` ( `create_time` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', `update_time` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间', PRIMARY KEY (`id`) USING BTREE -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='用户表'; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC COMMENT='用户表'; -- ---------------------------- -- Records of user @@ -290,6 +320,8 @@ INSERT INTO `user` (`id`, `username`, `password`, `nickname`, `phone`, `picture` INSERT INTO `user` (`id`, `username`, `password`, `nickname`, `phone`, `picture`, `is_enable`, `create_time`, `update_time`) VALUES (1850801224132067328, 'test1', '7c4a8d09ca3762af61e59520943dc26494f8941b', '张四', '13012341234', NULL, '1', '2024-10-28 15:26:12', '2024-10-28 15:56:52'); INSERT INTO `user` (`id`, `username`, `password`, `nickname`, `phone`, `picture`, `is_enable`, `create_time`, `update_time`) VALUES (1850812935484473344, 'test2', '7c4a8d09ca3762af61e59520943dc26494f8941b', '王五', '13012341235', NULL, '1', '2024-10-28 16:12:44', '2024-10-28 16:12:44'); INSERT INTO `user` (`id`, `username`, `password`, `nickname`, `phone`, `picture`, `is_enable`, `create_time`, `update_time`) VALUES (1853726975508611072, '123d', '7c4a8d09ca3762af61e59520943dc26494f8941b', '123dd', '13333333331', NULL, '0', '2024-11-05 17:12:06', '2024-11-06 15:04:57'); +INSERT INTO `user` (`id`, `username`, `password`, `nickname`, `phone`, `picture`, `is_enable`, `create_time`, `update_time`) VALUES (1859282476250169344, '123dd', '7c4a8d09ca3762af61e59520943dc26494f8941b', '安定', '13333333333', NULL, '1', '2024-11-21 01:07:40', '2024-11-21 01:07:40'); +INSERT INTO `user` (`id`, `username`, `password`, `nickname`, `phone`, `picture`, `is_enable`, `create_time`, `update_time`) VALUES (1859283318915203072, 'dfg2', '7c4a8d09ca3762af61e59520943dc26494f8941b', '213安定', '13999999999', NULL, '1', '2024-11-21 01:11:01', '2024-11-21 01:11:01'); COMMIT; -- ---------------------------- @@ -303,13 +335,16 @@ CREATE TABLE `user_department` ( `create_time` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', `update_time` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间', PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='用户部门关联表'; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci ROW_FORMAT=DYNAMIC COMMENT='用户部门关联表'; -- ---------------------------- -- Records of user_department -- ---------------------------- BEGIN; INSERT INTO `user_department` (`id`, `user_id`, `department_id`, `create_time`, `update_time`) VALUES (1857847465089171456, 1850812935484473344, 1, '2024-11-17 02:05:27', '2024-11-17 02:05:27'); +INSERT INTO `user_department` (`id`, `user_id`, `department_id`, `create_time`, `update_time`) VALUES (1859278803252019200, 1853726975508611072, 2, '2024-11-21 00:53:05', '2024-11-21 00:53:05'); +INSERT INTO `user_department` (`id`, `user_id`, `department_id`, `create_time`, `update_time`) VALUES (1859282476338249728, 1859282476250169344, 2, '2024-11-21 01:07:40', '2024-11-21 01:07:40'); +INSERT INTO `user_department` (`id`, `user_id`, `department_id`, `create_time`, `update_time`) VALUES (1859283318936174592, 1859283318915203072, 1, '2024-11-21 01:11:01', '2024-11-21 01:11:01'); COMMIT; -- ---------------------------- @@ -332,7 +367,7 @@ CREATE TABLE `user_operation_record` ( `create_time` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', `update_time` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间', PRIMARY KEY (`id`) USING BTREE -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='用户操作记录表'; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC COMMENT='用户操作记录表'; -- ---------------------------- -- Records of user_operation_record @@ -351,16 +386,18 @@ CREATE TABLE `user_role` ( `create_time` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', `update_time` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间', PRIMARY KEY (`id`) USING BTREE -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='用户角色关联表'; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC COMMENT='用户角色关联表'; -- ---------------------------- -- Records of user_role -- ---------------------------- BEGIN; -INSERT INTO `user_role` (`id`, `user_id`, `role_id`, `create_time`, `update_time`) VALUES (1, 1, 1, '2024-10-28 15:28:14', '2024-10-28 15:28:14'); INSERT INTO `user_role` (`id`, `user_id`, `role_id`, `create_time`, `update_time`) VALUES (1850808941676593152, 1850801224132067328, 1836575681450868736, '2024-10-28 15:56:52', '2024-10-28 15:56:52'); -INSERT INTO `user_role` (`id`, `user_id`, `role_id`, `create_time`, `update_time`) VALUES (1854057365498757120, 1853726975508611072, 1836581703372505088, '2024-11-06 15:04:57', '2024-11-06 15:04:57'); INSERT INTO `user_role` (`id`, `user_id`, `role_id`, `create_time`, `update_time`) VALUES (1857847465064005632, 1850812935484473344, 1836575681450868736, '2024-11-17 02:05:27', '2024-11-17 02:05:27'); +INSERT INTO `user_role` (`id`, `user_id`, `role_id`, `create_time`, `update_time`) VALUES (1859278803231047680, 1853726975508611072, 1836581703372505088, '2024-11-21 00:53:05', '2024-11-21 00:53:05'); +INSERT INTO `user_role` (`id`, `user_id`, `role_id`, `create_time`, `update_time`) VALUES (1859282476308889600, 1859282476250169344, 1836581703372505088, '2024-11-21 01:07:40', '2024-11-21 01:07:40'); +INSERT INTO `user_role` (`id`, `user_id`, `role_id`, `create_time`, `update_time`) VALUES (1859283318923591680, 1859283318915203072, 1836581703372505088, '2024-11-21 01:11:01', '2024-11-21 01:11:01'); +INSERT INTO `user_role` (`id`, `user_id`, `role_id`, `create_time`, `update_time`) VALUES (1859897951527108608, 1, 1, '2024-11-22 17:53:21', '2024-11-22 17:53:21'); COMMIT; SET FOREIGN_KEY_CHECKS = 1; diff --git a/src/main/resources/mapper/DictionaryDao.xml b/src/main/resources/mapper/DictionaryDao.xml new file mode 100644 index 0000000..afd8012 --- /dev/null +++ b/src/main/resources/mapper/DictionaryDao.xml @@ -0,0 +1,7 @@ + + + + + + +