commit 5e83bae822f351b135926c0ff0ecf841a9e35874 Author: review512jwy@163.com <“review512jwy@163.com”> Date: Tue Oct 21 10:30:37 2025 +0800 初始化 diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..d63dd99 --- /dev/null +++ b/.gitignore @@ -0,0 +1,16 @@ +/target/ +/logs/ +/.idea/ +*.iml +*.bak +*.log +/.settings/ +*.project +*.classpath +*.factorypath +*.springBeans +/.apt_generated/ +/.externalToolBuilders/ +/bin/ +/dongjian-dashboard-back-controller/tmp/ +application-*.properties diff --git a/document/cmd b/document/cmd new file mode 100644 index 0000000..09a4d33 --- /dev/null +++ b/document/cmd @@ -0,0 +1,31 @@ +aws ecr get-login-password --region ap-northeast-1 | docker login --username AWS --password-stdin 381659385655.dkr.ecr.ap-northeast-1.amazonaws.com + +docker tag 67f91fc6cfbf 381659385655.dkr.ecr.ap-northeast-1.amazonaws.com/tokyo-build-business:latest + +docker push 381659385655.dkr.ecr.ap-northeast-1.amazonaws.com/tokyo-build-business:latest + +docker pull 381659385655.dkr.ecr.ap-northeast-1.amazonaws.com/tokyo-build-business:latest + +docker run -d -p 8887:20008 -v /home/data-center-business/back/application.properties:/home/data-center-business/config/application.properties 381659385655.dkr.ecr.ap-northeast-1.amazonaws.com/tokyo-build-business + +aws configure + +docker run -e apiEnable=false -e datasourceDNS=tokyo-building-db.caetvgb7diak.ap-northeast-1.rds.amazonaws.com -e datasourceTimeZone=Asia/Tokyo -e datasourceUsername=techsor -e datasourcePassword=Abc#123456xyz -e loggingLevel=ERROR -e loggingPath=/home/data-center-business/log -e loggingAppender=SYSLOG -e redisHost=replication-group-tokyo-build.ncvpel.ng.0001.apne1.cache.amazonaws.com -e redisPassword= -e awsAccesskey=AKIA5OFH5OOZHM3U3KX4 -e awsSecretkey=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 -e awsBucket=tokyo-build-databucket-381659385655 -e ibatisLoggingLog=ERROR -e ibatisLoggingLogFactory=ERROR -d -p 20008:20008 923770123186.dkr.ecr.ap-northeast-1.amazonaws.com/tokyo-build-business:latest + +阿里云 +docker tag e1fe6f58961e registry.cn-shanghai.aliyuncs.com/test-data-business/data-business-server:latest + +docker push registry.cn-shanghai.aliyuncs.com/test-data-business/data-business-server:latest + +docker pull registry.cn-shanghai.aliyuncs.com/test-data-business/data-business-server:latest + +docker exec -it 3c77bb84d338 /bin/bash + +docker run -d -p 20008:20015 -v /home/application.properties:/home/dongjian-dashboard-back/config/application.properties registry.cn-shanghai.aliyuncs.com/test-data-business/data-business-server + +测试环境 +aws ecr get-login-password --region ap-northeast-1 | docker login --username AWS --password-stdin 923770123186.dkr.ecr.ap-northeast-1.amazonaws.com + +docker tag ecee6b583d3c 923770123186.dkr.ecr.ap-northeast-1.amazonaws.com/tokyo-build-business:latest + +docker push 923770123186.dkr.ecr.ap-northeast-1.amazonaws.com/tokyo-build-business:latest diff --git a/document/db/20240508.sql b/document/db/20240508.sql new file mode 100644 index 0000000..3b87a30 --- /dev/null +++ b/document/db/20240508.sql @@ -0,0 +1,85 @@ +USE `data_center_new`; + +DROP procedure IF EXISTS `add_column`; + +DELIMITER $$ + +CREATE PROCEDURE add_column() + +BEGIN + IF NOT EXISTS ( + SELECT * + FROM information_schema.columns + WHERE table_schema = 'data_center_new' + AND table_name = 'basic_company' + AND column_name = 'aurora_flag' + ) THEN + ALTER TABLE basic_company + ADD COLUMN `aurora_flag` int DEFAULT '0' COMMENT '0-未创建,1-创建中,2-创建成功,3-创建失败'; + END IF; + + IF NOT EXISTS ( + SELECT * + FROM information_schema.columns + WHERE table_schema = 'data_center_new' + AND table_name = 'basic_company' + AND column_name = 'aurora_url' + ) THEN + ALTER TABLE basic_company + ADD COLUMN `aurora_url` varchar(255) DEFAULT NULL; + END IF; + + IF NOT EXISTS ( + SELECT * + FROM information_schema.columns + WHERE table_schema = 'data_center_new' + AND table_name = 'basic_company' + AND column_name = 'aurora_username' + ) THEN + ALTER TABLE basic_company + ADD COLUMN `aurora_username` varchar(255) DEFAULT NULL; + END IF; + + IF NOT EXISTS ( + SELECT * + FROM information_schema.columns + WHERE table_schema = 'data_center_new' + AND table_name = 'basic_company' + AND column_name = 'aurora_password' + ) THEN + ALTER TABLE basic_company + ADD COLUMN `aurora_password` varchar(255) DEFAULT NULL; + END IF; + + IF NOT EXISTS ( + SELECT * + FROM information_schema.columns + WHERE table_schema = 'data_center_new' + AND table_name = 'basic_company' + AND column_name = 'redis_db_id' + ) THEN + ALTER TABLE basic_company + ADD COLUMN `redis_db_id` int DEFAULT NULL COMMENT '使用的redis库id'; + END IF; + + IF NOT EXISTS ( + SELECT * + FROM information_schema.columns + WHERE table_schema = 'data_center_new' + AND table_name = 'basic_company' + AND column_name = 'bearer_token' + ) THEN + ALTER TABLE basic_company + ADD COLUMN `bearer_token` text; + END IF; + + update basic_company set aurora_flag = 2 where aurora_url is not null; + +END$$ + +DELIMITER ; + + +CALL add_column(); + +DROP procedure IF EXISTS `add_column`; \ No newline at end of file diff --git a/document/db/20240515.sql b/document/db/20240515.sql new file mode 100644 index 0000000..d731e2a --- /dev/null +++ b/document/db/20240515.sql @@ -0,0 +1,62 @@ +USE `data_center_new`; + +/*Table structure for table `basic_menu` */ + +DROP TABLE IF EXISTS `basic_menu`; + +CREATE TABLE `basic_menu` ( + `id` bigint NOT NULL AUTO_INCREMENT, + `parent_menu_id` bigint DEFAULT NULL, + `menu_name` varchar(100) DEFAULT NULL, + `menu_name_en` varchar(100) DEFAULT NULL, + `menu_name_jp` varchar(100) DEFAULT NULL, + `remark` varchar(100) DEFAULT NULL, + `menu_level` int DEFAULT '1' COMMENT '菜单级别', + `flag` int DEFAULT '0' COMMENT '0-正常,1-删除', + `create_time` bigint DEFAULT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=43 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; + +/*Data for the table `basic_menu` */ + +insert into `basic_menu`(`id`,`parent_menu_id`,`menu_name`,`menu_name_en`,`menu_name_jp`,`remark`,`menu_level`,`flag`,`create_time`) values (1,-1,'项目管理','项目管理','プロジェクト管理','项目管理',1,0,1659079777164),(2,-1,'楼宇模块','楼宇模块','ビルモジュール','楼宇模块',1,0,1659079777164),(3,-1,'设备模块','设备模块','設備モジュール','设备模块',1,0,1659079777164),(4,-1,'转发管理','转发管理','転送管理','转发管理',1,0,1659079777164),(5,-1,'数据来源管理','数据来源管理','データ源管理','数据来源管理',1,0,1659079777164),(6,1,'添加','添加','追加','项目管理-添加',2,0,1659079777164),(7,1,'编辑','编辑','編集','项目管理-编辑',2,0,1659079777164),(8,1,'删除','删除','削除','项目管理-删除',2,0,1659079777164),(9,1,'批量添加','批量添加','大量に追加','项目管理-批量添加',2,0,1659079777164),(10,2,'楼宇管理','楼宇管理','ビル管理','楼宇管理',2,0,1659079777164),(11,2,'楼层管理','楼层管理','フロア管理','楼层管理',2,0,1659079777164),(12,2,'房间管理','房间管理','部屋管理','房间管理',2,0,1659079777164),(13,2,'资产管理','资产管理','資産管理','资产管理',2,0,1659079777164),(14,10,'添加','添加','追加','楼宇管理-添加',3,0,1659079777164),(15,10,'编辑','编辑','編集','楼宇管理-编辑',3,0,1659079777164),(16,10,'删除','删除','削除','楼宇管理-删除',3,0,1659079777164),(17,11,'添加','添加','追加','楼层管理-添加',3,0,1659079777164),(18,11,'编辑','编辑','編集','楼层管理-编辑',3,0,1659079777164),(19,11,'删除','删除','削除','楼层管理-删除',3,0,1659079777164),(20,12,'添加','添加','追加','房间管理-添加',3,0,1659079777164),(21,12,'编辑','编辑','編集','房间管理-编辑',3,0,1659079777164),(22,12,'删除','删除','削除','房间管理-删除',3,0,1659079777164),(23,13,'添加','添加','追加','资产管理-添加',3,0,1659079777164),(24,13,'编辑','编辑','編集','资产管理-编辑',3,0,1659079777164),(25,13,'删除','删除','削除','资产管理-删除',3,0,1659079777164),(26,3,'设备管理','设备管理','設備管理','设备管理',2,0,1659079777164),(27,26,'添加','添加','追加','设备管理-添加',3,0,1659079777164),(28,26,'编辑','编辑','編集','设备管理-编辑',3,0,1659079777164),(29,26,'删除','删除','削除','设备管理-删除',3,0,1659079777164),(30,26,'批量添加','批量添加','大量に追加','设备管理-批量添加',3,0,1659079777164),(31,26,'批量删除','批量删除','一括削除','设备管理-批量删除',3,0,1659079777164),(32,3,'设备类别管理','设备类别管理','設備の種類管理','设备类别管理',2,0,1659079777164),(33,32,'添加','添加','追加','设备类别管理-添加',3,0,1659079777164),(34,32,'编辑','编辑','編集','设备类别管理-编辑',3,0,1659079777164),(35,32,'删除','删除','削除','设备类别管理-删除',3,0,1659079777164),(36,4,'添加','添加','追加','转发管理-添加',3,0,1659079777164),(37,4,'编辑','编辑','編集','转发管理-编辑',3,0,1659079777164),(38,4,'删除','删除','削除','转发管理-删除',3,0,1659079777164),(39,5,'添加','添加','追加','数据来源管理-添加',3,0,1659079777164),(40,5,'编辑','编辑','編集','数据来源管理-编辑',3,0,1659079777164),(41,5,'删除','删除','削除','数据来源管理-删除',3,0,1659079777164),(42,26,'设置告警模板','设置告警模板','アラームテンプレートの設定','设备管理-设置告警模板',3,0,1659079777164); + + +/*Table structure for table `basic_role` */ + +DROP TABLE IF EXISTS `basic_role`; + +CREATE TABLE `basic_role` ( + `id` bigint NOT NULL AUTO_INCREMENT, + `company_id` bigint DEFAULT NULL, + `role_name` varchar(100) DEFAULT NULL, + `description` varchar(500) DEFAULT NULL, + `flag` int DEFAULT '0' COMMENT '0-正常,1-删除', + `creator_id` bigint DEFAULT NULL, + `create_time` bigint DEFAULT NULL, + `modifier_id` bigint DEFAULT NULL, + `modify_time` bigint DEFAULT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; + +/*Table structure for table `basic_role_menu_relation` */ + +DROP TABLE IF EXISTS `basic_role_menu_relation`; + +CREATE TABLE `basic_role_menu_relation` ( + `role_id` bigint DEFAULT NULL, + `menu_id` bigint DEFAULT NULL, + `creator_id` bigint DEFAULT NULL, + `create_time` bigint DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; + +/*Table structure for table `basic_role_user_relation` */ + +DROP TABLE IF EXISTS `basic_role_user_relation`; + +CREATE TABLE `basic_role_user_relation` ( + `user_id` bigint DEFAULT NULL, + `role_id` bigint DEFAULT NULL, + `creator_id` bigint DEFAULT NULL, + `create_time` bigint DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; diff --git a/document/db/init.sql b/document/db/init.sql new file mode 100644 index 0000000..b1cf338 --- /dev/null +++ b/document/db/init.sql @@ -0,0 +1,161 @@ +/* +SQLyog 企业版 - MySQL GUI v8.14 +MySQL - 8.0.28 : Database - data_center_new +********************************************************************* +*/ + + +/*!40101 SET NAMES utf8 */; + +/*!40101 SET SQL_MODE=''*/; + +/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; +/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; +/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; +/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; +CREATE DATABASE /*!32312 IF NOT EXISTS*/`data_center_new` /*!40100 DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci */ /*!80016 DEFAULT ENCRYPTION='N' */; + +USE `data_center_new`; + +/*Table structure for table `basic_company` */ + +DROP TABLE IF EXISTS `basic_company`; + +CREATE TABLE `basic_company` ( + `id` bigint NOT NULL AUTO_INCREMENT, + `parent_id` bigint DEFAULT NULL, + `company_name` varchar(500) DEFAULT NULL, + `mfa_switch` int DEFAULT '0' COMMENT '谷歌mfa服务开关。0-关闭,1-开启', + `flag` int DEFAULT '0' COMMENT '0-正常,1-删除', + `create_time` bigint DEFAULT NULL, + `modify_time` bigint DEFAULT NULL, + `apikey` varchar(255) DEFAULT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; + +/*Data for the table `basic_company` */ + +insert into `basic_company`(`id`,`parent_id`,`company_name`,`mfa_switch`,`flag`,`create_time`,`modify_time`) values (1,-1,'MiniSolution',0,0,1658978002231,1658978002231); + +/*Table structure for table `basic_menu` */ + +DROP TABLE IF EXISTS `basic_menu`; + +CREATE TABLE `basic_menu` ( + `id` bigint NOT NULL AUTO_INCREMENT, + `parent_menu_id` bigint DEFAULT NULL, + `menu_name` varchar(100) DEFAULT NULL, + `menu_name_en` varchar(100) DEFAULT NULL, + `menu_name_jp` varchar(100) DEFAULT NULL, + `remark` varchar(100) DEFAULT NULL, + `menu_level` int DEFAULT '1' COMMENT '菜单级别', + `flag` int DEFAULT '0' COMMENT '0-正常,1-删除', + `create_time` bigint DEFAULT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; + +/*Data for the table `basic_menu` */ + +insert into `basic_menu`(`id`,`parent_menu_id`,`menu_name`,`menu_name_en`,`menu_name_jp`,`remark`,`menu_level`,`flag`,`create_time`) values (1,-1,'项目管理','项目管理','项目管理','项目管理',1,0,1659079777164),(2,-1,'楼宇模块','楼宇模块','楼宇模块','楼宇模块',1,0,1659079777164),(3,-1,'设备模块','设备模块','设备模块','设备模块',1,0,1659079777164),(4,-1,'转发管理','转发管理','转发管理','转发管理',1,0,1659079777164),(5,-1,'数据来源管理','数据来源管理','数据来源管理','数据来源管理',1,0,1659079777164),(6,1,'添加','添加','添加','项目管理-添加',2,0,1659079777164),(7,1,'编辑','编辑','编辑','项目管理-编辑',2,0,1659079777164),(8,1,'删除','删除','删除','项目管理-删除',2,0,1659079777164),(9,1,'批量添加','批量添加','批量添加','项目管理-批量添加',2,0,1659079777164),(10,2,'楼宇管理','楼宇管理','楼宇管理','楼宇管理',2,0,1659079777164),(11,2,'楼层管理','楼层管理','楼层管理','楼层管理',2,0,1659079777164),(12,2,'房间管理','房间管理','房间管理','房间管理',2,0,1659079777164),(13,2,'资产管理','资产管理','资产管理','资产管理',2,0,1659079777164),(14,10,'添加','添加','添加','楼宇管理-添加',3,0,1659079777164),(15,10,'编辑','编辑','编辑','楼宇管理-编辑',3,0,1659079777164),(16,10,'删除','删除','删除','楼宇管理-删除',3,0,1659079777164),(17,11,'添加','添加','添加','楼层管理-添加',3,0,1659079777164),(18,11,'编辑','编辑','编辑','楼层管理-编辑',3,0,1659079777164),(19,11,'删除','删除','删除','楼层管理-删除',3,0,1659079777164),(20,12,'添加','添加','添加','房间管理-添加',3,0,1659079777164),(21,12,'编辑','编辑','编辑','房间管理-编辑',3,0,1659079777164),(22,12,'删除','删除','删除','房间管理-删除',3,0,1659079777164),(23,13,'添加','添加','添加','资产管理-添加',3,0,1659079777164),(24,13,'编辑','编辑','编辑','资产管理-编辑',3,0,1659079777164),(25,13,'删除','删除','删除','资产管理-删除',3,0,1659079777164),(26,3,'设备管理','设备管理','设备管理','设备管理',2,0,1659079777164),(27,26,'添加','添加','添加','设备管理-添加',3,0,1659079777164),(28,26,'编辑','编辑','编辑','设备管理-编辑',3,0,1659079777164),(29,26,'删除','删除','删除','设备管理-删除',3,0,1659079777164),(30,26,'批量添加','批量添加','批量添加','设备管理-批量添加',3,0,1659079777164),(31,26,'批量删除','批量删除','批量删除','设备管理-批量删除',3,0,1659079777164),(32,3,'设备类别管理','设备类别管理','设备类别管理','设备类别管理',2,0,1659079777164),(33,32,'添加','添加','添加','设备类别管理-添加',3,0,1659079777164),(34,32,'编辑','编辑','编辑','设备类别管理-编辑',3,0,1659079777164),(35,32,'删除','删除','删除','设备类别管理-删除',3,0,1659079777164),(36,4,'添加','添加','添加','转发管理-添加',3,0,1659079777164),(37,4,'编辑','编辑','编辑','转发管理-编辑',3,0,1659079777164),(38,4,'删除','删除','删除','转发管理-删除',3,0,1659079777164),(39,5,'添加','添加','添加','数据来源管理-添加',3,0,1659079777164),(40,5,'编辑','编辑','编辑','数据来源管理-编辑',3,0,1659079777164),(41,5,'删除','删除','删除','数据来源管理-删除',3,0,1659079777164); + +/*Table structure for table `basic_role` */ + +DROP TABLE IF EXISTS `basic_role`; + +CREATE TABLE `basic_role` ( + `id` bigint NOT NULL AUTO_INCREMENT, + `company_id` bigint DEFAULT NULL, + `role_name` varchar(100) DEFAULT NULL, + `description` varchar(500) DEFAULT NULL, + `flag` int DEFAULT '0' COMMENT '0-正常,1-删除', + `creator_id` bigint DEFAULT NULL, + `create_time` bigint DEFAULT NULL, + `modifier_id` bigint DEFAULT NULL, + `modify_time` bigint DEFAULT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; + +/*Table structure for table `basic_role_menu_relation` */ + +DROP TABLE IF EXISTS `basic_role_menu_relation`; + +CREATE TABLE `basic_role_menu_relation` ( + `role_id` bigint DEFAULT NULL, + `menu_id` bigint DEFAULT NULL, + `creator_id` bigint DEFAULT NULL, + `create_time` bigint DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; + +/*Table structure for table `basic_role_user_relation` */ + +DROP TABLE IF EXISTS `basic_role_user_relation`; + +CREATE TABLE `basic_role_user_relation` ( + `user_id` bigint DEFAULT NULL, + `role_id` bigint DEFAULT NULL, + `creator_id` bigint DEFAULT NULL, + `create_time` bigint DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; + +/*Table structure for table `basic_user` */ + +DROP TABLE IF EXISTS `basic_user`; + +CREATE TABLE `basic_user` ( + `id` bigint NOT NULL AUTO_INCREMENT, + `user_type` int DEFAULT '0' COMMENT '0-未知,1-管理平台用户,2-普通平台用户', + `company_id` bigint NOT NULL, + `username` varchar(255) DEFAULT NULL, + `login_name` varchar(255) DEFAULT NULL, + `password` varchar(255) DEFAULT NULL, + `password_modify_time` bigint DEFAULT NULL, + `salt` varchar(255) DEFAULT NULL, + `email` varchar(255) DEFAULT NULL, + `mobile_number` varchar(255) DEFAULT NULL, + `mfa_secret` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL, + `mfa_bind` int DEFAULT '0' COMMENT '用户是否绑定了mfa设备。0-未绑定,1-已绑定', + `last_login_time` bigint DEFAULT NULL, + `flag` int NOT NULL DEFAULT '0' COMMENT '0-正常,1-删除', + `expire_time` bigint DEFAULT '4114487556000', + `create_time` bigint DEFAULT NULL, + `creator_id` bigint DEFAULT NULL, + `modify_time` bigint DEFAULT NULL, + `modifier_id` bigint DEFAULT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; + +/*Data for the table `basic_user` */ + +insert into `basic_user`(`id`,`user_type`,`company_id`,`username`,`login_name`,`password`,`password_modify_time`,`salt`,`email`,`mobile_number`,`mfa_secret`,`mfa_bind`,`last_login_time`,`flag`,`expire_time`,`create_time`,`creator_id`,`modify_time`,`modifier_id`) values (1,1,1,'admin','admin','nVg+buw0YAs=',1670312031273,'09bc3a7898','1053492832@qq.com',NULL,NULL,0,1706177793183,0,4114487556000,4114487556000,NULL,1670312031273,NULL); + +/*Table structure for table `login_history` */ + +DROP TABLE IF EXISTS `login_history`; + +CREATE TABLE `login_history` ( + `id` bigint NOT NULL AUTO_INCREMENT, + `user_id` bigint DEFAULT NULL, + `request_ip` varchar(255) DEFAULT NULL, + `login_time` bigint DEFAULT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; + +/*Table structure for table `worker_node` */ + +DROP TABLE IF EXISTS `worker_node`; + +CREATE TABLE `worker_node` ( + `ID` bigint NOT NULL AUTO_INCREMENT COMMENT 'auto increment id', + `HOST_NAME` varchar(64) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT 'host name', + `PORT` varchar(64) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT 'port', + `TYPE` int NOT NULL COMMENT 'node type: ACTUAL or CONTAINER', + `LAUNCH_DATE` date NOT NULL COMMENT 'launch date', + `MODIFIED` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT 'modified time', + `CREATED` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'created time', + PRIMARY KEY (`ID`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='DB WorkerID Assigner for UID Generator'; + +/*!40101 SET SQL_MODE=@OLD_SQL_MODE */; +/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; +/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; +/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; diff --git a/document/start.sh b/document/start.sh new file mode 100644 index 0000000..d5c9ca5 --- /dev/null +++ b/document/start.sh @@ -0,0 +1,30 @@ +#! /bin/sh +#启动方法 +start(){ +now=`date "+%Y%m%d%H%M%S"` +cd /home/dongjian-dashboard-back/back/server/run && nohup /usr/local/java/jdk1.8.0_221/bin/java -server -Xms256m -Xmx256m -jar /home/dongjian-dashboard-back/back/server/run/dongjian-dashboard-back-controller-0.0.1-SNAPSHOT.jar > /dev/null 2>boot.log & +} +#停止方法 +stop(){ + ps -ef|grep java|grep dongjian-dashboard-back-controller-0.0.1-SNAPSHOT.jar|awk '{print $2}'|while read pid + do + kill -9 $pid + done +} + +case "$1" in +start) +start +;; +stop) +stop +;; +restart) +stop +start +;; +*) +printf 'Usage: %s {start|stop|restart}\n' "$prog" +exit 1 +;; +esac \ No newline at end of file diff --git a/document/update.sh b/document/update.sh new file mode 100644 index 0000000..ef12fdd --- /dev/null +++ b/document/update.sh @@ -0,0 +1,17 @@ +#!/bin/bash + +projectName=dongjian-dashboard-back +backFilePath=/home/$projectName/back/server + +basepath=$(cd `dirname $0`; pwd) +cd $basepath + +echo "start for Web" + +rm -rf $backFilePath/run/lib +unzip -o $backFilePath/$projectName.zip -d $backFilePath/run +\cp -r $backFilePath/run/$projectName/* $backFilePath/run/ +rm -rf $backFilePath/run/$projectName + +sh start.sh restart +exit \ No newline at end of file diff --git a/dongjian-dashboard-back-common/.gitignore b/dongjian-dashboard-back-common/.gitignore new file mode 100644 index 0000000..aa23915 --- /dev/null +++ b/dongjian-dashboard-back-common/.gitignore @@ -0,0 +1,15 @@ +/target/ +/logs/ +/.idea/ +*.iml +*.bak +*.log +/.settings/ +*.project +*.classpath +*.factorypath +*.springBeans +/.apt_generated/ +/.externalToolBuilders/ +/bin/ +application-*.properties diff --git a/dongjian-dashboard-back-common/pom.xml b/dongjian-dashboard-back-common/pom.xml new file mode 100644 index 0000000..3826ebe --- /dev/null +++ b/dongjian-dashboard-back-common/pom.xml @@ -0,0 +1,35 @@ + + + 4.0.0 + + com.techsor + dongjian-dashboard-back + 0.0.1-SNAPSHOT + + dongjian-dashboard-back-common + dongjian-dashboard-back-common + http://maven.apache.org + + UTF-8 + + + + junit + junit + test + + + + com.techsor + dongjian-dashboard-back-dao + 0.0.1-SNAPSHOT + + + com.techsor + dongjian-dashboard-back-util + 0.0.1-SNAPSHOT + + + + diff --git a/dongjian-dashboard-back-common/src/main/java/com/dongjian/dashboard/back/common/Constants.java b/dongjian-dashboard-back-common/src/main/java/com/dongjian/dashboard/back/common/Constants.java new file mode 100644 index 0000000..0ce104e --- /dev/null +++ b/dongjian-dashboard-back-common/src/main/java/com/dongjian/dashboard/back/common/Constants.java @@ -0,0 +1,54 @@ +package com.dongjian.dashboard.back.common; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** +* @author Mr.Jiang +* @time 2022年5月20日 下午2:01:41 +*/ +public class Constants { + + //这个很重要,不要随便动 + public static final String DES_SALT = "ci3b512jwy199511"; + + public static final String APP_NAME = "data-center-business:"; + + //用户ID,登录名,企业ID,token + public static final String ACCESS_TOKEN_FORMAT = "RequestHeader:AccessToken:{0}:{1}:{2}:{3}"; + + public static final String CAPTCHA_VERIFICATION = "CAPTCHA:VERIFICATION:"; + + public static final String DATASOURCE_PREFIX = "dataSourceForCompany_"; + + public static final String THIRD_DB_PREFIX = "data_center_dongjian_"; + + public static final int AURORA_IN_BATCH_SIZE = 1000; + + // 定义大类常量 + public static final int CATEGORY_ALARM = 1;//报警 + public static final int CATEGORY_ACCUMULATE = 2;//累积 + public static final int CATEGORY_MEASURE = 3;//计测 + public static final int CATEGORY_STATUS= 4;//状态 + + // 所有设备类型ID的总集合 + public static final List ALL_DEVICE_TYPE_IDS = new ArrayList<>(); + + // 定义分类与设备类型的映射 + public static final Map> CATEGORY_DEVICE_TYPE_MAP = new HashMap<>(); + static { + CATEGORY_DEVICE_TYPE_MAP.put(CATEGORY_ALARM, Arrays.asList(46, 110)); + CATEGORY_DEVICE_TYPE_MAP.put(CATEGORY_MEASURE, Arrays.asList(47, 111, 121)); + CATEGORY_DEVICE_TYPE_MAP.put(CATEGORY_ACCUMULATE, Arrays.asList(48, 112, 122)); + CATEGORY_DEVICE_TYPE_MAP.put(CATEGORY_STATUS, Arrays.asList(86, 113, 123)); + + // 收集所有的设备类型ID + for (List ids : CATEGORY_DEVICE_TYPE_MAP.values()) { + ALL_DEVICE_TYPE_IDS.addAll(ids); + } + } + +} diff --git a/dongjian-dashboard-back-common/src/main/java/com/dongjian/dashboard/back/common/config/DataSourceAdminConfig.java b/dongjian-dashboard-back-common/src/main/java/com/dongjian/dashboard/back/common/config/DataSourceAdminConfig.java new file mode 100644 index 0000000..7e788d0 --- /dev/null +++ b/dongjian-dashboard-back-common/src/main/java/com/dongjian/dashboard/back/common/config/DataSourceAdminConfig.java @@ -0,0 +1,129 @@ +package com.dongjian.dashboard.back.common.config; + +import com.alibaba.druid.pool.DruidDataSource; +import com.dongjian.dashboard.back.common.Constants; + +import org.apache.ibatis.session.SqlSessionFactory; +import org.mybatis.spring.SqlSessionFactoryBean; +import org.mybatis.spring.SqlSessionTemplate; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.boot.context.properties.ConfigurationProperties; +import org.springframework.boot.jdbc.DataSourceBuilder; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.context.annotation.Primary; +import org.springframework.core.io.support.PathMatchingResourcePatternResolver; +import org.springframework.jdbc.core.JdbcTemplate; +import javax.sql.DataSource; +import java.util.HashMap; +import java.util.Map; + +@Configuration +public class DataSourceAdminConfig { + + private static Logger logger = LoggerFactory.getLogger(DataSourceAdminConfig.class); + + @Value("${spring.datasource.admin.name}") + private String name; + + @Value("${spring.datasource.admin.url}") + private String url; + + @Value("${spring.datasource.admin.username}") + private String username; + + @Value("${spring.datasource.admin.password}") + private String password; + + @Value("${spring.datasource.admin.driverClassName}") + private String driverClassName; + + @Value("${spring.datasource.admin.type}") + private String type; + + @Value("${dynamic.jdbc.url}") + private String dynamicJdbcUrl; + + + private final static String THIRD_DB_PREFIX = Constants.THIRD_DB_PREFIX; + + private final static String DATASOURCE_PREFIX = Constants.DATASOURCE_PREFIX; + + + @Primary + @Bean + public DataSource adminDatasource() { + DruidDataSource datasource = DataSourceBuilder.create() + .url(url) + .username(username) + .password(password).driverClassName(driverClassName) + .type(DruidDataSource.class) + .build(); + + return datasource; + } + + @Bean + public JdbcTemplate jdbcTemplate(DataSource adminDatasource) { + return new JdbcTemplate(adminDatasource); + } + + @Bean + @ConfigurationProperties(prefix = "mybatis.configuration") + public org.apache.ibatis.session.Configuration globalConfiguration() { + return new org.apache.ibatis.session.Configuration(); + } + + @Bean + public SqlSessionFactory sqlSessionFactory(@Qualifier("dynamicDataSource") DataSource dynamicDataSource) throws Exception { + SqlSessionFactoryBean sessionFactory = new SqlSessionFactoryBean(); + sessionFactory.setDataSource(dynamicDataSource); // 设置为动态数据源 + sessionFactory.setConfiguration(globalConfiguration());//驼峰设置mybatis.configuration.map-underscore-to-camel-case不生效处理 + sessionFactory.setMapperLocations(new PathMatchingResourcePatternResolver().getResources("classpath*:mappers/**/*.xml")); // 设置Mapper XML文件的位置 + return sessionFactory.getObject(); + } + + @Bean + public SqlSessionTemplate sqlSessionTemplate(SqlSessionFactory sqlSessionFactory) { + return new SqlSessionTemplate(sqlSessionFactory); + } + + + @Bean + public DataSource dynamicDataSource(JdbcTemplate jdbcTemplate, DataSource adminDatasource) { + DynamicRouteDataSource dynamicDataSource = new DynamicRouteDataSource(); + Map targetDataSources = new HashMap<>(); + + //Requirement for 2024-07-16: Small enterprises and large enterprises share the same database. For large enterprises, parent_id = 1 + String sql="\t\tSELECT\n" + + "\t\t\tbcom.id,\n" + + "\t\t\tbcom.company_name companyName\n" + + "\t\tFROM\n" + + "\t\t\tdata_center_new.basic_company bcom\n" + + "\t\tWHERE bcom.flag != 1 and (parent_id = 1 or parent_id = -1)"; + + jdbcTemplate.query(sql,rs->{ + DruidDataSource dataSource1 = new DruidDataSource(); + String dbName=THIRD_DB_PREFIX+rs.getInt("id"); + String dbUrl=String.format(dynamicJdbcUrl,dbName); + dataSource1.setUrl(dbUrl); + dataSource1.setUsername(username); + dataSource1.setPassword(password); + dataSource1.setDriverClassName(driverClassName); + dataSource1.setDbType(type); + targetDataSources.put(DATASOURCE_PREFIX+rs.getInt("id"), dataSource1); + + }); + + dynamicDataSource.setTargetDataSources(targetDataSources); + dynamicDataSource.setDefaultTargetDataSource(adminDatasource); // 设置默认数据源 + return dynamicDataSource; + } + + + + +} diff --git a/dongjian-dashboard-back-common/src/main/java/com/dongjian/dashboard/back/common/config/DataSourceContextHolder.java b/dongjian-dashboard-back-common/src/main/java/com/dongjian/dashboard/back/common/config/DataSourceContextHolder.java new file mode 100644 index 0000000..82d4095 --- /dev/null +++ b/dongjian-dashboard-back-common/src/main/java/com/dongjian/dashboard/back/common/config/DataSourceContextHolder.java @@ -0,0 +1,18 @@ +package com.dongjian.dashboard.back.common.config; + +public class DataSourceContextHolder { + + private static final ThreadLocal contextHolder = new ThreadLocal<>(); + + public static void setCurrentDataSourceKey(String dataSourceKey) { + contextHolder.set(dataSourceKey); + } + + public static String getCurrentDataSourceKey() { + return contextHolder.get(); + } + + public static void clearCurrentDataSourceKey() { + contextHolder.remove(); + } +} diff --git a/dongjian-dashboard-back-common/src/main/java/com/dongjian/dashboard/back/common/config/DataSourceInterceptor.java b/dongjian-dashboard-back-common/src/main/java/com/dongjian/dashboard/back/common/config/DataSourceInterceptor.java new file mode 100644 index 0000000..70e28ed --- /dev/null +++ b/dongjian-dashboard-back-common/src/main/java/com/dongjian/dashboard/back/common/config/DataSourceInterceptor.java @@ -0,0 +1,117 @@ +package com.dongjian.dashboard.back.common.config; + +import lombok.extern.slf4j.Slf4j; + +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.jdbc.core.JdbcTemplate; +import org.springframework.stereotype.Component; +import org.springframework.web.servlet.HandlerInterceptor; + +import com.dongjian.dashboard.back.common.Constants; + +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; + +import java.util.ArrayList; +import java.util.HashSet; +import java.util.List; +import java.util.Set; +import java.util.concurrent.atomic.AtomicLong; + + +@Slf4j +@Component +public class DataSourceInterceptor implements HandlerInterceptor { + + @Autowired + JdbcTemplate jdbcTemplate; + + @Override + public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) { + String companyId = request.getHeader("companyId"); + if (StringUtils.isNotBlank(companyId)) { + + // 如果包含 /role 或 /user,使用默认数据源(adminDatasource),不设置动态数据源 + String uri = request.getRequestURI(); + if (useDefaultDataSource(uri)){ + log.info("路径 {} 命中 adminDatasource,使用默认数据源", uri); + DataSourceContextHolder.clearCurrentDataSourceKey(); // 确保没有设置动态数据源键 + return true; + } + + + //Find the ID of the large enterprise. + long topCompanyId = getTopCompanyId(companyId); + + String dataSourceKey = Constants.DATASOURCE_PREFIX + topCompanyId; // 创建数据源键 + log.info("当前数据源为:" + dataSourceKey); + DataSourceContextHolder.setCurrentDataSourceKey(dataSourceKey); + } + return true; + } + + public boolean useDefaultDataSource(String uri) { + return uri.contains("/role") || uri.contains("/user"); + } + + public long getTopCompanyId(String companyId) { + + String sql="SELECT " + + " bcom.id, bcom.parent_id parentId" + + " FROM data_center_new.basic_company bcom " + + " WHERE bcom.flag != 1 and bcom.id = " + companyId; + + AtomicLong parentId = new AtomicLong(0); + AtomicLong id = new AtomicLong(0); + jdbcTemplate.query(sql,rs -> { + parentId.set(rs.getLong("parentId")); + id.set(rs.getLong("id")); + }); + //Recursive logic + if (1 == parentId.get() || -1 == parentId.get()) { + return id.get(); + } else { + return getTopCompanyId(parentId.get()+""); + } + } + + /** + * 获取所有的一级企业 + * @return + */ + public List getTopCompanyIdList(){ + List companyIdList=new ArrayList<>(); + String sql="\t\tSELECT\n" + + "\t\t\tbcom.id,\n" + + "\t\t\tbcom.company_name companyName\n" + + "\t\tFROM\n" + + "\t\t\tdata_center_new.basic_company bcom\n" + + "\t\tWHERE (bcom.parent_id=1 or bcom.parent_id=-1) and bcom.flag != 1"; + + jdbcTemplate.query(sql,rs->{ + companyIdList.add(rs.getLong("id")); + }); + +// // 用于存放去重后的 topCompanyIdList +// List topCompanyIdList = new ArrayList<>(); +// Set seenIds = new HashSet<>(); // 用于快速判断重复 +// // 遍历 companyIdList +// for (Integer companyId : companyIdList) { +// Long topCompanyId = getTopCompanyId(companyId.toString()); +// // 如果 topCompanyId 未出现在 seenIds 中,则添加 +// if (seenIds.add(topCompanyId)) { +// topCompanyIdList.add(topCompanyId); +// } +// } + + return companyIdList; + } + + @Override + public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex) { + DataSourceContextHolder.clearCurrentDataSourceKey(); // 清理数据源键 + } + + +} diff --git a/dongjian-dashboard-back-common/src/main/java/com/dongjian/dashboard/back/common/config/DynamicRouteDataSource.java b/dongjian-dashboard-back-common/src/main/java/com/dongjian/dashboard/back/common/config/DynamicRouteDataSource.java new file mode 100644 index 0000000..ebce947 --- /dev/null +++ b/dongjian-dashboard-back-common/src/main/java/com/dongjian/dashboard/back/common/config/DynamicRouteDataSource.java @@ -0,0 +1,13 @@ +package com.dongjian.dashboard.back.common.config; + +import org.springframework.jdbc.datasource.lookup.AbstractRoutingDataSource; + + +public class DynamicRouteDataSource extends AbstractRoutingDataSource { + + @Override + protected Object determineCurrentLookupKey() { + // 返回当前线程要使用的数据源的键 + return DataSourceContextHolder.getCurrentDataSourceKey(); + } +} diff --git a/dongjian-dashboard-back-common/src/main/java/com/dongjian/dashboard/back/common/exception/BusinessException.java b/dongjian-dashboard-back-common/src/main/java/com/dongjian/dashboard/back/common/exception/BusinessException.java new file mode 100644 index 0000000..5d6f9a3 --- /dev/null +++ b/dongjian-dashboard-back-common/src/main/java/com/dongjian/dashboard/back/common/exception/BusinessException.java @@ -0,0 +1,36 @@ +package com.dongjian.dashboard.back.common.exception; + +/** + * 业务异常处理 + * + */ +public class BusinessException extends RuntimeException{ + + /** + * 实例化一个新的业务异常 + * + * @param msg 异常信息 + */ + public BusinessException(String msg) { + super(msg); + } + + /** + * 实例化一个新的业务异常 + * + * @param cause 异常原因 + */ + public BusinessException(Throwable cause) { + super(cause); + } + + /** + * 实例化一个新的业务异常 + * + * @param msg 异常信息 + * @param cause 异常原因 + */ + public BusinessException(String msg, Throwable cause) { + super(msg, cause); + } +} diff --git a/dongjian-dashboard-back-common/src/main/java/com/dongjian/dashboard/back/common/exception/MsgCodeException.java b/dongjian-dashboard-back-common/src/main/java/com/dongjian/dashboard/back/common/exception/MsgCodeException.java new file mode 100644 index 0000000..8d9b493 --- /dev/null +++ b/dongjian-dashboard-back-common/src/main/java/com/dongjian/dashboard/back/common/exception/MsgCodeException.java @@ -0,0 +1,26 @@ +package com.dongjian.dashboard.back.common.exception; + +/** + * + * @author jwy-style + * + */ +public class MsgCodeException extends RuntimeException{ + + private String message; + + public MsgCodeException(String message) { + super(message); + this.message = message; + } + + + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + +} diff --git a/dongjian-dashboard-back-common/src/main/java/com/dongjian/dashboard/back/common/language/PropertySourceYumFactory.java b/dongjian-dashboard-back-common/src/main/java/com/dongjian/dashboard/back/common/language/PropertySourceYumFactory.java new file mode 100644 index 0000000..75ca84b --- /dev/null +++ b/dongjian-dashboard-back-common/src/main/java/com/dongjian/dashboard/back/common/language/PropertySourceYumFactory.java @@ -0,0 +1,26 @@ +package com.dongjian.dashboard.back.common.language; + +import java.io.IOException; +import java.util.List; + +import org.springframework.boot.env.YamlPropertySourceLoader; +import org.springframework.core.env.PropertySource; +import org.springframework.core.io.support.DefaultPropertySourceFactory; +import org.springframework.core.io.support.EncodedResource; + +/** + * @PropertySource 解析.yum文件需要指定该工厂 + */ +public class PropertySourceYumFactory extends DefaultPropertySourceFactory { + + @Override + public PropertySource createPropertySource(String name, EncodedResource resource) throws IOException { + if (resource == null) { + return super.createPropertySource(name, resource); + } + List> sources = new YamlPropertySourceLoader().load(resource.getResource().getFilename(), resource.getResource()); + return sources.get(0); + } + + +} diff --git a/dongjian-dashboard-back-common/src/main/java/com/dongjian/dashboard/back/common/language/msg/MsgLanguageChange.java b/dongjian-dashboard-back-common/src/main/java/com/dongjian/dashboard/back/common/language/msg/MsgLanguageChange.java new file mode 100644 index 0000000..d2c637a --- /dev/null +++ b/dongjian-dashboard-back-common/src/main/java/com/dongjian/dashboard/back/common/language/msg/MsgLanguageChange.java @@ -0,0 +1,54 @@ +package com.dongjian.dashboard.back.common.language.msg; + +import org.apache.commons.collections.MapUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +@Component +public class MsgLanguageChange { + @Autowired + private Msg_EN msgEn; + @Autowired + private Msg_CN msgCn; + @Autowired + private Msg_JP msgJp; + + /** + * 参数映射 + * @param languaType + * @param code + * @return + */ + public String getParameterMapByCode(Integer languageType,String code){ + String msg = null; + if(null != languageType){ + if(languageType == 0){//中文 + msg = MapUtils.getString(msgCn.getParameterMap(), code, code); + }else if(languageType == 1){//英文 + msg = MapUtils.getString(msgEn.getParameterMap(), code, code); + }else if(languageType == 2){//日语 + msg = MapUtils.getString(msgJp.getParameterMap(), code, code); + } + }else{ + msg = MapUtils.getString(msgJp.getParameterMap(), code, code); + } + return msg; + } + + public String getOperationLogMapByCode(Integer languageType,String code){ + String msg = null; + if(null != languageType){ + if(languageType == 0){//中文 + msg = MapUtils.getString(msgCn.getOperationLogMap(), code, code); + }else if(languageType == 1){//英文 + msg = MapUtils.getString(msgEn.getOperationLogMap(), code, code); + }else if(languageType == 2){//日语 + msg = MapUtils.getString(msgJp.getOperationLogMap(), code, code); + } + }else{ + msg = MapUtils.getString(msgJp.getOperationLogMap(), code, code); + } + return msg; + } + +} diff --git a/dongjian-dashboard-back-common/src/main/java/com/dongjian/dashboard/back/common/language/msg/Msg_CN.java b/dongjian-dashboard-back-common/src/main/java/com/dongjian/dashboard/back/common/language/msg/Msg_CN.java new file mode 100644 index 0000000..141ceb7 --- /dev/null +++ b/dongjian-dashboard-back-common/src/main/java/com/dongjian/dashboard/back/common/language/msg/Msg_CN.java @@ -0,0 +1,27 @@ +package com.dongjian.dashboard.back.common.language.msg; + +import java.util.Map; + +import org.springframework.boot.context.properties.ConfigurationProperties; +import org.springframework.context.annotation.PropertySource; +import org.springframework.stereotype.Component; + +import com.dongjian.dashboard.back.common.language.PropertySourceYumFactory; + +import lombok.Getter; +import lombok.Setter; + +@Setter +@Getter +@Component +@PropertySource(value = "classpath:/config/language/msg/msg_cn.yml", encoding = "UTF-8", factory = PropertySourceYumFactory.class) +@ConfigurationProperties(prefix = "msgcn") +public class Msg_CN { + + private Map parameterMap; + + private Map reportMap; + + private Map operationLogMap; + +} \ No newline at end of file diff --git a/dongjian-dashboard-back-common/src/main/java/com/dongjian/dashboard/back/common/language/msg/Msg_EN.java b/dongjian-dashboard-back-common/src/main/java/com/dongjian/dashboard/back/common/language/msg/Msg_EN.java new file mode 100644 index 0000000..f29e43e --- /dev/null +++ b/dongjian-dashboard-back-common/src/main/java/com/dongjian/dashboard/back/common/language/msg/Msg_EN.java @@ -0,0 +1,27 @@ +package com.dongjian.dashboard.back.common.language.msg; + +import java.util.Map; + +import org.springframework.boot.context.properties.ConfigurationProperties; +import org.springframework.context.annotation.PropertySource; +import org.springframework.stereotype.Component; + +import com.dongjian.dashboard.back.common.language.PropertySourceYumFactory; + +import lombok.Getter; +import lombok.Setter; + +@Setter +@Getter +@Component +@PropertySource(value = "classpath:/config/language/msg/msg_en.yml", encoding = "UTF-8", factory = PropertySourceYumFactory.class) +@ConfigurationProperties(prefix = "msgen") +public class Msg_EN { + + private Map parameterMap; + + private Map reportMap; + + private Map operationLogMap; + +} \ No newline at end of file diff --git a/dongjian-dashboard-back-common/src/main/java/com/dongjian/dashboard/back/common/language/msg/Msg_JP.java b/dongjian-dashboard-back-common/src/main/java/com/dongjian/dashboard/back/common/language/msg/Msg_JP.java new file mode 100644 index 0000000..f341b19 --- /dev/null +++ b/dongjian-dashboard-back-common/src/main/java/com/dongjian/dashboard/back/common/language/msg/Msg_JP.java @@ -0,0 +1,27 @@ +package com.dongjian.dashboard.back.common.language.msg; + +import java.util.Map; + +import org.springframework.boot.context.properties.ConfigurationProperties; +import org.springframework.context.annotation.PropertySource; +import org.springframework.stereotype.Component; + +import com.dongjian.dashboard.back.common.language.PropertySourceYumFactory; + +import lombok.Getter; +import lombok.Setter; + +@Setter +@Getter +@Component +@PropertySource(value = "classpath:/config/language/msg/msg_jp.yml", encoding = "UTF-8", factory = PropertySourceYumFactory.class) +@ConfigurationProperties(prefix = "msgjp") +public class Msg_JP { + + private Map parameterMap; + + private Map reportMap; + + private Map operationLogMap; + +} \ No newline at end of file diff --git a/dongjian-dashboard-back-common/src/main/java/com/dongjian/dashboard/back/common/response/BaseResponse.java b/dongjian-dashboard-back-common/src/main/java/com/dongjian/dashboard/back/common/response/BaseResponse.java new file mode 100644 index 0000000..322280a --- /dev/null +++ b/dongjian-dashboard-back-common/src/main/java/com/dongjian/dashboard/back/common/response/BaseResponse.java @@ -0,0 +1,51 @@ +package com.dongjian.dashboard.back.common.response; + +import io.swagger.v3.oas.annotations.media.Schema; + +/** + * + * @author jwy-style + * + */ +public class BaseResponse { + /** + * 返回码 + */ + @Schema(description = "状态码, 0或者200表示成功",example = "0") + private int code; + /** + * 提示信息 + */ + @Schema(description = "简单的提示信息",example = "服务器错误") + private String msg = "success"; + + public BaseResponse() { + + } + + public BaseResponse(int code) { + this.code = code; + } + + public BaseResponse(int code, String msg) { + this.code = code; + this.msg = msg; + } + + public int getCode() { + return code; + } + + public void setCode(int code) { + this.code = code; + } + + public String getMsg() { + return msg; + } + + public void setMsg(String msg) { + this.msg = msg; + } +} + diff --git a/dongjian-dashboard-back-common/src/main/java/com/dongjian/dashboard/back/common/response/PageInfo.java b/dongjian-dashboard-back-common/src/main/java/com/dongjian/dashboard/back/common/response/PageInfo.java new file mode 100644 index 0000000..6deb706 --- /dev/null +++ b/dongjian-dashboard-back-common/src/main/java/com/dongjian/dashboard/back/common/response/PageInfo.java @@ -0,0 +1,401 @@ +package com.dongjian.dashboard.back.common.response; + +import java.util.Collection; +import java.util.Collections; +import java.util.List; + +import com.github.pagehelper.Page; +import com.github.pagehelper.PageSerializable; + +/** + * 对Page结果进行包装 + *

+ * 新增分页的多项属性,主要参考:http://bbs.csdn.net/topics/360010907 + * + * @author liuzh/abel533/isea533 + * @version 3.3.0 + * @since 3.2.2 + * 项目地址 : http://git.oschina.net/free/Mybatis_PageHelper + */ +@SuppressWarnings({"rawtypes", "unchecked"}) +public class PageInfo extends PageSerializable { + public static final int DEFAULT_NAVIGATE_PAGES = 8; + public static final PageInfo EMPTY = new PageInfo(Collections.emptyList(), 0); + /** + * 当前页 + */ + private int pageNum; + /** + * 每页的数量 + */ + private int pageSize; + /** + * 当前页的数量 + */ + private int size; + + /** + * 由于startRow和endRow不常用,这里说个具体的用法 + * 可以在页面中"显示startRow到endRow 共size条数据" + * 当前页面第一个元素在数据库中的行号 + */ + private long startRow; + /** + * 当前页面最后一个元素在数据库中的行号 + */ + private long endRow; + /** + * 总页数 + */ + private int pages; + /** + * 前一页 + */ + private int prePage; + /** + * 下一页 + */ + private int nextPage; + + /** + * 是否为第一页 + */ + private boolean isFirstPage = false; + /** + * 是否为最后一页 + */ + private boolean isLastPage = false; + /** + * 是否有前一页 + */ + private boolean hasPreviousPage = false; + /** + * 是否有下一页 + */ + private boolean hasNextPage = false; + + /** + * 导航页码数 + */ + private int navigatePages; + /** + * 所有导航页号 + */ + private int[] navigatepageNums; + /** + * 导航条上的第一页 + */ + private int navigateFirstPage; + /** + * 导航条上的最后一页 + */ + private int navigateLastPage; + + public PageInfo() { + } + + /** + * 包装Page对象 + * + * @param list + */ + public PageInfo(List list) { + this(list, DEFAULT_NAVIGATE_PAGES); + } + + /** + * 包装Page对象 + * + * @param list page结果 + * @param navigatePages 页码数量 + */ + public PageInfo(List list, int navigatePages) { + super(list); + if (list instanceof Page) { + Page page = (Page) list; + this.pageNum = page.getPageNum(); + this.pageSize = page.getPageSize(); + + this.pages = page.getPages(); + this.size = page.size(); + //由于结果是>startRow的,所以实际的需要+1 + if (this.size == 0) { + this.startRow = 0; + this.endRow = 0; + } else { + this.startRow = page.getStartRow() + 1; + //计算实际的endRow(最后一页的时候特殊) + this.endRow = this.startRow - 1 + this.size; + } + } else if (list instanceof Collection) { + this.pageNum = 1; + this.pageSize = list.size(); + + this.pages = this.pageSize > 0 ? 1 : 0; + this.size = list.size(); + this.startRow = 0; + this.endRow = list.size() > 0 ? list.size() - 1 : 0; + } + if (list instanceof Collection) { + calcByNavigatePages(navigatePages); + } + } + + public static PageInfo of(List list) { + return new PageInfo(list); + } + + public static PageInfo of(List list, int navigatePages) { + return new PageInfo(list, navigatePages); + } + + /** + * 返回一个空的 Pageinfo 对象 + * + * @return + */ + public static PageInfo emptyPageInfo() { + return EMPTY; + } + + public void calcByNavigatePages(int navigatePages) { + setNavigatePages(navigatePages); + //计算导航页 + calcNavigatepageNums(); + //计算前后页,第一页,最后一页 + calcPage(); + //判断页面边界 + judgePageBoudary(); + } + + /** + * 计算导航页 + */ + private void calcNavigatepageNums() { + //当总页数小于或等于导航页码数时 + if (pages <= navigatePages) { + navigatepageNums = new int[pages]; + for (int i = 0; i < pages; i++) { + navigatepageNums[i] = i + 1; + } + } else { //当总页数大于导航页码数时 + navigatepageNums = new int[navigatePages]; + int startNum = pageNum - navigatePages / 2; + int endNum = pageNum + navigatePages / 2; + + if (startNum < 1) { + startNum = 1; + //(最前navigatePages页 + for (int i = 0; i < navigatePages; i++) { + navigatepageNums[i] = startNum++; + } + } else if (endNum > pages) { + endNum = pages; + //最后navigatePages页 + for (int i = navigatePages - 1; i >= 0; i--) { + navigatepageNums[i] = endNum--; + } + } else { + //所有中间页 + for (int i = 0; i < navigatePages; i++) { + navigatepageNums[i] = startNum++; + } + } + } + } + + /** + * 计算前后页,第一页,最后一页 + */ + private void calcPage() { + if (navigatepageNums != null && navigatepageNums.length > 0) { + navigateFirstPage = navigatepageNums[0]; + navigateLastPage = navigatepageNums[navigatepageNums.length - 1]; + if (pageNum > 1) { + prePage = pageNum - 1; + } + if (pageNum < pages) { + nextPage = pageNum + 1; + } + } + } + + /** + * 判定页面边界 + */ + private void judgePageBoudary() { + isFirstPage = pageNum == 1; + isLastPage = pageNum == pages || pages == 0; + hasPreviousPage = pageNum > 1; + hasNextPage = pageNum < pages; + } + + /** + * 是否包含内容 + */ + public boolean hasContent() { + return this.size > 0; + } + + public int getPageNum() { + return pageNum; + } + + public void setPageNum(int pageNum) { + this.pageNum = pageNum; + } + + public int getPageSize() { + return pageSize; + } + + public void setPageSize(int pageSize) { + this.pageSize = pageSize; + } + + public int getSize() { + return size; + } + + public void setSize(int size) { + this.size = size; + } + + public long getStartRow() { + return startRow; + } + + public void setStartRow(long startRow) { + this.startRow = startRow; + } + + public long getEndRow() { + return endRow; + } + + public void setEndRow(long endRow) { + this.endRow = endRow; + } + + public int getPages() { + return pages; + } + + public void setPages(int pages) { + this.pages = pages; + } + + public int getPrePage() { + return prePage; + } + + public void setPrePage(int prePage) { + this.prePage = prePage; + } + + public int getNextPage() { + return nextPage; + } + + public void setNextPage(int nextPage) { + this.nextPage = nextPage; + } + + public boolean isIsFirstPage() { + return isFirstPage; + } + + public void setIsFirstPage(boolean isFirstPage) { + this.isFirstPage = isFirstPage; + } + + public boolean isIsLastPage() { + return isLastPage; + } + + public void setIsLastPage(boolean isLastPage) { + this.isLastPage = isLastPage; + } + + public boolean isHasPreviousPage() { + return hasPreviousPage; + } + + public void setHasPreviousPage(boolean hasPreviousPage) { + this.hasPreviousPage = hasPreviousPage; + } + + public boolean isHasNextPage() { + return hasNextPage; + } + + public void setHasNextPage(boolean hasNextPage) { + this.hasNextPage = hasNextPage; + } + + public int getNavigatePages() { + return navigatePages; + } + + public void setNavigatePages(int navigatePages) { + this.navigatePages = navigatePages; + } + + public int[] getNavigatepageNums() { + return navigatepageNums; + } + + public void setNavigatepageNums(int[] navigatepageNums) { + this.navigatepageNums = navigatepageNums; + } + + public int getNavigateFirstPage() { + return navigateFirstPage; + } + + public int getNavigateLastPage() { + return navigateLastPage; + } + + public void setNavigateFirstPage(int navigateFirstPage) { + this.navigateFirstPage = navigateFirstPage; + } + + public void setNavigateLastPage(int navigateLastPage) { + this.navigateLastPage = navigateLastPage; + } + + @Override + public String toString() { + final StringBuilder sb = new StringBuilder("PageInfo{"); + sb.append("pageNum=").append(pageNum); + sb.append(", pageSize=").append(pageSize); + sb.append(", size=").append(size); + sb.append(", startRow=").append(startRow); + sb.append(", endRow=").append(endRow); + sb.append(", total=").append(total); + sb.append(", pages=").append(pages); + sb.append(", list=").append(list); + sb.append(", prePage=").append(prePage); + sb.append(", nextPage=").append(nextPage); + sb.append(", isFirstPage=").append(isFirstPage); + sb.append(", isLastPage=").append(isLastPage); + sb.append(", hasPreviousPage=").append(hasPreviousPage); + sb.append(", hasNextPage=").append(hasNextPage); + sb.append(", navigatePages=").append(navigatePages); + sb.append(", navigateFirstPage=").append(navigateFirstPage); + sb.append(", navigateLastPage=").append(navigateLastPage); + sb.append(", navigatepageNums="); + if (navigatepageNums == null) { + sb.append("null"); + } else { + sb.append('['); + for (int i = 0; i < navigatepageNums.length; ++i) { + sb.append(i == 0 ? "" : ", ").append(navigatepageNums[i]); + } + sb.append(']'); + } + sb.append('}'); + return sb.toString(); + } +} \ No newline at end of file diff --git a/dongjian-dashboard-back-common/src/main/java/com/dongjian/dashboard/back/common/response/PageResponse.java b/dongjian-dashboard-back-common/src/main/java/com/dongjian/dashboard/back/common/response/PageResponse.java new file mode 100644 index 0000000..1357864 --- /dev/null +++ b/dongjian-dashboard-back-common/src/main/java/com/dongjian/dashboard/back/common/response/PageResponse.java @@ -0,0 +1,66 @@ +package com.dongjian.dashboard.back.common.response; + +import com.github.pagehelper.PageInfo; + +import java.util.Map; + +/** + * + * @author jwy-style + * + * @param + */ +public class PageResponse extends BaseResponse{ + /** + * 对象信息 + */ + private T data; + + private Map errorMap; + + public PageResponse() { + } + + public PageResponse(int code) { + super(code); + } + + public PageResponse(int code, String msg) { + super(code, msg); + } + + public PageResponse(int code,String msg,Map errorMap){ + super(code, msg); + this.errorMap = errorMap; + } + + public static PageResponse success(Object data){ + PageResponse pageResponse = new PageResponse(); + pageResponse.setData((PageInfo) data); + pageResponse.setCode(ResponseCode.SUCCESS); + pageResponse.setMsg("success"); + return pageResponse; + } + + + public Map getErrorMap() { + return errorMap; + } + + public void setErrorMap(Map errorMap) { + this.errorMap = errorMap; + } + + public T getData() { + return data; + } + + public void setData(T data) { + this.data = data; + } + + + + + +} diff --git a/dongjian-dashboard-back-common/src/main/java/com/dongjian/dashboard/back/common/response/ResponseCode.java b/dongjian-dashboard-back-common/src/main/java/com/dongjian/dashboard/back/common/response/ResponseCode.java new file mode 100644 index 0000000..c71e862 --- /dev/null +++ b/dongjian-dashboard-back-common/src/main/java/com/dongjian/dashboard/back/common/response/ResponseCode.java @@ -0,0 +1,32 @@ +package com.dongjian.dashboard.back.common.response; + +/** + * + * @author jwy-style + * + */ +public class ResponseCode { + + /** 成功 */ + public static final int OK = 0; + /** + * 请求已成功,请求所希望的响应头或数据体将随此响应返回。 + */ + public static final int SUCCESS = 200; + + //鉴权不通过 + public static final int AUTHORIZE_FAILED = 401; + + //服务器内部错误 + public static final int SERVER_ERROR = 500; + public static final String SERVER_ERROR_MSG = "service error"; + + /** 系统错误 */ + public static final int SYSTEM_ERROR = 20000; + // + public static final int MSG_ERROR = 20001; + + public static final int MSG_DATA_NULL_ERROR = 20002; + + public static final int MSG_DATA_ERROR = 20003; +} diff --git a/dongjian-dashboard-back-common/src/main/java/com/dongjian/dashboard/back/common/response/SimpleDataResponse.java b/dongjian-dashboard-back-common/src/main/java/com/dongjian/dashboard/back/common/response/SimpleDataResponse.java new file mode 100644 index 0000000..b77c24d --- /dev/null +++ b/dongjian-dashboard-back-common/src/main/java/com/dongjian/dashboard/back/common/response/SimpleDataResponse.java @@ -0,0 +1,104 @@ +package com.dongjian.dashboard.back.common.response; + +import com.fasterxml.jackson.annotation.JsonInclude; + +import io.swagger.v3.oas.annotations.media.Schema; + +import java.util.Map; + +/** + * + * @author jwy-style + * + * @param + */ +@JsonInclude(JsonInclude.Include.NON_NULL) +public class SimpleDataResponse extends BaseResponse { + /** + * 单个对象 + */ + @Schema(description = "返回的数据",example = "object") + private T data; + + /** + * The parameters Error map. + */ + @Schema(description = "复杂的提示信息",example = "{\"name\":\"长度过长\",\"age\":\"年龄太大\",\"weight\":\"体重超标\"}") + private Map errorMap; + + public SimpleDataResponse() { + super(); + } + + public SimpleDataResponse(int code) { + super(code); + } + + public SimpleDataResponse(int code, String msg) { + super(code, msg); + } + + /** + * 响应结果,携带错误Map + * @param code + * @param msg + * @param errorMap + */ + public SimpleDataResponse(int code, String msg, Map errorMap) { + this(code, msg); + this.errorMap = errorMap; + } + + /** + * 成功响应 + * @return + */ + public static SimpleDataResponse success(){ + return new SimpleDataResponse(ResponseCode.SUCCESS,"Success"); + } + + /** + * 多条数据,成功响应 + * @param rows + * @return + */ + public static SimpleDataResponse success(int rows){ + return new SimpleDataResponse(ResponseCode.SUCCESS,"Success: "+rows); + } + + /** + * 成功响应,携带数据对象返回 + * @param data + * @return + */ + public static SimpleDataResponse success(Object data){ + SimpleDataResponse comm = success(); + comm.setData(data); + return comm; + } + + + public static SimpleDataResponse fail(int code,String message){ + return new SimpleDataResponse(code,message); + } + public static SimpleDataResponse fail(int code,String message,Object data){ + SimpleDataResponse simpleDataResponse= new SimpleDataResponse(code,message); + simpleDataResponse.setData(data); + return simpleDataResponse; + } + public T getData() { + return data; + } + + public void setData(T data) { + this.data = data; + } + + public Map getErrorMap() { + return errorMap; + } + + public void setErrorMap(Map errorMap) { + this.errorMap = errorMap; + } +} diff --git a/dongjian-dashboard-back-common/src/main/resources/config/language/msg/msg_cn.yml b/dongjian-dashboard-back-common/src/main/resources/config/language/msg/msg_cn.yml new file mode 100644 index 0000000..7956ecb --- /dev/null +++ b/dongjian-dashboard-back-common/src/main/resources/config/language/msg/msg_cn.yml @@ -0,0 +1,131 @@ +msgcn: + parameterMap: + serviceError: 内部服务错误 + tokenError: 接口鉴权失败 + excelEmpty: 表格为空 + lineNum: 第{0}行: + paramsFormatError: 参数格式错误 + verifCodeExpired: 验证码过期 + verifCodeError: 验证码错误 + accountExpired: 该账号已过期 + pwdError: 密码错误 + userNotExist: 用户不存在 + noOperationAuth: 无操作权限 + projectNameHasExisted: 项目名称已存在 + projectNameDoesNotExist: 项目名称不存在 + buildingNameHasExisted: 楼宇名称已存在 + buildingNameDoesNotExist: 楼宇名称不存在 + floorNameHasExisted: 楼层名称已存在 + floorNameDoesNotExist: 楼层名称不存在 + buildingNotFound: 不存在该楼宇 + fbNotSameCompany: 需与楼宇归属于同一企业 + spaceNameHasExisted: 房间名称已存在 + floorNotFound: 不存在该楼层 + rfNotSameCompany: 需与楼层归属于同一企业 + assetNameHasExisted: 资产名称已存在 + assetSymbolHasExisted: 资产记号已存在 + assetNameDoesNotExist: 资产名称不存在 + assetSymbolDoesNotExist: 资产记号不存在 + spaceNotFound: 不存在该房间 + faNotSameCompany: 需与房间归属于同一企业 + bindedDevice: 绑定了设备 + deviceTypeNotExist: 设备类型不存在 + excelBuildingLineDuplicate: 表格内存在相同的数据 + dbBuildingDuplicate: 平台已存在此楼宇 + dbFloorDuplicate: 平台已存在此楼层 + dbSpaceDuplicate: 平台已存在此房间 + dbAssetDuplicate: 平台已存在此资产 + excelCompanyNameIsNull: 需填写企业名称 + excelBuildingNameIsNull: 需填写楼宇 + excelFloorNameIsNull: 需填写楼层 + excelSpaceNameIsNull: 需填写房间 + excelSpaceOrFloorNameIsNull: 需填写楼层和房间 + excelCompanyNameNotExist: 平台不存在此企业名称 + userOrEmailNotExist: 用户名或邮箱不存在 + companyNameHasExisted: 平台已存在此企业 + taowaComapny: 不可使用下级企业作为父企业 + hasSubsidiary: 删除的企业拥有下级企业,需先处理下级企业 + roleNameExist: 角色名已存在 + roleHasBinded: 角色已绑定用户,请先解绑再删除 + loginNameOrEmailHasExisted: 用户名或邮箱已被使用 + mailAddUserPwdSubject: 新建账号密码 + mailAddUserPwdContent: '账号 {0} 的密码为 {1} 请妥善保管

登陆网址:{2}' + mailResetUserPwdSubject: 重置账号密码 + pwdFormatError: 密码组成必须包含数字、英文字母、特殊符号(~!@#$%^&*)且大于等于12位 + oldPwdError: 旧密码错误 + newPwdSameOld: 新密码不得与旧密码相同 + companyLimit: 最多可创建15个企业 + consecutiveLoginFail: 登录失败次数过多,请等待{0}分{1}秒后再登录 + loginFailCount: 已登录失败{0}次,剩余尝试登录次数:{1} + deviceGroupNameHasExisted: 此设备组名称已存在 + groupTypeNotMatch: 设备类型与分组类型不匹配 + monitoringPointCategoryNameHasExisted: 此监控点分类名称已存在 + monitoringPointCategoryGroupNameHasExisted: 此监控点分组名称已存在 + alertLevel_1: 正常 + alertLevel_2: 紧急故障 + alertLevel_3: 严重故障 + alertLevel_4: 中等故障 + alertLevel_5: 轻微故障 + confirmStatus_0: 未确认 + confirmStatus_1: 已确认 + handleStatus_1: 未对应 + handleStatus_2: 对应中 + handleStatus_3: 完成 + handleStatus_4: 自动恢复 + canNotProcessed: 无法再处理 + alreadyExists: 平台已存在 + hasChildLevel: 存在下级层级,不允许删除 + operationLogMap: + addRole: 新增角色 + editRole: 编辑角色 + deleteRole: 删除角色 + queryRole: 查询角色列表 + addUser: 添加用户 + editUser: 编辑用户 + deleteUser: 删除用户 + resetPassword: 重置密码 + changePassword: 修改密码 + unbindMFADevice: 解绑MFA设备 + queryUser: 查询用户列表 + queryOperationLog: 查询操作日志 + getS3Credentials: 获取s3文件操作token + addSlack: 新增slack + editSlack: 编辑slack + deleteSlack: 删除slack + querySlack: 查询slack列表 + addTeams: 新增teams + editTeams: 编辑teams + deleteTeams: 删除teams + queryTeams: 获取teams列表 + getCumulativeDataList: 获取积算数据列表 + queryDeviceList: 获取设备列表 + addDeviceGroup: 新增设备组 + editDeviceGroup: 编辑设备组 + deleteDeviceGroup: 删除设备组 + queryDeviceGroup: 获取设备组列表 + bindGroupForDevice: 给设备绑定设备组 + bindDeviceForGroup: 给设备组设置绑定的设备 + addMonitoringPointCategory: 新增监控点分类 + editMonitoringPointCategory: 编辑监控点分类 + deleteMonitoringPointCategory: 删除监控点分类 + queryMonitoringPointCategory: 获取监控点分类列表 + addMonitoringPointCategoryGroup: 新增监控点分类组 + editMonitoringPointCategoryGroup: 编辑监控点分类组 + deleteMonitoringPointCategoryGroup: 删除监控点分类组 + queryMonitoringPointCategoryGroup: 获取监控点分类组列表 + bindGroupForCategory: 给监控点分类绑定分组 + bindCategoryForGroup: 给分组设置绑定的监控点分类 + confirmAlarm: 确认告警 + handleAlarm: 处理告警 + exportCumulativeData: 导出积算数据 + getAlarmDataList: 获取告警数据列表 + exportAlarmData: 导出告警数据 + getMeasureDataList: 获取计量数据列表 + exportMeasureData: 导出计量数据 + getBaStatusDataList: 获取运行状态列表 + exportBaStatusData: 导出运行状态数据 + getFavoriteList: 获取收藏设备列表 + removeFavoriteDevice: 删除收藏设备 + addFavoriteDevice: 新增收藏设备 + + diff --git a/dongjian-dashboard-back-common/src/main/resources/config/language/msg/msg_en.yml b/dongjian-dashboard-back-common/src/main/resources/config/language/msg/msg_en.yml new file mode 100644 index 0000000..1c69a47 --- /dev/null +++ b/dongjian-dashboard-back-common/src/main/resources/config/language/msg/msg_en.yml @@ -0,0 +1,136 @@ +msgen: + parameterMap: + serviceError: Internal service error. + tokenError: API authentication failed. + excelEmpty: The spreadsheet is empty. + lineNum: "Lines {0}:" + paramsFormatError: Parameter format error. + verifCodeExpired: Verification code expired. + verifCodeError: Verification code error. + accountExpired: The account has expired. + pwdError: Password error. + userNotExist: User does not exist. + noOperationAuth: No operation permission. + projectNameHasExisted: Project name already exists. + projectNameDoesNotExist: Project name does not exist. + buildingNameHasExisted: Building name already exists. + buildingNameDoesNotExist: Building name does not exist. + floorNameHasExisted: Floor name already exists. + floorNameDoesNotExist: Floor name does not exist. + buildingNotFound: Building not found. + fbNotSameCompany: Must belong to the same company as the building. + spaceNameHasExisted: Room name already exists. + floorNotFound: Floor not found. + rfNotSameCompany: Must belong to the same company as the floor. + assetNameHasExisted: Asset name already exists. + assetSymbolHasExisted: Asset symbol already exists. + assetNameDoesNotExist: Asset name does not exist. + assetSymbolDoesNotExist: 资产记号不存在 + spaceNotFound: Room not found. + faNotSameCompany: Must belong to the same company as the room. + bindedDevice: Device is bound. + deviceTypeNotExist: Device type does not exist. + excelBuildingLineDuplicate: Duplicate data exists in the spreadsheet. + dbBuildingDuplicate: This building already exists on the platform. + dbFloorDuplicate: 平台已存在此楼层 + dbSpaceDuplicate: 平台已存在此房间 + dbAssetDuplicate: 平台已存在此资产 + excelCompanyNameIsNull: Company name needs to be filled out. + excelBuildingNameIsNull: Building name needs to be filled out. + excelFloorNameIsNull: 需填写楼层 + excelSpaceNameIsNull: 需填写房间 + excelSpaceOrFloorNameIsNull: 需填写楼层和房间 + excelCompanyNameNotExist: The platform does not have this company name. + userOrEmailNotExist: 用户名或邮箱不存在 + companyNameHasExisted: 平台已存在此企业 + taowaComapny: 不可使用下级企业作为父企业 + hasSubsidiary: 删除的企业拥有下级企业,需先处理下级企业 + roleNameExist: 角色名已存在 + roleHasBinded: 角色已绑定用户,请先解绑再删除 + loginNameOrEmailHasExisted: 用户名或邮箱已被使用 + mailAddUserPwdSubject: 新建账号密码 + mailAddUserPwdContent: '账号 {0} 的密码为 {1} 请妥善保管

登陆网址:{2}' + mailResetUserPwdSubject: 重置账号密码 + pwdFormatError: 密码组成必须包含数字、英文字母、特殊符号(~!@#$%^&*)且大于等于12位 + oldPwdError: 旧密码错误 + newPwdSameOld: 新密码不得与旧密码相同 + companyLimit: 最多可创建15个企业 + consecutiveLoginFail: Too many failed login attempts. Please wait {0} minute(s) and {1} second(s) before trying again. + loginFailCount: Login failed {0} times. Remaining login attempts:{1}. + deviceGroupNameHasExisted: Device group name already exists. + groupTypeNotMatch: Device type does not match the group type + monitoringPointCategoryNameHasExisted: This monitoring point category name already exists + monitoringPointCategoryGroupNameHasExisted: The monitoring point group name already exists + alertLevel_1: Normal + alertLevel_2: Critical Fault + alertLevel_3: Severe Fault + alertLevel_4: Moderate Fault + alertLevel_5: Minor Fault + confirmStatus_0: Unconfirmed + confirmStatus_1: Confirmed + handleStatus_1: Not Handled + handleStatus_2: Handling + handleStatus_3: Completed + handleStatus_4: Auto Recovered + canNotProcessed: Can not be processed further + alreadyExists: 平台已存在 + hasChildLevel: 存在下级层级,不允许删除 + operationLogMap: + addRole: Add Role + editRole: Edit Role + deleteRole: Delete Role + queryRole: Query Role List + addUser: Add user + editUser: Edit user + deleteUser: Delete user + resetPassword: Reset password + changePassword: Change password + unbindMFADevice: Unbind MFA device + queryUser: Query user list + queryOperationLog: Query operation log + getS3Credentials: Get S3 file operation token + addSlack: Add Slack + editSlack: Edit Slack + deleteSlack: Delete Slack + querySlack: Query Slack List + addTeams: Add Teams + editTeams: Edit Teams + deleteTeams: Delete Teams + queryTeams: Query Teams List + getCumulativeDataList: Get Cumulative Data List + queryDeviceList: Get Device List + addDeviceGroup: Add Device Group + editDeviceGroup: Edit Device Group + deleteDeviceGroup: Delete Device Group + queryDeviceGroup: Get Device Group List + bindGroupForDevice: Bind device to device group + bindDeviceForGroup: Set bound devices for the device group + addMonitoringPointCategory: Add Monitoring Point Category + editMonitoringPointCategory: Edit Monitoring Point Category + deleteMonitoringPointCategory: Delete Monitoring Point Category + queryMonitoringPointCategory: Get Monitoring Point Category List + addMonitoringPointCategoryGroup: Add monitoring point category group + editMonitoringPointCategoryGroup: Edit monitoring point category group + deleteMonitoringPointCategoryGroup: Delete monitoring point category group + queryMonitoringPointCategoryGroup: Get monitoring point category group list + bindGroupForCategory: Bind group to monitoring point category + bindCategoryForGroup: Bind monitoring point categories to group + confirmAlarm: Confirm Alarm + handleAlarm: Handle Alarm + exportCumulativeData: Export cumulative data + getAlarmDataList: Get alarm data list + exportAlarmData: Export alarm data + getMeasureDataList: Get measurement data list + exportMeasureData: Export measurement data + getBaStatusDataList: Get operation status list + exportBaStatusData: Export operation status data + getFavoriteList: Get list of favorited devices + removeFavoriteDevice: Remove favorited device + addFavoriteDevice: Add favorited device + + + + + + + diff --git a/dongjian-dashboard-back-common/src/main/resources/config/language/msg/msg_jp.yml b/dongjian-dashboard-back-common/src/main/resources/config/language/msg/msg_jp.yml new file mode 100644 index 0000000..605a15f --- /dev/null +++ b/dongjian-dashboard-back-common/src/main/resources/config/language/msg/msg_jp.yml @@ -0,0 +1,135 @@ +msgjp: + parameterMap: + serviceError: 内部サービスのエラー + tokenError: インターフェイスの認証に失敗 + excelEmpty: フォームが空になっている + lineNum: 行{0}: + paramsFormatError: パラメータのフォーマットエラー + verifCodeExpired: 確認コード期限切れ + verifCodeError: 確認コードエラー + accountExpired: アカウントの有効期限が切れている + pwdError: パスワードエラー + userNotExist: ユーザーが存在しない + noOperationAuth: 操作権限なし + projectNameHasExisted: プロジェクト名がすでにある + projectNameDoesNotExist: プロジェクト名がない + buildingNameHasExisted: 該当ビル名がすでにある + buildingNameDoesNotExist: 該当ビル名がない + floorNameHasExisted: 該当フロア名がすでにある + floorNameDoesNotExist: 該当フロア名がない + buildingNotFound: 該当ビルがない + fbNotSameCompany: ビルと同じ会社に所属してください + spaceNameHasExisted: 該当部屋名がすでにある + floorNotFound: 該当フロア名がない + rfNotSameCompany: フロアと同じ会社に所属してください + assetNameHasExisted: 該当資産名がすでにある + assetSymbolHasExisted: 記号はすでに存在します + assetNameDoesNotExist: 該当資産名がない + assetSymbolDoesNotExist: 資産記号が存在しません + spaceNotFound: 該当部屋がない + faNotSameCompany: 部屋と同じ会社に所属してください + bindedDevice: デバイスと関連付け + deviceTypeNotExist: デバイスタイプがない + excelBuildingLineDuplicate: テーブルに同じデータがある + dbBuildingDuplicate: プラットフォームにすでに該当ビルがない + dbFloorDuplicate: プラットフォームには既にこのフロアが存在しています。 + dbSpaceDuplicate: プラットフォームには既にこのスペースが存在しています。 + dbAssetDuplicate: プラットフォームには既にこのアセットが存在しています。 + excelCompanyNameIsNull: 会社名を入力してください + excelBuildingNameIsNull: ビルを入力してください + excelFloorNameIsNull: フロア名を入力してください。 + excelSpaceNameIsNull: スペース名を入力してください。 + excelSpaceOrFloorNameIsNull: フロア名とスペース名を入力してください。 + excelCompanyNameNotExist: プラットフォーム上に該当会社名はない + userOrEmailNotExist: ユーザーが存在しません + companyNameHasExisted: 会社はすでにプラットフォーム上に存在する + taowaComapny: 下位の会社を親会社として利用することは不可 + hasSubsidiary: 削除対象の会社には下位の会社があるので、先に下位の会社を対応してください + roleNameExist: 役割名が既に登録済み + roleHasBinded: 役割はユーザーにバインドされている ので、削除する前にバインドを解除してください + loginNameOrEmailHasExisted: ユーザー名またはメールボックスはすでに使用されています + mailAddUserPwdSubject: 新規アカウント・パスワードの作成 + mailAddUserPwdContent: 'アカウント {0} のパスワードは {1} お忘れにならないようにお願いします。

ログインWebアドレス:{2}' + mailResetUserPwdSubject: アカウント・パスワードのリセット + pwdFormatError: パスワードの構成には、数字、アルファベット、特殊文字(~!@#$%^&*) で、12桁以上 + oldPwdError: 旧パスワードエラー + newPwdSameOld: 注:旧パスワードと同じものを使用しないでください + companyLimit: 最大15のエンタープライズを作成可能 + consecutiveLoginFail: ログインの失敗が多すぎます。{0}分{1}秒待ってから再度ログインしてください。 + loginFailCount: ログインに{0}回失敗しました。残りの試行回数:{1}回。 + deviceGroupNameHasExisted: デバイスグループ名は既に存在しています。 + groupTypeNotMatch: デバイスタイプがグループタイプと一致しません。 + monitoringPointCategoryNameHasExisted: この監視ポイントカテゴリ名は既に存在します + monitoringPointCategoryGroupNameHasExisted: この監視ポイントグループ名は既に存在します + alertLevel_1: 通常 + alertLevel_2: 緊急故障 + alertLevel_3: 深刻な故障 + alertLevel_4: 中程度の故障 + alertLevel_5: 軽微な故障 + confirmStatus_0: 未確認 + confirmStatus_1: 確認済み + handleStatus_1: 未対応 + handleStatus_2: 対応中 + handleStatus_3: 完了 + handleStatus_4: 自動復旧 + canNotProcessed: これ以上の処理はできません + alreadyExists: 平台已存在 + hasChildLevel: 存在下级层级,不允许删除 + operationLogMap: + addRole: ロールを追加 + editRole: ロールを編集 + deleteRole: ロールを削除 + queryRole: ロール一覧を取得 + addUser: ユーザーを追加 + editUser: ユーザーを編集 + deleteUser: ユーザーを削除 + resetPassword: パスワードをリセット + changePassword: パスワードを変更 + unbindMFADevice: MFAデバイスの連携を解除 + queryUser: ユーザー一覧を取得 + queryOperationLog: 操作ログを照会する + getS3Credentials: S3ファイル操作トークンを取得する + addSlack: Slackを追加 + editSlack: Slackを編集 + deleteSlack: Slackを削除 + querySlack: Slackリストを取得 + addTeams: Teamsを追加 + editTeams: Teamsを編集 + deleteTeams: Teamsを削除 + queryTeams: Teamsリストを取得 + getCumulativeDataList: 積算データ一覧を取得 + queryDeviceList: デバイス一覧を取得 + addDeviceGroup: デバイスグループを追加 + editDeviceGroup: デバイスグループを編集 + deleteDeviceGroup: デバイスグループを削除 + queryDeviceGroup: デバイスグループ一覧を取得 + bindGroupForDevice: デバイスにデバイスグループを割り当てる + bindDeviceForGroup: デバイスグループに紐付けるデバイスを設定する + addMonitoringPointCategory: 監視ポイントカテゴリを追加 + editMonitoringPointCategory: 監視ポイントカテゴリを編集 + deleteMonitoringPointCategory: 監視ポイントカテゴリを削除 + queryMonitoringPointCategory: 監視ポイントカテゴリ一覧を取得 + addMonitoringPointCategoryGroup: 監視ポイントカテゴリグループを追加 + editMonitoringPointCategoryGroup: 監視ポイントカテゴリグループを編集 + deleteMonitoringPointCategoryGroup: 監視ポイントカテゴリグループを削除 + queryMonitoringPointCategoryGroup: 監視ポイントカテゴリグループ一覧を取得 + bindGroupForCategory: 監視ポイントカテゴリにグループをバインド + bindCategoryForGroup: グループに監視ポイントカテゴリをバインド + confirmAlarm: アラームを確認 + handleAlarm: アラームを対応 + exportCumulativeData: 積算データをエクスポート + getAlarmDataList: アラームデータ一覧を取得 + exportAlarmData: アラームデータをエクスポート + getMeasureDataList: 計測データ一覧を取得 + exportMeasureData: 計測データをエクスポート + getBaStatusDataList: 稼働設備一覧を取得 + exportBaStatusData: 稼働設備データをエクスポート + getFavoriteList: お気に入りデバイス一覧を取得 + removeFavoriteDevice: お気に入りデバイスを削除 + addFavoriteDevice: お気に入りデバイスを追加 + + + + + + diff --git a/dongjian-dashboard-back-controller/.gitignore b/dongjian-dashboard-back-controller/.gitignore new file mode 100644 index 0000000..aa23915 --- /dev/null +++ b/dongjian-dashboard-back-controller/.gitignore @@ -0,0 +1,15 @@ +/target/ +/logs/ +/.idea/ +*.iml +*.bak +*.log +/.settings/ +*.project +*.classpath +*.factorypath +*.springBeans +/.apt_generated/ +/.externalToolBuilders/ +/bin/ +application-*.properties diff --git a/dongjian-dashboard-back-controller/buildPush-aeon.sh b/dongjian-dashboard-back-controller/buildPush-aeon.sh new file mode 100644 index 0000000..6a0a00f --- /dev/null +++ b/dongjian-dashboard-back-controller/buildPush-aeon.sh @@ -0,0 +1,11 @@ +aws configure set aws_access_key_id AKIAQNYBBSGDVT3VF4ON +aws configure set aws_secret_access_key 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 +aws configure set default.region ap-northeast-1 +aws ecr get-login-password --region ap-northeast-1 | docker login --username AWS --password-stdin 029530100103.dkr.ecr.ap-northeast-1.amazonaws.com + +docker build -t 029530100103.dkr.ecr.ap-northeast-1.amazonaws.com/aeon/dashboard-back:latest\ + --build-arg JAR_FILE=target/dongjian-dashboard-back-controller-0.0.1-SNAPSHOT.jar \ + --build-arg LIB_DIR=target/lib \ + --build-arg CONFIG_DIR=target/config \ + . +docker push 029530100103.dkr.ecr.ap-northeast-1.amazonaws.com/aeon/dashboard-back:latest \ No newline at end of file diff --git a/dongjian-dashboard-back-controller/buildPush-prod.sh b/dongjian-dashboard-back-controller/buildPush-prod.sh new file mode 100644 index 0000000..523eb09 --- /dev/null +++ b/dongjian-dashboard-back-controller/buildPush-prod.sh @@ -0,0 +1,11 @@ +aws configure set aws_access_key_id AKIAVRXFMB43TOELSROK +aws configure set aws_secret_access_key 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 +aws configure set default.region ap-northeast-1 +aws ecr get-login-password --region ap-northeast-1 | docker login --username AWS --password-stdin 381659385655.dkr.ecr.ap-northeast-1.amazonaws.com + +docker build -t 381659385655.dkr.ecr.ap-northeast-1.amazonaws.com/dashboard-back:latest\ + --build-arg JAR_FILE=target/dongjian-dashboard-back-controller-0.0.1-SNAPSHOT.jar \ + --build-arg LIB_DIR=target/lib \ + --build-arg CONFIG_DIR=target/config \ + . +docker push 381659385655.dkr.ecr.ap-northeast-1.amazonaws.com/dashboard-back:latest \ No newline at end of file diff --git a/dongjian-dashboard-back-controller/buildPush-staging.sh b/dongjian-dashboard-back-controller/buildPush-staging.sh new file mode 100644 index 0000000..9b20e10 --- /dev/null +++ b/dongjian-dashboard-back-controller/buildPush-staging.sh @@ -0,0 +1,11 @@ +aws configure set aws_access_key_id AKIA5OFH5OOZPCXZIRUQ +aws configure set aws_secret_access_key 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 +aws configure set default.region ap-northeast-1 +aws ecr get-login-password --region ap-northeast-1 | docker login --username AWS --password-stdin 923770123186.dkr.ecr.ap-northeast-1.amazonaws.com + +docker build -t 923770123186.dkr.ecr.ap-northeast-1.amazonaws.com/dashboard-back:latest\ + --build-arg JAR_FILE=target/dongjian-dashboard-back-controller-0.0.1-SNAPSHOT.jar \ + --build-arg LIB_DIR=target/lib \ + --build-arg CONFIG_DIR=target/config \ + . +docker push 923770123186.dkr.ecr.ap-northeast-1.amazonaws.com/dashboard-back:latest \ No newline at end of file diff --git a/dongjian-dashboard-back-controller/dockerfile b/dongjian-dashboard-back-controller/dockerfile new file mode 100644 index 0000000..936f8e6 --- /dev/null +++ b/dongjian-dashboard-back-controller/dockerfile @@ -0,0 +1,21 @@ +FROM registry.ap-northeast-1.aliyuncs.com/southwave/jdk17-template:latest +# FROM openjdk:17-jdk +ENV TZ=Asia/Tokyo +WORKDIR /home/data-center-dashboard + +#EXPOSE 20008 + +# 设置时区 +#RUN /bin/cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && echo 'Asia/Shanghai' >/etc/timezone + +ARG JAR_FILE +ARG LIB_DIR +ARG CONFIG_DIR + +COPY ${JAR_FILE} app.jar +COPY ${LIB_DIR} lib +COPY ${CONFIG_DIR} config + +ENTRYPOINT ["java","-jar","app.jar"] + + diff --git a/dongjian-dashboard-back-controller/pom.xml b/dongjian-dashboard-back-controller/pom.xml new file mode 100644 index 0000000..61186b9 --- /dev/null +++ b/dongjian-dashboard-back-controller/pom.xml @@ -0,0 +1,552 @@ + + + 4.0.0 + + com.techsor + dongjian-dashboard-back + 0.0.1-SNAPSHOT + + dongjian-dashboard-back-controller + dongjian-dashboard-back-controller + http://maven.apache.org + + UTF-8 + + tokyo-build-admin + latest + ap-northeast-1 + + 923770123186.dkr.ecr.ap-northeast-1.amazonaws.com + AKIA5OFH5OOZHM3U3KX4 + Plkid7RDnHc1gGbp2yAv/Scc+ukI0q8vzBuyEBN2 + + 381659385655.dkr.ecr.ap-northeast-1.amazonaws.com + AKIAVRXFMB43XVQ3GXAL + G0FaGcizm8FlgLxZsL+8xBwfPSzQF71294nrtE2y + + + + + + + com.techsor + dongjian-dashboard-back-service + 0.0.1-SNAPSHOT + + + + com.techsor + dongjian-dashboard-back-common + 0.0.1-SNAPSHOT + + + junit + junit + test + + + + + org.springframework.boot + spring-boot-starter-aop + 3.5.3 + + + + + + + only-package + + true + + + + + + + org.apache.maven.plugins + maven-assembly-plugin + + dongjian-dashboard-back + + src/main/resources/assembly.xml + + false + + + + make-assembly + package + + single + + + + + + + + + docker-package + + + + + com.google.cloud.tools + jib-maven-plugin + 3.4.5 + + + + ]]> + docker://registry.ap-northeast-1.aliyuncs.com/southwave/jdk17-template:latest + + + registry.cn-shanghai.aliyuncs.com/clouddog/datacenter-admin:${aws.ecr.tag} + + + /home/dongjian-dashboard-back + + Asia/Tokyo + + + java + -jar + ${project.build.finalName}.jar + + + + + + ${project.build.directory} + ${project.build.finalName}.jar + /home/dongjian-dashboard-back/ + + + ${project.build.directory} + lib/** + /home/dongjian-dashboard-back/ + + + ${project.build.directory} + config/** + /home/dongjian-dashboard-back/ + + + ${project.build.directory} + aurora_terraform/** + /home/dongjian-dashboard-back/ + + + + + /home/dongjian-dashboard-back/lib + 755 + + + /home/dongjian-dashboard-back/config + 755 + + + /home/dongjian-dashboard-back/aurora_terraform + 755 + + + + + + + package + + + dockerBuild + + + + + + + + + docker-aliyun + + + + + com.google.cloud.tools + jib-maven-plugin + 3.4.5 + + + + ]]> + docker://registry.ap-northeast-1.aliyuncs.com/southwave/jdk17-template:latest + + + ${aws.ecr.registry.test}/${aws.ecr.repository}:${aws.ecr.tag} + + + /home/dongjian-dashboard-back + + Asia/Tokyo + + + java + -jar + ${project.build.finalName}.jar + + + + + + ${project.build.directory} + ${project.build.finalName}.jar + /home/dongjian-dashboard-back/ + + + ${project.build.directory} + lib/** + /home/dongjian-dashboard-back/ + + + ${project.build.directory} + config/** + /home/dongjian-dashboard-back/ + + + ${project.build.directory} + aurora_terraform/** + /home/dongjian-dashboard-back/ + + + + + /home/dongjian-dashboard-back/lib + 755 + + + /home/dongjian-dashboard-back/config + 755 + + + /home/dongjian-dashboard-back/aurora_terraform + 755 + + + + + + + package + + + dockerBuild + + + + + + + org.apache.maven.plugins + maven-antrun-plugin + 3.0.0 + + + + package + + run + + + + + + + + + + + + + + + + + + + + + + docker-test + + + + + com.google.cloud.tools + jib-maven-plugin + 3.4.5 + + + + ]]> + docker://registry.ap-northeast-1.aliyuncs.com/southwave/jdk17-template:latest + + + ${aws.ecr.registry.test}/${aws.ecr.repository}:${aws.ecr.tag} + + + /home/dongjian-dashboard-back + + Asia/Tokyo + + + java + -jar + ${project.build.finalName}.jar + + + + + + ${project.build.directory} + ${project.build.finalName}.jar + /home/dongjian-dashboard-back/ + + + ${project.build.directory} + lib/** + /home/dongjian-dashboard-back/ + + + ${project.build.directory} + config/** + /home/dongjian-dashboard-back/ + + + ${project.build.directory} + aurora_terraform/** + /home/dongjian-dashboard-back/ + + + + + /home/dongjian-dashboard-back/lib + 755 + + + /home/dongjian-dashboard-back/config + 755 + + + /home/dongjian-dashboard-back/aurora_terraform + 755 + + + + + + + package + + + dockerBuild + + + + + + + org.apache.maven.plugins + maven-antrun-plugin + 3.0.0 + + + + package + + run + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + docker-production + + + + + com.google.cloud.tools + jib-maven-plugin + 3.4.5 + + + + ]]> + docker://registry.ap-northeast-1.aliyuncs.com/southwave/jdk17-template:latest + + + ${aws.ecr.registry.production}/${aws.ecr.repository}:${aws.ecr.tag} + + + /home/dongjian-dashboard-back + + Asia/Tokyo + + + java + -jar + ${project.build.finalName}.jar + + + + + + ${project.build.directory} + ${project.build.finalName}.jar + /home/dongjian-dashboard-back/ + + + ${project.build.directory} + lib/** + /home/dongjian-dashboard-back/ + + + ${project.build.directory} + config/** + /home/dongjian-dashboard-back/ + + + ${project.build.directory} + aurora_terraform/** + /home/dongjian-dashboard-back/ + + + + + /home/dongjian-dashboard-back/lib + 755 + + + /home/dongjian-dashboard-back/config + 755 + + + /home/dongjian-dashboard-back/aurora_terraform + 755 + + + + + + + package + + build + + + + + + + org.apache.maven.plugins + maven-antrun-plugin + 3.0.0 + + + + package + + run + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/dongjian-dashboard-back-controller/src/main/java/com/dongjian/dashboard/back/DongjianDashboardBackApplication.java b/dongjian-dashboard-back-controller/src/main/java/com/dongjian/dashboard/back/DongjianDashboardBackApplication.java new file mode 100644 index 0000000..bf41709 --- /dev/null +++ b/dongjian-dashboard-back-controller/src/main/java/com/dongjian/dashboard/back/DongjianDashboardBackApplication.java @@ -0,0 +1,19 @@ +package com.dongjian.dashboard.back; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.boot.web.servlet.ServletComponentScan; +import org.springframework.scheduling.annotation.EnableAsync; +import org.springframework.scheduling.annotation.EnableScheduling; + +@SpringBootApplication +@ServletComponentScan +@EnableAsync +@EnableScheduling +public class DongjianDashboardBackApplication { + + public static void main(String[] args) { + SpringApplication.run(DongjianDashboardBackApplication.class, args); + } + +} \ No newline at end of file diff --git a/dongjian-dashboard-back-controller/src/main/java/com/dongjian/dashboard/back/configurator/ApiConfig.java b/dongjian-dashboard-back-controller/src/main/java/com/dongjian/dashboard/back/configurator/ApiConfig.java new file mode 100644 index 0000000..e427023 --- /dev/null +++ b/dongjian-dashboard-back-controller/src/main/java/com/dongjian/dashboard/back/configurator/ApiConfig.java @@ -0,0 +1,64 @@ +package com.dongjian.dashboard.back.configurator; + +import com.dongjian.dashboard.back.common.config.DataSourceInterceptor; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.web.servlet.MultipartConfigFactory; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.mobile.device.DeviceHandlerMethodArgumentResolver; +import org.springframework.mobile.device.DeviceResolverHandlerInterceptor; +import org.springframework.util.unit.DataSize; +import org.springframework.web.method.support.HandlerMethodArgumentResolver; +import org.springframework.web.servlet.config.annotation.InterceptorRegistry; +import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry; +import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; + +import com.dongjian.dashboard.back.configurator.interceptor.AccessApiInterceptor; + +import jakarta.servlet.MultipartConfigElement; + +import java.io.File; +import java.util.List; + +@Configuration +public class ApiConfig implements WebMvcConfigurer { + + @Bean + public AccessApiInterceptor accessApiInterceptor(){ + return new AccessApiInterceptor(); + } + + @Bean + public DataSourceInterceptor dataSourceInterceptor(){ + return new DataSourceInterceptor(); + } + + @Override + public void addInterceptors(InterceptorRegistry registry){ + registry.addInterceptor(dataSourceInterceptor()); + registry.addInterceptor(accessApiInterceptor()); + } + + @Bean + public DeviceHandlerMethodArgumentResolver deviceHandlerMethodArgumentResolver() { + return new DeviceHandlerMethodArgumentResolver(); + } + + @Override + public void addArgumentResolvers(List argumentResolvers) { + argumentResolvers.add(deviceHandlerMethodArgumentResolver()); + } + + @Bean + public MultipartConfigElement multipartConfigElement() { + String path = System.getProperty("user.dir")+"/tmp"; + MultipartConfigFactory factory = new MultipartConfigFactory(); + factory.setMaxFileSize(DataSize.ofMegabytes(20L)); + File tmpFile = new File(path); + if (!tmpFile.exists()) { + tmpFile.mkdirs(); + } + factory.setLocation(path); + return factory.createMultipartConfig(); + } +} diff --git a/dongjian-dashboard-back-controller/src/main/java/com/dongjian/dashboard/back/configurator/CorsConfigurer.java b/dongjian-dashboard-back-controller/src/main/java/com/dongjian/dashboard/back/configurator/CorsConfigurer.java new file mode 100644 index 0000000..a765d94 --- /dev/null +++ b/dongjian-dashboard-back-controller/src/main/java/com/dongjian/dashboard/back/configurator/CorsConfigurer.java @@ -0,0 +1,38 @@ +package com.dongjian.dashboard.back.configurator; + +import java.util.ArrayList; +import java.util.List; + +import org.springframework.beans.factory.annotation.Value; +import org.springframework.boot.web.servlet.FilterRegistrationBean; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.web.cors.CorsConfiguration; +import org.springframework.web.cors.UrlBasedCorsConfigurationSource; +import org.springframework.web.filter.CorsFilter; + +/** + * 跨域配置 +* @author jwy +* @time 2022-5-12 17:54:43 + */ +@Configuration +public class CorsConfigurer { + @Value("${crosxss.origin:*}") + private String corsOrigin; + @Bean + public FilterRegistrationBean corsFilter() { + List allowedOriginPatterns = new ArrayList(); + allowedOriginPatterns.add(corsOrigin); + UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource(); + CorsConfiguration config = new CorsConfiguration(); + config.setAllowCredentials(true); + config.setAllowedOriginPatterns(allowedOriginPatterns); + config.addAllowedHeader("*"); + config.addAllowedMethod("*"); + source.registerCorsConfiguration("/**", config); + FilterRegistrationBean bean = new FilterRegistrationBean(new CorsFilter(source)); + bean.setOrder(0); + return bean; + } +} \ No newline at end of file diff --git a/dongjian-dashboard-back-controller/src/main/java/com/dongjian/dashboard/back/configurator/CrosXssFilter.java b/dongjian-dashboard-back-controller/src/main/java/com/dongjian/dashboard/back/configurator/CrosXssFilter.java new file mode 100644 index 0000000..bbe3944 --- /dev/null +++ b/dongjian-dashboard-back-controller/src/main/java/com/dongjian/dashboard/back/configurator/CrosXssFilter.java @@ -0,0 +1,78 @@ +package com.dongjian.dashboard.back.configurator; + +import java.io.IOException; + +import jakarta.servlet.Filter; +import jakarta.servlet.FilterChain; +import jakarta.servlet.FilterConfig; +import jakarta.servlet.ServletException; +import jakarta.servlet.ServletRequest; +import jakarta.servlet.ServletResponse; +import javax.servlet.annotation.WebFilter; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Value; +import java.util.UUID; + +import org.jboss.logging.MDC; + +@WebFilter +public class CrosXssFilter implements Filter { + + private static final Logger logger = LoggerFactory.getLogger(CrosXssFilter.class); + + @Value("${crosxss.filter.disable:false}") + private boolean disable; + + @Override + public void init(FilterConfig filterConfig) throws ServletException { + } + + @Override + public void doFilter(ServletRequest request, ServletResponse response, + FilterChain chain) throws IOException, ServletException { + try { + MDC.put("processNo", UUID.randomUUID().toString().replace("-", "")); + request.setCharacterEncoding("utf-8"); +// response.setContentType("text/html;charset=utf-8"); + if (disable) { + chain.doFilter(request, response); + } else { + //跨域设置 + if (response instanceof HttpServletResponse) { + HttpServletResponse httpServletResponse = (HttpServletResponse) response; + //禁用浏览器缓存 + httpServletResponse.setHeader("Cache-Control", "no-store"); + //禁止被IFrame嵌套 + httpServletResponse.setHeader("X-Frame-Options", "deny"); + //安全性配置 + httpServletResponse.setHeader("X-XSS-Protection", "1; mode=block"); + httpServletResponse.setHeader("X-Content-Type-Options", "nosniff"); + httpServletResponse.setHeader("Referrer-Policy", "origin"); + } + ServletRequest requestWrapper = null; + if(request instanceof HttpServletRequest) { + requestWrapper = new RequestWrapper((HttpServletRequest) request); + } + if(requestWrapper == null) { + chain.doFilter(request, response); + } else { + chain.doFilter(requestWrapper, response); + } + } + } finally { + // 避免线程泄漏 + MDC.clear(); + } + + } + + @Override + public void destroy() { + + } + +} \ No newline at end of file diff --git a/dongjian-dashboard-back-controller/src/main/java/com/dongjian/dashboard/back/configurator/RequestWrapper.java b/dongjian-dashboard-back-controller/src/main/java/com/dongjian/dashboard/back/configurator/RequestWrapper.java new file mode 100644 index 0000000..590a928 --- /dev/null +++ b/dongjian-dashboard-back-controller/src/main/java/com/dongjian/dashboard/back/configurator/RequestWrapper.java @@ -0,0 +1,92 @@ +package com.dongjian.dashboard.back.configurator; + +import jakarta.servlet.ReadListener; +import jakarta.servlet.ServletInputStream; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletRequestWrapper; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.io.*; + +public class RequestWrapper extends HttpServletRequestWrapper { + + private static final Logger logger = LoggerFactory.getLogger(HttpServletRequestWrapper.class); + + private final String body; + + public RequestWrapper(HttpServletRequest request) { + super(request); + StringBuilder stringBuilder = new StringBuilder(); + BufferedReader bufferedReader = null; + InputStream inputStream = null; + try { + inputStream = request.getInputStream(); + if (inputStream != null) { + bufferedReader = new BufferedReader(new InputStreamReader(inputStream)); + char[] charBuffer = new char[128]; + int bytesRead = -1; + while ((bytesRead = bufferedReader.read(charBuffer)) > 0) { + stringBuilder.append(charBuffer, 0, bytesRead); + } + } else { + stringBuilder.append(""); + } + } catch (IOException ex) { + logger.error("RequestWrapper读取流错误", ex); + } finally { + if (inputStream != null) { + try { + inputStream.close(); + } + catch (IOException e) { + e.printStackTrace(); + } + } + if (bufferedReader != null) { + try { + bufferedReader.close(); + } + catch (IOException e) { + e.printStackTrace(); + } + } + } + body = stringBuilder.toString(); + } + + @Override + public ServletInputStream getInputStream() throws IOException { + final ByteArrayInputStream byteArrayInputStream = new ByteArrayInputStream(body.getBytes()); + ServletInputStream servletInputStream = new ServletInputStream() { + @Override + public boolean isFinished() { + return false; + } + @Override + public boolean isReady() { + return false; + } + @Override + public void setReadListener(ReadListener readListener) { + } + @Override + public int read() throws IOException { + return byteArrayInputStream.read(); + } + }; + return servletInputStream; + + } + + @Override + public BufferedReader getReader() throws IOException { + return new BufferedReader(new InputStreamReader(this.getInputStream())); + } + + public String getBody() { + return this.body; + } + +} \ No newline at end of file diff --git a/dongjian-dashboard-back-controller/src/main/java/com/dongjian/dashboard/back/configurator/aspect/OperationLog.java b/dongjian-dashboard-back-controller/src/main/java/com/dongjian/dashboard/back/configurator/aspect/OperationLog.java new file mode 100644 index 0000000..12766bf --- /dev/null +++ b/dongjian-dashboard-back-controller/src/main/java/com/dongjian/dashboard/back/configurator/aspect/OperationLog.java @@ -0,0 +1,15 @@ +package com.dongjian.dashboard.back.configurator.aspect; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +@Target(ElementType.METHOD) +@Retention(RetentionPolicy.RUNTIME) +public @interface OperationLog { + String operation() default ""; + String remark() default ""; +} + + diff --git a/dongjian-dashboard-back-controller/src/main/java/com/dongjian/dashboard/back/configurator/aspect/OperationLogAspect.java b/dongjian-dashboard-back-controller/src/main/java/com/dongjian/dashboard/back/configurator/aspect/OperationLogAspect.java new file mode 100644 index 0000000..bfcd2ae --- /dev/null +++ b/dongjian-dashboard-back-controller/src/main/java/com/dongjian/dashboard/back/configurator/aspect/OperationLogAspect.java @@ -0,0 +1,102 @@ +package com.dongjian.dashboard.back.configurator.aspect; + +import com.dongjian.dashboard.back.common.Constants; +import com.dongjian.dashboard.back.common.config.DataSourceContextHolder; +import com.dongjian.dashboard.back.common.config.DataSourceInterceptor; +import com.dongjian.dashboard.back.dao.ex.DashboardOperationLogMapperExt; +import com.dongjian.dashboard.back.model.DashboardOperationLog; +import com.dongjian.dashboard.back.service.common.CommonOpt; +import com.fasterxml.jackson.databind.ObjectMapper; +import jakarta.servlet.http.HttpServletRequest; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; +import org.aspectj.lang.ProceedingJoinPoint; +import org.aspectj.lang.annotation.Around; +import org.aspectj.lang.annotation.Aspect; +import org.aspectj.lang.annotation.Pointcut; +import org.aspectj.lang.reflect.MethodSignature; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; +import org.springframework.web.context.request.RequestContextHolder; +import org.springframework.web.context.request.ServletRequestAttributes; + +import java.lang.reflect.Method; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +@Aspect +@Component +@Slf4j +public class OperationLogAspect { + + @Autowired + private DashboardOperationLogMapperExt dashboardOperationLogMapperExt; + @Autowired + private DataSourceInterceptor dataSourceInterceptor; + + private static final ObjectMapper objectMapper = new ObjectMapper(); + + + + + @Pointcut("@annotation(com.dongjian.dashboard.back.configurator.aspect.OperationLog)") + public void controllerOperationLog() {} + + @Around("controllerOperationLog()") + public Object recordLog(ProceedingJoinPoint joinPoint) throws Throwable { + + long start = System.currentTimeMillis(); + Object result = joinPoint.proceed(); + + try { + long duration = System.currentTimeMillis() - start; + + MethodSignature signature = (MethodSignature) joinPoint.getSignature(); + Method method = signature.getMethod(); + + HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest(); + + String uri = request.getRequestURI(); + // 读取注解上的描述 + OperationLog annotation = method.getAnnotation(OperationLog.class); + String operation = (annotation != null) ? annotation.operation() : ""; + String remark = (annotation != null) ? annotation.remark() : ""; + + DashboardOperationLog logEntry = new DashboardOperationLog(); + logEntry.setOperation(operation); + logEntry.setOperationRemark(remark); + logEntry.setUri(uri); + logEntry.setMethodName(method.getName()); + logEntry.setClassName(signature.getDeclaringTypeName()); + logEntry.setIpAddress(request.getRemoteAddr()); + String paramsJson = objectMapper.writeValueAsString(joinPoint.getArgs()); + logEntry.setRequestParams(paramsJson); + logEntry.setExecutionTimeMs(duration); + logEntry.setCreatedAt(System.currentTimeMillis()); + + // 如果有用户信息,可以在这里设置 + String userId = request.getHeader("UserId"); + String companyId = request.getHeader("CompanyId"); + if (StringUtils.isNotBlank(companyId)){ + logEntry.setUserId(StringUtils.isNotBlank(userId) ? Long.parseLong(userId) : null); + logEntry.setCompanyId(Long.parseLong(companyId)); + + if (dataSourceInterceptor.useDefaultDataSource(uri)) { + long topCompanyId = dataSourceInterceptor.getTopCompanyId(companyId); + + String dataSourceKey = Constants.DATASOURCE_PREFIX+ topCompanyId; + log.info("操作日志切换数据源为:" + dataSourceKey); + DataSourceContextHolder.setCurrentDataSourceKey(dataSourceKey); + } + + dashboardOperationLogMapperExt.insertSelective(logEntry); + + } + } catch (Exception e) { + log.error("recordLog error", e); + } + + return result; + } +} diff --git a/dongjian-dashboard-back-controller/src/main/java/com/dongjian/dashboard/back/configurator/interceptor/AccessApiInterceptor.java b/dongjian-dashboard-back-controller/src/main/java/com/dongjian/dashboard/back/configurator/interceptor/AccessApiInterceptor.java new file mode 100644 index 0000000..68c2c71 --- /dev/null +++ b/dongjian-dashboard-back-controller/src/main/java/com/dongjian/dashboard/back/configurator/interceptor/AccessApiInterceptor.java @@ -0,0 +1,73 @@ +package com.dongjian.dashboard.back.configurator.interceptor; + + +import com.alibaba.fastjson.JSONObject; +import com.dongjian.dashboard.back.common.response.ResponseCode; +import com.dongjian.dashboard.back.service.AccountService; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.web.method.HandlerMethod; +import org.springframework.web.servlet.HandlerInterceptor; +import org.springframework.web.servlet.resource.ResourceHttpRequestHandler; + +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; +import java.lang.reflect.Method; + +public class AccessApiInterceptor implements HandlerInterceptor { + + private static final Logger logger = LoggerFactory.getLogger(AccessApiInterceptor.class); + + @Value("${user.login.keytimeout}") + private long keytimeout; + + @Autowired + private AccountService accountService; + + public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception { + if(handler instanceof HandlerMethod) { + HandlerMethod handlerMethod = (HandlerMethod) handler; + Class tClass = handlerMethod.getBeanType(); + AccessRequired annotation = tClass.getAnnotation(AccessRequired.class); + if (annotation == null) { + Method method = handlerMethod.getMethod(); + annotation = method.getAnnotation(AccessRequired.class); + } + try { + if (annotation != null) { + String loginName = request.getHeader("LoginName"); + String accessToken = request.getHeader("AccessToken"); + String userId = request.getHeader("UserId"); + String companyId = request.getHeader("CompanyId"); + + String languageType = request.getHeader("LanguageType"); + response.setContentType("application/json;charset=utf-8"); + String URI = request.getRequestURI(); + logger.info("===============请求的URI :" + URI + " ==============="); + JSONObject jsonObject = new JSONObject(); + + boolean result = accountService.accessAuth(loginName, companyId, userId, accessToken, languageType, jsonObject, keytimeout); + if(!result) { + response.getWriter().print(jsonObject.toString()); + } + return result; + } + } catch (Exception e) { + logger.error("Error from AccessApiInterceptor!", e); + JSONObject jsonObject = new JSONObject(); + jsonObject.put("code", ResponseCode.SERVER_ERROR); + jsonObject.put("msg", "service error"); + response.getWriter().print(jsonObject.toString()); + return false; + } + // 没有注解通过拦截 + return true; + }else if(handler instanceof ResourceHttpRequestHandler) {//资源文件不拦截 + return true; + } + return false; + } +} diff --git a/dongjian-dashboard-back-controller/src/main/java/com/dongjian/dashboard/back/configurator/interceptor/AccessRequired.java b/dongjian-dashboard-back-controller/src/main/java/com/dongjian/dashboard/back/configurator/interceptor/AccessRequired.java new file mode 100644 index 0000000..e36fe54 --- /dev/null +++ b/dongjian-dashboard-back-controller/src/main/java/com/dongjian/dashboard/back/configurator/interceptor/AccessRequired.java @@ -0,0 +1,10 @@ +package com.dongjian.dashboard.back.configurator.interceptor; + +import java.lang.annotation.*; + +@Target({ElementType.TYPE,ElementType.METHOD}) +@Retention(RetentionPolicy.RUNTIME) +@Documented +public @interface AccessRequired { + +} \ No newline at end of file diff --git a/dongjian-dashboard-back-controller/src/main/java/com/dongjian/dashboard/back/controller/BuildingController.java b/dongjian-dashboard-back-controller/src/main/java/com/dongjian/dashboard/back/controller/BuildingController.java new file mode 100644 index 0000000..837e735 --- /dev/null +++ b/dongjian-dashboard-back-controller/src/main/java/com/dongjian/dashboard/back/controller/BuildingController.java @@ -0,0 +1,73 @@ +package com.dongjian.dashboard.back.controller; + +import com.dongjian.dashboard.back.common.exception.BusinessException; +import com.dongjian.dashboard.back.common.response.PageInfo; +import com.dongjian.dashboard.back.common.response.PageResponse; +import com.dongjian.dashboard.back.common.response.ResponseCode; +import com.dongjian.dashboard.back.configurator.interceptor.AccessRequired; +import com.dongjian.dashboard.back.dto.building.BuildingSearchParams; +import com.dongjian.dashboard.back.service.BuildingService; +import com.dongjian.dashboard.back.vo.building.BuildingPageVO; +import io.swagger.v3.oas.annotations.Hidden; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; + +import java.io.FileNotFoundException; +import java.util.List; + +import jakarta.servlet.http.HttpServletResponse; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.MediaType; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; + + +/** + * + */ +@RestController +@AccessRequired +@RequestMapping("/building") // HTTP request path mapping +@Tag(name = "楼宇接口", description = "") +@SuppressWarnings("unchecked") +public class BuildingController { + + private static final Logger logger = LoggerFactory.getLogger(BuildingController.class); + + @Autowired + private BuildingService buildingService; + + + @Hidden + @Operation(summary = "Get a page of building list") + @RequestMapping(value = "/getListPage", method = RequestMethod.GET) + public PageResponse> getListPage( + @Parameter(name = "LoginName", description = "Login name", required = true, schema = @Schema(defaultValue = "admin")) @RequestHeader(required = true) String LoginName, + @Parameter(name = "AccessToken", description = "Authentication token", required = true) @RequestHeader(required = true) String AccessToken, + @Parameter(name = "UserId", description = "User ID", required = true, schema = @Schema(defaultValue = "1")) @RequestHeader(required = true) Long UserId, + @Parameter(name = "CompanyId", description = "User's company ID", required = false, schema = @Schema(defaultValue = "1")) @RequestHeader(required = false) Long CompanyId, + @Parameter(name = "LanguageType", description = "Language type", required = true, schema = @Schema(defaultValue = "2")) @RequestHeader(required = true) Integer LanguageType, + @Parameter(name = "UTCOffset", description = "Difference between GMT and local time in minutes", required = true, schema = @Schema(defaultValue = "-480")) @RequestHeader(required = true) Integer UTCOffset, + BuildingSearchParams pageSearchParam) throws BusinessException { + + pageSearchParam.setUserId(UserId); + + PageResponse> pageResponse = new PageResponse<>(); + try { + pageResponse.setData(buildingService.getListPage(pageSearchParam, CompanyId, UserId, LanguageType, UTCOffset)); + pageResponse.setCode(ResponseCode.SUCCESS); + pageResponse.setMsg("success"); + } catch (Exception e) { + logger.error("Error querying list", e); + pageResponse.setCode(ResponseCode.SERVER_ERROR); + pageResponse.setMsg("service error"); + } + return pageResponse; + } + +} diff --git a/dongjian-dashboard-back-controller/src/main/java/com/dongjian/dashboard/back/controller/CommonController.java b/dongjian-dashboard-back-controller/src/main/java/com/dongjian/dashboard/back/controller/CommonController.java new file mode 100644 index 0000000..17533eb --- /dev/null +++ b/dongjian-dashboard-back-controller/src/main/java/com/dongjian/dashboard/back/controller/CommonController.java @@ -0,0 +1,81 @@ +package com.dongjian.dashboard.back.controller; + +import java.util.List; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; + +import com.alibaba.fastjson.JSONObject; +import com.dongjian.dashboard.back.common.response.SimpleDataResponse; +import com.dongjian.dashboard.back.service.CommonService; +import io.swagger.v3.oas.annotations.Hidden; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.tags.Tag; + +/** + * + * @author jwy-style + * + */ +//@ApiIgnore +@RestController//代表返回的是json格式的数据,这个注解是Spring4之后新加的注解 +@RequestMapping("/common") //http请求路径映射 +@Tag(name = "CommonController",description = "公共接口") +@SuppressWarnings("unchecked") +public class CommonController{ + + private static Logger logger = LoggerFactory.getLogger(CommonController.class); + + @Autowired + private CommonService commonService; + + @Hidden + @Operation(summary = "接收Lambda测试数据") + @RequestMapping(value = "/testReceiveLambdaData",method = RequestMethod.POST) + public SimpleDataResponse testReceiveLambdaData(@RequestBody JSONObject jsonObj){ + logger.info("testReceiveLambdaData接收数据--{}", jsonObj.toString()); + return SimpleDataResponse.success(); + } + + @Hidden + @Operation(summary = "检测apikey是否有效") + @RequestMapping(value = "/checkApikey",method = RequestMethod.GET) + public SimpleDataResponse checkApikey( + @Parameter(name = "apikey", description = "API key value", required = true) @RequestParam String apikey){ + return commonService.checkApikey(apikey); + } + + @Hidden + @Operation(summary = "初始化企业对应数据库") + @RequestMapping(value = "/initDatabase/{companyId}",method = RequestMethod.GET) + public SimpleDataResponse initDatabase( + @PathVariable Long companyId + ){ + return commonService.initDatabase(companyId); + } + + @Hidden + @Operation(summary = "初始化企业对应aurora") + @RequestMapping(value = "/initAurora/{companyId}",method = RequestMethod.GET) + public SimpleDataResponse initAurora( + @PathVariable Long companyId + ){ + return commonService.initAurora(companyId); + } + + @Hidden + @Operation(summary = "销毁企业对应aurora") + @RequestMapping(value = "/destroyAurora/{companyId}",method = RequestMethod.GET) + public SimpleDataResponse destroyAurora( + @PathVariable Long companyId + ){ + return commonService.destroyAurora(companyId); + } +} diff --git a/dongjian-dashboard-back-controller/src/main/java/com/dongjian/dashboard/back/controller/CompanyController.java b/dongjian-dashboard-back-controller/src/main/java/com/dongjian/dashboard/back/controller/CompanyController.java new file mode 100644 index 0000000..90bdf8b --- /dev/null +++ b/dongjian-dashboard-back-controller/src/main/java/com/dongjian/dashboard/back/controller/CompanyController.java @@ -0,0 +1,140 @@ +package com.dongjian.dashboard.back.controller; + + +import io.swagger.v3.oas.annotations.Hidden; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; + +import java.util.List; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import com.dongjian.dashboard.back.common.exception.BusinessException; +import com.dongjian.dashboard.back.common.response.PageInfo; +import com.dongjian.dashboard.back.common.response.PageResponse; +import com.dongjian.dashboard.back.common.response.ResponseCode; +import com.dongjian.dashboard.back.common.response.SimpleDataResponse; +import com.dongjian.dashboard.back.configurator.interceptor.AccessRequired; +import com.dongjian.dashboard.back.dto.company.CompanySearchParams; +import com.dongjian.dashboard.back.dto.company.DeleteCompanyParams; +import com.dongjian.dashboard.back.dto.company.OptCompanyParams; +import com.dongjian.dashboard.back.vo.company.CompanyPageDTO; +import com.dongjian.dashboard.back.vo.TreeMenusDTO; +import com.dongjian.dashboard.back.service.CompanyService; + +/** + * + * @author jwy-style + * + */ +@RestController//代表返回的是json格式的数据,这个注解是Spring4之后新加的注解 +//@AccessRequired //注解标识是否需要验证token +@Hidden +@RequestMapping("/company/del") //http请求路径映射 +@Tag(name = "CompanyController",description = "企业管理的相关接口") +@SuppressWarnings("unchecked") +public class CompanyController { + + private static Logger logger = LoggerFactory.getLogger(CompanyController.class); + + @Autowired + private CompanyService companyService; + + + @AccessRequired + @Operation(summary = "添加企业") + @RequestMapping(value = "/add",method = RequestMethod.POST) + public SimpleDataResponse add( + @RequestBody OptCompanyParams optCompanyParams, + @Parameter(name = "LoginName", description = "Login name", required = true, schema = @Schema(defaultValue = "admin")) @RequestHeader(required=true) String LoginName, + @Parameter(name = "AccessToken", description = "Authentication token", required = true) @RequestHeader(required=true) String AccessToken, + @Parameter(name = "UserId", description = "User ID", required = true, schema = @Schema(defaultValue = "1")) @RequestHeader(required=true) Long UserId, + @Parameter(name = "CompanyId", description = "ID of the company to which the user belongs", required = false, schema = @Schema(defaultValue = "1")) @RequestHeader(required=false) Long CompanyId, + @Parameter(name = "LanguageType", description = "Language type (0: Chinese, 1: English, 2: Japanese)", required = true, schema = @Schema(defaultValue = "2")) @RequestHeader(required=true) Integer LanguageType){ + return companyService.add(optCompanyParams, CompanyId, UserId, LanguageType); + } + + @AccessRequired + @Operation(summary = "编辑企业") + @RequestMapping(value = "/edit",method = RequestMethod.POST) + public SimpleDataResponse edit( + @RequestBody OptCompanyParams optCompanyParams, + @Parameter(name = "LoginName", description = "Login name", required = true, schema = @Schema(defaultValue = "admin")) @RequestHeader(required=true) String LoginName, + @Parameter(name = "AccessToken", description = "Authentication token", required = true) @RequestHeader(required=true) String AccessToken, + @Parameter(name = "UserId", description = "User ID", required = true, schema = @Schema(defaultValue = "1")) @RequestHeader(required=true) Long UserId, + @Parameter(name = "CompanyId", description = "ID of the company to which the user belongs", required = false, schema = @Schema(defaultValue = "1")) @RequestHeader(required=false) Long CompanyId, + @Parameter(name = "LanguageType", description = "Language type (0: Chinese, 1: English, 2: Japanese)", required = true, schema = @Schema(defaultValue = "2")) @RequestHeader(required=true) Integer LanguageType) { + return companyService.edit(optCompanyParams, CompanyId, UserId, LanguageType); + } + + @AccessRequired + @Operation(summary = "删除企业") + @RequestMapping(value = "/batchDelete",method = RequestMethod.POST) + public SimpleDataResponse batchDelete( + @RequestBody DeleteCompanyParams deleteCompanyParams, + @Parameter(name = "LoginName", description = "Login name", required = true, schema = @Schema(defaultValue = "admin")) @RequestHeader(required=true) String LoginName, + @Parameter(name = "AccessToken", description = "Authentication token", required = true) @RequestHeader(required=true) String AccessToken, + @Parameter(name = "UserId", description = "User ID", required = true, schema = @Schema(defaultValue = "1")) @RequestHeader(required=true) Long UserId, + @Parameter(name = "CompanyId", description = "ID of the company to which the user belongs", required = false, schema = @Schema(defaultValue = "1")) @RequestHeader(required=false) Long CompanyId, + @Parameter(name = "LanguageType", description = "Language type (0: Chinese, 1: English, 2: Japanese)", required = true, schema = @Schema(defaultValue = "2")) @RequestHeader(required=true) Integer LanguageType){ + return companyService.batchDelete(deleteCompanyParams, CompanyId, UserId, LanguageType); + } + + @AccessRequired + @Operation(summary = "获取当前登录用户下的企业菜单树") + @RequestMapping(value = "/getCompanyTree",method = RequestMethod.GET) + public SimpleDataResponse> getCompanyTree( + @Parameter(name = "LoginName", description = "Login name", required = true, schema = @Schema(defaultValue = "admin")) @RequestHeader(required=true) String LoginName, + @Parameter(name = "AccessToken", description = "Authentication token", required = true) @RequestHeader(required=true) String AccessToken, + @Parameter(name = "UserId", description = "User ID", required = true, schema = @Schema(defaultValue = "1")) @RequestHeader(required=true) Long UserId, + @Parameter(name = "CompanyId", description = "ID of the company to which the user belongs", required = false, schema = @Schema(defaultValue = "1")) @RequestHeader(required=true) Long CompanyId, + @Parameter(name = "LanguageType", description = "Language type (0: Chinese, 1: English, 2: Japanese)", required = true, schema = @Schema(defaultValue = "2")) @RequestHeader(required=true) Integer LanguageType){ + return companyService.getCompanyTree(CompanyId, UserId, LanguageType); + } + + @AccessRequired + @Operation(summary = "获取企业列表") + @RequestMapping(value = "/getListPage",method = RequestMethod.GET) + public PageResponse> getListPage( + @Parameter(name = "LoginName", description = "Login name", required = true, schema = @Schema(defaultValue = "admin")) @RequestHeader(required=true) String LoginName, + @Parameter(name = "AccessToken", description = "Authentication token", required = true) @RequestHeader(required=true) String AccessToken, + @Parameter(name = "UserId", description = "User ID", required = true, schema = @Schema(defaultValue = "1")) @RequestHeader(required=true) Long UserId, + @Parameter(name = "CompanyId", description = "ID of the company to which the user belongs", required = false, schema = @Schema(defaultValue = "1")) @RequestHeader(required=false) Long CompanyId, +// @ApiParam(name="LoginCompanyId",value="登录用户的企业ID",required=false,defaultValue = "1") @RequestHeader(required=false) Long LoginCompanyId, + @Parameter(name = "LanguageType", description = "Language type (0: Chinese, 1: English, 2: Japanese)", required = true, schema = @Schema(defaultValue = "2")) @RequestHeader(required=true) Integer LanguageType, + @Parameter(name="UTCOffset",description="格林威治时间与本地时间的差值,单位是分钟,比如东八区是 -480",required=true,schema = @Schema(defaultValue = "-480")) @RequestHeader(required=true) Integer UTCOffset, + CompanySearchParams pageSearchParam + ) throws BusinessException { + + pageSearchParam.setUserId(UserId); +// if (1 == pageSearchParam.getSearchType()) { +// pageSearchParam.setCompanyId(LoginCompanyId); +// } else if (2 == pageSearchParam.getSearchType()) { +// pageSearchParam.setCompanyId(CompanyId); +// } + + PageResponse> pageResponse = new PageResponse>(); + try{ + pageResponse.setData(companyService.getListPage(pageSearchParam, CompanyId, UserId, LanguageType, UTCOffset)); + pageResponse.setCode(ResponseCode.SUCCESS); + pageResponse.setMsg("success"); + }catch (Exception e){ + logger.error("查询列表报错",e); + pageResponse.setCode(ResponseCode.SERVER_ERROR); + pageResponse.setMsg("service error"); + } + return pageResponse; + } + + @Operation(summary = "创建大阪区资源") + @RequestMapping(value = "/initAurora/osaka",method = RequestMethod.GET) + public SimpleDataResponse osakaInitAurora(){ + return companyService.osakaInitAurora(); + } + +} diff --git a/dongjian-dashboard-back-controller/src/main/java/com/dongjian/dashboard/back/controller/DeviceController.java b/dongjian-dashboard-back-controller/src/main/java/com/dongjian/dashboard/back/controller/DeviceController.java new file mode 100644 index 0000000..e49dbe0 --- /dev/null +++ b/dongjian-dashboard-back-controller/src/main/java/com/dongjian/dashboard/back/controller/DeviceController.java @@ -0,0 +1,82 @@ +package com.dongjian.dashboard.back.controller; + + +import com.dongjian.dashboard.back.common.exception.BusinessException; +import com.dongjian.dashboard.back.common.response.PageInfo; +import com.dongjian.dashboard.back.common.response.PageResponse; +import com.dongjian.dashboard.back.common.response.ResponseCode; +import com.dongjian.dashboard.back.common.response.SimpleDataResponse; +import com.dongjian.dashboard.back.configurator.aspect.OperationLog; +import com.dongjian.dashboard.back.configurator.interceptor.AccessRequired; +import com.dongjian.dashboard.back.dto.device.DeviceSearchParams; +import com.dongjian.dashboard.back.dto.device.OptDeviceFieldParams; +import com.dongjian.dashboard.back.service.DeviceService; +import com.dongjian.dashboard.back.vo.device.DeviceVO; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.tags.Tag; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +/** + * + * @author jwy-style + * + */ +@RestController//代表返回的是json格式的数据,这个注解是Spring4之后新加的注解 +@AccessRequired //注解标识是否需要验证token +@RequestMapping("/device") //http请求路径映射 +@Tag(name = "设备的相关接口",description = "设备的相关接口") +@SuppressWarnings("unchecked") +public class DeviceController { + + private static Logger logger = LoggerFactory.getLogger(DeviceController.class); + + @Autowired + private DeviceService deviceService; + + @OperationLog(operation = "queryDeviceList", remark = "") + @Operation(summary = "获取设备列表") + @RequestMapping(value = "/getListPage",method = RequestMethod.GET) + public PageResponse> getListPage( + @Parameter(name = "LoginName", description = "Login name", required = true, schema = @Schema(defaultValue = "admin")) @RequestHeader(required=true) String LoginName, + @Parameter(name = "AccessToken", description = "Authentication token", required = true) @RequestHeader(required=true) String AccessToken, + @Parameter(name = "UserId", description = "User ID", required = true, schema = @Schema(defaultValue = "1")) @RequestHeader(required=true) Long UserId, + @Parameter(name = "CompanyId", description = "ID of the company to which the user belongs", required = false, schema = @Schema(defaultValue = "1")) @RequestHeader(required=false) Long CompanyId, + @Parameter(name = "LanguageType", description = "Language type (0: Chinese, 1: English, 2: Japanese)", required = true, schema = @Schema(defaultValue = "2")) @RequestHeader(required=true) Integer LanguageType, + DeviceSearchParams pageSearchParam + ) throws BusinessException { + + pageSearchParam.setUserId(UserId); +// pageSearchParam.setCompanyId(CompanyId); + PageResponse> pageResponse = new PageResponse>(); + try{ + pageResponse.setData(deviceService.getListPage(pageSearchParam, CompanyId, UserId, LanguageType)); + pageResponse.setCode(ResponseCode.SUCCESS); + pageResponse.setMsg("success"); + }catch (Exception e){ + logger.error("查询列表报错",e); + pageResponse.setCode(ResponseCode.SERVER_ERROR); + pageResponse.setMsg("service error"); + } + return pageResponse; + } + + @OperationLog(operation = "editRole", remark = "") + @Operation(summary = "编辑设备属性") + @RequestMapping(value = "/editField",method = RequestMethod.POST) + public SimpleDataResponse editField( + @RequestBody OptDeviceFieldParams optDeviceFieldParams, + @Parameter(name = "LoginName", description = "Login name", required = true, schema = @Schema(defaultValue = "admin")) @RequestHeader(required=true) String LoginName, + @Parameter(name = "AccessToken", description = "Authentication token", required = true) @RequestHeader(required=true) String AccessToken, + @Parameter(name = "UserId", description = "User ID", required = true, schema = @Schema(defaultValue = "1")) @RequestHeader(required=true) Long UserId, + @Parameter(name = "CompanyId", description = "ID of the company to which the user belongs", required = false, schema = @Schema(defaultValue = "1")) @RequestHeader(required=true) Long CompanyId, + @Parameter(name = "LanguageType", description = "Language type (0: Chinese, 1: English, 2: Japanese)", required = true, schema = @Schema(defaultValue = "2")) @RequestHeader(required=true) Integer LanguageType){ + return deviceService.editField(optDeviceFieldParams, CompanyId, UserId, LanguageType); + } + + +} diff --git a/dongjian-dashboard-back-controller/src/main/java/com/dongjian/dashboard/back/controller/DeviceDataAccumulateController.java b/dongjian-dashboard-back-controller/src/main/java/com/dongjian/dashboard/back/controller/DeviceDataAccumulateController.java new file mode 100644 index 0000000..c411b0c --- /dev/null +++ b/dongjian-dashboard-back-controller/src/main/java/com/dongjian/dashboard/back/controller/DeviceDataAccumulateController.java @@ -0,0 +1,129 @@ +package com.dongjian.dashboard.back.controller; + + +import com.alibaba.excel.EasyExcel; +import com.dongjian.dashboard.back.common.exception.BusinessException; +import com.dongjian.dashboard.back.common.response.PageInfo; +import com.dongjian.dashboard.back.common.response.PageResponse; +import com.dongjian.dashboard.back.common.response.ResponseCode; +import com.dongjian.dashboard.back.common.response.SimpleDataResponse; +import com.dongjian.dashboard.back.configurator.aspect.OperationLog; +import com.dongjian.dashboard.back.configurator.interceptor.AccessRequired; +import com.dongjian.dashboard.back.dto.data.AccumulateDataSearchParam; +import com.dongjian.dashboard.back.dto.device.LineDataSearchParams; +import com.dongjian.dashboard.back.easyexcel.ExportDeviceAccumulateDataDTO; +import com.dongjian.dashboard.back.easyexcel.LanguageDynamicHeaderAdapter; +import com.dongjian.dashboard.back.service.DeviceDataAccumulateService; +import com.dongjian.dashboard.back.vo.data.DeviceAccumulateData; +import com.dongjian.dashboard.back.vo.device.LineData; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.tags.Tag; +import jakarta.servlet.http.HttpServletResponse; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.BeanUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.io.IOException; +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.List; + +/** + * + * @author jwy-style + * + */ +@RestController//代表返回的是json格式的数据,这个注解是Spring4之后新加的注解 +@AccessRequired //注解标识是否需要验证token +@RequestMapping("/deviceAccumulate") //http请求路径映射 +@Tag(name = "积算设备的相关接口",description = "积算设备的相关接口") +@SuppressWarnings("unchecked") +public class DeviceDataAccumulateController { + + private static final Logger logger = LoggerFactory.getLogger(DeviceDataAccumulateController.class); + + @Autowired + private DeviceDataAccumulateService deviceDataAccumulateService; + + @OperationLog(operation = "getCumulativeDataList", remark = "") + @Operation(summary = "获取积算数据列表") + @RequestMapping(value = "/getDataList",method = RequestMethod.GET) + public PageResponse> getListPage( + @Parameter(name = "LoginName", description = "Login name", required = true, schema = @Schema(defaultValue = "admin")) @RequestHeader(required=true) String LoginName, + @Parameter(name = "AccessToken", description = "Authentication token", required = true) @RequestHeader(required=true) String AccessToken, + @Parameter(name = "UserId", description = "User ID", required = true, schema = @Schema(defaultValue = "1")) @RequestHeader(required=true) Long UserId, + @Parameter(name = "CompanyId", description = "ID of the company to which the user belongs", required = false, schema = @Schema(defaultValue = "1")) @RequestHeader(required=false) Long CompanyId, + @Parameter(name = "LanguageType", description = "Language type (0: Chinese, 1: English, 2: Japanese)", required = true, schema = @Schema(defaultValue = "2")) @RequestHeader(required=true) Integer LanguageType, + AccumulateDataSearchParam pageSearchParam + ) throws BusinessException { + + pageSearchParam.setUserId(UserId); +// pageSearchParam.setCompanyId(CompanyId); + PageResponse> pageResponse = new PageResponse>(); + try{ + pageResponse.setData(deviceDataAccumulateService.getDataList(pageSearchParam, CompanyId, UserId, LanguageType)); + pageResponse.setCode(ResponseCode.SUCCESS); + pageResponse.setMsg("success"); + }catch (Exception e){ + logger.error("查询列表报错",e); + pageResponse.setCode(ResponseCode.SERVER_ERROR); + pageResponse.setMsg("service error"); + } + return pageResponse; + } + + + @OperationLog(operation = "exportCumulativeData", remark = "") + @GetMapping("/exportData") + public void exportDeviceAccumulate(HttpServletResponse response, + @Parameter(name = "LoginName", description = "Login name", required = true, schema = @Schema(defaultValue = "admin")) @RequestHeader(required=true) String LoginName, + @Parameter(name = "AccessToken", description = "Authentication token", required = true) @RequestHeader(required=true) String AccessToken, + @Parameter(name = "UserId", description = "User ID", required = true, schema = @Schema(defaultValue = "1")) @RequestHeader(required=true) Long UserId, + @Parameter(name = "CompanyId", description = "ID of the company to which the user belongs", required = false, schema = @Schema(defaultValue = "1")) @RequestHeader(required=false) Long CompanyId, + @Parameter(name = "LanguageType", description = "Language type (0: Chinese, 1: English, 2: Japanese)", required = true, schema = @Schema(defaultValue = "2")) @RequestHeader(required=true) Integer LanguageType, + AccumulateDataSearchParam pageSearchParam + ) throws IOException { + + response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"); + response.setCharacterEncoding("utf-8"); + String fileName = URLEncoder.encode("積算データ", StandardCharsets.UTF_8).replace("+", "%20"); + response.setHeader("Content-disposition", "attachment;filename*=utf-8''" + fileName + ".xlsx"); + + PageInfo pageData = deviceDataAccumulateService.getDataList(pageSearchParam, CompanyId, UserId, LanguageType); + List list = pageData.getList(); + + List exportList = list.stream().map(item -> { + ExportDeviceAccumulateDataDTO dto = new ExportDeviceAccumulateDataDTO(); + BeanUtils.copyProperties(item, dto); + return dto; + }).toList(); + + // 构造 Excel header:每列三语组合为字符串 "中文||English||日本語" + List> head = LanguageDynamicHeaderAdapter.buildHead(ExportDeviceAccumulateDataDTO.class, LanguageType); + + EasyExcel.write(response.getOutputStream()) + .head(head) + .sheet("sheet1") + .doWrite(exportList); + } + + + @OperationLog(operation = "getLineData", remark = "") + @Operation(summary = "获取7日趋势数据") + @RequestMapping(value = "/getLineData",method = RequestMethod.GET) + public SimpleDataResponse getLineData( + @Parameter(name = "LoginName", description = "Login name", required = true, schema = @Schema(defaultValue = "admin")) @RequestHeader(required=true) String LoginName, + @Parameter(name = "AccessToken", description = "Authentication token", required = true) @RequestHeader(required=true) String AccessToken, + @Parameter(name = "UserId", description = "User ID", required = true, schema = @Schema(defaultValue = "1")) @RequestHeader(required=true) Long UserId, + @Parameter(name = "CompanyId", description = "ID of the company to which the user belongs", required = false, schema = @Schema(defaultValue = "1")) @RequestHeader(required=false) Long CompanyId, + @Parameter(name = "LanguageType", description = "Language type (0: Chinese, 1: English, 2: Japanese)", required = true, schema = @Schema(defaultValue = "2")) @RequestHeader(required=true) Integer LanguageType, + LineDataSearchParams lineDataSearchParams + ) throws BusinessException { + return deviceDataAccumulateService.getLineData(lineDataSearchParams, CompanyId, UserId, LanguageType); + } + +} diff --git a/dongjian-dashboard-back-controller/src/main/java/com/dongjian/dashboard/back/controller/DeviceDataAlarmController.java b/dongjian-dashboard-back-controller/src/main/java/com/dongjian/dashboard/back/controller/DeviceDataAlarmController.java new file mode 100644 index 0000000..967bdd4 --- /dev/null +++ b/dongjian-dashboard-back-controller/src/main/java/com/dongjian/dashboard/back/controller/DeviceDataAlarmController.java @@ -0,0 +1,157 @@ +package com.dongjian.dashboard.back.controller; + + +import com.alibaba.excel.EasyExcel; +import com.dongjian.dashboard.back.common.exception.BusinessException; +import com.dongjian.dashboard.back.common.response.PageInfo; +import com.dongjian.dashboard.back.common.response.PageResponse; +import com.dongjian.dashboard.back.common.response.ResponseCode; +import com.dongjian.dashboard.back.common.response.SimpleDataResponse; +import com.dongjian.dashboard.back.configurator.aspect.OperationLog; +import com.dongjian.dashboard.back.configurator.interceptor.AccessRequired; +import com.dongjian.dashboard.back.dto.data.AlarmDataSearchParam; +import com.dongjian.dashboard.back.dto.data.HandleAlarmParams; +import com.dongjian.dashboard.back.dto.data.HandleHistorySearchParam; +import com.dongjian.dashboard.back.easyexcel.ExportDeviceAlarmDataDTO; +import com.dongjian.dashboard.back.easyexcel.LanguageDynamicHeaderAdapter; +import com.dongjian.dashboard.back.service.DeviceDataAlarmService; +import com.dongjian.dashboard.back.vo.data.DeviceAlarmData; +import com.dongjian.dashboard.back.vo.data.HandleHistoryDataVO; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.tags.Tag; +import jakarta.servlet.http.HttpServletResponse; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.BeanUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.io.IOException; +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.List; + +/** + * + * @author jwy-style + * + */ +@RestController//代表返回的是json格式的数据,这个注解是Spring4之后新加的注解 +@AccessRequired //注解标识是否需要验证token +@RequestMapping("/deviceAlarm") //http请求路径映射 +@Tag(name = "警报设备的相关接口",description = "警报设备的相关接口") +@SuppressWarnings("unchecked") +public class DeviceDataAlarmController { + + private static final Logger logger = LoggerFactory.getLogger(DeviceDataAlarmController.class); + + @Autowired + private DeviceDataAlarmService deviceDataAlarmService; + + @OperationLog(operation = "getAlarmDataList", remark = "") + @Operation(summary = "告警设备列表") + @RequestMapping(value = "/getDataList",method = RequestMethod.GET) + public PageResponse> getListPage( + @Parameter(name = "LoginName", description = "Login name", required = true, schema = @Schema(defaultValue = "admin")) @RequestHeader(required=true) String LoginName, + @Parameter(name = "AccessToken", description = "Authentication token", required = true) @RequestHeader(required=true) String AccessToken, + @Parameter(name = "UserId", description = "User ID", required = true, schema = @Schema(defaultValue = "1")) @RequestHeader(required=true) Long UserId, + @Parameter(name = "CompanyId", description = "ID of the company to which the user belongs", required = false, schema = @Schema(defaultValue = "1")) @RequestHeader(required=false) Long CompanyId, + @Parameter(name = "LanguageType", description = "Language type (0: Chinese, 1: English, 2: Japanese)", required = true, schema = @Schema(defaultValue = "2")) @RequestHeader(required=true) Integer LanguageType, + AlarmDataSearchParam pageSearchParam + ) throws BusinessException { + + pageSearchParam.setUserId(UserId); +// pageSearchParam.setCompanyId(CompanyId); + PageResponse> pageResponse = new PageResponse>(); + try{ + pageResponse.setData(deviceDataAlarmService.getDataList(pageSearchParam, CompanyId, UserId, LanguageType)); + pageResponse.setCode(ResponseCode.SUCCESS); + pageResponse.setMsg("success"); + }catch (Exception e){ + logger.error("查询列表报错",e); + pageResponse.setCode(ResponseCode.SERVER_ERROR); + pageResponse.setMsg("service error"); + } + return pageResponse; + } + + + @OperationLog(operation = "exportAlarmData", remark = "") + @GetMapping("/exportData") + public void exportDeviceAlarm(HttpServletResponse response, + @Parameter(name = "LoginName", description = "Login name", required = true, schema = @Schema(defaultValue = "admin")) @RequestHeader(required=true) String LoginName, + @Parameter(name = "AccessToken", description = "Authentication token", required = true) @RequestHeader(required=true) String AccessToken, + @Parameter(name = "UserId", description = "User ID", required = true, schema = @Schema(defaultValue = "1")) @RequestHeader(required=true) Long UserId, + @Parameter(name = "CompanyId", description = "ID of the company to which the user belongs", required = false, schema = @Schema(defaultValue = "1")) @RequestHeader(required=false) Long CompanyId, + @Parameter(name = "LanguageType", description = "Language type (0: Chinese, 1: English, 2: Japanese)", required = true, schema = @Schema(defaultValue = "2")) @RequestHeader(required=true) Integer LanguageType, + AlarmDataSearchParam pageSearchParam + ) throws IOException { + + response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"); + response.setCharacterEncoding("utf-8"); + String fileName = URLEncoder.encode("警報データ", StandardCharsets.UTF_8).replace("+", "%20"); + response.setHeader("Content-disposition", "attachment;filename*=utf-8''" + fileName + ".xlsx"); + + PageInfo pageData = deviceDataAlarmService.getDataList(pageSearchParam, CompanyId, UserId, LanguageType); + List list = pageData.getList(); + + List exportList = list.stream().map(item -> { + ExportDeviceAlarmDataDTO dto = new ExportDeviceAlarmDataDTO(); + BeanUtils.copyProperties(item, dto); + return dto; + }).toList(); + + // 构造 Excel header:每列三语组合为字符串 "中文||English||日本語" + List> head = LanguageDynamicHeaderAdapter.buildHead(ExportDeviceAlarmDataDTO.class, LanguageType); + + EasyExcel.write(response.getOutputStream()) + .head(head) + .sheet("sheet1") + .doWrite(exportList); + } + + @OperationLog(operation = "handleAlarm", remark = "") + @Operation(summary = "处理告警") + @RequestMapping(value = "/handleAlarm", method = RequestMethod.POST) + public SimpleDataResponse handleAlarm( + @RequestBody HandleAlarmParams handleAlarmParams, + @Parameter(name = "LoginName", description = "Login name", required = true, schema = @Schema(defaultValue = "admin")) @RequestHeader(required = true) String LoginName, + @Parameter(name = "AccessToken", description = "Authentication token", required = true) @RequestHeader(required = true) String AccessToken, + @Parameter(name = "UserId", description = "User ID", required = true, schema = @Schema(defaultValue = "1")) @RequestHeader(required = true) Long UserId, + @Parameter(name = "CompanyId", description = "User's company ID", required = false, schema = @Schema(defaultValue = "1")) @RequestHeader(required = false) Long CompanyId, + @Parameter(name = "LanguageType", description = "Language type: 0 - Chinese, 1 - English, 2 - Japanese", required = true, schema = @Schema(defaultValue = "2")) @RequestHeader(required = true) Integer LanguageType) { + return deviceDataAlarmService.handleAlarm(handleAlarmParams, UserId, CompanyId, LanguageType); + } + + + @GetMapping("/getHandleHistory/{alertHistoryId}") + @Operation(summary = "告警处理历史") + public PageResponse> getHandleHistory( + @PathVariable Long alertHistoryId, + @Parameter(name = "LoginName", description = "Login name", required = true, schema = @Schema(defaultValue = "admin")) @RequestHeader(required=true) String LoginName, + @Parameter(name = "AccessToken", description = "Authentication token", required = true) @RequestHeader(required=true) String AccessToken, + @Parameter(name = "UserId", description = "User ID", required = true, schema = @Schema(defaultValue = "1")) @RequestHeader(required=true) Long UserId, + @Parameter(name = "CompanyId", description = "ID of the company to which the user belongs", required = false, schema = @Schema(defaultValue = "1")) @RequestHeader(required=false) Long CompanyId, + @Parameter(name = "LanguageType", description = "Language type (0: Chinese, 1: English, 2: Japanese)", required = true, schema = @Schema(defaultValue = "2")) @RequestHeader(required=true) Integer LanguageType, + HandleHistorySearchParam pageSearchParam + ) throws IOException { + + pageSearchParam.setUserId(UserId); + pageSearchParam.setAlertHistoryId(alertHistoryId); + + PageResponse> pageResponse = new PageResponse<>(); + try { + pageResponse.setData(deviceDataAlarmService.getHandleHistory(pageSearchParam, CompanyId, UserId, LanguageType)); + pageResponse.setCode(ResponseCode.SUCCESS); + pageResponse.setMsg("success"); + } catch (Exception e) { + logger.error("Error querying list", e); + pageResponse.setCode(ResponseCode.SERVER_ERROR); + pageResponse.setMsg("service error"); + } + return pageResponse; + } + +} diff --git a/dongjian-dashboard-back-controller/src/main/java/com/dongjian/dashboard/back/controller/DeviceDataBaStatusController.java b/dongjian-dashboard-back-controller/src/main/java/com/dongjian/dashboard/back/controller/DeviceDataBaStatusController.java new file mode 100644 index 0000000..6156013 --- /dev/null +++ b/dongjian-dashboard-back-controller/src/main/java/com/dongjian/dashboard/back/controller/DeviceDataBaStatusController.java @@ -0,0 +1,111 @@ +package com.dongjian.dashboard.back.controller; + + +import com.alibaba.excel.EasyExcel; +import com.dongjian.dashboard.back.common.exception.BusinessException; +import com.dongjian.dashboard.back.common.response.PageInfo; +import com.dongjian.dashboard.back.common.response.PageResponse; +import com.dongjian.dashboard.back.common.response.ResponseCode; +import com.dongjian.dashboard.back.configurator.aspect.OperationLog; +import com.dongjian.dashboard.back.configurator.interceptor.AccessRequired; +import com.dongjian.dashboard.back.dto.data.BaStatusDataSearchParam; +import com.dongjian.dashboard.back.easyexcel.ExportDeviceBaStatusDataDTO; +import com.dongjian.dashboard.back.easyexcel.LanguageDynamicHeaderAdapter; +import com.dongjian.dashboard.back.service.DeviceDataBaStatusService; +import com.dongjian.dashboard.back.vo.data.DeviceBaStatusData; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.tags.Tag; +import jakarta.servlet.http.HttpServletResponse; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.BeanUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.io.IOException; +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.List; + +/** + * + * @author jwy-style + * + */ +@RestController//代表返回的是json格式的数据,这个注解是Spring4之后新加的注解 +@AccessRequired //注解标识是否需要验证token +@RequestMapping("/deviceBaStatus") //http请求路径映射 +@Tag(name = "运行状态设备的相关接口",description = "运行状态设备的相关接口") +@SuppressWarnings("unchecked") +public class DeviceDataBaStatusController { + + private static final Logger logger = LoggerFactory.getLogger(DeviceDataAccumulateController.class); + + @Autowired + private DeviceDataBaStatusService deviceDataBaStatusService; + + @OperationLog(operation = "getBaStatusDataList", remark = "") + @Operation(summary = "获取状态数据列表") + @RequestMapping(value = "/getDataList",method = RequestMethod.GET) + public PageResponse> getListPage( + @Parameter(name = "LoginName", description = "Login name", required = true, schema = @Schema(defaultValue = "admin")) @RequestHeader(required=true) String LoginName, + @Parameter(name = "AccessToken", description = "Authentication token", required = true) @RequestHeader(required=true) String AccessToken, + @Parameter(name = "UserId", description = "User ID", required = true, schema = @Schema(defaultValue = "1")) @RequestHeader(required=true) Long UserId, + @Parameter(name = "CompanyId", description = "ID of the company to which the user belongs", required = false, schema = @Schema(defaultValue = "1")) @RequestHeader(required=false) Long CompanyId, + @Parameter(name = "LanguageType", description = "Language type (0: Chinese, 1: English, 2: Japanese)", required = true, schema = @Schema(defaultValue = "2")) @RequestHeader(required=true) Integer LanguageType, + BaStatusDataSearchParam pageSearchParam + ) throws BusinessException { + + pageSearchParam.setUserId(UserId); +// pageSearchParam.setCompanyId(CompanyId); + PageResponse> pageResponse = new PageResponse>(); + try{ + pageResponse.setData(deviceDataBaStatusService.getDataList(pageSearchParam, CompanyId, UserId, LanguageType)); + pageResponse.setCode(ResponseCode.SUCCESS); + pageResponse.setMsg("success"); + }catch (Exception e){ + logger.error("查询列表报错",e); + pageResponse.setCode(ResponseCode.SERVER_ERROR); + pageResponse.setMsg("service error"); + } + return pageResponse; + } + + + @OperationLog(operation = "exportBaStatusData", remark = "") + @GetMapping("/exportData") + public void exportDeviceBaStatus(HttpServletResponse response, + @Parameter(name = "LoginName", description = "Login name", required = true, schema = @Schema(defaultValue = "admin")) @RequestHeader(required=true) String LoginName, + @Parameter(name = "AccessToken", description = "Authentication token", required = true) @RequestHeader(required=true) String AccessToken, + @Parameter(name = "UserId", description = "User ID", required = true, schema = @Schema(defaultValue = "1")) @RequestHeader(required=true) Long UserId, + @Parameter(name = "CompanyId", description = "ID of the company to which the user belongs", required = false, schema = @Schema(defaultValue = "1")) @RequestHeader(required=false) Long CompanyId, + @Parameter(name = "LanguageType", description = "Language type (0: Chinese, 1: English, 2: Japanese)", required = true, schema = @Schema(defaultValue = "2")) @RequestHeader(required=true) Integer LanguageType, + BaStatusDataSearchParam pageSearchParam + ) throws IOException { + + response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"); + response.setCharacterEncoding("utf-8"); + String fileName = URLEncoder.encode("稼働設備", StandardCharsets.UTF_8).replace("+", "%20"); + response.setHeader("Content-disposition", "attachment;filename*=utf-8''" + fileName + ".xlsx"); + + PageInfo pageData = deviceDataBaStatusService.getDataList(pageSearchParam, CompanyId, UserId, LanguageType); + List list = pageData.getList(); + + List exportList = list.stream().map(item -> { + ExportDeviceBaStatusDataDTO dto = new ExportDeviceBaStatusDataDTO(); + BeanUtils.copyProperties(item, dto); + return dto; + }).toList(); + + // 构造 Excel header:每列三语组合为字符串 "中文||English||日本語" + List> head = LanguageDynamicHeaderAdapter.buildHead(ExportDeviceBaStatusDataDTO.class, LanguageType); + + EasyExcel.write(response.getOutputStream()) + .head(head) + .sheet("sheet1") + .doWrite(exportList); + } + +} diff --git a/dongjian-dashboard-back-controller/src/main/java/com/dongjian/dashboard/back/controller/DeviceDataMeasureController.java b/dongjian-dashboard-back-controller/src/main/java/com/dongjian/dashboard/back/controller/DeviceDataMeasureController.java new file mode 100644 index 0000000..f9343fb --- /dev/null +++ b/dongjian-dashboard-back-controller/src/main/java/com/dongjian/dashboard/back/controller/DeviceDataMeasureController.java @@ -0,0 +1,128 @@ +package com.dongjian.dashboard.back.controller; + + +import com.alibaba.excel.EasyExcel; +import com.dongjian.dashboard.back.common.exception.BusinessException; +import com.dongjian.dashboard.back.common.response.PageInfo; +import com.dongjian.dashboard.back.common.response.PageResponse; +import com.dongjian.dashboard.back.common.response.ResponseCode; +import com.dongjian.dashboard.back.common.response.SimpleDataResponse; +import com.dongjian.dashboard.back.configurator.aspect.OperationLog; +import com.dongjian.dashboard.back.configurator.interceptor.AccessRequired; +import com.dongjian.dashboard.back.dto.data.MeasureDataSearchParam; +import com.dongjian.dashboard.back.dto.device.LineDataSearchParams; +import com.dongjian.dashboard.back.easyexcel.ExportDeviceMeasureDataDTO; +import com.dongjian.dashboard.back.easyexcel.LanguageDynamicHeaderAdapter; +import com.dongjian.dashboard.back.service.DeviceDataMeasureService; +import com.dongjian.dashboard.back.vo.data.DeviceMeasureData; +import com.dongjian.dashboard.back.vo.device.LineData; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.tags.Tag; +import jakarta.servlet.http.HttpServletResponse; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.BeanUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.io.IOException; +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.List; + +/** + * + * @author jwy-style + * + */ +@RestController//代表返回的是json格式的数据,这个注解是Spring4之后新加的注解 +@AccessRequired //注解标识是否需要验证token +@RequestMapping("/deviceMeasure") //http请求路径映射 +@Tag(name = "计测设备的相关接口",description = "计测设备的相关接口") +@SuppressWarnings("unchecked") +public class DeviceDataMeasureController { + + private static final Logger logger = LoggerFactory.getLogger(DeviceDataAccumulateController.class); + + @Autowired + private DeviceDataMeasureService deviceDataMeasureService; + + @OperationLog(operation = "getMeasureDataList", remark = "") + @Operation(summary = "获取计测数据列表") + @RequestMapping(value = "/getDataList",method = RequestMethod.GET) + public PageResponse> getListPage( + @Parameter(name = "LoginName", description = "Login name", required = true, schema = @Schema(defaultValue = "admin")) @RequestHeader(required=true) String LoginName, + @Parameter(name = "AccessToken", description = "Authentication token", required = true) @RequestHeader(required=true) String AccessToken, + @Parameter(name = "UserId", description = "User ID", required = true, schema = @Schema(defaultValue = "1")) @RequestHeader(required=true) Long UserId, + @Parameter(name = "CompanyId", description = "ID of the company to which the user belongs", required = false, schema = @Schema(defaultValue = "1")) @RequestHeader(required=false) Long CompanyId, + @Parameter(name = "LanguageType", description = "Language type (0: Chinese, 1: English, 2: Japanese)", required = true, schema = @Schema(defaultValue = "2")) @RequestHeader(required=true) Integer LanguageType, + MeasureDataSearchParam pageSearchParam + ) throws BusinessException { + + pageSearchParam.setUserId(UserId); +// pageSearchParam.setCompanyId(CompanyId); + PageResponse> pageResponse = new PageResponse>(); + try{ + pageResponse.setData(deviceDataMeasureService.getDataList(pageSearchParam, CompanyId, UserId, LanguageType)); + pageResponse.setCode(ResponseCode.SUCCESS); + pageResponse.setMsg("success"); + }catch (Exception e){ + logger.error("查询列表报错",e); + pageResponse.setCode(ResponseCode.SERVER_ERROR); + pageResponse.setMsg("service error"); + } + return pageResponse; + } + + + @OperationLog(operation = "exportMeasureData", remark = "") + @GetMapping("/exportData") + public void exportDeviceMeasure(HttpServletResponse response, + @Parameter(name = "LoginName", description = "Login name", required = true, schema = @Schema(defaultValue = "admin")) @RequestHeader(required=true) String LoginName, + @Parameter(name = "AccessToken", description = "Authentication token", required = true) @RequestHeader(required=true) String AccessToken, + @Parameter(name = "UserId", description = "User ID", required = true, schema = @Schema(defaultValue = "1")) @RequestHeader(required=true) Long UserId, + @Parameter(name = "CompanyId", description = "ID of the company to which the user belongs", required = false, schema = @Schema(defaultValue = "1")) @RequestHeader(required=false) Long CompanyId, + @Parameter(name = "LanguageType", description = "Language type (0: Chinese, 1: English, 2: Japanese)", required = true, schema = @Schema(defaultValue = "2")) @RequestHeader(required=true) Integer LanguageType, + MeasureDataSearchParam pageSearchParam + ) throws IOException { + + response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"); + response.setCharacterEncoding("utf-8"); + String fileName = URLEncoder.encode("計測データ", StandardCharsets.UTF_8).replace("+", "%20"); + response.setHeader("Content-disposition", "attachment;filename*=utf-8''" + fileName + ".xlsx"); + + PageInfo pageData = deviceDataMeasureService.getDataList(pageSearchParam, CompanyId, UserId, LanguageType); + List list = pageData.getList(); + + List exportList = list.stream().map(item -> { + ExportDeviceMeasureDataDTO dto = new ExportDeviceMeasureDataDTO(); + BeanUtils.copyProperties(item, dto); + return dto; + }).toList(); + + // 构造 Excel header:每列三语组合为字符串 "中文||English||日本語" + List> head = LanguageDynamicHeaderAdapter.buildHead(ExportDeviceMeasureDataDTO.class, LanguageType); + + EasyExcel.write(response.getOutputStream()) + .head(head) + .sheet("sheet1") + .doWrite(exportList); + } + + @OperationLog(operation = "getLineData", remark = "") + @Operation(summary = "获取7日趋势数据") + @RequestMapping(value = "/getLineData",method = RequestMethod.GET) + public SimpleDataResponse getLineData( + @Parameter(name = "LoginName", description = "Login name", required = true, schema = @Schema(defaultValue = "admin")) @RequestHeader(required=true) String LoginName, + @Parameter(name = "AccessToken", description = "Authentication token", required = true) @RequestHeader(required=true) String AccessToken, + @Parameter(name = "UserId", description = "User ID", required = true, schema = @Schema(defaultValue = "1")) @RequestHeader(required=true) Long UserId, + @Parameter(name = "CompanyId", description = "ID of the company to which the user belongs", required = false, schema = @Schema(defaultValue = "1")) @RequestHeader(required=false) Long CompanyId, + @Parameter(name = "LanguageType", description = "Language type (0: Chinese, 1: English, 2: Japanese)", required = true, schema = @Schema(defaultValue = "2")) @RequestHeader(required=true) Integer LanguageType, + LineDataSearchParams lineDataSearchParams + ) throws BusinessException { + return deviceDataMeasureService.getLineData(lineDataSearchParams, CompanyId, UserId, LanguageType); + } + +} diff --git a/dongjian-dashboard-back-controller/src/main/java/com/dongjian/dashboard/back/controller/DeviceGroupController.java b/dongjian-dashboard-back-controller/src/main/java/com/dongjian/dashboard/back/controller/DeviceGroupController.java new file mode 100644 index 0000000..6bf3100 --- /dev/null +++ b/dongjian-dashboard-back-controller/src/main/java/com/dongjian/dashboard/back/controller/DeviceGroupController.java @@ -0,0 +1,158 @@ +package com.dongjian.dashboard.back.controller; + +import com.dongjian.dashboard.back.configurator.aspect.OperationLog; +import com.dongjian.dashboard.back.dto.devicegroup.*; +import com.dongjian.dashboard.back.vo.device.DeviceVO; +import io.swagger.v3.oas.annotations.Hidden; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import com.dongjian.dashboard.back.common.exception.BusinessException; +import com.dongjian.dashboard.back.common.response.PageInfo; +import com.dongjian.dashboard.back.common.response.PageResponse; +import com.dongjian.dashboard.back.common.response.ResponseCode; +import com.dongjian.dashboard.back.common.response.SimpleDataResponse; +import com.dongjian.dashboard.back.configurator.interceptor.AccessRequired; +import com.dongjian.dashboard.back.service.DeviceGroupService; +import com.dongjian.dashboard.back.vo.devicegroup.DeviceGroupPageVO; + +import java.util.List; + +@Hidden +@RestController +@AccessRequired +@RequestMapping("/deviceGroup") +@Tag(name = "设备组相关接口", description = "设备组相关接口") +@SuppressWarnings("unchecked") +public class DeviceGroupController { + + private static final Logger logger = LoggerFactory.getLogger(DeviceGroupController.class); + + @Autowired + private DeviceGroupService deviceGroupService; + + @OperationLog(operation = "addDeviceGroup", remark = "") + @Operation(summary = "Add deviceGroup") + @RequestMapping(value = "/deviceGroup/add", method = RequestMethod.POST) + public SimpleDataResponse add( + @RequestBody OptDeviceGroupParams optDeviceGroupParams, + @Parameter(name = "LoginName", description = "Login name", required = true, schema = @Schema(defaultValue = "admin")) @RequestHeader(required = true) String LoginName, + @Parameter(name = "AccessToken", description = "Authentication token", required = true) @RequestHeader(required = true) String AccessToken, + @Parameter(name = "UserId", description = "User ID", required = true, schema = @Schema(defaultValue = "1")) @RequestHeader(required = true) Long UserId, + @Parameter(name = "CompanyId", description = "User's company ID", required = false, schema = @Schema(defaultValue = "1")) @RequestHeader(required = false) Long CompanyId, + @Parameter(name = "LanguageType", description = "Language type: 0 - Chinese, 1 - English, 2 - Japanese", required = true, schema = @Schema(defaultValue = "2")) @RequestHeader(required = true) Integer LanguageType) { + return deviceGroupService.add(optDeviceGroupParams, UserId, CompanyId, LanguageType); + } + + @OperationLog(operation = "editDeviceGroup", remark = "") + @Operation(summary = "Edit deviceGroup") + @RequestMapping(value = "/deviceGroup/edit", method = RequestMethod.POST) + public SimpleDataResponse edit( + @RequestBody OptDeviceGroupParams optDeviceGroupParams, + @Parameter(name = "LoginName", description = "Login name", required = true, schema = @Schema(defaultValue = "admin")) @RequestHeader(required = true) String LoginName, + @Parameter(name = "AccessToken", description = "Authentication token", required = true) @RequestHeader(required = true) String AccessToken, + @Parameter(name = "UserId", description = "User ID", required = true, schema = @Schema(defaultValue = "1")) @RequestHeader(required = true) Long UserId, + @Parameter(name = "CompanyId", description = "User's company ID", required = false, schema = @Schema(defaultValue = "1")) @RequestHeader(required = false) Long CompanyId, + @Parameter(name = "LanguageType", description = "Language type: 0 - Chinese, 1 - English, 2 - Japanese", required = true, schema = @Schema(defaultValue = "2")) @RequestHeader(required = true) Integer LanguageType) { + return deviceGroupService.edit(optDeviceGroupParams, UserId, CompanyId, LanguageType); + } + + @OperationLog(operation = "deleteDeviceGroup", remark = "") + @Operation(summary = "Delete deviceGroup") + @RequestMapping(value = "/deviceGroup/batchDelete", method = RequestMethod.POST) + public SimpleDataResponse batchDelete( + @RequestBody DeleteDeviceGroupParams deleteDeviceGroupParams, + @Parameter(name = "LoginName", description = "Login name", required = true, schema = @Schema(defaultValue = "admin")) @RequestHeader(required = true) String LoginName, + @Parameter(name = "AccessToken", description = "Authentication token", required = true) @RequestHeader(required = true) String AccessToken, + @Parameter(name = "UserId", description = "User ID", required = true, schema = @Schema(defaultValue = "1")) @RequestHeader(required = true) Long UserId, + @Parameter(name = "CompanyId", description = "User's company ID", required = false, schema = @Schema(defaultValue = "1")) @RequestHeader(required = false) Long CompanyId, + @Parameter(name = "LanguageType", description = "Language type: 0 - Chinese, 1 - English, 2 - Japanese", required = true, schema = @Schema(defaultValue = "2")) @RequestHeader(required = true) Integer LanguageType) { + return deviceGroupService.batchDelete(deleteDeviceGroupParams, UserId, CompanyId, LanguageType); + } + + @OperationLog(operation = "queryDeviceGroup", remark = "") + @Operation(summary = "Get deviceGroup list") + @RequestMapping(value = "/deviceGroup/getListPage", method = RequestMethod.GET) + public PageResponse> getListPage( + @Parameter(name = "LoginName", description = "Login name", required = true, schema = @Schema(defaultValue = "admin")) @RequestHeader(required = true) String LoginName, + @Parameter(name = "AccessToken", description = "Authentication token", required = true) @RequestHeader(required = true) String AccessToken, + @Parameter(name = "UserId", description = "User ID", required = true, schema = @Schema(defaultValue = "1")) @RequestHeader(required = true) Long UserId, + @Parameter(name = "CompanyId", description = "User's company ID", required = false, schema = @Schema(defaultValue = "1")) @RequestHeader(required = false) Long CompanyId, + @Parameter(name = "LanguageType", description = "Language type: 0 - Chinese, 1 - English, 2 - Japanese", required = true, schema = @Schema(defaultValue = "2")) @RequestHeader(required = true) Integer LanguageType, + @Parameter(name = "UTCOffset", description = "Time zone offset in minutes from GMT, e.g., +480 for UTC+8", required = true, schema = @Schema(defaultValue = "-480")) @RequestHeader(required = true) Integer UTCOffset, + DeviceGroupSearchParams pageSearchParam) throws BusinessException { + + pageSearchParam.setUserId(UserId); + + PageResponse> pageResponse = new PageResponse<>(); + try { + pageResponse.setData(deviceGroupService.getListPage(pageSearchParam, CompanyId, UserId, LanguageType, UTCOffset)); + pageResponse.setCode(ResponseCode.SUCCESS); + pageResponse.setMsg("success"); + } catch (Exception e) { + logger.error("Error querying list", e); + pageResponse.setCode(ResponseCode.SERVER_ERROR); + pageResponse.setMsg("service error"); + } + return pageResponse; + } + + + @OperationLog(operation = "bindGroupForDevice", remark = "") + @Operation(summary = "给设备绑定设备组") + @RequestMapping(value = "/deviceGroup/bindGroupForDevice", method = RequestMethod.POST) + public SimpleDataResponse bindGroupForDevice( + @RequestBody BindGroupForDeviceParams bindGroupForDeviceParams, + @Parameter(name = "LoginName", description = "Login name", required = true, schema = @Schema(defaultValue = "admin")) @RequestHeader(required = true) String LoginName, + @Parameter(name = "AccessToken", description = "Authentication token", required = true) @RequestHeader(required = true) String AccessToken, + @Parameter(name = "UserId", description = "User ID", required = true, schema = @Schema(defaultValue = "1")) @RequestHeader(required = true) Long UserId, + @Parameter(name = "CompanyId", description = "User's company ID", required = false, schema = @Schema(defaultValue = "1")) @RequestHeader(required = false) Long CompanyId, + @Parameter(name = "LanguageType", description = "Language type: 0 - Chinese, 1 - English, 2 - Japanese", required = true, schema = @Schema(defaultValue = "2")) @RequestHeader(required = true) Integer LanguageType) { + return deviceGroupService.bindGroupForDevice(bindGroupForDeviceParams, UserId, CompanyId, LanguageType); + } + + @OperationLog(operation = "bindDeviceForGroup", remark = "") + @Operation(summary = "给设备组设置绑定的设备") + @RequestMapping(value = "/deviceGroup/bindDeviceForGroup", method = RequestMethod.POST) + public SimpleDataResponse bindDeviceForGroup( + @RequestBody BindDeviceForGroupParams bindDeviceForGroupParams, + @Parameter(name = "LoginName", description = "Login name", required = true, schema = @Schema(defaultValue = "admin")) @RequestHeader(required = true) String LoginName, + @Parameter(name = "AccessToken", description = "Authentication token", required = true) @RequestHeader(required = true) String AccessToken, + @Parameter(name = "UserId", description = "User ID", required = true, schema = @Schema(defaultValue = "1")) @RequestHeader(required = true) Long UserId, + @Parameter(name = "CompanyId", description = "User's company ID", required = false, schema = @Schema(defaultValue = "1")) @RequestHeader(required = false) Long CompanyId, + @Parameter(name = "LanguageType", description = "Language type: 0 - Chinese, 1 - English, 2 - Japanese", required = true, schema = @Schema(defaultValue = "2")) @RequestHeader(required = true) Integer LanguageType) { + return deviceGroupService.bindDeviceForGroup(bindDeviceForGroupParams, UserId, CompanyId, LanguageType); + } + + @Operation(summary = "根据设备主键ID获取绑定的设备组") + @RequestMapping(value = "/deviceGroup/getBindedGroupByDevice/{deviceInfoId}", method = RequestMethod.GET) + public SimpleDataResponse> getBindedGroupByDevice( + @PathVariable Integer deviceInfoId, + @Parameter(name = "LoginName", description = "Login name", required = true, schema = @Schema(defaultValue = "admin")) @RequestHeader(required = true) String LoginName, + @Parameter(name = "AccessToken", description = "Authentication token", required = true) @RequestHeader(required = true) String AccessToken, + @Parameter(name = "UserId", description = "User ID", required = true, schema = @Schema(defaultValue = "1")) @RequestHeader(required = true) Long UserId, + @Parameter(name = "CompanyId", description = "User's company ID", required = false, schema = @Schema(defaultValue = "1")) @RequestHeader(required = false) Long CompanyId, + @Parameter(name = "LanguageType", description = "Language type: 0 - Chinese, 1 - English, 2 - Japanese", required = true, schema = @Schema(defaultValue = "2")) @RequestHeader(required = true) Integer LanguageType) { + return deviceGroupService.getBindedGroupByDevice(deviceInfoId, UserId, CompanyId, LanguageType); + } + + @Operation(summary = "根据设备组ID获取绑定的设备") + @RequestMapping(value = "/deviceGroup/getBindedDeviceByGroup/{deviceGroupId}", method = RequestMethod.GET) + public SimpleDataResponse> getBindedDeviceByGroup( + @PathVariable Long deviceGroupId, + @Parameter(name = "LoginName", description = "Login name", required = true, schema = @Schema(defaultValue = "admin")) @RequestHeader(required = true) String LoginName, + @Parameter(name = "AccessToken", description = "Authentication token", required = true) @RequestHeader(required = true) String AccessToken, + @Parameter(name = "UserId", description = "User ID", required = true, schema = @Schema(defaultValue = "1")) @RequestHeader(required = true) Long UserId, + @Parameter(name = "CompanyId", description = "User's company ID", required = false, schema = @Schema(defaultValue = "1")) @RequestHeader(required = false) Long CompanyId, + @Parameter(name = "LanguageType", description = "Language type: 0 - Chinese, 1 - English, 2 - Japanese", required = true, schema = @Schema(defaultValue = "2")) @RequestHeader(required = true) Integer LanguageType) { + return deviceGroupService.getBindedDeviceByGroup(deviceGroupId, UserId, CompanyId, LanguageType); + } + +} diff --git a/dongjian-dashboard-back-controller/src/main/java/com/dongjian/dashboard/back/controller/FavoritedDeviceController.java b/dongjian-dashboard-back-controller/src/main/java/com/dongjian/dashboard/back/controller/FavoritedDeviceController.java new file mode 100644 index 0000000..77f5888 --- /dev/null +++ b/dongjian-dashboard-back-controller/src/main/java/com/dongjian/dashboard/back/controller/FavoritedDeviceController.java @@ -0,0 +1,87 @@ +package com.dongjian.dashboard.back.controller; + +import com.dongjian.dashboard.back.common.exception.BusinessException; +import com.dongjian.dashboard.back.common.response.PageInfo; +import com.dongjian.dashboard.back.common.response.PageResponse; +import com.dongjian.dashboard.back.common.response.ResponseCode; +import com.dongjian.dashboard.back.common.response.SimpleDataResponse; +import com.dongjian.dashboard.back.configurator.aspect.OperationLog; +import com.dongjian.dashboard.back.configurator.interceptor.AccessRequired; +import com.dongjian.dashboard.back.dto.device.FavoritedDeviceSearchParams; +import com.dongjian.dashboard.back.dto.device.OptFavoritedDeviceParams; +import com.dongjian.dashboard.back.service.FavoritedDeviceService; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.tags.Tag; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +@RestController +@AccessRequired +@RequestMapping("/favoritedDevice") +@Tag(name = "收藏设备相关接口", description = "收藏设备相关接口") +@SuppressWarnings("unchecked") +public class FavoritedDeviceController { + + private static final Logger logger = LoggerFactory.getLogger(FavoritedDeviceController.class); + + @Autowired + private FavoritedDeviceService favoritedDeviceService; + + + @OperationLog(operation = "getFavoriteList", remark = "") + @Operation(summary = "Get favorite list") + @RequestMapping(value = "/getListPage", method = RequestMethod.GET) + public PageResponse> getListPage( + @Parameter(name = "LoginName", description = "Login name", required = true, schema = @Schema(defaultValue = "admin")) @RequestHeader(required = true) String LoginName, + @Parameter(name = "AccessToken", description = "Authentication token", required = true) @RequestHeader(required = true) String AccessToken, + @Parameter(name = "UserId", description = "User ID", required = true, schema = @Schema(defaultValue = "1")) @RequestHeader(required = true) Long UserId, + @Parameter(name = "CompanyId", description = "User's company ID", required = false, schema = @Schema(defaultValue = "1")) @RequestHeader(required = false) Long CompanyId, + @Parameter(name = "LanguageType", description = "Language type: 0 - Chinese, 1 - English, 2 - Japanese", required = true, schema = @Schema(defaultValue = "2")) @RequestHeader(required = true) Integer LanguageType, + @Parameter(name = "UTCOffset", description = "Time zone offset in minutes from GMT, e.g., +480 for UTC+8", required = true, schema = @Schema(defaultValue = "-480")) @RequestHeader(required = true) Integer UTCOffset, + FavoritedDeviceSearchParams pageSearchParam) throws BusinessException { + + pageSearchParam.setUserId(UserId); + + PageResponse> pageResponse = new PageResponse<>(); + try { + pageResponse.setData(favoritedDeviceService.getListPage(pageSearchParam, CompanyId, UserId, LanguageType, UTCOffset)); + pageResponse.setCode(ResponseCode.SUCCESS); + pageResponse.setMsg("success"); + } catch (Exception e) { + logger.error("Error querying list", e); + pageResponse.setCode(ResponseCode.SERVER_ERROR); + pageResponse.setMsg("service error"); + } + return pageResponse; + } + + @OperationLog(operation = "addFavoriteDevice", remark = "") + @Operation(summary = "Add to Favorites") + @RequestMapping(value = "/addToFavorite", method = RequestMethod.POST) + public SimpleDataResponse addToFavorite( + @RequestBody OptFavoritedDeviceParams optFavoritedDeviceParams, + @Parameter(name = "LoginName", description = "Login name", required = true, schema = @Schema(defaultValue = "admin")) @RequestHeader(required = true) String LoginName, + @Parameter(name = "AccessToken", description = "Authentication token", required = true) @RequestHeader(required = true) String AccessToken, + @Parameter(name = "UserId", description = "User ID", required = true, schema = @Schema(defaultValue = "1")) @RequestHeader(required = true) Long UserId, + @Parameter(name = "CompanyId", description = "User's company ID", required = false, schema = @Schema(defaultValue = "1")) @RequestHeader(required = false) Long CompanyId, + @Parameter(name = "LanguageType", description = "Language type: 0 - Chinese, 1 - English, 2 - Japanese", required = true, schema = @Schema(defaultValue = "2")) @RequestHeader(required = true) Integer LanguageType) { + return favoritedDeviceService.addToFavorite(optFavoritedDeviceParams, UserId, CompanyId, LanguageType); + } + + @OperationLog(operation = "removeFavoriteDevice", remark = "") + @Operation(summary = "Remove from Favorites") + @RequestMapping(value = "/removeFavoriteDevice", method = RequestMethod.POST) + public SimpleDataResponse removeFavoriteDevice( + @RequestBody OptFavoritedDeviceParams optFavoritedDeviceParams, + @Parameter(name = "LoginName", description = "Login name", required = true, schema = @Schema(defaultValue = "admin")) @RequestHeader(required = true) String LoginName, + @Parameter(name = "AccessToken", description = "Authentication token", required = true) @RequestHeader(required = true) String AccessToken, + @Parameter(name = "UserId", description = "User ID", required = true, schema = @Schema(defaultValue = "1")) @RequestHeader(required = true) Long UserId, + @Parameter(name = "CompanyId", description = "User's company ID", required = false, schema = @Schema(defaultValue = "1")) @RequestHeader(required = false) Long CompanyId, + @Parameter(name = "LanguageType", description = "Language type: 0 - Chinese, 1 - English, 2 - Japanese", required = true, schema = @Schema(defaultValue = "2")) @RequestHeader(required = true) Integer LanguageType) { + return favoritedDeviceService.removeFavoriteDevice(optFavoritedDeviceParams, UserId, CompanyId, LanguageType); + } +} diff --git a/dongjian-dashboard-back-controller/src/main/java/com/dongjian/dashboard/back/controller/HealthController.java b/dongjian-dashboard-back-controller/src/main/java/com/dongjian/dashboard/back/controller/HealthController.java new file mode 100644 index 0000000..a5832b8 --- /dev/null +++ b/dongjian-dashboard-back-controller/src/main/java/com/dongjian/dashboard/back/controller/HealthController.java @@ -0,0 +1,35 @@ +package com.dongjian.dashboard.back.controller; + +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + +import com.alibaba.fastjson.JSONObject; + +import java.io.BufferedReader; +import java.io.IOException; +import java.io.InputStreamReader; +import java.io.Reader; +import java.util.Properties; + +@RestController +public class HealthController { + + @GetMapping("/healthcheck") + public String health(){ + return "ok"; + } + + @GetMapping("/version") + public String getVersion() throws IOException { + Properties properties = new Properties(); + Reader in = new InputStreamReader(this.getClass().getResourceAsStream("/config/version.properties"),"utf-8"); + BufferedReader bufferedReader = new BufferedReader(in); + properties.load(bufferedReader); + String version=properties.getProperty("project.latest.version"); + String content = properties.getProperty(version); + JSONObject jsonObject = new JSONObject(); + jsonObject.put("version", version); + jsonObject.put("content", content); + return jsonObject.toString(); + } +} diff --git a/dongjian-dashboard-back-controller/src/main/java/com/dongjian/dashboard/back/controller/LevelHierarchyController.java b/dongjian-dashboard-back-controller/src/main/java/com/dongjian/dashboard/back/controller/LevelHierarchyController.java new file mode 100644 index 0000000..396825e --- /dev/null +++ b/dongjian-dashboard-back-controller/src/main/java/com/dongjian/dashboard/back/controller/LevelHierarchyController.java @@ -0,0 +1,111 @@ +package com.dongjian.dashboard.back.controller; + + +import com.dongjian.dashboard.back.common.exception.BusinessException; +import com.dongjian.dashboard.back.common.response.PageInfo; +import com.dongjian.dashboard.back.common.response.PageResponse; +import com.dongjian.dashboard.back.common.response.ResponseCode; +import com.dongjian.dashboard.back.common.response.SimpleDataResponse; +import com.dongjian.dashboard.back.configurator.aspect.OperationLog; +import com.dongjian.dashboard.back.configurator.interceptor.AccessRequired; +import com.dongjian.dashboard.back.dto.levelhierarchy.DeleteLevelHierarchyParam; +import com.dongjian.dashboard.back.dto.levelhierarchy.OptLevelHierarchyParam; +import com.dongjian.dashboard.back.dto.levelhierarchy.PageLevelHierarchySearchParam; +import com.dongjian.dashboard.back.vo.levelhierarchy.LevelHierarchyPageDTO; +import com.dongjian.dashboard.back.service.LevelHierarchyService; + +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +/** + * + * @author jwy-style + * + */ +@RestController//代表返回的是json格式的数据,这个注解是Spring4之后新加的注解 +@AccessRequired //注解标识是否需要验证token +@RequestMapping("/levelHierarchy") //http请求路径映射 +@Tag(name = "支社、支店等层级的相关接口",description = "支社、支店等层级的相关接口") +@SuppressWarnings("unchecked") +public class LevelHierarchyController { + + private static Logger logger = LoggerFactory.getLogger(LevelHierarchyController.class); + + @Autowired + private LevelHierarchyService levelHierarchyService; + + + @OperationLog(operation = "addLevelHierarchy", remark = "") + @Operation(summary = "添加层级") + @RequestMapping(value = "/add",method = RequestMethod.POST) + public SimpleDataResponse add( + @RequestBody OptLevelHierarchyParam optLevelHierarchyParam, + @Parameter(name = "LoginName", description = "Login name", required = true, schema = @Schema(defaultValue = "admin")) @RequestHeader(required=true) String LoginName, + @Parameter(name = "AccessToken", description = "Authentication token", required = true) @RequestHeader(required=true) String AccessToken, + @Parameter(name = "UserId", description = "User ID", required = true, schema = @Schema(defaultValue = "1")) @RequestHeader(required=true) Long UserId, + @Parameter(name = "CompanyId", description = "ID of the company to which the user belongs", required = false, schema = @Schema(defaultValue = "1")) @RequestHeader(required=true) Long CompanyId, + @Parameter(name = "LanguageType", description = "Language type (0: Chinese, 1: English, 2: Japanese)", required = true, schema = @Schema(defaultValue = "2")) @RequestHeader(required=true) Integer LanguageType){ + return levelHierarchyService.add(optLevelHierarchyParam, CompanyId, UserId, LanguageType); + } + + @OperationLog(operation = "editLevelHierarchy", remark = "") + @Operation(summary = "编辑层级") + @RequestMapping(value = "/edit",method = RequestMethod.POST) + public SimpleDataResponse edit( + @RequestBody OptLevelHierarchyParam optLevelHierarchyParam, + @Parameter(name = "LoginName", description = "Login name", required = true, schema = @Schema(defaultValue = "admin")) @RequestHeader(required=true) String LoginName, + @Parameter(name = "AccessToken", description = "Authentication token", required = true) @RequestHeader(required=true) String AccessToken, + @Parameter(name = "UserId", description = "User ID", required = true, schema = @Schema(defaultValue = "1")) @RequestHeader(required=true) Long UserId, + @Parameter(name = "CompanyId", description = "ID of the company to which the user belongs", required = false, schema = @Schema(defaultValue = "1")) @RequestHeader(required=true) Long CompanyId, + @Parameter(name = "LanguageType", description = "Language type (0: Chinese, 1: English, 2: Japanese)", required = true, schema = @Schema(defaultValue = "2")) @RequestHeader(required=true) Integer LanguageType){ + return levelHierarchyService.edit(optLevelHierarchyParam, CompanyId, UserId, LanguageType); + } + + @OperationLog(operation = "deleteLevelHierarchy", remark = "") + @Operation(summary = "删除层级") + @RequestMapping(value = "/batchDelete",method = RequestMethod.POST) + public SimpleDataResponse batchDelete( + @RequestBody DeleteLevelHierarchyParam deleteLevelHierarchyParam, + @Parameter(name = "LoginName", description = "Login name", required = true, schema = @Schema(defaultValue = "admin")) @RequestHeader(required=true) String LoginName, + @Parameter(name = "AccessToken", description = "Authentication token", required = true) @RequestHeader(required=true) String AccessToken, + @Parameter(name = "UserId", description = "User ID", required = true, schema = @Schema(defaultValue = "1")) @RequestHeader(required=true) Long UserId, + @Parameter(name = "CompanyId", description = "ID of the company to which the user belongs", required = false, schema = @Schema(defaultValue = "1")) @RequestHeader(required=true) Long CompanyId, + @Parameter(name = "LanguageType", description = "Language type (0: Chinese, 1: English, 2: Japanese)", required = true, schema = @Schema(defaultValue = "2")) @RequestHeader(required=true) Integer LanguageType){ + return levelHierarchyService.batchDelete(deleteLevelHierarchyParam, CompanyId, UserId, LanguageType); + } + + @OperationLog(operation = "queryLevelHierarchy", remark = "") + @Operation(summary = "获取层级列表") + @RequestMapping(value = "/getListPage",method = RequestMethod.GET) + public PageResponse> getListPage( + @Parameter(name = "LoginName", description = "Login name", required = true, schema = @Schema(defaultValue = "admin")) @RequestHeader(required=true) String LoginName, + @Parameter(name = "AccessToken", description = "Authentication token", required = true) @RequestHeader(required=true) String AccessToken, + @Parameter(name = "UserId", description = "User ID", required = true, schema = @Schema(defaultValue = "1")) @RequestHeader(required=true) Long UserId, + @Parameter(name = "CompanyId", description = "ID of the company to which the user belongs", required = false, schema = @Schema(defaultValue = "1")) @RequestHeader(required=false) Long CompanyId, + @Parameter(name = "LanguageType", description = "Language type (0: Chinese, 1: English, 2: Japanese)", required = true, schema = @Schema(defaultValue = "2")) @RequestHeader(required=true) Integer LanguageType, + PageLevelHierarchySearchParam pageSearchParam + ) throws BusinessException { + + pageSearchParam.setUserId(UserId); +// pageSearchParam.setCompanyId(CompanyId); + PageResponse> pageResponse = new PageResponse>(); + try{ + pageResponse.setData(levelHierarchyService.getListPage(pageSearchParam, CompanyId, UserId, LanguageType)); + pageResponse.setCode(ResponseCode.SUCCESS); + pageResponse.setMsg("success"); + }catch (Exception e){ + logger.error("查询列表报错",e); + pageResponse.setCode(ResponseCode.SERVER_ERROR); + pageResponse.setMsg("service error"); + } + return pageResponse; + } + +} diff --git a/dongjian-dashboard-back-controller/src/main/java/com/dongjian/dashboard/back/controller/LevelHierarchyRoleController.java b/dongjian-dashboard-back-controller/src/main/java/com/dongjian/dashboard/back/controller/LevelHierarchyRoleController.java new file mode 100644 index 0000000..1f051a0 --- /dev/null +++ b/dongjian-dashboard-back-controller/src/main/java/com/dongjian/dashboard/back/controller/LevelHierarchyRoleController.java @@ -0,0 +1,127 @@ +package com.dongjian.dashboard.back.controller; + + +import com.dongjian.dashboard.back.common.exception.BusinessException; +import com.dongjian.dashboard.back.common.response.PageInfo; +import com.dongjian.dashboard.back.common.response.PageResponse; +import com.dongjian.dashboard.back.common.response.ResponseCode; +import com.dongjian.dashboard.back.common.response.SimpleDataResponse; +import com.dongjian.dashboard.back.configurator.aspect.OperationLog; +import com.dongjian.dashboard.back.configurator.interceptor.AccessRequired; +import com.dongjian.dashboard.back.dto.levelhierarchy.DeleteLevelHierarchyRoleParam; +import com.dongjian.dashboard.back.dto.levelhierarchy.OptLevelHierarchyRoleParam; +import com.dongjian.dashboard.back.dto.levelhierarchy.PageLevelHierarchyRoleSearchParam; +import com.dongjian.dashboard.back.service.LevelHierarchyRoleService; +import com.dongjian.dashboard.back.vo.levelhierarchy.LevelHierarchyRolePageDTO; +import com.dongjian.dashboard.back.vo.levelhierarchy.LevelHierarchyTreeVO; +import io.swagger.v3.oas.annotations.Hidden; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.tags.Tag; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.List; + +/** + * + * @author jwy-style + * + */ +@RestController//代表返回的是json格式的数据,这个注解是Spring4之后新加的注解 +@AccessRequired //注解标识是否需要验证token +@RequestMapping("/levelHierarchyRole") //http请求路径映射 +@Tag(name = "支社、支店等层级角色的相关接口",description = "支社、支店等层级角色的相关接口") +@SuppressWarnings("unchecked") +public class LevelHierarchyRoleController { + + private static Logger logger = LoggerFactory.getLogger(LevelHierarchyRoleController.class); + + @Autowired + private LevelHierarchyRoleService levelHierarchyRoleService; + + + @OperationLog(operation = "addLevelHierarchyRole", remark = "") + @Operation(summary = "添加角色") + @RequestMapping(value = "/add",method = RequestMethod.POST) + public SimpleDataResponse add( + @RequestBody OptLevelHierarchyRoleParam optLevelHierarchyRoleParam, + @Parameter(name = "LoginName", description = "Login name", required = true, schema = @Schema(defaultValue = "admin")) @RequestHeader(required=true) String LoginName, + @Parameter(name = "AccessToken", description = "Authentication token", required = true) @RequestHeader(required=true) String AccessToken, + @Parameter(name = "UserId", description = "User ID", required = true, schema = @Schema(defaultValue = "1")) @RequestHeader(required=true) Long UserId, + @Parameter(name = "CompanyId", description = "ID of the company to which the user belongs", required = false, schema = @Schema(defaultValue = "1")) @RequestHeader(required=true) Long CompanyId, + @Parameter(name = "LanguageType", description = "Language type (0: Chinese, 1: English, 2: Japanese)", required = true, schema = @Schema(defaultValue = "2")) @RequestHeader(required=true) Integer LanguageType){ + return levelHierarchyRoleService.add(optLevelHierarchyRoleParam, CompanyId, UserId, LanguageType); + } + + @OperationLog(operation = "editLevelHierarchyRole", remark = "") + @Operation(summary = "编辑角色") + @RequestMapping(value = "/edit",method = RequestMethod.POST) + public SimpleDataResponse edit( + @RequestBody OptLevelHierarchyRoleParam optLevelHierarchyRoleParam, + @Parameter(name = "LoginName", description = "Login name", required = true, schema = @Schema(defaultValue = "admin")) @RequestHeader(required=true) String LoginName, + @Parameter(name = "AccessToken", description = "Authentication token", required = true) @RequestHeader(required=true) String AccessToken, + @Parameter(name = "UserId", description = "User ID", required = true, schema = @Schema(defaultValue = "1")) @RequestHeader(required=true) Long UserId, + @Parameter(name = "CompanyId", description = "ID of the company to which the user belongs", required = false, schema = @Schema(defaultValue = "1")) @RequestHeader(required=true) Long CompanyId, + @Parameter(name = "LanguageType", description = "Language type (0: Chinese, 1: English, 2: Japanese)", required = true, schema = @Schema(defaultValue = "2")) @RequestHeader(required=true) Integer LanguageType){ + return levelHierarchyRoleService.edit(optLevelHierarchyRoleParam, CompanyId, UserId, LanguageType); + } + + @OperationLog(operation = "deleteLevelHierarchyRole", remark = "") + @Operation(summary = "删除角色") + @RequestMapping(value = "/batchDelete",method = RequestMethod.POST) + public SimpleDataResponse batchDelete( + @RequestBody DeleteLevelHierarchyRoleParam deleteLevelHierarchyRoleParam, + @Parameter(name = "LoginName", description = "Login name", required = true, schema = @Schema(defaultValue = "admin")) @RequestHeader(required=true) String LoginName, + @Parameter(name = "AccessToken", description = "Authentication token", required = true) @RequestHeader(required=true) String AccessToken, + @Parameter(name = "UserId", description = "User ID", required = true, schema = @Schema(defaultValue = "1")) @RequestHeader(required=true) Long UserId, + @Parameter(name = "CompanyId", description = "ID of the company to which the user belongs", required = false, schema = @Schema(defaultValue = "1")) @RequestHeader(required=true) Long CompanyId, + @Parameter(name = "LanguageType", description = "Language type (0: Chinese, 1: English, 2: Japanese)", required = true, schema = @Schema(defaultValue = "2")) @RequestHeader(required=true) Integer LanguageType){ + return levelHierarchyRoleService.batchDelete(deleteLevelHierarchyRoleParam, CompanyId, UserId, LanguageType); + } + + @OperationLog(operation = "queryLevelHierarchyRole", remark = "") + @Operation(summary = "获取角色列表") + @RequestMapping(value = "/getListPage",method = RequestMethod.GET) + public PageResponse> getListPage( + @Parameter(name = "LoginName", description = "Login name", required = true, schema = @Schema(defaultValue = "admin")) @RequestHeader(required=true) String LoginName, + @Parameter(name = "AccessToken", description = "Authentication token", required = true) @RequestHeader(required=true) String AccessToken, + @Parameter(name = "UserId", description = "User ID", required = true, schema = @Schema(defaultValue = "1")) @RequestHeader(required=true) Long UserId, + @Parameter(name = "CompanyId", description = "ID of the company to which the user belongs", required = false, schema = @Schema(defaultValue = "1")) @RequestHeader(required=false) Long CompanyId, + @Parameter(name = "LanguageType", description = "Language type (0: Chinese, 1: English, 2: Japanese)", required = true, schema = @Schema(defaultValue = "2")) @RequestHeader(required=true) Integer LanguageType, + PageLevelHierarchyRoleSearchParam pageSearchParam + ) throws BusinessException { + + pageSearchParam.setUserId(UserId); +// pageSearchParam.setCompanyId(CompanyId); + PageResponse> pageResponse = new PageResponse>(); + try{ + pageResponse.setData(levelHierarchyRoleService.getListPage(pageSearchParam, CompanyId, UserId, LanguageType)); + pageResponse.setCode(ResponseCode.SUCCESS); + pageResponse.setMsg("success"); + }catch (Exception e){ + logger.error("查询列表报错",e); + pageResponse.setCode(ResponseCode.SERVER_ERROR); + pageResponse.setMsg("service error"); + } + return pageResponse; + } + +// @Hidden + @GetMapping("/tree/{roleId}") + @Operation(summary = "查询指定层级角色对应的物件树结构") + public SimpleDataResponse> getHierarchyTree( + @PathVariable("roleId") Long roleId, + @Parameter(name = "LoginName", description = "Login name", required = true, schema = @Schema(defaultValue = "admin")) @RequestHeader(required=true) String LoginName, + @Parameter(name = "AccessToken", description = "Authentication token", required = true) @RequestHeader(required=true) String AccessToken, + @Parameter(name = "UserId", description = "User ID", required = true, schema = @Schema(defaultValue = "1")) @RequestHeader(required=true) Long UserId, + @Parameter(name = "CompanyId", description = "ID of the company to which the user belongs", required = false, schema = @Schema(defaultValue = "1")) @RequestHeader(required=false) Long CompanyId, + @Parameter(name = "LanguageType", description = "Language type (0: Chinese, 1: English, 2: Japanese)", required = true, schema = @Schema(defaultValue = "2")) @RequestHeader(required=true) Integer LanguageType + ) { + return levelHierarchyRoleService.getHierarchyTree(roleId, CompanyId, UserId, LanguageType); + } + +} diff --git a/dongjian-dashboard-back-controller/src/main/java/com/dongjian/dashboard/back/controller/MonitoringPointCategoryController.java b/dongjian-dashboard-back-controller/src/main/java/com/dongjian/dashboard/back/controller/MonitoringPointCategoryController.java new file mode 100644 index 0000000..5aadc60 --- /dev/null +++ b/dongjian-dashboard-back-controller/src/main/java/com/dongjian/dashboard/back/controller/MonitoringPointCategoryController.java @@ -0,0 +1,105 @@ +package com.dongjian.dashboard.back.controller; + +import com.dongjian.dashboard.back.common.exception.BusinessException; +import com.dongjian.dashboard.back.common.response.PageInfo; +import com.dongjian.dashboard.back.common.response.PageResponse; +import com.dongjian.dashboard.back.common.response.ResponseCode; +import com.dongjian.dashboard.back.common.response.SimpleDataResponse; +import com.dongjian.dashboard.back.configurator.aspect.OperationLog; +import com.dongjian.dashboard.back.configurator.interceptor.AccessRequired; +import com.dongjian.dashboard.back.dto.monitoringpointcategory.*; +import com.dongjian.dashboard.back.service.MonitoringPointCategoryService; +import com.dongjian.dashboard.back.vo.monitoringpointcategory.MonitoringPointCategoryPageVO; +import io.swagger.v3.oas.annotations.Hidden; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.tags.Tag; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + + +@RestController +@AccessRequired +@RequestMapping("/monitoringPointCategory") +@Tag(name = "监视点分类相关接口", description = "监视点分类相关接口") +@SuppressWarnings("unchecked") +public class MonitoringPointCategoryController { + + private static final Logger logger = LoggerFactory.getLogger(MonitoringPointCategoryController.class); + + @Autowired + private MonitoringPointCategoryService monitoringPointCategoryService; + + @Hidden + @OperationLog(operation = "addMonitoringPointCategory", remark = "") + @Operation(summary = "Add monitoringPointCategory") + @RequestMapping(value = "/add", method = RequestMethod.POST) + public SimpleDataResponse add( + @RequestBody OptMonitoringPointCategoryParams optMonitoringPointCategoryParams, + @Parameter(name = "LoginName", description = "Login name", required = true, schema = @Schema(defaultValue = "admin")) @RequestHeader(required = true) String LoginName, + @Parameter(name = "AccessToken", description = "Authentication token", required = true) @RequestHeader(required = true) String AccessToken, + @Parameter(name = "UserId", description = "User ID", required = true, schema = @Schema(defaultValue = "1")) @RequestHeader(required = true) Long UserId, + @Parameter(name = "CompanyId", description = "User's company ID", required = false, schema = @Schema(defaultValue = "1")) @RequestHeader(required = false) Long CompanyId, + @Parameter(name = "LanguageType", description = "Language type: 0 - Chinese, 1 - English, 2 - Japanese", required = true, schema = @Schema(defaultValue = "2")) @RequestHeader(required = true) Integer LanguageType) { + return monitoringPointCategoryService.add(optMonitoringPointCategoryParams, UserId, CompanyId, LanguageType); + } + + @Hidden + @OperationLog(operation = "editMonitoringPointCategory", remark = "") + @Operation(summary = "Edit monitoringPointCategory") + @RequestMapping(value = "/edit", method = RequestMethod.POST) + public SimpleDataResponse edit( + @RequestBody OptMonitoringPointCategoryParams optMonitoringPointCategoryParams, + @Parameter(name = "LoginName", description = "Login name", required = true, schema = @Schema(defaultValue = "admin")) @RequestHeader(required = true) String LoginName, + @Parameter(name = "AccessToken", description = "Authentication token", required = true) @RequestHeader(required = true) String AccessToken, + @Parameter(name = "UserId", description = "User ID", required = true, schema = @Schema(defaultValue = "1")) @RequestHeader(required = true) Long UserId, + @Parameter(name = "CompanyId", description = "User's company ID", required = false, schema = @Schema(defaultValue = "1")) @RequestHeader(required = false) Long CompanyId, + @Parameter(name = "LanguageType", description = "Language type: 0 - Chinese, 1 - English, 2 - Japanese", required = true, schema = @Schema(defaultValue = "2")) @RequestHeader(required = true) Integer LanguageType) { + return monitoringPointCategoryService.edit(optMonitoringPointCategoryParams, UserId, CompanyId, LanguageType); + } + + @Hidden + @OperationLog(operation = "deleteMonitoringPointCategory", remark = "") + @Operation(summary = "Delete monitoringPointCategory") + @RequestMapping(value = "/batchDelete", method = RequestMethod.POST) + public SimpleDataResponse batchDelete( + @RequestBody DeleteMonitoringPointCategoryParams deleteMonitoringPointCategoryParams, + @Parameter(name = "LoginName", description = "Login name", required = true, schema = @Schema(defaultValue = "admin")) @RequestHeader(required = true) String LoginName, + @Parameter(name = "AccessToken", description = "Authentication token", required = true) @RequestHeader(required = true) String AccessToken, + @Parameter(name = "UserId", description = "User ID", required = true, schema = @Schema(defaultValue = "1")) @RequestHeader(required = true) Long UserId, + @Parameter(name = "CompanyId", description = "User's company ID", required = false, schema = @Schema(defaultValue = "1")) @RequestHeader(required = false) Long CompanyId, + @Parameter(name = "LanguageType", description = "Language type: 0 - Chinese, 1 - English, 2 - Japanese", required = true, schema = @Schema(defaultValue = "2")) @RequestHeader(required = true) Integer LanguageType) { + return monitoringPointCategoryService.batchDelete(deleteMonitoringPointCategoryParams, UserId, CompanyId, LanguageType); + } + + @OperationLog(operation = "queryMonitoringPointCategory", remark = "") + @Operation(summary = "Get monitoringPointCategory list") + @RequestMapping(value = "/getListPage", method = RequestMethod.GET) + public PageResponse> getListPage( + @Parameter(name = "LoginName", description = "Login name", required = true, schema = @Schema(defaultValue = "admin")) @RequestHeader(required = true) String LoginName, + @Parameter(name = "AccessToken", description = "Authentication token", required = true) @RequestHeader(required = true) String AccessToken, + @Parameter(name = "UserId", description = "User ID", required = true, schema = @Schema(defaultValue = "1")) @RequestHeader(required = true) Long UserId, + @Parameter(name = "CompanyId", description = "User's company ID", required = false, schema = @Schema(defaultValue = "1")) @RequestHeader(required = false) Long CompanyId, + @Parameter(name = "LanguageType", description = "Language type: 0 - Chinese, 1 - English, 2 - Japanese", required = true, schema = @Schema(defaultValue = "2")) @RequestHeader(required = true) Integer LanguageType, + @Parameter(name = "UTCOffset", description = "Time zone offset in minutes from GMT, e.g., +480 for UTC+8", required = true, schema = @Schema(defaultValue = "-480")) @RequestHeader(required = true) Integer UTCOffset, + MonitoringPointCategorySearchParams pageSearchParam) throws BusinessException { + + pageSearchParam.setUserId(UserId); + + PageResponse> pageResponse = new PageResponse<>(); + try { + pageResponse.setData(monitoringPointCategoryService.getListPage(pageSearchParam, CompanyId, UserId, LanguageType, UTCOffset)); + pageResponse.setCode(ResponseCode.SUCCESS); + pageResponse.setMsg("success"); + } catch (Exception e) { + logger.error("Error querying list", e); + pageResponse.setCode(ResponseCode.SERVER_ERROR); + pageResponse.setMsg("service error"); + } + return pageResponse; + } + +} diff --git a/dongjian-dashboard-back-controller/src/main/java/com/dongjian/dashboard/back/controller/MonitoringPointCategoryGroupController.java b/dongjian-dashboard-back-controller/src/main/java/com/dongjian/dashboard/back/controller/MonitoringPointCategoryGroupController.java new file mode 100644 index 0000000..1716af1 --- /dev/null +++ b/dongjian-dashboard-back-controller/src/main/java/com/dongjian/dashboard/back/controller/MonitoringPointCategoryGroupController.java @@ -0,0 +1,158 @@ +package com.dongjian.dashboard.back.controller; + +import com.dongjian.dashboard.back.common.exception.BusinessException; +import com.dongjian.dashboard.back.common.response.PageInfo; +import com.dongjian.dashboard.back.common.response.PageResponse; +import com.dongjian.dashboard.back.common.response.ResponseCode; +import com.dongjian.dashboard.back.common.response.SimpleDataResponse; +import com.dongjian.dashboard.back.configurator.aspect.OperationLog; +import com.dongjian.dashboard.back.configurator.interceptor.AccessRequired; +import com.dongjian.dashboard.back.dto.monitoringpointcategorygroup.*; +import com.dongjian.dashboard.back.service.MonitoringPointCategoryGroupService; +import com.dongjian.dashboard.back.vo.device.DeviceVO; +import com.dongjian.dashboard.back.vo.monitoringpointcategory.MonitoringPointCategoryPageVO; +import com.dongjian.dashboard.back.vo.monitoringpointcategorygroup.MonitoringPointCategoryGroupPageVO; +import io.swagger.v3.oas.annotations.Hidden; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.tags.Tag; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.List; + + +@RestController +@AccessRequired +@RequestMapping("/monitoringPointCategoryGroup") +@Tag(name = "监视点分类组别相关接口", description = "监视点分类组别相关接口") +@SuppressWarnings("unchecked") +public class MonitoringPointCategoryGroupController { + + private static final Logger logger = LoggerFactory.getLogger(MonitoringPointCategoryGroupController.class); + + @Autowired + private MonitoringPointCategoryGroupService monitoringPointCategoryGroupService; + + @OperationLog(operation = "addMonitoringPointCategoryGroup", remark = "") + @Operation(summary = "Add monitoring point category group") + @RequestMapping(value = "/add", method = RequestMethod.POST) + public SimpleDataResponse add( + @RequestBody OptMonitoringPointCategoryGroupParams optMonitoringPointCategoryGroupParams, + @Parameter(name = "LoginName", description = "Login name", required = true, schema = @Schema(defaultValue = "admin")) @RequestHeader(required = true) String LoginName, + @Parameter(name = "AccessToken", description = "Authentication token", required = true) @RequestHeader(required = true) String AccessToken, + @Parameter(name = "UserId", description = "User ID", required = true, schema = @Schema(defaultValue = "1")) @RequestHeader(required = true) Long UserId, + @Parameter(name = "CompanyId", description = "User's company ID", required = false, schema = @Schema(defaultValue = "1")) @RequestHeader(required = false) Long CompanyId, + @Parameter(name = "LanguageType", description = "Language type: 0 - Chinese, 1 - English, 2 - Japanese", required = true, schema = @Schema(defaultValue = "2")) @RequestHeader(required = true) Integer LanguageType) { + return monitoringPointCategoryGroupService.add(optMonitoringPointCategoryGroupParams, UserId, CompanyId, LanguageType); + } + + @OperationLog(operation = "editMonitoringPointCategoryGroup", remark = "") + @Operation(summary = "Edit monitoring point category group") + @RequestMapping(value = "/edit", method = RequestMethod.POST) + public SimpleDataResponse edit( + @RequestBody OptMonitoringPointCategoryGroupParams optMonitoringPointCategoryGroupParams, + @Parameter(name = "LoginName", description = "Login name", required = true, schema = @Schema(defaultValue = "admin")) @RequestHeader(required = true) String LoginName, + @Parameter(name = "AccessToken", description = "Authentication token", required = true) @RequestHeader(required = true) String AccessToken, + @Parameter(name = "UserId", description = "User ID", required = true, schema = @Schema(defaultValue = "1")) @RequestHeader(required = true) Long UserId, + @Parameter(name = "CompanyId", description = "User's company ID", required = false, schema = @Schema(defaultValue = "1")) @RequestHeader(required = false) Long CompanyId, + @Parameter(name = "LanguageType", description = "Language type: 0 - Chinese, 1 - English, 2 - Japanese", required = true, schema = @Schema(defaultValue = "2")) @RequestHeader(required = true) Integer LanguageType) { + return monitoringPointCategoryGroupService.edit(optMonitoringPointCategoryGroupParams, UserId, CompanyId, LanguageType); + } + + @OperationLog(operation = "deleteMonitoringPointCategoryGroup", remark = "") + @Operation(summary = "Delete monitoring point category group") + @RequestMapping(value = "/batchDelete", method = RequestMethod.POST) + public SimpleDataResponse batchDelete( + @RequestBody DeleteMonitoringPointCategoryGroupParams deleteMonitoringPointCategoryGroupParams, + @Parameter(name = "LoginName", description = "Login name", required = true, schema = @Schema(defaultValue = "admin")) @RequestHeader(required = true) String LoginName, + @Parameter(name = "AccessToken", description = "Authentication token", required = true) @RequestHeader(required = true) String AccessToken, + @Parameter(name = "UserId", description = "User ID", required = true, schema = @Schema(defaultValue = "1")) @RequestHeader(required = true) Long UserId, + @Parameter(name = "CompanyId", description = "User's company ID", required = false, schema = @Schema(defaultValue = "1")) @RequestHeader(required = false) Long CompanyId, + @Parameter(name = "LanguageType", description = "Language type: 0 - Chinese, 1 - English, 2 - Japanese", required = true, schema = @Schema(defaultValue = "2")) @RequestHeader(required = true) Integer LanguageType) { + return monitoringPointCategoryGroupService.batchDelete(deleteMonitoringPointCategoryGroupParams, UserId, CompanyId, LanguageType); + } + + @OperationLog(operation = "queryMonitoringPointCategoryGroup", remark = "") + @Operation(summary = "Get monitoring point category group list") + @RequestMapping(value = "/getListPage", method = RequestMethod.GET) + public PageResponse> getListPage( + @Parameter(name = "LoginName", description = "Login name", required = true, schema = @Schema(defaultValue = "admin")) @RequestHeader(required = true) String LoginName, + @Parameter(name = "AccessToken", description = "Authentication token", required = true) @RequestHeader(required = true) String AccessToken, + @Parameter(name = "UserId", description = "User ID", required = true, schema = @Schema(defaultValue = "1")) @RequestHeader(required = true) Long UserId, + @Parameter(name = "CompanyId", description = "User's company ID", required = false, schema = @Schema(defaultValue = "1")) @RequestHeader(required = false) Long CompanyId, + @Parameter(name = "LanguageType", description = "Language type: 0 - Chinese, 1 - English, 2 - Japanese", required = true, schema = @Schema(defaultValue = "2")) @RequestHeader(required = true) Integer LanguageType, + @Parameter(name = "UTCOffset", description = "Time zone offset in minutes from GMT, e.g., +480 for UTC+8", required = true, schema = @Schema(defaultValue = "-480")) @RequestHeader(required = true) Integer UTCOffset, + MonitoringPointCategoryGroupSearchParams pageSearchParam) throws BusinessException { + + pageSearchParam.setUserId(UserId); + + PageResponse> pageResponse = new PageResponse<>(); + try { + pageResponse.setData(monitoringPointCategoryGroupService.getListPage(pageSearchParam, CompanyId, UserId, LanguageType, UTCOffset)); + pageResponse.setCode(ResponseCode.SUCCESS); + pageResponse.setMsg("success"); + } catch (Exception e) { + logger.error("Error querying list", e); + pageResponse.setCode(ResponseCode.SERVER_ERROR); + pageResponse.setMsg("service error"); + } + return pageResponse; + } + + @Hidden + @OperationLog(operation = "bindGroupForCategory", remark = "") + @Operation(summary = "给分类绑定监视点分类组") + @RequestMapping(value = "/bindGroupForCategory", method = RequestMethod.POST) + public SimpleDataResponse bindGroupForDevice( + @RequestBody BindGroupForCategoryParams bindGroupForCategoryParams, + @Parameter(name = "LoginName", description = "Login name", required = true, schema = @Schema(defaultValue = "admin")) @RequestHeader(required = true) String LoginName, + @Parameter(name = "AccessToken", description = "Authentication token", required = true) @RequestHeader(required = true) String AccessToken, + @Parameter(name = "UserId", description = "User ID", required = true, schema = @Schema(defaultValue = "1")) @RequestHeader(required = true) Long UserId, + @Parameter(name = "CompanyId", description = "User's company ID", required = false, schema = @Schema(defaultValue = "1")) @RequestHeader(required = false) Long CompanyId, + @Parameter(name = "LanguageType", description = "Language type: 0 - Chinese, 1 - English, 2 - Japanese", required = true, schema = @Schema(defaultValue = "2")) @RequestHeader(required = true) Integer LanguageType) { + return monitoringPointCategoryGroupService.bindGroupForCategory(bindGroupForCategoryParams, UserId, CompanyId, LanguageType); + } + + @OperationLog(operation = "bindCategoryForGroup", remark = "") + @Operation(summary = "给监视点分类组设置绑定的分类") + @RequestMapping(value = "/bindCategoryForGroup", method = RequestMethod.POST) + public SimpleDataResponse bindDeviceForGroup( + @RequestBody BindCategoryForGroupParams bindCategoryForGroupParams, + @Parameter(name = "LoginName", description = "Login name", required = true, schema = @Schema(defaultValue = "admin")) @RequestHeader(required = true) String LoginName, + @Parameter(name = "AccessToken", description = "Authentication token", required = true) @RequestHeader(required = true) String AccessToken, + @Parameter(name = "UserId", description = "User ID", required = true, schema = @Schema(defaultValue = "1")) @RequestHeader(required = true) Long UserId, + @Parameter(name = "CompanyId", description = "User's company ID", required = false, schema = @Schema(defaultValue = "1")) @RequestHeader(required = false) Long CompanyId, + @Parameter(name = "LanguageType", description = "Language type: 0 - Chinese, 1 - English, 2 - Japanese", required = true, schema = @Schema(defaultValue = "2")) @RequestHeader(required = true) Integer LanguageType) { + return monitoringPointCategoryGroupService.bindCategoryForGroup(bindCategoryForGroupParams, UserId, CompanyId, LanguageType); + } + + @Hidden + @Operation(summary = "根据分类主键ID获取绑定的监视点分类组") + @RequestMapping(value = "/getBindedGroupByCategory/{monitoringPointCategoryId}", method = RequestMethod.GET) + public SimpleDataResponse> getBindedGroupByDevice( + @PathVariable Long monitoringPointCategoryId, + @Parameter(name = "LoginName", description = "Login name", required = true, schema = @Schema(defaultValue = "admin")) @RequestHeader(required = true) String LoginName, + @Parameter(name = "AccessToken", description = "Authentication token", required = true) @RequestHeader(required = true) String AccessToken, + @Parameter(name = "UserId", description = "User ID", required = true, schema = @Schema(defaultValue = "1")) @RequestHeader(required = true) Long UserId, + @Parameter(name = "CompanyId", description = "User's company ID", required = false, schema = @Schema(defaultValue = "1")) @RequestHeader(required = false) Long CompanyId, + @Parameter(name = "LanguageType", description = "Language type: 0 - Chinese, 1 - English, 2 - Japanese", required = true, schema = @Schema(defaultValue = "2")) @RequestHeader(required = true) Integer LanguageType) { + return monitoringPointCategoryGroupService.getBindedGroupByCategory(monitoringPointCategoryId, UserId, CompanyId, LanguageType); + } + + @Operation(summary = "根据监视点分类组ID获取绑定的分类") + @RequestMapping(value = "/getBindedCategoryByGroup/{monitoringPointCategoryGroupId}", method = RequestMethod.GET) + public SimpleDataResponse> getBindedDeviceByGroup( + @PathVariable Long monitoringPointCategoryGroupId, + @Parameter(name = "LoginName", description = "Login name", required = true, schema = @Schema(defaultValue = "admin")) @RequestHeader(required = true) String LoginName, + @Parameter(name = "AccessToken", description = "Authentication token", required = true) @RequestHeader(required = true) String AccessToken, + @Parameter(name = "UserId", description = "User ID", required = true, schema = @Schema(defaultValue = "1")) @RequestHeader(required = true) Long UserId, + @Parameter(name = "CompanyId", description = "User's company ID", required = false, schema = @Schema(defaultValue = "1")) @RequestHeader(required = false) Long CompanyId, + @Parameter(name = "LanguageType", description = "Language type: 0 - Chinese, 1 - English, 2 - Japanese", required = true, schema = @Schema(defaultValue = "2")) @RequestHeader(required = true) Integer LanguageType) { + return monitoringPointCategoryGroupService.getBindedCategoryByGroup(monitoringPointCategoryGroupId, UserId, CompanyId, LanguageType); + } + +} diff --git a/dongjian-dashboard-back-controller/src/main/java/com/dongjian/dashboard/back/controller/NotificationConfigController.java b/dongjian-dashboard-back-controller/src/main/java/com/dongjian/dashboard/back/controller/NotificationConfigController.java new file mode 100644 index 0000000..72a1529 --- /dev/null +++ b/dongjian-dashboard-back-controller/src/main/java/com/dongjian/dashboard/back/controller/NotificationConfigController.java @@ -0,0 +1,182 @@ +package com.dongjian.dashboard.back.controller; + +import com.dongjian.dashboard.back.configurator.aspect.OperationLog; +import io.swagger.v3.oas.annotations.Hidden; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import com.dongjian.dashboard.back.common.exception.BusinessException; +import com.dongjian.dashboard.back.common.response.PageInfo; +import com.dongjian.dashboard.back.common.response.PageResponse; +import com.dongjian.dashboard.back.common.response.ResponseCode; +import com.dongjian.dashboard.back.common.response.SimpleDataResponse; +import com.dongjian.dashboard.back.configurator.interceptor.AccessRequired; +import com.dongjian.dashboard.back.dto.notificationconfig.DeleteSlackParams; +import com.dongjian.dashboard.back.dto.notificationconfig.DeleteTeamsParams; +import com.dongjian.dashboard.back.dto.notificationconfig.OptSlackParams; +import com.dongjian.dashboard.back.dto.notificationconfig.OptTeamsParams; +import com.dongjian.dashboard.back.dto.notificationconfig.SlackSearchParams; +import com.dongjian.dashboard.back.dto.notificationconfig.TeamsSearchParams; +import com.dongjian.dashboard.back.service.NotificationConfigService; +import com.dongjian.dashboard.back.vo.notificationconfig.SlackPageVO; +import com.dongjian.dashboard.back.vo.notificationconfig.TeamsPageVO; + + +/** + * + * @author jwy-style + * + */ +@Hidden +@RestController +@AccessRequired +@RequestMapping("/notificationConfig") +@Tag(name = "slack、teams等通知设置",description = "slack、teams等通知设置") +@SuppressWarnings("unchecked") +public class NotificationConfigController { + + private static Logger logger = LoggerFactory.getLogger(NotificationConfigController.class); + + @Autowired + private NotificationConfigService notificationConfigService; + + @OperationLog(operation = "addSlack", remark = "") + @Operation(summary = "Add slack") + @RequestMapping(value = "/slack/add", method = RequestMethod.POST) + public SimpleDataResponse add( + @RequestBody OptSlackParams optSlackParams, + @Parameter(name="LoginName", description ="Login name", required=true, schema = @Schema(defaultValue = "admin")) @RequestHeader(required=true) String LoginName, + @Parameter(name="AccessToken", description ="Authentication token", required=true) @RequestHeader(required=true) String AccessToken, + @Parameter(name="UserId", description ="User ID", required=true, schema = @Schema(defaultValue = "1")) @RequestHeader(required=true) Long UserId, + @Parameter(name="CompanyId", description ="User's company ID", required=false, schema = @Schema(defaultValue = "1")) @RequestHeader(required=false) Long CompanyId, + @Parameter(name="LanguageType", description ="Language type: 0 - Chinese, 1 - English, 2 - Japanese", required=true, schema = @Schema(defaultValue = "2")) @RequestHeader(required=true) Integer LanguageType) { + return notificationConfigService.add(optSlackParams, UserId, CompanyId, LanguageType); + } + + @OperationLog(operation = "editSlack", remark = "") + @Operation(summary = "Edit notificationConfig") + @RequestMapping(value = "/slack/edit", method = RequestMethod.POST) + public SimpleDataResponse edit( + @RequestBody OptSlackParams optSlackParams, + @Parameter(name="LoginName", description ="Login name", required=true, schema = @Schema(defaultValue = "admin")) @RequestHeader(required=true) String LoginName, + @Parameter(name="AccessToken", description ="Authentication token", required=true) @RequestHeader(required=true) String AccessToken, + @Parameter(name="UserId", description ="User ID", required=true, schema = @Schema(defaultValue = "1")) @RequestHeader(required=true) Long UserId, + @Parameter(name="CompanyId", description ="User's company ID", required=false, schema = @Schema(defaultValue = "1")) @RequestHeader(required=false) Long CompanyId, + @Parameter(name="LanguageType", description ="Language type: 0 - Chinese, 1 - English, 2 - Japanese", required=true, schema = @Schema(defaultValue = "2")) @RequestHeader(required=true) Integer LanguageType) { + return notificationConfigService.edit(optSlackParams, UserId, CompanyId, LanguageType); + } + + @OperationLog(operation = "deleteSlack", remark = "") + @Operation(summary = "Delete notificationConfig") + @RequestMapping(value = "/slack/batchDelete", method = RequestMethod.POST) + public SimpleDataResponse batchDelete( + @RequestBody DeleteSlackParams deleteSlackParams, + @Parameter(name="LoginName", description ="Login name", required=true, schema = @Schema(defaultValue = "admin")) @RequestHeader(required=true) String LoginName, + @Parameter(name="AccessToken", description ="Authentication token", required=true) @RequestHeader(required=true) String AccessToken, + @Parameter(name="UserId", description ="User ID", required=true, schema = @Schema(defaultValue = "1")) @RequestHeader(required=true) Long UserId, + @Parameter(name="CompanyId", description ="User's company ID", required=false, schema = @Schema(defaultValue = "1")) @RequestHeader(required=false) Long CompanyId, + @Parameter(name="LanguageType", description ="Language type: 0 - Chinese, 1 - English, 2 - Japanese", required=true, schema = @Schema(defaultValue = "2")) @RequestHeader(required=true) Integer LanguageType) { + return notificationConfigService.batchDelete(deleteSlackParams, UserId, CompanyId, LanguageType); + } + + @OperationLog(operation = "querySlack", remark = "") + @Operation(summary = "Get slack list") + @RequestMapping(value = "/slack/getListPage", method = RequestMethod.GET) + public PageResponse> getListPage( + @Parameter(name="LoginName", description ="Login name", required=true, schema = @Schema(defaultValue = "admin")) @RequestHeader(required=true) String LoginName, + @Parameter(name="AccessToken", description ="Authentication token", required=true) @RequestHeader(required=true) String AccessToken, + @Parameter(name="UserId", description ="User ID", required=true, schema = @Schema(defaultValue = "1")) @RequestHeader(required=true) Long UserId, + @Parameter(name="CompanyId", description ="User's company ID", required=false, schema = @Schema(defaultValue = "1")) @RequestHeader(required=false) Long CompanyId, + @Parameter(name="LanguageType", description ="Language type: 0 - Chinese, 1 - English, 2 - Japanese", required=true, schema = @Schema(defaultValue = "2")) @RequestHeader(required=true) Integer LanguageType, + @Parameter(name="UTCOffset", description ="Time zone offset in minutes from GMT, e.g., +480 for UTC+8", required=true, schema = @Schema(defaultValue = "-480")) @RequestHeader(required=true) Integer UTCOffset, + SlackSearchParams pageSearchParam) throws BusinessException { + + pageSearchParam.setUserId(UserId); + + PageResponse> pageResponse = new PageResponse<>(); + try { + pageResponse.setData(notificationConfigService.getListPage(pageSearchParam, CompanyId, UserId, LanguageType, UTCOffset)); + pageResponse.setCode(ResponseCode.SUCCESS); + pageResponse.setMsg("success"); + } catch (Exception e) { + logger.error("Error querying list", e); + pageResponse.setCode(ResponseCode.SERVER_ERROR); + pageResponse.setMsg("service error"); + } + return pageResponse; + } + + + @OperationLog(operation = "addTeams", remark = "") + @Operation(summary = "Add teams") + @RequestMapping(value = "/teams/add", method = RequestMethod.POST) + public SimpleDataResponse add( + @RequestBody OptTeamsParams optTeamsParams, + @Parameter(name="LoginName", description ="Login name", required=true, schema = @Schema(defaultValue = "admin")) @RequestHeader(required=true) String LoginName, + @Parameter(name="AccessToken", description ="Authentication token", required=true) @RequestHeader(required=true) String AccessToken, + @Parameter(name="UserId", description ="User ID", required=true, schema = @Schema(defaultValue = "1")) @RequestHeader(required=true) Long UserId, + @Parameter(name="CompanyId", description ="User's company ID", required=false, schema = @Schema(defaultValue = "1")) @RequestHeader(required=false) Long CompanyId, + @Parameter(name="LanguageType", description ="Language type: 0 - Chinese, 1 - English, 2 - Japanese", required=true, schema = @Schema(defaultValue = "2")) @RequestHeader(required=true) Integer LanguageType) { + return notificationConfigService.add(optTeamsParams, UserId, CompanyId, LanguageType); + } + + @OperationLog(operation = "editTeams", remark = "") + @Operation(summary = "Edit notificationConfig") + @RequestMapping(value = "/teams/edit", method = RequestMethod.POST) + public SimpleDataResponse edit( + @RequestBody OptTeamsParams optTeamsParams, + @Parameter(name="LoginName", description ="Login name", required=true, schema = @Schema(defaultValue = "admin")) @RequestHeader(required=true) String LoginName, + @Parameter(name="AccessToken", description ="Authentication token", required=true) @RequestHeader(required=true) String AccessToken, + @Parameter(name="UserId", description ="User ID", required=true, schema = @Schema(defaultValue = "1")) @RequestHeader(required=true) Long UserId, + @Parameter(name="CompanyId", description ="User's company ID", required=false, schema = @Schema(defaultValue = "1")) @RequestHeader(required=false) Long CompanyId, + @Parameter(name="LanguageType", description ="Language type: 0 - Chinese, 1 - English, 2 - Japanese", required=true, schema = @Schema(defaultValue = "2")) @RequestHeader(required=true) Integer LanguageType) { + return notificationConfigService.edit(optTeamsParams, UserId, CompanyId, LanguageType); + } + + @OperationLog(operation = "deleteTeams", remark = "") + @Operation(summary = "Delete notificationConfig") + @RequestMapping(value = "/teams/batchDelete", method = RequestMethod.POST) + public SimpleDataResponse batchDelete( + @RequestBody DeleteTeamsParams deleteTeamsParams, + @Parameter(name="LoginName", description ="Login name", required=true, schema = @Schema(defaultValue = "admin")) @RequestHeader(required=true) String LoginName, + @Parameter(name="AccessToken", description ="Authentication token", required=true) @RequestHeader(required=true) String AccessToken, + @Parameter(name="UserId", description ="User ID", required=true, schema = @Schema(defaultValue = "1")) @RequestHeader(required=true) Long UserId, + @Parameter(name="CompanyId", description ="User's company ID", required=false, schema = @Schema(defaultValue = "1")) @RequestHeader(required=false) Long CompanyId, + @Parameter(name="LanguageType", description ="Language type: 0 - Chinese, 1 - English, 2 - Japanese", required=true, schema = @Schema(defaultValue = "2")) @RequestHeader(required=true) Integer LanguageType) { + return notificationConfigService.batchDelete(deleteTeamsParams, UserId, CompanyId, LanguageType); + } + + @OperationLog(operation = "queryTeams", remark = "") + @Operation(summary = "Get notificationConfig list") + @RequestMapping(value = "/teams/getListPage", method = RequestMethod.GET) + public PageResponse> getListPage( + @Parameter(name="LoginName", description ="Login name", required=true, schema = @Schema(defaultValue = "admin")) @RequestHeader(required=true) String LoginName, + @Parameter(name="AccessToken", description ="Authentication token", required=true) @RequestHeader(required=true) String AccessToken, + @Parameter(name="UserId", description ="User ID", required=true, schema = @Schema(defaultValue = "1")) @RequestHeader(required=true) Long UserId, + @Parameter(name="CompanyId", description ="User's company ID", required=false, schema = @Schema(defaultValue = "1")) @RequestHeader(required=false) Long CompanyId, + @Parameter(name="LanguageType", description ="Language type: 0 - Chinese, 1 - English, 2 - Japanese", required=true, schema = @Schema(defaultValue = "2")) @RequestHeader(required=true) Integer LanguageType, + @Parameter(name="UTCOffset", description ="Time zone offset in minutes from GMT, e.g., +480 for UTC+8", required=true, schema = @Schema(defaultValue = "-480")) @RequestHeader(required=true) Integer UTCOffset, + TeamsSearchParams pageSearchParam) throws BusinessException { + + pageSearchParam.setUserId(UserId); + + PageResponse> pageResponse = new PageResponse<>(); + try { + pageResponse.setData(notificationConfigService.getListPage(pageSearchParam, CompanyId, UserId, LanguageType, UTCOffset)); + pageResponse.setCode(ResponseCode.SUCCESS); + pageResponse.setMsg("success"); + } catch (Exception e) { + logger.error("Error querying list", e); + pageResponse.setCode(ResponseCode.SERVER_ERROR); + pageResponse.setMsg("service error"); + } + return pageResponse; + } +} diff --git a/dongjian-dashboard-back-controller/src/main/java/com/dongjian/dashboard/back/controller/OperationLogController.java b/dongjian-dashboard-back-controller/src/main/java/com/dongjian/dashboard/back/controller/OperationLogController.java new file mode 100644 index 0000000..4c4ca95 --- /dev/null +++ b/dongjian-dashboard-back-controller/src/main/java/com/dongjian/dashboard/back/controller/OperationLogController.java @@ -0,0 +1,67 @@ +package com.dongjian.dashboard.back.controller; + + +import com.dongjian.dashboard.back.common.exception.BusinessException; +import com.dongjian.dashboard.back.common.response.PageInfo; +import com.dongjian.dashboard.back.common.response.PageResponse; +import com.dongjian.dashboard.back.common.response.ResponseCode; +import com.dongjian.dashboard.back.configurator.aspect.OperationLog; +import com.dongjian.dashboard.back.configurator.interceptor.AccessRequired; +import com.dongjian.dashboard.back.dto.operationlog.LogSearchParam; +import com.dongjian.dashboard.back.service.OperationLogService; +import com.dongjian.dashboard.back.vo.operationlog.OperationLogPageVO; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.tags.Tag; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +/** + * + * @author jwy-style + * + */ +@RestController//代表返回的是json格式的数据,这个注解是Spring4之后新加的注解 +@AccessRequired //注解标识是否需要验证token +@RequestMapping("/operationLog") //http请求路径映射 +@Tag(name = "操作日志的相关接口",description = "操作日志的相关接口") +@SuppressWarnings("unchecked") +public class OperationLogController { + + private static Logger logger = LoggerFactory.getLogger(OperationLogController.class); + + @Autowired + private OperationLogService operationLogService; + + @OperationLog(operation = "queryOperationLog", remark = "") + @Operation(summary = "获取日志列表") + @RequestMapping(value = "/getListPage",method = RequestMethod.GET) + public PageResponse> getListPage( + @Parameter(name = "LoginName", description = "Login name", required = true, schema = @Schema(defaultValue = "admin")) @RequestHeader(required=true) String LoginName, + @Parameter(name = "AccessToken", description = "Authentication token", required = true) @RequestHeader(required=true) String AccessToken, + @Parameter(name = "UserId", description = "User ID", required = true, schema = @Schema(defaultValue = "1")) @RequestHeader(required=true) Long UserId, + @Parameter(name = "CompanyId", description = "ID of the company to which the user belongs", required = false, schema = @Schema(defaultValue = "1")) @RequestHeader(required=false) Long CompanyId, + @Parameter(name = "LanguageType", description = "Language type (0: Chinese, 1: English, 2: Japanese)", required = true, schema = @Schema(defaultValue = "2")) @RequestHeader(required=true) Integer LanguageType, + LogSearchParam pageSearchParam + ) throws BusinessException { + + pageSearchParam.setUserId(UserId); +// pageSearchParam.setCompanyId(CompanyId); + PageResponse> pageResponse = new PageResponse>(); + try{ + pageResponse.setData(operationLogService.getListPage(pageSearchParam, CompanyId, UserId, LanguageType)); + pageResponse.setCode(ResponseCode.SUCCESS); + pageResponse.setMsg("success"); + }catch (Exception e){ + logger.error("查询列表报错",e); + pageResponse.setCode(ResponseCode.SERVER_ERROR); + pageResponse.setMsg("service error"); + } + return pageResponse; + } + + +} diff --git a/dongjian-dashboard-back-controller/src/main/java/com/dongjian/dashboard/back/controller/OverviewController.java b/dongjian-dashboard-back-controller/src/main/java/com/dongjian/dashboard/back/controller/OverviewController.java new file mode 100644 index 0000000..89e908d --- /dev/null +++ b/dongjian-dashboard-back-controller/src/main/java/com/dongjian/dashboard/back/controller/OverviewController.java @@ -0,0 +1,41 @@ +package com.dongjian.dashboard.back.controller; + +import com.dongjian.dashboard.back.common.response.SimpleDataResponse; +import com.dongjian.dashboard.back.configurator.interceptor.AccessRequired; +import com.dongjian.dashboard.back.service.OverviewService; +import com.dongjian.dashboard.back.vo.data.OverviewVO; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.tags.Tag; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.List; + +@RestController +@AccessRequired +@RequestMapping("/overview") +@Tag(name = "概览相关接口", description = "概览相关接口") +@SuppressWarnings("unchecked") +public class OverviewController { + + private static final Logger logger = LoggerFactory.getLogger(OverviewController.class); + + @Autowired + private OverviewService overviewService; + + @Operation(summary = "Get overview information") + @RequestMapping(value = "/getOverviewInfo", method = RequestMethod.GET) + public SimpleDataResponse> getOverviewInfo( + @Parameter(name = "LoginName", description = "Login name", required = true, schema = @Schema(defaultValue = "admin")) @RequestHeader(required = true) String LoginName, + @Parameter(name = "AccessToken", description = "Authentication token", required = true) @RequestHeader(required = true) String AccessToken, + @Parameter(name = "UserId", description = "User ID", required = true, schema = @Schema(defaultValue = "1")) @RequestHeader(required = true) Long UserId, + @Parameter(name = "CompanyId", description = "User's company ID", required = false, schema = @Schema(defaultValue = "1")) @RequestHeader(required = false) Long CompanyId, + @Parameter(name = "LanguageType", description = "Language type: 0 - Chinese, 1 - English, 2 - Japanese", required = true, schema = @Schema(defaultValue = "2")) @RequestHeader(required = true) Integer LanguageType, + @Parameter(name = "UTCOffset", description = "Time zone offset in minutes from GMT, e.g., +480 for UTC+8", required = true, schema = @Schema(defaultValue = "-480")) @RequestHeader(required = true) Integer UTCOffset) { + return overviewService.getOverviewInfo(UserId, CompanyId, LanguageType, UTCOffset); + } +} diff --git a/dongjian-dashboard-back-controller/src/main/java/com/dongjian/dashboard/back/controller/RoleController.java b/dongjian-dashboard-back-controller/src/main/java/com/dongjian/dashboard/back/controller/RoleController.java new file mode 100644 index 0000000..f71b0d6 --- /dev/null +++ b/dongjian-dashboard-back-controller/src/main/java/com/dongjian/dashboard/back/controller/RoleController.java @@ -0,0 +1,137 @@ +package com.dongjian.dashboard.back.controller; + + +import com.dongjian.dashboard.back.common.exception.BusinessException; +import com.dongjian.dashboard.back.common.response.PageInfo; +import com.dongjian.dashboard.back.common.response.PageResponse; +import com.dongjian.dashboard.back.common.response.ResponseCode; +import com.dongjian.dashboard.back.common.response.SimpleDataResponse; +import com.dongjian.dashboard.back.configurator.aspect.OperationLog; +import com.dongjian.dashboard.back.configurator.interceptor.AccessRequired; +import com.dongjian.dashboard.back.dto.role.DeleteRoleParam; +import com.dongjian.dashboard.back.dto.role.OptRoleParam; +import com.dongjian.dashboard.back.dto.role.PageSearchParam; +import com.dongjian.dashboard.back.vo.TreeMenusDTO; +import com.dongjian.dashboard.back.vo.role.RolePageDTO; +import com.dongjian.dashboard.back.service.RoleService; + +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; + +import java.util.List; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +/** + * + * @author jwy-style + * + */ +@RestController//代表返回的是json格式的数据,这个注解是Spring4之后新加的注解 +@AccessRequired //注解标识是否需要验证token +@RequestMapping("/role") //http请求路径映射 +@Tag(name = "角色权限的相关接口",description = "角色权限的相关接口") +@SuppressWarnings("unchecked") +public class RoleController { + + private static Logger logger = LoggerFactory.getLogger(RoleController.class); + + @Autowired + private RoleService roleService; + + + @OperationLog(operation = "addRole", remark = "") + @Operation(summary = "添加角色") + @RequestMapping(value = "/add",method = RequestMethod.POST) + public SimpleDataResponse add( + @RequestBody OptRoleParam optRoleParam, + @Parameter(name = "LoginName", description = "Login name", required = true, schema = @Schema(defaultValue = "admin")) @RequestHeader(required=true) String LoginName, + @Parameter(name = "AccessToken", description = "Authentication token", required = true) @RequestHeader(required=true) String AccessToken, + @Parameter(name = "UserId", description = "User ID", required = true, schema = @Schema(defaultValue = "1")) @RequestHeader(required=true) Long UserId, + @Parameter(name = "CompanyId", description = "ID of the company to which the user belongs", required = false, schema = @Schema(defaultValue = "1")) @RequestHeader(required=true) Long CompanyId, + @Parameter(name = "LanguageType", description = "Language type (0: Chinese, 1: English, 2: Japanese)", required = true, schema = @Schema(defaultValue = "2")) @RequestHeader(required=true) Integer LanguageType){ + return roleService.add(optRoleParam, CompanyId, UserId, LanguageType); + } + + @OperationLog(operation = "editRole", remark = "") + @Operation(summary = "编辑角色") + @RequestMapping(value = "/edit",method = RequestMethod.POST) + public SimpleDataResponse edit( + @RequestBody OptRoleParam optRoleParam, + @Parameter(name = "LoginName", description = "Login name", required = true, schema = @Schema(defaultValue = "admin")) @RequestHeader(required=true) String LoginName, + @Parameter(name = "AccessToken", description = "Authentication token", required = true) @RequestHeader(required=true) String AccessToken, + @Parameter(name = "UserId", description = "User ID", required = true, schema = @Schema(defaultValue = "1")) @RequestHeader(required=true) Long UserId, + @Parameter(name = "CompanyId", description = "ID of the company to which the user belongs", required = false, schema = @Schema(defaultValue = "1")) @RequestHeader(required=true) Long CompanyId, + @Parameter(name = "LanguageType", description = "Language type (0: Chinese, 1: English, 2: Japanese)", required = true, schema = @Schema(defaultValue = "2")) @RequestHeader(required=true) Integer LanguageType){ + return roleService.edit(optRoleParam, CompanyId, UserId, LanguageType); + } + + @OperationLog(operation = "deleteRole", remark = "") + @Operation(summary = "删除角色") + @RequestMapping(value = "/batchDelete",method = RequestMethod.POST) + public SimpleDataResponse batchDelete( + @RequestBody DeleteRoleParam deleteRoleParam, + @Parameter(name = "LoginName", description = "Login name", required = true, schema = @Schema(defaultValue = "admin")) @RequestHeader(required=true) String LoginName, + @Parameter(name = "AccessToken", description = "Authentication token", required = true) @RequestHeader(required=true) String AccessToken, + @Parameter(name = "UserId", description = "User ID", required = true, schema = @Schema(defaultValue = "1")) @RequestHeader(required=true) Long UserId, + @Parameter(name = "CompanyId", description = "ID of the company to which the user belongs", required = false, schema = @Schema(defaultValue = "1")) @RequestHeader(required=true) Long CompanyId, + @Parameter(name = "LanguageType", description = "Language type (0: Chinese, 1: English, 2: Japanese)", required = true, schema = @Schema(defaultValue = "2")) @RequestHeader(required=true) Integer LanguageType){ + return roleService.batchDelete(deleteRoleParam, CompanyId, UserId, LanguageType); + } + + @OperationLog(operation = "queryRole", remark = "") + @Operation(summary = "获取角色列表") + @RequestMapping(value = "/getListPage",method = RequestMethod.GET) + public PageResponse> getListPage( + @Parameter(name = "LoginName", description = "Login name", required = true, schema = @Schema(defaultValue = "admin")) @RequestHeader(required=true) String LoginName, + @Parameter(name = "AccessToken", description = "Authentication token", required = true) @RequestHeader(required=true) String AccessToken, + @Parameter(name = "UserId", description = "User ID", required = true, schema = @Schema(defaultValue = "1")) @RequestHeader(required=true) Long UserId, + @Parameter(name = "CompanyId", description = "ID of the company to which the user belongs", required = false, schema = @Schema(defaultValue = "1")) @RequestHeader(required=false) Long CompanyId, + @Parameter(name = "LanguageType", description = "Language type (0: Chinese, 1: English, 2: Japanese)", required = true, schema = @Schema(defaultValue = "2")) @RequestHeader(required=true) Integer LanguageType, + PageSearchParam pageSearchParam + ) throws BusinessException { + + pageSearchParam.setUserId(UserId); +// pageSearchParam.setCompanyId(CompanyId); + PageResponse> pageResponse = new PageResponse>(); + try{ + pageResponse.setData(roleService.getListPage(pageSearchParam, CompanyId, UserId, LanguageType)); + pageResponse.setCode(ResponseCode.SUCCESS); + pageResponse.setMsg("success"); + }catch (Exception e){ + logger.error("查询列表报错",e); + pageResponse.setCode(ResponseCode.SERVER_ERROR); + pageResponse.setMsg("service error"); + } + return pageResponse; + } + + @Operation(summary = "获取当前登录用户拥有的权限菜单树") + @RequestMapping(value = "/getOwnMenuIds",method = RequestMethod.GET) + public SimpleDataResponse> getOwnMenuIds( + @Parameter(name = "LoginName", description = "Login name", required = true, schema = @Schema(defaultValue = "admin")) @RequestHeader(required=true) String LoginName, + @Parameter(name = "AccessToken", description = "Authentication token", required = true) @RequestHeader(required=true) String AccessToken, + @Parameter(name = "UserId", description = "User ID", required = true, schema = @Schema(defaultValue = "1")) @RequestHeader(required=true) Long UserId, + @Parameter(name = "CompanyId", description = "ID of the company to which the user belongs", required = false, schema = @Schema(defaultValue = "1")) @RequestHeader(required=true) Long CompanyId, + @Parameter(name = "LanguageType", description = "Language type (0: Chinese, 1: English, 2: Japanese)", required = true, schema = @Schema(defaultValue = "2")) @RequestHeader(required=true) Integer LanguageType){ + return roleService.getOwnMenuIds(CompanyId, UserId, LanguageType); + } + + @Operation(summary = "获取对应角色拥有的权限菜单ID") + @RequestMapping(value = "/getMenuIdsByRoleId",method = RequestMethod.GET) + public SimpleDataResponse getMenuIdsByRoleId( + @Parameter(name="roleId",description="角色ID",required=true, schema = @Schema(defaultValue = "28")) @RequestParam Long roleId, + @Parameter(name = "LoginName", description = "Login name", required = true, schema = @Schema(defaultValue = "admin")) @RequestHeader(required=true) String LoginName, + @Parameter(name = "AccessToken", description = "Authentication token", required = true) @RequestHeader(required=true) String AccessToken, + @Parameter(name = "UserId", description = "User ID", required = true, schema = @Schema(defaultValue = "1")) @RequestHeader(required=true) Long UserId, + @Parameter(name = "CompanyId", description = "ID of the company to which the user belongs", required = false, schema = @Schema(defaultValue = "1")) @RequestHeader(required=true) Long CompanyId, + @Parameter(name = "LanguageType", description = "Language type (0: Chinese, 1: English, 2: Japanese)", required = true, schema = @Schema(defaultValue = "2")) @RequestHeader(required=true) Integer LanguageType){ + return roleService.getMenuIdsByRoleId(roleId, CompanyId, UserId, LanguageType); + } + +} diff --git a/dongjian-dashboard-back-controller/src/main/java/com/dongjian/dashboard/back/controller/S3FileController.java b/dongjian-dashboard-back-controller/src/main/java/com/dongjian/dashboard/back/controller/S3FileController.java new file mode 100644 index 0000000..365e737 --- /dev/null +++ b/dongjian-dashboard-back-controller/src/main/java/com/dongjian/dashboard/back/controller/S3FileController.java @@ -0,0 +1,38 @@ +package com.dongjian.dashboard.back.controller; + +import com.dongjian.dashboard.back.common.response.SimpleDataResponse; +import com.dongjian.dashboard.back.configurator.aspect.OperationLog; +import com.dongjian.dashboard.back.configurator.interceptor.AccessRequired; +import com.dongjian.dashboard.back.service.S3FileService; +import com.dongjian.dashboard.back.vo.s3.TemporaryCredentials; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.tags.Tag; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +@RestController +@AccessRequired +@RequestMapping("/s3") +@Tag(name = "aws s3相关接口", description = "提供认证等接口") +@SuppressWarnings("unchecked") +public class S3FileController { + + @Autowired + private S3FileService s3FileService; + + @OperationLog(operation = "getS3Credentials", remark = "") + @Operation(summary = "获取s3文件操作接口认证token") + @GetMapping("/aws/credentials") + public SimpleDataResponse getCredentials( + @Parameter(name = "LoginName", description = "Login name", required = true, schema = @Schema(defaultValue = "admin")) @RequestHeader(required=true) String LoginName, + @Parameter(name = "AccessToken", description = "Authentication token", required = true) @RequestHeader(required=true) String AccessToken, + @Parameter(name = "UserId", description = "User ID", required = true, schema = @Schema(defaultValue = "1")) @RequestHeader(required=true) Long UserId, + @Parameter(name = "CompanyId", description = "ID of the company to which the user belongs", required = false, schema = @Schema(defaultValue = "1")) @RequestHeader(required=false) Long CompanyId, + @Parameter(name = "LanguageType", description = "Language type (0: Chinese, 1: English, 2: Japanese)", required = true, schema = @Schema(defaultValue = "2")) @RequestHeader(required=true) Integer LanguageType + ) { + return s3FileService.getTemporaryCredentials(); + } + +} diff --git a/dongjian-dashboard-back-controller/src/main/java/com/dongjian/dashboard/back/controller/UserController.java b/dongjian-dashboard-back-controller/src/main/java/com/dongjian/dashboard/back/controller/UserController.java new file mode 100644 index 0000000..1b5d1fa --- /dev/null +++ b/dongjian-dashboard-back-controller/src/main/java/com/dongjian/dashboard/back/controller/UserController.java @@ -0,0 +1,163 @@ +package com.dongjian.dashboard.back.controller; + + +import com.dongjian.dashboard.back.common.exception.BusinessException; +import com.dongjian.dashboard.back.common.response.PageInfo; +import com.dongjian.dashboard.back.common.response.PageResponse; +import com.dongjian.dashboard.back.common.response.ResponseCode; +import com.dongjian.dashboard.back.common.response.SimpleDataResponse; +import com.dongjian.dashboard.back.configurator.aspect.OperationLog; +import com.dongjian.dashboard.back.configurator.interceptor.AccessRequired; +import com.dongjian.dashboard.back.dto.user.DeleteUserParam; +import com.dongjian.dashboard.back.dto.user.ModifyPassword; +import com.dongjian.dashboard.back.dto.user.OptUserParam; +import com.dongjian.dashboard.back.dto.user.PageSearchParam; +import com.dongjian.dashboard.back.dto.user.ResetPassword; +import com.dongjian.dashboard.back.dto.user.SwitchMfaBind; +import com.dongjian.dashboard.back.service.UserService; +import com.dongjian.dashboard.back.vo.user.UserPageDTO; + +import io.swagger.v3.oas.annotations.Hidden; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +/** + * + * @author jwy-style + * + */ +@RestController//代表返回的是json格式的数据,这个注解是Spring4之后新加的注解 +//@AccessRequired //注解标识是否需要验证token +@RequestMapping("/user") //http请求路径映射 +@Tag(name = "用户管理的相关接口",description = "用户管理的相关接口") +@SuppressWarnings("unchecked") +public class UserController { + + private static Logger logger = LoggerFactory.getLogger(UserController.class); + + @Autowired + private UserService userService; + + @AccessRequired + @OperationLog(operation = "addUser", remark = "") + @Operation(summary = "添加用户") + @RequestMapping(value = "/add",method = RequestMethod.POST) + public SimpleDataResponse add( + @RequestBody OptUserParam optUserParam, + @Parameter(name = "LoginName", description = "Login name", required = true, schema = @Schema(defaultValue = "admin")) @RequestHeader(required=true) String LoginName, + @Parameter(name = "AccessToken", description = "Authentication token", required = true) @RequestHeader(required=true) String AccessToken, + @Parameter(name = "UserId", description = "User ID", required = true, schema = @Schema(defaultValue = "1")) @RequestHeader(required=true) Long UserId, + @Parameter(name = "CompanyId", description = "ID of the company to which the user belongs", required = false, schema = @Schema(defaultValue = "1")) @RequestHeader(required=true) Long CompanyId, + @Parameter(name = "LanguageType", description = "Language type (0: Chinese, 1: English, 2: Japanese)", required = true, schema = @Schema(defaultValue = "2")) @RequestHeader(required=true) Integer LanguageType){ + return userService.add(optUserParam, CompanyId, UserId, LanguageType); + } + + @AccessRequired + @OperationLog(operation = "editUser", remark = "") + @Operation(summary = "编辑用户") + @RequestMapping(value = "/edit",method = RequestMethod.POST) + public SimpleDataResponse edit( + @RequestBody OptUserParam optUserParam, + @Parameter(name = "LoginName", description = "Login name", required = true, schema = @Schema(defaultValue = "admin")) @RequestHeader(required=true) String LoginName, + @Parameter(name = "AccessToken", description = "Authentication token", required = true) @RequestHeader(required=true) String AccessToken, + @Parameter(name = "UserId", description = "User ID", required = true, schema = @Schema(defaultValue = "1")) @RequestHeader(required=true) Long UserId, + @Parameter(name = "CompanyId", description = "ID of the company to which the user belongs", required = false, schema = @Schema(defaultValue = "1")) @RequestHeader(required=true) Long CompanyId, + @Parameter(name = "LanguageType", description = "Language type (0: Chinese, 1: English, 2: Japanese)", required = true, schema = @Schema(defaultValue = "2")) @RequestHeader(required=true) Integer LanguageType){ + return userService.edit(optUserParam, CompanyId, UserId, LanguageType); + } + + @AccessRequired + @OperationLog(operation = "deleteUser", remark = "") + @Operation(summary = "删除用户") + @RequestMapping(value = "/batchDelete",method = RequestMethod.POST) + public SimpleDataResponse batchDelete( + @RequestBody DeleteUserParam deleteUserParam, + @Parameter(name = "LoginName", description = "Login name", required = true, schema = @Schema(defaultValue = "admin")) @RequestHeader(required=true) String LoginName, + @Parameter(name = "AccessToken", description = "Authentication token", required = true) @RequestHeader(required=true) String AccessToken, + @Parameter(name = "UserId", description = "User ID", required = true, schema = @Schema(defaultValue = "1")) @RequestHeader(required=true) Long UserId, + @Parameter(name = "CompanyId", description = "ID of the company to which the user belongs", required = false, schema = @Schema(defaultValue = "1")) @RequestHeader(required=true) Long CompanyId, + @Parameter(name = "LanguageType", description = "Language type (0: Chinese, 1: English, 2: Japanese)", required = true, schema = @Schema(defaultValue = "2")) @RequestHeader(required=true) Integer LanguageType){ + return userService.batchDelete(deleteUserParam, CompanyId, UserId, LanguageType); + } + + @AccessRequired + @OperationLog(operation = "resetPassword", remark = "") + @Operation(summary = "重置密码") + @RequestMapping(value = "/batchResetPassword",method = RequestMethod.POST) + public SimpleDataResponse batchResetPassword( + @RequestBody ResetPassword resetPassword, + @Parameter(name = "LoginName", description = "Login name", required = true, schema = @Schema(defaultValue = "admin")) @RequestHeader(required=true) String LoginName, + @Parameter(name = "AccessToken", description = "Authentication token", required = true) @RequestHeader(required=true) String AccessToken, + @Parameter(name = "UserId", description = "User ID", required = true, schema = @Schema(defaultValue = "1")) @RequestHeader(required=true) Long UserId, + @Parameter(name = "CompanyId", description = "ID of the company to which the user belongs", required = false, schema = @Schema(defaultValue = "1")) @RequestHeader(required=true) Long CompanyId, + @Parameter(name = "LanguageType", description = "Language type (0: Chinese, 1: English, 2: Japanese)", required = true, schema = @Schema(defaultValue = "2")) @RequestHeader(required=true) Integer LanguageType){ + return userService.batchResetPassword(resetPassword, CompanyId, UserId, LanguageType); + } + + @AccessRequired + @OperationLog(operation = "changePassword", remark = "") + @Operation(summary = "修改密码") + @RequestMapping(value = "/modifyPassword",method = RequestMethod.POST) + public SimpleDataResponse modifyPassword( + @RequestBody ModifyPassword modifyPassword, + @Parameter(name = "LoginName", description = "Login name", required = true, schema = @Schema(defaultValue = "admin")) @RequestHeader(required=true) String LoginName, + @Parameter(name = "AccessToken", description = "Authentication token", required = true) @RequestHeader(required=true) String AccessToken, + @Parameter(name = "UserId", description = "User ID", required = true, schema = @Schema(defaultValue = "1")) @RequestHeader(required=true) Long UserId, + @Parameter(name = "CompanyId", description = "ID of the company to which the user belongs", required = false, schema = @Schema(defaultValue = "1")) @RequestHeader(required=false) Long CompanyId, + @Parameter(name = "LanguageType", description = "Language type (0: Chinese, 1: English, 2: Japanese)", required = true, schema = @Schema(defaultValue = "2")) @RequestHeader(required=true) Integer LanguageType + ) { + return userService.modifyPassword(modifyPassword, CompanyId, UserId, LanguageType); + } + + @Hidden + @AccessRequired + @OperationLog(operation = "unbindMFADevice", remark = "") + @Operation(summary = "解绑MFA设备") + @RequestMapping(value = "/unbindMfa",method = RequestMethod.POST) + public SimpleDataResponse unbindMfa( + @RequestBody SwitchMfaBind switchMfaBind, + @Parameter(name = "LoginName", description = "Login name", required = true, schema = @Schema(defaultValue = "admin")) @RequestHeader(required=true) String LoginName, + @Parameter(name = "AccessToken", description = "Authentication token", required = true) @RequestHeader(required=true) String AccessToken, + @Parameter(name = "UserId", description = "User ID", required = true, schema = @Schema(defaultValue = "1")) @RequestHeader(required=true) Long UserId, + @Parameter(name = "CompanyId", description = "ID of the company to which the user belongs", required = false, schema = @Schema(defaultValue = "1")) @RequestHeader(required=false) Long CompanyId, + @Parameter(name = "LanguageType", description = "Language type (0: Chinese, 1: English, 2: Japanese)", required = true, schema = @Schema(defaultValue = "2")) @RequestHeader(required=true) Integer LanguageType + ) { + return userService.unbindMfa(switchMfaBind, CompanyId, UserId, LanguageType); + } + + @AccessRequired + @OperationLog(operation = "queryUser", remark = "") + @Operation(summary = "获取用户列表") + @RequestMapping(value = "/getListPage",method = RequestMethod.GET) + public PageResponse> getListPage( + @Parameter(name = "LoginName", description = "Login name", required = true, schema = @Schema(defaultValue = "admin")) @RequestHeader(required=true) String LoginName, + @Parameter(name = "AccessToken", description = "Authentication token", required = true) @RequestHeader(required=true) String AccessToken, + @Parameter(name = "UserId", description = "User ID", required = true, schema = @Schema(defaultValue = "1")) @RequestHeader(required=true) Long UserId, + @Parameter(name = "CompanyId", description = "ID of the company to which the user belongs", required = false, schema = @Schema(defaultValue = "1")) @RequestHeader(required=false) Long CompanyId, + @Parameter(name = "LanguageType", description = "Language type (0: Chinese, 1: English, 2: Japanese)", required = true, schema = @Schema(defaultValue = "2")) @RequestHeader(required=true) Integer LanguageType, + PageSearchParam pageSearchParam + ) throws BusinessException { + + pageSearchParam.setUserId(UserId); +// pageSearchParam.setCompanyId(CompanyId); + PageResponse> pageResponse = new PageResponse>(); + try{ + pageResponse.setData(userService.getListPage(pageSearchParam, CompanyId, UserId, LanguageType)); + pageResponse.setCode(ResponseCode.SUCCESS); + pageResponse.setMsg("success"); + }catch (Exception e){ + logger.error("查询列表报错",e); + pageResponse.setCode(ResponseCode.SERVER_ERROR); + pageResponse.setMsg("service error"); + } + return pageResponse; + } + +} diff --git a/dongjian-dashboard-back-controller/src/main/java/com/dongjian/dashboard/back/swagger/SwaggerConfig.java b/dongjian-dashboard-back-controller/src/main/java/com/dongjian/dashboard/back/swagger/SwaggerConfig.java new file mode 100644 index 0000000..84dc7c3 --- /dev/null +++ b/dongjian-dashboard-back-controller/src/main/java/com/dongjian/dashboard/back/swagger/SwaggerConfig.java @@ -0,0 +1,50 @@ +//package com.dongjian.dashboard.back.swagger; +// +//import org.springframework.beans.factory.annotation.Value; +//import org.springframework.context.annotation.Bean; +//import org.springframework.context.annotation.Configuration; +//import org.springframework.context.annotation.Profile; +//import springfox.documentation.builders.ApiInfoBuilder; +//import springfox.documentation.builders.PathSelectors; +//import springfox.documentation.service.ApiInfo; +//import springfox.documentation.service.Contact; +//import springfox.documentation.spi.DocumentationType; +//import springfox.documentation.spring.web.plugins.Docket; +//import springfox.documentation.swagger2.annotations.EnableSwagger2; +// +///** +// * http://127.0.0.1:20002/swagger-ui.html +//* @author 江武元 +// */ +//@Configuration +//@EnableSwagger2 +//public class SwaggerConfig { +// +// @Value("${api.enable:false}") +// private boolean enable; +// +//// @Profile({"dev","stg"}) +// @Bean +// public Docket webApiConfig(){ +// return new Docket(DocumentationType.SWAGGER_2) +// .groupName("webApi") +// .apiInfo(webApiInfo()) +// .select() +// //配置显示所有的URL +// .paths(PathSelectors.any()) +// .build() +// .enable(enable); +// } +// +// private ApiInfo webApiInfo(){ +// return new ApiInfoBuilder() +// //文档标题 +// .title("接口文档") +// //文档描述 +// .description("接口文档") +// //文档版本 +// .version("1.0") +// .build(); +// } +//} +// diff --git a/dongjian-dashboard-back-controller/src/main/resources/assembly.xml b/dongjian-dashboard-back-controller/src/main/resources/assembly.xml new file mode 100644 index 0000000..292a54a --- /dev/null +++ b/dongjian-dashboard-back-controller/src/main/resources/assembly.xml @@ -0,0 +1,59 @@ + + + + dongjian-dashboard-back + + + zip + + + + + + + + ${project.build.directory} + / + + *.jar + + + + + + ${project.build.directory}/jar + / + + lib/*.jar + + + *.jar + + + + + + ${project.build.directory}/lib + /lib + + *.jar + + + + + + ${project.build.directory}/config + /config + + application.properties + + + + + + ${project.build.directory}/sql + /sql + + + + diff --git a/dongjian-dashboard-back-controller/src/main/resources/config/application.properties b/dongjian-dashboard-back-controller/src/main/resources/config/application.properties new file mode 100644 index 0000000..ec6a788 --- /dev/null +++ b/dongjian-dashboard-back-controller/src/main/resources/config/application.properties @@ -0,0 +1,109 @@ +server.port=${serverPort} + +api.enable=${apiEnable} + +spring.mvc.pathmatch.matching-strategy= ANT_PATH_MATCHER + +mybatis.mapperLocations=classpath:mappers/**/*.xml + +spring.datasource.admin.name=data_center_new +spring.datasource.admin.url=jdbc:mysql://${datasourceDNS}/data_center_new?useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=${datasourceTimeZone} +spring.datasource.admin.username=${datasourceUsername} +spring.datasource.admin.password=${datasourcePassword} +#使用druid数据源 +spring.datasource.admin.type=com.alibaba.druid.pool.DruidDataSource +spring.datasource.admin.driverClassName=com.mysql.jdbc.Driver +spring.datasource.admin.hikari.driverClassName=com.mysql.jdbc.Driver +spring.datasource.admin.hikari.schema=data_center_new +spring.datasource.admin.hikari.minimum-idle: 5 +spring.datasource.admin.hikari.maximum-pool-size: ${rdsMaxPool:40} +spring.datasource.admin.hikari.connection-timeout:10000 + +dynamic.jdbc.url=jdbc:mysql://${datasourceDNS:rm-bp11k2zm2fr7864428o.mysql.rds.aliyuncs.com:3306}/%s?useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=${datasourceTimeZone} + +spring.datasource.url=jdbc:mysql://${datasourceDNS:rm-bp11k2zm2fr7864428o.mysql.rds.aliyuncs.com:3306}/data_center_new?useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=${datasourceTimeZone} + + +#配置log日志 +logging.config=classpath:config/logback-boot.xml +logging_level=${loggingLevel} +logging_path=${loggingPath} +#部署时使用SYSLOG +logging_appender=${loggingAppender} +logging_maxHistory=${loggingMaxHistory:7} +logging_maxFileSize=100MB +mybatis_log_level=${mybatisLogLevel} + +user.login.keytimeout=360000 + +#集群模式cluster +spring.redis.cluster.nodes=192.168.0.30:7000,192.168.0.30:7001 +#跨集群执行命令时要遵循的最大重定向数量 +spring.redis.cluster.max-redirects=3 +#哨兵模式sentinel +spring.redis.sentinel.master=mymaster +spring.redis.sentinel.nodes=192.168.0.30:16379,192.168.0.30:16379 + +#单机模式standalone +spring.redis.host=${redisHost} +spring.redis.port=6379 + +spring.redis.password=${redisPassword} +spring.redis.timeout=5000 +#Redis数据库索引(默认为0) +spring.redis.database=0 +#配置启动模式cluster、sentinel、standalone +spring.redis.mode=standalone +# Lettuce +# 连接池最大连接数(使用负值表示没有限制) +spring.redis.lettuce.pool.max-active=8 +# 连接池最大阻塞等待时间(使用负值表示没有限制) +spring.redis.lettuce.pool.max-wait=100 +# 连接池中的最大空闲连接 +spring.redis.lettuce.pool.max-idle=8 +# 连接池中的最小空闲连接 +spring.redis.lettuce.pool.min-idle=0 +# 关闭超时时间 +spring.redis.lettuce.shutdown-timeout=100 + + +#邮件发送信息 +mail.smtp.host=email-smtp.ap-northeast-1.amazonaws.com +mail.smtp.port=465 +mail.smtp.auth=true +mail.smtp.ssl=true +mail.sender.username=AKIAVRXFMB43Z4Q6WGZN +mail.sender.password_encrypted=true +mail.sender.password=a/52R0rao7ksRMvl1j17fVEmPCw7gC9OreHDqWOE+S7sgmoQT0YgoLRJqOlJqX7e +mail.sender.sendername=datacenter-info +mail.sender.from=alert@ttkdatatechbuild.com +#邮件通知服务开关 +mail.send.switch=true + +Spring.mvc.hiddenmethod.filter.enabled=true +#单个文件上传发大小 +spring.servlet.multipart.max-file-size=20MB +#多个文件上传的共大小不得超过100M +spring.servlet.multipart.max-request-size=100MB + +server.servlet.context-path=/api + +mybatis.configuration.map-underscore-to-camel-case=true + +server.servlet.session.cookie.http-only=true +server.servlet.session.cookie.secure=true + +springdoc.swagger-ui.doc-expansion=none +springdoc.swagger-ui.operations-sorter=alpha +springdoc.swagger-ui.tags-sorter=alpha + +web.login.url=${webLoginUrl} +web.admin.login.url=${webAdminLoginUrl} + +amazon.aws.accesskey=${awsAccessKey} +amazon.aws.secretkey=${awsSecretKey} +amazon.aws.actionable.region=ap-northeast-1 +amazon.aws.actionable.bucket=${awsActionableBucket} +amazon.aws.actionable.directory=${awsActionableDirectory} +amazon.aws.actionable.roleArn=${awsActionableRoleArn} + diff --git a/dongjian-dashboard-back-controller/src/main/resources/config/logback-boot.xml b/dongjian-dashboard-back-controller/src/main/resources/config/logback-boot.xml new file mode 100644 index 0000000..413a632 --- /dev/null +++ b/dongjian-dashboard-back-controller/src/main/resources/config/logback-boot.xml @@ -0,0 +1,53 @@ + + + + + + + + + + + + + + %d{yyyy-MM-dd HH:mm:ss.SSS} %p [%t] %m%n + + UTF-8 + + + + + ${logging_path}/spring.log + + + + + + ${logging_path}/spring.%d.%i.gz + + ${logging_maxHistory} + + + ${logging_maxFileSize} + + + + + + %d{yyyy-MM-dd HH:mm:ss.SSS} %-5p [%t] %c %m%n + + + UTF-8 + + + + + + + + + + + diff --git a/dongjian-dashboard-back-controller/src/main/resources/config/version.properties b/dongjian-dashboard-back-controller/src/main/resources/config/version.properties new file mode 100644 index 0000000..10d9a5d --- /dev/null +++ b/dongjian-dashboard-back-controller/src/main/resources/config/version.properties @@ -0,0 +1,3 @@ +project.latest.version=v0.0.1.20240228 + +v0.0.1.20240228=1.初始版本 \ No newline at end of file diff --git a/dongjian-dashboard-back-controller/src/test/java/com/dongjian/dashboard/back/controller/AdminCompanyControllerTest.java b/dongjian-dashboard-back-controller/src/test/java/com/dongjian/dashboard/back/controller/AdminCompanyControllerTest.java new file mode 100644 index 0000000..5fd0d44 --- /dev/null +++ b/dongjian-dashboard-back-controller/src/test/java/com/dongjian/dashboard/back/controller/AdminCompanyControllerTest.java @@ -0,0 +1,163 @@ +package com.dongjian.dashboard.back.controller; + +import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; +import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.post; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; + +import com.alibaba.fastjson2.JSONObject; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.dongjian.dashboard.back.common.language.msg.MsgLanguageChange; +import com.dongjian.dashboard.back.dto.account.LoginParam; +import com.dongjian.dashboard.back.dto.company.OptCompanyParams; +import com.dongjian.dashboard.back.util.CommonUtil; +import com.dongjian.dashboard.back.dto.company.CompanySearchParams; + +import org.junit.After; +import org.junit.Before; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.http.HttpHeaders; +import org.springframework.http.MediaType; +import org.springframework.test.context.junit4.SpringRunner; +import org.springframework.test.web.servlet.MockMvc; +import org.springframework.test.web.servlet.result.MockMvcResultMatchers; +import org.springframework.web.context.WebApplicationContext; + +import jakarta.annotation.Resource; + + +@RunWith(SpringRunner.class) +@SpringBootTest +@AutoConfigureMockMvc +public class AdminCompanyControllerTest { + + + @Resource + private MsgLanguageChange msgLanguageChange; + + @Resource + protected MockMvc mockMvc; + + @Autowired + protected WebApplicationContext wac; + + protected HttpHeaders httpHeaders = new HttpHeaders(); + + + private static final String COMPANY_NAME = "junit-test-admin-CompanyName"; + + + @Before() + public void setup() throws Exception { + System.out.println("run before......."); + LoginParam loginParam = new LoginParam(); + loginParam.setLoginname("admin"); + loginParam.setPassword("123456"); + + String content = (new ObjectMapper()).writeValueAsString(loginParam); + + System.out.println(content); + + HttpHeaders loginHeaders = new HttpHeaders(); + loginHeaders.set("LanguageType", "0"); + String responseString = mockMvc.perform( + post("/account/login") + .contentType(MediaType.APPLICATION_JSON) + .headers(loginHeaders) + .content(content) + ).andReturn().getResponse().getContentAsString(); + + System.out.println("setup response:" + responseString); + + JSONObject loginRespObject = JSONObject.parseObject(responseString).getJSONObject("data"); + httpHeaders.set("LoginName", loginRespObject.getString("loginName")); + httpHeaders.set("AccessToken", loginRespObject.getString("accessToken")); + httpHeaders.set("UserId", loginRespObject.getString("userId")); + httpHeaders.set("CompanyId", loginRespObject.getString("companyId")); + httpHeaders.set("LanguageType", "2"); + httpHeaders.set("UTCOffset", "-480"); + } + + @After() + public void after() throws Exception { + System.out.println("run after......."); + + editData(); + + } + + private String editData() throws Exception { + + OptCompanyParams param = new OptCompanyParams(); + param.setCompanyName(COMPANY_NAME); + param.setCompanyId(16L); + param.setParentId(1L); + param.setMfaSwitch(0); + String content = (new ObjectMapper()).writeValueAsString(param); + + String responseString = mockMvc.perform( + post("/company/edit") + .contentType(MediaType.APPLICATION_JSON) + .headers(httpHeaders) + .content(content)) + .andExpect(MockMvcResultMatchers.status().isOk()) + .andExpect(MockMvcResultMatchers.jsonPath("$.code").value("200")) + .andReturn().getResponse().getContentAsString(); + + return responseString; + } + + + @Test + public void testEdit() throws Exception { + System.out.println("run testEdit......."); + + OptCompanyParams param = new OptCompanyParams(); + param.setCompanyName(COMPANY_NAME +"-edit"); + param.setCompanyId(16L); + param.setParentId(2L); + param.setMfaSwitch(0); + String content = (new ObjectMapper()).writeValueAsString(param); + + System.out.println("testEdit params:"+content); + + String responseString = mockMvc.perform( + post("/company/edit") + .contentType(MediaType.APPLICATION_JSON) + .headers(httpHeaders) + .content(content)) + .andExpect(MockMvcResultMatchers.status().isOk()) + .andExpect(MockMvcResultMatchers.jsonPath("$.code").value("200")) + .andReturn().getResponse().getContentAsString(); + + System.out.println("testEdit response:" + responseString); + + } + + + @Test + public void testGetListPage() throws Exception { + System.out.println("run testGetListPage......."); + + CompanySearchParams companySearchParams = new CompanySearchParams(); + companySearchParams.setCompanyName(COMPANY_NAME); + companySearchParams.setSelfCompanyId(1L); + + String pageString = mockMvc.perform( + get("/company/getListPage") + .contentType(MediaType.APPLICATION_JSON) + .headers(httpHeaders) + .queryParams(CommonUtil.convertToMultiValueMap(companySearchParams)) + ) + .andExpect(status().isOk()) + .andExpect(MockMvcResultMatchers.jsonPath("$.code").value("200")) + .andExpect(MockMvcResultMatchers.jsonPath("$.data.total").value(1)) + .andReturn().getResponse().getContentAsString(); + System.out.println("testGetListPage response:" + pageString); + + } +} + diff --git a/dongjian-dashboard-back-controller/src/test/java/com/dongjian/dashboard/back/controller/AdminProjectControllerTest.java b/dongjian-dashboard-back-controller/src/test/java/com/dongjian/dashboard/back/controller/AdminProjectControllerTest.java new file mode 100644 index 0000000..61e51ed --- /dev/null +++ b/dongjian-dashboard-back-controller/src/test/java/com/dongjian/dashboard/back/controller/AdminProjectControllerTest.java @@ -0,0 +1,265 @@ +package com.dongjian.dashboard.back.controller; + +import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; +import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.post; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; + +import com.alibaba.fastjson2.JSONArray; +import com.alibaba.fastjson2.JSONObject; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.dongjian.dashboard.back.common.language.msg.MsgLanguageChange; +import com.dongjian.dashboard.back.dto.account.LoginParam; +import com.dongjian.dashboard.back.dto.project.DeleteProjectParams; +import com.dongjian.dashboard.back.dto.project.OptProjectParams; +import com.dongjian.dashboard.back.dto.project.ProjectSearchParams; +import com.dongjian.dashboard.back.util.CommonUtil; + +import org.junit.After; +import org.junit.Before; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.http.HttpHeaders; +import org.springframework.http.MediaType; +import org.springframework.test.context.junit4.SpringRunner; +import org.springframework.test.web.servlet.MockMvc; +import org.springframework.test.web.servlet.result.MockMvcResultMatchers; +import org.springframework.web.context.WebApplicationContext; + +import jakarta.annotation.Resource; + + +@RunWith(SpringRunner.class) +@SpringBootTest +@AutoConfigureMockMvc +public class AdminProjectControllerTest { + + + @Resource + private MsgLanguageChange msgLanguageChange; + + @Resource + protected MockMvc mockMvc; + + @Autowired + protected WebApplicationContext wac; + + protected HttpHeaders httpHeaders = new HttpHeaders(); + + + private static final String PROJECT_NAME = "junit-test-admin-ProjectName"; + + + @Before() + public void setup() throws Exception { + System.out.println("run before......."); + LoginParam loginParam = new LoginParam(); + loginParam.setLoginname("admin"); + loginParam.setPassword("123456"); + + String content = (new ObjectMapper()).writeValueAsString(loginParam); + + System.out.println(content); + + HttpHeaders loginHeaders = new HttpHeaders(); + loginHeaders.set("LanguageType", "0"); + String responseString = mockMvc.perform( + post("/account/login") + .contentType(MediaType.APPLICATION_JSON) + .headers(loginHeaders) + .content(content) + ).andReturn().getResponse().getContentAsString(); + + System.out.println("setup response:" + responseString); + + JSONObject loginRespObject = JSONObject.parseObject(responseString).getJSONObject("data"); + httpHeaders.set("LoginName", loginRespObject.getString("loginName")); + httpHeaders.set("AccessToken", loginRespObject.getString("accessToken")); + httpHeaders.set("UserId", loginRespObject.getString("userId")); + httpHeaders.set("CompanyId", loginRespObject.getString("companyId")); + httpHeaders.set("LanguageType", "2"); + httpHeaders.set("UTCOffset", "-480"); + + deleteMockData(); + } + + @After() + public void after() throws Exception { + System.out.println("run after......."); + deleteMockData(); + + } + + private String deleteMockData() throws Exception { + long projectId = getMockDataId(); + + DeleteProjectParams param = new DeleteProjectParams(); + param.setProjectIds(projectId+""); + param.setCompanyIds("2"); + String content = (new ObjectMapper()).writeValueAsString(param); + + String responseString = mockMvc.perform( + post("/project/batchDelete") + .contentType(MediaType.APPLICATION_JSON) + .headers(httpHeaders) + .content(content)) + .andExpect(MockMvcResultMatchers.status().isOk()) + .andExpect(MockMvcResultMatchers.jsonPath("$.code").value("200")) + .andReturn().getResponse().getContentAsString(); + return responseString; + } + + private void insertMockData() throws Exception { + System.out.println("run insertMockData......."); + long projectId = getMockDataId(); + if (-1 == projectId) { + OptProjectParams param = createMockData(); + String content = (new ObjectMapper()).writeValueAsString(param); + + System.out.println("testAdd params:"+content); + + String responseString = mockMvc.perform( + post("/project/add") + .contentType(MediaType.APPLICATION_JSON) + .headers(httpHeaders) + .content(content)) + .andExpect(MockMvcResultMatchers.status().isOk()) + .andExpect(MockMvcResultMatchers.jsonPath("$.code").value("200")) + .andReturn().getResponse().getContentAsString(); + } + } + + private OptProjectParams createMockData() throws Exception { + OptProjectParams param = new OptProjectParams(); + param.setProjectName(PROJECT_NAME); + param.setCompanyId(2L); + param.setUdfProjectId("junit-test-amdin-UdfProjectId"); + return param; + } + + private long getMockDataId() throws Exception { + ProjectSearchParams projectSearchParams = new ProjectSearchParams(); + projectSearchParams.setProjectName(PROJECT_NAME); + projectSearchParams.setCompanyId(2L); + + String pageString = mockMvc.perform( + get("/project/getListPage") + .contentType(MediaType.APPLICATION_JSON) + .headers(httpHeaders) + .queryParams(CommonUtil.convertToMultiValueMap(projectSearchParams)) + ) + .andExpect(status().isOk()) + .andExpect(MockMvcResultMatchers.jsonPath("$.code").value("200")) + .andReturn().getResponse().getContentAsString(); + System.out.println("getMockDataId :" + pageString); + JSONObject pageObject = JSONObject.parseObject(pageString); + + JSONArray list = pageObject.getJSONObject("data").getJSONArray("list"); + return list.size() == 0 ? -1L : list.getJSONObject(0).getLongValue("projectId"); + } + + @Test + public void testAdd() throws Exception { + System.out.println("run testAdd......."); + + OptProjectParams param = createMockData(); + String content = (new ObjectMapper()).writeValueAsString(param); + + System.out.println("testAdd params:"+content); + + String responseString = mockMvc.perform( + post("/project/add") + .contentType(MediaType.APPLICATION_JSON) + .headers(httpHeaders) + .content(content)) + .andExpect(MockMvcResultMatchers.status().isOk()) + .andExpect(MockMvcResultMatchers.jsonPath("$.code").value("200")) + .andReturn().getResponse().getContentAsString(); + + System.out.println("testAdd response:" + responseString); + + String responseString2 = mockMvc.perform( + post("/project/add") + .contentType(MediaType.APPLICATION_JSON) + .headers(httpHeaders) + .content(content)) + .andExpect(MockMvcResultMatchers.status().isOk()) + .andExpect(MockMvcResultMatchers.jsonPath("$.code").value("20001")) + .andExpect(MockMvcResultMatchers.jsonPath("$.msg").value( + msgLanguageChange.getParameterMapByCode(Integer.valueOf(httpHeaders.getFirst("LanguageType")), "projectNameHasExisted") + )) + .andReturn().getResponse().getContentAsString(); + + System.out.println("testAdd response:" + responseString2); + + } + + @Test + public void testEdit() throws Exception { + System.out.println("run testEdit......."); + + insertMockData(); + + OptProjectParams param = new OptProjectParams(); + param.setProjectId(getMockDataId()); + param.setProjectName(PROJECT_NAME); + param.setCompanyId(2L); + param.setUdfProjectId("junit-test-UdfProjectId-edit"); + String content = (new ObjectMapper()).writeValueAsString(param); + + System.out.println("testEdit params:"+content); + + String responseString = mockMvc.perform( + post("/project/edit") + .contentType(MediaType.APPLICATION_JSON) + .headers(httpHeaders) + .content(content)) + .andExpect(MockMvcResultMatchers.status().isOk()) + .andExpect(MockMvcResultMatchers.jsonPath("$.code").value("200")) + .andReturn().getResponse().getContentAsString(); + + System.out.println("testEdit response:" + responseString); + + } + + + @Test + public void testGetListPage() throws Exception { + System.out.println("run testGetListPage......."); + + insertMockData(); + + ProjectSearchParams projectSearchParams = new ProjectSearchParams(); + projectSearchParams.setProjectName(PROJECT_NAME); + projectSearchParams.setCompanyId(2L); + + String pageString = mockMvc.perform( + get("/project/getListPage") + .contentType(MediaType.APPLICATION_JSON) + .headers(httpHeaders) + .queryParams(CommonUtil.convertToMultiValueMap(projectSearchParams)) + ) + .andExpect(status().isOk()) + .andExpect(MockMvcResultMatchers.jsonPath("$.code").value("200")) + .andExpect(MockMvcResultMatchers.jsonPath("$.data.total").value(1)) + .andReturn().getResponse().getContentAsString(); + System.out.println("testGetListPage response:" + pageString); + + } + + + @Test + public void testDelete() throws Exception { + System.out.println("run testDelete......."); + + insertMockData(); + + String responseString = deleteMockData(); + + System.out.println("testDelete response:" + responseString); + + } +} + diff --git a/dongjian-dashboard-back-controller/src/test/java/com/dongjian/dashboard/back/controller/AdminRoleControllerTest.java b/dongjian-dashboard-back-controller/src/test/java/com/dongjian/dashboard/back/controller/AdminRoleControllerTest.java new file mode 100644 index 0000000..30fb884 --- /dev/null +++ b/dongjian-dashboard-back-controller/src/test/java/com/dongjian/dashboard/back/controller/AdminRoleControllerTest.java @@ -0,0 +1,262 @@ +package com.dongjian.dashboard.back.controller; + +import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; +import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.post; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; + +import com.alibaba.fastjson2.JSONArray; +import com.alibaba.fastjson2.JSONObject; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.dongjian.dashboard.back.common.language.msg.MsgLanguageChange; +import com.dongjian.dashboard.back.dto.account.LoginParam; +import com.dongjian.dashboard.back.dto.role.DeleteRoleParam; +import com.dongjian.dashboard.back.dto.role.OptRoleParam; +import com.dongjian.dashboard.back.dto.role.PageSearchParam; +import com.dongjian.dashboard.back.util.CommonUtil; + +import org.junit.After; +import org.junit.Before; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.http.HttpHeaders; +import org.springframework.http.MediaType; +import org.springframework.test.context.junit4.SpringRunner; +import org.springframework.test.web.servlet.MockMvc; +import org.springframework.test.web.servlet.result.MockMvcResultMatchers; +import org.springframework.web.context.WebApplicationContext; + +import jakarta.annotation.Resource; + + +@RunWith(SpringRunner.class) +@SpringBootTest +@AutoConfigureMockMvc +public class AdminRoleControllerTest { + + + @Resource + private MsgLanguageChange msgLanguageChange; + + @Resource + protected MockMvc mockMvc; + + @Autowired + protected WebApplicationContext wac; + + protected HttpHeaders httpHeaders = new HttpHeaders(); + + + private static final String ROLE_NAME = "junit-test-admin-RoleName"; + + + @Before() + public void setup() throws Exception { + System.out.println("run before......."); + LoginParam loginParam = new LoginParam(); + loginParam.setLoginname("admin"); + loginParam.setPassword("123456"); + + String content = (new ObjectMapper()).writeValueAsString(loginParam); + + System.out.println(content); + + HttpHeaders loginHeaders = new HttpHeaders(); + loginHeaders.set("LanguageType", "0"); + String responseString = mockMvc.perform( + post("/account/login") + .contentType(MediaType.APPLICATION_JSON) + .headers(loginHeaders) + .content(content) + ).andReturn().getResponse().getContentAsString(); + + System.out.println("setup response:" + responseString); + + JSONObject loginRespObject = JSONObject.parseObject(responseString).getJSONObject("data"); + httpHeaders.set("LoginName", loginRespObject.getString("loginName")); + httpHeaders.set("AccessToken", loginRespObject.getString("accessToken")); + httpHeaders.set("UserId", loginRespObject.getString("userId")); + httpHeaders.set("CompanyId", loginRespObject.getString("companyId")); + httpHeaders.set("LanguageType", "2"); + httpHeaders.set("UTCOffset", "-480"); + + deleteMockData(); + } + + @After() + public void after() throws Exception { + System.out.println("run after......."); + deleteMockData(); + + } + + private String deleteMockData() throws Exception { + long roleId = getMockDataId(); + + DeleteRoleParam param = new DeleteRoleParam(); + param.setRoleIds(roleId+""); + String content = (new ObjectMapper()).writeValueAsString(param); + + String responseString = mockMvc.perform( + post("/role/batchDelete") + .contentType(MediaType.APPLICATION_JSON) + .headers(httpHeaders) + .content(content)) + .andExpect(MockMvcResultMatchers.status().isOk()) + .andExpect(MockMvcResultMatchers.jsonPath("$.code").value("200")) + .andReturn().getResponse().getContentAsString(); + return responseString; + } + + private void insertMockData() throws Exception { + System.out.println("run insertMockData......."); + long roleId = getMockDataId(); + if (-1 == roleId) { + OptRoleParam param = createMockData(); + String content = (new ObjectMapper()).writeValueAsString(param); + + System.out.println("testAdd params:"+content); + + String responseString = mockMvc.perform( + post("/role/add") + .contentType(MediaType.APPLICATION_JSON) + .headers(httpHeaders) + .content(content)) + .andExpect(MockMvcResultMatchers.status().isOk()) + .andExpect(MockMvcResultMatchers.jsonPath("$.code").value("200")) + .andReturn().getResponse().getContentAsString(); + } + } + + private OptRoleParam createMockData() throws Exception { + OptRoleParam param = new OptRoleParam(); + param.setRoleName(ROLE_NAME); + param.setDescription("Description"); + param.setMenuIds("1,2"); + return param; + } + + private long getMockDataId() throws Exception { + PageSearchParam roleSearchParams = new PageSearchParam(); + roleSearchParams.setRoleName(ROLE_NAME); + + String pageString = mockMvc.perform( + get("/role/getListPage") + .contentType(MediaType.APPLICATION_JSON) + .headers(httpHeaders) + .queryParams(CommonUtil.convertToMultiValueMap(roleSearchParams)) + ) + .andExpect(status().isOk()) + .andExpect(MockMvcResultMatchers.jsonPath("$.code").value("200")) + .andReturn().getResponse().getContentAsString(); + System.out.println("getMockDataId :" + pageString); + JSONObject pageObject = JSONObject.parseObject(pageString); + + JSONArray list = pageObject.getJSONObject("data").getJSONArray("list"); + return list.size() == 0 ? -1L : list.getJSONObject(0).getLongValue("roleId"); + } + + @Test + public void testAdd() throws Exception { + System.out.println("run testAdd......."); + + OptRoleParam param = createMockData(); + String content = (new ObjectMapper()).writeValueAsString(param); + + System.out.println("testAdd params:"+content); + + String responseString = mockMvc.perform( + post("/role/add") + .contentType(MediaType.APPLICATION_JSON) + .headers(httpHeaders) + .content(content)) + .andExpect(MockMvcResultMatchers.status().isOk()) + .andExpect(MockMvcResultMatchers.jsonPath("$.code").value("200")) + .andReturn().getResponse().getContentAsString(); + + System.out.println("testAdd response:" + responseString); + + String responseString2 = mockMvc.perform( + post("/role/add") + .contentType(MediaType.APPLICATION_JSON) + .headers(httpHeaders) + .content(content)) + .andExpect(MockMvcResultMatchers.status().isOk()) + .andExpect(MockMvcResultMatchers.jsonPath("$.code").value("20001")) + .andExpect(MockMvcResultMatchers.jsonPath("$.msg").value( + msgLanguageChange.getParameterMapByCode(Integer.valueOf(httpHeaders.getFirst("LanguageType")), "roleNameExist") + )) + .andReturn().getResponse().getContentAsString(); + + System.out.println("testAdd response:" + responseString2); + + } + + @Test + public void testEdit() throws Exception { + System.out.println("run testEdit......."); + + insertMockData(); + + OptRoleParam param = new OptRoleParam(); + param.setRoleId(getMockDataId()); + param.setRoleName(ROLE_NAME); + param.setDescription("Description-edit"); + param.setMenuIds("1,2,3"); + String content = (new ObjectMapper()).writeValueAsString(param); + + System.out.println("testEdit params:"+content); + + String responseString = mockMvc.perform( + post("/role/edit") + .contentType(MediaType.APPLICATION_JSON) + .headers(httpHeaders) + .content(content)) + .andExpect(MockMvcResultMatchers.status().isOk()) + .andExpect(MockMvcResultMatchers.jsonPath("$.code").value("200")) + .andReturn().getResponse().getContentAsString(); + + System.out.println("testEdit response:" + responseString); + + } + + + @Test + public void testGetListPage() throws Exception { + System.out.println("run testGetListPage......."); + + insertMockData(); + + PageSearchParam roleSearchParams = new PageSearchParam(); + roleSearchParams.setRoleName(ROLE_NAME); + + String pageString = mockMvc.perform( + get("/role/getListPage") + .contentType(MediaType.APPLICATION_JSON) + .headers(httpHeaders) + .queryParams(CommonUtil.convertToMultiValueMap(roleSearchParams)) + ) + .andExpect(status().isOk()) + .andExpect(MockMvcResultMatchers.jsonPath("$.code").value("200")) + .andExpect(MockMvcResultMatchers.jsonPath("$.data.total").value(1)) + .andReturn().getResponse().getContentAsString(); + System.out.println("testGetListPage response:" + pageString); + + } + + + @Test + public void testDelete() throws Exception { + System.out.println("run testDelete......."); + + insertMockData(); + + String responseString = deleteMockData(); + + System.out.println("testDelete response:" + responseString); + + } +} + diff --git a/dongjian-dashboard-back-controller/src/test/java/com/dongjian/dashboard/back/controller/AdminUserControllerTest.java b/dongjian-dashboard-back-controller/src/test/java/com/dongjian/dashboard/back/controller/AdminUserControllerTest.java new file mode 100644 index 0000000..630b100 --- /dev/null +++ b/dongjian-dashboard-back-controller/src/test/java/com/dongjian/dashboard/back/controller/AdminUserControllerTest.java @@ -0,0 +1,356 @@ +package com.dongjian.dashboard.back.controller; + +import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; +import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.post; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; + +import com.alibaba.fastjson2.JSONArray; +import com.alibaba.fastjson2.JSONObject; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.dongjian.dashboard.back.common.language.msg.MsgLanguageChange; +import com.dongjian.dashboard.back.dto.account.LoginParam; +import com.dongjian.dashboard.back.dto.user.DeleteUserParam; +import com.dongjian.dashboard.back.dto.user.ModifyPassword; +import com.dongjian.dashboard.back.dto.user.OptUserParam; +import com.dongjian.dashboard.back.dto.user.PageSearchParam; +import com.dongjian.dashboard.back.dto.user.ResetPassword; +import com.dongjian.dashboard.back.dto.user.SwitchMfaBind; +import com.dongjian.dashboard.back.util.CommonUtil; + +import org.junit.After; +import org.junit.Before; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.http.HttpHeaders; +import org.springframework.http.MediaType; +import org.springframework.test.context.junit4.SpringRunner; +import org.springframework.test.web.servlet.MockMvc; +import org.springframework.test.web.servlet.result.MockMvcResultMatchers; +import org.springframework.web.context.WebApplicationContext; + +import jakarta.annotation.Resource; + + +@RunWith(SpringRunner.class) +@SpringBootTest +@AutoConfigureMockMvc +public class AdminUserControllerTest { + + + @Resource + private MsgLanguageChange msgLanguageChange; + + @Resource + protected MockMvc mockMvc; + + @Autowired + protected WebApplicationContext wac; + + protected HttpHeaders httpHeaders = new HttpHeaders(); + + + private static final String USER_NAME = "junit-test-admin-UserName"; + + + @Before() + public void setup() throws Exception { + System.out.println("run before......."); + LoginParam loginParam = new LoginParam(); + loginParam.setLoginname("admin"); + loginParam.setPassword("123456"); + + String content = (new ObjectMapper()).writeValueAsString(loginParam); + + System.out.println(content); + + HttpHeaders loginHeaders = new HttpHeaders(); + loginHeaders.set("LanguageType", "0"); + String responseString = mockMvc.perform( + post("/account/login") + .contentType(MediaType.APPLICATION_JSON) + .headers(loginHeaders) + .content(content) + ).andReturn().getResponse().getContentAsString(); + + System.out.println("setup response:" + responseString); + + JSONObject loginRespObject = JSONObject.parseObject(responseString).getJSONObject("data"); + httpHeaders.set("LoginName", loginRespObject.getString("loginName")); + httpHeaders.set("AccessToken", loginRespObject.getString("accessToken")); + httpHeaders.set("UserId", loginRespObject.getString("userId")); + httpHeaders.set("CompanyId", loginRespObject.getString("companyId")); + httpHeaders.set("LanguageType", "2"); + httpHeaders.set("UTCOffset", "-480"); + + deleteMockData(); + } + + @After() + public void after() throws Exception { + System.out.println("run after......."); + deleteMockData(); + + } + + private String deleteMockData() throws Exception { + long userId = getMockDataId(); + + DeleteUserParam param = new DeleteUserParam(); + param.setUserIds(userId+""); + String content = (new ObjectMapper()).writeValueAsString(param); + + String responseString = mockMvc.perform( + post("/user/batchDelete") + .contentType(MediaType.APPLICATION_JSON) + .headers(httpHeaders) + .content(content)) + .andExpect(MockMvcResultMatchers.status().isOk()) + .andExpect(MockMvcResultMatchers.jsonPath("$.code").value("200")) + .andReturn().getResponse().getContentAsString(); + return responseString; + } + + private void insertMockData() throws Exception { + System.out.println("run insertMockData......."); + long userId = getMockDataId(); + if (-1 == userId) { + OptUserParam param = createMockData(); + String content = (new ObjectMapper()).writeValueAsString(param); + + System.out.println("testAdd params:"+content); + + String responseString = mockMvc.perform( + post("/user/add") + .contentType(MediaType.APPLICATION_JSON) + .headers(httpHeaders) + .content(content)) + .andExpect(MockMvcResultMatchers.status().isOk()) + .andExpect(MockMvcResultMatchers.jsonPath("$.code").value("200")) + .andReturn().getResponse().getContentAsString(); + } + } + + private OptUserParam createMockData() throws Exception { + OptUserParam param = new OptUserParam(); + param.setUsername(USER_NAME); + param.setCompanyId(2L); + param.setEmail("9386@qq.com"); + param.setMobileNumber("+86-18766667777"); +// param.setRoleId(9L); + param.setUsername(USER_NAME); + param.setUserType(2); + return param; + } + + private long getMockDataId() throws Exception { + PageSearchParam userSearchParams = new PageSearchParam(); + userSearchParams.setKeyword(USER_NAME); + + String pageString = mockMvc.perform( + get("/user/getListPage") + .contentType(MediaType.APPLICATION_JSON) + .headers(httpHeaders) + .queryParams(CommonUtil.convertToMultiValueMap(userSearchParams)) + ) + .andExpect(status().isOk()) + .andExpect(MockMvcResultMatchers.jsonPath("$.code").value("200")) + .andReturn().getResponse().getContentAsString(); + System.out.println("getMockDataId :" + pageString); + JSONObject pageObject = JSONObject.parseObject(pageString); + + JSONArray list = pageObject.getJSONObject("data").getJSONArray("list"); + return list.size() == 0 ? -1L : list.getJSONObject(0).getLongValue("userId"); + } + + @Test + public void testAdd() throws Exception { + System.out.println("run testAdd......."); + + OptUserParam param = createMockData(); + String content = (new ObjectMapper()).writeValueAsString(param); + + System.out.println("testAdd params:"+content); + + String responseString = mockMvc.perform( + post("/user/add") + .contentType(MediaType.APPLICATION_JSON) + .headers(httpHeaders) + .content(content)) + .andExpect(MockMvcResultMatchers.status().isOk()) + .andExpect(MockMvcResultMatchers.jsonPath("$.code").value("200")) + .andReturn().getResponse().getContentAsString(); + + System.out.println("testAdd response:" + responseString); + + String responseString2 = mockMvc.perform( + post("/user/add") + .contentType(MediaType.APPLICATION_JSON) + .headers(httpHeaders) + .content(content)) + .andExpect(MockMvcResultMatchers.status().isOk()) + .andExpect(MockMvcResultMatchers.jsonPath("$.code").value("20001")) + .andExpect(MockMvcResultMatchers.jsonPath("$.msg").value( + msgLanguageChange.getParameterMapByCode(Integer.valueOf(httpHeaders.getFirst("LanguageType")), "loginNameOrEmailHasExisted") + )) + .andReturn().getResponse().getContentAsString(); + + System.out.println("testAdd response:" + responseString2); + + } + + @Test + public void testEdit() throws Exception { + System.out.println("run testEdit......."); + + insertMockData(); + + OptUserParam param = new OptUserParam(); + param.setUserId(getMockDataId()); + param.setUsername(USER_NAME); + param.setCompanyId(2L); + param.setEmail("938@qq.com"); + param.setMobileNumber("+86-18766668888"); +// param.setRoleId(9L); + param.setUsername(USER_NAME); + param.setUserType(2); + + String content = (new ObjectMapper()).writeValueAsString(param); + + System.out.println("testEdit params:"+content); + + String responseString = mockMvc.perform( + post("/user/edit") + .contentType(MediaType.APPLICATION_JSON) + .headers(httpHeaders) + .content(content)) + .andExpect(MockMvcResultMatchers.status().isOk()) + .andExpect(MockMvcResultMatchers.jsonPath("$.code").value("200")) + .andReturn().getResponse().getContentAsString(); + + System.out.println("testEdit response:" + responseString); + + } + + @Test + public void testBatchResetPassword() throws Exception { + System.out.println("run testBatchResetPassword......."); + + insertMockData(); + + ResetPassword param = new ResetPassword(); + param.setUserIds(getMockDataId()+""); + + String content = (new ObjectMapper()).writeValueAsString(param); + + System.out.println("testBatchResetPassword params:"+content); + + String responseString = mockMvc.perform( + post("/user/batchResetPassword") + .contentType(MediaType.APPLICATION_JSON) + .headers(httpHeaders) + .content(content)) + .andExpect(MockMvcResultMatchers.status().isOk()) + .andExpect(MockMvcResultMatchers.jsonPath("$.code").value("200")) + .andReturn().getResponse().getContentAsString(); + + System.out.println("testBatchResetPassword response:" + responseString); + + } + + @Test + public void testModifyPassword() throws Exception { + System.out.println("run testModifyPassword......."); + + insertMockData(); + + ModifyPassword param = new ModifyPassword(); + param.setOldPassword("123456"); + param.setNewPassword("123456"); + + String content = (new ObjectMapper()).writeValueAsString(param); + + System.out.println("testModifyPassword params:"+content); + + String responseString = mockMvc.perform( + post("/user/modifyPassword") + .contentType(MediaType.APPLICATION_JSON) + .headers(httpHeaders) + .content(content)) + .andExpect(MockMvcResultMatchers.status().isOk()) + .andExpect(MockMvcResultMatchers.jsonPath("$.code").value("20001")) + .andExpect(MockMvcResultMatchers.jsonPath("$.msg").value( + msgLanguageChange.getParameterMapByCode(Integer.valueOf(httpHeaders.getFirst("LanguageType")), "pwdFormatError") + )) + .andReturn().getResponse().getContentAsString(); + + System.out.println("testModifyPassword response:" + responseString); + + } + + @Test + public void testUnbindMfa() throws Exception { + System.out.println("run testUnbindMfa......."); + + insertMockData(); + + SwitchMfaBind param = new SwitchMfaBind(); + param.setUserIds(getMockDataId()+""); + + String content = (new ObjectMapper()).writeValueAsString(param); + + System.out.println("testUnbindMfa params:"+content); + + String responseString = mockMvc.perform( + post("/user/unbindMfa") + .contentType(MediaType.APPLICATION_JSON) + .headers(httpHeaders) + .content(content)) + .andExpect(MockMvcResultMatchers.status().isOk()) + .andExpect(MockMvcResultMatchers.jsonPath("$.code").value("200")) + .andReturn().getResponse().getContentAsString(); + + System.out.println("testUnbindMfa response:" + responseString); + + } + + + @Test + public void testGetListPage() throws Exception { + System.out.println("run testGetListPage......."); + + insertMockData(); + + PageSearchParam userSearchParams = new PageSearchParam(); + userSearchParams.setKeyword(USER_NAME); + + String pageString = mockMvc.perform( + get("/user/getListPage") + .contentType(MediaType.APPLICATION_JSON) + .headers(httpHeaders) + .queryParams(CommonUtil.convertToMultiValueMap(userSearchParams)) + ) + .andExpect(status().isOk()) + .andExpect(MockMvcResultMatchers.jsonPath("$.code").value("200")) + .andExpect(MockMvcResultMatchers.jsonPath("$.data.total").value(1)) + .andReturn().getResponse().getContentAsString(); + System.out.println("testGetListPage response:" + pageString); + + } + + + @Test + public void testDelete() throws Exception { + System.out.println("run testDelete......."); + + insertMockData(); + + String responseString = deleteMockData(); + + System.out.println("testDelete response:" + responseString); + + } +} + diff --git a/dongjian-dashboard-back-dao/.gitignore b/dongjian-dashboard-back-dao/.gitignore new file mode 100644 index 0000000..aa23915 --- /dev/null +++ b/dongjian-dashboard-back-dao/.gitignore @@ -0,0 +1,15 @@ +/target/ +/logs/ +/.idea/ +*.iml +*.bak +*.log +/.settings/ +*.project +*.classpath +*.factorypath +*.springBeans +/.apt_generated/ +/.externalToolBuilders/ +/bin/ +application-*.properties diff --git a/dongjian-dashboard-back-dao/pom.xml b/dongjian-dashboard-back-dao/pom.xml new file mode 100644 index 0000000..4478e96 --- /dev/null +++ b/dongjian-dashboard-back-dao/pom.xml @@ -0,0 +1,70 @@ + + + 4.0.0 + + com.techsor + dongjian-dashboard-back + 0.0.1-SNAPSHOT + + dongjian-dashboard-back-dao + dongjian-dashboard-back-dao + http://maven.apache.org + + UTF-8 + + + + + com.techsor + dongjian-dashboard-back-model + 0.0.1-SNAPSHOT + + + + junit + junit + test + + + + + + + org.mybatis.generator + mybatis-generator-maven-plugin + 1.3.5 + + + org.mybatis.generator + mybatis-generator-core + 1.3.5 + + + com.mysql + mysql-connector-j + 9.3.0 + + + + + mybatis generator + package + + generate + + + + + + true + + true + + src/main/resources/mybatis-generator/generatorConfig.xml + + + + + + diff --git a/dongjian-dashboard-back-dao/runGenerator.bat b/dongjian-dashboard-back-dao/runGenerator.bat new file mode 100644 index 0000000..8638666 --- /dev/null +++ b/dongjian-dashboard-back-dao/runGenerator.bat @@ -0,0 +1,3 @@ + +call mvn mybatis-generator:generate -e +pause \ No newline at end of file diff --git a/dongjian-dashboard-back-dao/runGenerator.sh b/dongjian-dashboard-back-dao/runGenerator.sh new file mode 100644 index 0000000..5d580f2 --- /dev/null +++ b/dongjian-dashboard-back-dao/runGenerator.sh @@ -0,0 +1 @@ +mvn mybatis-generator:generate -e diff --git a/dongjian-dashboard-back-dao/src/main/java/com/dongjian/dashboard/back/dao/auto/AlertHandleHistoryMapper.java b/dongjian-dashboard-back-dao/src/main/java/com/dongjian/dashboard/back/dao/auto/AlertHandleHistoryMapper.java new file mode 100644 index 0000000..bbbd90a --- /dev/null +++ b/dongjian-dashboard-back-dao/src/main/java/com/dongjian/dashboard/back/dao/auto/AlertHandleHistoryMapper.java @@ -0,0 +1,120 @@ +package com.dongjian.dashboard.back.dao.auto; + +import com.dongjian.dashboard.back.model.AlertHandleHistory; +import com.dongjian.dashboard.back.model.AlertHandleHistoryExample; +import java.util.List; +import org.apache.ibatis.annotations.Param; + +public interface AlertHandleHistoryMapper { + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table alert_handle_history + * + * @mbg.generated + */ + long countByExample(AlertHandleHistoryExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table alert_handle_history + * + * @mbg.generated + */ + int deleteByExample(AlertHandleHistoryExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table alert_handle_history + * + * @mbg.generated + */ + int deleteByPrimaryKey(Long id); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table alert_handle_history + * + * @mbg.generated + */ + int insert(AlertHandleHistory record); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table alert_handle_history + * + * @mbg.generated + */ + int insertSelective(AlertHandleHistory record); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table alert_handle_history + * + * @mbg.generated + */ + List selectByExampleWithBLOBs(AlertHandleHistoryExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table alert_handle_history + * + * @mbg.generated + */ + List selectByExample(AlertHandleHistoryExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table alert_handle_history + * + * @mbg.generated + */ + AlertHandleHistory selectByPrimaryKey(Long id); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table alert_handle_history + * + * @mbg.generated + */ + int updateByExampleSelective(@Param("record") AlertHandleHistory record, @Param("example") AlertHandleHistoryExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table alert_handle_history + * + * @mbg.generated + */ + int updateByExampleWithBLOBs(@Param("record") AlertHandleHistory record, @Param("example") AlertHandleHistoryExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table alert_handle_history + * + * @mbg.generated + */ + int updateByExample(@Param("record") AlertHandleHistory record, @Param("example") AlertHandleHistoryExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table alert_handle_history + * + * @mbg.generated + */ + int updateByPrimaryKeySelective(AlertHandleHistory record); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table alert_handle_history + * + * @mbg.generated + */ + int updateByPrimaryKeyWithBLOBs(AlertHandleHistory record); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table alert_handle_history + * + * @mbg.generated + */ + int updateByPrimaryKey(AlertHandleHistory record); +} \ No newline at end of file diff --git a/dongjian-dashboard-back-dao/src/main/java/com/dongjian/dashboard/back/dao/auto/AlertHistoryMapper.java b/dongjian-dashboard-back-dao/src/main/java/com/dongjian/dashboard/back/dao/auto/AlertHistoryMapper.java new file mode 100644 index 0000000..1846c12 --- /dev/null +++ b/dongjian-dashboard-back-dao/src/main/java/com/dongjian/dashboard/back/dao/auto/AlertHistoryMapper.java @@ -0,0 +1,96 @@ +package com.dongjian.dashboard.back.dao.auto; + +import com.dongjian.dashboard.back.model.AlertHistory; +import com.dongjian.dashboard.back.model.AlertHistoryExample; +import java.util.List; +import org.apache.ibatis.annotations.Param; + +public interface AlertHistoryMapper { + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table alert_history + * + * @mbg.generated + */ + long countByExample(AlertHistoryExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table alert_history + * + * @mbg.generated + */ + int deleteByExample(AlertHistoryExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table alert_history + * + * @mbg.generated + */ + int deleteByPrimaryKey(Long id); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table alert_history + * + * @mbg.generated + */ + int insert(AlertHistory record); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table alert_history + * + * @mbg.generated + */ + int insertSelective(AlertHistory record); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table alert_history + * + * @mbg.generated + */ + List selectByExample(AlertHistoryExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table alert_history + * + * @mbg.generated + */ + AlertHistory selectByPrimaryKey(Long id); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table alert_history + * + * @mbg.generated + */ + int updateByExampleSelective(@Param("record") AlertHistory record, @Param("example") AlertHistoryExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table alert_history + * + * @mbg.generated + */ + int updateByExample(@Param("record") AlertHistory record, @Param("example") AlertHistoryExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table alert_history + * + * @mbg.generated + */ + int updateByPrimaryKeySelective(AlertHistory record); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table alert_history + * + * @mbg.generated + */ + int updateByPrimaryKey(AlertHistory record); +} \ No newline at end of file diff --git a/dongjian-dashboard-back-dao/src/main/java/com/dongjian/dashboard/back/dao/auto/BaStatusStatisticsMapper.java b/dongjian-dashboard-back-dao/src/main/java/com/dongjian/dashboard/back/dao/auto/BaStatusStatisticsMapper.java new file mode 100644 index 0000000..f5728b4 --- /dev/null +++ b/dongjian-dashboard-back-dao/src/main/java/com/dongjian/dashboard/back/dao/auto/BaStatusStatisticsMapper.java @@ -0,0 +1,96 @@ +package com.dongjian.dashboard.back.dao.auto; + +import com.dongjian.dashboard.back.model.BaStatusStatistics; +import com.dongjian.dashboard.back.model.BaStatusStatisticsExample; +import java.util.List; +import org.apache.ibatis.annotations.Param; + +public interface BaStatusStatisticsMapper { + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table ba_status_statistics + * + * @mbg.generated + */ + long countByExample(BaStatusStatisticsExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table ba_status_statistics + * + * @mbg.generated + */ + int deleteByExample(BaStatusStatisticsExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table ba_status_statistics + * + * @mbg.generated + */ + int deleteByPrimaryKey(Integer id); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table ba_status_statistics + * + * @mbg.generated + */ + int insert(BaStatusStatistics record); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table ba_status_statistics + * + * @mbg.generated + */ + int insertSelective(BaStatusStatistics record); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table ba_status_statistics + * + * @mbg.generated + */ + List selectByExample(BaStatusStatisticsExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table ba_status_statistics + * + * @mbg.generated + */ + BaStatusStatistics selectByPrimaryKey(Integer id); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table ba_status_statistics + * + * @mbg.generated + */ + int updateByExampleSelective(@Param("record") BaStatusStatistics record, @Param("example") BaStatusStatisticsExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table ba_status_statistics + * + * @mbg.generated + */ + int updateByExample(@Param("record") BaStatusStatistics record, @Param("example") BaStatusStatisticsExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table ba_status_statistics + * + * @mbg.generated + */ + int updateByPrimaryKeySelective(BaStatusStatistics record); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table ba_status_statistics + * + * @mbg.generated + */ + int updateByPrimaryKey(BaStatusStatistics record); +} \ No newline at end of file diff --git a/dongjian-dashboard-back-dao/src/main/java/com/dongjian/dashboard/back/dao/auto/BasicBuildingMapper.java b/dongjian-dashboard-back-dao/src/main/java/com/dongjian/dashboard/back/dao/auto/BasicBuildingMapper.java new file mode 100644 index 0000000..25a3e05 --- /dev/null +++ b/dongjian-dashboard-back-dao/src/main/java/com/dongjian/dashboard/back/dao/auto/BasicBuildingMapper.java @@ -0,0 +1,120 @@ +package com.dongjian.dashboard.back.dao.auto; + +import com.dongjian.dashboard.back.model.BasicBuilding; +import com.dongjian.dashboard.back.model.BasicBuildingExample; +import java.util.List; +import org.apache.ibatis.annotations.Param; + +public interface BasicBuildingMapper { + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table basic_building + * + * @mbg.generated + */ + long countByExample(BasicBuildingExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table basic_building + * + * @mbg.generated + */ + int deleteByExample(BasicBuildingExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table basic_building + * + * @mbg.generated + */ + int deleteByPrimaryKey(Long buildingId); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table basic_building + * + * @mbg.generated + */ + int insert(BasicBuilding record); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table basic_building + * + * @mbg.generated + */ + int insertSelective(BasicBuilding record); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table basic_building + * + * @mbg.generated + */ + List selectByExampleWithBLOBs(BasicBuildingExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table basic_building + * + * @mbg.generated + */ + List selectByExample(BasicBuildingExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table basic_building + * + * @mbg.generated + */ + BasicBuilding selectByPrimaryKey(Long buildingId); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table basic_building + * + * @mbg.generated + */ + int updateByExampleSelective(@Param("record") BasicBuilding record, @Param("example") BasicBuildingExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table basic_building + * + * @mbg.generated + */ + int updateByExampleWithBLOBs(@Param("record") BasicBuilding record, @Param("example") BasicBuildingExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table basic_building + * + * @mbg.generated + */ + int updateByExample(@Param("record") BasicBuilding record, @Param("example") BasicBuildingExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table basic_building + * + * @mbg.generated + */ + int updateByPrimaryKeySelective(BasicBuilding record); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table basic_building + * + * @mbg.generated + */ + int updateByPrimaryKeyWithBLOBs(BasicBuilding record); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table basic_building + * + * @mbg.generated + */ + int updateByPrimaryKey(BasicBuilding record); +} \ No newline at end of file diff --git a/dongjian-dashboard-back-dao/src/main/java/com/dongjian/dashboard/back/dao/auto/BasicCompanyMapper.java b/dongjian-dashboard-back-dao/src/main/java/com/dongjian/dashboard/back/dao/auto/BasicCompanyMapper.java new file mode 100644 index 0000000..c201190 --- /dev/null +++ b/dongjian-dashboard-back-dao/src/main/java/com/dongjian/dashboard/back/dao/auto/BasicCompanyMapper.java @@ -0,0 +1,120 @@ +package com.dongjian.dashboard.back.dao.auto; + +import com.dongjian.dashboard.back.model.BasicCompany; +import com.dongjian.dashboard.back.model.BasicCompanyExample; +import java.util.List; +import org.apache.ibatis.annotations.Param; + +public interface BasicCompanyMapper { + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table basic_company + * + * @mbg.generated + */ + long countByExample(BasicCompanyExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table basic_company + * + * @mbg.generated + */ + int deleteByExample(BasicCompanyExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table basic_company + * + * @mbg.generated + */ + int deleteByPrimaryKey(Long id); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table basic_company + * + * @mbg.generated + */ + int insert(BasicCompany record); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table basic_company + * + * @mbg.generated + */ + int insertSelective(BasicCompany record); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table basic_company + * + * @mbg.generated + */ + List selectByExampleWithBLOBs(BasicCompanyExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table basic_company + * + * @mbg.generated + */ + List selectByExample(BasicCompanyExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table basic_company + * + * @mbg.generated + */ + BasicCompany selectByPrimaryKey(Long id); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table basic_company + * + * @mbg.generated + */ + int updateByExampleSelective(@Param("record") BasicCompany record, @Param("example") BasicCompanyExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table basic_company + * + * @mbg.generated + */ + int updateByExampleWithBLOBs(@Param("record") BasicCompany record, @Param("example") BasicCompanyExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table basic_company + * + * @mbg.generated + */ + int updateByExample(@Param("record") BasicCompany record, @Param("example") BasicCompanyExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table basic_company + * + * @mbg.generated + */ + int updateByPrimaryKeySelective(BasicCompany record); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table basic_company + * + * @mbg.generated + */ + int updateByPrimaryKeyWithBLOBs(BasicCompany record); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table basic_company + * + * @mbg.generated + */ + int updateByPrimaryKey(BasicCompany record); +} \ No newline at end of file diff --git a/dongjian-dashboard-back-dao/src/main/java/com/dongjian/dashboard/back/dao/auto/BasicMenuMapper.java b/dongjian-dashboard-back-dao/src/main/java/com/dongjian/dashboard/back/dao/auto/BasicMenuMapper.java new file mode 100644 index 0000000..58281d6 --- /dev/null +++ b/dongjian-dashboard-back-dao/src/main/java/com/dongjian/dashboard/back/dao/auto/BasicMenuMapper.java @@ -0,0 +1,96 @@ +package com.dongjian.dashboard.back.dao.auto; + +import com.dongjian.dashboard.back.model.BasicMenu; +import com.dongjian.dashboard.back.model.BasicMenuExample; +import java.util.List; +import org.apache.ibatis.annotations.Param; + +public interface BasicMenuMapper { + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table basic_menu + * + * @mbg.generated + */ + long countByExample(BasicMenuExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table basic_menu + * + * @mbg.generated + */ + int deleteByExample(BasicMenuExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table basic_menu + * + * @mbg.generated + */ + int deleteByPrimaryKey(Long id); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table basic_menu + * + * @mbg.generated + */ + int insert(BasicMenu record); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table basic_menu + * + * @mbg.generated + */ + int insertSelective(BasicMenu record); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table basic_menu + * + * @mbg.generated + */ + List selectByExample(BasicMenuExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table basic_menu + * + * @mbg.generated + */ + BasicMenu selectByPrimaryKey(Long id); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table basic_menu + * + * @mbg.generated + */ + int updateByExampleSelective(@Param("record") BasicMenu record, @Param("example") BasicMenuExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table basic_menu + * + * @mbg.generated + */ + int updateByExample(@Param("record") BasicMenu record, @Param("example") BasicMenuExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table basic_menu + * + * @mbg.generated + */ + int updateByPrimaryKeySelective(BasicMenu record); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table basic_menu + * + * @mbg.generated + */ + int updateByPrimaryKey(BasicMenu record); +} \ No newline at end of file diff --git a/dongjian-dashboard-back-dao/src/main/java/com/dongjian/dashboard/back/dao/auto/BasicRoleMapper.java b/dongjian-dashboard-back-dao/src/main/java/com/dongjian/dashboard/back/dao/auto/BasicRoleMapper.java new file mode 100644 index 0000000..36c710d --- /dev/null +++ b/dongjian-dashboard-back-dao/src/main/java/com/dongjian/dashboard/back/dao/auto/BasicRoleMapper.java @@ -0,0 +1,96 @@ +package com.dongjian.dashboard.back.dao.auto; + +import com.dongjian.dashboard.back.model.BasicRole; +import com.dongjian.dashboard.back.model.BasicRoleExample; +import java.util.List; +import org.apache.ibatis.annotations.Param; + +public interface BasicRoleMapper { + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table basic_role + * + * @mbg.generated + */ + long countByExample(BasicRoleExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table basic_role + * + * @mbg.generated + */ + int deleteByExample(BasicRoleExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table basic_role + * + * @mbg.generated + */ + int deleteByPrimaryKey(Long id); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table basic_role + * + * @mbg.generated + */ + int insert(BasicRole record); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table basic_role + * + * @mbg.generated + */ + int insertSelective(BasicRole record); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table basic_role + * + * @mbg.generated + */ + List selectByExample(BasicRoleExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table basic_role + * + * @mbg.generated + */ + BasicRole selectByPrimaryKey(Long id); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table basic_role + * + * @mbg.generated + */ + int updateByExampleSelective(@Param("record") BasicRole record, @Param("example") BasicRoleExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table basic_role + * + * @mbg.generated + */ + int updateByExample(@Param("record") BasicRole record, @Param("example") BasicRoleExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table basic_role + * + * @mbg.generated + */ + int updateByPrimaryKeySelective(BasicRole record); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table basic_role + * + * @mbg.generated + */ + int updateByPrimaryKey(BasicRole record); +} \ No newline at end of file diff --git a/dongjian-dashboard-back-dao/src/main/java/com/dongjian/dashboard/back/dao/auto/BasicRoleMenuRelationMapper.java b/dongjian-dashboard-back-dao/src/main/java/com/dongjian/dashboard/back/dao/auto/BasicRoleMenuRelationMapper.java new file mode 100644 index 0000000..5440827 --- /dev/null +++ b/dongjian-dashboard-back-dao/src/main/java/com/dongjian/dashboard/back/dao/auto/BasicRoleMenuRelationMapper.java @@ -0,0 +1,64 @@ +package com.dongjian.dashboard.back.dao.auto; + +import com.dongjian.dashboard.back.model.BasicRoleMenuRelation; +import com.dongjian.dashboard.back.model.BasicRoleMenuRelationExample; +import java.util.List; +import org.apache.ibatis.annotations.Param; + +public interface BasicRoleMenuRelationMapper { + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table basic_role_menu_relation + * + * @mbg.generated + */ + long countByExample(BasicRoleMenuRelationExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table basic_role_menu_relation + * + * @mbg.generated + */ + int deleteByExample(BasicRoleMenuRelationExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table basic_role_menu_relation + * + * @mbg.generated + */ + int insert(BasicRoleMenuRelation record); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table basic_role_menu_relation + * + * @mbg.generated + */ + int insertSelective(BasicRoleMenuRelation record); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table basic_role_menu_relation + * + * @mbg.generated + */ + List selectByExample(BasicRoleMenuRelationExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table basic_role_menu_relation + * + * @mbg.generated + */ + int updateByExampleSelective(@Param("record") BasicRoleMenuRelation record, @Param("example") BasicRoleMenuRelationExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table basic_role_menu_relation + * + * @mbg.generated + */ + int updateByExample(@Param("record") BasicRoleMenuRelation record, @Param("example") BasicRoleMenuRelationExample example); +} \ No newline at end of file diff --git a/dongjian-dashboard-back-dao/src/main/java/com/dongjian/dashboard/back/dao/auto/BasicRoleUserRelationMapper.java b/dongjian-dashboard-back-dao/src/main/java/com/dongjian/dashboard/back/dao/auto/BasicRoleUserRelationMapper.java new file mode 100644 index 0000000..1add083 --- /dev/null +++ b/dongjian-dashboard-back-dao/src/main/java/com/dongjian/dashboard/back/dao/auto/BasicRoleUserRelationMapper.java @@ -0,0 +1,64 @@ +package com.dongjian.dashboard.back.dao.auto; + +import com.dongjian.dashboard.back.model.BasicRoleUserRelation; +import com.dongjian.dashboard.back.model.BasicRoleUserRelationExample; +import java.util.List; +import org.apache.ibatis.annotations.Param; + +public interface BasicRoleUserRelationMapper { + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table basic_role_user_relation + * + * @mbg.generated + */ + long countByExample(BasicRoleUserRelationExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table basic_role_user_relation + * + * @mbg.generated + */ + int deleteByExample(BasicRoleUserRelationExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table basic_role_user_relation + * + * @mbg.generated + */ + int insert(BasicRoleUserRelation record); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table basic_role_user_relation + * + * @mbg.generated + */ + int insertSelective(BasicRoleUserRelation record); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table basic_role_user_relation + * + * @mbg.generated + */ + List selectByExample(BasicRoleUserRelationExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table basic_role_user_relation + * + * @mbg.generated + */ + int updateByExampleSelective(@Param("record") BasicRoleUserRelation record, @Param("example") BasicRoleUserRelationExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table basic_role_user_relation + * + * @mbg.generated + */ + int updateByExample(@Param("record") BasicRoleUserRelation record, @Param("example") BasicRoleUserRelationExample example); +} \ No newline at end of file diff --git a/dongjian-dashboard-back-dao/src/main/java/com/dongjian/dashboard/back/dao/auto/BasicUserMapper.java b/dongjian-dashboard-back-dao/src/main/java/com/dongjian/dashboard/back/dao/auto/BasicUserMapper.java new file mode 100644 index 0000000..f605eda --- /dev/null +++ b/dongjian-dashboard-back-dao/src/main/java/com/dongjian/dashboard/back/dao/auto/BasicUserMapper.java @@ -0,0 +1,96 @@ +package com.dongjian.dashboard.back.dao.auto; + +import com.dongjian.dashboard.back.model.BasicUser; +import com.dongjian.dashboard.back.model.BasicUserExample; +import java.util.List; +import org.apache.ibatis.annotations.Param; + +public interface BasicUserMapper { + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table basic_user + * + * @mbg.generated + */ + long countByExample(BasicUserExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table basic_user + * + * @mbg.generated + */ + int deleteByExample(BasicUserExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table basic_user + * + * @mbg.generated + */ + int deleteByPrimaryKey(Long id); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table basic_user + * + * @mbg.generated + */ + int insert(BasicUser record); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table basic_user + * + * @mbg.generated + */ + int insertSelective(BasicUser record); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table basic_user + * + * @mbg.generated + */ + List selectByExample(BasicUserExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table basic_user + * + * @mbg.generated + */ + BasicUser selectByPrimaryKey(Long id); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table basic_user + * + * @mbg.generated + */ + int updateByExampleSelective(@Param("record") BasicUser record, @Param("example") BasicUserExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table basic_user + * + * @mbg.generated + */ + int updateByExample(@Param("record") BasicUser record, @Param("example") BasicUserExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table basic_user + * + * @mbg.generated + */ + int updateByPrimaryKeySelective(BasicUser record); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table basic_user + * + * @mbg.generated + */ + int updateByPrimaryKey(BasicUser record); +} \ No newline at end of file diff --git a/dongjian-dashboard-back-dao/src/main/java/com/dongjian/dashboard/back/dao/auto/DashboardLevelRoleMapper.java b/dongjian-dashboard-back-dao/src/main/java/com/dongjian/dashboard/back/dao/auto/DashboardLevelRoleMapper.java new file mode 100644 index 0000000..283e458 --- /dev/null +++ b/dongjian-dashboard-back-dao/src/main/java/com/dongjian/dashboard/back/dao/auto/DashboardLevelRoleMapper.java @@ -0,0 +1,96 @@ +package com.dongjian.dashboard.back.dao.auto; + +import com.dongjian.dashboard.back.model.DashboardLevelRole; +import com.dongjian.dashboard.back.model.DashboardLevelRoleExample; +import java.util.List; +import org.apache.ibatis.annotations.Param; + +public interface DashboardLevelRoleMapper { + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table dashboard_level_role + * + * @mbg.generated + */ + long countByExample(DashboardLevelRoleExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table dashboard_level_role + * + * @mbg.generated + */ + int deleteByExample(DashboardLevelRoleExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table dashboard_level_role + * + * @mbg.generated + */ + int deleteByPrimaryKey(Long id); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table dashboard_level_role + * + * @mbg.generated + */ + int insert(DashboardLevelRole record); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table dashboard_level_role + * + * @mbg.generated + */ + int insertSelective(DashboardLevelRole record); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table dashboard_level_role + * + * @mbg.generated + */ + List selectByExample(DashboardLevelRoleExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table dashboard_level_role + * + * @mbg.generated + */ + DashboardLevelRole selectByPrimaryKey(Long id); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table dashboard_level_role + * + * @mbg.generated + */ + int updateByExampleSelective(@Param("record") DashboardLevelRole record, @Param("example") DashboardLevelRoleExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table dashboard_level_role + * + * @mbg.generated + */ + int updateByExample(@Param("record") DashboardLevelRole record, @Param("example") DashboardLevelRoleExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table dashboard_level_role + * + * @mbg.generated + */ + int updateByPrimaryKeySelective(DashboardLevelRole record); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table dashboard_level_role + * + * @mbg.generated + */ + int updateByPrimaryKey(DashboardLevelRole record); +} \ No newline at end of file diff --git a/dongjian-dashboard-back-dao/src/main/java/com/dongjian/dashboard/back/dao/auto/DashboardOperationLogMapper.java b/dongjian-dashboard-back-dao/src/main/java/com/dongjian/dashboard/back/dao/auto/DashboardOperationLogMapper.java new file mode 100644 index 0000000..848c3a0 --- /dev/null +++ b/dongjian-dashboard-back-dao/src/main/java/com/dongjian/dashboard/back/dao/auto/DashboardOperationLogMapper.java @@ -0,0 +1,120 @@ +package com.dongjian.dashboard.back.dao.auto; + +import com.dongjian.dashboard.back.model.DashboardOperationLog; +import com.dongjian.dashboard.back.model.DashboardOperationLogExample; +import java.util.List; +import org.apache.ibatis.annotations.Param; + +public interface DashboardOperationLogMapper { + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table dashboard_operation_log + * + * @mbg.generated + */ + long countByExample(DashboardOperationLogExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table dashboard_operation_log + * + * @mbg.generated + */ + int deleteByExample(DashboardOperationLogExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table dashboard_operation_log + * + * @mbg.generated + */ + int deleteByPrimaryKey(Long id); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table dashboard_operation_log + * + * @mbg.generated + */ + int insert(DashboardOperationLog record); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table dashboard_operation_log + * + * @mbg.generated + */ + int insertSelective(DashboardOperationLog record); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table dashboard_operation_log + * + * @mbg.generated + */ + List selectByExampleWithBLOBs(DashboardOperationLogExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table dashboard_operation_log + * + * @mbg.generated + */ + List selectByExample(DashboardOperationLogExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table dashboard_operation_log + * + * @mbg.generated + */ + DashboardOperationLog selectByPrimaryKey(Long id); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table dashboard_operation_log + * + * @mbg.generated + */ + int updateByExampleSelective(@Param("record") DashboardOperationLog record, @Param("example") DashboardOperationLogExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table dashboard_operation_log + * + * @mbg.generated + */ + int updateByExampleWithBLOBs(@Param("record") DashboardOperationLog record, @Param("example") DashboardOperationLogExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table dashboard_operation_log + * + * @mbg.generated + */ + int updateByExample(@Param("record") DashboardOperationLog record, @Param("example") DashboardOperationLogExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table dashboard_operation_log + * + * @mbg.generated + */ + int updateByPrimaryKeySelective(DashboardOperationLog record); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table dashboard_operation_log + * + * @mbg.generated + */ + int updateByPrimaryKeyWithBLOBs(DashboardOperationLog record); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table dashboard_operation_log + * + * @mbg.generated + */ + int updateByPrimaryKey(DashboardOperationLog record); +} \ No newline at end of file diff --git a/dongjian-dashboard-back-dao/src/main/java/com/dongjian/dashboard/back/dao/auto/DashboardRealtimeMeasureMapper.java b/dongjian-dashboard-back-dao/src/main/java/com/dongjian/dashboard/back/dao/auto/DashboardRealtimeMeasureMapper.java new file mode 100644 index 0000000..4e2038b --- /dev/null +++ b/dongjian-dashboard-back-dao/src/main/java/com/dongjian/dashboard/back/dao/auto/DashboardRealtimeMeasureMapper.java @@ -0,0 +1,96 @@ +package com.dongjian.dashboard.back.dao.auto; + +import com.dongjian.dashboard.back.model.DashboardRealtimeMeasure; +import com.dongjian.dashboard.back.model.DashboardRealtimeMeasureExample; +import java.util.List; +import org.apache.ibatis.annotations.Param; + +public interface DashboardRealtimeMeasureMapper { + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table dashboard_realtime_measure + * + * @mbg.generated + */ + long countByExample(DashboardRealtimeMeasureExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table dashboard_realtime_measure + * + * @mbg.generated + */ + int deleteByExample(DashboardRealtimeMeasureExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table dashboard_realtime_measure + * + * @mbg.generated + */ + int deleteByPrimaryKey(String deviceId); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table dashboard_realtime_measure + * + * @mbg.generated + */ + int insert(DashboardRealtimeMeasure record); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table dashboard_realtime_measure + * + * @mbg.generated + */ + int insertSelective(DashboardRealtimeMeasure record); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table dashboard_realtime_measure + * + * @mbg.generated + */ + List selectByExample(DashboardRealtimeMeasureExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table dashboard_realtime_measure + * + * @mbg.generated + */ + DashboardRealtimeMeasure selectByPrimaryKey(String deviceId); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table dashboard_realtime_measure + * + * @mbg.generated + */ + int updateByExampleSelective(@Param("record") DashboardRealtimeMeasure record, @Param("example") DashboardRealtimeMeasureExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table dashboard_realtime_measure + * + * @mbg.generated + */ + int updateByExample(@Param("record") DashboardRealtimeMeasure record, @Param("example") DashboardRealtimeMeasureExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table dashboard_realtime_measure + * + * @mbg.generated + */ + int updateByPrimaryKeySelective(DashboardRealtimeMeasure record); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table dashboard_realtime_measure + * + * @mbg.generated + */ + int updateByPrimaryKey(DashboardRealtimeMeasure record); +} \ No newline at end of file diff --git a/dongjian-dashboard-back-dao/src/main/java/com/dongjian/dashboard/back/dao/auto/DashboardRecordAccumulateMapper.java b/dongjian-dashboard-back-dao/src/main/java/com/dongjian/dashboard/back/dao/auto/DashboardRecordAccumulateMapper.java new file mode 100644 index 0000000..17f3893 --- /dev/null +++ b/dongjian-dashboard-back-dao/src/main/java/com/dongjian/dashboard/back/dao/auto/DashboardRecordAccumulateMapper.java @@ -0,0 +1,96 @@ +package com.dongjian.dashboard.back.dao.auto; + +import com.dongjian.dashboard.back.model.DashboardRecordAccumulate; +import com.dongjian.dashboard.back.model.DashboardRecordAccumulateExample; +import java.util.List; +import org.apache.ibatis.annotations.Param; + +public interface DashboardRecordAccumulateMapper { + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table dashboard_record_accumulate + * + * @mbg.generated + */ + long countByExample(DashboardRecordAccumulateExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table dashboard_record_accumulate + * + * @mbg.generated + */ + int deleteByExample(DashboardRecordAccumulateExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table dashboard_record_accumulate + * + * @mbg.generated + */ + int deleteByPrimaryKey(Long id); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table dashboard_record_accumulate + * + * @mbg.generated + */ + int insert(DashboardRecordAccumulate record); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table dashboard_record_accumulate + * + * @mbg.generated + */ + int insertSelective(DashboardRecordAccumulate record); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table dashboard_record_accumulate + * + * @mbg.generated + */ + List selectByExample(DashboardRecordAccumulateExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table dashboard_record_accumulate + * + * @mbg.generated + */ + DashboardRecordAccumulate selectByPrimaryKey(Long id); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table dashboard_record_accumulate + * + * @mbg.generated + */ + int updateByExampleSelective(@Param("record") DashboardRecordAccumulate record, @Param("example") DashboardRecordAccumulateExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table dashboard_record_accumulate + * + * @mbg.generated + */ + int updateByExample(@Param("record") DashboardRecordAccumulate record, @Param("example") DashboardRecordAccumulateExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table dashboard_record_accumulate + * + * @mbg.generated + */ + int updateByPrimaryKeySelective(DashboardRecordAccumulate record); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table dashboard_record_accumulate + * + * @mbg.generated + */ + int updateByPrimaryKey(DashboardRecordAccumulate record); +} \ No newline at end of file diff --git a/dongjian-dashboard-back-dao/src/main/java/com/dongjian/dashboard/back/dao/auto/DeviceGroupMapper.java b/dongjian-dashboard-back-dao/src/main/java/com/dongjian/dashboard/back/dao/auto/DeviceGroupMapper.java new file mode 100644 index 0000000..f568b3c --- /dev/null +++ b/dongjian-dashboard-back-dao/src/main/java/com/dongjian/dashboard/back/dao/auto/DeviceGroupMapper.java @@ -0,0 +1,96 @@ +package com.dongjian.dashboard.back.dao.auto; + +import com.dongjian.dashboard.back.model.DeviceGroup; +import com.dongjian.dashboard.back.model.DeviceGroupExample; +import java.util.List; +import org.apache.ibatis.annotations.Param; + +public interface DeviceGroupMapper { + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table device_group + * + * @mbg.generated + */ + long countByExample(DeviceGroupExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table device_group + * + * @mbg.generated + */ + int deleteByExample(DeviceGroupExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table device_group + * + * @mbg.generated + */ + int deleteByPrimaryKey(Long id); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table device_group + * + * @mbg.generated + */ + int insert(DeviceGroup record); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table device_group + * + * @mbg.generated + */ + int insertSelective(DeviceGroup record); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table device_group + * + * @mbg.generated + */ + List selectByExample(DeviceGroupExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table device_group + * + * @mbg.generated + */ + DeviceGroup selectByPrimaryKey(Long id); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table device_group + * + * @mbg.generated + */ + int updateByExampleSelective(@Param("record") DeviceGroup record, @Param("example") DeviceGroupExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table device_group + * + * @mbg.generated + */ + int updateByExample(@Param("record") DeviceGroup record, @Param("example") DeviceGroupExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table device_group + * + * @mbg.generated + */ + int updateByPrimaryKeySelective(DeviceGroup record); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table device_group + * + * @mbg.generated + */ + int updateByPrimaryKey(DeviceGroup record); +} \ No newline at end of file diff --git a/dongjian-dashboard-back-dao/src/main/java/com/dongjian/dashboard/back/dao/auto/DeviceGroupRelationMapper.java b/dongjian-dashboard-back-dao/src/main/java/com/dongjian/dashboard/back/dao/auto/DeviceGroupRelationMapper.java new file mode 100644 index 0000000..3582199 --- /dev/null +++ b/dongjian-dashboard-back-dao/src/main/java/com/dongjian/dashboard/back/dao/auto/DeviceGroupRelationMapper.java @@ -0,0 +1,64 @@ +package com.dongjian.dashboard.back.dao.auto; + +import com.dongjian.dashboard.back.model.DeviceGroupRelation; +import com.dongjian.dashboard.back.model.DeviceGroupRelationExample; +import java.util.List; +import org.apache.ibatis.annotations.Param; + +public interface DeviceGroupRelationMapper { + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table device_group_relation + * + * @mbg.generated + */ + long countByExample(DeviceGroupRelationExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table device_group_relation + * + * @mbg.generated + */ + int deleteByExample(DeviceGroupRelationExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table device_group_relation + * + * @mbg.generated + */ + int insert(DeviceGroupRelation record); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table device_group_relation + * + * @mbg.generated + */ + int insertSelective(DeviceGroupRelation record); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table device_group_relation + * + * @mbg.generated + */ + List selectByExample(DeviceGroupRelationExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table device_group_relation + * + * @mbg.generated + */ + int updateByExampleSelective(@Param("record") DeviceGroupRelation record, @Param("example") DeviceGroupRelationExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table device_group_relation + * + * @mbg.generated + */ + int updateByExample(@Param("record") DeviceGroupRelation record, @Param("example") DeviceGroupRelationExample example); +} \ No newline at end of file diff --git a/dongjian-dashboard-back-dao/src/main/java/com/dongjian/dashboard/back/dao/auto/DeviceInfoMapper.java b/dongjian-dashboard-back-dao/src/main/java/com/dongjian/dashboard/back/dao/auto/DeviceInfoMapper.java new file mode 100644 index 0000000..afc1af1 --- /dev/null +++ b/dongjian-dashboard-back-dao/src/main/java/com/dongjian/dashboard/back/dao/auto/DeviceInfoMapper.java @@ -0,0 +1,96 @@ +package com.dongjian.dashboard.back.dao.auto; + +import com.dongjian.dashboard.back.model.DeviceInfo; +import com.dongjian.dashboard.back.model.DeviceInfoExample; +import java.util.List; +import org.apache.ibatis.annotations.Param; + +public interface DeviceInfoMapper { + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table device_info + * + * @mbg.generated + */ + long countByExample(DeviceInfoExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table device_info + * + * @mbg.generated + */ + int deleteByExample(DeviceInfoExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table device_info + * + * @mbg.generated + */ + int deleteByPrimaryKey(Integer id); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table device_info + * + * @mbg.generated + */ + int insert(DeviceInfo record); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table device_info + * + * @mbg.generated + */ + int insertSelective(DeviceInfo record); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table device_info + * + * @mbg.generated + */ + List selectByExample(DeviceInfoExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table device_info + * + * @mbg.generated + */ + DeviceInfo selectByPrimaryKey(Integer id); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table device_info + * + * @mbg.generated + */ + int updateByExampleSelective(@Param("record") DeviceInfo record, @Param("example") DeviceInfoExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table device_info + * + * @mbg.generated + */ + int updateByExample(@Param("record") DeviceInfo record, @Param("example") DeviceInfoExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table device_info + * + * @mbg.generated + */ + int updateByPrimaryKeySelective(DeviceInfo record); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table device_info + * + * @mbg.generated + */ + int updateByPrimaryKey(DeviceInfo record); +} \ No newline at end of file diff --git a/dongjian-dashboard-back-dao/src/main/java/com/dongjian/dashboard/back/dao/auto/DeviceRawdataRealtimeMapper.java b/dongjian-dashboard-back-dao/src/main/java/com/dongjian/dashboard/back/dao/auto/DeviceRawdataRealtimeMapper.java new file mode 100644 index 0000000..f4c74a3 --- /dev/null +++ b/dongjian-dashboard-back-dao/src/main/java/com/dongjian/dashboard/back/dao/auto/DeviceRawdataRealtimeMapper.java @@ -0,0 +1,120 @@ +package com.dongjian.dashboard.back.dao.auto; + +import com.dongjian.dashboard.back.model.DeviceRawdataRealtime; +import com.dongjian.dashboard.back.model.DeviceRawdataRealtimeExample; +import java.util.List; +import org.apache.ibatis.annotations.Param; + +public interface DeviceRawdataRealtimeMapper { + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table device_rawdata_realtime + * + * @mbg.generated + */ + long countByExample(DeviceRawdataRealtimeExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table device_rawdata_realtime + * + * @mbg.generated + */ + int deleteByExample(DeviceRawdataRealtimeExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table device_rawdata_realtime + * + * @mbg.generated + */ + int deleteByPrimaryKey(String deviceId); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table device_rawdata_realtime + * + * @mbg.generated + */ + int insert(DeviceRawdataRealtime record); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table device_rawdata_realtime + * + * @mbg.generated + */ + int insertSelective(DeviceRawdataRealtime record); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table device_rawdata_realtime + * + * @mbg.generated + */ + List selectByExampleWithBLOBs(DeviceRawdataRealtimeExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table device_rawdata_realtime + * + * @mbg.generated + */ + List selectByExample(DeviceRawdataRealtimeExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table device_rawdata_realtime + * + * @mbg.generated + */ + DeviceRawdataRealtime selectByPrimaryKey(String deviceId); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table device_rawdata_realtime + * + * @mbg.generated + */ + int updateByExampleSelective(@Param("record") DeviceRawdataRealtime record, @Param("example") DeviceRawdataRealtimeExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table device_rawdata_realtime + * + * @mbg.generated + */ + int updateByExampleWithBLOBs(@Param("record") DeviceRawdataRealtime record, @Param("example") DeviceRawdataRealtimeExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table device_rawdata_realtime + * + * @mbg.generated + */ + int updateByExample(@Param("record") DeviceRawdataRealtime record, @Param("example") DeviceRawdataRealtimeExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table device_rawdata_realtime + * + * @mbg.generated + */ + int updateByPrimaryKeySelective(DeviceRawdataRealtime record); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table device_rawdata_realtime + * + * @mbg.generated + */ + int updateByPrimaryKeyWithBLOBs(DeviceRawdataRealtime record); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table device_rawdata_realtime + * + * @mbg.generated + */ + int updateByPrimaryKey(DeviceRawdataRealtime record); +} \ No newline at end of file diff --git a/dongjian-dashboard-back-dao/src/main/java/com/dongjian/dashboard/back/dao/auto/FavoritedDeviceMapper.java b/dongjian-dashboard-back-dao/src/main/java/com/dongjian/dashboard/back/dao/auto/FavoritedDeviceMapper.java new file mode 100644 index 0000000..7dec325 --- /dev/null +++ b/dongjian-dashboard-back-dao/src/main/java/com/dongjian/dashboard/back/dao/auto/FavoritedDeviceMapper.java @@ -0,0 +1,96 @@ +package com.dongjian.dashboard.back.dao.auto; + +import com.dongjian.dashboard.back.model.FavoritedDevice; +import com.dongjian.dashboard.back.model.FavoritedDeviceExample; +import java.util.List; +import org.apache.ibatis.annotations.Param; + +public interface FavoritedDeviceMapper { + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table favorited_device + * + * @mbg.generated + */ + long countByExample(FavoritedDeviceExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table favorited_device + * + * @mbg.generated + */ + int deleteByExample(FavoritedDeviceExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table favorited_device + * + * @mbg.generated + */ + int deleteByPrimaryKey(String deviceId); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table favorited_device + * + * @mbg.generated + */ + int insert(FavoritedDevice record); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table favorited_device + * + * @mbg.generated + */ + int insertSelective(FavoritedDevice record); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table favorited_device + * + * @mbg.generated + */ + List selectByExample(FavoritedDeviceExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table favorited_device + * + * @mbg.generated + */ + FavoritedDevice selectByPrimaryKey(String deviceId); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table favorited_device + * + * @mbg.generated + */ + int updateByExampleSelective(@Param("record") FavoritedDevice record, @Param("example") FavoritedDeviceExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table favorited_device + * + * @mbg.generated + */ + int updateByExample(@Param("record") FavoritedDevice record, @Param("example") FavoritedDeviceExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table favorited_device + * + * @mbg.generated + */ + int updateByPrimaryKeySelective(FavoritedDevice record); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table favorited_device + * + * @mbg.generated + */ + int updateByPrimaryKey(FavoritedDevice record); +} \ No newline at end of file diff --git a/dongjian-dashboard-back-dao/src/main/java/com/dongjian/dashboard/back/dao/auto/LoginHistoryMapper.java b/dongjian-dashboard-back-dao/src/main/java/com/dongjian/dashboard/back/dao/auto/LoginHistoryMapper.java new file mode 100644 index 0000000..0929f08 --- /dev/null +++ b/dongjian-dashboard-back-dao/src/main/java/com/dongjian/dashboard/back/dao/auto/LoginHistoryMapper.java @@ -0,0 +1,96 @@ +package com.dongjian.dashboard.back.dao.auto; + +import com.dongjian.dashboard.back.model.LoginHistory; +import com.dongjian.dashboard.back.model.LoginHistoryExample; +import java.util.List; +import org.apache.ibatis.annotations.Param; + +public interface LoginHistoryMapper { + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table login_history + * + * @mbg.generated + */ + long countByExample(LoginHistoryExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table login_history + * + * @mbg.generated + */ + int deleteByExample(LoginHistoryExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table login_history + * + * @mbg.generated + */ + int deleteByPrimaryKey(Long id); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table login_history + * + * @mbg.generated + */ + int insert(LoginHistory record); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table login_history + * + * @mbg.generated + */ + int insertSelective(LoginHistory record); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table login_history + * + * @mbg.generated + */ + List selectByExample(LoginHistoryExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table login_history + * + * @mbg.generated + */ + LoginHistory selectByPrimaryKey(Long id); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table login_history + * + * @mbg.generated + */ + int updateByExampleSelective(@Param("record") LoginHistory record, @Param("example") LoginHistoryExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table login_history + * + * @mbg.generated + */ + int updateByExample(@Param("record") LoginHistory record, @Param("example") LoginHistoryExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table login_history + * + * @mbg.generated + */ + int updateByPrimaryKeySelective(LoginHistory record); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table login_history + * + * @mbg.generated + */ + int updateByPrimaryKey(LoginHistory record); +} \ No newline at end of file diff --git a/dongjian-dashboard-back-dao/src/main/java/com/dongjian/dashboard/back/dao/auto/MonitoringPointCategoryGroupMapper.java b/dongjian-dashboard-back-dao/src/main/java/com/dongjian/dashboard/back/dao/auto/MonitoringPointCategoryGroupMapper.java new file mode 100644 index 0000000..3d0a316 --- /dev/null +++ b/dongjian-dashboard-back-dao/src/main/java/com/dongjian/dashboard/back/dao/auto/MonitoringPointCategoryGroupMapper.java @@ -0,0 +1,96 @@ +package com.dongjian.dashboard.back.dao.auto; + +import com.dongjian.dashboard.back.model.MonitoringPointCategoryGroup; +import com.dongjian.dashboard.back.model.MonitoringPointCategoryGroupExample; +import java.util.List; +import org.apache.ibatis.annotations.Param; + +public interface MonitoringPointCategoryGroupMapper { + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table monitoring_point_category_group + * + * @mbg.generated + */ + long countByExample(MonitoringPointCategoryGroupExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table monitoring_point_category_group + * + * @mbg.generated + */ + int deleteByExample(MonitoringPointCategoryGroupExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table monitoring_point_category_group + * + * @mbg.generated + */ + int deleteByPrimaryKey(Long id); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table monitoring_point_category_group + * + * @mbg.generated + */ + int insert(MonitoringPointCategoryGroup record); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table monitoring_point_category_group + * + * @mbg.generated + */ + int insertSelective(MonitoringPointCategoryGroup record); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table monitoring_point_category_group + * + * @mbg.generated + */ + List selectByExample(MonitoringPointCategoryGroupExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table monitoring_point_category_group + * + * @mbg.generated + */ + MonitoringPointCategoryGroup selectByPrimaryKey(Long id); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table monitoring_point_category_group + * + * @mbg.generated + */ + int updateByExampleSelective(@Param("record") MonitoringPointCategoryGroup record, @Param("example") MonitoringPointCategoryGroupExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table monitoring_point_category_group + * + * @mbg.generated + */ + int updateByExample(@Param("record") MonitoringPointCategoryGroup record, @Param("example") MonitoringPointCategoryGroupExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table monitoring_point_category_group + * + * @mbg.generated + */ + int updateByPrimaryKeySelective(MonitoringPointCategoryGroup record); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table monitoring_point_category_group + * + * @mbg.generated + */ + int updateByPrimaryKey(MonitoringPointCategoryGroup record); +} \ No newline at end of file diff --git a/dongjian-dashboard-back-dao/src/main/java/com/dongjian/dashboard/back/dao/auto/MonitoringPointCategoryGroupRelationMapper.java b/dongjian-dashboard-back-dao/src/main/java/com/dongjian/dashboard/back/dao/auto/MonitoringPointCategoryGroupRelationMapper.java new file mode 100644 index 0000000..1dd0c6d --- /dev/null +++ b/dongjian-dashboard-back-dao/src/main/java/com/dongjian/dashboard/back/dao/auto/MonitoringPointCategoryGroupRelationMapper.java @@ -0,0 +1,64 @@ +package com.dongjian.dashboard.back.dao.auto; + +import com.dongjian.dashboard.back.model.MonitoringPointCategoryGroupRelation; +import com.dongjian.dashboard.back.model.MonitoringPointCategoryGroupRelationExample; +import java.util.List; +import org.apache.ibatis.annotations.Param; + +public interface MonitoringPointCategoryGroupRelationMapper { + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table monitoring_point_category_group_relation + * + * @mbg.generated + */ + long countByExample(MonitoringPointCategoryGroupRelationExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table monitoring_point_category_group_relation + * + * @mbg.generated + */ + int deleteByExample(MonitoringPointCategoryGroupRelationExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table monitoring_point_category_group_relation + * + * @mbg.generated + */ + int insert(MonitoringPointCategoryGroupRelation record); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table monitoring_point_category_group_relation + * + * @mbg.generated + */ + int insertSelective(MonitoringPointCategoryGroupRelation record); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table monitoring_point_category_group_relation + * + * @mbg.generated + */ + List selectByExample(MonitoringPointCategoryGroupRelationExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table monitoring_point_category_group_relation + * + * @mbg.generated + */ + int updateByExampleSelective(@Param("record") MonitoringPointCategoryGroupRelation record, @Param("example") MonitoringPointCategoryGroupRelationExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table monitoring_point_category_group_relation + * + * @mbg.generated + */ + int updateByExample(@Param("record") MonitoringPointCategoryGroupRelation record, @Param("example") MonitoringPointCategoryGroupRelationExample example); +} \ No newline at end of file diff --git a/dongjian-dashboard-back-dao/src/main/java/com/dongjian/dashboard/back/dao/auto/MonitoringPointCategoryMapper.java b/dongjian-dashboard-back-dao/src/main/java/com/dongjian/dashboard/back/dao/auto/MonitoringPointCategoryMapper.java new file mode 100644 index 0000000..98c1ed8 --- /dev/null +++ b/dongjian-dashboard-back-dao/src/main/java/com/dongjian/dashboard/back/dao/auto/MonitoringPointCategoryMapper.java @@ -0,0 +1,120 @@ +package com.dongjian.dashboard.back.dao.auto; + +import com.dongjian.dashboard.back.model.MonitoringPointCategory; +import com.dongjian.dashboard.back.model.MonitoringPointCategoryExample; +import java.util.List; +import org.apache.ibatis.annotations.Param; + +public interface MonitoringPointCategoryMapper { + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table monitoring_point_category + * + * @mbg.generated + */ + long countByExample(MonitoringPointCategoryExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table monitoring_point_category + * + * @mbg.generated + */ + int deleteByExample(MonitoringPointCategoryExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table monitoring_point_category + * + * @mbg.generated + */ + int deleteByPrimaryKey(Long id); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table monitoring_point_category + * + * @mbg.generated + */ + int insert(MonitoringPointCategory record); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table monitoring_point_category + * + * @mbg.generated + */ + int insertSelective(MonitoringPointCategory record); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table monitoring_point_category + * + * @mbg.generated + */ + List selectByExampleWithBLOBs(MonitoringPointCategoryExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table monitoring_point_category + * + * @mbg.generated + */ + List selectByExample(MonitoringPointCategoryExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table monitoring_point_category + * + * @mbg.generated + */ + MonitoringPointCategory selectByPrimaryKey(Long id); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table monitoring_point_category + * + * @mbg.generated + */ + int updateByExampleSelective(@Param("record") MonitoringPointCategory record, @Param("example") MonitoringPointCategoryExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table monitoring_point_category + * + * @mbg.generated + */ + int updateByExampleWithBLOBs(@Param("record") MonitoringPointCategory record, @Param("example") MonitoringPointCategoryExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table monitoring_point_category + * + * @mbg.generated + */ + int updateByExample(@Param("record") MonitoringPointCategory record, @Param("example") MonitoringPointCategoryExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table monitoring_point_category + * + * @mbg.generated + */ + int updateByPrimaryKeySelective(MonitoringPointCategory record); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table monitoring_point_category + * + * @mbg.generated + */ + int updateByPrimaryKeyWithBLOBs(MonitoringPointCategory record); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table monitoring_point_category + * + * @mbg.generated + */ + int updateByPrimaryKey(MonitoringPointCategory record); +} \ No newline at end of file diff --git a/dongjian-dashboard-back-dao/src/main/java/com/dongjian/dashboard/back/dao/auto/NotificationSlackMapper.java b/dongjian-dashboard-back-dao/src/main/java/com/dongjian/dashboard/back/dao/auto/NotificationSlackMapper.java new file mode 100644 index 0000000..0b00145 --- /dev/null +++ b/dongjian-dashboard-back-dao/src/main/java/com/dongjian/dashboard/back/dao/auto/NotificationSlackMapper.java @@ -0,0 +1,96 @@ +package com.dongjian.dashboard.back.dao.auto; + +import com.dongjian.dashboard.back.model.NotificationSlack; +import com.dongjian.dashboard.back.model.NotificationSlackExample; +import java.util.List; +import org.apache.ibatis.annotations.Param; + +public interface NotificationSlackMapper { + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table notification_slack + * + * @mbg.generated + */ + long countByExample(NotificationSlackExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table notification_slack + * + * @mbg.generated + */ + int deleteByExample(NotificationSlackExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table notification_slack + * + * @mbg.generated + */ + int deleteByPrimaryKey(Long id); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table notification_slack + * + * @mbg.generated + */ + int insert(NotificationSlack record); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table notification_slack + * + * @mbg.generated + */ + int insertSelective(NotificationSlack record); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table notification_slack + * + * @mbg.generated + */ + List selectByExample(NotificationSlackExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table notification_slack + * + * @mbg.generated + */ + NotificationSlack selectByPrimaryKey(Long id); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table notification_slack + * + * @mbg.generated + */ + int updateByExampleSelective(@Param("record") NotificationSlack record, @Param("example") NotificationSlackExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table notification_slack + * + * @mbg.generated + */ + int updateByExample(@Param("record") NotificationSlack record, @Param("example") NotificationSlackExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table notification_slack + * + * @mbg.generated + */ + int updateByPrimaryKeySelective(NotificationSlack record); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table notification_slack + * + * @mbg.generated + */ + int updateByPrimaryKey(NotificationSlack record); +} \ No newline at end of file diff --git a/dongjian-dashboard-back-dao/src/main/java/com/dongjian/dashboard/back/dao/auto/NotificationTeamsMapper.java b/dongjian-dashboard-back-dao/src/main/java/com/dongjian/dashboard/back/dao/auto/NotificationTeamsMapper.java new file mode 100644 index 0000000..598f9fa --- /dev/null +++ b/dongjian-dashboard-back-dao/src/main/java/com/dongjian/dashboard/back/dao/auto/NotificationTeamsMapper.java @@ -0,0 +1,96 @@ +package com.dongjian.dashboard.back.dao.auto; + +import com.dongjian.dashboard.back.model.NotificationTeams; +import com.dongjian.dashboard.back.model.NotificationTeamsExample; +import java.util.List; +import org.apache.ibatis.annotations.Param; + +public interface NotificationTeamsMapper { + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table notification_teams + * + * @mbg.generated + */ + long countByExample(NotificationTeamsExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table notification_teams + * + * @mbg.generated + */ + int deleteByExample(NotificationTeamsExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table notification_teams + * + * @mbg.generated + */ + int deleteByPrimaryKey(Long id); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table notification_teams + * + * @mbg.generated + */ + int insert(NotificationTeams record); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table notification_teams + * + * @mbg.generated + */ + int insertSelective(NotificationTeams record); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table notification_teams + * + * @mbg.generated + */ + List selectByExample(NotificationTeamsExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table notification_teams + * + * @mbg.generated + */ + NotificationTeams selectByPrimaryKey(Long id); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table notification_teams + * + * @mbg.generated + */ + int updateByExampleSelective(@Param("record") NotificationTeams record, @Param("example") NotificationTeamsExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table notification_teams + * + * @mbg.generated + */ + int updateByExample(@Param("record") NotificationTeams record, @Param("example") NotificationTeamsExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table notification_teams + * + * @mbg.generated + */ + int updateByPrimaryKeySelective(NotificationTeams record); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table notification_teams + * + * @mbg.generated + */ + int updateByPrimaryKey(NotificationTeams record); +} \ No newline at end of file diff --git a/dongjian-dashboard-back-dao/src/main/java/com/dongjian/dashboard/back/dao/auto/SysEnvMapper.java b/dongjian-dashboard-back-dao/src/main/java/com/dongjian/dashboard/back/dao/auto/SysEnvMapper.java new file mode 100644 index 0000000..74613f4 --- /dev/null +++ b/dongjian-dashboard-back-dao/src/main/java/com/dongjian/dashboard/back/dao/auto/SysEnvMapper.java @@ -0,0 +1,96 @@ +package com.dongjian.dashboard.back.dao.auto; + +import com.dongjian.dashboard.back.model.SysEnv; +import com.dongjian.dashboard.back.model.SysEnvExample; +import java.util.List; +import org.apache.ibatis.annotations.Param; + +public interface SysEnvMapper { + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table sys_env + * + * @mbg.generated + */ + long countByExample(SysEnvExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table sys_env + * + * @mbg.generated + */ + int deleteByExample(SysEnvExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table sys_env + * + * @mbg.generated + */ + int deleteByPrimaryKey(String envKey); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table sys_env + * + * @mbg.generated + */ + int insert(SysEnv record); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table sys_env + * + * @mbg.generated + */ + int insertSelective(SysEnv record); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table sys_env + * + * @mbg.generated + */ + List selectByExample(SysEnvExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table sys_env + * + * @mbg.generated + */ + SysEnv selectByPrimaryKey(String envKey); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table sys_env + * + * @mbg.generated + */ + int updateByExampleSelective(@Param("record") SysEnv record, @Param("example") SysEnvExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table sys_env + * + * @mbg.generated + */ + int updateByExample(@Param("record") SysEnv record, @Param("example") SysEnvExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table sys_env + * + * @mbg.generated + */ + int updateByPrimaryKeySelective(SysEnv record); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table sys_env + * + * @mbg.generated + */ + int updateByPrimaryKey(SysEnv record); +} \ No newline at end of file diff --git a/dongjian-dashboard-back-dao/src/main/java/com/dongjian/dashboard/back/dao/auto/UserBuildingRelationMapper.java b/dongjian-dashboard-back-dao/src/main/java/com/dongjian/dashboard/back/dao/auto/UserBuildingRelationMapper.java new file mode 100644 index 0000000..61a0ee4 --- /dev/null +++ b/dongjian-dashboard-back-dao/src/main/java/com/dongjian/dashboard/back/dao/auto/UserBuildingRelationMapper.java @@ -0,0 +1,64 @@ +package com.dongjian.dashboard.back.dao.auto; + +import com.dongjian.dashboard.back.model.UserBuildingRelation; +import com.dongjian.dashboard.back.model.UserBuildingRelationExample; +import java.util.List; +import org.apache.ibatis.annotations.Param; + +public interface UserBuildingRelationMapper { + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table user_building_relation + * + * @mbg.generated + */ + long countByExample(UserBuildingRelationExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table user_building_relation + * + * @mbg.generated + */ + int deleteByExample(UserBuildingRelationExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table user_building_relation + * + * @mbg.generated + */ + int insert(UserBuildingRelation record); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table user_building_relation + * + * @mbg.generated + */ + int insertSelective(UserBuildingRelation record); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table user_building_relation + * + * @mbg.generated + */ + List selectByExample(UserBuildingRelationExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table user_building_relation + * + * @mbg.generated + */ + int updateByExampleSelective(@Param("record") UserBuildingRelation record, @Param("example") UserBuildingRelationExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table user_building_relation + * + * @mbg.generated + */ + int updateByExample(@Param("record") UserBuildingRelation record, @Param("example") UserBuildingRelationExample example); +} \ No newline at end of file diff --git a/dongjian-dashboard-back-dao/src/main/java/com/dongjian/dashboard/back/dao/ex/AlertHandleHistoryMapperExt.java b/dongjian-dashboard-back-dao/src/main/java/com/dongjian/dashboard/back/dao/ex/AlertHandleHistoryMapperExt.java new file mode 100644 index 0000000..017dad6 --- /dev/null +++ b/dongjian-dashboard-back-dao/src/main/java/com/dongjian/dashboard/back/dao/ex/AlertHandleHistoryMapperExt.java @@ -0,0 +1,14 @@ +package com.dongjian.dashboard.back.dao.ex; + +import com.dongjian.dashboard.back.dao.auto.AlertHandleHistoryMapper; +import com.dongjian.dashboard.back.dto.data.HandleHistorySearchParam; +import com.dongjian.dashboard.back.vo.data.HandleHistoryDataVO; +import org.apache.ibatis.annotations.Mapper; + +import java.util.List; + +@Mapper +public interface AlertHandleHistoryMapperExt extends AlertHandleHistoryMapper { + + List getListPage(HandleHistorySearchParam pageSearchParam); +} diff --git a/dongjian-dashboard-back-dao/src/main/java/com/dongjian/dashboard/back/dao/ex/AlertHistoryMapperExt.java b/dongjian-dashboard-back-dao/src/main/java/com/dongjian/dashboard/back/dao/ex/AlertHistoryMapperExt.java new file mode 100644 index 0000000..857cc5f --- /dev/null +++ b/dongjian-dashboard-back-dao/src/main/java/com/dongjian/dashboard/back/dao/ex/AlertHistoryMapperExt.java @@ -0,0 +1,9 @@ +package com.dongjian.dashboard.back.dao.ex; + +import com.dongjian.dashboard.back.dao.auto.AlertHistoryMapper; +import org.apache.ibatis.annotations.Mapper; + +@Mapper +public interface AlertHistoryMapperExt extends AlertHistoryMapper { + +} diff --git a/dongjian-dashboard-back-dao/src/main/java/com/dongjian/dashboard/back/dao/ex/BaStatusStatisticsMapperExt.java b/dongjian-dashboard-back-dao/src/main/java/com/dongjian/dashboard/back/dao/ex/BaStatusStatisticsMapperExt.java new file mode 100644 index 0000000..c0acb5b --- /dev/null +++ b/dongjian-dashboard-back-dao/src/main/java/com/dongjian/dashboard/back/dao/ex/BaStatusStatisticsMapperExt.java @@ -0,0 +1,9 @@ +package com.dongjian.dashboard.back.dao.ex; + +import com.dongjian.dashboard.back.dao.auto.BaStatusStatisticsMapper; +import org.apache.ibatis.annotations.Mapper; + +@Mapper +public interface BaStatusStatisticsMapperExt extends BaStatusStatisticsMapper { + +} diff --git a/dongjian-dashboard-back-dao/src/main/java/com/dongjian/dashboard/back/dao/ex/BasicBuildingMapperExt.java b/dongjian-dashboard-back-dao/src/main/java/com/dongjian/dashboard/back/dao/ex/BasicBuildingMapperExt.java new file mode 100644 index 0000000..c35cd20 --- /dev/null +++ b/dongjian-dashboard-back-dao/src/main/java/com/dongjian/dashboard/back/dao/ex/BasicBuildingMapperExt.java @@ -0,0 +1,15 @@ +package com.dongjian.dashboard.back.dao.ex; + +import com.dongjian.dashboard.back.dao.auto.BasicBuildingMapper; +import com.dongjian.dashboard.back.dto.building.BuildingSearchParams; +import com.dongjian.dashboard.back.vo.building.BuildingPageVO; +import org.apache.ibatis.annotations.Mapper; + +import java.util.List; + +@Mapper +public interface BasicBuildingMapperExt extends BasicBuildingMapper { + + List getListPage(BuildingSearchParams pageSearchParam); + +} diff --git a/dongjian-dashboard-back-dao/src/main/java/com/dongjian/dashboard/back/dao/ex/BasicCompanyMapperExt.java b/dongjian-dashboard-back-dao/src/main/java/com/dongjian/dashboard/back/dao/ex/BasicCompanyMapperExt.java new file mode 100644 index 0000000..77bf9af --- /dev/null +++ b/dongjian-dashboard-back-dao/src/main/java/com/dongjian/dashboard/back/dao/ex/BasicCompanyMapperExt.java @@ -0,0 +1,30 @@ +package com.dongjian.dashboard.back.dao.ex; + +import java.util.List; +import java.util.Map; + +import com.dongjian.dashboard.back.vo.company.AuroraInfo; +import org.apache.ibatis.annotations.Mapper; + +import com.dongjian.dashboard.back.dao.auto.BasicCompanyMapper; +import com.dongjian.dashboard.back.dto.company.CompanySearchParams; +import com.dongjian.dashboard.back.dto.company.OptCompanyParams; +import com.dongjian.dashboard.back.model.BasicCompany; +import com.dongjian.dashboard.back.vo.TreeMenusDTO; +import com.dongjian.dashboard.back.vo.company.CompanyPageDTO; + +@Mapper +public interface BasicCompanyMapperExt extends BasicCompanyMapper{ + + List getSubCompanyByParentId(Map searchChildMap); + + List getSelectList(Map paramMap); + + int checkExist(OptCompanyParams optCompanyParams); + + List getListPage(CompanySearchParams pageSearchParam); + + List getListForTree(); + + AuroraInfo getAuroraInfoByApikey(Map paramMap); +} diff --git a/dongjian-dashboard-back-dao/src/main/java/com/dongjian/dashboard/back/dao/ex/BasicProjectMapperExt.java b/dongjian-dashboard-back-dao/src/main/java/com/dongjian/dashboard/back/dao/ex/BasicProjectMapperExt.java new file mode 100644 index 0000000..b2d5247 --- /dev/null +++ b/dongjian-dashboard-back-dao/src/main/java/com/dongjian/dashboard/back/dao/ex/BasicProjectMapperExt.java @@ -0,0 +1,26 @@ +package com.dongjian.dashboard.back.dao.ex; + +import java.util.List; +import java.util.Map; + +import org.apache.ibatis.annotations.Mapper; + +import com.dongjian.dashboard.back.dto.project.OptProjectParams; +import com.dongjian.dashboard.back.dto.project.ProjectSearchParams; +import com.dongjian.dashboard.back.model.BasicProject; +import com.dongjian.dashboard.back.vo.project.ProjectPageVO; + +@Mapper +public interface BasicProjectMapperExt { + + int checkExist(OptProjectParams optProjectParams); + + List getListPage(ProjectSearchParams pageSearchParam); + + void selfInsertSelective(BasicProject basicProject); + + BasicProject selfSelectByPrimaryKey(Map paramMap); + + void selfUpdateByPrimaryKeySelective(BasicProject basicProject); + +} diff --git a/dongjian-dashboard-back-dao/src/main/java/com/dongjian/dashboard/back/dao/ex/BasicRoleMapperExt.java b/dongjian-dashboard-back-dao/src/main/java/com/dongjian/dashboard/back/dao/ex/BasicRoleMapperExt.java new file mode 100644 index 0000000..2d1de8b --- /dev/null +++ b/dongjian-dashboard-back-dao/src/main/java/com/dongjian/dashboard/back/dao/ex/BasicRoleMapperExt.java @@ -0,0 +1,23 @@ +package com.dongjian.dashboard.back.dao.ex; + +import java.util.List; +import java.util.Map; + +import org.apache.ibatis.annotations.Mapper; + +import com.dongjian.dashboard.back.dao.auto.BasicRoleMapper; +import com.dongjian.dashboard.back.dto.role.OptRoleParam; +import com.dongjian.dashboard.back.dto.role.PageSearchParam; +import com.dongjian.dashboard.back.vo.TreeMenusDTO; +import com.dongjian.dashboard.back.vo.role.RolePageDTO; + +@Mapper +public interface BasicRoleMapperExt extends BasicRoleMapper { + + Long checkExist(OptRoleParam param); + + List getOwnMenuIds(Map paramMap); + + List getListPage(PageSearchParam pageSearchParam); + +} diff --git a/dongjian-dashboard-back-dao/src/main/java/com/dongjian/dashboard/back/dao/ex/BasicRoleMenuRelationMapperExt.java b/dongjian-dashboard-back-dao/src/main/java/com/dongjian/dashboard/back/dao/ex/BasicRoleMenuRelationMapperExt.java new file mode 100644 index 0000000..25e9deb --- /dev/null +++ b/dongjian-dashboard-back-dao/src/main/java/com/dongjian/dashboard/back/dao/ex/BasicRoleMenuRelationMapperExt.java @@ -0,0 +1,17 @@ +package com.dongjian.dashboard.back.dao.ex; + +import java.util.Map; + +import org.apache.ibatis.annotations.Mapper; + +import com.dongjian.dashboard.back.dao.auto.BasicRoleMenuRelationMapper; + +@Mapper +public interface BasicRoleMenuRelationMapperExt extends BasicRoleMenuRelationMapper { + + void batchInsert(Map paramMap); + + String getMenuIdsByRoleId(Long roleId); + + void deleteDashboardRelation(Map deleteMap); +} diff --git a/dongjian-dashboard-back-dao/src/main/java/com/dongjian/dashboard/back/dao/ex/BasicRoleUserRelationMapperExt.java b/dongjian-dashboard-back-dao/src/main/java/com/dongjian/dashboard/back/dao/ex/BasicRoleUserRelationMapperExt.java new file mode 100644 index 0000000..79eb677 --- /dev/null +++ b/dongjian-dashboard-back-dao/src/main/java/com/dongjian/dashboard/back/dao/ex/BasicRoleUserRelationMapperExt.java @@ -0,0 +1,10 @@ +package com.dongjian.dashboard.back.dao.ex; + +import org.apache.ibatis.annotations.Mapper; + +import com.dongjian.dashboard.back.dao.auto.BasicRoleUserRelationMapper; + +@Mapper +public interface BasicRoleUserRelationMapperExt extends BasicRoleUserRelationMapper { + +} diff --git a/dongjian-dashboard-back-dao/src/main/java/com/dongjian/dashboard/back/dao/ex/BasicUserMapperExt.java b/dongjian-dashboard-back-dao/src/main/java/com/dongjian/dashboard/back/dao/ex/BasicUserMapperExt.java new file mode 100644 index 0000000..786272b --- /dev/null +++ b/dongjian-dashboard-back-dao/src/main/java/com/dongjian/dashboard/back/dao/ex/BasicUserMapperExt.java @@ -0,0 +1,26 @@ +package com.dongjian.dashboard.back.dao.ex; + +import java.util.List; +import java.util.Map; + +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; +import com.dongjian.dashboard.back.dao.auto.BasicUserMapper; +import com.dongjian.dashboard.back.dto.user.OptUserParam; +import com.dongjian.dashboard.back.dto.user.PageSearchParam; +import com.dongjian.dashboard.back.vo.user.UserInfoVO; +import com.dongjian.dashboard.back.vo.user.UserPageDTO; + +@Mapper +public interface BasicUserMapperExt extends BasicUserMapper{ + + Long checkExist(OptUserParam param); + + List getListPage(PageSearchParam pageSearchParam); + + String getMenuIdsByUserId(Map menuMap); + + UserInfoVO getAccountInfo(Map paramMap); + + Integer checkBuildingManager(Long userId); +} diff --git a/dongjian-dashboard-back-dao/src/main/java/com/dongjian/dashboard/back/dao/ex/DashboardLevelRoleMapperExt.java b/dongjian-dashboard-back-dao/src/main/java/com/dongjian/dashboard/back/dao/ex/DashboardLevelRoleMapperExt.java new file mode 100644 index 0000000..12a9949 --- /dev/null +++ b/dongjian-dashboard-back-dao/src/main/java/com/dongjian/dashboard/back/dao/ex/DashboardLevelRoleMapperExt.java @@ -0,0 +1,24 @@ +package com.dongjian.dashboard.back.dao.ex; + +import com.dongjian.dashboard.back.dao.auto.DashboardLevelRoleMapper; +import com.dongjian.dashboard.back.dto.levelhierarchy.OptLevelHierarchyRoleParam; +import com.dongjian.dashboard.back.dto.levelhierarchy.PageLevelHierarchyRoleSearchParam; +import com.dongjian.dashboard.back.vo.levelhierarchy.LevelHierarchyRolePageDTO; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +@Mapper +public interface DashboardLevelRoleMapperExt extends DashboardLevelRoleMapper { + + long checkExist(OptLevelHierarchyRoleParam param); + + long checkBound(@Param("idList") List idList); + + void deleteUserRelation(@Param("idList") List idList); + + List getListPage(PageLevelHierarchyRoleSearchParam pageSearchParam); + + int checkAdministrativePrivileges(Long userId); +} diff --git a/dongjian-dashboard-back-dao/src/main/java/com/dongjian/dashboard/back/dao/ex/DashboardOperationLogMapperExt.java b/dongjian-dashboard-back-dao/src/main/java/com/dongjian/dashboard/back/dao/ex/DashboardOperationLogMapperExt.java new file mode 100644 index 0000000..1add941 --- /dev/null +++ b/dongjian-dashboard-back-dao/src/main/java/com/dongjian/dashboard/back/dao/ex/DashboardOperationLogMapperExt.java @@ -0,0 +1,14 @@ +package com.dongjian.dashboard.back.dao.ex; + +import com.dongjian.dashboard.back.dao.auto.DashboardOperationLogMapper; +import com.dongjian.dashboard.back.dto.operationlog.LogSearchParam; +import com.dongjian.dashboard.back.vo.operationlog.OperationLogPageVO; +import org.apache.ibatis.annotations.Mapper; + +import java.util.List; + +@Mapper +public interface DashboardOperationLogMapperExt extends DashboardOperationLogMapper { + + List getListPage(LogSearchParam pageSearchParam); +} diff --git a/dongjian-dashboard-back-dao/src/main/java/com/dongjian/dashboard/back/dao/ex/DashboardRealtimeMeasureMapperExt.java b/dongjian-dashboard-back-dao/src/main/java/com/dongjian/dashboard/back/dao/ex/DashboardRealtimeMeasureMapperExt.java new file mode 100644 index 0000000..3460108 --- /dev/null +++ b/dongjian-dashboard-back-dao/src/main/java/com/dongjian/dashboard/back/dao/ex/DashboardRealtimeMeasureMapperExt.java @@ -0,0 +1,13 @@ +package com.dongjian.dashboard.back.dao.ex; + +import com.dongjian.dashboard.back.dao.auto.DashboardRealtimeMeasureMapper; +import com.dongjian.dashboard.back.model.DashboardRealtimeMeasure; +import org.apache.ibatis.annotations.Mapper; + +import java.util.List; + +@Mapper +public interface DashboardRealtimeMeasureMapperExt extends DashboardRealtimeMeasureMapper { + + List selectRealtimeMeasureByDevices(List deviceIds); +} diff --git a/dongjian-dashboard-back-dao/src/main/java/com/dongjian/dashboard/back/dao/ex/DashboardRecordAccumulateMapperExt.java b/dongjian-dashboard-back-dao/src/main/java/com/dongjian/dashboard/back/dao/ex/DashboardRecordAccumulateMapperExt.java new file mode 100644 index 0000000..16730f2 --- /dev/null +++ b/dongjian-dashboard-back-dao/src/main/java/com/dongjian/dashboard/back/dao/ex/DashboardRecordAccumulateMapperExt.java @@ -0,0 +1,40 @@ +package com.dongjian.dashboard.back.dao.ex; + +import com.dongjian.dashboard.back.dao.auto.DashboardRecordAccumulateMapper; +import com.dongjian.dashboard.back.dao.auto.FavoritedDeviceMapper; +import com.dongjian.dashboard.back.dto.device.FavoritedDeviceSearchParams; +import com.dongjian.dashboard.back.vo.device.DeviceIncrement; +import com.dongjian.dashboard.back.vo.device.FavoritedDeviceVO; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; +import java.util.Map; + +@Mapper +public interface DashboardRecordAccumulateMapperExt extends DashboardRecordAccumulateMapper { + + List selectTodayIncrement( + @Param("deviceIds") List deviceIds, + @Param("year") int year, + @Param("month") int month, + @Param("day") int day + ); + + List selectYesterdayIncrement( + @Param("deviceIds") List deviceIds, + @Param("year") int year, + @Param("month") int month, + @Param("day") int day, + @Param("targetSeconds") int targetSeconds + ); + + List selectLastYearIncrement( + @Param("deviceIds") List deviceIds, + @Param("year") int year, + @Param("month") int month, + @Param("day") int day, + @Param("targetSeconds") int targetSeconds + ); + +} diff --git a/dongjian-dashboard-back-dao/src/main/java/com/dongjian/dashboard/back/dao/ex/DeviceGroupMapperExt.java b/dongjian-dashboard-back-dao/src/main/java/com/dongjian/dashboard/back/dao/ex/DeviceGroupMapperExt.java new file mode 100644 index 0000000..ce766cd --- /dev/null +++ b/dongjian-dashboard-back-dao/src/main/java/com/dongjian/dashboard/back/dao/ex/DeviceGroupMapperExt.java @@ -0,0 +1,22 @@ +package com.dongjian.dashboard.back.dao.ex; + +import com.dongjian.dashboard.back.dao.auto.DeviceGroupMapper; +import com.dongjian.dashboard.back.dto.devicegroup.OptDeviceGroupParams; +import com.dongjian.dashboard.back.dto.devicegroup.DeviceGroupSearchParams; +import com.dongjian.dashboard.back.vo.device.DeviceVO; +import com.dongjian.dashboard.back.vo.devicegroup.DeviceGroupPageVO; +import org.apache.ibatis.annotations.Mapper; + +import java.util.List; + +@Mapper +public interface DeviceGroupMapperExt extends DeviceGroupMapper { + + int checkExist(OptDeviceGroupParams optDeviceGroupParams); + + List getListPage(DeviceGroupSearchParams pageSearchParam); + + List getBindedGroupByDevice(Integer deviceInfoId); + + List getBindedDeviceByGroup(Long deviceGroupId); +} diff --git a/dongjian-dashboard-back-dao/src/main/java/com/dongjian/dashboard/back/dao/ex/DeviceGroupRelationMapperExt.java b/dongjian-dashboard-back-dao/src/main/java/com/dongjian/dashboard/back/dao/ex/DeviceGroupRelationMapperExt.java new file mode 100644 index 0000000..2bd4286 --- /dev/null +++ b/dongjian-dashboard-back-dao/src/main/java/com/dongjian/dashboard/back/dao/ex/DeviceGroupRelationMapperExt.java @@ -0,0 +1,15 @@ +package com.dongjian.dashboard.back.dao.ex; + +import com.dongjian.dashboard.back.dao.auto.DeviceGroupMapper; +import com.dongjian.dashboard.back.dao.auto.DeviceGroupRelationMapper; +import com.dongjian.dashboard.back.dto.devicegroup.DeviceGroupSearchParams; +import com.dongjian.dashboard.back.dto.devicegroup.OptDeviceGroupParams; +import com.dongjian.dashboard.back.vo.devicegroup.DeviceGroupPageVO; +import org.apache.ibatis.annotations.Mapper; + +import java.util.List; + +@Mapper +public interface DeviceGroupRelationMapperExt extends DeviceGroupRelationMapper { + +} diff --git a/dongjian-dashboard-back-dao/src/main/java/com/dongjian/dashboard/back/dao/ex/DeviceInfoMapperExt.java b/dongjian-dashboard-back-dao/src/main/java/com/dongjian/dashboard/back/dao/ex/DeviceInfoMapperExt.java new file mode 100644 index 0000000..10bed02 --- /dev/null +++ b/dongjian-dashboard-back-dao/src/main/java/com/dongjian/dashboard/back/dao/ex/DeviceInfoMapperExt.java @@ -0,0 +1,41 @@ +package com.dongjian.dashboard.back.dao.ex; + + +import com.dongjian.dashboard.back.dao.auto.DeviceInfoMapper; +import com.dongjian.dashboard.back.dto.data.AccumulateDataSearchParam; +import com.dongjian.dashboard.back.dto.data.AlarmDataSearchParam; +import com.dongjian.dashboard.back.dto.data.BaStatusDataSearchParam; +import com.dongjian.dashboard.back.dto.data.MeasureDataSearchParam; +import com.dongjian.dashboard.back.dto.device.DeviceSearchParams; +import com.dongjian.dashboard.back.vo.data.DeviceAccumulateData; +import com.dongjian.dashboard.back.vo.data.DeviceAlarmData; +import com.dongjian.dashboard.back.vo.data.DeviceBaStatusData; +import com.dongjian.dashboard.back.vo.data.DeviceMeasureData; +import com.dongjian.dashboard.back.vo.device.DeviceVO; +import org.apache.ibatis.annotations.Mapper; + +import java.util.List; + +@Mapper +public interface DeviceInfoMapperExt extends DeviceInfoMapper { + + List getListPage(DeviceSearchParams pageSearchParam); + + DeviceVO selectOne(int deviceInfoId); + + List getDevice4AccumulateData(AccumulateDataSearchParam pageSearchParam); + + List getDevice4AccumulateDataByGroup(AccumulateDataSearchParam pageSearchParam); + + List getDevice4MeasureData(MeasureDataSearchParam pageSearchParam); + + List getDevice4MeasureDataByGroup(MeasureDataSearchParam pageSearchParam); + + List getDevice4BaStatusData(BaStatusDataSearchParam pageSearchParam); + + List getDevice4BaStatusDataByGroup(BaStatusDataSearchParam pageSearchParam); + + List getDevice4AlarmData(AlarmDataSearchParam pageSearchParam); + + List getDevice4AlarmDataByGroup(AlarmDataSearchParam pageSearchParam); +} diff --git a/dongjian-dashboard-back-dao/src/main/java/com/dongjian/dashboard/back/dao/ex/DeviceRawdataRealtimeMapperExt.java b/dongjian-dashboard-back-dao/src/main/java/com/dongjian/dashboard/back/dao/ex/DeviceRawdataRealtimeMapperExt.java new file mode 100644 index 0000000..55a4b64 --- /dev/null +++ b/dongjian-dashboard-back-dao/src/main/java/com/dongjian/dashboard/back/dao/ex/DeviceRawdataRealtimeMapperExt.java @@ -0,0 +1,17 @@ +package com.dongjian.dashboard.back.dao.ex; + +import com.dongjian.dashboard.back.dao.auto.DeviceRawdataRealtimeMapper; +import com.dongjian.dashboard.back.vo.data.OverviewInfo; +import com.dongjian.dashboard.back.vo.data.OverviewVO; +import org.apache.ibatis.annotations.Mapper; + +import java.util.List; +import java.util.Map; + +@Mapper +public interface DeviceRawdataRealtimeMapperExt extends DeviceRawdataRealtimeMapper { + + List getOverviewInfo(Map paramMap); + + List getBuildingInfo(Map buildingMap); +} diff --git a/dongjian-dashboard-back-dao/src/main/java/com/dongjian/dashboard/back/dao/ex/FavoritedDeviceMapperExt.java b/dongjian-dashboard-back-dao/src/main/java/com/dongjian/dashboard/back/dao/ex/FavoritedDeviceMapperExt.java new file mode 100644 index 0000000..28c2fe5 --- /dev/null +++ b/dongjian-dashboard-back-dao/src/main/java/com/dongjian/dashboard/back/dao/ex/FavoritedDeviceMapperExt.java @@ -0,0 +1,24 @@ +package com.dongjian.dashboard.back.dao.ex; + +import com.dongjian.dashboard.back.dao.auto.FavoritedDeviceMapper; +import com.dongjian.dashboard.back.dto.device.FavoritedDeviceSearchParams; +import com.dongjian.dashboard.back.vo.device.FavoritedDeviceVO; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; +import java.util.Map; + +@Mapper +public interface FavoritedDeviceMapperExt extends FavoritedDeviceMapper { + + List getListPage(FavoritedDeviceSearchParams pageSearchParam); + + List selectExistsByIds(List deviceIdList); + + void batchInsert(Map insertMap); + + int deleteByDeviceIds(@Param("deviceIdList") List deviceIdList); + + List getFavoritedDeviceIds(); +} diff --git a/dongjian-dashboard-back-dao/src/main/java/com/dongjian/dashboard/back/dao/ex/LevelHierarchyMapperExt.java b/dongjian-dashboard-back-dao/src/main/java/com/dongjian/dashboard/back/dao/ex/LevelHierarchyMapperExt.java new file mode 100644 index 0000000..0a10a3e --- /dev/null +++ b/dongjian-dashboard-back-dao/src/main/java/com/dongjian/dashboard/back/dao/ex/LevelHierarchyMapperExt.java @@ -0,0 +1,41 @@ +package com.dongjian.dashboard.back.dao.ex; + +import com.dongjian.dashboard.back.dto.levelhierarchy.OptLevelHierarchyParam; +import com.dongjian.dashboard.back.dto.levelhierarchy.PageLevelHierarchySearchParam; +import com.dongjian.dashboard.back.vo.levelhierarchy.LevelHierarchyPageDTO; +import com.dongjian.dashboard.back.vo.levelhierarchy.LevelHierarchyTreeVO; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +@Mapper +public interface LevelHierarchyMapperExt { + + long checkExist(OptLevelHierarchyParam param); + + void insertHierarchy(OptLevelHierarchyParam param); + + void deleteRelations(@Param("relationType") String relationType, + @Param("childId") Long childId); + + void insertHierarchyRelation(@Param("relationType") String relationType, + @Param("parentIdList") List parentIdList, + @Param("childId") Long childId, + @Param("createdBy") Long createdBy, + @Param("createdAt") Long createdAt); + + long checkOld(OptLevelHierarchyParam param); + + void updateHierarchy(OptLevelHierarchyParam param); + + Long countChildrenByType(@Param("type") String type, + @Param("idList") List idList); + + void deleteHierarchyByType(@Param("type") String type, + @Param("idList") List idList); + + List getListPage(PageLevelHierarchySearchParam pageSearchParam); + + List selectAllHierarchyByCompanyId(@Param("companyId") Long companyId); +} diff --git a/dongjian-dashboard-back-dao/src/main/java/com/dongjian/dashboard/back/dao/ex/LoginHistoryMapperExt.java b/dongjian-dashboard-back-dao/src/main/java/com/dongjian/dashboard/back/dao/ex/LoginHistoryMapperExt.java new file mode 100644 index 0000000..8835142 --- /dev/null +++ b/dongjian-dashboard-back-dao/src/main/java/com/dongjian/dashboard/back/dao/ex/LoginHistoryMapperExt.java @@ -0,0 +1,10 @@ +package com.dongjian.dashboard.back.dao.ex; + +import org.apache.ibatis.annotations.Mapper; + +import com.dongjian.dashboard.back.dao.auto.LoginHistoryMapper; + +@Mapper +public interface LoginHistoryMapperExt extends LoginHistoryMapper{ + +} diff --git a/dongjian-dashboard-back-dao/src/main/java/com/dongjian/dashboard/back/dao/ex/MonitoringPointCategoryGroupMapperExt.java b/dongjian-dashboard-back-dao/src/main/java/com/dongjian/dashboard/back/dao/ex/MonitoringPointCategoryGroupMapperExt.java new file mode 100644 index 0000000..d510359 --- /dev/null +++ b/dongjian-dashboard-back-dao/src/main/java/com/dongjian/dashboard/back/dao/ex/MonitoringPointCategoryGroupMapperExt.java @@ -0,0 +1,23 @@ +package com.dongjian.dashboard.back.dao.ex; + +import com.dongjian.dashboard.back.dao.auto.MonitoringPointCategoryGroupMapper; +import com.dongjian.dashboard.back.dao.auto.MonitoringPointCategoryGroupMapper; +import com.dongjian.dashboard.back.dto.monitoringpointcategorygroup.MonitoringPointCategoryGroupSearchParams; +import com.dongjian.dashboard.back.dto.monitoringpointcategorygroup.OptMonitoringPointCategoryGroupParams; +import com.dongjian.dashboard.back.vo.monitoringpointcategory.MonitoringPointCategoryPageVO; +import com.dongjian.dashboard.back.vo.monitoringpointcategorygroup.MonitoringPointCategoryGroupPageVO; +import org.apache.ibatis.annotations.Mapper; + +import java.util.List; + +@Mapper +public interface MonitoringPointCategoryGroupMapperExt extends MonitoringPointCategoryGroupMapper { + + int checkExist(OptMonitoringPointCategoryGroupParams optMonitoringPointCategoryGroupParams); + + List getListPage(MonitoringPointCategoryGroupSearchParams pageSearchParam); + + List getBindedGroupByCategory(Long monitoringPointCategoryId); + + List getBindedCategoryByGroup(Long monitoringPointCategoryGroupId); +} diff --git a/dongjian-dashboard-back-dao/src/main/java/com/dongjian/dashboard/back/dao/ex/MonitoringPointCategoryGroupRelationMapperExt.java b/dongjian-dashboard-back-dao/src/main/java/com/dongjian/dashboard/back/dao/ex/MonitoringPointCategoryGroupRelationMapperExt.java new file mode 100644 index 0000000..e12e2f8 --- /dev/null +++ b/dongjian-dashboard-back-dao/src/main/java/com/dongjian/dashboard/back/dao/ex/MonitoringPointCategoryGroupRelationMapperExt.java @@ -0,0 +1,8 @@ +package com.dongjian.dashboard.back.dao.ex; + +import com.dongjian.dashboard.back.dao.auto.MonitoringPointCategoryGroupRelationMapper; +import org.apache.ibatis.annotations.Mapper; + +@Mapper +public interface MonitoringPointCategoryGroupRelationMapperExt extends MonitoringPointCategoryGroupRelationMapper { +} diff --git a/dongjian-dashboard-back-dao/src/main/java/com/dongjian/dashboard/back/dao/ex/MonitoringPointCategoryMapperExt.java b/dongjian-dashboard-back-dao/src/main/java/com/dongjian/dashboard/back/dao/ex/MonitoringPointCategoryMapperExt.java new file mode 100644 index 0000000..04352b8 --- /dev/null +++ b/dongjian-dashboard-back-dao/src/main/java/com/dongjian/dashboard/back/dao/ex/MonitoringPointCategoryMapperExt.java @@ -0,0 +1,19 @@ +package com.dongjian.dashboard.back.dao.ex; + +import com.dongjian.dashboard.back.dao.auto.MonitoringPointCategoryMapper; +import com.dongjian.dashboard.back.dao.auto.MonitoringPointCategoryMapper; +import com.dongjian.dashboard.back.dto.monitoringpointcategory.MonitoringPointCategorySearchParams; +import com.dongjian.dashboard.back.dto.monitoringpointcategory.OptMonitoringPointCategoryParams; +import com.dongjian.dashboard.back.vo.device.DeviceVO; +import com.dongjian.dashboard.back.vo.monitoringpointcategory.MonitoringPointCategoryPageVO; +import org.apache.ibatis.annotations.Mapper; + +import java.util.List; + +@Mapper +public interface MonitoringPointCategoryMapperExt extends MonitoringPointCategoryMapper { + + int checkExist(OptMonitoringPointCategoryParams optMonitoringPointCategoryParams); + + List getListPage(MonitoringPointCategorySearchParams pageSearchParam); +} diff --git a/dongjian-dashboard-back-dao/src/main/java/com/dongjian/dashboard/back/dao/ex/NotificationSlackMapperExt.java b/dongjian-dashboard-back-dao/src/main/java/com/dongjian/dashboard/back/dao/ex/NotificationSlackMapperExt.java new file mode 100644 index 0000000..3164bb5 --- /dev/null +++ b/dongjian-dashboard-back-dao/src/main/java/com/dongjian/dashboard/back/dao/ex/NotificationSlackMapperExt.java @@ -0,0 +1,18 @@ +package com.dongjian.dashboard.back.dao.ex; + +import java.util.List; + +import org.apache.ibatis.annotations.Mapper; + +import com.dongjian.dashboard.back.dao.auto.NotificationSlackMapper; +import com.dongjian.dashboard.back.dto.notificationconfig.OptSlackParams; +import com.dongjian.dashboard.back.dto.notificationconfig.SlackSearchParams; +import com.dongjian.dashboard.back.vo.notificationconfig.SlackPageVO; + +@Mapper +public interface NotificationSlackMapperExt extends NotificationSlackMapper{ + + int checkExist(OptSlackParams optSlackParams); + + List getListPage(SlackSearchParams pageSearchParam); +} diff --git a/dongjian-dashboard-back-dao/src/main/java/com/dongjian/dashboard/back/dao/ex/NotificationTeamsMapperExt.java b/dongjian-dashboard-back-dao/src/main/java/com/dongjian/dashboard/back/dao/ex/NotificationTeamsMapperExt.java new file mode 100644 index 0000000..2f11c0f --- /dev/null +++ b/dongjian-dashboard-back-dao/src/main/java/com/dongjian/dashboard/back/dao/ex/NotificationTeamsMapperExt.java @@ -0,0 +1,18 @@ +package com.dongjian.dashboard.back.dao.ex; + +import java.util.List; + +import org.apache.ibatis.annotations.Mapper; + +import com.dongjian.dashboard.back.dao.auto.NotificationTeamsMapper; +import com.dongjian.dashboard.back.dto.notificationconfig.OptTeamsParams; +import com.dongjian.dashboard.back.dto.notificationconfig.TeamsSearchParams; +import com.dongjian.dashboard.back.vo.notificationconfig.TeamsPageVO; + +@Mapper +public interface NotificationTeamsMapperExt extends NotificationTeamsMapper{ + + int checkExist(OptTeamsParams optTeamsParams); + + List getListPage(TeamsSearchParams pageSearchParam); +} diff --git a/dongjian-dashboard-back-dao/src/main/java/com/dongjian/dashboard/back/dao/ex/SysEnvMapperExt.java b/dongjian-dashboard-back-dao/src/main/java/com/dongjian/dashboard/back/dao/ex/SysEnvMapperExt.java new file mode 100644 index 0000000..0ff4b98 --- /dev/null +++ b/dongjian-dashboard-back-dao/src/main/java/com/dongjian/dashboard/back/dao/ex/SysEnvMapperExt.java @@ -0,0 +1,11 @@ +package com.dongjian.dashboard.back.dao.ex; + + +import com.dongjian.dashboard.back.dao.auto.SysEnvMapper; +import com.dongjian.dashboard.back.model.SysEnv; +import org.apache.ibatis.annotations.Mapper; + +@Mapper +public interface SysEnvMapperExt extends SysEnvMapper { + SysEnv selectByPrimaryKeyWithCompanyId(String envKey, String companyId); +} diff --git a/dongjian-dashboard-back-dao/src/main/java/com/dongjian/dashboard/back/dao/ex/UserBuildingRelationMapperExt.java b/dongjian-dashboard-back-dao/src/main/java/com/dongjian/dashboard/back/dao/ex/UserBuildingRelationMapperExt.java new file mode 100644 index 0000000..5ba1563 --- /dev/null +++ b/dongjian-dashboard-back-dao/src/main/java/com/dongjian/dashboard/back/dao/ex/UserBuildingRelationMapperExt.java @@ -0,0 +1,18 @@ +package com.dongjian.dashboard.back.dao.ex; + +import java.util.List; + +import com.dongjian.dashboard.back.dao.auto.UserBuildingRelationMapper; +import com.dongjian.dashboard.back.model.UserBuildingRelation; +import com.dongjian.dashboard.back.vo.building.BindedBuildingVO; +import org.apache.ibatis.annotations.Mapper; + +@Mapper +public interface UserBuildingRelationMapperExt extends UserBuildingRelationMapper { + + void deleteByUserId(Long userId); + + void batchInsert(List userBuildingRelationList); + + List getBindedBuilding(Long sourceUserId); +} diff --git a/dongjian-dashboard-back-dao/src/main/resources/mappers/auto/AlertHandleHistoryMapper.xml b/dongjian-dashboard-back-dao/src/main/resources/mappers/auto/AlertHandleHistoryMapper.xml new file mode 100644 index 0000000..3c41888 --- /dev/null +++ b/dongjian-dashboard-back-dao/src/main/resources/mappers/auto/AlertHandleHistoryMapper.xml @@ -0,0 +1,404 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + + id, alert_history_id, device_id, last_status, `status`, `handler`, alert_status, + handle_at + + + + remark + + + + + + + delete from alert_handle_history + where id = #{id,jdbcType=BIGINT} + + + + delete from alert_handle_history + + + + + + + + SELECT LAST_INSERT_ID() + + insert into alert_handle_history (alert_history_id, device_id, last_status, + `status`, `handler`, alert_status, + handle_at, remark) + values (#{alertHistoryId,jdbcType=BIGINT}, #{deviceId,jdbcType=VARCHAR}, #{lastStatus,jdbcType=INTEGER}, + #{status,jdbcType=INTEGER}, #{handler,jdbcType=VARCHAR}, #{alertStatus,jdbcType=INTEGER}, + #{handleAt,jdbcType=BIGINT}, #{remark,jdbcType=LONGVARCHAR}) + + + + + SELECT LAST_INSERT_ID() + + insert into alert_handle_history + + + alert_history_id, + + + device_id, + + + last_status, + + + `status`, + + + `handler`, + + + alert_status, + + + handle_at, + + + remark, + + + + + #{alertHistoryId,jdbcType=BIGINT}, + + + #{deviceId,jdbcType=VARCHAR}, + + + #{lastStatus,jdbcType=INTEGER}, + + + #{status,jdbcType=INTEGER}, + + + #{handler,jdbcType=VARCHAR}, + + + #{alertStatus,jdbcType=INTEGER}, + + + #{handleAt,jdbcType=BIGINT}, + + + #{remark,jdbcType=LONGVARCHAR}, + + + + + + + update alert_handle_history + + + id = #{record.id,jdbcType=BIGINT}, + + + alert_history_id = #{record.alertHistoryId,jdbcType=BIGINT}, + + + device_id = #{record.deviceId,jdbcType=VARCHAR}, + + + last_status = #{record.lastStatus,jdbcType=INTEGER}, + + + `status` = #{record.status,jdbcType=INTEGER}, + + + `handler` = #{record.handler,jdbcType=VARCHAR}, + + + alert_status = #{record.alertStatus,jdbcType=INTEGER}, + + + handle_at = #{record.handleAt,jdbcType=BIGINT}, + + + remark = #{record.remark,jdbcType=LONGVARCHAR}, + + + + + + + + + update alert_handle_history + set id = #{record.id,jdbcType=BIGINT}, + alert_history_id = #{record.alertHistoryId,jdbcType=BIGINT}, + device_id = #{record.deviceId,jdbcType=VARCHAR}, + last_status = #{record.lastStatus,jdbcType=INTEGER}, + `status` = #{record.status,jdbcType=INTEGER}, + `handler` = #{record.handler,jdbcType=VARCHAR}, + alert_status = #{record.alertStatus,jdbcType=INTEGER}, + handle_at = #{record.handleAt,jdbcType=BIGINT}, + remark = #{record.remark,jdbcType=LONGVARCHAR} + + + + + + + update alert_handle_history + set id = #{record.id,jdbcType=BIGINT}, + alert_history_id = #{record.alertHistoryId,jdbcType=BIGINT}, + device_id = #{record.deviceId,jdbcType=VARCHAR}, + last_status = #{record.lastStatus,jdbcType=INTEGER}, + `status` = #{record.status,jdbcType=INTEGER}, + `handler` = #{record.handler,jdbcType=VARCHAR}, + alert_status = #{record.alertStatus,jdbcType=INTEGER}, + handle_at = #{record.handleAt,jdbcType=BIGINT} + + + + + + + update alert_handle_history + + + alert_history_id = #{alertHistoryId,jdbcType=BIGINT}, + + + device_id = #{deviceId,jdbcType=VARCHAR}, + + + last_status = #{lastStatus,jdbcType=INTEGER}, + + + `status` = #{status,jdbcType=INTEGER}, + + + `handler` = #{handler,jdbcType=VARCHAR}, + + + alert_status = #{alertStatus,jdbcType=INTEGER}, + + + handle_at = #{handleAt,jdbcType=BIGINT}, + + + remark = #{remark,jdbcType=LONGVARCHAR}, + + + where id = #{id,jdbcType=BIGINT} + + + + update alert_handle_history + set alert_history_id = #{alertHistoryId,jdbcType=BIGINT}, + device_id = #{deviceId,jdbcType=VARCHAR}, + last_status = #{lastStatus,jdbcType=INTEGER}, + `status` = #{status,jdbcType=INTEGER}, + `handler` = #{handler,jdbcType=VARCHAR}, + alert_status = #{alertStatus,jdbcType=INTEGER}, + handle_at = #{handleAt,jdbcType=BIGINT}, + remark = #{remark,jdbcType=LONGVARCHAR} + where id = #{id,jdbcType=BIGINT} + + + + update alert_handle_history + set alert_history_id = #{alertHistoryId,jdbcType=BIGINT}, + device_id = #{deviceId,jdbcType=VARCHAR}, + last_status = #{lastStatus,jdbcType=INTEGER}, + `status` = #{status,jdbcType=INTEGER}, + `handler` = #{handler,jdbcType=VARCHAR}, + alert_status = #{alertStatus,jdbcType=INTEGER}, + handle_at = #{handleAt,jdbcType=BIGINT} + where id = #{id,jdbcType=BIGINT} + + \ No newline at end of file diff --git a/dongjian-dashboard-back-dao/src/main/resources/mappers/auto/AlertHistoryMapper.xml b/dongjian-dashboard-back-dao/src/main/resources/mappers/auto/AlertHistoryMapper.xml new file mode 100644 index 0000000..18bffa0 --- /dev/null +++ b/dongjian-dashboard-back-dao/src/main/resources/mappers/auto/AlertHistoryMapper.xml @@ -0,0 +1,304 @@ + + + + + + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + + id, device_id, receive_ts, confirm_status, handle_status, alert_status, retain_alert + + + + + + delete from alert_history + where id = #{id,jdbcType=BIGINT} + + + + delete from alert_history + + + + + + + + SELECT LAST_INSERT_ID() + + insert into alert_history (device_id, receive_ts, confirm_status, + handle_status, alert_status, retain_alert + ) + values (#{deviceId,jdbcType=VARCHAR}, #{receiveTs,jdbcType=BIGINT}, #{confirmStatus,jdbcType=INTEGER}, + #{handleStatus,jdbcType=INTEGER}, #{alertStatus,jdbcType=INTEGER}, #{retainAlert,jdbcType=INTEGER} + ) + + + + + SELECT LAST_INSERT_ID() + + insert into alert_history + + + device_id, + + + receive_ts, + + + confirm_status, + + + handle_status, + + + alert_status, + + + retain_alert, + + + + + #{deviceId,jdbcType=VARCHAR}, + + + #{receiveTs,jdbcType=BIGINT}, + + + #{confirmStatus,jdbcType=INTEGER}, + + + #{handleStatus,jdbcType=INTEGER}, + + + #{alertStatus,jdbcType=INTEGER}, + + + #{retainAlert,jdbcType=INTEGER}, + + + + + + + update alert_history + + + id = #{record.id,jdbcType=BIGINT}, + + + device_id = #{record.deviceId,jdbcType=VARCHAR}, + + + receive_ts = #{record.receiveTs,jdbcType=BIGINT}, + + + confirm_status = #{record.confirmStatus,jdbcType=INTEGER}, + + + handle_status = #{record.handleStatus,jdbcType=INTEGER}, + + + alert_status = #{record.alertStatus,jdbcType=INTEGER}, + + + retain_alert = #{record.retainAlert,jdbcType=INTEGER}, + + + + + + + + + update alert_history + set id = #{record.id,jdbcType=BIGINT}, + device_id = #{record.deviceId,jdbcType=VARCHAR}, + receive_ts = #{record.receiveTs,jdbcType=BIGINT}, + confirm_status = #{record.confirmStatus,jdbcType=INTEGER}, + handle_status = #{record.handleStatus,jdbcType=INTEGER}, + alert_status = #{record.alertStatus,jdbcType=INTEGER}, + retain_alert = #{record.retainAlert,jdbcType=INTEGER} + + + + + + + update alert_history + + + device_id = #{deviceId,jdbcType=VARCHAR}, + + + receive_ts = #{receiveTs,jdbcType=BIGINT}, + + + confirm_status = #{confirmStatus,jdbcType=INTEGER}, + + + handle_status = #{handleStatus,jdbcType=INTEGER}, + + + alert_status = #{alertStatus,jdbcType=INTEGER}, + + + retain_alert = #{retainAlert,jdbcType=INTEGER}, + + + where id = #{id,jdbcType=BIGINT} + + + + update alert_history + set device_id = #{deviceId,jdbcType=VARCHAR}, + receive_ts = #{receiveTs,jdbcType=BIGINT}, + confirm_status = #{confirmStatus,jdbcType=INTEGER}, + handle_status = #{handleStatus,jdbcType=INTEGER}, + alert_status = #{alertStatus,jdbcType=INTEGER}, + retain_alert = #{retainAlert,jdbcType=INTEGER} + where id = #{id,jdbcType=BIGINT} + + \ No newline at end of file diff --git a/dongjian-dashboard-back-dao/src/main/resources/mappers/auto/BaStatusStatisticsMapper.xml b/dongjian-dashboard-back-dao/src/main/resources/mappers/auto/BaStatusStatisticsMapper.xml new file mode 100644 index 0000000..86bc4e9 --- /dev/null +++ b/dongjian-dashboard-back-dao/src/main/resources/mappers/auto/BaStatusStatisticsMapper.xml @@ -0,0 +1,337 @@ + + + + + + + + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + + id, device_info_id, is_running, latest_ts, continuous_running_time, aggregated_running_time, + running_count, last_start_time, last_stop_time + + + + + + delete from ba_status_statistics + where id = #{id,jdbcType=INTEGER} + + + + delete from ba_status_statistics + + + + + + + insert into ba_status_statistics (id, device_info_id, is_running, + latest_ts, continuous_running_time, aggregated_running_time, + running_count, last_start_time, last_stop_time + ) + values (#{id,jdbcType=INTEGER}, #{deviceInfoId,jdbcType=INTEGER}, #{isRunning,jdbcType=INTEGER}, + #{latestTs,jdbcType=VARCHAR}, #{continuousRunningTime,jdbcType=BIGINT}, #{aggregatedRunningTime,jdbcType=BIGINT}, + #{runningCount,jdbcType=INTEGER}, #{lastStartTime,jdbcType=BIGINT}, #{lastStopTime,jdbcType=BIGINT} + ) + + + + insert into ba_status_statistics + + + id, + + + device_info_id, + + + is_running, + + + latest_ts, + + + continuous_running_time, + + + aggregated_running_time, + + + running_count, + + + last_start_time, + + + last_stop_time, + + + + + #{id,jdbcType=INTEGER}, + + + #{deviceInfoId,jdbcType=INTEGER}, + + + #{isRunning,jdbcType=INTEGER}, + + + #{latestTs,jdbcType=VARCHAR}, + + + #{continuousRunningTime,jdbcType=BIGINT}, + + + #{aggregatedRunningTime,jdbcType=BIGINT}, + + + #{runningCount,jdbcType=INTEGER}, + + + #{lastStartTime,jdbcType=BIGINT}, + + + #{lastStopTime,jdbcType=BIGINT}, + + + + + + + update ba_status_statistics + + + id = #{record.id,jdbcType=INTEGER}, + + + device_info_id = #{record.deviceInfoId,jdbcType=INTEGER}, + + + is_running = #{record.isRunning,jdbcType=INTEGER}, + + + latest_ts = #{record.latestTs,jdbcType=VARCHAR}, + + + continuous_running_time = #{record.continuousRunningTime,jdbcType=BIGINT}, + + + aggregated_running_time = #{record.aggregatedRunningTime,jdbcType=BIGINT}, + + + running_count = #{record.runningCount,jdbcType=INTEGER}, + + + last_start_time = #{record.lastStartTime,jdbcType=BIGINT}, + + + last_stop_time = #{record.lastStopTime,jdbcType=BIGINT}, + + + + + + + + + update ba_status_statistics + set id = #{record.id,jdbcType=INTEGER}, + device_info_id = #{record.deviceInfoId,jdbcType=INTEGER}, + is_running = #{record.isRunning,jdbcType=INTEGER}, + latest_ts = #{record.latestTs,jdbcType=VARCHAR}, + continuous_running_time = #{record.continuousRunningTime,jdbcType=BIGINT}, + aggregated_running_time = #{record.aggregatedRunningTime,jdbcType=BIGINT}, + running_count = #{record.runningCount,jdbcType=INTEGER}, + last_start_time = #{record.lastStartTime,jdbcType=BIGINT}, + last_stop_time = #{record.lastStopTime,jdbcType=BIGINT} + + + + + + + update ba_status_statistics + + + device_info_id = #{deviceInfoId,jdbcType=INTEGER}, + + + is_running = #{isRunning,jdbcType=INTEGER}, + + + latest_ts = #{latestTs,jdbcType=VARCHAR}, + + + continuous_running_time = #{continuousRunningTime,jdbcType=BIGINT}, + + + aggregated_running_time = #{aggregatedRunningTime,jdbcType=BIGINT}, + + + running_count = #{runningCount,jdbcType=INTEGER}, + + + last_start_time = #{lastStartTime,jdbcType=BIGINT}, + + + last_stop_time = #{lastStopTime,jdbcType=BIGINT}, + + + where id = #{id,jdbcType=INTEGER} + + + + update ba_status_statistics + set device_info_id = #{deviceInfoId,jdbcType=INTEGER}, + is_running = #{isRunning,jdbcType=INTEGER}, + latest_ts = #{latestTs,jdbcType=VARCHAR}, + continuous_running_time = #{continuousRunningTime,jdbcType=BIGINT}, + aggregated_running_time = #{aggregatedRunningTime,jdbcType=BIGINT}, + running_count = #{runningCount,jdbcType=INTEGER}, + last_start_time = #{lastStartTime,jdbcType=BIGINT}, + last_stop_time = #{lastStopTime,jdbcType=BIGINT} + where id = #{id,jdbcType=INTEGER} + + \ No newline at end of file diff --git a/dongjian-dashboard-back-dao/src/main/resources/mappers/auto/BasicBuildingMapper.xml b/dongjian-dashboard-back-dao/src/main/resources/mappers/auto/BasicBuildingMapper.xml new file mode 100644 index 0000000..fa7ea51 --- /dev/null +++ b/dongjian-dashboard-back-dao/src/main/resources/mappers/auto/BasicBuildingMapper.xml @@ -0,0 +1,527 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + + building_id, company_id, `name`, address, flag, create_time, creator_id, modify_time, + modifier_id, udf_building_id, building_bucket, thumbnail_num, show_switch_2d3d, brief_introduction + + + + floor_info_list, picture_introduction + + + + + + + delete from basic_building + where building_id = #{buildingId,jdbcType=BIGINT} + + + + delete from basic_building + + + + + + + insert into basic_building (building_id, company_id, `name`, + address, flag, create_time, + creator_id, modify_time, modifier_id, + udf_building_id, building_bucket, thumbnail_num, + show_switch_2d3d, brief_introduction, floor_info_list, + picture_introduction) + values (#{buildingId,jdbcType=BIGINT}, #{companyId,jdbcType=BIGINT}, #{name,jdbcType=VARCHAR}, + #{address,jdbcType=VARCHAR}, #{flag,jdbcType=INTEGER}, #{createTime,jdbcType=BIGINT}, + #{creatorId,jdbcType=BIGINT}, #{modifyTime,jdbcType=BIGINT}, #{modifierId,jdbcType=BIGINT}, + #{udfBuildingId,jdbcType=VARCHAR}, #{buildingBucket,jdbcType=VARCHAR}, #{thumbnailNum,jdbcType=INTEGER}, + #{showSwitch2d3d,jdbcType=INTEGER}, #{briefIntroduction,jdbcType=VARCHAR}, #{floorInfoList,jdbcType=LONGVARCHAR}, + #{pictureIntroduction,jdbcType=LONGVARCHAR}) + + + + insert into basic_building + + + building_id, + + + company_id, + + + `name`, + + + address, + + + flag, + + + create_time, + + + creator_id, + + + modify_time, + + + modifier_id, + + + udf_building_id, + + + building_bucket, + + + thumbnail_num, + + + show_switch_2d3d, + + + brief_introduction, + + + floor_info_list, + + + picture_introduction, + + + + + #{buildingId,jdbcType=BIGINT}, + + + #{companyId,jdbcType=BIGINT}, + + + #{name,jdbcType=VARCHAR}, + + + #{address,jdbcType=VARCHAR}, + + + #{flag,jdbcType=INTEGER}, + + + #{createTime,jdbcType=BIGINT}, + + + #{creatorId,jdbcType=BIGINT}, + + + #{modifyTime,jdbcType=BIGINT}, + + + #{modifierId,jdbcType=BIGINT}, + + + #{udfBuildingId,jdbcType=VARCHAR}, + + + #{buildingBucket,jdbcType=VARCHAR}, + + + #{thumbnailNum,jdbcType=INTEGER}, + + + #{showSwitch2d3d,jdbcType=INTEGER}, + + + #{briefIntroduction,jdbcType=VARCHAR}, + + + #{floorInfoList,jdbcType=LONGVARCHAR}, + + + #{pictureIntroduction,jdbcType=LONGVARCHAR}, + + + + + + + update basic_building + + + building_id = #{record.buildingId,jdbcType=BIGINT}, + + + company_id = #{record.companyId,jdbcType=BIGINT}, + + + `name` = #{record.name,jdbcType=VARCHAR}, + + + address = #{record.address,jdbcType=VARCHAR}, + + + flag = #{record.flag,jdbcType=INTEGER}, + + + create_time = #{record.createTime,jdbcType=BIGINT}, + + + creator_id = #{record.creatorId,jdbcType=BIGINT}, + + + modify_time = #{record.modifyTime,jdbcType=BIGINT}, + + + modifier_id = #{record.modifierId,jdbcType=BIGINT}, + + + udf_building_id = #{record.udfBuildingId,jdbcType=VARCHAR}, + + + building_bucket = #{record.buildingBucket,jdbcType=VARCHAR}, + + + thumbnail_num = #{record.thumbnailNum,jdbcType=INTEGER}, + + + show_switch_2d3d = #{record.showSwitch2d3d,jdbcType=INTEGER}, + + + brief_introduction = #{record.briefIntroduction,jdbcType=VARCHAR}, + + + floor_info_list = #{record.floorInfoList,jdbcType=LONGVARCHAR}, + + + picture_introduction = #{record.pictureIntroduction,jdbcType=LONGVARCHAR}, + + + + + + + + + update basic_building + set building_id = #{record.buildingId,jdbcType=BIGINT}, + company_id = #{record.companyId,jdbcType=BIGINT}, + `name` = #{record.name,jdbcType=VARCHAR}, + address = #{record.address,jdbcType=VARCHAR}, + flag = #{record.flag,jdbcType=INTEGER}, + create_time = #{record.createTime,jdbcType=BIGINT}, + creator_id = #{record.creatorId,jdbcType=BIGINT}, + modify_time = #{record.modifyTime,jdbcType=BIGINT}, + modifier_id = #{record.modifierId,jdbcType=BIGINT}, + udf_building_id = #{record.udfBuildingId,jdbcType=VARCHAR}, + building_bucket = #{record.buildingBucket,jdbcType=VARCHAR}, + thumbnail_num = #{record.thumbnailNum,jdbcType=INTEGER}, + show_switch_2d3d = #{record.showSwitch2d3d,jdbcType=INTEGER}, + brief_introduction = #{record.briefIntroduction,jdbcType=VARCHAR}, + floor_info_list = #{record.floorInfoList,jdbcType=LONGVARCHAR}, + picture_introduction = #{record.pictureIntroduction,jdbcType=LONGVARCHAR} + + + + + + + update basic_building + set building_id = #{record.buildingId,jdbcType=BIGINT}, + company_id = #{record.companyId,jdbcType=BIGINT}, + `name` = #{record.name,jdbcType=VARCHAR}, + address = #{record.address,jdbcType=VARCHAR}, + flag = #{record.flag,jdbcType=INTEGER}, + create_time = #{record.createTime,jdbcType=BIGINT}, + creator_id = #{record.creatorId,jdbcType=BIGINT}, + modify_time = #{record.modifyTime,jdbcType=BIGINT}, + modifier_id = #{record.modifierId,jdbcType=BIGINT}, + udf_building_id = #{record.udfBuildingId,jdbcType=VARCHAR}, + building_bucket = #{record.buildingBucket,jdbcType=VARCHAR}, + thumbnail_num = #{record.thumbnailNum,jdbcType=INTEGER}, + show_switch_2d3d = #{record.showSwitch2d3d,jdbcType=INTEGER}, + brief_introduction = #{record.briefIntroduction,jdbcType=VARCHAR} + + + + + + + update basic_building + + + company_id = #{companyId,jdbcType=BIGINT}, + + + `name` = #{name,jdbcType=VARCHAR}, + + + address = #{address,jdbcType=VARCHAR}, + + + flag = #{flag,jdbcType=INTEGER}, + + + create_time = #{createTime,jdbcType=BIGINT}, + + + creator_id = #{creatorId,jdbcType=BIGINT}, + + + modify_time = #{modifyTime,jdbcType=BIGINT}, + + + modifier_id = #{modifierId,jdbcType=BIGINT}, + + + udf_building_id = #{udfBuildingId,jdbcType=VARCHAR}, + + + building_bucket = #{buildingBucket,jdbcType=VARCHAR}, + + + thumbnail_num = #{thumbnailNum,jdbcType=INTEGER}, + + + show_switch_2d3d = #{showSwitch2d3d,jdbcType=INTEGER}, + + + brief_introduction = #{briefIntroduction,jdbcType=VARCHAR}, + + + floor_info_list = #{floorInfoList,jdbcType=LONGVARCHAR}, + + + picture_introduction = #{pictureIntroduction,jdbcType=LONGVARCHAR}, + + + where building_id = #{buildingId,jdbcType=BIGINT} + + + + update basic_building + set company_id = #{companyId,jdbcType=BIGINT}, + `name` = #{name,jdbcType=VARCHAR}, + address = #{address,jdbcType=VARCHAR}, + flag = #{flag,jdbcType=INTEGER}, + create_time = #{createTime,jdbcType=BIGINT}, + creator_id = #{creatorId,jdbcType=BIGINT}, + modify_time = #{modifyTime,jdbcType=BIGINT}, + modifier_id = #{modifierId,jdbcType=BIGINT}, + udf_building_id = #{udfBuildingId,jdbcType=VARCHAR}, + building_bucket = #{buildingBucket,jdbcType=VARCHAR}, + thumbnail_num = #{thumbnailNum,jdbcType=INTEGER}, + show_switch_2d3d = #{showSwitch2d3d,jdbcType=INTEGER}, + brief_introduction = #{briefIntroduction,jdbcType=VARCHAR}, + floor_info_list = #{floorInfoList,jdbcType=LONGVARCHAR}, + picture_introduction = #{pictureIntroduction,jdbcType=LONGVARCHAR} + where building_id = #{buildingId,jdbcType=BIGINT} + + + + update basic_building + set company_id = #{companyId,jdbcType=BIGINT}, + `name` = #{name,jdbcType=VARCHAR}, + address = #{address,jdbcType=VARCHAR}, + flag = #{flag,jdbcType=INTEGER}, + create_time = #{createTime,jdbcType=BIGINT}, + creator_id = #{creatorId,jdbcType=BIGINT}, + modify_time = #{modifyTime,jdbcType=BIGINT}, + modifier_id = #{modifierId,jdbcType=BIGINT}, + udf_building_id = #{udfBuildingId,jdbcType=VARCHAR}, + building_bucket = #{buildingBucket,jdbcType=VARCHAR}, + thumbnail_num = #{thumbnailNum,jdbcType=INTEGER}, + show_switch_2d3d = #{showSwitch2d3d,jdbcType=INTEGER}, + brief_introduction = #{briefIntroduction,jdbcType=VARCHAR} + where building_id = #{buildingId,jdbcType=BIGINT} + + \ No newline at end of file diff --git a/dongjian-dashboard-back-dao/src/main/resources/mappers/auto/BasicCompanyMapper.xml b/dongjian-dashboard-back-dao/src/main/resources/mappers/auto/BasicCompanyMapper.xml new file mode 100644 index 0000000..22ef440 --- /dev/null +++ b/dongjian-dashboard-back-dao/src/main/resources/mappers/auto/BasicCompanyMapper.xml @@ -0,0 +1,583 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + + id, parent_id, company_name, mfa_switch, flag, create_time, creator_id, modify_time, + modifier_id, apikey, aurora_flag, aurora_url, aurora_read_url, aurora_username, aurora_password, + redis_db_id, third_api_host, lock_switch + + + + bearer_token + + + + + + + delete from basic_company + where id = #{id,jdbcType=BIGINT} + + + + delete from basic_company + + + + + + + + SELECT LAST_INSERT_ID() + + insert into basic_company (parent_id, company_name, mfa_switch, + flag, create_time, creator_id, + modify_time, modifier_id, apikey, + aurora_flag, aurora_url, aurora_read_url, + aurora_username, aurora_password, redis_db_id, + third_api_host, lock_switch, bearer_token + ) + values (#{parentId,jdbcType=BIGINT}, #{companyName,jdbcType=VARCHAR}, #{mfaSwitch,jdbcType=INTEGER}, + #{flag,jdbcType=INTEGER}, #{createTime,jdbcType=BIGINT}, #{creatorId,jdbcType=BIGINT}, + #{modifyTime,jdbcType=BIGINT}, #{modifierId,jdbcType=BIGINT}, #{apikey,jdbcType=VARCHAR}, + #{auroraFlag,jdbcType=INTEGER}, #{auroraUrl,jdbcType=VARCHAR}, #{auroraReadUrl,jdbcType=VARCHAR}, + #{auroraUsername,jdbcType=VARCHAR}, #{auroraPassword,jdbcType=VARCHAR}, #{redisDbId,jdbcType=INTEGER}, + #{thirdApiHost,jdbcType=VARCHAR}, #{lockSwitch,jdbcType=INTEGER}, #{bearerToken,jdbcType=LONGVARCHAR} + ) + + + + + SELECT LAST_INSERT_ID() + + insert into basic_company + + + parent_id, + + + company_name, + + + mfa_switch, + + + flag, + + + create_time, + + + creator_id, + + + modify_time, + + + modifier_id, + + + apikey, + + + aurora_flag, + + + aurora_url, + + + aurora_read_url, + + + aurora_username, + + + aurora_password, + + + redis_db_id, + + + third_api_host, + + + lock_switch, + + + bearer_token, + + + + + #{parentId,jdbcType=BIGINT}, + + + #{companyName,jdbcType=VARCHAR}, + + + #{mfaSwitch,jdbcType=INTEGER}, + + + #{flag,jdbcType=INTEGER}, + + + #{createTime,jdbcType=BIGINT}, + + + #{creatorId,jdbcType=BIGINT}, + + + #{modifyTime,jdbcType=BIGINT}, + + + #{modifierId,jdbcType=BIGINT}, + + + #{apikey,jdbcType=VARCHAR}, + + + #{auroraFlag,jdbcType=INTEGER}, + + + #{auroraUrl,jdbcType=VARCHAR}, + + + #{auroraReadUrl,jdbcType=VARCHAR}, + + + #{auroraUsername,jdbcType=VARCHAR}, + + + #{auroraPassword,jdbcType=VARCHAR}, + + + #{redisDbId,jdbcType=INTEGER}, + + + #{thirdApiHost,jdbcType=VARCHAR}, + + + #{lockSwitch,jdbcType=INTEGER}, + + + #{bearerToken,jdbcType=LONGVARCHAR}, + + + + + + + update basic_company + + + id = #{record.id,jdbcType=BIGINT}, + + + parent_id = #{record.parentId,jdbcType=BIGINT}, + + + company_name = #{record.companyName,jdbcType=VARCHAR}, + + + mfa_switch = #{record.mfaSwitch,jdbcType=INTEGER}, + + + flag = #{record.flag,jdbcType=INTEGER}, + + + create_time = #{record.createTime,jdbcType=BIGINT}, + + + creator_id = #{record.creatorId,jdbcType=BIGINT}, + + + modify_time = #{record.modifyTime,jdbcType=BIGINT}, + + + modifier_id = #{record.modifierId,jdbcType=BIGINT}, + + + apikey = #{record.apikey,jdbcType=VARCHAR}, + + + aurora_flag = #{record.auroraFlag,jdbcType=INTEGER}, + + + aurora_url = #{record.auroraUrl,jdbcType=VARCHAR}, + + + aurora_read_url = #{record.auroraReadUrl,jdbcType=VARCHAR}, + + + aurora_username = #{record.auroraUsername,jdbcType=VARCHAR}, + + + aurora_password = #{record.auroraPassword,jdbcType=VARCHAR}, + + + redis_db_id = #{record.redisDbId,jdbcType=INTEGER}, + + + third_api_host = #{record.thirdApiHost,jdbcType=VARCHAR}, + + + lock_switch = #{record.lockSwitch,jdbcType=INTEGER}, + + + bearer_token = #{record.bearerToken,jdbcType=LONGVARCHAR}, + + + + + + + + + update basic_company + set id = #{record.id,jdbcType=BIGINT}, + parent_id = #{record.parentId,jdbcType=BIGINT}, + company_name = #{record.companyName,jdbcType=VARCHAR}, + mfa_switch = #{record.mfaSwitch,jdbcType=INTEGER}, + flag = #{record.flag,jdbcType=INTEGER}, + create_time = #{record.createTime,jdbcType=BIGINT}, + creator_id = #{record.creatorId,jdbcType=BIGINT}, + modify_time = #{record.modifyTime,jdbcType=BIGINT}, + modifier_id = #{record.modifierId,jdbcType=BIGINT}, + apikey = #{record.apikey,jdbcType=VARCHAR}, + aurora_flag = #{record.auroraFlag,jdbcType=INTEGER}, + aurora_url = #{record.auroraUrl,jdbcType=VARCHAR}, + aurora_read_url = #{record.auroraReadUrl,jdbcType=VARCHAR}, + aurora_username = #{record.auroraUsername,jdbcType=VARCHAR}, + aurora_password = #{record.auroraPassword,jdbcType=VARCHAR}, + redis_db_id = #{record.redisDbId,jdbcType=INTEGER}, + third_api_host = #{record.thirdApiHost,jdbcType=VARCHAR}, + lock_switch = #{record.lockSwitch,jdbcType=INTEGER}, + bearer_token = #{record.bearerToken,jdbcType=LONGVARCHAR} + + + + + + + update basic_company + set id = #{record.id,jdbcType=BIGINT}, + parent_id = #{record.parentId,jdbcType=BIGINT}, + company_name = #{record.companyName,jdbcType=VARCHAR}, + mfa_switch = #{record.mfaSwitch,jdbcType=INTEGER}, + flag = #{record.flag,jdbcType=INTEGER}, + create_time = #{record.createTime,jdbcType=BIGINT}, + creator_id = #{record.creatorId,jdbcType=BIGINT}, + modify_time = #{record.modifyTime,jdbcType=BIGINT}, + modifier_id = #{record.modifierId,jdbcType=BIGINT}, + apikey = #{record.apikey,jdbcType=VARCHAR}, + aurora_flag = #{record.auroraFlag,jdbcType=INTEGER}, + aurora_url = #{record.auroraUrl,jdbcType=VARCHAR}, + aurora_read_url = #{record.auroraReadUrl,jdbcType=VARCHAR}, + aurora_username = #{record.auroraUsername,jdbcType=VARCHAR}, + aurora_password = #{record.auroraPassword,jdbcType=VARCHAR}, + redis_db_id = #{record.redisDbId,jdbcType=INTEGER}, + third_api_host = #{record.thirdApiHost,jdbcType=VARCHAR}, + lock_switch = #{record.lockSwitch,jdbcType=INTEGER} + + + + + + + update basic_company + + + parent_id = #{parentId,jdbcType=BIGINT}, + + + company_name = #{companyName,jdbcType=VARCHAR}, + + + mfa_switch = #{mfaSwitch,jdbcType=INTEGER}, + + + flag = #{flag,jdbcType=INTEGER}, + + + create_time = #{createTime,jdbcType=BIGINT}, + + + creator_id = #{creatorId,jdbcType=BIGINT}, + + + modify_time = #{modifyTime,jdbcType=BIGINT}, + + + modifier_id = #{modifierId,jdbcType=BIGINT}, + + + apikey = #{apikey,jdbcType=VARCHAR}, + + + aurora_flag = #{auroraFlag,jdbcType=INTEGER}, + + + aurora_url = #{auroraUrl,jdbcType=VARCHAR}, + + + aurora_read_url = #{auroraReadUrl,jdbcType=VARCHAR}, + + + aurora_username = #{auroraUsername,jdbcType=VARCHAR}, + + + aurora_password = #{auroraPassword,jdbcType=VARCHAR}, + + + redis_db_id = #{redisDbId,jdbcType=INTEGER}, + + + third_api_host = #{thirdApiHost,jdbcType=VARCHAR}, + + + lock_switch = #{lockSwitch,jdbcType=INTEGER}, + + + bearer_token = #{bearerToken,jdbcType=LONGVARCHAR}, + + + where id = #{id,jdbcType=BIGINT} + + + + update basic_company + set parent_id = #{parentId,jdbcType=BIGINT}, + company_name = #{companyName,jdbcType=VARCHAR}, + mfa_switch = #{mfaSwitch,jdbcType=INTEGER}, + flag = #{flag,jdbcType=INTEGER}, + create_time = #{createTime,jdbcType=BIGINT}, + creator_id = #{creatorId,jdbcType=BIGINT}, + modify_time = #{modifyTime,jdbcType=BIGINT}, + modifier_id = #{modifierId,jdbcType=BIGINT}, + apikey = #{apikey,jdbcType=VARCHAR}, + aurora_flag = #{auroraFlag,jdbcType=INTEGER}, + aurora_url = #{auroraUrl,jdbcType=VARCHAR}, + aurora_read_url = #{auroraReadUrl,jdbcType=VARCHAR}, + aurora_username = #{auroraUsername,jdbcType=VARCHAR}, + aurora_password = #{auroraPassword,jdbcType=VARCHAR}, + redis_db_id = #{redisDbId,jdbcType=INTEGER}, + third_api_host = #{thirdApiHost,jdbcType=VARCHAR}, + lock_switch = #{lockSwitch,jdbcType=INTEGER}, + bearer_token = #{bearerToken,jdbcType=LONGVARCHAR} + where id = #{id,jdbcType=BIGINT} + + + + update basic_company + set parent_id = #{parentId,jdbcType=BIGINT}, + company_name = #{companyName,jdbcType=VARCHAR}, + mfa_switch = #{mfaSwitch,jdbcType=INTEGER}, + flag = #{flag,jdbcType=INTEGER}, + create_time = #{createTime,jdbcType=BIGINT}, + creator_id = #{creatorId,jdbcType=BIGINT}, + modify_time = #{modifyTime,jdbcType=BIGINT}, + modifier_id = #{modifierId,jdbcType=BIGINT}, + apikey = #{apikey,jdbcType=VARCHAR}, + aurora_flag = #{auroraFlag,jdbcType=INTEGER}, + aurora_url = #{auroraUrl,jdbcType=VARCHAR}, + aurora_read_url = #{auroraReadUrl,jdbcType=VARCHAR}, + aurora_username = #{auroraUsername,jdbcType=VARCHAR}, + aurora_password = #{auroraPassword,jdbcType=VARCHAR}, + redis_db_id = #{redisDbId,jdbcType=INTEGER}, + third_api_host = #{thirdApiHost,jdbcType=VARCHAR}, + lock_switch = #{lockSwitch,jdbcType=INTEGER} + where id = #{id,jdbcType=BIGINT} + + \ No newline at end of file diff --git a/dongjian-dashboard-back-dao/src/main/resources/mappers/auto/BasicMenuMapper.xml b/dongjian-dashboard-back-dao/src/main/resources/mappers/auto/BasicMenuMapper.xml new file mode 100644 index 0000000..77c8685 --- /dev/null +++ b/dongjian-dashboard-back-dao/src/main/resources/mappers/auto/BasicMenuMapper.xml @@ -0,0 +1,335 @@ + + + + + + + + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + + id, parent_menu_id, menu_name, menu_name_en, menu_name_jp, remark, menu_level, flag, + create_time + + + + + + delete from basic_menu + where id = #{id,jdbcType=BIGINT} + + + + delete from basic_menu + + + + + + + + SELECT LAST_INSERT_ID() + + insert into basic_menu (parent_menu_id, menu_name, menu_name_en, + menu_name_jp, remark, menu_level, + flag, create_time) + values (#{parentMenuId,jdbcType=BIGINT}, #{menuName,jdbcType=VARCHAR}, #{menuNameEn,jdbcType=VARCHAR}, + #{menuNameJp,jdbcType=VARCHAR}, #{remark,jdbcType=VARCHAR}, #{menuLevel,jdbcType=INTEGER}, + #{flag,jdbcType=INTEGER}, #{createTime,jdbcType=BIGINT}) + + + + + SELECT LAST_INSERT_ID() + + insert into basic_menu + + + parent_menu_id, + + + menu_name, + + + menu_name_en, + + + menu_name_jp, + + + remark, + + + menu_level, + + + flag, + + + create_time, + + + + + #{parentMenuId,jdbcType=BIGINT}, + + + #{menuName,jdbcType=VARCHAR}, + + + #{menuNameEn,jdbcType=VARCHAR}, + + + #{menuNameJp,jdbcType=VARCHAR}, + + + #{remark,jdbcType=VARCHAR}, + + + #{menuLevel,jdbcType=INTEGER}, + + + #{flag,jdbcType=INTEGER}, + + + #{createTime,jdbcType=BIGINT}, + + + + + + + update basic_menu + + + id = #{record.id,jdbcType=BIGINT}, + + + parent_menu_id = #{record.parentMenuId,jdbcType=BIGINT}, + + + menu_name = #{record.menuName,jdbcType=VARCHAR}, + + + menu_name_en = #{record.menuNameEn,jdbcType=VARCHAR}, + + + menu_name_jp = #{record.menuNameJp,jdbcType=VARCHAR}, + + + remark = #{record.remark,jdbcType=VARCHAR}, + + + menu_level = #{record.menuLevel,jdbcType=INTEGER}, + + + flag = #{record.flag,jdbcType=INTEGER}, + + + create_time = #{record.createTime,jdbcType=BIGINT}, + + + + + + + + + update basic_menu + set id = #{record.id,jdbcType=BIGINT}, + parent_menu_id = #{record.parentMenuId,jdbcType=BIGINT}, + menu_name = #{record.menuName,jdbcType=VARCHAR}, + menu_name_en = #{record.menuNameEn,jdbcType=VARCHAR}, + menu_name_jp = #{record.menuNameJp,jdbcType=VARCHAR}, + remark = #{record.remark,jdbcType=VARCHAR}, + menu_level = #{record.menuLevel,jdbcType=INTEGER}, + flag = #{record.flag,jdbcType=INTEGER}, + create_time = #{record.createTime,jdbcType=BIGINT} + + + + + + + update basic_menu + + + parent_menu_id = #{parentMenuId,jdbcType=BIGINT}, + + + menu_name = #{menuName,jdbcType=VARCHAR}, + + + menu_name_en = #{menuNameEn,jdbcType=VARCHAR}, + + + menu_name_jp = #{menuNameJp,jdbcType=VARCHAR}, + + + remark = #{remark,jdbcType=VARCHAR}, + + + menu_level = #{menuLevel,jdbcType=INTEGER}, + + + flag = #{flag,jdbcType=INTEGER}, + + + create_time = #{createTime,jdbcType=BIGINT}, + + + where id = #{id,jdbcType=BIGINT} + + + + update basic_menu + set parent_menu_id = #{parentMenuId,jdbcType=BIGINT}, + menu_name = #{menuName,jdbcType=VARCHAR}, + menu_name_en = #{menuNameEn,jdbcType=VARCHAR}, + menu_name_jp = #{menuNameJp,jdbcType=VARCHAR}, + remark = #{remark,jdbcType=VARCHAR}, + menu_level = #{menuLevel,jdbcType=INTEGER}, + flag = #{flag,jdbcType=INTEGER}, + create_time = #{createTime,jdbcType=BIGINT} + where id = #{id,jdbcType=BIGINT} + + \ No newline at end of file diff --git a/dongjian-dashboard-back-dao/src/main/resources/mappers/auto/BasicRoleMapper.xml b/dongjian-dashboard-back-dao/src/main/resources/mappers/auto/BasicRoleMapper.xml new file mode 100644 index 0000000..10307fd --- /dev/null +++ b/dongjian-dashboard-back-dao/src/main/resources/mappers/auto/BasicRoleMapper.xml @@ -0,0 +1,335 @@ + + + + + + + + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + + id, company_id, role_name, description, flag, creator_id, create_time, modifier_id, + modify_time + + + + + + delete from basic_role + where id = #{id,jdbcType=BIGINT} + + + + delete from basic_role + + + + + + + + SELECT LAST_INSERT_ID() + + insert into basic_role (company_id, role_name, description, + flag, creator_id, create_time, + modifier_id, modify_time) + values (#{companyId,jdbcType=BIGINT}, #{roleName,jdbcType=VARCHAR}, #{description,jdbcType=VARCHAR}, + #{flag,jdbcType=INTEGER}, #{creatorId,jdbcType=BIGINT}, #{createTime,jdbcType=BIGINT}, + #{modifierId,jdbcType=BIGINT}, #{modifyTime,jdbcType=BIGINT}) + + + + + SELECT LAST_INSERT_ID() + + insert into basic_role + + + company_id, + + + role_name, + + + description, + + + flag, + + + creator_id, + + + create_time, + + + modifier_id, + + + modify_time, + + + + + #{companyId,jdbcType=BIGINT}, + + + #{roleName,jdbcType=VARCHAR}, + + + #{description,jdbcType=VARCHAR}, + + + #{flag,jdbcType=INTEGER}, + + + #{creatorId,jdbcType=BIGINT}, + + + #{createTime,jdbcType=BIGINT}, + + + #{modifierId,jdbcType=BIGINT}, + + + #{modifyTime,jdbcType=BIGINT}, + + + + + + + update basic_role + + + id = #{record.id,jdbcType=BIGINT}, + + + company_id = #{record.companyId,jdbcType=BIGINT}, + + + role_name = #{record.roleName,jdbcType=VARCHAR}, + + + description = #{record.description,jdbcType=VARCHAR}, + + + flag = #{record.flag,jdbcType=INTEGER}, + + + creator_id = #{record.creatorId,jdbcType=BIGINT}, + + + create_time = #{record.createTime,jdbcType=BIGINT}, + + + modifier_id = #{record.modifierId,jdbcType=BIGINT}, + + + modify_time = #{record.modifyTime,jdbcType=BIGINT}, + + + + + + + + + update basic_role + set id = #{record.id,jdbcType=BIGINT}, + company_id = #{record.companyId,jdbcType=BIGINT}, + role_name = #{record.roleName,jdbcType=VARCHAR}, + description = #{record.description,jdbcType=VARCHAR}, + flag = #{record.flag,jdbcType=INTEGER}, + creator_id = #{record.creatorId,jdbcType=BIGINT}, + create_time = #{record.createTime,jdbcType=BIGINT}, + modifier_id = #{record.modifierId,jdbcType=BIGINT}, + modify_time = #{record.modifyTime,jdbcType=BIGINT} + + + + + + + update basic_role + + + company_id = #{companyId,jdbcType=BIGINT}, + + + role_name = #{roleName,jdbcType=VARCHAR}, + + + description = #{description,jdbcType=VARCHAR}, + + + flag = #{flag,jdbcType=INTEGER}, + + + creator_id = #{creatorId,jdbcType=BIGINT}, + + + create_time = #{createTime,jdbcType=BIGINT}, + + + modifier_id = #{modifierId,jdbcType=BIGINT}, + + + modify_time = #{modifyTime,jdbcType=BIGINT}, + + + where id = #{id,jdbcType=BIGINT} + + + + update basic_role + set company_id = #{companyId,jdbcType=BIGINT}, + role_name = #{roleName,jdbcType=VARCHAR}, + description = #{description,jdbcType=VARCHAR}, + flag = #{flag,jdbcType=INTEGER}, + creator_id = #{creatorId,jdbcType=BIGINT}, + create_time = #{createTime,jdbcType=BIGINT}, + modifier_id = #{modifierId,jdbcType=BIGINT}, + modify_time = #{modifyTime,jdbcType=BIGINT} + where id = #{id,jdbcType=BIGINT} + + \ No newline at end of file diff --git a/dongjian-dashboard-back-dao/src/main/resources/mappers/auto/BasicRoleMenuRelationMapper.xml b/dongjian-dashboard-back-dao/src/main/resources/mappers/auto/BasicRoleMenuRelationMapper.xml new file mode 100644 index 0000000..5490917 --- /dev/null +++ b/dongjian-dashboard-back-dao/src/main/resources/mappers/auto/BasicRoleMenuRelationMapper.xml @@ -0,0 +1,209 @@ + + + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + + role_id, menu_id, creator_id, create_time + + + + + delete from basic_role_menu_relation + + + + + + + insert into basic_role_menu_relation (role_id, menu_id, creator_id, + create_time) + values (#{roleId,jdbcType=BIGINT}, #{menuId,jdbcType=BIGINT}, #{creatorId,jdbcType=BIGINT}, + #{createTime,jdbcType=BIGINT}) + + + + insert into basic_role_menu_relation + + + role_id, + + + menu_id, + + + creator_id, + + + create_time, + + + + + #{roleId,jdbcType=BIGINT}, + + + #{menuId,jdbcType=BIGINT}, + + + #{creatorId,jdbcType=BIGINT}, + + + #{createTime,jdbcType=BIGINT}, + + + + + + + update basic_role_menu_relation + + + role_id = #{record.roleId,jdbcType=BIGINT}, + + + menu_id = #{record.menuId,jdbcType=BIGINT}, + + + creator_id = #{record.creatorId,jdbcType=BIGINT}, + + + create_time = #{record.createTime,jdbcType=BIGINT}, + + + + + + + + + update basic_role_menu_relation + set role_id = #{record.roleId,jdbcType=BIGINT}, + menu_id = #{record.menuId,jdbcType=BIGINT}, + creator_id = #{record.creatorId,jdbcType=BIGINT}, + create_time = #{record.createTime,jdbcType=BIGINT} + + + + + \ No newline at end of file diff --git a/dongjian-dashboard-back-dao/src/main/resources/mappers/auto/BasicRoleUserRelationMapper.xml b/dongjian-dashboard-back-dao/src/main/resources/mappers/auto/BasicRoleUserRelationMapper.xml new file mode 100644 index 0000000..7355fe4 --- /dev/null +++ b/dongjian-dashboard-back-dao/src/main/resources/mappers/auto/BasicRoleUserRelationMapper.xml @@ -0,0 +1,209 @@ + + + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + + user_id, role_id, creator_id, create_time + + + + + delete from basic_role_user_relation + + + + + + + insert into basic_role_user_relation (user_id, role_id, creator_id, + create_time) + values (#{userId,jdbcType=BIGINT}, #{roleId,jdbcType=BIGINT}, #{creatorId,jdbcType=BIGINT}, + #{createTime,jdbcType=BIGINT}) + + + + insert into basic_role_user_relation + + + user_id, + + + role_id, + + + creator_id, + + + create_time, + + + + + #{userId,jdbcType=BIGINT}, + + + #{roleId,jdbcType=BIGINT}, + + + #{creatorId,jdbcType=BIGINT}, + + + #{createTime,jdbcType=BIGINT}, + + + + + + + update basic_role_user_relation + + + user_id = #{record.userId,jdbcType=BIGINT}, + + + role_id = #{record.roleId,jdbcType=BIGINT}, + + + creator_id = #{record.creatorId,jdbcType=BIGINT}, + + + create_time = #{record.createTime,jdbcType=BIGINT}, + + + + + + + + + update basic_role_user_relation + set user_id = #{record.userId,jdbcType=BIGINT}, + role_id = #{record.roleId,jdbcType=BIGINT}, + creator_id = #{record.creatorId,jdbcType=BIGINT}, + create_time = #{record.createTime,jdbcType=BIGINT} + + + + + \ No newline at end of file diff --git a/dongjian-dashboard-back-dao/src/main/resources/mappers/auto/BasicUserMapper.xml b/dongjian-dashboard-back-dao/src/main/resources/mappers/auto/BasicUserMapper.xml new file mode 100644 index 0000000..21b9c88 --- /dev/null +++ b/dongjian-dashboard-back-dao/src/main/resources/mappers/auto/BasicUserMapper.xml @@ -0,0 +1,494 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + + id, user_type, company_id, username, login_name, `password`, salt, email, mfa_secret, + mfa_bind, mobile_number, last_login_time, flag, expire_time, create_time, creator_id, + modify_time, modifier_id, super_role + + + + + + delete from basic_user + where id = #{id,jdbcType=BIGINT} + + + + delete from basic_user + + + + + + + + SELECT LAST_INSERT_ID() + + insert into basic_user (user_type, company_id, username, + login_name, `password`, salt, + email, mfa_secret, mfa_bind, + mobile_number, last_login_time, flag, + expire_time, create_time, creator_id, + modify_time, modifier_id, super_role + ) + values (#{userType,jdbcType=INTEGER}, #{companyId,jdbcType=BIGINT}, #{username,jdbcType=VARCHAR}, + #{loginName,jdbcType=VARCHAR}, #{password,jdbcType=VARCHAR}, #{salt,jdbcType=VARCHAR}, + #{email,jdbcType=VARCHAR}, #{mfaSecret,jdbcType=VARCHAR}, #{mfaBind,jdbcType=INTEGER}, + #{mobileNumber,jdbcType=VARCHAR}, #{lastLoginTime,jdbcType=BIGINT}, #{flag,jdbcType=INTEGER}, + #{expireTime,jdbcType=BIGINT}, #{createTime,jdbcType=BIGINT}, #{creatorId,jdbcType=BIGINT}, + #{modifyTime,jdbcType=BIGINT}, #{modifierId,jdbcType=BIGINT}, #{superRole,jdbcType=INTEGER} + ) + + + + + SELECT LAST_INSERT_ID() + + insert into basic_user + + + user_type, + + + company_id, + + + username, + + + login_name, + + + `password`, + + + salt, + + + email, + + + mfa_secret, + + + mfa_bind, + + + mobile_number, + + + last_login_time, + + + flag, + + + expire_time, + + + create_time, + + + creator_id, + + + modify_time, + + + modifier_id, + + + super_role, + + + + + #{userType,jdbcType=INTEGER}, + + + #{companyId,jdbcType=BIGINT}, + + + #{username,jdbcType=VARCHAR}, + + + #{loginName,jdbcType=VARCHAR}, + + + #{password,jdbcType=VARCHAR}, + + + #{salt,jdbcType=VARCHAR}, + + + #{email,jdbcType=VARCHAR}, + + + #{mfaSecret,jdbcType=VARCHAR}, + + + #{mfaBind,jdbcType=INTEGER}, + + + #{mobileNumber,jdbcType=VARCHAR}, + + + #{lastLoginTime,jdbcType=BIGINT}, + + + #{flag,jdbcType=INTEGER}, + + + #{expireTime,jdbcType=BIGINT}, + + + #{createTime,jdbcType=BIGINT}, + + + #{creatorId,jdbcType=BIGINT}, + + + #{modifyTime,jdbcType=BIGINT}, + + + #{modifierId,jdbcType=BIGINT}, + + + #{superRole,jdbcType=INTEGER}, + + + + + + + update basic_user + + + id = #{record.id,jdbcType=BIGINT}, + + + user_type = #{record.userType,jdbcType=INTEGER}, + + + company_id = #{record.companyId,jdbcType=BIGINT}, + + + username = #{record.username,jdbcType=VARCHAR}, + + + login_name = #{record.loginName,jdbcType=VARCHAR}, + + + `password` = #{record.password,jdbcType=VARCHAR}, + + + salt = #{record.salt,jdbcType=VARCHAR}, + + + email = #{record.email,jdbcType=VARCHAR}, + + + mfa_secret = #{record.mfaSecret,jdbcType=VARCHAR}, + + + mfa_bind = #{record.mfaBind,jdbcType=INTEGER}, + + + mobile_number = #{record.mobileNumber,jdbcType=VARCHAR}, + + + last_login_time = #{record.lastLoginTime,jdbcType=BIGINT}, + + + flag = #{record.flag,jdbcType=INTEGER}, + + + expire_time = #{record.expireTime,jdbcType=BIGINT}, + + + create_time = #{record.createTime,jdbcType=BIGINT}, + + + creator_id = #{record.creatorId,jdbcType=BIGINT}, + + + modify_time = #{record.modifyTime,jdbcType=BIGINT}, + + + modifier_id = #{record.modifierId,jdbcType=BIGINT}, + + + super_role = #{record.superRole,jdbcType=INTEGER}, + + + + + + + + + update basic_user + set id = #{record.id,jdbcType=BIGINT}, + user_type = #{record.userType,jdbcType=INTEGER}, + company_id = #{record.companyId,jdbcType=BIGINT}, + username = #{record.username,jdbcType=VARCHAR}, + login_name = #{record.loginName,jdbcType=VARCHAR}, + `password` = #{record.password,jdbcType=VARCHAR}, + salt = #{record.salt,jdbcType=VARCHAR}, + email = #{record.email,jdbcType=VARCHAR}, + mfa_secret = #{record.mfaSecret,jdbcType=VARCHAR}, + mfa_bind = #{record.mfaBind,jdbcType=INTEGER}, + mobile_number = #{record.mobileNumber,jdbcType=VARCHAR}, + last_login_time = #{record.lastLoginTime,jdbcType=BIGINT}, + flag = #{record.flag,jdbcType=INTEGER}, + expire_time = #{record.expireTime,jdbcType=BIGINT}, + create_time = #{record.createTime,jdbcType=BIGINT}, + creator_id = #{record.creatorId,jdbcType=BIGINT}, + modify_time = #{record.modifyTime,jdbcType=BIGINT}, + modifier_id = #{record.modifierId,jdbcType=BIGINT}, + super_role = #{record.superRole,jdbcType=INTEGER} + + + + + + + update basic_user + + + user_type = #{userType,jdbcType=INTEGER}, + + + company_id = #{companyId,jdbcType=BIGINT}, + + + username = #{username,jdbcType=VARCHAR}, + + + login_name = #{loginName,jdbcType=VARCHAR}, + + + `password` = #{password,jdbcType=VARCHAR}, + + + salt = #{salt,jdbcType=VARCHAR}, + + + email = #{email,jdbcType=VARCHAR}, + + + mfa_secret = #{mfaSecret,jdbcType=VARCHAR}, + + + mfa_bind = #{mfaBind,jdbcType=INTEGER}, + + + mobile_number = #{mobileNumber,jdbcType=VARCHAR}, + + + last_login_time = #{lastLoginTime,jdbcType=BIGINT}, + + + flag = #{flag,jdbcType=INTEGER}, + + + expire_time = #{expireTime,jdbcType=BIGINT}, + + + create_time = #{createTime,jdbcType=BIGINT}, + + + creator_id = #{creatorId,jdbcType=BIGINT}, + + + modify_time = #{modifyTime,jdbcType=BIGINT}, + + + modifier_id = #{modifierId,jdbcType=BIGINT}, + + + super_role = #{superRole,jdbcType=INTEGER}, + + + where id = #{id,jdbcType=BIGINT} + + + + update basic_user + set user_type = #{userType,jdbcType=INTEGER}, + company_id = #{companyId,jdbcType=BIGINT}, + username = #{username,jdbcType=VARCHAR}, + login_name = #{loginName,jdbcType=VARCHAR}, + `password` = #{password,jdbcType=VARCHAR}, + salt = #{salt,jdbcType=VARCHAR}, + email = #{email,jdbcType=VARCHAR}, + mfa_secret = #{mfaSecret,jdbcType=VARCHAR}, + mfa_bind = #{mfaBind,jdbcType=INTEGER}, + mobile_number = #{mobileNumber,jdbcType=VARCHAR}, + last_login_time = #{lastLoginTime,jdbcType=BIGINT}, + flag = #{flag,jdbcType=INTEGER}, + expire_time = #{expireTime,jdbcType=BIGINT}, + create_time = #{createTime,jdbcType=BIGINT}, + creator_id = #{creatorId,jdbcType=BIGINT}, + modify_time = #{modifyTime,jdbcType=BIGINT}, + modifier_id = #{modifierId,jdbcType=BIGINT}, + super_role = #{superRole,jdbcType=INTEGER} + where id = #{id,jdbcType=BIGINT} + + \ No newline at end of file diff --git a/dongjian-dashboard-back-dao/src/main/resources/mappers/auto/DashboardLevelRoleMapper.xml b/dongjian-dashboard-back-dao/src/main/resources/mappers/auto/DashboardLevelRoleMapper.xml new file mode 100644 index 0000000..cdd0472 --- /dev/null +++ b/dongjian-dashboard-back-dao/src/main/resources/mappers/auto/DashboardLevelRoleMapper.xml @@ -0,0 +1,319 @@ + + + + + + + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + + id, company_id, `name`, remark, flag, created_by, created_at, updated_at + + + + + + delete from dashboard_level_role + where id = #{id,jdbcType=BIGINT} + + + + delete from dashboard_level_role + + + + + + + + SELECT LAST_INSERT_ID() + + insert into dashboard_level_role (company_id, `name`, remark, + flag, created_by, created_at, + updated_at) + values (#{companyId,jdbcType=BIGINT}, #{name,jdbcType=VARCHAR}, #{remark,jdbcType=VARCHAR}, + #{flag,jdbcType=INTEGER}, #{createdBy,jdbcType=BIGINT}, #{createdAt,jdbcType=BIGINT}, + #{updatedAt,jdbcType=BIGINT}) + + + + + SELECT LAST_INSERT_ID() + + insert into dashboard_level_role + + + company_id, + + + `name`, + + + remark, + + + flag, + + + created_by, + + + created_at, + + + updated_at, + + + + + #{companyId,jdbcType=BIGINT}, + + + #{name,jdbcType=VARCHAR}, + + + #{remark,jdbcType=VARCHAR}, + + + #{flag,jdbcType=INTEGER}, + + + #{createdBy,jdbcType=BIGINT}, + + + #{createdAt,jdbcType=BIGINT}, + + + #{updatedAt,jdbcType=BIGINT}, + + + + + + + update dashboard_level_role + + + id = #{record.id,jdbcType=BIGINT}, + + + company_id = #{record.companyId,jdbcType=BIGINT}, + + + `name` = #{record.name,jdbcType=VARCHAR}, + + + remark = #{record.remark,jdbcType=VARCHAR}, + + + flag = #{record.flag,jdbcType=INTEGER}, + + + created_by = #{record.createdBy,jdbcType=BIGINT}, + + + created_at = #{record.createdAt,jdbcType=BIGINT}, + + + updated_at = #{record.updatedAt,jdbcType=BIGINT}, + + + + + + + + + update dashboard_level_role + set id = #{record.id,jdbcType=BIGINT}, + company_id = #{record.companyId,jdbcType=BIGINT}, + `name` = #{record.name,jdbcType=VARCHAR}, + remark = #{record.remark,jdbcType=VARCHAR}, + flag = #{record.flag,jdbcType=INTEGER}, + created_by = #{record.createdBy,jdbcType=BIGINT}, + created_at = #{record.createdAt,jdbcType=BIGINT}, + updated_at = #{record.updatedAt,jdbcType=BIGINT} + + + + + + + update dashboard_level_role + + + company_id = #{companyId,jdbcType=BIGINT}, + + + `name` = #{name,jdbcType=VARCHAR}, + + + remark = #{remark,jdbcType=VARCHAR}, + + + flag = #{flag,jdbcType=INTEGER}, + + + created_by = #{createdBy,jdbcType=BIGINT}, + + + created_at = #{createdAt,jdbcType=BIGINT}, + + + updated_at = #{updatedAt,jdbcType=BIGINT}, + + + where id = #{id,jdbcType=BIGINT} + + + + update dashboard_level_role + set company_id = #{companyId,jdbcType=BIGINT}, + `name` = #{name,jdbcType=VARCHAR}, + remark = #{remark,jdbcType=VARCHAR}, + flag = #{flag,jdbcType=INTEGER}, + created_by = #{createdBy,jdbcType=BIGINT}, + created_at = #{createdAt,jdbcType=BIGINT}, + updated_at = #{updatedAt,jdbcType=BIGINT} + where id = #{id,jdbcType=BIGINT} + + \ No newline at end of file diff --git a/dongjian-dashboard-back-dao/src/main/resources/mappers/auto/DashboardOperationLogMapper.xml b/dongjian-dashboard-back-dao/src/main/resources/mappers/auto/DashboardOperationLogMapper.xml new file mode 100644 index 0000000..e742299 --- /dev/null +++ b/dongjian-dashboard-back-dao/src/main/resources/mappers/auto/DashboardOperationLogMapper.xml @@ -0,0 +1,457 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + + id, user_id, company_id, `operation`, operation_remark, uri, method_name, class_name, + ip_address, execution_time_ms, created_at + + + + request_params + + + + + + + delete from dashboard_operation_log + where id = #{id,jdbcType=BIGINT} + + + + delete from dashboard_operation_log + + + + + + + + SELECT LAST_INSERT_ID() + + insert into dashboard_operation_log (user_id, company_id, `operation`, + operation_remark, uri, method_name, + class_name, ip_address, execution_time_ms, + created_at, request_params) + values (#{userId,jdbcType=BIGINT}, #{companyId,jdbcType=BIGINT}, #{operation,jdbcType=VARCHAR}, + #{operationRemark,jdbcType=VARCHAR}, #{uri,jdbcType=VARCHAR}, #{methodName,jdbcType=VARCHAR}, + #{className,jdbcType=VARCHAR}, #{ipAddress,jdbcType=VARCHAR}, #{executionTimeMs,jdbcType=BIGINT}, + #{createdAt,jdbcType=BIGINT}, #{requestParams,jdbcType=LONGVARCHAR}) + + + + + SELECT LAST_INSERT_ID() + + insert into dashboard_operation_log + + + user_id, + + + company_id, + + + `operation`, + + + operation_remark, + + + uri, + + + method_name, + + + class_name, + + + ip_address, + + + execution_time_ms, + + + created_at, + + + request_params, + + + + + #{userId,jdbcType=BIGINT}, + + + #{companyId,jdbcType=BIGINT}, + + + #{operation,jdbcType=VARCHAR}, + + + #{operationRemark,jdbcType=VARCHAR}, + + + #{uri,jdbcType=VARCHAR}, + + + #{methodName,jdbcType=VARCHAR}, + + + #{className,jdbcType=VARCHAR}, + + + #{ipAddress,jdbcType=VARCHAR}, + + + #{executionTimeMs,jdbcType=BIGINT}, + + + #{createdAt,jdbcType=BIGINT}, + + + #{requestParams,jdbcType=LONGVARCHAR}, + + + + + + + update dashboard_operation_log + + + id = #{record.id,jdbcType=BIGINT}, + + + user_id = #{record.userId,jdbcType=BIGINT}, + + + company_id = #{record.companyId,jdbcType=BIGINT}, + + + `operation` = #{record.operation,jdbcType=VARCHAR}, + + + operation_remark = #{record.operationRemark,jdbcType=VARCHAR}, + + + uri = #{record.uri,jdbcType=VARCHAR}, + + + method_name = #{record.methodName,jdbcType=VARCHAR}, + + + class_name = #{record.className,jdbcType=VARCHAR}, + + + ip_address = #{record.ipAddress,jdbcType=VARCHAR}, + + + execution_time_ms = #{record.executionTimeMs,jdbcType=BIGINT}, + + + created_at = #{record.createdAt,jdbcType=BIGINT}, + + + request_params = #{record.requestParams,jdbcType=LONGVARCHAR}, + + + + + + + + + update dashboard_operation_log + set id = #{record.id,jdbcType=BIGINT}, + user_id = #{record.userId,jdbcType=BIGINT}, + company_id = #{record.companyId,jdbcType=BIGINT}, + `operation` = #{record.operation,jdbcType=VARCHAR}, + operation_remark = #{record.operationRemark,jdbcType=VARCHAR}, + uri = #{record.uri,jdbcType=VARCHAR}, + method_name = #{record.methodName,jdbcType=VARCHAR}, + class_name = #{record.className,jdbcType=VARCHAR}, + ip_address = #{record.ipAddress,jdbcType=VARCHAR}, + execution_time_ms = #{record.executionTimeMs,jdbcType=BIGINT}, + created_at = #{record.createdAt,jdbcType=BIGINT}, + request_params = #{record.requestParams,jdbcType=LONGVARCHAR} + + + + + + + update dashboard_operation_log + set id = #{record.id,jdbcType=BIGINT}, + user_id = #{record.userId,jdbcType=BIGINT}, + company_id = #{record.companyId,jdbcType=BIGINT}, + `operation` = #{record.operation,jdbcType=VARCHAR}, + operation_remark = #{record.operationRemark,jdbcType=VARCHAR}, + uri = #{record.uri,jdbcType=VARCHAR}, + method_name = #{record.methodName,jdbcType=VARCHAR}, + class_name = #{record.className,jdbcType=VARCHAR}, + ip_address = #{record.ipAddress,jdbcType=VARCHAR}, + execution_time_ms = #{record.executionTimeMs,jdbcType=BIGINT}, + created_at = #{record.createdAt,jdbcType=BIGINT} + + + + + + + update dashboard_operation_log + + + user_id = #{userId,jdbcType=BIGINT}, + + + company_id = #{companyId,jdbcType=BIGINT}, + + + `operation` = #{operation,jdbcType=VARCHAR}, + + + operation_remark = #{operationRemark,jdbcType=VARCHAR}, + + + uri = #{uri,jdbcType=VARCHAR}, + + + method_name = #{methodName,jdbcType=VARCHAR}, + + + class_name = #{className,jdbcType=VARCHAR}, + + + ip_address = #{ipAddress,jdbcType=VARCHAR}, + + + execution_time_ms = #{executionTimeMs,jdbcType=BIGINT}, + + + created_at = #{createdAt,jdbcType=BIGINT}, + + + request_params = #{requestParams,jdbcType=LONGVARCHAR}, + + + where id = #{id,jdbcType=BIGINT} + + + + update dashboard_operation_log + set user_id = #{userId,jdbcType=BIGINT}, + company_id = #{companyId,jdbcType=BIGINT}, + `operation` = #{operation,jdbcType=VARCHAR}, + operation_remark = #{operationRemark,jdbcType=VARCHAR}, + uri = #{uri,jdbcType=VARCHAR}, + method_name = #{methodName,jdbcType=VARCHAR}, + class_name = #{className,jdbcType=VARCHAR}, + ip_address = #{ipAddress,jdbcType=VARCHAR}, + execution_time_ms = #{executionTimeMs,jdbcType=BIGINT}, + created_at = #{createdAt,jdbcType=BIGINT}, + request_params = #{requestParams,jdbcType=LONGVARCHAR} + where id = #{id,jdbcType=BIGINT} + + + + update dashboard_operation_log + set user_id = #{userId,jdbcType=BIGINT}, + company_id = #{companyId,jdbcType=BIGINT}, + `operation` = #{operation,jdbcType=VARCHAR}, + operation_remark = #{operationRemark,jdbcType=VARCHAR}, + uri = #{uri,jdbcType=VARCHAR}, + method_name = #{methodName,jdbcType=VARCHAR}, + class_name = #{className,jdbcType=VARCHAR}, + ip_address = #{ipAddress,jdbcType=VARCHAR}, + execution_time_ms = #{executionTimeMs,jdbcType=BIGINT}, + created_at = #{createdAt,jdbcType=BIGINT} + where id = #{id,jdbcType=BIGINT} + + \ No newline at end of file diff --git a/dongjian-dashboard-back-dao/src/main/resources/mappers/auto/DashboardRealtimeMeasureMapper.xml b/dongjian-dashboard-back-dao/src/main/resources/mappers/auto/DashboardRealtimeMeasureMapper.xml new file mode 100644 index 0000000..4329daf --- /dev/null +++ b/dongjian-dashboard-back-dao/src/main/resources/mappers/auto/DashboardRealtimeMeasureMapper.xml @@ -0,0 +1,367 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + + device_id, date_year, date_month, date_day, date_hour, date_minute, date_second, + upload_value, min_value, max_value, upload_at + + + + + + delete from dashboard_realtime_measure + where device_id = #{deviceId,jdbcType=VARCHAR} + + + + delete from dashboard_realtime_measure + + + + + + + insert into dashboard_realtime_measure (device_id, date_year, date_month, + date_day, date_hour, date_minute, + date_second, upload_value, min_value, + max_value, upload_at) + values (#{deviceId,jdbcType=VARCHAR}, #{dateYear,jdbcType=INTEGER}, #{dateMonth,jdbcType=INTEGER}, + #{dateDay,jdbcType=INTEGER}, #{dateHour,jdbcType=INTEGER}, #{dateMinute,jdbcType=INTEGER}, + #{dateSecond,jdbcType=INTEGER}, #{uploadValue,jdbcType=VARCHAR}, #{minValue,jdbcType=VARCHAR}, + #{maxValue,jdbcType=VARCHAR}, #{uploadAt,jdbcType=BIGINT}) + + + + insert into dashboard_realtime_measure + + + device_id, + + + date_year, + + + date_month, + + + date_day, + + + date_hour, + + + date_minute, + + + date_second, + + + upload_value, + + + min_value, + + + max_value, + + + upload_at, + + + + + #{deviceId,jdbcType=VARCHAR}, + + + #{dateYear,jdbcType=INTEGER}, + + + #{dateMonth,jdbcType=INTEGER}, + + + #{dateDay,jdbcType=INTEGER}, + + + #{dateHour,jdbcType=INTEGER}, + + + #{dateMinute,jdbcType=INTEGER}, + + + #{dateSecond,jdbcType=INTEGER}, + + + #{uploadValue,jdbcType=VARCHAR}, + + + #{minValue,jdbcType=VARCHAR}, + + + #{maxValue,jdbcType=VARCHAR}, + + + #{uploadAt,jdbcType=BIGINT}, + + + + + + + update dashboard_realtime_measure + + + device_id = #{record.deviceId,jdbcType=VARCHAR}, + + + date_year = #{record.dateYear,jdbcType=INTEGER}, + + + date_month = #{record.dateMonth,jdbcType=INTEGER}, + + + date_day = #{record.dateDay,jdbcType=INTEGER}, + + + date_hour = #{record.dateHour,jdbcType=INTEGER}, + + + date_minute = #{record.dateMinute,jdbcType=INTEGER}, + + + date_second = #{record.dateSecond,jdbcType=INTEGER}, + + + upload_value = #{record.uploadValue,jdbcType=VARCHAR}, + + + min_value = #{record.minValue,jdbcType=VARCHAR}, + + + max_value = #{record.maxValue,jdbcType=VARCHAR}, + + + upload_at = #{record.uploadAt,jdbcType=BIGINT}, + + + + + + + + + update dashboard_realtime_measure + set device_id = #{record.deviceId,jdbcType=VARCHAR}, + date_year = #{record.dateYear,jdbcType=INTEGER}, + date_month = #{record.dateMonth,jdbcType=INTEGER}, + date_day = #{record.dateDay,jdbcType=INTEGER}, + date_hour = #{record.dateHour,jdbcType=INTEGER}, + date_minute = #{record.dateMinute,jdbcType=INTEGER}, + date_second = #{record.dateSecond,jdbcType=INTEGER}, + upload_value = #{record.uploadValue,jdbcType=VARCHAR}, + min_value = #{record.minValue,jdbcType=VARCHAR}, + max_value = #{record.maxValue,jdbcType=VARCHAR}, + upload_at = #{record.uploadAt,jdbcType=BIGINT} + + + + + + + update dashboard_realtime_measure + + + date_year = #{dateYear,jdbcType=INTEGER}, + + + date_month = #{dateMonth,jdbcType=INTEGER}, + + + date_day = #{dateDay,jdbcType=INTEGER}, + + + date_hour = #{dateHour,jdbcType=INTEGER}, + + + date_minute = #{dateMinute,jdbcType=INTEGER}, + + + date_second = #{dateSecond,jdbcType=INTEGER}, + + + upload_value = #{uploadValue,jdbcType=VARCHAR}, + + + min_value = #{minValue,jdbcType=VARCHAR}, + + + max_value = #{maxValue,jdbcType=VARCHAR}, + + + upload_at = #{uploadAt,jdbcType=BIGINT}, + + + where device_id = #{deviceId,jdbcType=VARCHAR} + + + + update dashboard_realtime_measure + set date_year = #{dateYear,jdbcType=INTEGER}, + date_month = #{dateMonth,jdbcType=INTEGER}, + date_day = #{dateDay,jdbcType=INTEGER}, + date_hour = #{dateHour,jdbcType=INTEGER}, + date_minute = #{dateMinute,jdbcType=INTEGER}, + date_second = #{dateSecond,jdbcType=INTEGER}, + upload_value = #{uploadValue,jdbcType=VARCHAR}, + min_value = #{minValue,jdbcType=VARCHAR}, + max_value = #{maxValue,jdbcType=VARCHAR}, + upload_at = #{uploadAt,jdbcType=BIGINT} + where device_id = #{deviceId,jdbcType=VARCHAR} + + \ No newline at end of file diff --git a/dongjian-dashboard-back-dao/src/main/resources/mappers/auto/DashboardRecordAccumulateMapper.xml b/dongjian-dashboard-back-dao/src/main/resources/mappers/auto/DashboardRecordAccumulateMapper.xml new file mode 100644 index 0000000..86138d0 --- /dev/null +++ b/dongjian-dashboard-back-dao/src/main/resources/mappers/auto/DashboardRecordAccumulateMapper.xml @@ -0,0 +1,382 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + + id, device_id, date_year, date_month, date_day, date_hour, date_minute, date_second, + upload_value, increment_today, increment_minute, upload_at + + + + + + delete from dashboard_record_accumulate + where id = #{id,jdbcType=BIGINT} + + + + delete from dashboard_record_accumulate + + + + + + + + SELECT LAST_INSERT_ID() + + insert into dashboard_record_accumulate (device_id, date_year, date_month, + date_day, date_hour, date_minute, + date_second, upload_value, increment_today, + increment_minute, upload_at) + values (#{deviceId,jdbcType=VARCHAR}, #{dateYear,jdbcType=INTEGER}, #{dateMonth,jdbcType=INTEGER}, + #{dateDay,jdbcType=INTEGER}, #{dateHour,jdbcType=INTEGER}, #{dateMinute,jdbcType=INTEGER}, + #{dateSecond,jdbcType=INTEGER}, #{uploadValue,jdbcType=VARCHAR}, #{incrementToday,jdbcType=VARCHAR}, + #{incrementMinute,jdbcType=VARCHAR}, #{uploadAt,jdbcType=BIGINT}) + + + + + SELECT LAST_INSERT_ID() + + insert into dashboard_record_accumulate + + + device_id, + + + date_year, + + + date_month, + + + date_day, + + + date_hour, + + + date_minute, + + + date_second, + + + upload_value, + + + increment_today, + + + increment_minute, + + + upload_at, + + + + + #{deviceId,jdbcType=VARCHAR}, + + + #{dateYear,jdbcType=INTEGER}, + + + #{dateMonth,jdbcType=INTEGER}, + + + #{dateDay,jdbcType=INTEGER}, + + + #{dateHour,jdbcType=INTEGER}, + + + #{dateMinute,jdbcType=INTEGER}, + + + #{dateSecond,jdbcType=INTEGER}, + + + #{uploadValue,jdbcType=VARCHAR}, + + + #{incrementToday,jdbcType=VARCHAR}, + + + #{incrementMinute,jdbcType=VARCHAR}, + + + #{uploadAt,jdbcType=BIGINT}, + + + + + + + update dashboard_record_accumulate + + + id = #{record.id,jdbcType=BIGINT}, + + + device_id = #{record.deviceId,jdbcType=VARCHAR}, + + + date_year = #{record.dateYear,jdbcType=INTEGER}, + + + date_month = #{record.dateMonth,jdbcType=INTEGER}, + + + date_day = #{record.dateDay,jdbcType=INTEGER}, + + + date_hour = #{record.dateHour,jdbcType=INTEGER}, + + + date_minute = #{record.dateMinute,jdbcType=INTEGER}, + + + date_second = #{record.dateSecond,jdbcType=INTEGER}, + + + upload_value = #{record.uploadValue,jdbcType=VARCHAR}, + + + increment_today = #{record.incrementToday,jdbcType=VARCHAR}, + + + increment_minute = #{record.incrementMinute,jdbcType=VARCHAR}, + + + upload_at = #{record.uploadAt,jdbcType=BIGINT}, + + + + + + + + + update dashboard_record_accumulate + set id = #{record.id,jdbcType=BIGINT}, + device_id = #{record.deviceId,jdbcType=VARCHAR}, + date_year = #{record.dateYear,jdbcType=INTEGER}, + date_month = #{record.dateMonth,jdbcType=INTEGER}, + date_day = #{record.dateDay,jdbcType=INTEGER}, + date_hour = #{record.dateHour,jdbcType=INTEGER}, + date_minute = #{record.dateMinute,jdbcType=INTEGER}, + date_second = #{record.dateSecond,jdbcType=INTEGER}, + upload_value = #{record.uploadValue,jdbcType=VARCHAR}, + increment_today = #{record.incrementToday,jdbcType=VARCHAR}, + increment_minute = #{record.incrementMinute,jdbcType=VARCHAR}, + upload_at = #{record.uploadAt,jdbcType=BIGINT} + + + + + + + update dashboard_record_accumulate + + + device_id = #{deviceId,jdbcType=VARCHAR}, + + + date_year = #{dateYear,jdbcType=INTEGER}, + + + date_month = #{dateMonth,jdbcType=INTEGER}, + + + date_day = #{dateDay,jdbcType=INTEGER}, + + + date_hour = #{dateHour,jdbcType=INTEGER}, + + + date_minute = #{dateMinute,jdbcType=INTEGER}, + + + date_second = #{dateSecond,jdbcType=INTEGER}, + + + upload_value = #{uploadValue,jdbcType=VARCHAR}, + + + increment_today = #{incrementToday,jdbcType=VARCHAR}, + + + increment_minute = #{incrementMinute,jdbcType=VARCHAR}, + + + upload_at = #{uploadAt,jdbcType=BIGINT}, + + + where id = #{id,jdbcType=BIGINT} + + + + update dashboard_record_accumulate + set device_id = #{deviceId,jdbcType=VARCHAR}, + date_year = #{dateYear,jdbcType=INTEGER}, + date_month = #{dateMonth,jdbcType=INTEGER}, + date_day = #{dateDay,jdbcType=INTEGER}, + date_hour = #{dateHour,jdbcType=INTEGER}, + date_minute = #{dateMinute,jdbcType=INTEGER}, + date_second = #{dateSecond,jdbcType=INTEGER}, + upload_value = #{uploadValue,jdbcType=VARCHAR}, + increment_today = #{incrementToday,jdbcType=VARCHAR}, + increment_minute = #{incrementMinute,jdbcType=VARCHAR}, + upload_at = #{uploadAt,jdbcType=BIGINT} + where id = #{id,jdbcType=BIGINT} + + \ No newline at end of file diff --git a/dongjian-dashboard-back-dao/src/main/resources/mappers/auto/DeviceGroupMapper.xml b/dongjian-dashboard-back-dao/src/main/resources/mappers/auto/DeviceGroupMapper.xml new file mode 100644 index 0000000..546d02f --- /dev/null +++ b/dongjian-dashboard-back-dao/src/main/resources/mappers/auto/DeviceGroupMapper.xml @@ -0,0 +1,334 @@ + + + + + + + + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + + id, company_id, building_id, `name`, group_type, remark, flag, created_by, created_at + + + + + + delete from device_group + where id = #{id,jdbcType=BIGINT} + + + + delete from device_group + + + + + + + + SELECT LAST_INSERT_ID() + + insert into device_group (company_id, building_id, `name`, + group_type, remark, flag, + created_by, created_at) + values (#{companyId,jdbcType=BIGINT}, #{buildingId,jdbcType=BIGINT}, #{name,jdbcType=VARCHAR}, + #{groupType,jdbcType=INTEGER}, #{remark,jdbcType=VARCHAR}, #{flag,jdbcType=INTEGER}, + #{createdBy,jdbcType=BIGINT}, #{createdAt,jdbcType=BIGINT}) + + + + + SELECT LAST_INSERT_ID() + + insert into device_group + + + company_id, + + + building_id, + + + `name`, + + + group_type, + + + remark, + + + flag, + + + created_by, + + + created_at, + + + + + #{companyId,jdbcType=BIGINT}, + + + #{buildingId,jdbcType=BIGINT}, + + + #{name,jdbcType=VARCHAR}, + + + #{groupType,jdbcType=INTEGER}, + + + #{remark,jdbcType=VARCHAR}, + + + #{flag,jdbcType=INTEGER}, + + + #{createdBy,jdbcType=BIGINT}, + + + #{createdAt,jdbcType=BIGINT}, + + + + + + + update device_group + + + id = #{record.id,jdbcType=BIGINT}, + + + company_id = #{record.companyId,jdbcType=BIGINT}, + + + building_id = #{record.buildingId,jdbcType=BIGINT}, + + + `name` = #{record.name,jdbcType=VARCHAR}, + + + group_type = #{record.groupType,jdbcType=INTEGER}, + + + remark = #{record.remark,jdbcType=VARCHAR}, + + + flag = #{record.flag,jdbcType=INTEGER}, + + + created_by = #{record.createdBy,jdbcType=BIGINT}, + + + created_at = #{record.createdAt,jdbcType=BIGINT}, + + + + + + + + + update device_group + set id = #{record.id,jdbcType=BIGINT}, + company_id = #{record.companyId,jdbcType=BIGINT}, + building_id = #{record.buildingId,jdbcType=BIGINT}, + `name` = #{record.name,jdbcType=VARCHAR}, + group_type = #{record.groupType,jdbcType=INTEGER}, + remark = #{record.remark,jdbcType=VARCHAR}, + flag = #{record.flag,jdbcType=INTEGER}, + created_by = #{record.createdBy,jdbcType=BIGINT}, + created_at = #{record.createdAt,jdbcType=BIGINT} + + + + + + + update device_group + + + company_id = #{companyId,jdbcType=BIGINT}, + + + building_id = #{buildingId,jdbcType=BIGINT}, + + + `name` = #{name,jdbcType=VARCHAR}, + + + group_type = #{groupType,jdbcType=INTEGER}, + + + remark = #{remark,jdbcType=VARCHAR}, + + + flag = #{flag,jdbcType=INTEGER}, + + + created_by = #{createdBy,jdbcType=BIGINT}, + + + created_at = #{createdAt,jdbcType=BIGINT}, + + + where id = #{id,jdbcType=BIGINT} + + + + update device_group + set company_id = #{companyId,jdbcType=BIGINT}, + building_id = #{buildingId,jdbcType=BIGINT}, + `name` = #{name,jdbcType=VARCHAR}, + group_type = #{groupType,jdbcType=INTEGER}, + remark = #{remark,jdbcType=VARCHAR}, + flag = #{flag,jdbcType=INTEGER}, + created_by = #{createdBy,jdbcType=BIGINT}, + created_at = #{createdAt,jdbcType=BIGINT} + where id = #{id,jdbcType=BIGINT} + + \ No newline at end of file diff --git a/dongjian-dashboard-back-dao/src/main/resources/mappers/auto/DeviceGroupRelationMapper.xml b/dongjian-dashboard-back-dao/src/main/resources/mappers/auto/DeviceGroupRelationMapper.xml new file mode 100644 index 0000000..34e61a3 --- /dev/null +++ b/dongjian-dashboard-back-dao/src/main/resources/mappers/auto/DeviceGroupRelationMapper.xml @@ -0,0 +1,185 @@ + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + + device_info_id, device_group_id + + + + + delete from device_group_relation + + + + + + + insert into device_group_relation (device_info_id, device_group_id) + values (#{deviceInfoId,jdbcType=INTEGER}, #{deviceGroupId,jdbcType=BIGINT}) + + + + insert into device_group_relation + + + device_info_id, + + + device_group_id, + + + + + #{deviceInfoId,jdbcType=INTEGER}, + + + #{deviceGroupId,jdbcType=BIGINT}, + + + + + + + update device_group_relation + + + device_info_id = #{record.deviceInfoId,jdbcType=INTEGER}, + + + device_group_id = #{record.deviceGroupId,jdbcType=BIGINT}, + + + + + + + + + update device_group_relation + set device_info_id = #{record.deviceInfoId,jdbcType=INTEGER}, + device_group_id = #{record.deviceGroupId,jdbcType=BIGINT} + + + + + \ No newline at end of file diff --git a/dongjian-dashboard-back-dao/src/main/resources/mappers/auto/DeviceInfoMapper.xml b/dongjian-dashboard-back-dao/src/main/resources/mappers/auto/DeviceInfoMapper.xml new file mode 100644 index 0000000..699be02 --- /dev/null +++ b/dongjian-dashboard-back-dao/src/main/resources/mappers/auto/DeviceInfoMapper.xml @@ -0,0 +1,574 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + + id, device_id, device_sn, type_id, wsclient_id, space_id, device_name, remark, building_id, + asset_id, flag, company_id, created_by, created_timestamp, updated_by, updated_timestamp, + project_id, floor_id, monitoring_point_name, monitoring_point_category_id, data_provider_id, + gateway_info_id, alarm_level, retain_alert + + + + + + delete from device_info + where id = #{id,jdbcType=INTEGER} + + + + delete from device_info + + + + + + + + SELECT LAST_INSERT_ID() + + insert into device_info (device_id, device_sn, type_id, + wsclient_id, space_id, device_name, + remark, building_id, asset_id, + flag, company_id, created_by, + created_timestamp, updated_by, updated_timestamp, + project_id, floor_id, monitoring_point_name, + monitoring_point_category_id, data_provider_id, + gateway_info_id, alarm_level, retain_alert + ) + values (#{deviceId,jdbcType=VARCHAR}, #{deviceSn,jdbcType=VARCHAR}, #{typeId,jdbcType=INTEGER}, + #{wsclientId,jdbcType=INTEGER}, #{spaceId,jdbcType=BIGINT}, #{deviceName,jdbcType=VARCHAR}, + #{remark,jdbcType=VARCHAR}, #{buildingId,jdbcType=BIGINT}, #{assetId,jdbcType=BIGINT}, + #{flag,jdbcType=INTEGER}, #{companyId,jdbcType=BIGINT}, #{createdBy,jdbcType=BIGINT}, + #{createdTimestamp,jdbcType=TIMESTAMP}, #{updatedBy,jdbcType=BIGINT}, #{updatedTimestamp,jdbcType=BIGINT}, + #{projectId,jdbcType=BIGINT}, #{floorId,jdbcType=BIGINT}, #{monitoringPointName,jdbcType=VARCHAR}, + #{monitoringPointCategoryId,jdbcType=BIGINT}, #{dataProviderId,jdbcType=BIGINT}, + #{gatewayInfoId,jdbcType=BIGINT}, #{alarmLevel,jdbcType=INTEGER}, #{retainAlert,jdbcType=INTEGER} + ) + + + + + SELECT LAST_INSERT_ID() + + insert into device_info + + + device_id, + + + device_sn, + + + type_id, + + + wsclient_id, + + + space_id, + + + device_name, + + + remark, + + + building_id, + + + asset_id, + + + flag, + + + company_id, + + + created_by, + + + created_timestamp, + + + updated_by, + + + updated_timestamp, + + + project_id, + + + floor_id, + + + monitoring_point_name, + + + monitoring_point_category_id, + + + data_provider_id, + + + gateway_info_id, + + + alarm_level, + + + retain_alert, + + + + + #{deviceId,jdbcType=VARCHAR}, + + + #{deviceSn,jdbcType=VARCHAR}, + + + #{typeId,jdbcType=INTEGER}, + + + #{wsclientId,jdbcType=INTEGER}, + + + #{spaceId,jdbcType=BIGINT}, + + + #{deviceName,jdbcType=VARCHAR}, + + + #{remark,jdbcType=VARCHAR}, + + + #{buildingId,jdbcType=BIGINT}, + + + #{assetId,jdbcType=BIGINT}, + + + #{flag,jdbcType=INTEGER}, + + + #{companyId,jdbcType=BIGINT}, + + + #{createdBy,jdbcType=BIGINT}, + + + #{createdTimestamp,jdbcType=TIMESTAMP}, + + + #{updatedBy,jdbcType=BIGINT}, + + + #{updatedTimestamp,jdbcType=BIGINT}, + + + #{projectId,jdbcType=BIGINT}, + + + #{floorId,jdbcType=BIGINT}, + + + #{monitoringPointName,jdbcType=VARCHAR}, + + + #{monitoringPointCategoryId,jdbcType=BIGINT}, + + + #{dataProviderId,jdbcType=BIGINT}, + + + #{gatewayInfoId,jdbcType=BIGINT}, + + + #{alarmLevel,jdbcType=INTEGER}, + + + #{retainAlert,jdbcType=INTEGER}, + + + + + + + update device_info + + + id = #{record.id,jdbcType=INTEGER}, + + + device_id = #{record.deviceId,jdbcType=VARCHAR}, + + + device_sn = #{record.deviceSn,jdbcType=VARCHAR}, + + + type_id = #{record.typeId,jdbcType=INTEGER}, + + + wsclient_id = #{record.wsclientId,jdbcType=INTEGER}, + + + space_id = #{record.spaceId,jdbcType=BIGINT}, + + + device_name = #{record.deviceName,jdbcType=VARCHAR}, + + + remark = #{record.remark,jdbcType=VARCHAR}, + + + building_id = #{record.buildingId,jdbcType=BIGINT}, + + + asset_id = #{record.assetId,jdbcType=BIGINT}, + + + flag = #{record.flag,jdbcType=INTEGER}, + + + company_id = #{record.companyId,jdbcType=BIGINT}, + + + created_by = #{record.createdBy,jdbcType=BIGINT}, + + + created_timestamp = #{record.createdTimestamp,jdbcType=TIMESTAMP}, + + + updated_by = #{record.updatedBy,jdbcType=BIGINT}, + + + updated_timestamp = #{record.updatedTimestamp,jdbcType=BIGINT}, + + + project_id = #{record.projectId,jdbcType=BIGINT}, + + + floor_id = #{record.floorId,jdbcType=BIGINT}, + + + monitoring_point_name = #{record.monitoringPointName,jdbcType=VARCHAR}, + + + monitoring_point_category_id = #{record.monitoringPointCategoryId,jdbcType=BIGINT}, + + + data_provider_id = #{record.dataProviderId,jdbcType=BIGINT}, + + + gateway_info_id = #{record.gatewayInfoId,jdbcType=BIGINT}, + + + alarm_level = #{record.alarmLevel,jdbcType=INTEGER}, + + + retain_alert = #{record.retainAlert,jdbcType=INTEGER}, + + + + + + + + + update device_info + set id = #{record.id,jdbcType=INTEGER}, + device_id = #{record.deviceId,jdbcType=VARCHAR}, + device_sn = #{record.deviceSn,jdbcType=VARCHAR}, + type_id = #{record.typeId,jdbcType=INTEGER}, + wsclient_id = #{record.wsclientId,jdbcType=INTEGER}, + space_id = #{record.spaceId,jdbcType=BIGINT}, + device_name = #{record.deviceName,jdbcType=VARCHAR}, + remark = #{record.remark,jdbcType=VARCHAR}, + building_id = #{record.buildingId,jdbcType=BIGINT}, + asset_id = #{record.assetId,jdbcType=BIGINT}, + flag = #{record.flag,jdbcType=INTEGER}, + company_id = #{record.companyId,jdbcType=BIGINT}, + created_by = #{record.createdBy,jdbcType=BIGINT}, + created_timestamp = #{record.createdTimestamp,jdbcType=TIMESTAMP}, + updated_by = #{record.updatedBy,jdbcType=BIGINT}, + updated_timestamp = #{record.updatedTimestamp,jdbcType=BIGINT}, + project_id = #{record.projectId,jdbcType=BIGINT}, + floor_id = #{record.floorId,jdbcType=BIGINT}, + monitoring_point_name = #{record.monitoringPointName,jdbcType=VARCHAR}, + monitoring_point_category_id = #{record.monitoringPointCategoryId,jdbcType=BIGINT}, + data_provider_id = #{record.dataProviderId,jdbcType=BIGINT}, + gateway_info_id = #{record.gatewayInfoId,jdbcType=BIGINT}, + alarm_level = #{record.alarmLevel,jdbcType=INTEGER}, + retain_alert = #{record.retainAlert,jdbcType=INTEGER} + + + + + + + update device_info + + + device_id = #{deviceId,jdbcType=VARCHAR}, + + + device_sn = #{deviceSn,jdbcType=VARCHAR}, + + + type_id = #{typeId,jdbcType=INTEGER}, + + + wsclient_id = #{wsclientId,jdbcType=INTEGER}, + + + space_id = #{spaceId,jdbcType=BIGINT}, + + + device_name = #{deviceName,jdbcType=VARCHAR}, + + + remark = #{remark,jdbcType=VARCHAR}, + + + building_id = #{buildingId,jdbcType=BIGINT}, + + + asset_id = #{assetId,jdbcType=BIGINT}, + + + flag = #{flag,jdbcType=INTEGER}, + + + company_id = #{companyId,jdbcType=BIGINT}, + + + created_by = #{createdBy,jdbcType=BIGINT}, + + + created_timestamp = #{createdTimestamp,jdbcType=TIMESTAMP}, + + + updated_by = #{updatedBy,jdbcType=BIGINT}, + + + updated_timestamp = #{updatedTimestamp,jdbcType=BIGINT}, + + + project_id = #{projectId,jdbcType=BIGINT}, + + + floor_id = #{floorId,jdbcType=BIGINT}, + + + monitoring_point_name = #{monitoringPointName,jdbcType=VARCHAR}, + + + monitoring_point_category_id = #{monitoringPointCategoryId,jdbcType=BIGINT}, + + + data_provider_id = #{dataProviderId,jdbcType=BIGINT}, + + + gateway_info_id = #{gatewayInfoId,jdbcType=BIGINT}, + + + alarm_level = #{alarmLevel,jdbcType=INTEGER}, + + + retain_alert = #{retainAlert,jdbcType=INTEGER}, + + + where id = #{id,jdbcType=INTEGER} + + + + update device_info + set device_id = #{deviceId,jdbcType=VARCHAR}, + device_sn = #{deviceSn,jdbcType=VARCHAR}, + type_id = #{typeId,jdbcType=INTEGER}, + wsclient_id = #{wsclientId,jdbcType=INTEGER}, + space_id = #{spaceId,jdbcType=BIGINT}, + device_name = #{deviceName,jdbcType=VARCHAR}, + remark = #{remark,jdbcType=VARCHAR}, + building_id = #{buildingId,jdbcType=BIGINT}, + asset_id = #{assetId,jdbcType=BIGINT}, + flag = #{flag,jdbcType=INTEGER}, + company_id = #{companyId,jdbcType=BIGINT}, + created_by = #{createdBy,jdbcType=BIGINT}, + created_timestamp = #{createdTimestamp,jdbcType=TIMESTAMP}, + updated_by = #{updatedBy,jdbcType=BIGINT}, + updated_timestamp = #{updatedTimestamp,jdbcType=BIGINT}, + project_id = #{projectId,jdbcType=BIGINT}, + floor_id = #{floorId,jdbcType=BIGINT}, + monitoring_point_name = #{monitoringPointName,jdbcType=VARCHAR}, + monitoring_point_category_id = #{monitoringPointCategoryId,jdbcType=BIGINT}, + data_provider_id = #{dataProviderId,jdbcType=BIGINT}, + gateway_info_id = #{gatewayInfoId,jdbcType=BIGINT}, + alarm_level = #{alarmLevel,jdbcType=INTEGER}, + retain_alert = #{retainAlert,jdbcType=INTEGER} + where id = #{id,jdbcType=INTEGER} + + \ No newline at end of file diff --git a/dongjian-dashboard-back-dao/src/main/resources/mappers/auto/DeviceRawdataRealtimeMapper.xml b/dongjian-dashboard-back-dao/src/main/resources/mappers/auto/DeviceRawdataRealtimeMapper.xml new file mode 100644 index 0000000..3856fca --- /dev/null +++ b/dongjian-dashboard-back-dao/src/main/resources/mappers/auto/DeviceRawdataRealtimeMapper.xml @@ -0,0 +1,455 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + + device_id, building_id, `status`, receive_ts, alert_title, alert_cancel_title, upload_year, + upload_month, upload_day + + + + alert_content, alert_cancel_content, raw_data + + + + + + + delete from device_rawdata_realtime + where device_id = #{deviceId,jdbcType=VARCHAR} + + + + delete from device_rawdata_realtime + + + + + + + insert into device_rawdata_realtime (device_id, building_id, `status`, + receive_ts, alert_title, alert_cancel_title, + upload_year, upload_month, upload_day, + alert_content, alert_cancel_content, + raw_data) + values (#{deviceId,jdbcType=VARCHAR}, #{buildingId,jdbcType=BIGINT}, #{status,jdbcType=VARCHAR}, + #{receiveTs,jdbcType=BIGINT}, #{alertTitle,jdbcType=VARCHAR}, #{alertCancelTitle,jdbcType=VARCHAR}, + #{uploadYear,jdbcType=INTEGER}, #{uploadMonth,jdbcType=INTEGER}, #{uploadDay,jdbcType=INTEGER}, + #{alertContent,jdbcType=LONGVARCHAR}, #{alertCancelContent,jdbcType=LONGVARCHAR}, + #{rawData,jdbcType=LONGVARCHAR}) + + + + insert into device_rawdata_realtime + + + device_id, + + + building_id, + + + `status`, + + + receive_ts, + + + alert_title, + + + alert_cancel_title, + + + upload_year, + + + upload_month, + + + upload_day, + + + alert_content, + + + alert_cancel_content, + + + raw_data, + + + + + #{deviceId,jdbcType=VARCHAR}, + + + #{buildingId,jdbcType=BIGINT}, + + + #{status,jdbcType=VARCHAR}, + + + #{receiveTs,jdbcType=BIGINT}, + + + #{alertTitle,jdbcType=VARCHAR}, + + + #{alertCancelTitle,jdbcType=VARCHAR}, + + + #{uploadYear,jdbcType=INTEGER}, + + + #{uploadMonth,jdbcType=INTEGER}, + + + #{uploadDay,jdbcType=INTEGER}, + + + #{alertContent,jdbcType=LONGVARCHAR}, + + + #{alertCancelContent,jdbcType=LONGVARCHAR}, + + + #{rawData,jdbcType=LONGVARCHAR}, + + + + + + + update device_rawdata_realtime + + + device_id = #{record.deviceId,jdbcType=VARCHAR}, + + + building_id = #{record.buildingId,jdbcType=BIGINT}, + + + `status` = #{record.status,jdbcType=VARCHAR}, + + + receive_ts = #{record.receiveTs,jdbcType=BIGINT}, + + + alert_title = #{record.alertTitle,jdbcType=VARCHAR}, + + + alert_cancel_title = #{record.alertCancelTitle,jdbcType=VARCHAR}, + + + upload_year = #{record.uploadYear,jdbcType=INTEGER}, + + + upload_month = #{record.uploadMonth,jdbcType=INTEGER}, + + + upload_day = #{record.uploadDay,jdbcType=INTEGER}, + + + alert_content = #{record.alertContent,jdbcType=LONGVARCHAR}, + + + alert_cancel_content = #{record.alertCancelContent,jdbcType=LONGVARCHAR}, + + + raw_data = #{record.rawData,jdbcType=LONGVARCHAR}, + + + + + + + + + update device_rawdata_realtime + set device_id = #{record.deviceId,jdbcType=VARCHAR}, + building_id = #{record.buildingId,jdbcType=BIGINT}, + `status` = #{record.status,jdbcType=VARCHAR}, + receive_ts = #{record.receiveTs,jdbcType=BIGINT}, + alert_title = #{record.alertTitle,jdbcType=VARCHAR}, + alert_cancel_title = #{record.alertCancelTitle,jdbcType=VARCHAR}, + upload_year = #{record.uploadYear,jdbcType=INTEGER}, + upload_month = #{record.uploadMonth,jdbcType=INTEGER}, + upload_day = #{record.uploadDay,jdbcType=INTEGER}, + alert_content = #{record.alertContent,jdbcType=LONGVARCHAR}, + alert_cancel_content = #{record.alertCancelContent,jdbcType=LONGVARCHAR}, + raw_data = #{record.rawData,jdbcType=LONGVARCHAR} + + + + + + + update device_rawdata_realtime + set device_id = #{record.deviceId,jdbcType=VARCHAR}, + building_id = #{record.buildingId,jdbcType=BIGINT}, + `status` = #{record.status,jdbcType=VARCHAR}, + receive_ts = #{record.receiveTs,jdbcType=BIGINT}, + alert_title = #{record.alertTitle,jdbcType=VARCHAR}, + alert_cancel_title = #{record.alertCancelTitle,jdbcType=VARCHAR}, + upload_year = #{record.uploadYear,jdbcType=INTEGER}, + upload_month = #{record.uploadMonth,jdbcType=INTEGER}, + upload_day = #{record.uploadDay,jdbcType=INTEGER} + + + + + + + update device_rawdata_realtime + + + building_id = #{buildingId,jdbcType=BIGINT}, + + + `status` = #{status,jdbcType=VARCHAR}, + + + receive_ts = #{receiveTs,jdbcType=BIGINT}, + + + alert_title = #{alertTitle,jdbcType=VARCHAR}, + + + alert_cancel_title = #{alertCancelTitle,jdbcType=VARCHAR}, + + + upload_year = #{uploadYear,jdbcType=INTEGER}, + + + upload_month = #{uploadMonth,jdbcType=INTEGER}, + + + upload_day = #{uploadDay,jdbcType=INTEGER}, + + + alert_content = #{alertContent,jdbcType=LONGVARCHAR}, + + + alert_cancel_content = #{alertCancelContent,jdbcType=LONGVARCHAR}, + + + raw_data = #{rawData,jdbcType=LONGVARCHAR}, + + + where device_id = #{deviceId,jdbcType=VARCHAR} + + + + update device_rawdata_realtime + set building_id = #{buildingId,jdbcType=BIGINT}, + `status` = #{status,jdbcType=VARCHAR}, + receive_ts = #{receiveTs,jdbcType=BIGINT}, + alert_title = #{alertTitle,jdbcType=VARCHAR}, + alert_cancel_title = #{alertCancelTitle,jdbcType=VARCHAR}, + upload_year = #{uploadYear,jdbcType=INTEGER}, + upload_month = #{uploadMonth,jdbcType=INTEGER}, + upload_day = #{uploadDay,jdbcType=INTEGER}, + alert_content = #{alertContent,jdbcType=LONGVARCHAR}, + alert_cancel_content = #{alertCancelContent,jdbcType=LONGVARCHAR}, + raw_data = #{rawData,jdbcType=LONGVARCHAR} + where device_id = #{deviceId,jdbcType=VARCHAR} + + + + update device_rawdata_realtime + set building_id = #{buildingId,jdbcType=BIGINT}, + `status` = #{status,jdbcType=VARCHAR}, + receive_ts = #{receiveTs,jdbcType=BIGINT}, + alert_title = #{alertTitle,jdbcType=VARCHAR}, + alert_cancel_title = #{alertCancelTitle,jdbcType=VARCHAR}, + upload_year = #{uploadYear,jdbcType=INTEGER}, + upload_month = #{uploadMonth,jdbcType=INTEGER}, + upload_day = #{uploadDay,jdbcType=INTEGER} + where device_id = #{deviceId,jdbcType=VARCHAR} + + \ No newline at end of file diff --git a/dongjian-dashboard-back-dao/src/main/resources/mappers/auto/FavoritedDeviceMapper.xml b/dongjian-dashboard-back-dao/src/main/resources/mappers/auto/FavoritedDeviceMapper.xml new file mode 100644 index 0000000..c2c8565 --- /dev/null +++ b/dongjian-dashboard-back-dao/src/main/resources/mappers/auto/FavoritedDeviceMapper.xml @@ -0,0 +1,225 @@ + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + + device_id, create_at + + + + + + delete from favorited_device + where device_id = #{deviceId,jdbcType=VARCHAR} + + + + delete from favorited_device + + + + + + + insert into favorited_device (device_id, create_at) + values (#{deviceId,jdbcType=VARCHAR}, #{createAt,jdbcType=BIGINT}) + + + + insert into favorited_device + + + device_id, + + + create_at, + + + + + #{deviceId,jdbcType=VARCHAR}, + + + #{createAt,jdbcType=BIGINT}, + + + + + + + update favorited_device + + + device_id = #{record.deviceId,jdbcType=VARCHAR}, + + + create_at = #{record.createAt,jdbcType=BIGINT}, + + + + + + + + + update favorited_device + set device_id = #{record.deviceId,jdbcType=VARCHAR}, + create_at = #{record.createAt,jdbcType=BIGINT} + + + + + + + update favorited_device + + + create_at = #{createAt,jdbcType=BIGINT}, + + + where device_id = #{deviceId,jdbcType=VARCHAR} + + + + update favorited_device + set create_at = #{createAt,jdbcType=BIGINT} + where device_id = #{deviceId,jdbcType=VARCHAR} + + \ No newline at end of file diff --git a/dongjian-dashboard-back-dao/src/main/resources/mappers/auto/LoginHistoryMapper.xml b/dongjian-dashboard-back-dao/src/main/resources/mappers/auto/LoginHistoryMapper.xml new file mode 100644 index 0000000..6b1e076 --- /dev/null +++ b/dongjian-dashboard-back-dao/src/main/resources/mappers/auto/LoginHistoryMapper.xml @@ -0,0 +1,257 @@ + + + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + + id, user_id, request_ip, login_time + + + + + + delete from login_history + where id = #{id,jdbcType=BIGINT} + + + + delete from login_history + + + + + + + + SELECT LAST_INSERT_ID() + + insert into login_history (user_id, request_ip, login_time + ) + values (#{userId,jdbcType=BIGINT}, #{requestIp,jdbcType=VARCHAR}, #{loginTime,jdbcType=BIGINT} + ) + + + + + SELECT LAST_INSERT_ID() + + insert into login_history + + + user_id, + + + request_ip, + + + login_time, + + + + + #{userId,jdbcType=BIGINT}, + + + #{requestIp,jdbcType=VARCHAR}, + + + #{loginTime,jdbcType=BIGINT}, + + + + + + + update login_history + + + id = #{record.id,jdbcType=BIGINT}, + + + user_id = #{record.userId,jdbcType=BIGINT}, + + + request_ip = #{record.requestIp,jdbcType=VARCHAR}, + + + login_time = #{record.loginTime,jdbcType=BIGINT}, + + + + + + + + + update login_history + set id = #{record.id,jdbcType=BIGINT}, + user_id = #{record.userId,jdbcType=BIGINT}, + request_ip = #{record.requestIp,jdbcType=VARCHAR}, + login_time = #{record.loginTime,jdbcType=BIGINT} + + + + + + + update login_history + + + user_id = #{userId,jdbcType=BIGINT}, + + + request_ip = #{requestIp,jdbcType=VARCHAR}, + + + login_time = #{loginTime,jdbcType=BIGINT}, + + + where id = #{id,jdbcType=BIGINT} + + + + update login_history + set user_id = #{userId,jdbcType=BIGINT}, + request_ip = #{requestIp,jdbcType=VARCHAR}, + login_time = #{loginTime,jdbcType=BIGINT} + where id = #{id,jdbcType=BIGINT} + + \ No newline at end of file diff --git a/dongjian-dashboard-back-dao/src/main/resources/mappers/auto/MonitoringPointCategoryGroupMapper.xml b/dongjian-dashboard-back-dao/src/main/resources/mappers/auto/MonitoringPointCategoryGroupMapper.xml new file mode 100644 index 0000000..6368639 --- /dev/null +++ b/dongjian-dashboard-back-dao/src/main/resources/mappers/auto/MonitoringPointCategoryGroupMapper.xml @@ -0,0 +1,319 @@ + + + + + + + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + + id, company_id, building_id, `name`, remark, flag, created_by, created_at + + + + + + delete from monitoring_point_category_group + where id = #{id,jdbcType=BIGINT} + + + + delete from monitoring_point_category_group + + + + + + + + SELECT LAST_INSERT_ID() + + insert into monitoring_point_category_group (company_id, building_id, `name`, + remark, flag, created_by, + created_at) + values (#{companyId,jdbcType=BIGINT}, #{buildingId,jdbcType=BIGINT}, #{name,jdbcType=VARCHAR}, + #{remark,jdbcType=VARCHAR}, #{flag,jdbcType=INTEGER}, #{createdBy,jdbcType=BIGINT}, + #{createdAt,jdbcType=BIGINT}) + + + + + SELECT LAST_INSERT_ID() + + insert into monitoring_point_category_group + + + company_id, + + + building_id, + + + `name`, + + + remark, + + + flag, + + + created_by, + + + created_at, + + + + + #{companyId,jdbcType=BIGINT}, + + + #{buildingId,jdbcType=BIGINT}, + + + #{name,jdbcType=VARCHAR}, + + + #{remark,jdbcType=VARCHAR}, + + + #{flag,jdbcType=INTEGER}, + + + #{createdBy,jdbcType=BIGINT}, + + + #{createdAt,jdbcType=BIGINT}, + + + + + + + update monitoring_point_category_group + + + id = #{record.id,jdbcType=BIGINT}, + + + company_id = #{record.companyId,jdbcType=BIGINT}, + + + building_id = #{record.buildingId,jdbcType=BIGINT}, + + + `name` = #{record.name,jdbcType=VARCHAR}, + + + remark = #{record.remark,jdbcType=VARCHAR}, + + + flag = #{record.flag,jdbcType=INTEGER}, + + + created_by = #{record.createdBy,jdbcType=BIGINT}, + + + created_at = #{record.createdAt,jdbcType=BIGINT}, + + + + + + + + + update monitoring_point_category_group + set id = #{record.id,jdbcType=BIGINT}, + company_id = #{record.companyId,jdbcType=BIGINT}, + building_id = #{record.buildingId,jdbcType=BIGINT}, + `name` = #{record.name,jdbcType=VARCHAR}, + remark = #{record.remark,jdbcType=VARCHAR}, + flag = #{record.flag,jdbcType=INTEGER}, + created_by = #{record.createdBy,jdbcType=BIGINT}, + created_at = #{record.createdAt,jdbcType=BIGINT} + + + + + + + update monitoring_point_category_group + + + company_id = #{companyId,jdbcType=BIGINT}, + + + building_id = #{buildingId,jdbcType=BIGINT}, + + + `name` = #{name,jdbcType=VARCHAR}, + + + remark = #{remark,jdbcType=VARCHAR}, + + + flag = #{flag,jdbcType=INTEGER}, + + + created_by = #{createdBy,jdbcType=BIGINT}, + + + created_at = #{createdAt,jdbcType=BIGINT}, + + + where id = #{id,jdbcType=BIGINT} + + + + update monitoring_point_category_group + set company_id = #{companyId,jdbcType=BIGINT}, + building_id = #{buildingId,jdbcType=BIGINT}, + `name` = #{name,jdbcType=VARCHAR}, + remark = #{remark,jdbcType=VARCHAR}, + flag = #{flag,jdbcType=INTEGER}, + created_by = #{createdBy,jdbcType=BIGINT}, + created_at = #{createdAt,jdbcType=BIGINT} + where id = #{id,jdbcType=BIGINT} + + \ No newline at end of file diff --git a/dongjian-dashboard-back-dao/src/main/resources/mappers/auto/MonitoringPointCategoryGroupRelationMapper.xml b/dongjian-dashboard-back-dao/src/main/resources/mappers/auto/MonitoringPointCategoryGroupRelationMapper.xml new file mode 100644 index 0000000..efbde71 --- /dev/null +++ b/dongjian-dashboard-back-dao/src/main/resources/mappers/auto/MonitoringPointCategoryGroupRelationMapper.xml @@ -0,0 +1,187 @@ + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + + monitoring_point_category_id, monitoring_point_category_group_id + + + + + delete from monitoring_point_category_group_relation + + + + + + + insert into monitoring_point_category_group_relation (monitoring_point_category_id, monitoring_point_category_group_id + ) + values (#{monitoringPointCategoryId,jdbcType=BIGINT}, #{monitoringPointCategoryGroupId,jdbcType=BIGINT} + ) + + + + insert into monitoring_point_category_group_relation + + + monitoring_point_category_id, + + + monitoring_point_category_group_id, + + + + + #{monitoringPointCategoryId,jdbcType=BIGINT}, + + + #{monitoringPointCategoryGroupId,jdbcType=BIGINT}, + + + + + + + update monitoring_point_category_group_relation + + + monitoring_point_category_id = #{record.monitoringPointCategoryId,jdbcType=BIGINT}, + + + monitoring_point_category_group_id = #{record.monitoringPointCategoryGroupId,jdbcType=BIGINT}, + + + + + + + + + update monitoring_point_category_group_relation + set monitoring_point_category_id = #{record.monitoringPointCategoryId,jdbcType=BIGINT}, + monitoring_point_category_group_id = #{record.monitoringPointCategoryGroupId,jdbcType=BIGINT} + + + + + \ No newline at end of file diff --git a/dongjian-dashboard-back-dao/src/main/resources/mappers/auto/MonitoringPointCategoryMapper.xml b/dongjian-dashboard-back-dao/src/main/resources/mappers/auto/MonitoringPointCategoryMapper.xml new file mode 100644 index 0000000..c130b5b --- /dev/null +++ b/dongjian-dashboard-back-dao/src/main/resources/mappers/auto/MonitoringPointCategoryMapper.xml @@ -0,0 +1,403 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + + id, company_id, `name`, remark, flag, created_by, created_at + + + + thumbnail_normal_base64, thumbnail_alarm_base64 + + + + + + + delete from monitoring_point_category + where id = #{id,jdbcType=BIGINT} + + + + delete from monitoring_point_category + + + + + + + + SELECT LAST_INSERT_ID() + + insert into monitoring_point_category (company_id, `name`, remark, + flag, created_by, created_at, + thumbnail_normal_base64, thumbnail_alarm_base64 + ) + values (#{companyId,jdbcType=BIGINT}, #{name,jdbcType=VARCHAR}, #{remark,jdbcType=VARCHAR}, + #{flag,jdbcType=INTEGER}, #{createdBy,jdbcType=BIGINT}, #{createdAt,jdbcType=BIGINT}, + #{thumbnailNormalBase64,jdbcType=LONGVARCHAR}, #{thumbnailAlarmBase64,jdbcType=LONGVARCHAR} + ) + + + + + SELECT LAST_INSERT_ID() + + insert into monitoring_point_category + + + company_id, + + + `name`, + + + remark, + + + flag, + + + created_by, + + + created_at, + + + thumbnail_normal_base64, + + + thumbnail_alarm_base64, + + + + + #{companyId,jdbcType=BIGINT}, + + + #{name,jdbcType=VARCHAR}, + + + #{remark,jdbcType=VARCHAR}, + + + #{flag,jdbcType=INTEGER}, + + + #{createdBy,jdbcType=BIGINT}, + + + #{createdAt,jdbcType=BIGINT}, + + + #{thumbnailNormalBase64,jdbcType=LONGVARCHAR}, + + + #{thumbnailAlarmBase64,jdbcType=LONGVARCHAR}, + + + + + + + update monitoring_point_category + + + id = #{record.id,jdbcType=BIGINT}, + + + company_id = #{record.companyId,jdbcType=BIGINT}, + + + `name` = #{record.name,jdbcType=VARCHAR}, + + + remark = #{record.remark,jdbcType=VARCHAR}, + + + flag = #{record.flag,jdbcType=INTEGER}, + + + created_by = #{record.createdBy,jdbcType=BIGINT}, + + + created_at = #{record.createdAt,jdbcType=BIGINT}, + + + thumbnail_normal_base64 = #{record.thumbnailNormalBase64,jdbcType=LONGVARCHAR}, + + + thumbnail_alarm_base64 = #{record.thumbnailAlarmBase64,jdbcType=LONGVARCHAR}, + + + + + + + + + update monitoring_point_category + set id = #{record.id,jdbcType=BIGINT}, + company_id = #{record.companyId,jdbcType=BIGINT}, + `name` = #{record.name,jdbcType=VARCHAR}, + remark = #{record.remark,jdbcType=VARCHAR}, + flag = #{record.flag,jdbcType=INTEGER}, + created_by = #{record.createdBy,jdbcType=BIGINT}, + created_at = #{record.createdAt,jdbcType=BIGINT}, + thumbnail_normal_base64 = #{record.thumbnailNormalBase64,jdbcType=LONGVARCHAR}, + thumbnail_alarm_base64 = #{record.thumbnailAlarmBase64,jdbcType=LONGVARCHAR} + + + + + + + update monitoring_point_category + set id = #{record.id,jdbcType=BIGINT}, + company_id = #{record.companyId,jdbcType=BIGINT}, + `name` = #{record.name,jdbcType=VARCHAR}, + remark = #{record.remark,jdbcType=VARCHAR}, + flag = #{record.flag,jdbcType=INTEGER}, + created_by = #{record.createdBy,jdbcType=BIGINT}, + created_at = #{record.createdAt,jdbcType=BIGINT} + + + + + + + update monitoring_point_category + + + company_id = #{companyId,jdbcType=BIGINT}, + + + `name` = #{name,jdbcType=VARCHAR}, + + + remark = #{remark,jdbcType=VARCHAR}, + + + flag = #{flag,jdbcType=INTEGER}, + + + created_by = #{createdBy,jdbcType=BIGINT}, + + + created_at = #{createdAt,jdbcType=BIGINT}, + + + thumbnail_normal_base64 = #{thumbnailNormalBase64,jdbcType=LONGVARCHAR}, + + + thumbnail_alarm_base64 = #{thumbnailAlarmBase64,jdbcType=LONGVARCHAR}, + + + where id = #{id,jdbcType=BIGINT} + + + + update monitoring_point_category + set company_id = #{companyId,jdbcType=BIGINT}, + `name` = #{name,jdbcType=VARCHAR}, + remark = #{remark,jdbcType=VARCHAR}, + flag = #{flag,jdbcType=INTEGER}, + created_by = #{createdBy,jdbcType=BIGINT}, + created_at = #{createdAt,jdbcType=BIGINT}, + thumbnail_normal_base64 = #{thumbnailNormalBase64,jdbcType=LONGVARCHAR}, + thumbnail_alarm_base64 = #{thumbnailAlarmBase64,jdbcType=LONGVARCHAR} + where id = #{id,jdbcType=BIGINT} + + + + update monitoring_point_category + set company_id = #{companyId,jdbcType=BIGINT}, + `name` = #{name,jdbcType=VARCHAR}, + remark = #{remark,jdbcType=VARCHAR}, + flag = #{flag,jdbcType=INTEGER}, + created_by = #{createdBy,jdbcType=BIGINT}, + created_at = #{createdAt,jdbcType=BIGINT} + where id = #{id,jdbcType=BIGINT} + + \ No newline at end of file diff --git a/dongjian-dashboard-back-dao/src/main/resources/mappers/auto/NotificationSlackMapper.xml b/dongjian-dashboard-back-dao/src/main/resources/mappers/auto/NotificationSlackMapper.xml new file mode 100644 index 0000000..05dadb2 --- /dev/null +++ b/dongjian-dashboard-back-dao/src/main/resources/mappers/auto/NotificationSlackMapper.xml @@ -0,0 +1,319 @@ + + + + + + + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + + id, company_id, `identity`, webhook, remark, flag, created_by, created_at + + + + + + delete from notification_slack + where id = #{id,jdbcType=BIGINT} + + + + delete from notification_slack + + + + + + + + SELECT LAST_INSERT_ID() + + insert into notification_slack (company_id, `identity`, webhook, + remark, flag, created_by, + created_at) + values (#{companyId,jdbcType=BIGINT}, #{identity,jdbcType=VARCHAR}, #{webhook,jdbcType=VARCHAR}, + #{remark,jdbcType=VARCHAR}, #{flag,jdbcType=INTEGER}, #{createdBy,jdbcType=BIGINT}, + #{createdAt,jdbcType=BIGINT}) + + + + + SELECT LAST_INSERT_ID() + + insert into notification_slack + + + company_id, + + + `identity`, + + + webhook, + + + remark, + + + flag, + + + created_by, + + + created_at, + + + + + #{companyId,jdbcType=BIGINT}, + + + #{identity,jdbcType=VARCHAR}, + + + #{webhook,jdbcType=VARCHAR}, + + + #{remark,jdbcType=VARCHAR}, + + + #{flag,jdbcType=INTEGER}, + + + #{createdBy,jdbcType=BIGINT}, + + + #{createdAt,jdbcType=BIGINT}, + + + + + + + update notification_slack + + + id = #{record.id,jdbcType=BIGINT}, + + + company_id = #{record.companyId,jdbcType=BIGINT}, + + + `identity` = #{record.identity,jdbcType=VARCHAR}, + + + webhook = #{record.webhook,jdbcType=VARCHAR}, + + + remark = #{record.remark,jdbcType=VARCHAR}, + + + flag = #{record.flag,jdbcType=INTEGER}, + + + created_by = #{record.createdBy,jdbcType=BIGINT}, + + + created_at = #{record.createdAt,jdbcType=BIGINT}, + + + + + + + + + update notification_slack + set id = #{record.id,jdbcType=BIGINT}, + company_id = #{record.companyId,jdbcType=BIGINT}, + `identity` = #{record.identity,jdbcType=VARCHAR}, + webhook = #{record.webhook,jdbcType=VARCHAR}, + remark = #{record.remark,jdbcType=VARCHAR}, + flag = #{record.flag,jdbcType=INTEGER}, + created_by = #{record.createdBy,jdbcType=BIGINT}, + created_at = #{record.createdAt,jdbcType=BIGINT} + + + + + + + update notification_slack + + + company_id = #{companyId,jdbcType=BIGINT}, + + + `identity` = #{identity,jdbcType=VARCHAR}, + + + webhook = #{webhook,jdbcType=VARCHAR}, + + + remark = #{remark,jdbcType=VARCHAR}, + + + flag = #{flag,jdbcType=INTEGER}, + + + created_by = #{createdBy,jdbcType=BIGINT}, + + + created_at = #{createdAt,jdbcType=BIGINT}, + + + where id = #{id,jdbcType=BIGINT} + + + + update notification_slack + set company_id = #{companyId,jdbcType=BIGINT}, + `identity` = #{identity,jdbcType=VARCHAR}, + webhook = #{webhook,jdbcType=VARCHAR}, + remark = #{remark,jdbcType=VARCHAR}, + flag = #{flag,jdbcType=INTEGER}, + created_by = #{createdBy,jdbcType=BIGINT}, + created_at = #{createdAt,jdbcType=BIGINT} + where id = #{id,jdbcType=BIGINT} + + \ No newline at end of file diff --git a/dongjian-dashboard-back-dao/src/main/resources/mappers/auto/NotificationTeamsMapper.xml b/dongjian-dashboard-back-dao/src/main/resources/mappers/auto/NotificationTeamsMapper.xml new file mode 100644 index 0000000..33cd879 --- /dev/null +++ b/dongjian-dashboard-back-dao/src/main/resources/mappers/auto/NotificationTeamsMapper.xml @@ -0,0 +1,319 @@ + + + + + + + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + + id, company_id, `identity`, webhook, remark, flag, created_by, created_at + + + + + + delete from notification_teams + where id = #{id,jdbcType=BIGINT} + + + + delete from notification_teams + + + + + + + + SELECT LAST_INSERT_ID() + + insert into notification_teams (company_id, `identity`, webhook, + remark, flag, created_by, + created_at) + values (#{companyId,jdbcType=BIGINT}, #{identity,jdbcType=VARCHAR}, #{webhook,jdbcType=VARCHAR}, + #{remark,jdbcType=VARCHAR}, #{flag,jdbcType=INTEGER}, #{createdBy,jdbcType=BIGINT}, + #{createdAt,jdbcType=BIGINT}) + + + + + SELECT LAST_INSERT_ID() + + insert into notification_teams + + + company_id, + + + `identity`, + + + webhook, + + + remark, + + + flag, + + + created_by, + + + created_at, + + + + + #{companyId,jdbcType=BIGINT}, + + + #{identity,jdbcType=VARCHAR}, + + + #{webhook,jdbcType=VARCHAR}, + + + #{remark,jdbcType=VARCHAR}, + + + #{flag,jdbcType=INTEGER}, + + + #{createdBy,jdbcType=BIGINT}, + + + #{createdAt,jdbcType=BIGINT}, + + + + + + + update notification_teams + + + id = #{record.id,jdbcType=BIGINT}, + + + company_id = #{record.companyId,jdbcType=BIGINT}, + + + `identity` = #{record.identity,jdbcType=VARCHAR}, + + + webhook = #{record.webhook,jdbcType=VARCHAR}, + + + remark = #{record.remark,jdbcType=VARCHAR}, + + + flag = #{record.flag,jdbcType=INTEGER}, + + + created_by = #{record.createdBy,jdbcType=BIGINT}, + + + created_at = #{record.createdAt,jdbcType=BIGINT}, + + + + + + + + + update notification_teams + set id = #{record.id,jdbcType=BIGINT}, + company_id = #{record.companyId,jdbcType=BIGINT}, + `identity` = #{record.identity,jdbcType=VARCHAR}, + webhook = #{record.webhook,jdbcType=VARCHAR}, + remark = #{record.remark,jdbcType=VARCHAR}, + flag = #{record.flag,jdbcType=INTEGER}, + created_by = #{record.createdBy,jdbcType=BIGINT}, + created_at = #{record.createdAt,jdbcType=BIGINT} + + + + + + + update notification_teams + + + company_id = #{companyId,jdbcType=BIGINT}, + + + `identity` = #{identity,jdbcType=VARCHAR}, + + + webhook = #{webhook,jdbcType=VARCHAR}, + + + remark = #{remark,jdbcType=VARCHAR}, + + + flag = #{flag,jdbcType=INTEGER}, + + + created_by = #{createdBy,jdbcType=BIGINT}, + + + created_at = #{createdAt,jdbcType=BIGINT}, + + + where id = #{id,jdbcType=BIGINT} + + + + update notification_teams + set company_id = #{companyId,jdbcType=BIGINT}, + `identity` = #{identity,jdbcType=VARCHAR}, + webhook = #{webhook,jdbcType=VARCHAR}, + remark = #{remark,jdbcType=VARCHAR}, + flag = #{flag,jdbcType=INTEGER}, + created_by = #{createdBy,jdbcType=BIGINT}, + created_at = #{createdAt,jdbcType=BIGINT} + where id = #{id,jdbcType=BIGINT} + + \ No newline at end of file diff --git a/dongjian-dashboard-back-dao/src/main/resources/mappers/auto/SysEnvMapper.xml b/dongjian-dashboard-back-dao/src/main/resources/mappers/auto/SysEnvMapper.xml new file mode 100644 index 0000000..a2b2b5c --- /dev/null +++ b/dongjian-dashboard-back-dao/src/main/resources/mappers/auto/SysEnvMapper.xml @@ -0,0 +1,225 @@ + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + + env_key, env_value + + + + + + delete from sys_env + where env_key = #{envKey,jdbcType=VARCHAR} + + + + delete from sys_env + + + + + + + insert into sys_env (env_key, env_value) + values (#{envKey,jdbcType=VARCHAR}, #{envValue,jdbcType=VARCHAR}) + + + + insert into sys_env + + + env_key, + + + env_value, + + + + + #{envKey,jdbcType=VARCHAR}, + + + #{envValue,jdbcType=VARCHAR}, + + + + + + + update sys_env + + + env_key = #{record.envKey,jdbcType=VARCHAR}, + + + env_value = #{record.envValue,jdbcType=VARCHAR}, + + + + + + + + + update sys_env + set env_key = #{record.envKey,jdbcType=VARCHAR}, + env_value = #{record.envValue,jdbcType=VARCHAR} + + + + + + + update sys_env + + + env_value = #{envValue,jdbcType=VARCHAR}, + + + where env_key = #{envKey,jdbcType=VARCHAR} + + + + update sys_env + set env_value = #{envValue,jdbcType=VARCHAR} + where env_key = #{envKey,jdbcType=VARCHAR} + + \ No newline at end of file diff --git a/dongjian-dashboard-back-dao/src/main/resources/mappers/auto/UserBuildingRelationMapper.xml b/dongjian-dashboard-back-dao/src/main/resources/mappers/auto/UserBuildingRelationMapper.xml new file mode 100644 index 0000000..b668d17 --- /dev/null +++ b/dongjian-dashboard-back-dao/src/main/resources/mappers/auto/UserBuildingRelationMapper.xml @@ -0,0 +1,198 @@ + + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + + user_id, building_id, create_time + + + + + delete from user_building_relation + + + + + + + insert into user_building_relation (user_id, building_id, create_time + ) + values (#{userId,jdbcType=BIGINT}, #{buildingId,jdbcType=BIGINT}, #{createTime,jdbcType=BIGINT} + ) + + + + insert into user_building_relation + + + user_id, + + + building_id, + + + create_time, + + + + + #{userId,jdbcType=BIGINT}, + + + #{buildingId,jdbcType=BIGINT}, + + + #{createTime,jdbcType=BIGINT}, + + + + + + + update user_building_relation + + + user_id = #{record.userId,jdbcType=BIGINT}, + + + building_id = #{record.buildingId,jdbcType=BIGINT}, + + + create_time = #{record.createTime,jdbcType=BIGINT}, + + + + + + + + + update user_building_relation + set user_id = #{record.userId,jdbcType=BIGINT}, + building_id = #{record.buildingId,jdbcType=BIGINT}, + create_time = #{record.createTime,jdbcType=BIGINT} + + + + + \ No newline at end of file diff --git a/dongjian-dashboard-back-dao/src/main/resources/mappers/ex/AlertHandleHistoryMapperExt.xml b/dongjian-dashboard-back-dao/src/main/resources/mappers/ex/AlertHandleHistoryMapperExt.xml new file mode 100644 index 0000000..025ab31 --- /dev/null +++ b/dongjian-dashboard-back-dao/src/main/resources/mappers/ex/AlertHandleHistoryMapperExt.xml @@ -0,0 +1,21 @@ + + + + + + + \ No newline at end of file diff --git a/dongjian-dashboard-back-dao/src/main/resources/mappers/ex/BasicBuildingMapperExt.xml b/dongjian-dashboard-back-dao/src/main/resources/mappers/ex/BasicBuildingMapperExt.xml new file mode 100644 index 0000000..faf7188 --- /dev/null +++ b/dongjian-dashboard-back-dao/src/main/resources/mappers/ex/BasicBuildingMapperExt.xml @@ -0,0 +1,39 @@ + + + + + + + + + \ No newline at end of file diff --git a/dongjian-dashboard-back-dao/src/main/resources/mappers/ex/BasicCompanyMapperExt.xml b/dongjian-dashboard-back-dao/src/main/resources/mappers/ex/BasicCompanyMapperExt.xml new file mode 100644 index 0000000..dd6b9a2 --- /dev/null +++ b/dongjian-dashboard-back-dao/src/main/resources/mappers/ex/BasicCompanyMapperExt.xml @@ -0,0 +1,88 @@ + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/dongjian-dashboard-back-dao/src/main/resources/mappers/ex/BasicProjectMapperExt.xml b/dongjian-dashboard-back-dao/src/main/resources/mappers/ex/BasicProjectMapperExt.xml new file mode 100644 index 0000000..86975d7 --- /dev/null +++ b/dongjian-dashboard-back-dao/src/main/resources/mappers/ex/BasicProjectMapperExt.xml @@ -0,0 +1,142 @@ + + + + + + insert into data_center_third_${companyId}.basic_project + + + company_id, + + + project_name, + + + flag, + + + create_time, + + + creator_id, + + + modify_time, + + + modifier_id, + + + udf_project_id, + + + + + #{companyId,jdbcType=BIGINT}, + + + #{projectName,jdbcType=VARCHAR}, + + + #{flag,jdbcType=INTEGER}, + + + #{createTime,jdbcType=BIGINT}, + + + #{creatorId,jdbcType=BIGINT}, + + + #{modifyTime,jdbcType=BIGINT}, + + + #{modifierId,jdbcType=BIGINT}, + + + #{udfProjectId,jdbcType=VARCHAR}, + + + + + + + + + + update data_center_third_${companyId}.basic_project + + + company_id = #{companyId,jdbcType=BIGINT}, + + + project_name = #{projectName,jdbcType=VARCHAR}, + + + flag = #{flag,jdbcType=INTEGER}, + + + create_time = #{createTime,jdbcType=BIGINT}, + + + creator_id = #{creatorId,jdbcType=BIGINT}, + + + modify_time = #{modifyTime,jdbcType=BIGINT}, + + + modifier_id = #{modifierId,jdbcType=BIGINT}, + + + udf_project_id = #{udfProjectId,jdbcType=VARCHAR}, + + + where id = #{id,jdbcType=BIGINT} + + + + + + + + + + \ No newline at end of file diff --git a/dongjian-dashboard-back-dao/src/main/resources/mappers/ex/BasicRoleMapperExt.xml b/dongjian-dashboard-back-dao/src/main/resources/mappers/ex/BasicRoleMapperExt.xml new file mode 100644 index 0000000..a1f8291 --- /dev/null +++ b/dongjian-dashboard-back-dao/src/main/resources/mappers/ex/BasicRoleMapperExt.xml @@ -0,0 +1,67 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/dongjian-dashboard-back-dao/src/main/resources/mappers/ex/BasicRoleMenuRelationMapperExt.xml b/dongjian-dashboard-back-dao/src/main/resources/mappers/ex/BasicRoleMenuRelationMapperExt.xml new file mode 100644 index 0000000..43b47c3 --- /dev/null +++ b/dongjian-dashboard-back-dao/src/main/resources/mappers/ex/BasicRoleMenuRelationMapperExt.xml @@ -0,0 +1,34 @@ + + + + + + INSERT INTO + basic_role_menu_relation (role_id, menu_id, creator_id, create_time) + VALUES + + (#{roleId}, #{item}, #{creatorId}, #{createTime}) + + + + + + + + DELETE r + FROM + basic_role_menu_relation r INNER JOIN basic_menu m ON r.menu_id = m.id + WHERE + r.role_id = #{roleId} AND m.used_by_dashboard = 1 + + + + \ No newline at end of file diff --git a/dongjian-dashboard-back-dao/src/main/resources/mappers/ex/BasicUserMapperExt.xml b/dongjian-dashboard-back-dao/src/main/resources/mappers/ex/BasicUserMapperExt.xml new file mode 100644 index 0000000..9dc0a47 --- /dev/null +++ b/dongjian-dashboard-back-dao/src/main/resources/mappers/ex/BasicUserMapperExt.xml @@ -0,0 +1,116 @@ + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/dongjian-dashboard-back-dao/src/main/resources/mappers/ex/DashboardLevelRoleMapperExt.xml b/dongjian-dashboard-back-dao/src/main/resources/mappers/ex/DashboardLevelRoleMapperExt.xml new file mode 100644 index 0000000..06b7ee4 --- /dev/null +++ b/dongjian-dashboard-back-dao/src/main/resources/mappers/ex/DashboardLevelRoleMapperExt.xml @@ -0,0 +1,64 @@ + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/dongjian-dashboard-back-dao/src/main/resources/mappers/ex/DashboardRealtimeMeasureMapperExt.xml b/dongjian-dashboard-back-dao/src/main/resources/mappers/ex/DashboardRealtimeMeasureMapperExt.xml new file mode 100644 index 0000000..41e538e --- /dev/null +++ b/dongjian-dashboard-back-dao/src/main/resources/mappers/ex/DashboardRealtimeMeasureMapperExt.xml @@ -0,0 +1,22 @@ + + + + + + + + \ No newline at end of file diff --git a/dongjian-dashboard-back-dao/src/main/resources/mappers/ex/DashboardRecordAccumulateMapperExt.xml b/dongjian-dashboard-back-dao/src/main/resources/mappers/ex/DashboardRecordAccumulateMapperExt.xml new file mode 100644 index 0000000..4be77c6 --- /dev/null +++ b/dongjian-dashboard-back-dao/src/main/resources/mappers/ex/DashboardRecordAccumulateMapperExt.xml @@ -0,0 +1,80 @@ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/dongjian-dashboard-back-dao/src/main/resources/mappers/ex/DeviceGroupMapperExt.xml b/dongjian-dashboard-back-dao/src/main/resources/mappers/ex/DeviceGroupMapperExt.xml new file mode 100644 index 0000000..05a397f --- /dev/null +++ b/dongjian-dashboard-back-dao/src/main/resources/mappers/ex/DeviceGroupMapperExt.xml @@ -0,0 +1,109 @@ + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/dongjian-dashboard-back-dao/src/main/resources/mappers/ex/DeviceInfoMapperExt.xml b/dongjian-dashboard-back-dao/src/main/resources/mappers/ex/DeviceInfoMapperExt.xml new file mode 100644 index 0000000..ee7ff0c --- /dev/null +++ b/dongjian-dashboard-back-dao/src/main/resources/mappers/ex/DeviceInfoMapperExt.xml @@ -0,0 +1,439 @@ + + + + + + + basic_floor.floor_id as floorId, + basic_floor.name as floorName, + device_info.id, + device_info.device_id, + device_info.device_sn, + device_info.type_id, + device_info.retain_alert, + device_info.monitoring_point_name, + device_info.monitoring_point_category_id, + monitoring_point_category.name as monitoringPointCategoryName, + data_provider.name as dataProviderName, + data_provider.thumbnail_base64 as dataProviderThumbnailBase64, + device_info.gateway_info_id, + data_provider_gateway_info.name as gatewayInfoName, + type.unit + + + + from device_info + left join basic_monitoring_asset on device_info.asset_id = basic_monitoring_asset.equipment_id + left join basic_space on basic_monitoring_asset.space_id = basic_space.space_id + left join basic_floor on basic_space.floor_id = basic_floor.floor_id + left join basic_building on basic_floor.building_id = basic_building.building_id + left join data_provider on data_provider.id = device_info.data_provider_id + left join data_provider_gateway_info on data_provider_gateway_info.id = device_info.gateway_info_id + left join type on device_info.type_id = type.id + left join monitoring_point_category on monitoring_point_category.id = device_info.monitoring_point_category_id + + + + + and device_info.monitoring_point_name LIKE CONCAT('%',#{keyword},'%') + + + and device_info.company_id in + + #{companyId} + + + + and device_info.device_id in + + #{deviceId} + + + and device_info.flag = 0 and basic_monitoring_asset.flag != 1 and basic_space.flag != 1 and basic_floor.flag != 1 and basic_building.flag != 1 + and device_info.type_id in + + #{typeId} + + + + + order by device_info.id desc + + + + ORDER BY + + + monitoring_point_category.name + + + basic_floor.name + + + drr.receive_ts + + + device_info.id + + + + + ASC + + + DESC + + + + + + + + + + + + + + + + + + + ORDER BY + + + monitoring_point_category.name + + + basic_floor.name + + + bss.latest_ts + + + device_info.id + + + + + ASC + + + DESC + + + + + + + + + + + ORDER BY + + + monitoring_point_category.name + + + basic_floor.name + + + alert_history.receive_ts + + + device_info.id + + + + + ASC + + + DESC + + + + + + + + + + + + device_info.id, + device_info.company_id, + device_info.device_name, + device_info.device_id, + device_info.device_sn, + device_info.type_id, + device_info.flag, + type.name as typeName, + basic_building.building_id, + basic_building.name as buildingName, + basic_floor.floor_id as floorId, + basic_floor.name as floorName, + basic_space.space_id as spaceId, + basic_space.name as spaceName, + basic_project.id as projectId, + basic_project.project_name, + basic_monitoring_asset.equipment_id as assetId, + basic_monitoring_asset.symbol as assetSymbol, + device_info.remark, + device_info.monitoring_point_name, + device_info.monitoring_point_category_id, + mpc.name as monitoringPointCategoryName, + device_info.data_provider_id, + data_provider.name as dataProviderName, + device_info.gateway_info_id, + data_provider_gateway_info.name as gatewayInfoName + + + + + from device_info + left join basic_monitoring_asset on device_info.asset_id = basic_monitoring_asset.equipment_id + left join basic_space on basic_monitoring_asset.space_id = basic_space.space_id + left join basic_floor on basic_space.floor_id = basic_floor.floor_id + left join basic_building on basic_floor.building_id = basic_building.building_id + left join monitoring_point_category mpc on mpc.id = device_info.monitoring_point_category_id + left join data_provider on data_provider.id = device_info.data_provider_id + left join data_provider_gateway_info on data_provider_gateway_info.id = device_info.gateway_info_id + left join type on device_info.type_id = type.id + left join basic_project on device_info.project_id = basic_project.id + + + + + + + + + + diff --git a/dongjian-dashboard-back-dao/src/main/resources/mappers/ex/DeviceRawdataRealtimeMapperExt.xml b/dongjian-dashboard-back-dao/src/main/resources/mappers/ex/DeviceRawdataRealtimeMapperExt.xml new file mode 100644 index 0000000..df1ed01 --- /dev/null +++ b/dongjian-dashboard-back-dao/src/main/resources/mappers/ex/DeviceRawdataRealtimeMapperExt.xml @@ -0,0 +1,43 @@ + + + + + + + + + + \ No newline at end of file diff --git a/dongjian-dashboard-back-dao/src/main/resources/mappers/ex/FavoritedDeviceMapperExt.xml b/dongjian-dashboard-back-dao/src/main/resources/mappers/ex/FavoritedDeviceMapperExt.xml new file mode 100644 index 0000000..68cec6f --- /dev/null +++ b/dongjian-dashboard-back-dao/src/main/resources/mappers/ex/FavoritedDeviceMapperExt.xml @@ -0,0 +1,66 @@ + + + + + + + + + + + + INSERT INTO favorited_device (device_id, create_at) + VALUES + + (#{item}, #{createAt}) + + + + + + DELETE FROM favorited_device + WHERE device_id IN + + #{id} + + + + + + \ No newline at end of file diff --git a/dongjian-dashboard-back-dao/src/main/resources/mappers/ex/LevelHierarchyMapperExt.xml b/dongjian-dashboard-back-dao/src/main/resources/mappers/ex/LevelHierarchyMapperExt.xml new file mode 100644 index 0000000..16b52b9 --- /dev/null +++ b/dongjian-dashboard-back-dao/src/main/resources/mappers/ex/LevelHierarchyMapperExt.xml @@ -0,0 +1,359 @@ + + + + + + + + + + INSERT INTO + + dashboard_branch + dashboard_store + dashboard_area + dashboard_site + + (company_id, `name`, remark, created_by, created_at) + VALUES (#{companyId}, #{levelHierarchyName}, #{remark}, #{createdBy}, #{createdAt}) + + + + + + + + DELETE FROM dashboard_branch_store + WHERE store_id = #{childId} + + + + + DELETE FROM dashboard_store_area + WHERE area_id = #{childId} + + + + + DELETE FROM dashboard_area_site + WHERE site_id = #{childId} + + + + + DELETE FROM dashboard_site_building + WHERE building_id = #{childId} + + + + + + + + + + INSERT INTO dashboard_branch_store (branch_id, store_id, created_by, created_at) + VALUES + + (#{pid}, #{childId}, #{createdBy}, #{createdAt}) + + + + + + INSERT INTO dashboard_store_area (store_id, area_id, created_by, created_at) + VALUES + + (#{pid}, #{childId}, #{createdBy}, #{createdAt}) + + + + + + INSERT INTO dashboard_area_site (area_id, site_id, created_by, created_at) + VALUES + + (#{pid}, #{childId}, #{createdBy}, #{createdAt}) + + + + + + INSERT INTO dashboard_site_building (site_id, building_id, created_by, created_at) + VALUES + + (#{pid}, #{childId}, #{createdBy}, #{createdAt}) + + + + + + + + UPDATE + + dashboard_branch + dashboard_store + dashboard_area + dashboard_site + + + + name = #{levelHierarchyName}, + + + remark = #{remark}, + + updated_at = #{updatedAt} + + WHERE id = #{id} + + + + + + + + + + + + UPDATE dashboard_branch SET flag = 1 + WHERE id IN + + #{id} + + + + + UPDATE dashboard_store SET flag = 1 + WHERE id IN + + #{id} + + + + + UPDATE dashboard_area SET flag = 1 + WHERE id IN + + #{id} + + + + + UPDATE dashboard_site SET flag = 1 + WHERE id IN + + #{id} + + + + + + + + + + + \ No newline at end of file diff --git a/dongjian-dashboard-back-dao/src/main/resources/mappers/ex/MonitoringPointCategoryGroupMapperExt.xml b/dongjian-dashboard-back-dao/src/main/resources/mappers/ex/MonitoringPointCategoryGroupMapperExt.xml new file mode 100644 index 0000000..fbc4e31 --- /dev/null +++ b/dongjian-dashboard-back-dao/src/main/resources/mappers/ex/MonitoringPointCategoryGroupMapperExt.xml @@ -0,0 +1,81 @@ + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/dongjian-dashboard-back-dao/src/main/resources/mappers/ex/MonitoringPointCategoryMapperExt.xml b/dongjian-dashboard-back-dao/src/main/resources/mappers/ex/MonitoringPointCategoryMapperExt.xml new file mode 100644 index 0000000..fd3f7a1 --- /dev/null +++ b/dongjian-dashboard-back-dao/src/main/resources/mappers/ex/MonitoringPointCategoryMapperExt.xml @@ -0,0 +1,43 @@ + + + + + + + + + + \ No newline at end of file diff --git a/dongjian-dashboard-back-dao/src/main/resources/mappers/ex/NotificationSlackMapperExt.xml b/dongjian-dashboard-back-dao/src/main/resources/mappers/ex/NotificationSlackMapperExt.xml new file mode 100644 index 0000000..deef01a --- /dev/null +++ b/dongjian-dashboard-back-dao/src/main/resources/mappers/ex/NotificationSlackMapperExt.xml @@ -0,0 +1,45 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/dongjian-dashboard-back-dao/src/main/resources/mappers/ex/NotificationTeamsMapperExt.xml b/dongjian-dashboard-back-dao/src/main/resources/mappers/ex/NotificationTeamsMapperExt.xml new file mode 100644 index 0000000..3578d11 --- /dev/null +++ b/dongjian-dashboard-back-dao/src/main/resources/mappers/ex/NotificationTeamsMapperExt.xml @@ -0,0 +1,45 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/dongjian-dashboard-back-dao/src/main/resources/mappers/ex/OperationLogMapperExt.xml b/dongjian-dashboard-back-dao/src/main/resources/mappers/ex/OperationLogMapperExt.xml new file mode 100644 index 0000000..c29e84f --- /dev/null +++ b/dongjian-dashboard-back-dao/src/main/resources/mappers/ex/OperationLogMapperExt.xml @@ -0,0 +1,35 @@ + + + + + + + + \ No newline at end of file diff --git a/dongjian-dashboard-back-dao/src/main/resources/mappers/ex/SysEnvMapperExt.xml b/dongjian-dashboard-back-dao/src/main/resources/mappers/ex/SysEnvMapperExt.xml new file mode 100644 index 0000000..876fff5 --- /dev/null +++ b/dongjian-dashboard-back-dao/src/main/resources/mappers/ex/SysEnvMapperExt.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/dongjian-dashboard-back-dao/src/main/resources/mappers/ex/UserBuildingRelationMapperExt.xml b/dongjian-dashboard-back-dao/src/main/resources/mappers/ex/UserBuildingRelationMapperExt.xml new file mode 100644 index 0000000..cfe2ca5 --- /dev/null +++ b/dongjian-dashboard-back-dao/src/main/resources/mappers/ex/UserBuildingRelationMapperExt.xml @@ -0,0 +1,36 @@ + + + + + + + + DELETE FROM user_building_relation + WHERE user_id = #{userId} + + + + + INSERT INTO user_building_relation (user_id, building_id, create_time) + VALUES + + (#{item.userId}, #{item.buildingId}, #{item.createTime}) + + + + + + \ No newline at end of file diff --git a/dongjian-dashboard-back-dao/src/main/resources/mybatis-generator/generatorConfig.xml b/dongjian-dashboard-back-dao/src/main/resources/mybatis-generator/generatorConfig.xml new file mode 100644 index 0000000..005e232 --- /dev/null +++ b/dongjian-dashboard-back-dao/src/main/resources/mybatis-generator/generatorConfig.xml @@ -0,0 +1,139 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + +
+ + + + +
+ + + + +
+ + + + +
+ + + +
+ + + + +
+ + + + +
+ + + + +
+ + + +
+ + + +
+ + + + +
+ + + + +
+ + + +
+ + + +
+ + + +
+ + + + +
+ + + + +
+ +
+
\ No newline at end of file diff --git a/dongjian-dashboard-back-dao/src/main/resources/mybatis-generator/mybatisGeneratorinit.properties b/dongjian-dashboard-back-dao/src/main/resources/mybatis-generator/mybatisGeneratorinit.properties new file mode 100644 index 0000000..17318c4 --- /dev/null +++ b/dongjian-dashboard-back-dao/src/main/resources/mybatis-generator/mybatisGeneratorinit.properties @@ -0,0 +1,7 @@ +#Mybatis Generator configuration +project =src/main/java +resources=src/main/resources +jdbc_driver =com.mysql.cj.jdbc.Driver +jdbc_url=jdbc:mysql://rm-bp11k2zm2fr7864428o.mysql.rds.aliyuncs.com:3306/data_center_new?useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai +jdbc_user=zhc +jdbc_password=Youqu48bnb1 \ No newline at end of file diff --git a/dongjian-dashboard-back-dao/src/main/resources/page-config.xml b/dongjian-dashboard-back-dao/src/main/resources/page-config.xml new file mode 100644 index 0000000..90ae2bc --- /dev/null +++ b/dongjian-dashboard-back-dao/src/main/resources/page-config.xml @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/dongjian-dashboard-back-model/.gitignore b/dongjian-dashboard-back-model/.gitignore new file mode 100644 index 0000000..aa23915 --- /dev/null +++ b/dongjian-dashboard-back-model/.gitignore @@ -0,0 +1,15 @@ +/target/ +/logs/ +/.idea/ +*.iml +*.bak +*.log +/.settings/ +*.project +*.classpath +*.factorypath +*.springBeans +/.apt_generated/ +/.externalToolBuilders/ +/bin/ +application-*.properties diff --git a/dongjian-dashboard-back-model/pom.xml b/dongjian-dashboard-back-model/pom.xml new file mode 100644 index 0000000..a7074b7 --- /dev/null +++ b/dongjian-dashboard-back-model/pom.xml @@ -0,0 +1,40 @@ + + + 4.0.0 + + com.techsor + dongjian-dashboard-back + 0.0.1-SNAPSHOT + + dongjian-dashboard-back-model + dongjian-dashboard-back-model + http://maven.apache.org + + UTF-8 + + + + + org.hibernate + hibernate-validator + 6.1.0.Final + + + org.glassfish + javax.el + 3.0.1-b11 + + + org.hibernate + hibernate-validator-cdi + 6.1.0.Final + + + + junit + junit + test + + + diff --git a/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/aurora/ApikeyInfo.java b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/aurora/ApikeyInfo.java new file mode 100644 index 0000000..98ba497 --- /dev/null +++ b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/aurora/ApikeyInfo.java @@ -0,0 +1,13 @@ +package com.dongjian.dashboard.back.aurora; + +import lombok.Data; + +@Data +public class ApikeyInfo { + + private String auroraUrl; + + private String auroraUsername; + + private String auroraPassword; +} diff --git a/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/aurora/DataTarget.java b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/aurora/DataTarget.java new file mode 100644 index 0000000..7a4851e --- /dev/null +++ b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/aurora/DataTarget.java @@ -0,0 +1,29 @@ +package com.dongjian.dashboard.back.aurora; + +import java.util.ArrayList; +import java.util.List; + +import lombok.Data; + +@Data +public class DataTarget { + + private String target_id; + + private List maxData = new ArrayList<>(); + + private List minData = new ArrayList<>(); + + private List averageData = new ArrayList<>(); + + private List startData = new ArrayList<>(); + + private List endData = new ArrayList<>(); + + private List q1Data = new ArrayList<>(); + + private List q2Data = new ArrayList<>(); + + private List q3Data = new ArrayList<>(); + +} diff --git a/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/aurora/ElementData.java b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/aurora/ElementData.java new file mode 100644 index 0000000..e5d91ad --- /dev/null +++ b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/aurora/ElementData.java @@ -0,0 +1,11 @@ +package com.dongjian.dashboard.back.aurora; + +import lombok.Data; + +@Data +public class ElementData { + + private long milliTimestamp; + private String time; + private Double value; +} diff --git a/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/aurora/HistoricalDataDTO.java b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/aurora/HistoricalDataDTO.java new file mode 100644 index 0000000..a4b9643 --- /dev/null +++ b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/aurora/HistoricalDataDTO.java @@ -0,0 +1,16 @@ +package com.dongjian.dashboard.back.aurora; + +import lombok.Data; + +@Data +public class HistoricalDataDTO { + + private String rawData; + + private long receiveTs; + + private String targetId; + + private String targetIdMapper; + +} diff --git a/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/BaseSearchNoCompanysParams.java b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/BaseSearchNoCompanysParams.java new file mode 100644 index 0000000..2505e27 --- /dev/null +++ b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/BaseSearchNoCompanysParams.java @@ -0,0 +1,21 @@ +package com.dongjian.dashboard.back.dto; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Getter; +import lombok.Setter; + +@Setter +@Getter +public class BaseSearchNoCompanysParams { + + /** 页码 */ + @Schema(description = "当前页码(默认第一页)",example = "1") + private Integer pageNum; + /** 每页显示的条数 */ + @Schema(description = "每页显示的条数(默认20条)", example = "20") + private Integer pageSize; + + @Schema(description = "用户ID", hidden = true) + private Long userId; + +} diff --git a/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/BaseSearchParams.java b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/BaseSearchParams.java new file mode 100644 index 0000000..8b144e1 --- /dev/null +++ b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/BaseSearchParams.java @@ -0,0 +1,23 @@ +package com.dongjian.dashboard.back.dto; + +import java.util.List; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Getter; +import lombok.Setter; + +/** +* @author Mr.Jiang +* @time 2022年4月23日 下午1:55:22 +*/ +@Setter +@Getter +public class BaseSearchParams extends BaseSearchNoCompanysParams{ + + @Schema(description = "查询对象所属企业ID,多个使用逗号连接", hidden = true) + private String companyIds; + + @Schema(description = "查询对象所属企业ID", hidden = true) + private List companyIdList; + +} diff --git a/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/account/CacheUserData.java b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/account/CacheUserData.java new file mode 100644 index 0000000..72521fb --- /dev/null +++ b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/account/CacheUserData.java @@ -0,0 +1,23 @@ +package com.dongjian.dashboard.back.dto.account; + +import lombok.Data; + +/** +* @author Mr.Jiang +* @time 2022年5月20日 下午2:08:50 +*/ +@Data +public class CacheUserData { + + private String accessToken; + private Long userId; + private Long companyId; + private String username; + private String loginName; + private String password; + private Long createTime; + private Long expireTime; + private String menuIds; +// private String userGroupIds; + +} diff --git a/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/account/LoginParam.java b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/account/LoginParam.java new file mode 100644 index 0000000..7389aab --- /dev/null +++ b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/account/LoginParam.java @@ -0,0 +1,25 @@ +package com.dongjian.dashboard.back.dto.account; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** +* @author Mr.Jiang +* @time 2022年5月20日 下午7:13:50 +*/ +@Data +public class LoginParam { + + @Schema(description = "登录名",example = "admin") + private String loginname; + + @Schema(description = "密码",example = "123456") + private String password; + + @Schema(description = "验证码的请求标识ID",example = "111weyu2-123rt2u1-121ueiu2") + private String captchaRequestId; + + @Schema(description = "验证码值",example = "Z3xA") + private String captcha; + +} diff --git a/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/building/BuildingSearchParams.java b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/building/BuildingSearchParams.java new file mode 100644 index 0000000..e0070bb --- /dev/null +++ b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/building/BuildingSearchParams.java @@ -0,0 +1,28 @@ +package com.dongjian.dashboard.back.dto.building; + +import java.util.List; + +import com.dongjian.dashboard.back.dto.BaseSearchParams; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** +* @author Mr.Jiang +* @time 2022年7月21日 下午8:50:31 +*/ +@Data +public class BuildingSearchParams extends BaseSearchParams { + + @Schema(description ="Building name", example = "张三李四") + private String buildingName; + + @Schema(description ="Building IDs, comma-separated", example = "1,47") + private String buildingIds; + + @Schema(description ="Building IDs", hidden = true) + private List buildingIdList; + + @Schema(description ="Binded building IDs", hidden = true) + private List bindBuildingIdList; + +} diff --git a/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/common/BaseTransDataEntityMockParams.java b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/common/BaseTransDataEntityMockParams.java new file mode 100644 index 0000000..e868029 --- /dev/null +++ b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/common/BaseTransDataEntityMockParams.java @@ -0,0 +1,20 @@ +package com.dongjian.dashboard.back.dto.common; + + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +@Data +public class BaseTransDataEntityMockParams { + + @Schema(description = "hashId 32位UUID",example = "25-2121212112-121212-47") + private String hashId; + @Schema(description = "设备ID",example = "25,47") + private Integer id; + @Schema(description = "JSON内容",example = "25,47") + private String content; + @Schema(description = "时间戳",example = "251212121247") + private String ts; + @Schema(description = "公司名称",example = "ZETA") + private String company; //zifisense:纵行, nbi:农博, oviphone:oviphone +} diff --git a/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/common/DatacenterV1QueryParams.java b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/common/DatacenterV1QueryParams.java new file mode 100644 index 0000000..34730f4 --- /dev/null +++ b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/common/DatacenterV1QueryParams.java @@ -0,0 +1,27 @@ +package com.dongjian.dashboard.back.dto.common; + + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +@Data +public class DatacenterV1QueryParams { + + @Schema(description = "apikey值",example = "25aoy89qu69hnoskj47", required = true) + private String apikey; + + @Schema(description = "unix秒时间戳,endTime与startTime需在同一天内",example = "1658761235", required = true) + private long startTime; + + @Schema(description = "unix秒时间戳,endTime与startTime需在同一天",example = "1698761235", required = true) + private long endTime; + + @Schema(description = "设备ID",example = "bffffff1", required = true) + private String deviceId; + + @Schema(description = "hashId 32位UUID",example = "25-2121212112-121212-47") + private String hashId; + + @Schema(description = "日期,格式为 2023-10-23",example = "2023-10-23") + private String date; +} diff --git a/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/company/CompanySearchParams.java b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/company/CompanySearchParams.java new file mode 100644 index 0000000..674b3da --- /dev/null +++ b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/company/CompanySearchParams.java @@ -0,0 +1,24 @@ +package com.dongjian.dashboard.back.dto.company; + +import com.dongjian.dashboard.back.dto.BaseSearchParams; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** +* @author Mr.Jiang +* @time 2022年7月21日 下午8:50:31 +*/ +@Data +public class CompanySearchParams extends BaseSearchParams{ + + @Schema(description = "企业名",example = "张三李四") + private String companyName; + + @Schema(description = "登录账号的企业ID",example = "1", hidden = true) + private Long selfCompanyId; + +// @Schema(description = "1-未进入系统homepage页面获取,2-点击企业后进入系统后获取",example = "2") +// private Integer searchType; + +} diff --git a/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/company/DeleteCompanyParams.java b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/company/DeleteCompanyParams.java new file mode 100644 index 0000000..38c3dfd --- /dev/null +++ b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/company/DeleteCompanyParams.java @@ -0,0 +1,16 @@ +package com.dongjian.dashboard.back.dto.company; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** +* @author Mr.Jiang +* @time 2022年7月21日 下午8:50:31 +*/ +@Data +public class DeleteCompanyParams{ + + @Schema(description = "企业ID,多个使用半角字符逗号连接",example = "2738967,587") + private String companyIds; + +} diff --git a/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/company/OptCompanyParams.java b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/company/OptCompanyParams.java new file mode 100644 index 0000000..7ab3aad --- /dev/null +++ b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/company/OptCompanyParams.java @@ -0,0 +1,38 @@ +package com.dongjian.dashboard.back.dto.company; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** +* @author Mr.Jiang +* @time 2022年7月21日 下午8:50:31 +*/ +@Data +public class OptCompanyParams{ + + @Schema(description = "企业唯一标识ID,新增时无此参数",example = "2738967") + private Long companyId; + + @Schema(description = "父企业ID",example = "2738967", hidden = true) + private Long parentId; + + @Schema(description = "企业名称",example = "testAccount1", required = true) + private String companyName; + + @Schema(description = "mfa开关,0-关闭,1-开启",example = "1", required = true) + private Integer mfaSwitch; + + @Schema(description = "Bearer Token", example = "Bearer Token1111111", required = true) + private String bearerToken; + + @Schema(description = "third api host",example = "www.baiduc.com", required = true) + private String thirdApiHost; + + @Schema(description = "Lock the account after 5 failed login attempts. 0 - Off, 1 - On", example = "1") + private Integer lockSwitch; + +// @Schema(description = "企业付费后的使用有效期",example = "1662435718429", required = true) +// private Long expireTime; + + +} diff --git a/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/data/AccumulateDataSearchParam.java b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/data/AccumulateDataSearchParam.java new file mode 100644 index 0000000..33b3fd1 --- /dev/null +++ b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/data/AccumulateDataSearchParam.java @@ -0,0 +1,12 @@ +package com.dongjian.dashboard.back.dto.data; + +import lombok.Data; +import lombok.EqualsAndHashCode; + +@EqualsAndHashCode(callSuper = true) +@Data +public class AccumulateDataSearchParam extends DataSearchParam { + + + +} diff --git a/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/data/AlarmDataSearchParam.java b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/data/AlarmDataSearchParam.java new file mode 100644 index 0000000..372d34a --- /dev/null +++ b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/data/AlarmDataSearchParam.java @@ -0,0 +1,14 @@ +package com.dongjian.dashboard.back.dto.data; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import lombok.EqualsAndHashCode; + +@EqualsAndHashCode(callSuper = true) +@Data +public class AlarmDataSearchParam extends DataSearchParam { + + @Schema(description = "查询类型:1-告警一览,2-告警历史,3-未确认告警",example = "1") + private Integer searchType; + +} diff --git a/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/data/BaStatusDataSearchParam.java b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/data/BaStatusDataSearchParam.java new file mode 100644 index 0000000..7d03b5b --- /dev/null +++ b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/data/BaStatusDataSearchParam.java @@ -0,0 +1,12 @@ +package com.dongjian.dashboard.back.dto.data; + +import lombok.Data; +import lombok.EqualsAndHashCode; + +@EqualsAndHashCode(callSuper = true) +@Data +public class BaStatusDataSearchParam extends DataSearchParam { + + + +} diff --git a/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/data/DataSearchParam.java b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/data/DataSearchParam.java new file mode 100644 index 0000000..697239b --- /dev/null +++ b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/data/DataSearchParam.java @@ -0,0 +1,35 @@ +package com.dongjian.dashboard.back.dto.data; + +import com.dongjian.dashboard.back.dto.BaseSearchParams; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.List; + +@EqualsAndHashCode(callSuper = true) +@Data +public class DataSearchParam extends BaseSearchParams { + + @Schema(description = "楼宇ID",example = "122") + private Long buildingId; + + @Schema(description = "分组ID",example = "122") + private Long monitoringPointCategoryGroupId; + + @Schema(description = "设备类型",example = "[]", hidden = true) + private List typeIdList; + + @Schema(description = "设备ID",example = "[]", hidden = true) + private List deviceIdList; + + @Schema(description = "排序字段(接口返回什么字段,就用什么字段,比如monitoringPointCategoryName)",example = "monitoringPointCategoryName") + private String sortField; + + @Schema(description = "排序方式,两种:asc-正序,desc-倒叙",example = "desc") + private String sortOrder; + + @Schema(description = "关键词",example = "det") + private String keyword; + +} diff --git a/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/data/HandleAlarmParams.java b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/data/HandleAlarmParams.java new file mode 100644 index 0000000..ddafcec --- /dev/null +++ b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/data/HandleAlarmParams.java @@ -0,0 +1,24 @@ +package com.dongjian.dashboard.back.dto.data; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +@Data +public class HandleAlarmParams { + + @Schema(description = "告警记录ID",example = "122") + private Long alertHistoryId; + + @Schema(description = "处理者",example = "122") + private String handler; + + @Schema(description = "处理前的状态,0-未确认,1-未对应,2-对应中",example = "1") + private Integer oldStatus; + + @Schema(description = "处理后的状态,1-未对应,2-对应中,3-完了",example = "2") + private Integer targetStatus; + + @Schema(description = "处理备注",example = "22222") + private String remark; + +} diff --git a/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/data/HandleHistorySearchParam.java b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/data/HandleHistorySearchParam.java new file mode 100644 index 0000000..7832d8c --- /dev/null +++ b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/data/HandleHistorySearchParam.java @@ -0,0 +1,15 @@ +package com.dongjian.dashboard.back.dto.data; + +import com.dongjian.dashboard.back.dto.BaseSearchNoCompanysParams; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import lombok.EqualsAndHashCode; + +@EqualsAndHashCode(callSuper = true) +@Data +public class HandleHistorySearchParam extends BaseSearchNoCompanysParams { + + @Schema(description = "告警记录ID",example = "122", hidden = true) + private Long alertHistoryId; + +} diff --git a/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/data/MeasureDataSearchParam.java b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/data/MeasureDataSearchParam.java new file mode 100644 index 0000000..94124c4 --- /dev/null +++ b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/data/MeasureDataSearchParam.java @@ -0,0 +1,12 @@ +package com.dongjian.dashboard.back.dto.data; + +import lombok.Data; +import lombok.EqualsAndHashCode; + +@EqualsAndHashCode(callSuper = true) +@Data +public class MeasureDataSearchParam extends DataSearchParam { + + + +} diff --git a/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/device/DeviceSearchParams.java b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/device/DeviceSearchParams.java new file mode 100644 index 0000000..83257d1 --- /dev/null +++ b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/device/DeviceSearchParams.java @@ -0,0 +1,20 @@ +package com.dongjian.dashboard.back.dto.device; + +import com.dongjian.dashboard.back.dto.BaseSearchParams; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.List; + +@EqualsAndHashCode(callSuper = true) +@Data +public class DeviceSearchParams extends BaseSearchParams { + + @Schema(description = "building ID") + private Long buildingId; + + @Schema(description = "设备类型",example = "[]", hidden = true) + private List typeIdList; + +} diff --git a/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/device/FavoritedDeviceSearchParams.java b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/device/FavoritedDeviceSearchParams.java new file mode 100644 index 0000000..b97c239 --- /dev/null +++ b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/device/FavoritedDeviceSearchParams.java @@ -0,0 +1,23 @@ +package com.dongjian.dashboard.back.dto.device; + +import com.dongjian.dashboard.back.dto.BaseSearchParams; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.List; + +@EqualsAndHashCode(callSuper = true) +@Data +public class FavoritedDeviceSearchParams extends BaseSearchParams { + + @Schema(description = "building ID") + private Long buildingId; + + @Schema(description = "1-警报设备,2-积算设备,3-计测设备,4-运行状态设备",example = "1") + private Integer classId; + + @Schema(description = "设备类型",example = "[]", hidden = true) + private List typeIdList; + +} diff --git a/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/device/LineDataSearchParams.java b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/device/LineDataSearchParams.java new file mode 100644 index 0000000..3b3c4b3 --- /dev/null +++ b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/device/LineDataSearchParams.java @@ -0,0 +1,12 @@ +package com.dongjian.dashboard.back.dto.device; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +@Data +public class LineDataSearchParams { + + @Schema(description = "device ID") + private String deviceId; + +} diff --git a/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/device/OptDeviceFieldParams.java b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/device/OptDeviceFieldParams.java new file mode 100644 index 0000000..55307b3 --- /dev/null +++ b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/device/OptDeviceFieldParams.java @@ -0,0 +1,17 @@ +package com.dongjian.dashboard.back.dto.device; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.util.List; + +@Data +public class OptDeviceFieldParams { + + @Schema(description = "Device primary key ID", example = "6") + private Integer id; + + @Schema(description = "dashboard自动恢复告警时是否保留告警:0-不保留,1-保留", example = "1") + private Integer retainAlert; + +} diff --git a/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/device/OptFavoritedDeviceParams.java b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/device/OptFavoritedDeviceParams.java new file mode 100644 index 0000000..5ff8489 --- /dev/null +++ b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/device/OptFavoritedDeviceParams.java @@ -0,0 +1,16 @@ +package com.dongjian.dashboard.back.dto.device; + +import com.dongjian.dashboard.back.dto.BaseSearchParams; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.List; + +@Data +public class OptFavoritedDeviceParams { + + @Schema(description = "device id list") + private List deviceIdList; + +} diff --git a/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/devicegroup/BindDeviceForGroupParams.java b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/devicegroup/BindDeviceForGroupParams.java new file mode 100644 index 0000000..9dcbb86 --- /dev/null +++ b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/devicegroup/BindDeviceForGroupParams.java @@ -0,0 +1,16 @@ +package com.dongjian.dashboard.back.dto.devicegroup; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + + +@Data +public class BindDeviceForGroupParams { + + @Schema(description = "组ID",example = "27,587") + private Long deviceGroupId; + + @Schema(description = "设备主键ID,多个使用半角字符逗号连接,注意不是设备ID") + private String deviceInfoIds; + +} diff --git a/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/devicegroup/BindGroupForDeviceParams.java b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/devicegroup/BindGroupForDeviceParams.java new file mode 100644 index 0000000..c2710f9 --- /dev/null +++ b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/devicegroup/BindGroupForDeviceParams.java @@ -0,0 +1,16 @@ +package com.dongjian.dashboard.back.dto.devicegroup; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + + +@Data +public class BindGroupForDeviceParams { + + @Schema(description = "组ID,多个使用半角字符逗号连接",example = "27,587") + private String deviceGroupIds; + + @Schema(description = "设备主键ID,注意不是设备ID") + private Integer deviceInfoId; + +} diff --git a/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/devicegroup/DeleteDeviceGroupParams.java b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/devicegroup/DeleteDeviceGroupParams.java new file mode 100644 index 0000000..7a5ab28 --- /dev/null +++ b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/devicegroup/DeleteDeviceGroupParams.java @@ -0,0 +1,12 @@ +package com.dongjian.dashboard.back.dto.devicegroup; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +@Data +public class DeleteDeviceGroupParams{ + + @Schema(description = "组ID,多个使用半角字符逗号连接",example = "27,587") + private String deviceGroupIds; + +} diff --git a/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/devicegroup/DeviceGroupSearchParams.java b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/devicegroup/DeviceGroupSearchParams.java new file mode 100644 index 0000000..f383885 --- /dev/null +++ b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/devicegroup/DeviceGroupSearchParams.java @@ -0,0 +1,30 @@ +package com.dongjian.dashboard.back.dto.devicegroup; + +import com.dongjian.dashboard.back.dto.BaseSearchParams; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.List; + + +@EqualsAndHashCode(callSuper = true) +@Data +public class DeviceGroupSearchParams extends BaseSearchParams { + + @Schema(description = "楼宇ID",example = "222") + private Long buildingId; + + @Schema(description = "设备组名",example = "张三李四") + private String name; + + @Schema(description = "分组下的设备分类, 1-报警、2-累积、3-计测、4-振动",example = "1") + private Integer groupType; + + @Schema(description = "设备组id,多个逗号连接",example = "1,47") + private String deviceGroupIds; + + @Schema(description = "设备组id", hidden = true) + private List deviceGroupIdList; + +} diff --git a/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/devicegroup/OptDeviceGroupParams.java b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/devicegroup/OptDeviceGroupParams.java new file mode 100644 index 0000000..c086409 --- /dev/null +++ b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/devicegroup/OptDeviceGroupParams.java @@ -0,0 +1,27 @@ +package com.dongjian.dashboard.back.dto.devicegroup; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + + +@Data +public class OptDeviceGroupParams{ + + @Schema(description = "唯一标识ID,新增时无此参数",example = "2738967") + private Long deviceGroupId; + + @Schema(description = "楼宇ID",example = "222") + private Long buildingId; + + @Schema(description = "分组下的设备分类, 1-报警、2-累积、3-计测、4-振动",example = "2738967") + private Integer groupType; + + @Schema(description = "所属企业ID",example = "2738967", hidden = true) + private Long companyId; + + @Schema(description = "设备组名",example = "testDeviceGroup1", required = true) + private String name; + + @Schema(description = "remark", example = "remark") + private String remark; +} diff --git a/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/levelhierarchy/DeleteLevelHierarchyParam.java b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/levelhierarchy/DeleteLevelHierarchyParam.java new file mode 100644 index 0000000..975f3fc --- /dev/null +++ b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/levelhierarchy/DeleteLevelHierarchyParam.java @@ -0,0 +1,21 @@ +package com.dongjian.dashboard.back.dto.levelhierarchy; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Getter; +import lombok.Setter; + +/** +* @author Mr.Jiang +* @time 2022年4月23日 下午1:59:33 +*/ +@Setter +@Getter +public class DeleteLevelHierarchyParam { + + @Schema(description = "Id,多个使用逗号连接",example = "3,5", required = true) + private String ids; + + @Schema(description = "层级类型,BRANCH=支社,STORE=支店,AREA=area,SITE=site",example = "SITE", required = true) + private String type; + +} diff --git a/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/levelhierarchy/DeleteLevelHierarchyRoleParam.java b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/levelhierarchy/DeleteLevelHierarchyRoleParam.java new file mode 100644 index 0000000..10052ff --- /dev/null +++ b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/levelhierarchy/DeleteLevelHierarchyRoleParam.java @@ -0,0 +1,18 @@ +package com.dongjian.dashboard.back.dto.levelhierarchy; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Getter; +import lombok.Setter; + +/** +* @author Mr.Jiang +* @time 2022年4月23日 下午1:59:33 +*/ +@Setter +@Getter +public class DeleteLevelHierarchyRoleParam { + + @Schema(description = "Id,多个使用逗号连接",example = "3,5", required = true) + private String ids; + +} diff --git a/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/levelhierarchy/OptLevelHierarchyParam.java b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/levelhierarchy/OptLevelHierarchyParam.java new file mode 100644 index 0000000..a52fc49 --- /dev/null +++ b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/levelhierarchy/OptLevelHierarchyParam.java @@ -0,0 +1,46 @@ +package com.dongjian.dashboard.back.dto.levelhierarchy; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Getter; +import lombok.Setter; + +import java.util.List; + +/** +* @author zhc +* @time 2022年6月14日10:56:38 +*/ +@Setter +@Getter +public class OptLevelHierarchyParam { + + + @Schema(description = "层级ID, 新增时无此参数",example = "111", required = false) + private Long id; + + @Schema(description = "层级类型,BRANCH=支社,STORE=支店,AREA=area,SITE=site",example = "SITE", required = true) + private String type; + + @Schema(description = "层级名称",example = "管理员", required = true) + private String levelHierarchyName; + + @Schema(description = "描述",example = "这是管理员描述") + private String remark; + + @Schema(description = "所属上一层级的id列表(支持多个上级)",example = "[1,2,3,4]", required = true) + private List parentIdList; + + @Schema(description = "所属企业ID",example = "2", hidden = true) + private Long companyId; + + @Schema(hidden = true) + private Long createdBy; + + @Schema(hidden = true) + private Long createdAt; + + @Schema(hidden = true) + private Long updatedAt; + + +} diff --git a/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/levelhierarchy/OptLevelHierarchyRoleParam.java b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/levelhierarchy/OptLevelHierarchyRoleParam.java new file mode 100644 index 0000000..90920fd --- /dev/null +++ b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/levelhierarchy/OptLevelHierarchyRoleParam.java @@ -0,0 +1,40 @@ +package com.dongjian.dashboard.back.dto.levelhierarchy; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Getter; +import lombok.Setter; + +import java.util.List; + +/** +* @author zhc +* @time 2022年6月14日10:56:38 +*/ +@Setter +@Getter +public class OptLevelHierarchyRoleParam { + + + @Schema(description = "ID, 新增时无此参数",example = "111", required = false) + private Long id; + + @Schema(description = "名称",example = "管理员", required = true) + private String name; + + @Schema(description = "描述",example = "这是管理员描述", required = false) + private String remark; + + @Schema(description = "所属企业ID",example = "2", hidden = true) + private Long companyId; + + @Schema(hidden = true) + private Long createdBy; + + @Schema(hidden = true) + private Long createdAt; + + @Schema(hidden = true) + private Long updatedAt; + + +} diff --git a/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/levelhierarchy/PageLevelHierarchyRoleSearchParam.java b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/levelhierarchy/PageLevelHierarchyRoleSearchParam.java new file mode 100644 index 0000000..a49d540 --- /dev/null +++ b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/levelhierarchy/PageLevelHierarchyRoleSearchParam.java @@ -0,0 +1,19 @@ +package com.dongjian.dashboard.back.dto.levelhierarchy; + +import com.dongjian.dashboard.back.dto.BaseSearchParams; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Getter; +import lombok.Setter; + +/** +* @author Mr.zhc +* @time 2022年7月27日12:06:35 +*/ +@Setter +@Getter +public class PageLevelHierarchyRoleSearchParam extends BaseSearchParams{ + + @Schema(description = "名称",example = "test", required = false) + private String name; + +} diff --git a/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/levelhierarchy/PageLevelHierarchySearchParam.java b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/levelhierarchy/PageLevelHierarchySearchParam.java new file mode 100644 index 0000000..f2753b9 --- /dev/null +++ b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/levelhierarchy/PageLevelHierarchySearchParam.java @@ -0,0 +1,22 @@ +package com.dongjian.dashboard.back.dto.levelhierarchy; + +import com.dongjian.dashboard.back.dto.BaseSearchParams; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Getter; +import lombok.Setter; + +/** +* @author Mr.zhc +* @time 2022年7月27日12:06:35 +*/ +@Setter +@Getter +public class PageLevelHierarchySearchParam extends BaseSearchParams{ + + @Schema(description = "层级名称",example = "test", required = false) + private String levelHierarchyName; + + @Schema(description = "层级类型,BRANCH=支社,STORE=支店,AREA=area,SITE=site",example = "SITE", required = true) + private String type; + +} diff --git a/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/monitoringpointcategory/DeleteMonitoringPointCategoryParams.java b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/monitoringpointcategory/DeleteMonitoringPointCategoryParams.java new file mode 100644 index 0000000..db1cf99 --- /dev/null +++ b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/monitoringpointcategory/DeleteMonitoringPointCategoryParams.java @@ -0,0 +1,12 @@ +package com.dongjian.dashboard.back.dto.monitoringpointcategory; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +@Data +public class DeleteMonitoringPointCategoryParams{ + + @Schema(description = "组ID,多个使用半角字符逗号连接",example = "27,587") + private String monitoringPointCategoryIds; + +} diff --git a/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/monitoringpointcategory/MonitoringPointCategorySearchParams.java b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/monitoringpointcategory/MonitoringPointCategorySearchParams.java new file mode 100644 index 0000000..daa81f1 --- /dev/null +++ b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/monitoringpointcategory/MonitoringPointCategorySearchParams.java @@ -0,0 +1,25 @@ +package com.dongjian.dashboard.back.dto.monitoringpointcategory; + +import com.dongjian.dashboard.back.dto.BaseSearchParams; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.List; + + +@EqualsAndHashCode(callSuper = true) +@Data +public class MonitoringPointCategorySearchParams extends BaseSearchParams { + + + @Schema(description = "组名",example = "张三李四") + private String name; + + @Schema(description = "组id,多个逗号连接",example = "1,47") + private String monitoringPointCategoryIds; + + @Schema(description = "组id", hidden = true) + private List monitoringPointCategoryIdList; + +} diff --git a/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/monitoringpointcategory/OptMonitoringPointCategoryParams.java b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/monitoringpointcategory/OptMonitoringPointCategoryParams.java new file mode 100644 index 0000000..47ddcf3 --- /dev/null +++ b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/monitoringpointcategory/OptMonitoringPointCategoryParams.java @@ -0,0 +1,29 @@ +package com.dongjian.dashboard.back.dto.monitoringpointcategory; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + + +@Data +public class OptMonitoringPointCategoryParams{ + + @Schema(description = "唯一标识ID,新增时无此参数",example = "2738967") + private Long monitoringPointCategoryId; + + @Schema(description = "所属企业ID",example = "2738967", hidden = true) + private Long companyId; + + @Schema(description = "组名",example = "testMonitoringPointCategory1", required = true) + private String name; + + @Schema(description = "remark", example = "remark") + private String remark; + + @Schema(description = "正常图标", example = "data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAnormal") + private String thumbnailNormalBase64; + + @Schema(description = "告警图标", example = "data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAalarm") + private String thumbnailAlarmBase64; + + +} diff --git a/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/monitoringpointcategorygroup/BindCategoryForGroupParams.java b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/monitoringpointcategorygroup/BindCategoryForGroupParams.java new file mode 100644 index 0000000..2e6f4d9 --- /dev/null +++ b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/monitoringpointcategorygroup/BindCategoryForGroupParams.java @@ -0,0 +1,16 @@ +package com.dongjian.dashboard.back.dto.monitoringpointcategorygroup; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + + +@Data +public class BindCategoryForGroupParams { + + @Schema(description = "组ID",example = "27,587") + private Long monitoringPointCategoryGroupId; + + @Schema(description = "分类主键ID,多个使用半角字符逗号连接,注意不是设备ID") + private String monitoringPointCategoryIds; + +} diff --git a/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/monitoringpointcategorygroup/BindGroupForCategoryParams.java b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/monitoringpointcategorygroup/BindGroupForCategoryParams.java new file mode 100644 index 0000000..7a646b5 --- /dev/null +++ b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/monitoringpointcategorygroup/BindGroupForCategoryParams.java @@ -0,0 +1,16 @@ +package com.dongjian.dashboard.back.dto.monitoringpointcategorygroup; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + + +@Data +public class BindGroupForCategoryParams { + + @Schema(description = "组ID,多个使用半角字符逗号连接",example = "27,587") + private String monitoringPointCategoryGroupIds; + + @Schema(description = "分类主键ID,注意不是设备ID") + private Long monitoringPointCategoryId; + +} diff --git a/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/monitoringpointcategorygroup/DeleteMonitoringPointCategoryGroupParams.java b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/monitoringpointcategorygroup/DeleteMonitoringPointCategoryGroupParams.java new file mode 100644 index 0000000..df143c5 --- /dev/null +++ b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/monitoringpointcategorygroup/DeleteMonitoringPointCategoryGroupParams.java @@ -0,0 +1,12 @@ +package com.dongjian.dashboard.back.dto.monitoringpointcategorygroup; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +@Data +public class DeleteMonitoringPointCategoryGroupParams{ + + @Schema(description = "组ID,多个使用半角字符逗号连接",example = "27,587") + private String monitoringPointCategoryGroupIds; + +} diff --git a/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/monitoringpointcategorygroup/MonitoringPointCategoryGroupSearchParams.java b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/monitoringpointcategorygroup/MonitoringPointCategoryGroupSearchParams.java new file mode 100644 index 0000000..5d6b4a3 --- /dev/null +++ b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/monitoringpointcategorygroup/MonitoringPointCategoryGroupSearchParams.java @@ -0,0 +1,27 @@ +package com.dongjian.dashboard.back.dto.monitoringpointcategorygroup; + +import com.dongjian.dashboard.back.dto.BaseSearchParams; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.List; + + +@EqualsAndHashCode(callSuper = true) +@Data +public class MonitoringPointCategoryGroupSearchParams extends BaseSearchParams { + + @Schema(description = "楼宇ID",example = "222") + private Long buildingId; + + @Schema(description = "组名",example = "张三李四") + private String name; + + @Schema(description = "组id,多个逗号连接",example = "1,47") + private String monitoringPointCategoryGroupIds; + + @Schema(description = "组id", hidden = true) + private List monitoringPointCategoryGroupIdList; + +} diff --git a/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/monitoringpointcategorygroup/OptMonitoringPointCategoryGroupParams.java b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/monitoringpointcategorygroup/OptMonitoringPointCategoryGroupParams.java new file mode 100644 index 0000000..b1cea8c --- /dev/null +++ b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/monitoringpointcategorygroup/OptMonitoringPointCategoryGroupParams.java @@ -0,0 +1,24 @@ +package com.dongjian.dashboard.back.dto.monitoringpointcategorygroup; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + + +@Data +public class OptMonitoringPointCategoryGroupParams{ + + @Schema(description = "唯一标识ID,新增时无此参数",example = "2738967") + private Long monitoringPointCategoryGroupId; + + @Schema(description = "所属企业ID",example = "2738967") + private Long companyId; + + @Schema(description = "楼宇ID",example = "222") + private Long buildingId; + + @Schema(description = "名称",example = "testMonitoringPointCategoryGroup1", required = true) + private String name; + + @Schema(description = "remark", example = "remark") + private String remark; +} diff --git a/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/notificationconfig/DeleteSlackParams.java b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/notificationconfig/DeleteSlackParams.java new file mode 100644 index 0000000..b3827b2 --- /dev/null +++ b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/notificationconfig/DeleteSlackParams.java @@ -0,0 +1,16 @@ +package com.dongjian.dashboard.back.dto.notificationconfig; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** +* @author Mr.Jiang +* @time 2022年7月21日 下午8:50:31 +*/ +@Data +public class DeleteSlackParams{ + + @Schema(description = "Slack IDs, separated by commas", example = "2738967,587") + private String slackIds; + +} diff --git a/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/notificationconfig/DeleteTeamsParams.java b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/notificationconfig/DeleteTeamsParams.java new file mode 100644 index 0000000..0aab3a7 --- /dev/null +++ b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/notificationconfig/DeleteTeamsParams.java @@ -0,0 +1,16 @@ +package com.dongjian.dashboard.back.dto.notificationconfig; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** +* @author Mr.Jiang +* @time 2022年7月21日 下午8:50:31 +*/ +@Data +public class DeleteTeamsParams{ + + @Schema(description = "Teams IDs, separated by commas", example = "2738967,587") + private String teamsIds; + +} diff --git a/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/notificationconfig/OptSlackParams.java b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/notificationconfig/OptSlackParams.java new file mode 100644 index 0000000..b61b120 --- /dev/null +++ b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/notificationconfig/OptSlackParams.java @@ -0,0 +1,28 @@ +package com.dongjian.dashboard.back.dto.notificationconfig; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** +* @author Mr.Jiang +* @time 2022年7月21日 下午8:50:31 +*/ +@Data +public class OptSlackParams{ + + @Schema(description = "Slack unique identifier ID, not required for new entries", example = "2738967") + private Long slackId; + + @Schema(description = "Company ID", example = "2738967", hidden = true) + private Long companyId; + + @Schema(description = "unique identification", example = "testSlack1", required = true) + private String identity; + + @Schema(description = "webhook info", example = "webhook", required = true) + private String webhook; + + @Schema(description = "remark", example = "remark") + private String remark; + +} diff --git a/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/notificationconfig/OptTeamsParams.java b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/notificationconfig/OptTeamsParams.java new file mode 100644 index 0000000..d916717 --- /dev/null +++ b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/notificationconfig/OptTeamsParams.java @@ -0,0 +1,28 @@ +package com.dongjian.dashboard.back.dto.notificationconfig; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** +* @author Mr.Jiang +* @time 2022年7月21日 下午8:50:31 +*/ +@Data +public class OptTeamsParams{ + + @Schema(description = "Teams unique identifier ID, not required for new entries", example = "2738967") + private Long teamsId; + + @Schema(description = "Company ID", example = "2738967", hidden = true) + private Long companyId; + + @Schema(description = "unique identification", example = "testTeams1", required = true) + private String identity; + + @Schema(description = "webhook info", example = "webhook", required = true) + private String webhook; + + @Schema(description = "remark", example = "remark") + private String remark; + +} diff --git a/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/notificationconfig/SlackSearchParams.java b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/notificationconfig/SlackSearchParams.java new file mode 100644 index 0000000..96edbb5 --- /dev/null +++ b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/notificationconfig/SlackSearchParams.java @@ -0,0 +1,26 @@ +package com.dongjian.dashboard.back.dto.notificationconfig; + +import java.util.List; + +import com.dongjian.dashboard.back.dto.BaseSearchParams; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** +* @author Mr.Jiang +* @time 2022年7月21日 下午8:50:31 +*/ +@Data +public class SlackSearchParams extends BaseSearchParams{ + + @Schema(description = "unique identification", example = "testSlack1", required = true) + private String identity; + + @Schema(description = "Slack IDs, comma-separated", example = "1,47") + private String slackIds; + + @Schema(description = "Slack ID list", hidden = true) + private List slackIdList; + +} diff --git a/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/notificationconfig/TeamsSearchParams.java b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/notificationconfig/TeamsSearchParams.java new file mode 100644 index 0000000..a895692 --- /dev/null +++ b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/notificationconfig/TeamsSearchParams.java @@ -0,0 +1,26 @@ +package com.dongjian.dashboard.back.dto.notificationconfig; + +import java.util.List; + +import com.dongjian.dashboard.back.dto.BaseSearchParams; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** +* @author Mr.Jiang +* @time 2022年7月21日 下午8:50:31 +*/ +@Data +public class TeamsSearchParams extends BaseSearchParams{ + + @Schema(description = "unique identification", example = "testTeams1", required = true) + private String identity; + + @Schema(description = "Teams IDs, comma-separated", example = "1,47") + private String teamsIds; + + @Schema(description = "Teams ID list", hidden = true) + private List teamsIdList; + +} diff --git a/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/operationlog/LogSearchParam.java b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/operationlog/LogSearchParam.java new file mode 100644 index 0000000..3e94326 --- /dev/null +++ b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/operationlog/LogSearchParam.java @@ -0,0 +1,19 @@ +package com.dongjian.dashboard.back.dto.operationlog; + +import com.dongjian.dashboard.back.dto.BaseSearchParams; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Getter; +import lombok.Setter; + +@Setter +@Getter +public class LogSearchParam extends BaseSearchParams{ + + @Schema(description = "起始时间",example = "1760000000000", required = false) + private Long startTime; + + @Schema(description = "截止时间",example = "1770000000000", required = false) + private Long endTime; + + +} diff --git a/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/project/DeleteProjectParams.java b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/project/DeleteProjectParams.java new file mode 100644 index 0000000..0f96e80 --- /dev/null +++ b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/project/DeleteProjectParams.java @@ -0,0 +1,19 @@ +package com.dongjian.dashboard.back.dto.project; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** +* @author Mr.Jiang +* @time 2022年7月21日 下午8:50:31 +*/ +@Data +public class DeleteProjectParams{ + + @Schema(description = "项目ID,多个使用半角字符逗号连接",example = "27,587") + private String projectIds; + + @Schema(description = "项目所属的企业ID,多个使用半角字符逗号连接",example = "3,4") + private String companyIds; + +} diff --git a/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/project/OptProjectParams.java b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/project/OptProjectParams.java new file mode 100644 index 0000000..bb2cb7a --- /dev/null +++ b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/project/OptProjectParams.java @@ -0,0 +1,24 @@ +package com.dongjian.dashboard.back.dto.project; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** +* @author Mr.Jiang +* @time 2022年7月21日 下午8:50:31 +*/ +@Data +public class OptProjectParams{ + + @Schema(description = "项目唯一标识ID,新增时无此参数",example = "2738967") + private Long projectId; + + @Schema(description = "所属企业ID",example = "2738967") + private Long companyId; + + @Schema(description = "项目名称",example = "testProject1", required = true) + private String projectName; + + @Schema(description = "用户自定义ID",example = "XXXX", required = true) + private String udfProjectId; +} diff --git a/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/project/ProjectSearchParams.java b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/project/ProjectSearchParams.java new file mode 100644 index 0000000..1d98000 --- /dev/null +++ b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/project/ProjectSearchParams.java @@ -0,0 +1,28 @@ +package com.dongjian.dashboard.back.dto.project; + +import java.util.List; + +import com.dongjian.dashboard.back.dto.BaseSearchNoCompanysParams; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** +* @author Mr.Jiang +* @time 2022年7月21日 下午8:50:31 +*/ +@Data +public class ProjectSearchParams extends BaseSearchNoCompanysParams{ + + @Schema(description = "项目名",example = "张三李四") + private String projectName; + + @Schema(description = "项目id,多个逗号连接",example = "1,47") + private String projectIds; + + @Schema(description = "项目id", hidden = true) + private List projectIdList; + + @Schema(description = "企业id", required = true) + private Long companyId; + +} diff --git a/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/role/DeleteRoleParam.java b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/role/DeleteRoleParam.java new file mode 100644 index 0000000..5773df0 --- /dev/null +++ b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/role/DeleteRoleParam.java @@ -0,0 +1,18 @@ +package com.dongjian.dashboard.back.dto.role; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Getter; +import lombok.Setter; + +/** +* @author Mr.Jiang +* @time 2022年4月23日 下午1:59:33 +*/ +@Setter +@Getter +public class DeleteRoleParam { + + @Schema(description = "Id,多个使用逗号连接",example = "3,5", required = true) + private String roleIds; + +} diff --git a/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/role/OptRoleParam.java b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/role/OptRoleParam.java new file mode 100644 index 0000000..c875296 --- /dev/null +++ b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/role/OptRoleParam.java @@ -0,0 +1,32 @@ +package com.dongjian.dashboard.back.dto.role; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Getter; +import lombok.Setter; + +/** +* @author zhc +* @time 2022年6月14日10:56:38 +*/ +@Setter +@Getter +public class OptRoleParam { + + + @Schema(description = "角色ID, 新增时无此参数",example = "111", required = false) + private Long roleId; + + @Schema(description = "角色名称",example = "管理员", required = true) + private String roleName; + + @Schema(description = "描述",example = "这是管理员描述", required = true) + private String description; + + @Schema(description = "菜单权限ID,使用逗号连接",example = "1,4,5,6", required = true) + private String menuIds; + + @Schema(description = "所属企业ID",example = "2", hidden = true) + private Long companyId; + + +} diff --git a/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/role/PageSearchParam.java b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/role/PageSearchParam.java new file mode 100644 index 0000000..2c4a9fd --- /dev/null +++ b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/role/PageSearchParam.java @@ -0,0 +1,21 @@ +package com.dongjian.dashboard.back.dto.role; + +import com.dongjian.dashboard.back.dto.BaseSearchParams; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Getter; +import lombok.Setter; + +/** +* @author Mr.zhc +* @time 2022年7月27日12:06:35 +*/ +@Setter +@Getter +public class PageSearchParam extends BaseSearchParams{ + + @Schema(description = "角色名",example = "test", required = false) + private String roleName; + + +} diff --git a/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/user/DeleteUserParam.java b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/user/DeleteUserParam.java new file mode 100644 index 0000000..7011d98 --- /dev/null +++ b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/user/DeleteUserParam.java @@ -0,0 +1,18 @@ +package com.dongjian.dashboard.back.dto.user; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Getter; +import lombok.Setter; + +/** +* @author Mr.Jiang +* @time 2022年4月23日 下午1:59:33 +*/ +@Setter +@Getter +public class DeleteUserParam { + + @Schema(description = "Id,多个使用逗号连接",example = "3,5", required = true) + private String userIds; + +} diff --git a/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/user/ModifyPassword.java b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/user/ModifyPassword.java new file mode 100644 index 0000000..80be0d2 --- /dev/null +++ b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/user/ModifyPassword.java @@ -0,0 +1,21 @@ +package com.dongjian.dashboard.back.dto.user; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Getter; +import lombok.Setter; + +/** +* @author Mr.Jiang +* @time 2022年4月23日 下午1:59:33 +*/ +@Setter +@Getter +public class ModifyPassword{ + + @Schema(description = "旧密码",example = "haoihg09278", required = true) + private String oldPassword; + + @Schema(description = "新密码",example = "og.ayhgih", required = true) + private String newPassword; + +} diff --git a/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/user/OptUserParam.java b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/user/OptUserParam.java new file mode 100644 index 0000000..e93d317 --- /dev/null +++ b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/user/OptUserParam.java @@ -0,0 +1,41 @@ +package com.dongjian.dashboard.back.dto.user; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Getter; +import lombok.Setter; + +/** +* @author zhc +* @time 2022年6月14日10:56:38 +*/ +@Setter +@Getter +public class OptUserParam { + + + @Schema(description = "用户ID, 新增时无此参数",example = "111", required = false) + private Long userId; + + @Schema(description = "用户类型,1-管理平台用户,2-普通平台用户",example = "2", hidden = true) + private Integer userType; + + @Schema(description = "角色ID",example = "24", required = false) + private Long roleId; + + @Schema(description = "用户名",example = "管理员", required = true) + private String username; + + @Schema(description = "登录名",example = "adminmin", hidden = true) + private String loginName; + + @Schema(description = "用户邮箱",example = "1057897@qq.com", required = true) + private String email; + + @Schema(description = "手机号码,这里要加上国际区号,比如日本是+81,传给后台的就是+81-08041165856,中国是+86,传给后台的就是+86-18841165856",example = "+81-08041165856", required = false) + private String mobileNumber; + + @Schema(description = "所属企业ID",example = "2", hidden = true) + private Long companyId; + + +} diff --git a/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/user/PageSearchParam.java b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/user/PageSearchParam.java new file mode 100644 index 0000000..2b2eb1b --- /dev/null +++ b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/user/PageSearchParam.java @@ -0,0 +1,23 @@ +package com.dongjian.dashboard.back.dto.user; + +import com.dongjian.dashboard.back.dto.BaseSearchParams; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Getter; +import lombok.Setter; + +/** +* @author Mr.zhc +* @time 2022年7月27日12:06:35 +*/ +@Setter +@Getter +public class PageSearchParam extends BaseSearchParams{ + + @Schema(description = "用户名/用户邮箱",example = "test", required = false) + private String keyword; + + @Schema(description = "用户类型,1-管理平台用户,2-普通平台用户",example = "2", required = false) + private Integer userType; + +} diff --git a/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/user/ResetPassword.java b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/user/ResetPassword.java new file mode 100644 index 0000000..4adf179 --- /dev/null +++ b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/user/ResetPassword.java @@ -0,0 +1,21 @@ +package com.dongjian.dashboard.back.dto.user; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Getter; +import lombok.Setter; + +/** +* @author Mr.Jiang +* @time 2022年4月23日 下午1:59:33 +*/ +@Setter +@Getter +public class ResetPassword{ + + @Schema(description = "Id,多个使用逗号连接",example = "3,5", required = true) + private String userIds; + +// @Schema(description = "重置密码方式 1-管理员直接重置密码,账号邮箱接收该密码,2-发送重置密码链接到绑定的账户邮箱中,用户自己重置密码",example = "2", required = true) +// private Integer resetType = 1; + +} diff --git a/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/user/SwitchMfaBind.java b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/user/SwitchMfaBind.java new file mode 100644 index 0000000..3d9fac8 --- /dev/null +++ b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/user/SwitchMfaBind.java @@ -0,0 +1,18 @@ +package com.dongjian.dashboard.back.dto.user; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Getter; +import lombok.Setter; + +/** +* @author Mr.Jiang +* @time 2022年4月23日 下午1:59:33 +*/ +@Setter +@Getter +public class SwitchMfaBind{ + + @Schema(description = "Id,多个使用逗号连接",example = "3,5", required = true) + private String userIds; + +} diff --git a/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/easyexcel/ExportDeviceAccumulateDataDTO.java b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/easyexcel/ExportDeviceAccumulateDataDTO.java new file mode 100644 index 0000000..26e7dfa --- /dev/null +++ b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/easyexcel/ExportDeviceAccumulateDataDTO.java @@ -0,0 +1,40 @@ +package com.dongjian.dashboard.back.easyexcel; + +import com.alibaba.excel.annotation.ExcelProperty; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +@Data +public class ExportDeviceAccumulateDataDTO { + + @ExcelProperty(value = {"上传时间", "Upload Time", "計測日時"}, converter = TimestampConverter.class) + private Long uploadTimestamp; + + @ExcelProperty({"监视点名称", "Monitoring Point Name", "監視点名称"}) + private String monitoringPointName; + + @ExcelProperty({"楼层名称", "Floor Name", "フロア"}) + private String floorName; + + @ExcelProperty({"监控点分类名称", "Monitoring Point Category Name", "分類"}) + private String monitoringPointCategoryName; + + @ExcelProperty({"网关信息名称", "Gateway Info Name", "接続先情報"}) + private String gatewayInfoName; + + @ExcelProperty({"数据提供方名称", "Data Provider Name", "データソース"}) + private String dataProviderName; + + @ExcelProperty({"累积值", "Cumulative Value", "計測値"}) + private String cumulativeValue; + + @ExcelProperty({"昨日值", "Yesterday's Value", "前日値"}) + private String yesterdayValue; + + @ExcelProperty({"去年值", "Last Year's Value", "前年値"}) + private String lastYearValue; + + @ExcelProperty({"单位", "Unit", "単位"}) + private String unit; +} + diff --git a/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/easyexcel/ExportDeviceAlarmDataDTO.java b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/easyexcel/ExportDeviceAlarmDataDTO.java new file mode 100644 index 0000000..741ca37 --- /dev/null +++ b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/easyexcel/ExportDeviceAlarmDataDTO.java @@ -0,0 +1,38 @@ +package com.dongjian.dashboard.back.easyexcel; + +import com.alibaba.excel.annotation.ExcelProperty; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +@Data +public class ExportDeviceAlarmDataDTO { + + @ExcelProperty({"警报级别", "Alert level", "警報レベル"}) + private String alertLevelStr; + + @ExcelProperty(value = {"上传时间", "Upload Time", "計測日時"}, converter = TimestampConverter.class) + private Long uploadTimestamp; + + @ExcelProperty({"监视点名称", "Monitoring Point Name", "監視点名称"}) + private String monitoringPointName; + + @ExcelProperty({"楼层名称", "Floor Name", "フロア"}) + private String floorName; + + @ExcelProperty({"监控点分类名称", "Monitoring Point Category Name", "分類"}) + private String monitoringPointCategoryName; + + @ExcelProperty({"网关信息名称", "Gateway Info Name", "接続先情報"}) + private String gatewayInfoName; + + @ExcelProperty({"数据提供方名称", "Data Provider Name", "データソース"}) + private String dataProviderName; + + @ExcelProperty({"确认状态", "Confirmation Status", "かくにんステータス"}) + private String confirmStatusStr; + + @ExcelProperty({"处理状态", "Handling Status", "処理ステータス"}) + private String handleStatusStr; + +} + diff --git a/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/easyexcel/ExportDeviceBaStatusDataDTO.java b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/easyexcel/ExportDeviceBaStatusDataDTO.java new file mode 100644 index 0000000..faa6afe --- /dev/null +++ b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/easyexcel/ExportDeviceBaStatusDataDTO.java @@ -0,0 +1,40 @@ +package com.dongjian.dashboard.back.easyexcel; + +import com.alibaba.excel.annotation.ExcelProperty; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +@Data +public class ExportDeviceBaStatusDataDTO { + + @ExcelProperty(value = {"上传时间", "Upload Time", "計測日時"}, converter = TimestampConverter.class) + private Long uploadTimestamp; + + @ExcelProperty({"监视点名称", "Monitoring Point Name", "監視点名称"}) + private String monitoringPointName; + + @ExcelProperty({"楼层名称", "Floor Name", "フロア"}) + private String floorName; + + @ExcelProperty({"监控点分类名称", "Monitoring Point Category Name", "分類"}) + private String monitoringPointCategoryName; + + @ExcelProperty({"网关信息名称", "Gateway Info Name", "接続先情報"}) + private String gatewayInfoName; + + @ExcelProperty({"数据提供方名称", "Data Provider Name", "データソース"}) + private String dataProviderName; + + @ExcelProperty(value = {"运行状态", "Running status", "状態"}, converter = RunningStatusConverter.class) + private Integer runningStatus; + + @ExcelProperty(value = {"上次运行时间", "Last start time", "前回ON"}, converter = TimestampConverter.class) + private Long lastStartTime; + + @ExcelProperty(value = {"上次停止时间", "Last stop time", "前回OFF"}, converter = TimestampConverter.class) + private Long lastStopTime; + + @ExcelProperty(value = {"持续运行时间", "Continuous running time", "稼働時間"}) + private String continuousRunningTimeStr; +} + diff --git a/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/easyexcel/ExportDeviceMeasureDataDTO.java b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/easyexcel/ExportDeviceMeasureDataDTO.java new file mode 100644 index 0000000..e1118fb --- /dev/null +++ b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/easyexcel/ExportDeviceMeasureDataDTO.java @@ -0,0 +1,39 @@ +package com.dongjian.dashboard.back.easyexcel; + +import com.alibaba.excel.annotation.ExcelProperty; +import lombok.Data; + +@Data +public class ExportDeviceMeasureDataDTO { + + @ExcelProperty(value = {"上传时间", "Upload Time", "計測日時"}, converter = TimestampConverter.class) + private Long uploadTimestamp; + + @ExcelProperty({"监视点名称", "Monitoring Point Name", "監視点名称"}) + private String monitoringPointName; + + @ExcelProperty({"楼层名称", "Floor Name", "フロア"}) + private String floorName; + + @ExcelProperty({"监控点分类名称", "Monitoring Point Category Name", "分類"}) + private String monitoringPointCategoryName; + + @ExcelProperty({"网关信息名称", "Gateway Info Name", "接続先情報"}) + private String gatewayInfoName; + + @ExcelProperty({"数据提供方名称", "Data Provider Name", "データソース"}) + private String dataProviderName; + + @ExcelProperty({"测量值", "Measurement value", "計測値"}) + private String measurementValue; + + @ExcelProperty({"昨日值", "Yesterday's Value", "前日値"}) + private String yesterdayValue; + + @ExcelProperty({"去年值", "Last Year's Value", "前年値"}) + private String lastYearValue; + + @ExcelProperty({"单位", "Unit", "単位"}) + private String unit; +} + diff --git a/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/easyexcel/LanguageDynamicHeaderAdapter.java b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/easyexcel/LanguageDynamicHeaderAdapter.java new file mode 100644 index 0000000..52776de --- /dev/null +++ b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/easyexcel/LanguageDynamicHeaderAdapter.java @@ -0,0 +1,27 @@ +package com.dongjian.dashboard.back.easyexcel; + +import com.alibaba.excel.annotation.ExcelProperty; + +import java.lang.reflect.Field; +import java.util.ArrayList; +import java.util.List; + +public class LanguageDynamicHeaderAdapter { + + public static List> buildHead(Class clazz, int languageType) { + List> head = new ArrayList<>(); + Field[] fields = clazz.getDeclaredFields(); + for (Field f : fields) { + ExcelProperty prop = f.getAnnotation(ExcelProperty.class); + if (prop != null) { + String[] titles = prop.value(); + if (titles.length > languageType) { + head.add(List.of(titles[languageType])); + } else { + head.add(List.of(titles[0])); + } + } + } + return head; + } +} diff --git a/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/easyexcel/RunningStatusConverter.java b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/easyexcel/RunningStatusConverter.java new file mode 100644 index 0000000..13a6e5a --- /dev/null +++ b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/easyexcel/RunningStatusConverter.java @@ -0,0 +1,34 @@ +package com.dongjian.dashboard.back.easyexcel; + +import com.alibaba.excel.converters.Converter; +import com.alibaba.excel.enums.CellDataTypeEnum; +import com.alibaba.excel.metadata.data.WriteCellData; +import com.alibaba.excel.metadata.property.ExcelContentProperty; + +public class RunningStatusConverter implements Converter { + + @Override + public Class supportJavaTypeKey() { + return Integer.class; + } + + @Override + public CellDataTypeEnum supportExcelTypeKey() { + return CellDataTypeEnum.STRING; + } + + @Override + public WriteCellData convertToExcelData(Integer value, + ExcelContentProperty contentProperty, + com.alibaba.excel.metadata.GlobalConfiguration globalConfiguration) { + if (value == null) { + return new WriteCellData<>(""); + } + String statusText = switch (value) { + case 0 -> "停止中"; + case 1 -> "運転中"; + default -> "未知"; + }; + return new WriteCellData<>(statusText); + } +} diff --git a/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/easyexcel/SecondsToHMSConverter.java b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/easyexcel/SecondsToHMSConverter.java new file mode 100644 index 0000000..2e85b4d --- /dev/null +++ b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/easyexcel/SecondsToHMSConverter.java @@ -0,0 +1,47 @@ +package com.dongjian.dashboard.back.easyexcel; + +import com.alibaba.excel.converters.Converter; +import com.alibaba.excel.enums.CellDataTypeEnum; +import com.alibaba.excel.metadata.data.WriteCellData; +import com.alibaba.excel.metadata.property.ExcelContentProperty; + +public class SecondsToHMSConverter implements Converter { + + @Override + public Class supportJavaTypeKey() { + return Long.class; + } + + @Override + public CellDataTypeEnum supportExcelTypeKey() { + return CellDataTypeEnum.STRING; + } + + @Override + public WriteCellData convertToExcelData(Long value, + ExcelContentProperty contentProperty, + com.alibaba.excel.metadata.GlobalConfiguration globalConfiguration) { + return new WriteCellData<>(covertSeconds(value)); + } + + public static String covertSeconds(Long value) { + + if (null == value) return ""; + + long hours = value / 3600; + long minutes = (value % 3600) / 60; + long seconds = value % 60; + + StringBuilder sb = new StringBuilder(); + if (hours > 0) { + sb.append(hours).append("時間"); + } + if (minutes > 0 || hours > 0) { + sb.append(minutes).append("分"); + } + sb.append(seconds).append("秒"); + return sb.toString(); + } + + +} diff --git a/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/easyexcel/TimestampConverter.java b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/easyexcel/TimestampConverter.java new file mode 100644 index 0000000..9b8c78a --- /dev/null +++ b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/easyexcel/TimestampConverter.java @@ -0,0 +1,38 @@ +package com.dongjian.dashboard.back.easyexcel; + +import com.alibaba.excel.converters.Converter; +import com.alibaba.excel.enums.CellDataTypeEnum; +import com.alibaba.excel.metadata.data.WriteCellData; +import com.alibaba.excel.metadata.property.ExcelContentProperty; + +import java.time.Instant; +import java.time.LocalDateTime; +import java.time.ZoneId; +import java.time.format.DateTimeFormatter; + +public class TimestampConverter implements Converter { + + private static final DateTimeFormatter FORMATTER = DateTimeFormatter.ofPattern("yyyy/MM/dd HH:mm:ss"); + + @Override + public Class supportJavaTypeKey() { + return Long.class; + } + + @Override + public CellDataTypeEnum supportExcelTypeKey() { + return CellDataTypeEnum.STRING; + } + + @Override + public WriteCellData convertToExcelData(Long value, + ExcelContentProperty contentProperty, + com.alibaba.excel.metadata.GlobalConfiguration globalConfiguration) { + if (value == null) { + return new WriteCellData<>(""); + } + String formatted = LocalDateTime.ofInstant(Instant.ofEpochMilli(value), ZoneId.systemDefault()) + .format(FORMATTER); + return new WriteCellData<>(formatted); + } +} diff --git a/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/enums/AlertNotificationMethod.java b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/enums/AlertNotificationMethod.java new file mode 100644 index 0000000..67fc47a --- /dev/null +++ b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/enums/AlertNotificationMethod.java @@ -0,0 +1,27 @@ +package com.dongjian.dashboard.back.enums; + +public enum AlertNotificationMethod { + api("api"), + mail("mail"), + apiAndMail("api&mail"); + + private final String value; + + AlertNotificationMethod(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + // 可选:根据字符串值找到对应的枚举值 + public static AlertNotificationMethod fromString(String text) { + for (AlertNotificationMethod method : AlertNotificationMethod.values()) { + if (method.value.equalsIgnoreCase(text)) { + return method; + } + } + throw new IllegalArgumentException("No constant with text " + text + " found"); + } +} \ No newline at end of file diff --git a/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/enums/DataSourceMethodEnum.java b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/enums/DataSourceMethodEnum.java new file mode 100644 index 0000000..4a38457 --- /dev/null +++ b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/enums/DataSourceMethodEnum.java @@ -0,0 +1,20 @@ +package com.dongjian.dashboard.back.enums; + +public enum DataSourceMethodEnum { + + MQTT("0"), + RESTFUL("1"); + + private String methodType; + DataSourceMethodEnum(String methodType) { + this.methodType = methodType; + } + + public String getMethodType() { + return methodType; + } + + public void setMethodType(String methodType) { + this.methodType = methodType; + } +} diff --git a/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/enums/DataSourceStateEnum.java b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/enums/DataSourceStateEnum.java new file mode 100644 index 0000000..8951758 --- /dev/null +++ b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/enums/DataSourceStateEnum.java @@ -0,0 +1,21 @@ +package com.dongjian.dashboard.back.enums; + +public enum DataSourceStateEnum { + + ACTIVATE("0"), + FREEZE("1"); + + + private String state; + + DataSourceStateEnum(String state) { + this.state = state; + } + + public String getState() { + return state; + } + + + +} diff --git a/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/model/AlertHandleHistory.java b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/model/AlertHandleHistory.java new file mode 100644 index 0000000..11cee91 --- /dev/null +++ b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/model/AlertHandleHistory.java @@ -0,0 +1,336 @@ +package com.dongjian.dashboard.back.model; + +import java.io.Serializable; + +public class AlertHandleHistory implements Serializable { + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column alert_handle_history.id + * + * @mbg.generated + */ + private Long id; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column alert_handle_history.alert_history_id + * + * @mbg.generated + */ + private Long alertHistoryId; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column alert_handle_history.device_id + * + * @mbg.generated + */ + private String deviceId; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column alert_handle_history.last_status + * + * @mbg.generated + */ + private Integer lastStatus; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column alert_handle_history.status + * + * @mbg.generated + */ + private Integer status; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column alert_handle_history.handler + * + * @mbg.generated + */ + private String handler; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column alert_handle_history.alert_status + * + * @mbg.generated + */ + private Integer alertStatus; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column alert_handle_history.handle_at + * + * @mbg.generated + */ + private Long handleAt; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column alert_handle_history.remark + * + * @mbg.generated + */ + private String remark; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database table alert_handle_history + * + * @mbg.generated + */ + private static final long serialVersionUID = 1L; + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column alert_handle_history.id + * + * @return the value of alert_handle_history.id + * + * @mbg.generated + */ + public Long getId() { + return id; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column alert_handle_history.id + * + * @param id the value for alert_handle_history.id + * + * @mbg.generated + */ + public void setId(Long id) { + this.id = id; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column alert_handle_history.alert_history_id + * + * @return the value of alert_handle_history.alert_history_id + * + * @mbg.generated + */ + public Long getAlertHistoryId() { + return alertHistoryId; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column alert_handle_history.alert_history_id + * + * @param alertHistoryId the value for alert_handle_history.alert_history_id + * + * @mbg.generated + */ + public void setAlertHistoryId(Long alertHistoryId) { + this.alertHistoryId = alertHistoryId; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column alert_handle_history.device_id + * + * @return the value of alert_handle_history.device_id + * + * @mbg.generated + */ + public String getDeviceId() { + return deviceId; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column alert_handle_history.device_id + * + * @param deviceId the value for alert_handle_history.device_id + * + * @mbg.generated + */ + public void setDeviceId(String deviceId) { + this.deviceId = deviceId == null ? null : deviceId.trim(); + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column alert_handle_history.last_status + * + * @return the value of alert_handle_history.last_status + * + * @mbg.generated + */ + public Integer getLastStatus() { + return lastStatus; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column alert_handle_history.last_status + * + * @param lastStatus the value for alert_handle_history.last_status + * + * @mbg.generated + */ + public void setLastStatus(Integer lastStatus) { + this.lastStatus = lastStatus; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column alert_handle_history.status + * + * @return the value of alert_handle_history.status + * + * @mbg.generated + */ + public Integer getStatus() { + return status; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column alert_handle_history.status + * + * @param status the value for alert_handle_history.status + * + * @mbg.generated + */ + public void setStatus(Integer status) { + this.status = status; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column alert_handle_history.handler + * + * @return the value of alert_handle_history.handler + * + * @mbg.generated + */ + public String getHandler() { + return handler; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column alert_handle_history.handler + * + * @param handler the value for alert_handle_history.handler + * + * @mbg.generated + */ + public void setHandler(String handler) { + this.handler = handler == null ? null : handler.trim(); + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column alert_handle_history.alert_status + * + * @return the value of alert_handle_history.alert_status + * + * @mbg.generated + */ + public Integer getAlertStatus() { + return alertStatus; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column alert_handle_history.alert_status + * + * @param alertStatus the value for alert_handle_history.alert_status + * + * @mbg.generated + */ + public void setAlertStatus(Integer alertStatus) { + this.alertStatus = alertStatus; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column alert_handle_history.handle_at + * + * @return the value of alert_handle_history.handle_at + * + * @mbg.generated + */ + public Long getHandleAt() { + return handleAt; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column alert_handle_history.handle_at + * + * @param handleAt the value for alert_handle_history.handle_at + * + * @mbg.generated + */ + public void setHandleAt(Long handleAt) { + this.handleAt = handleAt; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column alert_handle_history.remark + * + * @return the value of alert_handle_history.remark + * + * @mbg.generated + */ + public String getRemark() { + return remark; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column alert_handle_history.remark + * + * @param remark the value for alert_handle_history.remark + * + * @mbg.generated + */ + public void setRemark(String remark) { + this.remark = remark == null ? null : remark.trim(); + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table alert_handle_history + * + * @mbg.generated + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append(getClass().getSimpleName()); + sb.append(" ["); + sb.append("Hash = ").append(hashCode()); + sb.append(", id=").append(id); + sb.append(", alertHistoryId=").append(alertHistoryId); + sb.append(", deviceId=").append(deviceId); + sb.append(", lastStatus=").append(lastStatus); + sb.append(", status=").append(status); + sb.append(", handler=").append(handler); + sb.append(", alertStatus=").append(alertStatus); + sb.append(", handleAt=").append(handleAt); + sb.append(", remark=").append(remark); + sb.append(", serialVersionUID=").append(serialVersionUID); + sb.append("]"); + return sb.toString(); + } +} \ No newline at end of file diff --git a/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/model/AlertHandleHistoryExample.java b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/model/AlertHandleHistoryExample.java new file mode 100644 index 0000000..856ad98 --- /dev/null +++ b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/model/AlertHandleHistoryExample.java @@ -0,0 +1,802 @@ +package com.dongjian.dashboard.back.model; + +import java.util.ArrayList; +import java.util.List; + +public class AlertHandleHistoryExample { + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database table alert_handle_history + * + * @mbg.generated + */ + protected String orderByClause; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database table alert_handle_history + * + * @mbg.generated + */ + protected boolean distinct; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database table alert_handle_history + * + * @mbg.generated + */ + protected List oredCriteria; + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table alert_handle_history + * + * @mbg.generated + */ + public AlertHandleHistoryExample() { + oredCriteria = new ArrayList(); + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table alert_handle_history + * + * @mbg.generated + */ + public void setOrderByClause(String orderByClause) { + this.orderByClause = orderByClause; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table alert_handle_history + * + * @mbg.generated + */ + public String getOrderByClause() { + return orderByClause; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table alert_handle_history + * + * @mbg.generated + */ + public void setDistinct(boolean distinct) { + this.distinct = distinct; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table alert_handle_history + * + * @mbg.generated + */ + public boolean isDistinct() { + return distinct; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table alert_handle_history + * + * @mbg.generated + */ + public List getOredCriteria() { + return oredCriteria; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table alert_handle_history + * + * @mbg.generated + */ + public void or(Criteria criteria) { + oredCriteria.add(criteria); + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table alert_handle_history + * + * @mbg.generated + */ + public Criteria or() { + Criteria criteria = createCriteriaInternal(); + oredCriteria.add(criteria); + return criteria; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table alert_handle_history + * + * @mbg.generated + */ + public Criteria createCriteria() { + Criteria criteria = createCriteriaInternal(); + if (oredCriteria.size() == 0) { + oredCriteria.add(criteria); + } + return criteria; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table alert_handle_history + * + * @mbg.generated + */ + protected Criteria createCriteriaInternal() { + Criteria criteria = new Criteria(); + return criteria; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table alert_handle_history + * + * @mbg.generated + */ + public void clear() { + oredCriteria.clear(); + orderByClause = null; + distinct = false; + } + + /** + * This class was generated by MyBatis Generator. + * This class corresponds to the database table alert_handle_history + * + * @mbg.generated + */ + protected abstract static class GeneratedCriteria { + protected List criteria; + + protected GeneratedCriteria() { + super(); + criteria = new ArrayList(); + } + + public boolean isValid() { + return criteria.size() > 0; + } + + public List getAllCriteria() { + return criteria; + } + + public List getCriteria() { + return criteria; + } + + protected void addCriterion(String condition) { + if (condition == null) { + throw new RuntimeException("Value for condition cannot be null"); + } + criteria.add(new Criterion(condition)); + } + + protected void addCriterion(String condition, Object value, String property) { + if (value == null) { + throw new RuntimeException("Value for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value)); + } + + protected void addCriterion(String condition, Object value1, Object value2, String property) { + if (value1 == null || value2 == null) { + throw new RuntimeException("Between values for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value1, value2)); + } + + public Criteria andIdIsNull() { + addCriterion("id is null"); + return (Criteria) this; + } + + public Criteria andIdIsNotNull() { + addCriterion("id is not null"); + return (Criteria) this; + } + + public Criteria andIdEqualTo(Long value) { + addCriterion("id =", value, "id"); + return (Criteria) this; + } + + public Criteria andIdNotEqualTo(Long value) { + addCriterion("id <>", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThan(Long value) { + addCriterion("id >", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThanOrEqualTo(Long value) { + addCriterion("id >=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThan(Long value) { + addCriterion("id <", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThanOrEqualTo(Long value) { + addCriterion("id <=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdIn(List values) { + addCriterion("id in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdNotIn(List values) { + addCriterion("id not in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdBetween(Long value1, Long value2) { + addCriterion("id between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andIdNotBetween(Long value1, Long value2) { + addCriterion("id not between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andAlertHistoryIdIsNull() { + addCriterion("alert_history_id is null"); + return (Criteria) this; + } + + public Criteria andAlertHistoryIdIsNotNull() { + addCriterion("alert_history_id is not null"); + return (Criteria) this; + } + + public Criteria andAlertHistoryIdEqualTo(Long value) { + addCriterion("alert_history_id =", value, "alertHistoryId"); + return (Criteria) this; + } + + public Criteria andAlertHistoryIdNotEqualTo(Long value) { + addCriterion("alert_history_id <>", value, "alertHistoryId"); + return (Criteria) this; + } + + public Criteria andAlertHistoryIdGreaterThan(Long value) { + addCriterion("alert_history_id >", value, "alertHistoryId"); + return (Criteria) this; + } + + public Criteria andAlertHistoryIdGreaterThanOrEqualTo(Long value) { + addCriterion("alert_history_id >=", value, "alertHistoryId"); + return (Criteria) this; + } + + public Criteria andAlertHistoryIdLessThan(Long value) { + addCriterion("alert_history_id <", value, "alertHistoryId"); + return (Criteria) this; + } + + public Criteria andAlertHistoryIdLessThanOrEqualTo(Long value) { + addCriterion("alert_history_id <=", value, "alertHistoryId"); + return (Criteria) this; + } + + public Criteria andAlertHistoryIdIn(List values) { + addCriterion("alert_history_id in", values, "alertHistoryId"); + return (Criteria) this; + } + + public Criteria andAlertHistoryIdNotIn(List values) { + addCriterion("alert_history_id not in", values, "alertHistoryId"); + return (Criteria) this; + } + + public Criteria andAlertHistoryIdBetween(Long value1, Long value2) { + addCriterion("alert_history_id between", value1, value2, "alertHistoryId"); + return (Criteria) this; + } + + public Criteria andAlertHistoryIdNotBetween(Long value1, Long value2) { + addCriterion("alert_history_id not between", value1, value2, "alertHistoryId"); + return (Criteria) this; + } + + public Criteria andDeviceIdIsNull() { + addCriterion("device_id is null"); + return (Criteria) this; + } + + public Criteria andDeviceIdIsNotNull() { + addCriterion("device_id is not null"); + return (Criteria) this; + } + + public Criteria andDeviceIdEqualTo(String value) { + addCriterion("device_id =", value, "deviceId"); + return (Criteria) this; + } + + public Criteria andDeviceIdNotEqualTo(String value) { + addCriterion("device_id <>", value, "deviceId"); + return (Criteria) this; + } + + public Criteria andDeviceIdGreaterThan(String value) { + addCriterion("device_id >", value, "deviceId"); + return (Criteria) this; + } + + public Criteria andDeviceIdGreaterThanOrEqualTo(String value) { + addCriterion("device_id >=", value, "deviceId"); + return (Criteria) this; + } + + public Criteria andDeviceIdLessThan(String value) { + addCriterion("device_id <", value, "deviceId"); + return (Criteria) this; + } + + public Criteria andDeviceIdLessThanOrEqualTo(String value) { + addCriterion("device_id <=", value, "deviceId"); + return (Criteria) this; + } + + public Criteria andDeviceIdLike(String value) { + addCriterion("device_id like", value, "deviceId"); + return (Criteria) this; + } + + public Criteria andDeviceIdNotLike(String value) { + addCriterion("device_id not like", value, "deviceId"); + return (Criteria) this; + } + + public Criteria andDeviceIdIn(List values) { + addCriterion("device_id in", values, "deviceId"); + return (Criteria) this; + } + + public Criteria andDeviceIdNotIn(List values) { + addCriterion("device_id not in", values, "deviceId"); + return (Criteria) this; + } + + public Criteria andDeviceIdBetween(String value1, String value2) { + addCriterion("device_id between", value1, value2, "deviceId"); + return (Criteria) this; + } + + public Criteria andDeviceIdNotBetween(String value1, String value2) { + addCriterion("device_id not between", value1, value2, "deviceId"); + return (Criteria) this; + } + + public Criteria andLastStatusIsNull() { + addCriterion("last_status is null"); + return (Criteria) this; + } + + public Criteria andLastStatusIsNotNull() { + addCriterion("last_status is not null"); + return (Criteria) this; + } + + public Criteria andLastStatusEqualTo(Integer value) { + addCriterion("last_status =", value, "lastStatus"); + return (Criteria) this; + } + + public Criteria andLastStatusNotEqualTo(Integer value) { + addCriterion("last_status <>", value, "lastStatus"); + return (Criteria) this; + } + + public Criteria andLastStatusGreaterThan(Integer value) { + addCriterion("last_status >", value, "lastStatus"); + return (Criteria) this; + } + + public Criteria andLastStatusGreaterThanOrEqualTo(Integer value) { + addCriterion("last_status >=", value, "lastStatus"); + return (Criteria) this; + } + + public Criteria andLastStatusLessThan(Integer value) { + addCriterion("last_status <", value, "lastStatus"); + return (Criteria) this; + } + + public Criteria andLastStatusLessThanOrEqualTo(Integer value) { + addCriterion("last_status <=", value, "lastStatus"); + return (Criteria) this; + } + + public Criteria andLastStatusIn(List values) { + addCriterion("last_status in", values, "lastStatus"); + return (Criteria) this; + } + + public Criteria andLastStatusNotIn(List values) { + addCriterion("last_status not in", values, "lastStatus"); + return (Criteria) this; + } + + public Criteria andLastStatusBetween(Integer value1, Integer value2) { + addCriterion("last_status between", value1, value2, "lastStatus"); + return (Criteria) this; + } + + public Criteria andLastStatusNotBetween(Integer value1, Integer value2) { + addCriterion("last_status not between", value1, value2, "lastStatus"); + return (Criteria) this; + } + + public Criteria andStatusIsNull() { + addCriterion("`status` is null"); + return (Criteria) this; + } + + public Criteria andStatusIsNotNull() { + addCriterion("`status` is not null"); + return (Criteria) this; + } + + public Criteria andStatusEqualTo(Integer value) { + addCriterion("`status` =", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusNotEqualTo(Integer value) { + addCriterion("`status` <>", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusGreaterThan(Integer value) { + addCriterion("`status` >", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusGreaterThanOrEqualTo(Integer value) { + addCriterion("`status` >=", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusLessThan(Integer value) { + addCriterion("`status` <", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusLessThanOrEqualTo(Integer value) { + addCriterion("`status` <=", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusIn(List values) { + addCriterion("`status` in", values, "status"); + return (Criteria) this; + } + + public Criteria andStatusNotIn(List values) { + addCriterion("`status` not in", values, "status"); + return (Criteria) this; + } + + public Criteria andStatusBetween(Integer value1, Integer value2) { + addCriterion("`status` between", value1, value2, "status"); + return (Criteria) this; + } + + public Criteria andStatusNotBetween(Integer value1, Integer value2) { + addCriterion("`status` not between", value1, value2, "status"); + return (Criteria) this; + } + + public Criteria andHandlerIsNull() { + addCriterion("`handler` is null"); + return (Criteria) this; + } + + public Criteria andHandlerIsNotNull() { + addCriterion("`handler` is not null"); + return (Criteria) this; + } + + public Criteria andHandlerEqualTo(String value) { + addCriterion("`handler` =", value, "handler"); + return (Criteria) this; + } + + public Criteria andHandlerNotEqualTo(String value) { + addCriterion("`handler` <>", value, "handler"); + return (Criteria) this; + } + + public Criteria andHandlerGreaterThan(String value) { + addCriterion("`handler` >", value, "handler"); + return (Criteria) this; + } + + public Criteria andHandlerGreaterThanOrEqualTo(String value) { + addCriterion("`handler` >=", value, "handler"); + return (Criteria) this; + } + + public Criteria andHandlerLessThan(String value) { + addCriterion("`handler` <", value, "handler"); + return (Criteria) this; + } + + public Criteria andHandlerLessThanOrEqualTo(String value) { + addCriterion("`handler` <=", value, "handler"); + return (Criteria) this; + } + + public Criteria andHandlerLike(String value) { + addCriterion("`handler` like", value, "handler"); + return (Criteria) this; + } + + public Criteria andHandlerNotLike(String value) { + addCriterion("`handler` not like", value, "handler"); + return (Criteria) this; + } + + public Criteria andHandlerIn(List values) { + addCriterion("`handler` in", values, "handler"); + return (Criteria) this; + } + + public Criteria andHandlerNotIn(List values) { + addCriterion("`handler` not in", values, "handler"); + return (Criteria) this; + } + + public Criteria andHandlerBetween(String value1, String value2) { + addCriterion("`handler` between", value1, value2, "handler"); + return (Criteria) this; + } + + public Criteria andHandlerNotBetween(String value1, String value2) { + addCriterion("`handler` not between", value1, value2, "handler"); + return (Criteria) this; + } + + public Criteria andAlertStatusIsNull() { + addCriterion("alert_status is null"); + return (Criteria) this; + } + + public Criteria andAlertStatusIsNotNull() { + addCriterion("alert_status is not null"); + return (Criteria) this; + } + + public Criteria andAlertStatusEqualTo(Integer value) { + addCriterion("alert_status =", value, "alertStatus"); + return (Criteria) this; + } + + public Criteria andAlertStatusNotEqualTo(Integer value) { + addCriterion("alert_status <>", value, "alertStatus"); + return (Criteria) this; + } + + public Criteria andAlertStatusGreaterThan(Integer value) { + addCriterion("alert_status >", value, "alertStatus"); + return (Criteria) this; + } + + public Criteria andAlertStatusGreaterThanOrEqualTo(Integer value) { + addCriterion("alert_status >=", value, "alertStatus"); + return (Criteria) this; + } + + public Criteria andAlertStatusLessThan(Integer value) { + addCriterion("alert_status <", value, "alertStatus"); + return (Criteria) this; + } + + public Criteria andAlertStatusLessThanOrEqualTo(Integer value) { + addCriterion("alert_status <=", value, "alertStatus"); + return (Criteria) this; + } + + public Criteria andAlertStatusIn(List values) { + addCriterion("alert_status in", values, "alertStatus"); + return (Criteria) this; + } + + public Criteria andAlertStatusNotIn(List values) { + addCriterion("alert_status not in", values, "alertStatus"); + return (Criteria) this; + } + + public Criteria andAlertStatusBetween(Integer value1, Integer value2) { + addCriterion("alert_status between", value1, value2, "alertStatus"); + return (Criteria) this; + } + + public Criteria andAlertStatusNotBetween(Integer value1, Integer value2) { + addCriterion("alert_status not between", value1, value2, "alertStatus"); + return (Criteria) this; + } + + public Criteria andHandleAtIsNull() { + addCriterion("handle_at is null"); + return (Criteria) this; + } + + public Criteria andHandleAtIsNotNull() { + addCriterion("handle_at is not null"); + return (Criteria) this; + } + + public Criteria andHandleAtEqualTo(Long value) { + addCriterion("handle_at =", value, "handleAt"); + return (Criteria) this; + } + + public Criteria andHandleAtNotEqualTo(Long value) { + addCriterion("handle_at <>", value, "handleAt"); + return (Criteria) this; + } + + public Criteria andHandleAtGreaterThan(Long value) { + addCriterion("handle_at >", value, "handleAt"); + return (Criteria) this; + } + + public Criteria andHandleAtGreaterThanOrEqualTo(Long value) { + addCriterion("handle_at >=", value, "handleAt"); + return (Criteria) this; + } + + public Criteria andHandleAtLessThan(Long value) { + addCriterion("handle_at <", value, "handleAt"); + return (Criteria) this; + } + + public Criteria andHandleAtLessThanOrEqualTo(Long value) { + addCriterion("handle_at <=", value, "handleAt"); + return (Criteria) this; + } + + public Criteria andHandleAtIn(List values) { + addCriterion("handle_at in", values, "handleAt"); + return (Criteria) this; + } + + public Criteria andHandleAtNotIn(List values) { + addCriterion("handle_at not in", values, "handleAt"); + return (Criteria) this; + } + + public Criteria andHandleAtBetween(Long value1, Long value2) { + addCriterion("handle_at between", value1, value2, "handleAt"); + return (Criteria) this; + } + + public Criteria andHandleAtNotBetween(Long value1, Long value2) { + addCriterion("handle_at not between", value1, value2, "handleAt"); + return (Criteria) this; + } + } + + /** + * This class was generated by MyBatis Generator. + * This class corresponds to the database table alert_handle_history + * + * @mbg.generated do_not_delete_during_merge + */ + public static class Criteria extends GeneratedCriteria { + + protected Criteria() { + super(); + } + } + + /** + * This class was generated by MyBatis Generator. + * This class corresponds to the database table alert_handle_history + * + * @mbg.generated + */ + public static class Criterion { + private String condition; + + private Object value; + + private Object secondValue; + + private boolean noValue; + + private boolean singleValue; + + private boolean betweenValue; + + private boolean listValue; + + private String typeHandler; + + public String getCondition() { + return condition; + } + + public Object getValue() { + return value; + } + + public Object getSecondValue() { + return secondValue; + } + + public boolean isNoValue() { + return noValue; + } + + public boolean isSingleValue() { + return singleValue; + } + + public boolean isBetweenValue() { + return betweenValue; + } + + public boolean isListValue() { + return listValue; + } + + public String getTypeHandler() { + return typeHandler; + } + + protected Criterion(String condition) { + super(); + this.condition = condition; + this.typeHandler = null; + this.noValue = true; + } + + protected Criterion(String condition, Object value, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.typeHandler = typeHandler; + if (value instanceof List) { + this.listValue = true; + } else { + this.singleValue = true; + } + } + + protected Criterion(String condition, Object value) { + this(condition, value, null); + } + + protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.secondValue = secondValue; + this.typeHandler = typeHandler; + this.betweenValue = true; + } + + protected Criterion(String condition, Object value, Object secondValue) { + this(condition, value, secondValue, null); + } + } +} \ No newline at end of file diff --git a/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/model/AlertHistory.java b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/model/AlertHistory.java new file mode 100644 index 0000000..89f8883 --- /dev/null +++ b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/model/AlertHistory.java @@ -0,0 +1,268 @@ +package com.dongjian.dashboard.back.model; + +import java.io.Serializable; + +public class AlertHistory implements Serializable { + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column alert_history.id + * + * @mbg.generated + */ + private Long id; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column alert_history.device_id + * + * @mbg.generated + */ + private String deviceId; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column alert_history.receive_ts + * + * @mbg.generated + */ + private Long receiveTs; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column alert_history.confirm_status + * + * @mbg.generated + */ + private Integer confirmStatus; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column alert_history.handle_status + * + * @mbg.generated + */ + private Integer handleStatus; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column alert_history.alert_status + * + * @mbg.generated + */ + private Integer alertStatus; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column alert_history.retain_alert + * + * @mbg.generated + */ + private Integer retainAlert; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database table alert_history + * + * @mbg.generated + */ + private static final long serialVersionUID = 1L; + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column alert_history.id + * + * @return the value of alert_history.id + * + * @mbg.generated + */ + public Long getId() { + return id; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column alert_history.id + * + * @param id the value for alert_history.id + * + * @mbg.generated + */ + public void setId(Long id) { + this.id = id; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column alert_history.device_id + * + * @return the value of alert_history.device_id + * + * @mbg.generated + */ + public String getDeviceId() { + return deviceId; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column alert_history.device_id + * + * @param deviceId the value for alert_history.device_id + * + * @mbg.generated + */ + public void setDeviceId(String deviceId) { + this.deviceId = deviceId == null ? null : deviceId.trim(); + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column alert_history.receive_ts + * + * @return the value of alert_history.receive_ts + * + * @mbg.generated + */ + public Long getReceiveTs() { + return receiveTs; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column alert_history.receive_ts + * + * @param receiveTs the value for alert_history.receive_ts + * + * @mbg.generated + */ + public void setReceiveTs(Long receiveTs) { + this.receiveTs = receiveTs; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column alert_history.confirm_status + * + * @return the value of alert_history.confirm_status + * + * @mbg.generated + */ + public Integer getConfirmStatus() { + return confirmStatus; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column alert_history.confirm_status + * + * @param confirmStatus the value for alert_history.confirm_status + * + * @mbg.generated + */ + public void setConfirmStatus(Integer confirmStatus) { + this.confirmStatus = confirmStatus; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column alert_history.handle_status + * + * @return the value of alert_history.handle_status + * + * @mbg.generated + */ + public Integer getHandleStatus() { + return handleStatus; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column alert_history.handle_status + * + * @param handleStatus the value for alert_history.handle_status + * + * @mbg.generated + */ + public void setHandleStatus(Integer handleStatus) { + this.handleStatus = handleStatus; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column alert_history.alert_status + * + * @return the value of alert_history.alert_status + * + * @mbg.generated + */ + public Integer getAlertStatus() { + return alertStatus; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column alert_history.alert_status + * + * @param alertStatus the value for alert_history.alert_status + * + * @mbg.generated + */ + public void setAlertStatus(Integer alertStatus) { + this.alertStatus = alertStatus; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column alert_history.retain_alert + * + * @return the value of alert_history.retain_alert + * + * @mbg.generated + */ + public Integer getRetainAlert() { + return retainAlert; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column alert_history.retain_alert + * + * @param retainAlert the value for alert_history.retain_alert + * + * @mbg.generated + */ + public void setRetainAlert(Integer retainAlert) { + this.retainAlert = retainAlert; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table alert_history + * + * @mbg.generated + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append(getClass().getSimpleName()); + sb.append(" ["); + sb.append("Hash = ").append(hashCode()); + sb.append(", id=").append(id); + sb.append(", deviceId=").append(deviceId); + sb.append(", receiveTs=").append(receiveTs); + sb.append(", confirmStatus=").append(confirmStatus); + sb.append(", handleStatus=").append(handleStatus); + sb.append(", alertStatus=").append(alertStatus); + sb.append(", retainAlert=").append(retainAlert); + sb.append(", serialVersionUID=").append(serialVersionUID); + sb.append("]"); + return sb.toString(); + } +} \ No newline at end of file diff --git a/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/model/AlertHistoryExample.java b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/model/AlertHistoryExample.java new file mode 100644 index 0000000..60c6023 --- /dev/null +++ b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/model/AlertHistoryExample.java @@ -0,0 +1,732 @@ +package com.dongjian.dashboard.back.model; + +import java.util.ArrayList; +import java.util.List; + +public class AlertHistoryExample { + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database table alert_history + * + * @mbg.generated + */ + protected String orderByClause; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database table alert_history + * + * @mbg.generated + */ + protected boolean distinct; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database table alert_history + * + * @mbg.generated + */ + protected List oredCriteria; + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table alert_history + * + * @mbg.generated + */ + public AlertHistoryExample() { + oredCriteria = new ArrayList(); + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table alert_history + * + * @mbg.generated + */ + public void setOrderByClause(String orderByClause) { + this.orderByClause = orderByClause; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table alert_history + * + * @mbg.generated + */ + public String getOrderByClause() { + return orderByClause; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table alert_history + * + * @mbg.generated + */ + public void setDistinct(boolean distinct) { + this.distinct = distinct; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table alert_history + * + * @mbg.generated + */ + public boolean isDistinct() { + return distinct; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table alert_history + * + * @mbg.generated + */ + public List getOredCriteria() { + return oredCriteria; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table alert_history + * + * @mbg.generated + */ + public void or(Criteria criteria) { + oredCriteria.add(criteria); + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table alert_history + * + * @mbg.generated + */ + public Criteria or() { + Criteria criteria = createCriteriaInternal(); + oredCriteria.add(criteria); + return criteria; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table alert_history + * + * @mbg.generated + */ + public Criteria createCriteria() { + Criteria criteria = createCriteriaInternal(); + if (oredCriteria.size() == 0) { + oredCriteria.add(criteria); + } + return criteria; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table alert_history + * + * @mbg.generated + */ + protected Criteria createCriteriaInternal() { + Criteria criteria = new Criteria(); + return criteria; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table alert_history + * + * @mbg.generated + */ + public void clear() { + oredCriteria.clear(); + orderByClause = null; + distinct = false; + } + + /** + * This class was generated by MyBatis Generator. + * This class corresponds to the database table alert_history + * + * @mbg.generated + */ + protected abstract static class GeneratedCriteria { + protected List criteria; + + protected GeneratedCriteria() { + super(); + criteria = new ArrayList(); + } + + public boolean isValid() { + return criteria.size() > 0; + } + + public List getAllCriteria() { + return criteria; + } + + public List getCriteria() { + return criteria; + } + + protected void addCriterion(String condition) { + if (condition == null) { + throw new RuntimeException("Value for condition cannot be null"); + } + criteria.add(new Criterion(condition)); + } + + protected void addCriterion(String condition, Object value, String property) { + if (value == null) { + throw new RuntimeException("Value for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value)); + } + + protected void addCriterion(String condition, Object value1, Object value2, String property) { + if (value1 == null || value2 == null) { + throw new RuntimeException("Between values for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value1, value2)); + } + + public Criteria andIdIsNull() { + addCriterion("id is null"); + return (Criteria) this; + } + + public Criteria andIdIsNotNull() { + addCriterion("id is not null"); + return (Criteria) this; + } + + public Criteria andIdEqualTo(Long value) { + addCriterion("id =", value, "id"); + return (Criteria) this; + } + + public Criteria andIdNotEqualTo(Long value) { + addCriterion("id <>", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThan(Long value) { + addCriterion("id >", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThanOrEqualTo(Long value) { + addCriterion("id >=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThan(Long value) { + addCriterion("id <", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThanOrEqualTo(Long value) { + addCriterion("id <=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdIn(List values) { + addCriterion("id in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdNotIn(List values) { + addCriterion("id not in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdBetween(Long value1, Long value2) { + addCriterion("id between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andIdNotBetween(Long value1, Long value2) { + addCriterion("id not between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andDeviceIdIsNull() { + addCriterion("device_id is null"); + return (Criteria) this; + } + + public Criteria andDeviceIdIsNotNull() { + addCriterion("device_id is not null"); + return (Criteria) this; + } + + public Criteria andDeviceIdEqualTo(String value) { + addCriterion("device_id =", value, "deviceId"); + return (Criteria) this; + } + + public Criteria andDeviceIdNotEqualTo(String value) { + addCriterion("device_id <>", value, "deviceId"); + return (Criteria) this; + } + + public Criteria andDeviceIdGreaterThan(String value) { + addCriterion("device_id >", value, "deviceId"); + return (Criteria) this; + } + + public Criteria andDeviceIdGreaterThanOrEqualTo(String value) { + addCriterion("device_id >=", value, "deviceId"); + return (Criteria) this; + } + + public Criteria andDeviceIdLessThan(String value) { + addCriterion("device_id <", value, "deviceId"); + return (Criteria) this; + } + + public Criteria andDeviceIdLessThanOrEqualTo(String value) { + addCriterion("device_id <=", value, "deviceId"); + return (Criteria) this; + } + + public Criteria andDeviceIdLike(String value) { + addCriterion("device_id like", value, "deviceId"); + return (Criteria) this; + } + + public Criteria andDeviceIdNotLike(String value) { + addCriterion("device_id not like", value, "deviceId"); + return (Criteria) this; + } + + public Criteria andDeviceIdIn(List values) { + addCriterion("device_id in", values, "deviceId"); + return (Criteria) this; + } + + public Criteria andDeviceIdNotIn(List values) { + addCriterion("device_id not in", values, "deviceId"); + return (Criteria) this; + } + + public Criteria andDeviceIdBetween(String value1, String value2) { + addCriterion("device_id between", value1, value2, "deviceId"); + return (Criteria) this; + } + + public Criteria andDeviceIdNotBetween(String value1, String value2) { + addCriterion("device_id not between", value1, value2, "deviceId"); + return (Criteria) this; + } + + public Criteria andReceiveTsIsNull() { + addCriterion("receive_ts is null"); + return (Criteria) this; + } + + public Criteria andReceiveTsIsNotNull() { + addCriterion("receive_ts is not null"); + return (Criteria) this; + } + + public Criteria andReceiveTsEqualTo(Long value) { + addCriterion("receive_ts =", value, "receiveTs"); + return (Criteria) this; + } + + public Criteria andReceiveTsNotEqualTo(Long value) { + addCriterion("receive_ts <>", value, "receiveTs"); + return (Criteria) this; + } + + public Criteria andReceiveTsGreaterThan(Long value) { + addCriterion("receive_ts >", value, "receiveTs"); + return (Criteria) this; + } + + public Criteria andReceiveTsGreaterThanOrEqualTo(Long value) { + addCriterion("receive_ts >=", value, "receiveTs"); + return (Criteria) this; + } + + public Criteria andReceiveTsLessThan(Long value) { + addCriterion("receive_ts <", value, "receiveTs"); + return (Criteria) this; + } + + public Criteria andReceiveTsLessThanOrEqualTo(Long value) { + addCriterion("receive_ts <=", value, "receiveTs"); + return (Criteria) this; + } + + public Criteria andReceiveTsIn(List values) { + addCriterion("receive_ts in", values, "receiveTs"); + return (Criteria) this; + } + + public Criteria andReceiveTsNotIn(List values) { + addCriterion("receive_ts not in", values, "receiveTs"); + return (Criteria) this; + } + + public Criteria andReceiveTsBetween(Long value1, Long value2) { + addCriterion("receive_ts between", value1, value2, "receiveTs"); + return (Criteria) this; + } + + public Criteria andReceiveTsNotBetween(Long value1, Long value2) { + addCriterion("receive_ts not between", value1, value2, "receiveTs"); + return (Criteria) this; + } + + public Criteria andConfirmStatusIsNull() { + addCriterion("confirm_status is null"); + return (Criteria) this; + } + + public Criteria andConfirmStatusIsNotNull() { + addCriterion("confirm_status is not null"); + return (Criteria) this; + } + + public Criteria andConfirmStatusEqualTo(Integer value) { + addCriterion("confirm_status =", value, "confirmStatus"); + return (Criteria) this; + } + + public Criteria andConfirmStatusNotEqualTo(Integer value) { + addCriterion("confirm_status <>", value, "confirmStatus"); + return (Criteria) this; + } + + public Criteria andConfirmStatusGreaterThan(Integer value) { + addCriterion("confirm_status >", value, "confirmStatus"); + return (Criteria) this; + } + + public Criteria andConfirmStatusGreaterThanOrEqualTo(Integer value) { + addCriterion("confirm_status >=", value, "confirmStatus"); + return (Criteria) this; + } + + public Criteria andConfirmStatusLessThan(Integer value) { + addCriterion("confirm_status <", value, "confirmStatus"); + return (Criteria) this; + } + + public Criteria andConfirmStatusLessThanOrEqualTo(Integer value) { + addCriterion("confirm_status <=", value, "confirmStatus"); + return (Criteria) this; + } + + public Criteria andConfirmStatusIn(List values) { + addCriterion("confirm_status in", values, "confirmStatus"); + return (Criteria) this; + } + + public Criteria andConfirmStatusNotIn(List values) { + addCriterion("confirm_status not in", values, "confirmStatus"); + return (Criteria) this; + } + + public Criteria andConfirmStatusBetween(Integer value1, Integer value2) { + addCriterion("confirm_status between", value1, value2, "confirmStatus"); + return (Criteria) this; + } + + public Criteria andConfirmStatusNotBetween(Integer value1, Integer value2) { + addCriterion("confirm_status not between", value1, value2, "confirmStatus"); + return (Criteria) this; + } + + public Criteria andHandleStatusIsNull() { + addCriterion("handle_status is null"); + return (Criteria) this; + } + + public Criteria andHandleStatusIsNotNull() { + addCriterion("handle_status is not null"); + return (Criteria) this; + } + + public Criteria andHandleStatusEqualTo(Integer value) { + addCriterion("handle_status =", value, "handleStatus"); + return (Criteria) this; + } + + public Criteria andHandleStatusNotEqualTo(Integer value) { + addCriterion("handle_status <>", value, "handleStatus"); + return (Criteria) this; + } + + public Criteria andHandleStatusGreaterThan(Integer value) { + addCriterion("handle_status >", value, "handleStatus"); + return (Criteria) this; + } + + public Criteria andHandleStatusGreaterThanOrEqualTo(Integer value) { + addCriterion("handle_status >=", value, "handleStatus"); + return (Criteria) this; + } + + public Criteria andHandleStatusLessThan(Integer value) { + addCriterion("handle_status <", value, "handleStatus"); + return (Criteria) this; + } + + public Criteria andHandleStatusLessThanOrEqualTo(Integer value) { + addCriterion("handle_status <=", value, "handleStatus"); + return (Criteria) this; + } + + public Criteria andHandleStatusIn(List values) { + addCriterion("handle_status in", values, "handleStatus"); + return (Criteria) this; + } + + public Criteria andHandleStatusNotIn(List values) { + addCriterion("handle_status not in", values, "handleStatus"); + return (Criteria) this; + } + + public Criteria andHandleStatusBetween(Integer value1, Integer value2) { + addCriterion("handle_status between", value1, value2, "handleStatus"); + return (Criteria) this; + } + + public Criteria andHandleStatusNotBetween(Integer value1, Integer value2) { + addCriterion("handle_status not between", value1, value2, "handleStatus"); + return (Criteria) this; + } + + public Criteria andAlertStatusIsNull() { + addCriterion("alert_status is null"); + return (Criteria) this; + } + + public Criteria andAlertStatusIsNotNull() { + addCriterion("alert_status is not null"); + return (Criteria) this; + } + + public Criteria andAlertStatusEqualTo(Integer value) { + addCriterion("alert_status =", value, "alertStatus"); + return (Criteria) this; + } + + public Criteria andAlertStatusNotEqualTo(Integer value) { + addCriterion("alert_status <>", value, "alertStatus"); + return (Criteria) this; + } + + public Criteria andAlertStatusGreaterThan(Integer value) { + addCriterion("alert_status >", value, "alertStatus"); + return (Criteria) this; + } + + public Criteria andAlertStatusGreaterThanOrEqualTo(Integer value) { + addCriterion("alert_status >=", value, "alertStatus"); + return (Criteria) this; + } + + public Criteria andAlertStatusLessThan(Integer value) { + addCriterion("alert_status <", value, "alertStatus"); + return (Criteria) this; + } + + public Criteria andAlertStatusLessThanOrEqualTo(Integer value) { + addCriterion("alert_status <=", value, "alertStatus"); + return (Criteria) this; + } + + public Criteria andAlertStatusIn(List values) { + addCriterion("alert_status in", values, "alertStatus"); + return (Criteria) this; + } + + public Criteria andAlertStatusNotIn(List values) { + addCriterion("alert_status not in", values, "alertStatus"); + return (Criteria) this; + } + + public Criteria andAlertStatusBetween(Integer value1, Integer value2) { + addCriterion("alert_status between", value1, value2, "alertStatus"); + return (Criteria) this; + } + + public Criteria andAlertStatusNotBetween(Integer value1, Integer value2) { + addCriterion("alert_status not between", value1, value2, "alertStatus"); + return (Criteria) this; + } + + public Criteria andRetainAlertIsNull() { + addCriterion("retain_alert is null"); + return (Criteria) this; + } + + public Criteria andRetainAlertIsNotNull() { + addCriterion("retain_alert is not null"); + return (Criteria) this; + } + + public Criteria andRetainAlertEqualTo(Integer value) { + addCriterion("retain_alert =", value, "retainAlert"); + return (Criteria) this; + } + + public Criteria andRetainAlertNotEqualTo(Integer value) { + addCriterion("retain_alert <>", value, "retainAlert"); + return (Criteria) this; + } + + public Criteria andRetainAlertGreaterThan(Integer value) { + addCriterion("retain_alert >", value, "retainAlert"); + return (Criteria) this; + } + + public Criteria andRetainAlertGreaterThanOrEqualTo(Integer value) { + addCriterion("retain_alert >=", value, "retainAlert"); + return (Criteria) this; + } + + public Criteria andRetainAlertLessThan(Integer value) { + addCriterion("retain_alert <", value, "retainAlert"); + return (Criteria) this; + } + + public Criteria andRetainAlertLessThanOrEqualTo(Integer value) { + addCriterion("retain_alert <=", value, "retainAlert"); + return (Criteria) this; + } + + public Criteria andRetainAlertIn(List values) { + addCriterion("retain_alert in", values, "retainAlert"); + return (Criteria) this; + } + + public Criteria andRetainAlertNotIn(List values) { + addCriterion("retain_alert not in", values, "retainAlert"); + return (Criteria) this; + } + + public Criteria andRetainAlertBetween(Integer value1, Integer value2) { + addCriterion("retain_alert between", value1, value2, "retainAlert"); + return (Criteria) this; + } + + public Criteria andRetainAlertNotBetween(Integer value1, Integer value2) { + addCriterion("retain_alert not between", value1, value2, "retainAlert"); + return (Criteria) this; + } + } + + /** + * This class was generated by MyBatis Generator. + * This class corresponds to the database table alert_history + * + * @mbg.generated do_not_delete_during_merge + */ + public static class Criteria extends GeneratedCriteria { + + protected Criteria() { + super(); + } + } + + /** + * This class was generated by MyBatis Generator. + * This class corresponds to the database table alert_history + * + * @mbg.generated + */ + public static class Criterion { + private String condition; + + private Object value; + + private Object secondValue; + + private boolean noValue; + + private boolean singleValue; + + private boolean betweenValue; + + private boolean listValue; + + private String typeHandler; + + public String getCondition() { + return condition; + } + + public Object getValue() { + return value; + } + + public Object getSecondValue() { + return secondValue; + } + + public boolean isNoValue() { + return noValue; + } + + public boolean isSingleValue() { + return singleValue; + } + + public boolean isBetweenValue() { + return betweenValue; + } + + public boolean isListValue() { + return listValue; + } + + public String getTypeHandler() { + return typeHandler; + } + + protected Criterion(String condition) { + super(); + this.condition = condition; + this.typeHandler = null; + this.noValue = true; + } + + protected Criterion(String condition, Object value, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.typeHandler = typeHandler; + if (value instanceof List) { + this.listValue = true; + } else { + this.singleValue = true; + } + } + + protected Criterion(String condition, Object value) { + this(condition, value, null); + } + + protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.secondValue = secondValue; + this.typeHandler = typeHandler; + this.betweenValue = true; + } + + protected Criterion(String condition, Object value, Object secondValue) { + this(condition, value, secondValue, null); + } + } +} \ No newline at end of file diff --git a/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/model/BaStatusStatistics.java b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/model/BaStatusStatistics.java new file mode 100644 index 0000000..ca9721c --- /dev/null +++ b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/model/BaStatusStatistics.java @@ -0,0 +1,336 @@ +package com.dongjian.dashboard.back.model; + +import java.io.Serializable; + +public class BaStatusStatistics implements Serializable { + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column ba_status_statistics.id + * + * @mbg.generated + */ + private Integer id; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column ba_status_statistics.device_info_id + * + * @mbg.generated + */ + private Integer deviceInfoId; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column ba_status_statistics.is_running + * + * @mbg.generated + */ + private Integer isRunning; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column ba_status_statistics.latest_ts + * + * @mbg.generated + */ + private String latestTs; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column ba_status_statistics.continuous_running_time + * + * @mbg.generated + */ + private Long continuousRunningTime; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column ba_status_statistics.aggregated_running_time + * + * @mbg.generated + */ + private Long aggregatedRunningTime; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column ba_status_statistics.running_count + * + * @mbg.generated + */ + private Integer runningCount; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column ba_status_statistics.last_start_time + * + * @mbg.generated + */ + private Long lastStartTime; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column ba_status_statistics.last_stop_time + * + * @mbg.generated + */ + private Long lastStopTime; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database table ba_status_statistics + * + * @mbg.generated + */ + private static final long serialVersionUID = 1L; + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column ba_status_statistics.id + * + * @return the value of ba_status_statistics.id + * + * @mbg.generated + */ + public Integer getId() { + return id; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column ba_status_statistics.id + * + * @param id the value for ba_status_statistics.id + * + * @mbg.generated + */ + public void setId(Integer id) { + this.id = id; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column ba_status_statistics.device_info_id + * + * @return the value of ba_status_statistics.device_info_id + * + * @mbg.generated + */ + public Integer getDeviceInfoId() { + return deviceInfoId; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column ba_status_statistics.device_info_id + * + * @param deviceInfoId the value for ba_status_statistics.device_info_id + * + * @mbg.generated + */ + public void setDeviceInfoId(Integer deviceInfoId) { + this.deviceInfoId = deviceInfoId; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column ba_status_statistics.is_running + * + * @return the value of ba_status_statistics.is_running + * + * @mbg.generated + */ + public Integer getIsRunning() { + return isRunning; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column ba_status_statistics.is_running + * + * @param isRunning the value for ba_status_statistics.is_running + * + * @mbg.generated + */ + public void setIsRunning(Integer isRunning) { + this.isRunning = isRunning; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column ba_status_statistics.latest_ts + * + * @return the value of ba_status_statistics.latest_ts + * + * @mbg.generated + */ + public String getLatestTs() { + return latestTs; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column ba_status_statistics.latest_ts + * + * @param latestTs the value for ba_status_statistics.latest_ts + * + * @mbg.generated + */ + public void setLatestTs(String latestTs) { + this.latestTs = latestTs == null ? null : latestTs.trim(); + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column ba_status_statistics.continuous_running_time + * + * @return the value of ba_status_statistics.continuous_running_time + * + * @mbg.generated + */ + public Long getContinuousRunningTime() { + return continuousRunningTime; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column ba_status_statistics.continuous_running_time + * + * @param continuousRunningTime the value for ba_status_statistics.continuous_running_time + * + * @mbg.generated + */ + public void setContinuousRunningTime(Long continuousRunningTime) { + this.continuousRunningTime = continuousRunningTime; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column ba_status_statistics.aggregated_running_time + * + * @return the value of ba_status_statistics.aggregated_running_time + * + * @mbg.generated + */ + public Long getAggregatedRunningTime() { + return aggregatedRunningTime; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column ba_status_statistics.aggregated_running_time + * + * @param aggregatedRunningTime the value for ba_status_statistics.aggregated_running_time + * + * @mbg.generated + */ + public void setAggregatedRunningTime(Long aggregatedRunningTime) { + this.aggregatedRunningTime = aggregatedRunningTime; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column ba_status_statistics.running_count + * + * @return the value of ba_status_statistics.running_count + * + * @mbg.generated + */ + public Integer getRunningCount() { + return runningCount; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column ba_status_statistics.running_count + * + * @param runningCount the value for ba_status_statistics.running_count + * + * @mbg.generated + */ + public void setRunningCount(Integer runningCount) { + this.runningCount = runningCount; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column ba_status_statistics.last_start_time + * + * @return the value of ba_status_statistics.last_start_time + * + * @mbg.generated + */ + public Long getLastStartTime() { + return lastStartTime; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column ba_status_statistics.last_start_time + * + * @param lastStartTime the value for ba_status_statistics.last_start_time + * + * @mbg.generated + */ + public void setLastStartTime(Long lastStartTime) { + this.lastStartTime = lastStartTime; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column ba_status_statistics.last_stop_time + * + * @return the value of ba_status_statistics.last_stop_time + * + * @mbg.generated + */ + public Long getLastStopTime() { + return lastStopTime; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column ba_status_statistics.last_stop_time + * + * @param lastStopTime the value for ba_status_statistics.last_stop_time + * + * @mbg.generated + */ + public void setLastStopTime(Long lastStopTime) { + this.lastStopTime = lastStopTime; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table ba_status_statistics + * + * @mbg.generated + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append(getClass().getSimpleName()); + sb.append(" ["); + sb.append("Hash = ").append(hashCode()); + sb.append(", id=").append(id); + sb.append(", deviceInfoId=").append(deviceInfoId); + sb.append(", isRunning=").append(isRunning); + sb.append(", latestTs=").append(latestTs); + sb.append(", continuousRunningTime=").append(continuousRunningTime); + sb.append(", aggregatedRunningTime=").append(aggregatedRunningTime); + sb.append(", runningCount=").append(runningCount); + sb.append(", lastStartTime=").append(lastStartTime); + sb.append(", lastStopTime=").append(lastStopTime); + sb.append(", serialVersionUID=").append(serialVersionUID); + sb.append("]"); + return sb.toString(); + } +} \ No newline at end of file diff --git a/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/model/BaStatusStatisticsExample.java b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/model/BaStatusStatisticsExample.java new file mode 100644 index 0000000..0fc773d --- /dev/null +++ b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/model/BaStatusStatisticsExample.java @@ -0,0 +1,852 @@ +package com.dongjian.dashboard.back.model; + +import java.util.ArrayList; +import java.util.List; + +public class BaStatusStatisticsExample { + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database table ba_status_statistics + * + * @mbg.generated + */ + protected String orderByClause; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database table ba_status_statistics + * + * @mbg.generated + */ + protected boolean distinct; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database table ba_status_statistics + * + * @mbg.generated + */ + protected List oredCriteria; + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table ba_status_statistics + * + * @mbg.generated + */ + public BaStatusStatisticsExample() { + oredCriteria = new ArrayList(); + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table ba_status_statistics + * + * @mbg.generated + */ + public void setOrderByClause(String orderByClause) { + this.orderByClause = orderByClause; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table ba_status_statistics + * + * @mbg.generated + */ + public String getOrderByClause() { + return orderByClause; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table ba_status_statistics + * + * @mbg.generated + */ + public void setDistinct(boolean distinct) { + this.distinct = distinct; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table ba_status_statistics + * + * @mbg.generated + */ + public boolean isDistinct() { + return distinct; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table ba_status_statistics + * + * @mbg.generated + */ + public List getOredCriteria() { + return oredCriteria; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table ba_status_statistics + * + * @mbg.generated + */ + public void or(Criteria criteria) { + oredCriteria.add(criteria); + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table ba_status_statistics + * + * @mbg.generated + */ + public Criteria or() { + Criteria criteria = createCriteriaInternal(); + oredCriteria.add(criteria); + return criteria; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table ba_status_statistics + * + * @mbg.generated + */ + public Criteria createCriteria() { + Criteria criteria = createCriteriaInternal(); + if (oredCriteria.size() == 0) { + oredCriteria.add(criteria); + } + return criteria; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table ba_status_statistics + * + * @mbg.generated + */ + protected Criteria createCriteriaInternal() { + Criteria criteria = new Criteria(); + return criteria; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table ba_status_statistics + * + * @mbg.generated + */ + public void clear() { + oredCriteria.clear(); + orderByClause = null; + distinct = false; + } + + /** + * This class was generated by MyBatis Generator. + * This class corresponds to the database table ba_status_statistics + * + * @mbg.generated + */ + protected abstract static class GeneratedCriteria { + protected List criteria; + + protected GeneratedCriteria() { + super(); + criteria = new ArrayList(); + } + + public boolean isValid() { + return criteria.size() > 0; + } + + public List getAllCriteria() { + return criteria; + } + + public List getCriteria() { + return criteria; + } + + protected void addCriterion(String condition) { + if (condition == null) { + throw new RuntimeException("Value for condition cannot be null"); + } + criteria.add(new Criterion(condition)); + } + + protected void addCriterion(String condition, Object value, String property) { + if (value == null) { + throw new RuntimeException("Value for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value)); + } + + protected void addCriterion(String condition, Object value1, Object value2, String property) { + if (value1 == null || value2 == null) { + throw new RuntimeException("Between values for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value1, value2)); + } + + public Criteria andIdIsNull() { + addCriterion("id is null"); + return (Criteria) this; + } + + public Criteria andIdIsNotNull() { + addCriterion("id is not null"); + return (Criteria) this; + } + + public Criteria andIdEqualTo(Integer value) { + addCriterion("id =", value, "id"); + return (Criteria) this; + } + + public Criteria andIdNotEqualTo(Integer value) { + addCriterion("id <>", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThan(Integer value) { + addCriterion("id >", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThanOrEqualTo(Integer value) { + addCriterion("id >=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThan(Integer value) { + addCriterion("id <", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThanOrEqualTo(Integer value) { + addCriterion("id <=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdIn(List values) { + addCriterion("id in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdNotIn(List values) { + addCriterion("id not in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdBetween(Integer value1, Integer value2) { + addCriterion("id between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andIdNotBetween(Integer value1, Integer value2) { + addCriterion("id not between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andDeviceInfoIdIsNull() { + addCriterion("device_info_id is null"); + return (Criteria) this; + } + + public Criteria andDeviceInfoIdIsNotNull() { + addCriterion("device_info_id is not null"); + return (Criteria) this; + } + + public Criteria andDeviceInfoIdEqualTo(Integer value) { + addCriterion("device_info_id =", value, "deviceInfoId"); + return (Criteria) this; + } + + public Criteria andDeviceInfoIdNotEqualTo(Integer value) { + addCriterion("device_info_id <>", value, "deviceInfoId"); + return (Criteria) this; + } + + public Criteria andDeviceInfoIdGreaterThan(Integer value) { + addCriterion("device_info_id >", value, "deviceInfoId"); + return (Criteria) this; + } + + public Criteria andDeviceInfoIdGreaterThanOrEqualTo(Integer value) { + addCriterion("device_info_id >=", value, "deviceInfoId"); + return (Criteria) this; + } + + public Criteria andDeviceInfoIdLessThan(Integer value) { + addCriterion("device_info_id <", value, "deviceInfoId"); + return (Criteria) this; + } + + public Criteria andDeviceInfoIdLessThanOrEqualTo(Integer value) { + addCriterion("device_info_id <=", value, "deviceInfoId"); + return (Criteria) this; + } + + public Criteria andDeviceInfoIdIn(List values) { + addCriterion("device_info_id in", values, "deviceInfoId"); + return (Criteria) this; + } + + public Criteria andDeviceInfoIdNotIn(List values) { + addCriterion("device_info_id not in", values, "deviceInfoId"); + return (Criteria) this; + } + + public Criteria andDeviceInfoIdBetween(Integer value1, Integer value2) { + addCriterion("device_info_id between", value1, value2, "deviceInfoId"); + return (Criteria) this; + } + + public Criteria andDeviceInfoIdNotBetween(Integer value1, Integer value2) { + addCriterion("device_info_id not between", value1, value2, "deviceInfoId"); + return (Criteria) this; + } + + public Criteria andIsRunningIsNull() { + addCriterion("is_running is null"); + return (Criteria) this; + } + + public Criteria andIsRunningIsNotNull() { + addCriterion("is_running is not null"); + return (Criteria) this; + } + + public Criteria andIsRunningEqualTo(Integer value) { + addCriterion("is_running =", value, "isRunning"); + return (Criteria) this; + } + + public Criteria andIsRunningNotEqualTo(Integer value) { + addCriterion("is_running <>", value, "isRunning"); + return (Criteria) this; + } + + public Criteria andIsRunningGreaterThan(Integer value) { + addCriterion("is_running >", value, "isRunning"); + return (Criteria) this; + } + + public Criteria andIsRunningGreaterThanOrEqualTo(Integer value) { + addCriterion("is_running >=", value, "isRunning"); + return (Criteria) this; + } + + public Criteria andIsRunningLessThan(Integer value) { + addCriterion("is_running <", value, "isRunning"); + return (Criteria) this; + } + + public Criteria andIsRunningLessThanOrEqualTo(Integer value) { + addCriterion("is_running <=", value, "isRunning"); + return (Criteria) this; + } + + public Criteria andIsRunningIn(List values) { + addCriterion("is_running in", values, "isRunning"); + return (Criteria) this; + } + + public Criteria andIsRunningNotIn(List values) { + addCriterion("is_running not in", values, "isRunning"); + return (Criteria) this; + } + + public Criteria andIsRunningBetween(Integer value1, Integer value2) { + addCriterion("is_running between", value1, value2, "isRunning"); + return (Criteria) this; + } + + public Criteria andIsRunningNotBetween(Integer value1, Integer value2) { + addCriterion("is_running not between", value1, value2, "isRunning"); + return (Criteria) this; + } + + public Criteria andLatestTsIsNull() { + addCriterion("latest_ts is null"); + return (Criteria) this; + } + + public Criteria andLatestTsIsNotNull() { + addCriterion("latest_ts is not null"); + return (Criteria) this; + } + + public Criteria andLatestTsEqualTo(String value) { + addCriterion("latest_ts =", value, "latestTs"); + return (Criteria) this; + } + + public Criteria andLatestTsNotEqualTo(String value) { + addCriterion("latest_ts <>", value, "latestTs"); + return (Criteria) this; + } + + public Criteria andLatestTsGreaterThan(String value) { + addCriterion("latest_ts >", value, "latestTs"); + return (Criteria) this; + } + + public Criteria andLatestTsGreaterThanOrEqualTo(String value) { + addCriterion("latest_ts >=", value, "latestTs"); + return (Criteria) this; + } + + public Criteria andLatestTsLessThan(String value) { + addCriterion("latest_ts <", value, "latestTs"); + return (Criteria) this; + } + + public Criteria andLatestTsLessThanOrEqualTo(String value) { + addCriterion("latest_ts <=", value, "latestTs"); + return (Criteria) this; + } + + public Criteria andLatestTsLike(String value) { + addCriterion("latest_ts like", value, "latestTs"); + return (Criteria) this; + } + + public Criteria andLatestTsNotLike(String value) { + addCriterion("latest_ts not like", value, "latestTs"); + return (Criteria) this; + } + + public Criteria andLatestTsIn(List values) { + addCriterion("latest_ts in", values, "latestTs"); + return (Criteria) this; + } + + public Criteria andLatestTsNotIn(List values) { + addCriterion("latest_ts not in", values, "latestTs"); + return (Criteria) this; + } + + public Criteria andLatestTsBetween(String value1, String value2) { + addCriterion("latest_ts between", value1, value2, "latestTs"); + return (Criteria) this; + } + + public Criteria andLatestTsNotBetween(String value1, String value2) { + addCriterion("latest_ts not between", value1, value2, "latestTs"); + return (Criteria) this; + } + + public Criteria andContinuousRunningTimeIsNull() { + addCriterion("continuous_running_time is null"); + return (Criteria) this; + } + + public Criteria andContinuousRunningTimeIsNotNull() { + addCriterion("continuous_running_time is not null"); + return (Criteria) this; + } + + public Criteria andContinuousRunningTimeEqualTo(Long value) { + addCriterion("continuous_running_time =", value, "continuousRunningTime"); + return (Criteria) this; + } + + public Criteria andContinuousRunningTimeNotEqualTo(Long value) { + addCriterion("continuous_running_time <>", value, "continuousRunningTime"); + return (Criteria) this; + } + + public Criteria andContinuousRunningTimeGreaterThan(Long value) { + addCriterion("continuous_running_time >", value, "continuousRunningTime"); + return (Criteria) this; + } + + public Criteria andContinuousRunningTimeGreaterThanOrEqualTo(Long value) { + addCriterion("continuous_running_time >=", value, "continuousRunningTime"); + return (Criteria) this; + } + + public Criteria andContinuousRunningTimeLessThan(Long value) { + addCriterion("continuous_running_time <", value, "continuousRunningTime"); + return (Criteria) this; + } + + public Criteria andContinuousRunningTimeLessThanOrEqualTo(Long value) { + addCriterion("continuous_running_time <=", value, "continuousRunningTime"); + return (Criteria) this; + } + + public Criteria andContinuousRunningTimeIn(List values) { + addCriterion("continuous_running_time in", values, "continuousRunningTime"); + return (Criteria) this; + } + + public Criteria andContinuousRunningTimeNotIn(List values) { + addCriterion("continuous_running_time not in", values, "continuousRunningTime"); + return (Criteria) this; + } + + public Criteria andContinuousRunningTimeBetween(Long value1, Long value2) { + addCriterion("continuous_running_time between", value1, value2, "continuousRunningTime"); + return (Criteria) this; + } + + public Criteria andContinuousRunningTimeNotBetween(Long value1, Long value2) { + addCriterion("continuous_running_time not between", value1, value2, "continuousRunningTime"); + return (Criteria) this; + } + + public Criteria andAggregatedRunningTimeIsNull() { + addCriterion("aggregated_running_time is null"); + return (Criteria) this; + } + + public Criteria andAggregatedRunningTimeIsNotNull() { + addCriterion("aggregated_running_time is not null"); + return (Criteria) this; + } + + public Criteria andAggregatedRunningTimeEqualTo(Long value) { + addCriterion("aggregated_running_time =", value, "aggregatedRunningTime"); + return (Criteria) this; + } + + public Criteria andAggregatedRunningTimeNotEqualTo(Long value) { + addCriterion("aggregated_running_time <>", value, "aggregatedRunningTime"); + return (Criteria) this; + } + + public Criteria andAggregatedRunningTimeGreaterThan(Long value) { + addCriterion("aggregated_running_time >", value, "aggregatedRunningTime"); + return (Criteria) this; + } + + public Criteria andAggregatedRunningTimeGreaterThanOrEqualTo(Long value) { + addCriterion("aggregated_running_time >=", value, "aggregatedRunningTime"); + return (Criteria) this; + } + + public Criteria andAggregatedRunningTimeLessThan(Long value) { + addCriterion("aggregated_running_time <", value, "aggregatedRunningTime"); + return (Criteria) this; + } + + public Criteria andAggregatedRunningTimeLessThanOrEqualTo(Long value) { + addCriterion("aggregated_running_time <=", value, "aggregatedRunningTime"); + return (Criteria) this; + } + + public Criteria andAggregatedRunningTimeIn(List values) { + addCriterion("aggregated_running_time in", values, "aggregatedRunningTime"); + return (Criteria) this; + } + + public Criteria andAggregatedRunningTimeNotIn(List values) { + addCriterion("aggregated_running_time not in", values, "aggregatedRunningTime"); + return (Criteria) this; + } + + public Criteria andAggregatedRunningTimeBetween(Long value1, Long value2) { + addCriterion("aggregated_running_time between", value1, value2, "aggregatedRunningTime"); + return (Criteria) this; + } + + public Criteria andAggregatedRunningTimeNotBetween(Long value1, Long value2) { + addCriterion("aggregated_running_time not between", value1, value2, "aggregatedRunningTime"); + return (Criteria) this; + } + + public Criteria andRunningCountIsNull() { + addCriterion("running_count is null"); + return (Criteria) this; + } + + public Criteria andRunningCountIsNotNull() { + addCriterion("running_count is not null"); + return (Criteria) this; + } + + public Criteria andRunningCountEqualTo(Integer value) { + addCriterion("running_count =", value, "runningCount"); + return (Criteria) this; + } + + public Criteria andRunningCountNotEqualTo(Integer value) { + addCriterion("running_count <>", value, "runningCount"); + return (Criteria) this; + } + + public Criteria andRunningCountGreaterThan(Integer value) { + addCriterion("running_count >", value, "runningCount"); + return (Criteria) this; + } + + public Criteria andRunningCountGreaterThanOrEqualTo(Integer value) { + addCriterion("running_count >=", value, "runningCount"); + return (Criteria) this; + } + + public Criteria andRunningCountLessThan(Integer value) { + addCriterion("running_count <", value, "runningCount"); + return (Criteria) this; + } + + public Criteria andRunningCountLessThanOrEqualTo(Integer value) { + addCriterion("running_count <=", value, "runningCount"); + return (Criteria) this; + } + + public Criteria andRunningCountIn(List values) { + addCriterion("running_count in", values, "runningCount"); + return (Criteria) this; + } + + public Criteria andRunningCountNotIn(List values) { + addCriterion("running_count not in", values, "runningCount"); + return (Criteria) this; + } + + public Criteria andRunningCountBetween(Integer value1, Integer value2) { + addCriterion("running_count between", value1, value2, "runningCount"); + return (Criteria) this; + } + + public Criteria andRunningCountNotBetween(Integer value1, Integer value2) { + addCriterion("running_count not between", value1, value2, "runningCount"); + return (Criteria) this; + } + + public Criteria andLastStartTimeIsNull() { + addCriterion("last_start_time is null"); + return (Criteria) this; + } + + public Criteria andLastStartTimeIsNotNull() { + addCriterion("last_start_time is not null"); + return (Criteria) this; + } + + public Criteria andLastStartTimeEqualTo(Long value) { + addCriterion("last_start_time =", value, "lastStartTime"); + return (Criteria) this; + } + + public Criteria andLastStartTimeNotEqualTo(Long value) { + addCriterion("last_start_time <>", value, "lastStartTime"); + return (Criteria) this; + } + + public Criteria andLastStartTimeGreaterThan(Long value) { + addCriterion("last_start_time >", value, "lastStartTime"); + return (Criteria) this; + } + + public Criteria andLastStartTimeGreaterThanOrEqualTo(Long value) { + addCriterion("last_start_time >=", value, "lastStartTime"); + return (Criteria) this; + } + + public Criteria andLastStartTimeLessThan(Long value) { + addCriterion("last_start_time <", value, "lastStartTime"); + return (Criteria) this; + } + + public Criteria andLastStartTimeLessThanOrEqualTo(Long value) { + addCriterion("last_start_time <=", value, "lastStartTime"); + return (Criteria) this; + } + + public Criteria andLastStartTimeIn(List values) { + addCriterion("last_start_time in", values, "lastStartTime"); + return (Criteria) this; + } + + public Criteria andLastStartTimeNotIn(List values) { + addCriterion("last_start_time not in", values, "lastStartTime"); + return (Criteria) this; + } + + public Criteria andLastStartTimeBetween(Long value1, Long value2) { + addCriterion("last_start_time between", value1, value2, "lastStartTime"); + return (Criteria) this; + } + + public Criteria andLastStartTimeNotBetween(Long value1, Long value2) { + addCriterion("last_start_time not between", value1, value2, "lastStartTime"); + return (Criteria) this; + } + + public Criteria andLastStopTimeIsNull() { + addCriterion("last_stop_time is null"); + return (Criteria) this; + } + + public Criteria andLastStopTimeIsNotNull() { + addCriterion("last_stop_time is not null"); + return (Criteria) this; + } + + public Criteria andLastStopTimeEqualTo(Long value) { + addCriterion("last_stop_time =", value, "lastStopTime"); + return (Criteria) this; + } + + public Criteria andLastStopTimeNotEqualTo(Long value) { + addCriterion("last_stop_time <>", value, "lastStopTime"); + return (Criteria) this; + } + + public Criteria andLastStopTimeGreaterThan(Long value) { + addCriterion("last_stop_time >", value, "lastStopTime"); + return (Criteria) this; + } + + public Criteria andLastStopTimeGreaterThanOrEqualTo(Long value) { + addCriterion("last_stop_time >=", value, "lastStopTime"); + return (Criteria) this; + } + + public Criteria andLastStopTimeLessThan(Long value) { + addCriterion("last_stop_time <", value, "lastStopTime"); + return (Criteria) this; + } + + public Criteria andLastStopTimeLessThanOrEqualTo(Long value) { + addCriterion("last_stop_time <=", value, "lastStopTime"); + return (Criteria) this; + } + + public Criteria andLastStopTimeIn(List values) { + addCriterion("last_stop_time in", values, "lastStopTime"); + return (Criteria) this; + } + + public Criteria andLastStopTimeNotIn(List values) { + addCriterion("last_stop_time not in", values, "lastStopTime"); + return (Criteria) this; + } + + public Criteria andLastStopTimeBetween(Long value1, Long value2) { + addCriterion("last_stop_time between", value1, value2, "lastStopTime"); + return (Criteria) this; + } + + public Criteria andLastStopTimeNotBetween(Long value1, Long value2) { + addCriterion("last_stop_time not between", value1, value2, "lastStopTime"); + return (Criteria) this; + } + } + + /** + * This class was generated by MyBatis Generator. + * This class corresponds to the database table ba_status_statistics + * + * @mbg.generated do_not_delete_during_merge + */ + public static class Criteria extends GeneratedCriteria { + + protected Criteria() { + super(); + } + } + + /** + * This class was generated by MyBatis Generator. + * This class corresponds to the database table ba_status_statistics + * + * @mbg.generated + */ + public static class Criterion { + private String condition; + + private Object value; + + private Object secondValue; + + private boolean noValue; + + private boolean singleValue; + + private boolean betweenValue; + + private boolean listValue; + + private String typeHandler; + + public String getCondition() { + return condition; + } + + public Object getValue() { + return value; + } + + public Object getSecondValue() { + return secondValue; + } + + public boolean isNoValue() { + return noValue; + } + + public boolean isSingleValue() { + return singleValue; + } + + public boolean isBetweenValue() { + return betweenValue; + } + + public boolean isListValue() { + return listValue; + } + + public String getTypeHandler() { + return typeHandler; + } + + protected Criterion(String condition) { + super(); + this.condition = condition; + this.typeHandler = null; + this.noValue = true; + } + + protected Criterion(String condition, Object value, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.typeHandler = typeHandler; + if (value instanceof List) { + this.listValue = true; + } else { + this.singleValue = true; + } + } + + protected Criterion(String condition, Object value) { + this(condition, value, null); + } + + protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.secondValue = secondValue; + this.typeHandler = typeHandler; + this.betweenValue = true; + } + + protected Criterion(String condition, Object value, Object secondValue) { + this(condition, value, secondValue, null); + } + } +} \ No newline at end of file diff --git a/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/model/BasicBuilding.java b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/model/BasicBuilding.java new file mode 100644 index 0000000..1650980 --- /dev/null +++ b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/model/BasicBuilding.java @@ -0,0 +1,574 @@ +package com.dongjian.dashboard.back.model; + +import java.io.Serializable; + +public class BasicBuilding implements Serializable { + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column basic_building.building_id + * + * @mbg.generated + */ + private Long buildingId; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column basic_building.company_id + * + * @mbg.generated + */ + private Long companyId; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column basic_building.name + * + * @mbg.generated + */ + private String name; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column basic_building.address + * + * @mbg.generated + */ + private String address; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column basic_building.flag + * + * @mbg.generated + */ + private Integer flag; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column basic_building.create_time + * + * @mbg.generated + */ + private Long createTime; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column basic_building.creator_id + * + * @mbg.generated + */ + private Long creatorId; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column basic_building.modify_time + * + * @mbg.generated + */ + private Long modifyTime; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column basic_building.modifier_id + * + * @mbg.generated + */ + private Long modifierId; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column basic_building.udf_building_id + * + * @mbg.generated + */ + private String udfBuildingId; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column basic_building.building_bucket + * + * @mbg.generated + */ + private String buildingBucket; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column basic_building.thumbnail_num + * + * @mbg.generated + */ + private Integer thumbnailNum; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column basic_building.show_switch_2d3d + * + * @mbg.generated + */ + private Integer showSwitch2d3d; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column basic_building.brief_introduction + * + * @mbg.generated + */ + private String briefIntroduction; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column basic_building.floor_info_list + * + * @mbg.generated + */ + private String floorInfoList; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column basic_building.picture_introduction + * + * @mbg.generated + */ + private String pictureIntroduction; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database table basic_building + * + * @mbg.generated + */ + private static final long serialVersionUID = 1L; + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column basic_building.building_id + * + * @return the value of basic_building.building_id + * + * @mbg.generated + */ + public Long getBuildingId() { + return buildingId; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column basic_building.building_id + * + * @param buildingId the value for basic_building.building_id + * + * @mbg.generated + */ + public void setBuildingId(Long buildingId) { + this.buildingId = buildingId; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column basic_building.company_id + * + * @return the value of basic_building.company_id + * + * @mbg.generated + */ + public Long getCompanyId() { + return companyId; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column basic_building.company_id + * + * @param companyId the value for basic_building.company_id + * + * @mbg.generated + */ + public void setCompanyId(Long companyId) { + this.companyId = companyId; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column basic_building.name + * + * @return the value of basic_building.name + * + * @mbg.generated + */ + public String getName() { + return name; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column basic_building.name + * + * @param name the value for basic_building.name + * + * @mbg.generated + */ + public void setName(String name) { + this.name = name == null ? null : name.trim(); + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column basic_building.address + * + * @return the value of basic_building.address + * + * @mbg.generated + */ + public String getAddress() { + return address; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column basic_building.address + * + * @param address the value for basic_building.address + * + * @mbg.generated + */ + public void setAddress(String address) { + this.address = address == null ? null : address.trim(); + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column basic_building.flag + * + * @return the value of basic_building.flag + * + * @mbg.generated + */ + public Integer getFlag() { + return flag; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column basic_building.flag + * + * @param flag the value for basic_building.flag + * + * @mbg.generated + */ + public void setFlag(Integer flag) { + this.flag = flag; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column basic_building.create_time + * + * @return the value of basic_building.create_time + * + * @mbg.generated + */ + public Long getCreateTime() { + return createTime; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column basic_building.create_time + * + * @param createTime the value for basic_building.create_time + * + * @mbg.generated + */ + public void setCreateTime(Long createTime) { + this.createTime = createTime; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column basic_building.creator_id + * + * @return the value of basic_building.creator_id + * + * @mbg.generated + */ + public Long getCreatorId() { + return creatorId; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column basic_building.creator_id + * + * @param creatorId the value for basic_building.creator_id + * + * @mbg.generated + */ + public void setCreatorId(Long creatorId) { + this.creatorId = creatorId; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column basic_building.modify_time + * + * @return the value of basic_building.modify_time + * + * @mbg.generated + */ + public Long getModifyTime() { + return modifyTime; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column basic_building.modify_time + * + * @param modifyTime the value for basic_building.modify_time + * + * @mbg.generated + */ + public void setModifyTime(Long modifyTime) { + this.modifyTime = modifyTime; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column basic_building.modifier_id + * + * @return the value of basic_building.modifier_id + * + * @mbg.generated + */ + public Long getModifierId() { + return modifierId; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column basic_building.modifier_id + * + * @param modifierId the value for basic_building.modifier_id + * + * @mbg.generated + */ + public void setModifierId(Long modifierId) { + this.modifierId = modifierId; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column basic_building.udf_building_id + * + * @return the value of basic_building.udf_building_id + * + * @mbg.generated + */ + public String getUdfBuildingId() { + return udfBuildingId; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column basic_building.udf_building_id + * + * @param udfBuildingId the value for basic_building.udf_building_id + * + * @mbg.generated + */ + public void setUdfBuildingId(String udfBuildingId) { + this.udfBuildingId = udfBuildingId == null ? null : udfBuildingId.trim(); + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column basic_building.building_bucket + * + * @return the value of basic_building.building_bucket + * + * @mbg.generated + */ + public String getBuildingBucket() { + return buildingBucket; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column basic_building.building_bucket + * + * @param buildingBucket the value for basic_building.building_bucket + * + * @mbg.generated + */ + public void setBuildingBucket(String buildingBucket) { + this.buildingBucket = buildingBucket == null ? null : buildingBucket.trim(); + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column basic_building.thumbnail_num + * + * @return the value of basic_building.thumbnail_num + * + * @mbg.generated + */ + public Integer getThumbnailNum() { + return thumbnailNum; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column basic_building.thumbnail_num + * + * @param thumbnailNum the value for basic_building.thumbnail_num + * + * @mbg.generated + */ + public void setThumbnailNum(Integer thumbnailNum) { + this.thumbnailNum = thumbnailNum; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column basic_building.show_switch_2d3d + * + * @return the value of basic_building.show_switch_2d3d + * + * @mbg.generated + */ + public Integer getShowSwitch2d3d() { + return showSwitch2d3d; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column basic_building.show_switch_2d3d + * + * @param showSwitch2d3d the value for basic_building.show_switch_2d3d + * + * @mbg.generated + */ + public void setShowSwitch2d3d(Integer showSwitch2d3d) { + this.showSwitch2d3d = showSwitch2d3d; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column basic_building.brief_introduction + * + * @return the value of basic_building.brief_introduction + * + * @mbg.generated + */ + public String getBriefIntroduction() { + return briefIntroduction; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column basic_building.brief_introduction + * + * @param briefIntroduction the value for basic_building.brief_introduction + * + * @mbg.generated + */ + public void setBriefIntroduction(String briefIntroduction) { + this.briefIntroduction = briefIntroduction == null ? null : briefIntroduction.trim(); + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column basic_building.floor_info_list + * + * @return the value of basic_building.floor_info_list + * + * @mbg.generated + */ + public String getFloorInfoList() { + return floorInfoList; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column basic_building.floor_info_list + * + * @param floorInfoList the value for basic_building.floor_info_list + * + * @mbg.generated + */ + public void setFloorInfoList(String floorInfoList) { + this.floorInfoList = floorInfoList == null ? null : floorInfoList.trim(); + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column basic_building.picture_introduction + * + * @return the value of basic_building.picture_introduction + * + * @mbg.generated + */ + public String getPictureIntroduction() { + return pictureIntroduction; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column basic_building.picture_introduction + * + * @param pictureIntroduction the value for basic_building.picture_introduction + * + * @mbg.generated + */ + public void setPictureIntroduction(String pictureIntroduction) { + this.pictureIntroduction = pictureIntroduction == null ? null : pictureIntroduction.trim(); + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table basic_building + * + * @mbg.generated + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append(getClass().getSimpleName()); + sb.append(" ["); + sb.append("Hash = ").append(hashCode()); + sb.append(", buildingId=").append(buildingId); + sb.append(", companyId=").append(companyId); + sb.append(", name=").append(name); + sb.append(", address=").append(address); + sb.append(", flag=").append(flag); + sb.append(", createTime=").append(createTime); + sb.append(", creatorId=").append(creatorId); + sb.append(", modifyTime=").append(modifyTime); + sb.append(", modifierId=").append(modifierId); + sb.append(", udfBuildingId=").append(udfBuildingId); + sb.append(", buildingBucket=").append(buildingBucket); + sb.append(", thumbnailNum=").append(thumbnailNum); + sb.append(", showSwitch2d3d=").append(showSwitch2d3d); + sb.append(", briefIntroduction=").append(briefIntroduction); + sb.append(", floorInfoList=").append(floorInfoList); + sb.append(", pictureIntroduction=").append(pictureIntroduction); + sb.append(", serialVersionUID=").append(serialVersionUID); + sb.append("]"); + return sb.toString(); + } +} \ No newline at end of file diff --git a/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/model/BasicBuildingExample.java b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/model/BasicBuildingExample.java new file mode 100644 index 0000000..5b8c433 --- /dev/null +++ b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/model/BasicBuildingExample.java @@ -0,0 +1,1192 @@ +package com.dongjian.dashboard.back.model; + +import java.util.ArrayList; +import java.util.List; + +public class BasicBuildingExample { + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database table basic_building + * + * @mbg.generated + */ + protected String orderByClause; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database table basic_building + * + * @mbg.generated + */ + protected boolean distinct; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database table basic_building + * + * @mbg.generated + */ + protected List oredCriteria; + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table basic_building + * + * @mbg.generated + */ + public BasicBuildingExample() { + oredCriteria = new ArrayList(); + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table basic_building + * + * @mbg.generated + */ + public void setOrderByClause(String orderByClause) { + this.orderByClause = orderByClause; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table basic_building + * + * @mbg.generated + */ + public String getOrderByClause() { + return orderByClause; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table basic_building + * + * @mbg.generated + */ + public void setDistinct(boolean distinct) { + this.distinct = distinct; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table basic_building + * + * @mbg.generated + */ + public boolean isDistinct() { + return distinct; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table basic_building + * + * @mbg.generated + */ + public List getOredCriteria() { + return oredCriteria; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table basic_building + * + * @mbg.generated + */ + public void or(Criteria criteria) { + oredCriteria.add(criteria); + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table basic_building + * + * @mbg.generated + */ + public Criteria or() { + Criteria criteria = createCriteriaInternal(); + oredCriteria.add(criteria); + return criteria; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table basic_building + * + * @mbg.generated + */ + public Criteria createCriteria() { + Criteria criteria = createCriteriaInternal(); + if (oredCriteria.size() == 0) { + oredCriteria.add(criteria); + } + return criteria; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table basic_building + * + * @mbg.generated + */ + protected Criteria createCriteriaInternal() { + Criteria criteria = new Criteria(); + return criteria; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table basic_building + * + * @mbg.generated + */ + public void clear() { + oredCriteria.clear(); + orderByClause = null; + distinct = false; + } + + /** + * This class was generated by MyBatis Generator. + * This class corresponds to the database table basic_building + * + * @mbg.generated + */ + protected abstract static class GeneratedCriteria { + protected List criteria; + + protected GeneratedCriteria() { + super(); + criteria = new ArrayList(); + } + + public boolean isValid() { + return criteria.size() > 0; + } + + public List getAllCriteria() { + return criteria; + } + + public List getCriteria() { + return criteria; + } + + protected void addCriterion(String condition) { + if (condition == null) { + throw new RuntimeException("Value for condition cannot be null"); + } + criteria.add(new Criterion(condition)); + } + + protected void addCriterion(String condition, Object value, String property) { + if (value == null) { + throw new RuntimeException("Value for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value)); + } + + protected void addCriterion(String condition, Object value1, Object value2, String property) { + if (value1 == null || value2 == null) { + throw new RuntimeException("Between values for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value1, value2)); + } + + public Criteria andBuildingIdIsNull() { + addCriterion("building_id is null"); + return (Criteria) this; + } + + public Criteria andBuildingIdIsNotNull() { + addCriterion("building_id is not null"); + return (Criteria) this; + } + + public Criteria andBuildingIdEqualTo(Long value) { + addCriterion("building_id =", value, "buildingId"); + return (Criteria) this; + } + + public Criteria andBuildingIdNotEqualTo(Long value) { + addCriterion("building_id <>", value, "buildingId"); + return (Criteria) this; + } + + public Criteria andBuildingIdGreaterThan(Long value) { + addCriterion("building_id >", value, "buildingId"); + return (Criteria) this; + } + + public Criteria andBuildingIdGreaterThanOrEqualTo(Long value) { + addCriterion("building_id >=", value, "buildingId"); + return (Criteria) this; + } + + public Criteria andBuildingIdLessThan(Long value) { + addCriterion("building_id <", value, "buildingId"); + return (Criteria) this; + } + + public Criteria andBuildingIdLessThanOrEqualTo(Long value) { + addCriterion("building_id <=", value, "buildingId"); + return (Criteria) this; + } + + public Criteria andBuildingIdIn(List values) { + addCriterion("building_id in", values, "buildingId"); + return (Criteria) this; + } + + public Criteria andBuildingIdNotIn(List values) { + addCriterion("building_id not in", values, "buildingId"); + return (Criteria) this; + } + + public Criteria andBuildingIdBetween(Long value1, Long value2) { + addCriterion("building_id between", value1, value2, "buildingId"); + return (Criteria) this; + } + + public Criteria andBuildingIdNotBetween(Long value1, Long value2) { + addCriterion("building_id not between", value1, value2, "buildingId"); + return (Criteria) this; + } + + public Criteria andCompanyIdIsNull() { + addCriterion("company_id is null"); + return (Criteria) this; + } + + public Criteria andCompanyIdIsNotNull() { + addCriterion("company_id is not null"); + return (Criteria) this; + } + + public Criteria andCompanyIdEqualTo(Long value) { + addCriterion("company_id =", value, "companyId"); + return (Criteria) this; + } + + public Criteria andCompanyIdNotEqualTo(Long value) { + addCriterion("company_id <>", value, "companyId"); + return (Criteria) this; + } + + public Criteria andCompanyIdGreaterThan(Long value) { + addCriterion("company_id >", value, "companyId"); + return (Criteria) this; + } + + public Criteria andCompanyIdGreaterThanOrEqualTo(Long value) { + addCriterion("company_id >=", value, "companyId"); + return (Criteria) this; + } + + public Criteria andCompanyIdLessThan(Long value) { + addCriterion("company_id <", value, "companyId"); + return (Criteria) this; + } + + public Criteria andCompanyIdLessThanOrEqualTo(Long value) { + addCriterion("company_id <=", value, "companyId"); + return (Criteria) this; + } + + public Criteria andCompanyIdIn(List values) { + addCriterion("company_id in", values, "companyId"); + return (Criteria) this; + } + + public Criteria andCompanyIdNotIn(List values) { + addCriterion("company_id not in", values, "companyId"); + return (Criteria) this; + } + + public Criteria andCompanyIdBetween(Long value1, Long value2) { + addCriterion("company_id between", value1, value2, "companyId"); + return (Criteria) this; + } + + public Criteria andCompanyIdNotBetween(Long value1, Long value2) { + addCriterion("company_id not between", value1, value2, "companyId"); + return (Criteria) this; + } + + public Criteria andNameIsNull() { + addCriterion("`name` is null"); + return (Criteria) this; + } + + public Criteria andNameIsNotNull() { + addCriterion("`name` is not null"); + return (Criteria) this; + } + + public Criteria andNameEqualTo(String value) { + addCriterion("`name` =", value, "name"); + return (Criteria) this; + } + + public Criteria andNameNotEqualTo(String value) { + addCriterion("`name` <>", value, "name"); + return (Criteria) this; + } + + public Criteria andNameGreaterThan(String value) { + addCriterion("`name` >", value, "name"); + return (Criteria) this; + } + + public Criteria andNameGreaterThanOrEqualTo(String value) { + addCriterion("`name` >=", value, "name"); + return (Criteria) this; + } + + public Criteria andNameLessThan(String value) { + addCriterion("`name` <", value, "name"); + return (Criteria) this; + } + + public Criteria andNameLessThanOrEqualTo(String value) { + addCriterion("`name` <=", value, "name"); + return (Criteria) this; + } + + public Criteria andNameLike(String value) { + addCriterion("`name` like", value, "name"); + return (Criteria) this; + } + + public Criteria andNameNotLike(String value) { + addCriterion("`name` not like", value, "name"); + return (Criteria) this; + } + + public Criteria andNameIn(List values) { + addCriterion("`name` in", values, "name"); + return (Criteria) this; + } + + public Criteria andNameNotIn(List values) { + addCriterion("`name` not in", values, "name"); + return (Criteria) this; + } + + public Criteria andNameBetween(String value1, String value2) { + addCriterion("`name` between", value1, value2, "name"); + return (Criteria) this; + } + + public Criteria andNameNotBetween(String value1, String value2) { + addCriterion("`name` not between", value1, value2, "name"); + return (Criteria) this; + } + + public Criteria andAddressIsNull() { + addCriterion("address is null"); + return (Criteria) this; + } + + public Criteria andAddressIsNotNull() { + addCriterion("address is not null"); + return (Criteria) this; + } + + public Criteria andAddressEqualTo(String value) { + addCriterion("address =", value, "address"); + return (Criteria) this; + } + + public Criteria andAddressNotEqualTo(String value) { + addCriterion("address <>", value, "address"); + return (Criteria) this; + } + + public Criteria andAddressGreaterThan(String value) { + addCriterion("address >", value, "address"); + return (Criteria) this; + } + + public Criteria andAddressGreaterThanOrEqualTo(String value) { + addCriterion("address >=", value, "address"); + return (Criteria) this; + } + + public Criteria andAddressLessThan(String value) { + addCriterion("address <", value, "address"); + return (Criteria) this; + } + + public Criteria andAddressLessThanOrEqualTo(String value) { + addCriterion("address <=", value, "address"); + return (Criteria) this; + } + + public Criteria andAddressLike(String value) { + addCriterion("address like", value, "address"); + return (Criteria) this; + } + + public Criteria andAddressNotLike(String value) { + addCriterion("address not like", value, "address"); + return (Criteria) this; + } + + public Criteria andAddressIn(List values) { + addCriterion("address in", values, "address"); + return (Criteria) this; + } + + public Criteria andAddressNotIn(List values) { + addCriterion("address not in", values, "address"); + return (Criteria) this; + } + + public Criteria andAddressBetween(String value1, String value2) { + addCriterion("address between", value1, value2, "address"); + return (Criteria) this; + } + + public Criteria andAddressNotBetween(String value1, String value2) { + addCriterion("address not between", value1, value2, "address"); + return (Criteria) this; + } + + public Criteria andFlagIsNull() { + addCriterion("flag is null"); + return (Criteria) this; + } + + public Criteria andFlagIsNotNull() { + addCriterion("flag is not null"); + return (Criteria) this; + } + + public Criteria andFlagEqualTo(Integer value) { + addCriterion("flag =", value, "flag"); + return (Criteria) this; + } + + public Criteria andFlagNotEqualTo(Integer value) { + addCriterion("flag <>", value, "flag"); + return (Criteria) this; + } + + public Criteria andFlagGreaterThan(Integer value) { + addCriterion("flag >", value, "flag"); + return (Criteria) this; + } + + public Criteria andFlagGreaterThanOrEqualTo(Integer value) { + addCriterion("flag >=", value, "flag"); + return (Criteria) this; + } + + public Criteria andFlagLessThan(Integer value) { + addCriterion("flag <", value, "flag"); + return (Criteria) this; + } + + public Criteria andFlagLessThanOrEqualTo(Integer value) { + addCriterion("flag <=", value, "flag"); + return (Criteria) this; + } + + public Criteria andFlagIn(List values) { + addCriterion("flag in", values, "flag"); + return (Criteria) this; + } + + public Criteria andFlagNotIn(List values) { + addCriterion("flag not in", values, "flag"); + return (Criteria) this; + } + + public Criteria andFlagBetween(Integer value1, Integer value2) { + addCriterion("flag between", value1, value2, "flag"); + return (Criteria) this; + } + + public Criteria andFlagNotBetween(Integer value1, Integer value2) { + addCriterion("flag not between", value1, value2, "flag"); + return (Criteria) this; + } + + public Criteria andCreateTimeIsNull() { + addCriterion("create_time is null"); + return (Criteria) this; + } + + public Criteria andCreateTimeIsNotNull() { + addCriterion("create_time is not null"); + return (Criteria) this; + } + + public Criteria andCreateTimeEqualTo(Long value) { + addCriterion("create_time =", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeNotEqualTo(Long value) { + addCriterion("create_time <>", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeGreaterThan(Long value) { + addCriterion("create_time >", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeGreaterThanOrEqualTo(Long value) { + addCriterion("create_time >=", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeLessThan(Long value) { + addCriterion("create_time <", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeLessThanOrEqualTo(Long value) { + addCriterion("create_time <=", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeIn(List values) { + addCriterion("create_time in", values, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeNotIn(List values) { + addCriterion("create_time not in", values, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeBetween(Long value1, Long value2) { + addCriterion("create_time between", value1, value2, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeNotBetween(Long value1, Long value2) { + addCriterion("create_time not between", value1, value2, "createTime"); + return (Criteria) this; + } + + public Criteria andCreatorIdIsNull() { + addCriterion("creator_id is null"); + return (Criteria) this; + } + + public Criteria andCreatorIdIsNotNull() { + addCriterion("creator_id is not null"); + return (Criteria) this; + } + + public Criteria andCreatorIdEqualTo(Long value) { + addCriterion("creator_id =", value, "creatorId"); + return (Criteria) this; + } + + public Criteria andCreatorIdNotEqualTo(Long value) { + addCriterion("creator_id <>", value, "creatorId"); + return (Criteria) this; + } + + public Criteria andCreatorIdGreaterThan(Long value) { + addCriterion("creator_id >", value, "creatorId"); + return (Criteria) this; + } + + public Criteria andCreatorIdGreaterThanOrEqualTo(Long value) { + addCriterion("creator_id >=", value, "creatorId"); + return (Criteria) this; + } + + public Criteria andCreatorIdLessThan(Long value) { + addCriterion("creator_id <", value, "creatorId"); + return (Criteria) this; + } + + public Criteria andCreatorIdLessThanOrEqualTo(Long value) { + addCriterion("creator_id <=", value, "creatorId"); + return (Criteria) this; + } + + public Criteria andCreatorIdIn(List values) { + addCriterion("creator_id in", values, "creatorId"); + return (Criteria) this; + } + + public Criteria andCreatorIdNotIn(List values) { + addCriterion("creator_id not in", values, "creatorId"); + return (Criteria) this; + } + + public Criteria andCreatorIdBetween(Long value1, Long value2) { + addCriterion("creator_id between", value1, value2, "creatorId"); + return (Criteria) this; + } + + public Criteria andCreatorIdNotBetween(Long value1, Long value2) { + addCriterion("creator_id not between", value1, value2, "creatorId"); + return (Criteria) this; + } + + public Criteria andModifyTimeIsNull() { + addCriterion("modify_time is null"); + return (Criteria) this; + } + + public Criteria andModifyTimeIsNotNull() { + addCriterion("modify_time is not null"); + return (Criteria) this; + } + + public Criteria andModifyTimeEqualTo(Long value) { + addCriterion("modify_time =", value, "modifyTime"); + return (Criteria) this; + } + + public Criteria andModifyTimeNotEqualTo(Long value) { + addCriterion("modify_time <>", value, "modifyTime"); + return (Criteria) this; + } + + public Criteria andModifyTimeGreaterThan(Long value) { + addCriterion("modify_time >", value, "modifyTime"); + return (Criteria) this; + } + + public Criteria andModifyTimeGreaterThanOrEqualTo(Long value) { + addCriterion("modify_time >=", value, "modifyTime"); + return (Criteria) this; + } + + public Criteria andModifyTimeLessThan(Long value) { + addCriterion("modify_time <", value, "modifyTime"); + return (Criteria) this; + } + + public Criteria andModifyTimeLessThanOrEqualTo(Long value) { + addCriterion("modify_time <=", value, "modifyTime"); + return (Criteria) this; + } + + public Criteria andModifyTimeIn(List values) { + addCriterion("modify_time in", values, "modifyTime"); + return (Criteria) this; + } + + public Criteria andModifyTimeNotIn(List values) { + addCriterion("modify_time not in", values, "modifyTime"); + return (Criteria) this; + } + + public Criteria andModifyTimeBetween(Long value1, Long value2) { + addCriterion("modify_time between", value1, value2, "modifyTime"); + return (Criteria) this; + } + + public Criteria andModifyTimeNotBetween(Long value1, Long value2) { + addCriterion("modify_time not between", value1, value2, "modifyTime"); + return (Criteria) this; + } + + public Criteria andModifierIdIsNull() { + addCriterion("modifier_id is null"); + return (Criteria) this; + } + + public Criteria andModifierIdIsNotNull() { + addCriterion("modifier_id is not null"); + return (Criteria) this; + } + + public Criteria andModifierIdEqualTo(Long value) { + addCriterion("modifier_id =", value, "modifierId"); + return (Criteria) this; + } + + public Criteria andModifierIdNotEqualTo(Long value) { + addCriterion("modifier_id <>", value, "modifierId"); + return (Criteria) this; + } + + public Criteria andModifierIdGreaterThan(Long value) { + addCriterion("modifier_id >", value, "modifierId"); + return (Criteria) this; + } + + public Criteria andModifierIdGreaterThanOrEqualTo(Long value) { + addCriterion("modifier_id >=", value, "modifierId"); + return (Criteria) this; + } + + public Criteria andModifierIdLessThan(Long value) { + addCriterion("modifier_id <", value, "modifierId"); + return (Criteria) this; + } + + public Criteria andModifierIdLessThanOrEqualTo(Long value) { + addCriterion("modifier_id <=", value, "modifierId"); + return (Criteria) this; + } + + public Criteria andModifierIdIn(List values) { + addCriterion("modifier_id in", values, "modifierId"); + return (Criteria) this; + } + + public Criteria andModifierIdNotIn(List values) { + addCriterion("modifier_id not in", values, "modifierId"); + return (Criteria) this; + } + + public Criteria andModifierIdBetween(Long value1, Long value2) { + addCriterion("modifier_id between", value1, value2, "modifierId"); + return (Criteria) this; + } + + public Criteria andModifierIdNotBetween(Long value1, Long value2) { + addCriterion("modifier_id not between", value1, value2, "modifierId"); + return (Criteria) this; + } + + public Criteria andUdfBuildingIdIsNull() { + addCriterion("udf_building_id is null"); + return (Criteria) this; + } + + public Criteria andUdfBuildingIdIsNotNull() { + addCriterion("udf_building_id is not null"); + return (Criteria) this; + } + + public Criteria andUdfBuildingIdEqualTo(String value) { + addCriterion("udf_building_id =", value, "udfBuildingId"); + return (Criteria) this; + } + + public Criteria andUdfBuildingIdNotEqualTo(String value) { + addCriterion("udf_building_id <>", value, "udfBuildingId"); + return (Criteria) this; + } + + public Criteria andUdfBuildingIdGreaterThan(String value) { + addCriterion("udf_building_id >", value, "udfBuildingId"); + return (Criteria) this; + } + + public Criteria andUdfBuildingIdGreaterThanOrEqualTo(String value) { + addCriterion("udf_building_id >=", value, "udfBuildingId"); + return (Criteria) this; + } + + public Criteria andUdfBuildingIdLessThan(String value) { + addCriterion("udf_building_id <", value, "udfBuildingId"); + return (Criteria) this; + } + + public Criteria andUdfBuildingIdLessThanOrEqualTo(String value) { + addCriterion("udf_building_id <=", value, "udfBuildingId"); + return (Criteria) this; + } + + public Criteria andUdfBuildingIdLike(String value) { + addCriterion("udf_building_id like", value, "udfBuildingId"); + return (Criteria) this; + } + + public Criteria andUdfBuildingIdNotLike(String value) { + addCriterion("udf_building_id not like", value, "udfBuildingId"); + return (Criteria) this; + } + + public Criteria andUdfBuildingIdIn(List values) { + addCriterion("udf_building_id in", values, "udfBuildingId"); + return (Criteria) this; + } + + public Criteria andUdfBuildingIdNotIn(List values) { + addCriterion("udf_building_id not in", values, "udfBuildingId"); + return (Criteria) this; + } + + public Criteria andUdfBuildingIdBetween(String value1, String value2) { + addCriterion("udf_building_id between", value1, value2, "udfBuildingId"); + return (Criteria) this; + } + + public Criteria andUdfBuildingIdNotBetween(String value1, String value2) { + addCriterion("udf_building_id not between", value1, value2, "udfBuildingId"); + return (Criteria) this; + } + + public Criteria andBuildingBucketIsNull() { + addCriterion("building_bucket is null"); + return (Criteria) this; + } + + public Criteria andBuildingBucketIsNotNull() { + addCriterion("building_bucket is not null"); + return (Criteria) this; + } + + public Criteria andBuildingBucketEqualTo(String value) { + addCriterion("building_bucket =", value, "buildingBucket"); + return (Criteria) this; + } + + public Criteria andBuildingBucketNotEqualTo(String value) { + addCriterion("building_bucket <>", value, "buildingBucket"); + return (Criteria) this; + } + + public Criteria andBuildingBucketGreaterThan(String value) { + addCriterion("building_bucket >", value, "buildingBucket"); + return (Criteria) this; + } + + public Criteria andBuildingBucketGreaterThanOrEqualTo(String value) { + addCriterion("building_bucket >=", value, "buildingBucket"); + return (Criteria) this; + } + + public Criteria andBuildingBucketLessThan(String value) { + addCriterion("building_bucket <", value, "buildingBucket"); + return (Criteria) this; + } + + public Criteria andBuildingBucketLessThanOrEqualTo(String value) { + addCriterion("building_bucket <=", value, "buildingBucket"); + return (Criteria) this; + } + + public Criteria andBuildingBucketLike(String value) { + addCriterion("building_bucket like", value, "buildingBucket"); + return (Criteria) this; + } + + public Criteria andBuildingBucketNotLike(String value) { + addCriterion("building_bucket not like", value, "buildingBucket"); + return (Criteria) this; + } + + public Criteria andBuildingBucketIn(List values) { + addCriterion("building_bucket in", values, "buildingBucket"); + return (Criteria) this; + } + + public Criteria andBuildingBucketNotIn(List values) { + addCriterion("building_bucket not in", values, "buildingBucket"); + return (Criteria) this; + } + + public Criteria andBuildingBucketBetween(String value1, String value2) { + addCriterion("building_bucket between", value1, value2, "buildingBucket"); + return (Criteria) this; + } + + public Criteria andBuildingBucketNotBetween(String value1, String value2) { + addCriterion("building_bucket not between", value1, value2, "buildingBucket"); + return (Criteria) this; + } + + public Criteria andThumbnailNumIsNull() { + addCriterion("thumbnail_num is null"); + return (Criteria) this; + } + + public Criteria andThumbnailNumIsNotNull() { + addCriterion("thumbnail_num is not null"); + return (Criteria) this; + } + + public Criteria andThumbnailNumEqualTo(Integer value) { + addCriterion("thumbnail_num =", value, "thumbnailNum"); + return (Criteria) this; + } + + public Criteria andThumbnailNumNotEqualTo(Integer value) { + addCriterion("thumbnail_num <>", value, "thumbnailNum"); + return (Criteria) this; + } + + public Criteria andThumbnailNumGreaterThan(Integer value) { + addCriterion("thumbnail_num >", value, "thumbnailNum"); + return (Criteria) this; + } + + public Criteria andThumbnailNumGreaterThanOrEqualTo(Integer value) { + addCriterion("thumbnail_num >=", value, "thumbnailNum"); + return (Criteria) this; + } + + public Criteria andThumbnailNumLessThan(Integer value) { + addCriterion("thumbnail_num <", value, "thumbnailNum"); + return (Criteria) this; + } + + public Criteria andThumbnailNumLessThanOrEqualTo(Integer value) { + addCriterion("thumbnail_num <=", value, "thumbnailNum"); + return (Criteria) this; + } + + public Criteria andThumbnailNumIn(List values) { + addCriterion("thumbnail_num in", values, "thumbnailNum"); + return (Criteria) this; + } + + public Criteria andThumbnailNumNotIn(List values) { + addCriterion("thumbnail_num not in", values, "thumbnailNum"); + return (Criteria) this; + } + + public Criteria andThumbnailNumBetween(Integer value1, Integer value2) { + addCriterion("thumbnail_num between", value1, value2, "thumbnailNum"); + return (Criteria) this; + } + + public Criteria andThumbnailNumNotBetween(Integer value1, Integer value2) { + addCriterion("thumbnail_num not between", value1, value2, "thumbnailNum"); + return (Criteria) this; + } + + public Criteria andShowSwitch2d3dIsNull() { + addCriterion("show_switch_2d3d is null"); + return (Criteria) this; + } + + public Criteria andShowSwitch2d3dIsNotNull() { + addCriterion("show_switch_2d3d is not null"); + return (Criteria) this; + } + + public Criteria andShowSwitch2d3dEqualTo(Integer value) { + addCriterion("show_switch_2d3d =", value, "showSwitch2d3d"); + return (Criteria) this; + } + + public Criteria andShowSwitch2d3dNotEqualTo(Integer value) { + addCriterion("show_switch_2d3d <>", value, "showSwitch2d3d"); + return (Criteria) this; + } + + public Criteria andShowSwitch2d3dGreaterThan(Integer value) { + addCriterion("show_switch_2d3d >", value, "showSwitch2d3d"); + return (Criteria) this; + } + + public Criteria andShowSwitch2d3dGreaterThanOrEqualTo(Integer value) { + addCriterion("show_switch_2d3d >=", value, "showSwitch2d3d"); + return (Criteria) this; + } + + public Criteria andShowSwitch2d3dLessThan(Integer value) { + addCriterion("show_switch_2d3d <", value, "showSwitch2d3d"); + return (Criteria) this; + } + + public Criteria andShowSwitch2d3dLessThanOrEqualTo(Integer value) { + addCriterion("show_switch_2d3d <=", value, "showSwitch2d3d"); + return (Criteria) this; + } + + public Criteria andShowSwitch2d3dIn(List values) { + addCriterion("show_switch_2d3d in", values, "showSwitch2d3d"); + return (Criteria) this; + } + + public Criteria andShowSwitch2d3dNotIn(List values) { + addCriterion("show_switch_2d3d not in", values, "showSwitch2d3d"); + return (Criteria) this; + } + + public Criteria andShowSwitch2d3dBetween(Integer value1, Integer value2) { + addCriterion("show_switch_2d3d between", value1, value2, "showSwitch2d3d"); + return (Criteria) this; + } + + public Criteria andShowSwitch2d3dNotBetween(Integer value1, Integer value2) { + addCriterion("show_switch_2d3d not between", value1, value2, "showSwitch2d3d"); + return (Criteria) this; + } + + public Criteria andBriefIntroductionIsNull() { + addCriterion("brief_introduction is null"); + return (Criteria) this; + } + + public Criteria andBriefIntroductionIsNotNull() { + addCriterion("brief_introduction is not null"); + return (Criteria) this; + } + + public Criteria andBriefIntroductionEqualTo(String value) { + addCriterion("brief_introduction =", value, "briefIntroduction"); + return (Criteria) this; + } + + public Criteria andBriefIntroductionNotEqualTo(String value) { + addCriterion("brief_introduction <>", value, "briefIntroduction"); + return (Criteria) this; + } + + public Criteria andBriefIntroductionGreaterThan(String value) { + addCriterion("brief_introduction >", value, "briefIntroduction"); + return (Criteria) this; + } + + public Criteria andBriefIntroductionGreaterThanOrEqualTo(String value) { + addCriterion("brief_introduction >=", value, "briefIntroduction"); + return (Criteria) this; + } + + public Criteria andBriefIntroductionLessThan(String value) { + addCriterion("brief_introduction <", value, "briefIntroduction"); + return (Criteria) this; + } + + public Criteria andBriefIntroductionLessThanOrEqualTo(String value) { + addCriterion("brief_introduction <=", value, "briefIntroduction"); + return (Criteria) this; + } + + public Criteria andBriefIntroductionLike(String value) { + addCriterion("brief_introduction like", value, "briefIntroduction"); + return (Criteria) this; + } + + public Criteria andBriefIntroductionNotLike(String value) { + addCriterion("brief_introduction not like", value, "briefIntroduction"); + return (Criteria) this; + } + + public Criteria andBriefIntroductionIn(List values) { + addCriterion("brief_introduction in", values, "briefIntroduction"); + return (Criteria) this; + } + + public Criteria andBriefIntroductionNotIn(List values) { + addCriterion("brief_introduction not in", values, "briefIntroduction"); + return (Criteria) this; + } + + public Criteria andBriefIntroductionBetween(String value1, String value2) { + addCriterion("brief_introduction between", value1, value2, "briefIntroduction"); + return (Criteria) this; + } + + public Criteria andBriefIntroductionNotBetween(String value1, String value2) { + addCriterion("brief_introduction not between", value1, value2, "briefIntroduction"); + return (Criteria) this; + } + } + + /** + * This class was generated by MyBatis Generator. + * This class corresponds to the database table basic_building + * + * @mbg.generated do_not_delete_during_merge + */ + public static class Criteria extends GeneratedCriteria { + + protected Criteria() { + super(); + } + } + + /** + * This class was generated by MyBatis Generator. + * This class corresponds to the database table basic_building + * + * @mbg.generated + */ + public static class Criterion { + private String condition; + + private Object value; + + private Object secondValue; + + private boolean noValue; + + private boolean singleValue; + + private boolean betweenValue; + + private boolean listValue; + + private String typeHandler; + + public String getCondition() { + return condition; + } + + public Object getValue() { + return value; + } + + public Object getSecondValue() { + return secondValue; + } + + public boolean isNoValue() { + return noValue; + } + + public boolean isSingleValue() { + return singleValue; + } + + public boolean isBetweenValue() { + return betweenValue; + } + + public boolean isListValue() { + return listValue; + } + + public String getTypeHandler() { + return typeHandler; + } + + protected Criterion(String condition) { + super(); + this.condition = condition; + this.typeHandler = null; + this.noValue = true; + } + + protected Criterion(String condition, Object value, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.typeHandler = typeHandler; + if (value instanceof List) { + this.listValue = true; + } else { + this.singleValue = true; + } + } + + protected Criterion(String condition, Object value) { + this(condition, value, null); + } + + protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.secondValue = secondValue; + this.typeHandler = typeHandler; + this.betweenValue = true; + } + + protected Criterion(String condition, Object value, Object secondValue) { + this(condition, value, secondValue, null); + } + } +} \ No newline at end of file diff --git a/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/model/BasicCompany.java b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/model/BasicCompany.java new file mode 100644 index 0000000..e008e24 --- /dev/null +++ b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/model/BasicCompany.java @@ -0,0 +1,676 @@ +package com.dongjian.dashboard.back.model; + +import java.io.Serializable; + +public class BasicCompany implements Serializable { + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column basic_company.id + * + * @mbg.generated + */ + private Long id; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column basic_company.parent_id + * + * @mbg.generated + */ + private Long parentId; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column basic_company.company_name + * + * @mbg.generated + */ + private String companyName; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column basic_company.mfa_switch + * + * @mbg.generated + */ + private Integer mfaSwitch; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column basic_company.flag + * + * @mbg.generated + */ + private Integer flag; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column basic_company.create_time + * + * @mbg.generated + */ + private Long createTime; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column basic_company.creator_id + * + * @mbg.generated + */ + private Long creatorId; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column basic_company.modify_time + * + * @mbg.generated + */ + private Long modifyTime; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column basic_company.modifier_id + * + * @mbg.generated + */ + private Long modifierId; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column basic_company.apikey + * + * @mbg.generated + */ + private String apikey; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column basic_company.aurora_flag + * + * @mbg.generated + */ + private Integer auroraFlag; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column basic_company.aurora_url + * + * @mbg.generated + */ + private String auroraUrl; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column basic_company.aurora_read_url + * + * @mbg.generated + */ + private String auroraReadUrl; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column basic_company.aurora_username + * + * @mbg.generated + */ + private String auroraUsername; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column basic_company.aurora_password + * + * @mbg.generated + */ + private String auroraPassword; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column basic_company.redis_db_id + * + * @mbg.generated + */ + private Integer redisDbId; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column basic_company.third_api_host + * + * @mbg.generated + */ + private String thirdApiHost; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column basic_company.lock_switch + * + * @mbg.generated + */ + private Integer lockSwitch; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column basic_company.bearer_token + * + * @mbg.generated + */ + private String bearerToken; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database table basic_company + * + * @mbg.generated + */ + private static final long serialVersionUID = 1L; + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column basic_company.id + * + * @return the value of basic_company.id + * + * @mbg.generated + */ + public Long getId() { + return id; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column basic_company.id + * + * @param id the value for basic_company.id + * + * @mbg.generated + */ + public void setId(Long id) { + this.id = id; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column basic_company.parent_id + * + * @return the value of basic_company.parent_id + * + * @mbg.generated + */ + public Long getParentId() { + return parentId; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column basic_company.parent_id + * + * @param parentId the value for basic_company.parent_id + * + * @mbg.generated + */ + public void setParentId(Long parentId) { + this.parentId = parentId; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column basic_company.company_name + * + * @return the value of basic_company.company_name + * + * @mbg.generated + */ + public String getCompanyName() { + return companyName; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column basic_company.company_name + * + * @param companyName the value for basic_company.company_name + * + * @mbg.generated + */ + public void setCompanyName(String companyName) { + this.companyName = companyName == null ? null : companyName.trim(); + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column basic_company.mfa_switch + * + * @return the value of basic_company.mfa_switch + * + * @mbg.generated + */ + public Integer getMfaSwitch() { + return mfaSwitch; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column basic_company.mfa_switch + * + * @param mfaSwitch the value for basic_company.mfa_switch + * + * @mbg.generated + */ + public void setMfaSwitch(Integer mfaSwitch) { + this.mfaSwitch = mfaSwitch; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column basic_company.flag + * + * @return the value of basic_company.flag + * + * @mbg.generated + */ + public Integer getFlag() { + return flag; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column basic_company.flag + * + * @param flag the value for basic_company.flag + * + * @mbg.generated + */ + public void setFlag(Integer flag) { + this.flag = flag; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column basic_company.create_time + * + * @return the value of basic_company.create_time + * + * @mbg.generated + */ + public Long getCreateTime() { + return createTime; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column basic_company.create_time + * + * @param createTime the value for basic_company.create_time + * + * @mbg.generated + */ + public void setCreateTime(Long createTime) { + this.createTime = createTime; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column basic_company.creator_id + * + * @return the value of basic_company.creator_id + * + * @mbg.generated + */ + public Long getCreatorId() { + return creatorId; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column basic_company.creator_id + * + * @param creatorId the value for basic_company.creator_id + * + * @mbg.generated + */ + public void setCreatorId(Long creatorId) { + this.creatorId = creatorId; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column basic_company.modify_time + * + * @return the value of basic_company.modify_time + * + * @mbg.generated + */ + public Long getModifyTime() { + return modifyTime; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column basic_company.modify_time + * + * @param modifyTime the value for basic_company.modify_time + * + * @mbg.generated + */ + public void setModifyTime(Long modifyTime) { + this.modifyTime = modifyTime; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column basic_company.modifier_id + * + * @return the value of basic_company.modifier_id + * + * @mbg.generated + */ + public Long getModifierId() { + return modifierId; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column basic_company.modifier_id + * + * @param modifierId the value for basic_company.modifier_id + * + * @mbg.generated + */ + public void setModifierId(Long modifierId) { + this.modifierId = modifierId; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column basic_company.apikey + * + * @return the value of basic_company.apikey + * + * @mbg.generated + */ + public String getApikey() { + return apikey; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column basic_company.apikey + * + * @param apikey the value for basic_company.apikey + * + * @mbg.generated + */ + public void setApikey(String apikey) { + this.apikey = apikey == null ? null : apikey.trim(); + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column basic_company.aurora_flag + * + * @return the value of basic_company.aurora_flag + * + * @mbg.generated + */ + public Integer getAuroraFlag() { + return auroraFlag; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column basic_company.aurora_flag + * + * @param auroraFlag the value for basic_company.aurora_flag + * + * @mbg.generated + */ + public void setAuroraFlag(Integer auroraFlag) { + this.auroraFlag = auroraFlag; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column basic_company.aurora_url + * + * @return the value of basic_company.aurora_url + * + * @mbg.generated + */ + public String getAuroraUrl() { + return auroraUrl; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column basic_company.aurora_url + * + * @param auroraUrl the value for basic_company.aurora_url + * + * @mbg.generated + */ + public void setAuroraUrl(String auroraUrl) { + this.auroraUrl = auroraUrl == null ? null : auroraUrl.trim(); + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column basic_company.aurora_read_url + * + * @return the value of basic_company.aurora_read_url + * + * @mbg.generated + */ + public String getAuroraReadUrl() { + return auroraReadUrl; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column basic_company.aurora_read_url + * + * @param auroraReadUrl the value for basic_company.aurora_read_url + * + * @mbg.generated + */ + public void setAuroraReadUrl(String auroraReadUrl) { + this.auroraReadUrl = auroraReadUrl == null ? null : auroraReadUrl.trim(); + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column basic_company.aurora_username + * + * @return the value of basic_company.aurora_username + * + * @mbg.generated + */ + public String getAuroraUsername() { + return auroraUsername; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column basic_company.aurora_username + * + * @param auroraUsername the value for basic_company.aurora_username + * + * @mbg.generated + */ + public void setAuroraUsername(String auroraUsername) { + this.auroraUsername = auroraUsername == null ? null : auroraUsername.trim(); + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column basic_company.aurora_password + * + * @return the value of basic_company.aurora_password + * + * @mbg.generated + */ + public String getAuroraPassword() { + return auroraPassword; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column basic_company.aurora_password + * + * @param auroraPassword the value for basic_company.aurora_password + * + * @mbg.generated + */ + public void setAuroraPassword(String auroraPassword) { + this.auroraPassword = auroraPassword == null ? null : auroraPassword.trim(); + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column basic_company.redis_db_id + * + * @return the value of basic_company.redis_db_id + * + * @mbg.generated + */ + public Integer getRedisDbId() { + return redisDbId; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column basic_company.redis_db_id + * + * @param redisDbId the value for basic_company.redis_db_id + * + * @mbg.generated + */ + public void setRedisDbId(Integer redisDbId) { + this.redisDbId = redisDbId; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column basic_company.third_api_host + * + * @return the value of basic_company.third_api_host + * + * @mbg.generated + */ + public String getThirdApiHost() { + return thirdApiHost; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column basic_company.third_api_host + * + * @param thirdApiHost the value for basic_company.third_api_host + * + * @mbg.generated + */ + public void setThirdApiHost(String thirdApiHost) { + this.thirdApiHost = thirdApiHost == null ? null : thirdApiHost.trim(); + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column basic_company.lock_switch + * + * @return the value of basic_company.lock_switch + * + * @mbg.generated + */ + public Integer getLockSwitch() { + return lockSwitch; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column basic_company.lock_switch + * + * @param lockSwitch the value for basic_company.lock_switch + * + * @mbg.generated + */ + public void setLockSwitch(Integer lockSwitch) { + this.lockSwitch = lockSwitch; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column basic_company.bearer_token + * + * @return the value of basic_company.bearer_token + * + * @mbg.generated + */ + public String getBearerToken() { + return bearerToken; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column basic_company.bearer_token + * + * @param bearerToken the value for basic_company.bearer_token + * + * @mbg.generated + */ + public void setBearerToken(String bearerToken) { + this.bearerToken = bearerToken == null ? null : bearerToken.trim(); + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table basic_company + * + * @mbg.generated + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append(getClass().getSimpleName()); + sb.append(" ["); + sb.append("Hash = ").append(hashCode()); + sb.append(", id=").append(id); + sb.append(", parentId=").append(parentId); + sb.append(", companyName=").append(companyName); + sb.append(", mfaSwitch=").append(mfaSwitch); + sb.append(", flag=").append(flag); + sb.append(", createTime=").append(createTime); + sb.append(", creatorId=").append(creatorId); + sb.append(", modifyTime=").append(modifyTime); + sb.append(", modifierId=").append(modifierId); + sb.append(", apikey=").append(apikey); + sb.append(", auroraFlag=").append(auroraFlag); + sb.append(", auroraUrl=").append(auroraUrl); + sb.append(", auroraReadUrl=").append(auroraReadUrl); + sb.append(", auroraUsername=").append(auroraUsername); + sb.append(", auroraPassword=").append(auroraPassword); + sb.append(", redisDbId=").append(redisDbId); + sb.append(", thirdApiHost=").append(thirdApiHost); + sb.append(", lockSwitch=").append(lockSwitch); + sb.append(", bearerToken=").append(bearerToken); + sb.append(", serialVersionUID=").append(serialVersionUID); + sb.append("]"); + return sb.toString(); + } +} \ No newline at end of file diff --git a/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/model/BasicCompanyExample.java b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/model/BasicCompanyExample.java new file mode 100644 index 0000000..8920fe9 --- /dev/null +++ b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/model/BasicCompanyExample.java @@ -0,0 +1,1452 @@ +package com.dongjian.dashboard.back.model; + +import java.util.ArrayList; +import java.util.List; + +public class BasicCompanyExample { + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database table basic_company + * + * @mbg.generated + */ + protected String orderByClause; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database table basic_company + * + * @mbg.generated + */ + protected boolean distinct; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database table basic_company + * + * @mbg.generated + */ + protected List oredCriteria; + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table basic_company + * + * @mbg.generated + */ + public BasicCompanyExample() { + oredCriteria = new ArrayList(); + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table basic_company + * + * @mbg.generated + */ + public void setOrderByClause(String orderByClause) { + this.orderByClause = orderByClause; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table basic_company + * + * @mbg.generated + */ + public String getOrderByClause() { + return orderByClause; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table basic_company + * + * @mbg.generated + */ + public void setDistinct(boolean distinct) { + this.distinct = distinct; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table basic_company + * + * @mbg.generated + */ + public boolean isDistinct() { + return distinct; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table basic_company + * + * @mbg.generated + */ + public List getOredCriteria() { + return oredCriteria; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table basic_company + * + * @mbg.generated + */ + public void or(Criteria criteria) { + oredCriteria.add(criteria); + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table basic_company + * + * @mbg.generated + */ + public Criteria or() { + Criteria criteria = createCriteriaInternal(); + oredCriteria.add(criteria); + return criteria; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table basic_company + * + * @mbg.generated + */ + public Criteria createCriteria() { + Criteria criteria = createCriteriaInternal(); + if (oredCriteria.size() == 0) { + oredCriteria.add(criteria); + } + return criteria; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table basic_company + * + * @mbg.generated + */ + protected Criteria createCriteriaInternal() { + Criteria criteria = new Criteria(); + return criteria; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table basic_company + * + * @mbg.generated + */ + public void clear() { + oredCriteria.clear(); + orderByClause = null; + distinct = false; + } + + /** + * This class was generated by MyBatis Generator. + * This class corresponds to the database table basic_company + * + * @mbg.generated + */ + protected abstract static class GeneratedCriteria { + protected List criteria; + + protected GeneratedCriteria() { + super(); + criteria = new ArrayList(); + } + + public boolean isValid() { + return criteria.size() > 0; + } + + public List getAllCriteria() { + return criteria; + } + + public List getCriteria() { + return criteria; + } + + protected void addCriterion(String condition) { + if (condition == null) { + throw new RuntimeException("Value for condition cannot be null"); + } + criteria.add(new Criterion(condition)); + } + + protected void addCriterion(String condition, Object value, String property) { + if (value == null) { + throw new RuntimeException("Value for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value)); + } + + protected void addCriterion(String condition, Object value1, Object value2, String property) { + if (value1 == null || value2 == null) { + throw new RuntimeException("Between values for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value1, value2)); + } + + public Criteria andIdIsNull() { + addCriterion("id is null"); + return (Criteria) this; + } + + public Criteria andIdIsNotNull() { + addCriterion("id is not null"); + return (Criteria) this; + } + + public Criteria andIdEqualTo(Long value) { + addCriterion("id =", value, "id"); + return (Criteria) this; + } + + public Criteria andIdNotEqualTo(Long value) { + addCriterion("id <>", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThan(Long value) { + addCriterion("id >", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThanOrEqualTo(Long value) { + addCriterion("id >=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThan(Long value) { + addCriterion("id <", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThanOrEqualTo(Long value) { + addCriterion("id <=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdIn(List values) { + addCriterion("id in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdNotIn(List values) { + addCriterion("id not in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdBetween(Long value1, Long value2) { + addCriterion("id between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andIdNotBetween(Long value1, Long value2) { + addCriterion("id not between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andParentIdIsNull() { + addCriterion("parent_id is null"); + return (Criteria) this; + } + + public Criteria andParentIdIsNotNull() { + addCriterion("parent_id is not null"); + return (Criteria) this; + } + + public Criteria andParentIdEqualTo(Long value) { + addCriterion("parent_id =", value, "parentId"); + return (Criteria) this; + } + + public Criteria andParentIdNotEqualTo(Long value) { + addCriterion("parent_id <>", value, "parentId"); + return (Criteria) this; + } + + public Criteria andParentIdGreaterThan(Long value) { + addCriterion("parent_id >", value, "parentId"); + return (Criteria) this; + } + + public Criteria andParentIdGreaterThanOrEqualTo(Long value) { + addCriterion("parent_id >=", value, "parentId"); + return (Criteria) this; + } + + public Criteria andParentIdLessThan(Long value) { + addCriterion("parent_id <", value, "parentId"); + return (Criteria) this; + } + + public Criteria andParentIdLessThanOrEqualTo(Long value) { + addCriterion("parent_id <=", value, "parentId"); + return (Criteria) this; + } + + public Criteria andParentIdIn(List values) { + addCriterion("parent_id in", values, "parentId"); + return (Criteria) this; + } + + public Criteria andParentIdNotIn(List values) { + addCriterion("parent_id not in", values, "parentId"); + return (Criteria) this; + } + + public Criteria andParentIdBetween(Long value1, Long value2) { + addCriterion("parent_id between", value1, value2, "parentId"); + return (Criteria) this; + } + + public Criteria andParentIdNotBetween(Long value1, Long value2) { + addCriterion("parent_id not between", value1, value2, "parentId"); + return (Criteria) this; + } + + public Criteria andCompanyNameIsNull() { + addCriterion("company_name is null"); + return (Criteria) this; + } + + public Criteria andCompanyNameIsNotNull() { + addCriterion("company_name is not null"); + return (Criteria) this; + } + + public Criteria andCompanyNameEqualTo(String value) { + addCriterion("company_name =", value, "companyName"); + return (Criteria) this; + } + + public Criteria andCompanyNameNotEqualTo(String value) { + addCriterion("company_name <>", value, "companyName"); + return (Criteria) this; + } + + public Criteria andCompanyNameGreaterThan(String value) { + addCriterion("company_name >", value, "companyName"); + return (Criteria) this; + } + + public Criteria andCompanyNameGreaterThanOrEqualTo(String value) { + addCriterion("company_name >=", value, "companyName"); + return (Criteria) this; + } + + public Criteria andCompanyNameLessThan(String value) { + addCriterion("company_name <", value, "companyName"); + return (Criteria) this; + } + + public Criteria andCompanyNameLessThanOrEqualTo(String value) { + addCriterion("company_name <=", value, "companyName"); + return (Criteria) this; + } + + public Criteria andCompanyNameLike(String value) { + addCriterion("company_name like", value, "companyName"); + return (Criteria) this; + } + + public Criteria andCompanyNameNotLike(String value) { + addCriterion("company_name not like", value, "companyName"); + return (Criteria) this; + } + + public Criteria andCompanyNameIn(List values) { + addCriterion("company_name in", values, "companyName"); + return (Criteria) this; + } + + public Criteria andCompanyNameNotIn(List values) { + addCriterion("company_name not in", values, "companyName"); + return (Criteria) this; + } + + public Criteria andCompanyNameBetween(String value1, String value2) { + addCriterion("company_name between", value1, value2, "companyName"); + return (Criteria) this; + } + + public Criteria andCompanyNameNotBetween(String value1, String value2) { + addCriterion("company_name not between", value1, value2, "companyName"); + return (Criteria) this; + } + + public Criteria andMfaSwitchIsNull() { + addCriterion("mfa_switch is null"); + return (Criteria) this; + } + + public Criteria andMfaSwitchIsNotNull() { + addCriterion("mfa_switch is not null"); + return (Criteria) this; + } + + public Criteria andMfaSwitchEqualTo(Integer value) { + addCriterion("mfa_switch =", value, "mfaSwitch"); + return (Criteria) this; + } + + public Criteria andMfaSwitchNotEqualTo(Integer value) { + addCriterion("mfa_switch <>", value, "mfaSwitch"); + return (Criteria) this; + } + + public Criteria andMfaSwitchGreaterThan(Integer value) { + addCriterion("mfa_switch >", value, "mfaSwitch"); + return (Criteria) this; + } + + public Criteria andMfaSwitchGreaterThanOrEqualTo(Integer value) { + addCriterion("mfa_switch >=", value, "mfaSwitch"); + return (Criteria) this; + } + + public Criteria andMfaSwitchLessThan(Integer value) { + addCriterion("mfa_switch <", value, "mfaSwitch"); + return (Criteria) this; + } + + public Criteria andMfaSwitchLessThanOrEqualTo(Integer value) { + addCriterion("mfa_switch <=", value, "mfaSwitch"); + return (Criteria) this; + } + + public Criteria andMfaSwitchIn(List values) { + addCriterion("mfa_switch in", values, "mfaSwitch"); + return (Criteria) this; + } + + public Criteria andMfaSwitchNotIn(List values) { + addCriterion("mfa_switch not in", values, "mfaSwitch"); + return (Criteria) this; + } + + public Criteria andMfaSwitchBetween(Integer value1, Integer value2) { + addCriterion("mfa_switch between", value1, value2, "mfaSwitch"); + return (Criteria) this; + } + + public Criteria andMfaSwitchNotBetween(Integer value1, Integer value2) { + addCriterion("mfa_switch not between", value1, value2, "mfaSwitch"); + return (Criteria) this; + } + + public Criteria andFlagIsNull() { + addCriterion("flag is null"); + return (Criteria) this; + } + + public Criteria andFlagIsNotNull() { + addCriterion("flag is not null"); + return (Criteria) this; + } + + public Criteria andFlagEqualTo(Integer value) { + addCriterion("flag =", value, "flag"); + return (Criteria) this; + } + + public Criteria andFlagNotEqualTo(Integer value) { + addCriterion("flag <>", value, "flag"); + return (Criteria) this; + } + + public Criteria andFlagGreaterThan(Integer value) { + addCriterion("flag >", value, "flag"); + return (Criteria) this; + } + + public Criteria andFlagGreaterThanOrEqualTo(Integer value) { + addCriterion("flag >=", value, "flag"); + return (Criteria) this; + } + + public Criteria andFlagLessThan(Integer value) { + addCriterion("flag <", value, "flag"); + return (Criteria) this; + } + + public Criteria andFlagLessThanOrEqualTo(Integer value) { + addCriterion("flag <=", value, "flag"); + return (Criteria) this; + } + + public Criteria andFlagIn(List values) { + addCriterion("flag in", values, "flag"); + return (Criteria) this; + } + + public Criteria andFlagNotIn(List values) { + addCriterion("flag not in", values, "flag"); + return (Criteria) this; + } + + public Criteria andFlagBetween(Integer value1, Integer value2) { + addCriterion("flag between", value1, value2, "flag"); + return (Criteria) this; + } + + public Criteria andFlagNotBetween(Integer value1, Integer value2) { + addCriterion("flag not between", value1, value2, "flag"); + return (Criteria) this; + } + + public Criteria andCreateTimeIsNull() { + addCriterion("create_time is null"); + return (Criteria) this; + } + + public Criteria andCreateTimeIsNotNull() { + addCriterion("create_time is not null"); + return (Criteria) this; + } + + public Criteria andCreateTimeEqualTo(Long value) { + addCriterion("create_time =", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeNotEqualTo(Long value) { + addCriterion("create_time <>", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeGreaterThan(Long value) { + addCriterion("create_time >", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeGreaterThanOrEqualTo(Long value) { + addCriterion("create_time >=", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeLessThan(Long value) { + addCriterion("create_time <", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeLessThanOrEqualTo(Long value) { + addCriterion("create_time <=", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeIn(List values) { + addCriterion("create_time in", values, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeNotIn(List values) { + addCriterion("create_time not in", values, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeBetween(Long value1, Long value2) { + addCriterion("create_time between", value1, value2, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeNotBetween(Long value1, Long value2) { + addCriterion("create_time not between", value1, value2, "createTime"); + return (Criteria) this; + } + + public Criteria andCreatorIdIsNull() { + addCriterion("creator_id is null"); + return (Criteria) this; + } + + public Criteria andCreatorIdIsNotNull() { + addCriterion("creator_id is not null"); + return (Criteria) this; + } + + public Criteria andCreatorIdEqualTo(Long value) { + addCriterion("creator_id =", value, "creatorId"); + return (Criteria) this; + } + + public Criteria andCreatorIdNotEqualTo(Long value) { + addCriterion("creator_id <>", value, "creatorId"); + return (Criteria) this; + } + + public Criteria andCreatorIdGreaterThan(Long value) { + addCriterion("creator_id >", value, "creatorId"); + return (Criteria) this; + } + + public Criteria andCreatorIdGreaterThanOrEqualTo(Long value) { + addCriterion("creator_id >=", value, "creatorId"); + return (Criteria) this; + } + + public Criteria andCreatorIdLessThan(Long value) { + addCriterion("creator_id <", value, "creatorId"); + return (Criteria) this; + } + + public Criteria andCreatorIdLessThanOrEqualTo(Long value) { + addCriterion("creator_id <=", value, "creatorId"); + return (Criteria) this; + } + + public Criteria andCreatorIdIn(List values) { + addCriterion("creator_id in", values, "creatorId"); + return (Criteria) this; + } + + public Criteria andCreatorIdNotIn(List values) { + addCriterion("creator_id not in", values, "creatorId"); + return (Criteria) this; + } + + public Criteria andCreatorIdBetween(Long value1, Long value2) { + addCriterion("creator_id between", value1, value2, "creatorId"); + return (Criteria) this; + } + + public Criteria andCreatorIdNotBetween(Long value1, Long value2) { + addCriterion("creator_id not between", value1, value2, "creatorId"); + return (Criteria) this; + } + + public Criteria andModifyTimeIsNull() { + addCriterion("modify_time is null"); + return (Criteria) this; + } + + public Criteria andModifyTimeIsNotNull() { + addCriterion("modify_time is not null"); + return (Criteria) this; + } + + public Criteria andModifyTimeEqualTo(Long value) { + addCriterion("modify_time =", value, "modifyTime"); + return (Criteria) this; + } + + public Criteria andModifyTimeNotEqualTo(Long value) { + addCriterion("modify_time <>", value, "modifyTime"); + return (Criteria) this; + } + + public Criteria andModifyTimeGreaterThan(Long value) { + addCriterion("modify_time >", value, "modifyTime"); + return (Criteria) this; + } + + public Criteria andModifyTimeGreaterThanOrEqualTo(Long value) { + addCriterion("modify_time >=", value, "modifyTime"); + return (Criteria) this; + } + + public Criteria andModifyTimeLessThan(Long value) { + addCriterion("modify_time <", value, "modifyTime"); + return (Criteria) this; + } + + public Criteria andModifyTimeLessThanOrEqualTo(Long value) { + addCriterion("modify_time <=", value, "modifyTime"); + return (Criteria) this; + } + + public Criteria andModifyTimeIn(List values) { + addCriterion("modify_time in", values, "modifyTime"); + return (Criteria) this; + } + + public Criteria andModifyTimeNotIn(List values) { + addCriterion("modify_time not in", values, "modifyTime"); + return (Criteria) this; + } + + public Criteria andModifyTimeBetween(Long value1, Long value2) { + addCriterion("modify_time between", value1, value2, "modifyTime"); + return (Criteria) this; + } + + public Criteria andModifyTimeNotBetween(Long value1, Long value2) { + addCriterion("modify_time not between", value1, value2, "modifyTime"); + return (Criteria) this; + } + + public Criteria andModifierIdIsNull() { + addCriterion("modifier_id is null"); + return (Criteria) this; + } + + public Criteria andModifierIdIsNotNull() { + addCriterion("modifier_id is not null"); + return (Criteria) this; + } + + public Criteria andModifierIdEqualTo(Long value) { + addCriterion("modifier_id =", value, "modifierId"); + return (Criteria) this; + } + + public Criteria andModifierIdNotEqualTo(Long value) { + addCriterion("modifier_id <>", value, "modifierId"); + return (Criteria) this; + } + + public Criteria andModifierIdGreaterThan(Long value) { + addCriterion("modifier_id >", value, "modifierId"); + return (Criteria) this; + } + + public Criteria andModifierIdGreaterThanOrEqualTo(Long value) { + addCriterion("modifier_id >=", value, "modifierId"); + return (Criteria) this; + } + + public Criteria andModifierIdLessThan(Long value) { + addCriterion("modifier_id <", value, "modifierId"); + return (Criteria) this; + } + + public Criteria andModifierIdLessThanOrEqualTo(Long value) { + addCriterion("modifier_id <=", value, "modifierId"); + return (Criteria) this; + } + + public Criteria andModifierIdIn(List values) { + addCriterion("modifier_id in", values, "modifierId"); + return (Criteria) this; + } + + public Criteria andModifierIdNotIn(List values) { + addCriterion("modifier_id not in", values, "modifierId"); + return (Criteria) this; + } + + public Criteria andModifierIdBetween(Long value1, Long value2) { + addCriterion("modifier_id between", value1, value2, "modifierId"); + return (Criteria) this; + } + + public Criteria andModifierIdNotBetween(Long value1, Long value2) { + addCriterion("modifier_id not between", value1, value2, "modifierId"); + return (Criteria) this; + } + + public Criteria andApikeyIsNull() { + addCriterion("apikey is null"); + return (Criteria) this; + } + + public Criteria andApikeyIsNotNull() { + addCriterion("apikey is not null"); + return (Criteria) this; + } + + public Criteria andApikeyEqualTo(String value) { + addCriterion("apikey =", value, "apikey"); + return (Criteria) this; + } + + public Criteria andApikeyNotEqualTo(String value) { + addCriterion("apikey <>", value, "apikey"); + return (Criteria) this; + } + + public Criteria andApikeyGreaterThan(String value) { + addCriterion("apikey >", value, "apikey"); + return (Criteria) this; + } + + public Criteria andApikeyGreaterThanOrEqualTo(String value) { + addCriterion("apikey >=", value, "apikey"); + return (Criteria) this; + } + + public Criteria andApikeyLessThan(String value) { + addCriterion("apikey <", value, "apikey"); + return (Criteria) this; + } + + public Criteria andApikeyLessThanOrEqualTo(String value) { + addCriterion("apikey <=", value, "apikey"); + return (Criteria) this; + } + + public Criteria andApikeyLike(String value) { + addCriterion("apikey like", value, "apikey"); + return (Criteria) this; + } + + public Criteria andApikeyNotLike(String value) { + addCriterion("apikey not like", value, "apikey"); + return (Criteria) this; + } + + public Criteria andApikeyIn(List values) { + addCriterion("apikey in", values, "apikey"); + return (Criteria) this; + } + + public Criteria andApikeyNotIn(List values) { + addCriterion("apikey not in", values, "apikey"); + return (Criteria) this; + } + + public Criteria andApikeyBetween(String value1, String value2) { + addCriterion("apikey between", value1, value2, "apikey"); + return (Criteria) this; + } + + public Criteria andApikeyNotBetween(String value1, String value2) { + addCriterion("apikey not between", value1, value2, "apikey"); + return (Criteria) this; + } + + public Criteria andAuroraFlagIsNull() { + addCriterion("aurora_flag is null"); + return (Criteria) this; + } + + public Criteria andAuroraFlagIsNotNull() { + addCriterion("aurora_flag is not null"); + return (Criteria) this; + } + + public Criteria andAuroraFlagEqualTo(Integer value) { + addCriterion("aurora_flag =", value, "auroraFlag"); + return (Criteria) this; + } + + public Criteria andAuroraFlagNotEqualTo(Integer value) { + addCriterion("aurora_flag <>", value, "auroraFlag"); + return (Criteria) this; + } + + public Criteria andAuroraFlagGreaterThan(Integer value) { + addCriterion("aurora_flag >", value, "auroraFlag"); + return (Criteria) this; + } + + public Criteria andAuroraFlagGreaterThanOrEqualTo(Integer value) { + addCriterion("aurora_flag >=", value, "auroraFlag"); + return (Criteria) this; + } + + public Criteria andAuroraFlagLessThan(Integer value) { + addCriterion("aurora_flag <", value, "auroraFlag"); + return (Criteria) this; + } + + public Criteria andAuroraFlagLessThanOrEqualTo(Integer value) { + addCriterion("aurora_flag <=", value, "auroraFlag"); + return (Criteria) this; + } + + public Criteria andAuroraFlagIn(List values) { + addCriterion("aurora_flag in", values, "auroraFlag"); + return (Criteria) this; + } + + public Criteria andAuroraFlagNotIn(List values) { + addCriterion("aurora_flag not in", values, "auroraFlag"); + return (Criteria) this; + } + + public Criteria andAuroraFlagBetween(Integer value1, Integer value2) { + addCriterion("aurora_flag between", value1, value2, "auroraFlag"); + return (Criteria) this; + } + + public Criteria andAuroraFlagNotBetween(Integer value1, Integer value2) { + addCriterion("aurora_flag not between", value1, value2, "auroraFlag"); + return (Criteria) this; + } + + public Criteria andAuroraUrlIsNull() { + addCriterion("aurora_url is null"); + return (Criteria) this; + } + + public Criteria andAuroraUrlIsNotNull() { + addCriterion("aurora_url is not null"); + return (Criteria) this; + } + + public Criteria andAuroraUrlEqualTo(String value) { + addCriterion("aurora_url =", value, "auroraUrl"); + return (Criteria) this; + } + + public Criteria andAuroraUrlNotEqualTo(String value) { + addCriterion("aurora_url <>", value, "auroraUrl"); + return (Criteria) this; + } + + public Criteria andAuroraUrlGreaterThan(String value) { + addCriterion("aurora_url >", value, "auroraUrl"); + return (Criteria) this; + } + + public Criteria andAuroraUrlGreaterThanOrEqualTo(String value) { + addCriterion("aurora_url >=", value, "auroraUrl"); + return (Criteria) this; + } + + public Criteria andAuroraUrlLessThan(String value) { + addCriterion("aurora_url <", value, "auroraUrl"); + return (Criteria) this; + } + + public Criteria andAuroraUrlLessThanOrEqualTo(String value) { + addCriterion("aurora_url <=", value, "auroraUrl"); + return (Criteria) this; + } + + public Criteria andAuroraUrlLike(String value) { + addCriterion("aurora_url like", value, "auroraUrl"); + return (Criteria) this; + } + + public Criteria andAuroraUrlNotLike(String value) { + addCriterion("aurora_url not like", value, "auroraUrl"); + return (Criteria) this; + } + + public Criteria andAuroraUrlIn(List values) { + addCriterion("aurora_url in", values, "auroraUrl"); + return (Criteria) this; + } + + public Criteria andAuroraUrlNotIn(List values) { + addCriterion("aurora_url not in", values, "auroraUrl"); + return (Criteria) this; + } + + public Criteria andAuroraUrlBetween(String value1, String value2) { + addCriterion("aurora_url between", value1, value2, "auroraUrl"); + return (Criteria) this; + } + + public Criteria andAuroraUrlNotBetween(String value1, String value2) { + addCriterion("aurora_url not between", value1, value2, "auroraUrl"); + return (Criteria) this; + } + + public Criteria andAuroraReadUrlIsNull() { + addCriterion("aurora_read_url is null"); + return (Criteria) this; + } + + public Criteria andAuroraReadUrlIsNotNull() { + addCriterion("aurora_read_url is not null"); + return (Criteria) this; + } + + public Criteria andAuroraReadUrlEqualTo(String value) { + addCriterion("aurora_read_url =", value, "auroraReadUrl"); + return (Criteria) this; + } + + public Criteria andAuroraReadUrlNotEqualTo(String value) { + addCriterion("aurora_read_url <>", value, "auroraReadUrl"); + return (Criteria) this; + } + + public Criteria andAuroraReadUrlGreaterThan(String value) { + addCriterion("aurora_read_url >", value, "auroraReadUrl"); + return (Criteria) this; + } + + public Criteria andAuroraReadUrlGreaterThanOrEqualTo(String value) { + addCriterion("aurora_read_url >=", value, "auroraReadUrl"); + return (Criteria) this; + } + + public Criteria andAuroraReadUrlLessThan(String value) { + addCriterion("aurora_read_url <", value, "auroraReadUrl"); + return (Criteria) this; + } + + public Criteria andAuroraReadUrlLessThanOrEqualTo(String value) { + addCriterion("aurora_read_url <=", value, "auroraReadUrl"); + return (Criteria) this; + } + + public Criteria andAuroraReadUrlLike(String value) { + addCriterion("aurora_read_url like", value, "auroraReadUrl"); + return (Criteria) this; + } + + public Criteria andAuroraReadUrlNotLike(String value) { + addCriterion("aurora_read_url not like", value, "auroraReadUrl"); + return (Criteria) this; + } + + public Criteria andAuroraReadUrlIn(List values) { + addCriterion("aurora_read_url in", values, "auroraReadUrl"); + return (Criteria) this; + } + + public Criteria andAuroraReadUrlNotIn(List values) { + addCriterion("aurora_read_url not in", values, "auroraReadUrl"); + return (Criteria) this; + } + + public Criteria andAuroraReadUrlBetween(String value1, String value2) { + addCriterion("aurora_read_url between", value1, value2, "auroraReadUrl"); + return (Criteria) this; + } + + public Criteria andAuroraReadUrlNotBetween(String value1, String value2) { + addCriterion("aurora_read_url not between", value1, value2, "auroraReadUrl"); + return (Criteria) this; + } + + public Criteria andAuroraUsernameIsNull() { + addCriterion("aurora_username is null"); + return (Criteria) this; + } + + public Criteria andAuroraUsernameIsNotNull() { + addCriterion("aurora_username is not null"); + return (Criteria) this; + } + + public Criteria andAuroraUsernameEqualTo(String value) { + addCriterion("aurora_username =", value, "auroraUsername"); + return (Criteria) this; + } + + public Criteria andAuroraUsernameNotEqualTo(String value) { + addCriterion("aurora_username <>", value, "auroraUsername"); + return (Criteria) this; + } + + public Criteria andAuroraUsernameGreaterThan(String value) { + addCriterion("aurora_username >", value, "auroraUsername"); + return (Criteria) this; + } + + public Criteria andAuroraUsernameGreaterThanOrEqualTo(String value) { + addCriterion("aurora_username >=", value, "auroraUsername"); + return (Criteria) this; + } + + public Criteria andAuroraUsernameLessThan(String value) { + addCriterion("aurora_username <", value, "auroraUsername"); + return (Criteria) this; + } + + public Criteria andAuroraUsernameLessThanOrEqualTo(String value) { + addCriterion("aurora_username <=", value, "auroraUsername"); + return (Criteria) this; + } + + public Criteria andAuroraUsernameLike(String value) { + addCriterion("aurora_username like", value, "auroraUsername"); + return (Criteria) this; + } + + public Criteria andAuroraUsernameNotLike(String value) { + addCriterion("aurora_username not like", value, "auroraUsername"); + return (Criteria) this; + } + + public Criteria andAuroraUsernameIn(List values) { + addCriterion("aurora_username in", values, "auroraUsername"); + return (Criteria) this; + } + + public Criteria andAuroraUsernameNotIn(List values) { + addCriterion("aurora_username not in", values, "auroraUsername"); + return (Criteria) this; + } + + public Criteria andAuroraUsernameBetween(String value1, String value2) { + addCriterion("aurora_username between", value1, value2, "auroraUsername"); + return (Criteria) this; + } + + public Criteria andAuroraUsernameNotBetween(String value1, String value2) { + addCriterion("aurora_username not between", value1, value2, "auroraUsername"); + return (Criteria) this; + } + + public Criteria andAuroraPasswordIsNull() { + addCriterion("aurora_password is null"); + return (Criteria) this; + } + + public Criteria andAuroraPasswordIsNotNull() { + addCriterion("aurora_password is not null"); + return (Criteria) this; + } + + public Criteria andAuroraPasswordEqualTo(String value) { + addCriterion("aurora_password =", value, "auroraPassword"); + return (Criteria) this; + } + + public Criteria andAuroraPasswordNotEqualTo(String value) { + addCriterion("aurora_password <>", value, "auroraPassword"); + return (Criteria) this; + } + + public Criteria andAuroraPasswordGreaterThan(String value) { + addCriterion("aurora_password >", value, "auroraPassword"); + return (Criteria) this; + } + + public Criteria andAuroraPasswordGreaterThanOrEqualTo(String value) { + addCriterion("aurora_password >=", value, "auroraPassword"); + return (Criteria) this; + } + + public Criteria andAuroraPasswordLessThan(String value) { + addCriterion("aurora_password <", value, "auroraPassword"); + return (Criteria) this; + } + + public Criteria andAuroraPasswordLessThanOrEqualTo(String value) { + addCriterion("aurora_password <=", value, "auroraPassword"); + return (Criteria) this; + } + + public Criteria andAuroraPasswordLike(String value) { + addCriterion("aurora_password like", value, "auroraPassword"); + return (Criteria) this; + } + + public Criteria andAuroraPasswordNotLike(String value) { + addCriterion("aurora_password not like", value, "auroraPassword"); + return (Criteria) this; + } + + public Criteria andAuroraPasswordIn(List values) { + addCriterion("aurora_password in", values, "auroraPassword"); + return (Criteria) this; + } + + public Criteria andAuroraPasswordNotIn(List values) { + addCriterion("aurora_password not in", values, "auroraPassword"); + return (Criteria) this; + } + + public Criteria andAuroraPasswordBetween(String value1, String value2) { + addCriterion("aurora_password between", value1, value2, "auroraPassword"); + return (Criteria) this; + } + + public Criteria andAuroraPasswordNotBetween(String value1, String value2) { + addCriterion("aurora_password not between", value1, value2, "auroraPassword"); + return (Criteria) this; + } + + public Criteria andRedisDbIdIsNull() { + addCriterion("redis_db_id is null"); + return (Criteria) this; + } + + public Criteria andRedisDbIdIsNotNull() { + addCriterion("redis_db_id is not null"); + return (Criteria) this; + } + + public Criteria andRedisDbIdEqualTo(Integer value) { + addCriterion("redis_db_id =", value, "redisDbId"); + return (Criteria) this; + } + + public Criteria andRedisDbIdNotEqualTo(Integer value) { + addCriterion("redis_db_id <>", value, "redisDbId"); + return (Criteria) this; + } + + public Criteria andRedisDbIdGreaterThan(Integer value) { + addCriterion("redis_db_id >", value, "redisDbId"); + return (Criteria) this; + } + + public Criteria andRedisDbIdGreaterThanOrEqualTo(Integer value) { + addCriterion("redis_db_id >=", value, "redisDbId"); + return (Criteria) this; + } + + public Criteria andRedisDbIdLessThan(Integer value) { + addCriterion("redis_db_id <", value, "redisDbId"); + return (Criteria) this; + } + + public Criteria andRedisDbIdLessThanOrEqualTo(Integer value) { + addCriterion("redis_db_id <=", value, "redisDbId"); + return (Criteria) this; + } + + public Criteria andRedisDbIdIn(List values) { + addCriterion("redis_db_id in", values, "redisDbId"); + return (Criteria) this; + } + + public Criteria andRedisDbIdNotIn(List values) { + addCriterion("redis_db_id not in", values, "redisDbId"); + return (Criteria) this; + } + + public Criteria andRedisDbIdBetween(Integer value1, Integer value2) { + addCriterion("redis_db_id between", value1, value2, "redisDbId"); + return (Criteria) this; + } + + public Criteria andRedisDbIdNotBetween(Integer value1, Integer value2) { + addCriterion("redis_db_id not between", value1, value2, "redisDbId"); + return (Criteria) this; + } + + public Criteria andThirdApiHostIsNull() { + addCriterion("third_api_host is null"); + return (Criteria) this; + } + + public Criteria andThirdApiHostIsNotNull() { + addCriterion("third_api_host is not null"); + return (Criteria) this; + } + + public Criteria andThirdApiHostEqualTo(String value) { + addCriterion("third_api_host =", value, "thirdApiHost"); + return (Criteria) this; + } + + public Criteria andThirdApiHostNotEqualTo(String value) { + addCriterion("third_api_host <>", value, "thirdApiHost"); + return (Criteria) this; + } + + public Criteria andThirdApiHostGreaterThan(String value) { + addCriterion("third_api_host >", value, "thirdApiHost"); + return (Criteria) this; + } + + public Criteria andThirdApiHostGreaterThanOrEqualTo(String value) { + addCriterion("third_api_host >=", value, "thirdApiHost"); + return (Criteria) this; + } + + public Criteria andThirdApiHostLessThan(String value) { + addCriterion("third_api_host <", value, "thirdApiHost"); + return (Criteria) this; + } + + public Criteria andThirdApiHostLessThanOrEqualTo(String value) { + addCriterion("third_api_host <=", value, "thirdApiHost"); + return (Criteria) this; + } + + public Criteria andThirdApiHostLike(String value) { + addCriterion("third_api_host like", value, "thirdApiHost"); + return (Criteria) this; + } + + public Criteria andThirdApiHostNotLike(String value) { + addCriterion("third_api_host not like", value, "thirdApiHost"); + return (Criteria) this; + } + + public Criteria andThirdApiHostIn(List values) { + addCriterion("third_api_host in", values, "thirdApiHost"); + return (Criteria) this; + } + + public Criteria andThirdApiHostNotIn(List values) { + addCriterion("third_api_host not in", values, "thirdApiHost"); + return (Criteria) this; + } + + public Criteria andThirdApiHostBetween(String value1, String value2) { + addCriterion("third_api_host between", value1, value2, "thirdApiHost"); + return (Criteria) this; + } + + public Criteria andThirdApiHostNotBetween(String value1, String value2) { + addCriterion("third_api_host not between", value1, value2, "thirdApiHost"); + return (Criteria) this; + } + + public Criteria andLockSwitchIsNull() { + addCriterion("lock_switch is null"); + return (Criteria) this; + } + + public Criteria andLockSwitchIsNotNull() { + addCriterion("lock_switch is not null"); + return (Criteria) this; + } + + public Criteria andLockSwitchEqualTo(Integer value) { + addCriterion("lock_switch =", value, "lockSwitch"); + return (Criteria) this; + } + + public Criteria andLockSwitchNotEqualTo(Integer value) { + addCriterion("lock_switch <>", value, "lockSwitch"); + return (Criteria) this; + } + + public Criteria andLockSwitchGreaterThan(Integer value) { + addCriterion("lock_switch >", value, "lockSwitch"); + return (Criteria) this; + } + + public Criteria andLockSwitchGreaterThanOrEqualTo(Integer value) { + addCriterion("lock_switch >=", value, "lockSwitch"); + return (Criteria) this; + } + + public Criteria andLockSwitchLessThan(Integer value) { + addCriterion("lock_switch <", value, "lockSwitch"); + return (Criteria) this; + } + + public Criteria andLockSwitchLessThanOrEqualTo(Integer value) { + addCriterion("lock_switch <=", value, "lockSwitch"); + return (Criteria) this; + } + + public Criteria andLockSwitchIn(List values) { + addCriterion("lock_switch in", values, "lockSwitch"); + return (Criteria) this; + } + + public Criteria andLockSwitchNotIn(List values) { + addCriterion("lock_switch not in", values, "lockSwitch"); + return (Criteria) this; + } + + public Criteria andLockSwitchBetween(Integer value1, Integer value2) { + addCriterion("lock_switch between", value1, value2, "lockSwitch"); + return (Criteria) this; + } + + public Criteria andLockSwitchNotBetween(Integer value1, Integer value2) { + addCriterion("lock_switch not between", value1, value2, "lockSwitch"); + return (Criteria) this; + } + } + + /** + * This class was generated by MyBatis Generator. + * This class corresponds to the database table basic_company + * + * @mbg.generated do_not_delete_during_merge + */ + public static class Criteria extends GeneratedCriteria { + + protected Criteria() { + super(); + } + } + + /** + * This class was generated by MyBatis Generator. + * This class corresponds to the database table basic_company + * + * @mbg.generated + */ + public static class Criterion { + private String condition; + + private Object value; + + private Object secondValue; + + private boolean noValue; + + private boolean singleValue; + + private boolean betweenValue; + + private boolean listValue; + + private String typeHandler; + + public String getCondition() { + return condition; + } + + public Object getValue() { + return value; + } + + public Object getSecondValue() { + return secondValue; + } + + public boolean isNoValue() { + return noValue; + } + + public boolean isSingleValue() { + return singleValue; + } + + public boolean isBetweenValue() { + return betweenValue; + } + + public boolean isListValue() { + return listValue; + } + + public String getTypeHandler() { + return typeHandler; + } + + protected Criterion(String condition) { + super(); + this.condition = condition; + this.typeHandler = null; + this.noValue = true; + } + + protected Criterion(String condition, Object value, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.typeHandler = typeHandler; + if (value instanceof List) { + this.listValue = true; + } else { + this.singleValue = true; + } + } + + protected Criterion(String condition, Object value) { + this(condition, value, null); + } + + protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.secondValue = secondValue; + this.typeHandler = typeHandler; + this.betweenValue = true; + } + + protected Criterion(String condition, Object value, Object secondValue) { + this(condition, value, secondValue, null); + } + } +} \ No newline at end of file diff --git a/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/model/BasicMenu.java b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/model/BasicMenu.java new file mode 100644 index 0000000..cbc4e0f --- /dev/null +++ b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/model/BasicMenu.java @@ -0,0 +1,336 @@ +package com.dongjian.dashboard.back.model; + +import java.io.Serializable; + +public class BasicMenu implements Serializable { + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column basic_menu.id + * + * @mbg.generated + */ + private Long id; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column basic_menu.parent_menu_id + * + * @mbg.generated + */ + private Long parentMenuId; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column basic_menu.menu_name + * + * @mbg.generated + */ + private String menuName; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column basic_menu.menu_name_en + * + * @mbg.generated + */ + private String menuNameEn; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column basic_menu.menu_name_jp + * + * @mbg.generated + */ + private String menuNameJp; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column basic_menu.remark + * + * @mbg.generated + */ + private String remark; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column basic_menu.menu_level + * + * @mbg.generated + */ + private Integer menuLevel; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column basic_menu.flag + * + * @mbg.generated + */ + private Integer flag; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column basic_menu.create_time + * + * @mbg.generated + */ + private Long createTime; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database table basic_menu + * + * @mbg.generated + */ + private static final long serialVersionUID = 1L; + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column basic_menu.id + * + * @return the value of basic_menu.id + * + * @mbg.generated + */ + public Long getId() { + return id; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column basic_menu.id + * + * @param id the value for basic_menu.id + * + * @mbg.generated + */ + public void setId(Long id) { + this.id = id; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column basic_menu.parent_menu_id + * + * @return the value of basic_menu.parent_menu_id + * + * @mbg.generated + */ + public Long getParentMenuId() { + return parentMenuId; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column basic_menu.parent_menu_id + * + * @param parentMenuId the value for basic_menu.parent_menu_id + * + * @mbg.generated + */ + public void setParentMenuId(Long parentMenuId) { + this.parentMenuId = parentMenuId; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column basic_menu.menu_name + * + * @return the value of basic_menu.menu_name + * + * @mbg.generated + */ + public String getMenuName() { + return menuName; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column basic_menu.menu_name + * + * @param menuName the value for basic_menu.menu_name + * + * @mbg.generated + */ + public void setMenuName(String menuName) { + this.menuName = menuName == null ? null : menuName.trim(); + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column basic_menu.menu_name_en + * + * @return the value of basic_menu.menu_name_en + * + * @mbg.generated + */ + public String getMenuNameEn() { + return menuNameEn; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column basic_menu.menu_name_en + * + * @param menuNameEn the value for basic_menu.menu_name_en + * + * @mbg.generated + */ + public void setMenuNameEn(String menuNameEn) { + this.menuNameEn = menuNameEn == null ? null : menuNameEn.trim(); + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column basic_menu.menu_name_jp + * + * @return the value of basic_menu.menu_name_jp + * + * @mbg.generated + */ + public String getMenuNameJp() { + return menuNameJp; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column basic_menu.menu_name_jp + * + * @param menuNameJp the value for basic_menu.menu_name_jp + * + * @mbg.generated + */ + public void setMenuNameJp(String menuNameJp) { + this.menuNameJp = menuNameJp == null ? null : menuNameJp.trim(); + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column basic_menu.remark + * + * @return the value of basic_menu.remark + * + * @mbg.generated + */ + public String getRemark() { + return remark; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column basic_menu.remark + * + * @param remark the value for basic_menu.remark + * + * @mbg.generated + */ + public void setRemark(String remark) { + this.remark = remark == null ? null : remark.trim(); + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column basic_menu.menu_level + * + * @return the value of basic_menu.menu_level + * + * @mbg.generated + */ + public Integer getMenuLevel() { + return menuLevel; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column basic_menu.menu_level + * + * @param menuLevel the value for basic_menu.menu_level + * + * @mbg.generated + */ + public void setMenuLevel(Integer menuLevel) { + this.menuLevel = menuLevel; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column basic_menu.flag + * + * @return the value of basic_menu.flag + * + * @mbg.generated + */ + public Integer getFlag() { + return flag; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column basic_menu.flag + * + * @param flag the value for basic_menu.flag + * + * @mbg.generated + */ + public void setFlag(Integer flag) { + this.flag = flag; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column basic_menu.create_time + * + * @return the value of basic_menu.create_time + * + * @mbg.generated + */ + public Long getCreateTime() { + return createTime; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column basic_menu.create_time + * + * @param createTime the value for basic_menu.create_time + * + * @mbg.generated + */ + public void setCreateTime(Long createTime) { + this.createTime = createTime; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table basic_menu + * + * @mbg.generated + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append(getClass().getSimpleName()); + sb.append(" ["); + sb.append("Hash = ").append(hashCode()); + sb.append(", id=").append(id); + sb.append(", parentMenuId=").append(parentMenuId); + sb.append(", menuName=").append(menuName); + sb.append(", menuNameEn=").append(menuNameEn); + sb.append(", menuNameJp=").append(menuNameJp); + sb.append(", remark=").append(remark); + sb.append(", menuLevel=").append(menuLevel); + sb.append(", flag=").append(flag); + sb.append(", createTime=").append(createTime); + sb.append(", serialVersionUID=").append(serialVersionUID); + sb.append("]"); + return sb.toString(); + } +} \ No newline at end of file diff --git a/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/model/BasicMenuExample.java b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/model/BasicMenuExample.java new file mode 100644 index 0000000..255761c --- /dev/null +++ b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/model/BasicMenuExample.java @@ -0,0 +1,882 @@ +package com.dongjian.dashboard.back.model; + +import java.util.ArrayList; +import java.util.List; + +public class BasicMenuExample { + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database table basic_menu + * + * @mbg.generated + */ + protected String orderByClause; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database table basic_menu + * + * @mbg.generated + */ + protected boolean distinct; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database table basic_menu + * + * @mbg.generated + */ + protected List oredCriteria; + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table basic_menu + * + * @mbg.generated + */ + public BasicMenuExample() { + oredCriteria = new ArrayList(); + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table basic_menu + * + * @mbg.generated + */ + public void setOrderByClause(String orderByClause) { + this.orderByClause = orderByClause; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table basic_menu + * + * @mbg.generated + */ + public String getOrderByClause() { + return orderByClause; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table basic_menu + * + * @mbg.generated + */ + public void setDistinct(boolean distinct) { + this.distinct = distinct; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table basic_menu + * + * @mbg.generated + */ + public boolean isDistinct() { + return distinct; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table basic_menu + * + * @mbg.generated + */ + public List getOredCriteria() { + return oredCriteria; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table basic_menu + * + * @mbg.generated + */ + public void or(Criteria criteria) { + oredCriteria.add(criteria); + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table basic_menu + * + * @mbg.generated + */ + public Criteria or() { + Criteria criteria = createCriteriaInternal(); + oredCriteria.add(criteria); + return criteria; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table basic_menu + * + * @mbg.generated + */ + public Criteria createCriteria() { + Criteria criteria = createCriteriaInternal(); + if (oredCriteria.size() == 0) { + oredCriteria.add(criteria); + } + return criteria; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table basic_menu + * + * @mbg.generated + */ + protected Criteria createCriteriaInternal() { + Criteria criteria = new Criteria(); + return criteria; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table basic_menu + * + * @mbg.generated + */ + public void clear() { + oredCriteria.clear(); + orderByClause = null; + distinct = false; + } + + /** + * This class was generated by MyBatis Generator. + * This class corresponds to the database table basic_menu + * + * @mbg.generated + */ + protected abstract static class GeneratedCriteria { + protected List criteria; + + protected GeneratedCriteria() { + super(); + criteria = new ArrayList(); + } + + public boolean isValid() { + return criteria.size() > 0; + } + + public List getAllCriteria() { + return criteria; + } + + public List getCriteria() { + return criteria; + } + + protected void addCriterion(String condition) { + if (condition == null) { + throw new RuntimeException("Value for condition cannot be null"); + } + criteria.add(new Criterion(condition)); + } + + protected void addCriterion(String condition, Object value, String property) { + if (value == null) { + throw new RuntimeException("Value for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value)); + } + + protected void addCriterion(String condition, Object value1, Object value2, String property) { + if (value1 == null || value2 == null) { + throw new RuntimeException("Between values for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value1, value2)); + } + + public Criteria andIdIsNull() { + addCriterion("id is null"); + return (Criteria) this; + } + + public Criteria andIdIsNotNull() { + addCriterion("id is not null"); + return (Criteria) this; + } + + public Criteria andIdEqualTo(Long value) { + addCriterion("id =", value, "id"); + return (Criteria) this; + } + + public Criteria andIdNotEqualTo(Long value) { + addCriterion("id <>", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThan(Long value) { + addCriterion("id >", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThanOrEqualTo(Long value) { + addCriterion("id >=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThan(Long value) { + addCriterion("id <", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThanOrEqualTo(Long value) { + addCriterion("id <=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdIn(List values) { + addCriterion("id in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdNotIn(List values) { + addCriterion("id not in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdBetween(Long value1, Long value2) { + addCriterion("id between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andIdNotBetween(Long value1, Long value2) { + addCriterion("id not between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andParentMenuIdIsNull() { + addCriterion("parent_menu_id is null"); + return (Criteria) this; + } + + public Criteria andParentMenuIdIsNotNull() { + addCriterion("parent_menu_id is not null"); + return (Criteria) this; + } + + public Criteria andParentMenuIdEqualTo(Long value) { + addCriterion("parent_menu_id =", value, "parentMenuId"); + return (Criteria) this; + } + + public Criteria andParentMenuIdNotEqualTo(Long value) { + addCriterion("parent_menu_id <>", value, "parentMenuId"); + return (Criteria) this; + } + + public Criteria andParentMenuIdGreaterThan(Long value) { + addCriterion("parent_menu_id >", value, "parentMenuId"); + return (Criteria) this; + } + + public Criteria andParentMenuIdGreaterThanOrEqualTo(Long value) { + addCriterion("parent_menu_id >=", value, "parentMenuId"); + return (Criteria) this; + } + + public Criteria andParentMenuIdLessThan(Long value) { + addCriterion("parent_menu_id <", value, "parentMenuId"); + return (Criteria) this; + } + + public Criteria andParentMenuIdLessThanOrEqualTo(Long value) { + addCriterion("parent_menu_id <=", value, "parentMenuId"); + return (Criteria) this; + } + + public Criteria andParentMenuIdIn(List values) { + addCriterion("parent_menu_id in", values, "parentMenuId"); + return (Criteria) this; + } + + public Criteria andParentMenuIdNotIn(List values) { + addCriterion("parent_menu_id not in", values, "parentMenuId"); + return (Criteria) this; + } + + public Criteria andParentMenuIdBetween(Long value1, Long value2) { + addCriterion("parent_menu_id between", value1, value2, "parentMenuId"); + return (Criteria) this; + } + + public Criteria andParentMenuIdNotBetween(Long value1, Long value2) { + addCriterion("parent_menu_id not between", value1, value2, "parentMenuId"); + return (Criteria) this; + } + + public Criteria andMenuNameIsNull() { + addCriterion("menu_name is null"); + return (Criteria) this; + } + + public Criteria andMenuNameIsNotNull() { + addCriterion("menu_name is not null"); + return (Criteria) this; + } + + public Criteria andMenuNameEqualTo(String value) { + addCriterion("menu_name =", value, "menuName"); + return (Criteria) this; + } + + public Criteria andMenuNameNotEqualTo(String value) { + addCriterion("menu_name <>", value, "menuName"); + return (Criteria) this; + } + + public Criteria andMenuNameGreaterThan(String value) { + addCriterion("menu_name >", value, "menuName"); + return (Criteria) this; + } + + public Criteria andMenuNameGreaterThanOrEqualTo(String value) { + addCriterion("menu_name >=", value, "menuName"); + return (Criteria) this; + } + + public Criteria andMenuNameLessThan(String value) { + addCriterion("menu_name <", value, "menuName"); + return (Criteria) this; + } + + public Criteria andMenuNameLessThanOrEqualTo(String value) { + addCriterion("menu_name <=", value, "menuName"); + return (Criteria) this; + } + + public Criteria andMenuNameLike(String value) { + addCriterion("menu_name like", value, "menuName"); + return (Criteria) this; + } + + public Criteria andMenuNameNotLike(String value) { + addCriterion("menu_name not like", value, "menuName"); + return (Criteria) this; + } + + public Criteria andMenuNameIn(List values) { + addCriterion("menu_name in", values, "menuName"); + return (Criteria) this; + } + + public Criteria andMenuNameNotIn(List values) { + addCriterion("menu_name not in", values, "menuName"); + return (Criteria) this; + } + + public Criteria andMenuNameBetween(String value1, String value2) { + addCriterion("menu_name between", value1, value2, "menuName"); + return (Criteria) this; + } + + public Criteria andMenuNameNotBetween(String value1, String value2) { + addCriterion("menu_name not between", value1, value2, "menuName"); + return (Criteria) this; + } + + public Criteria andMenuNameEnIsNull() { + addCriterion("menu_name_en is null"); + return (Criteria) this; + } + + public Criteria andMenuNameEnIsNotNull() { + addCriterion("menu_name_en is not null"); + return (Criteria) this; + } + + public Criteria andMenuNameEnEqualTo(String value) { + addCriterion("menu_name_en =", value, "menuNameEn"); + return (Criteria) this; + } + + public Criteria andMenuNameEnNotEqualTo(String value) { + addCriterion("menu_name_en <>", value, "menuNameEn"); + return (Criteria) this; + } + + public Criteria andMenuNameEnGreaterThan(String value) { + addCriterion("menu_name_en >", value, "menuNameEn"); + return (Criteria) this; + } + + public Criteria andMenuNameEnGreaterThanOrEqualTo(String value) { + addCriterion("menu_name_en >=", value, "menuNameEn"); + return (Criteria) this; + } + + public Criteria andMenuNameEnLessThan(String value) { + addCriterion("menu_name_en <", value, "menuNameEn"); + return (Criteria) this; + } + + public Criteria andMenuNameEnLessThanOrEqualTo(String value) { + addCriterion("menu_name_en <=", value, "menuNameEn"); + return (Criteria) this; + } + + public Criteria andMenuNameEnLike(String value) { + addCriterion("menu_name_en like", value, "menuNameEn"); + return (Criteria) this; + } + + public Criteria andMenuNameEnNotLike(String value) { + addCriterion("menu_name_en not like", value, "menuNameEn"); + return (Criteria) this; + } + + public Criteria andMenuNameEnIn(List values) { + addCriterion("menu_name_en in", values, "menuNameEn"); + return (Criteria) this; + } + + public Criteria andMenuNameEnNotIn(List values) { + addCriterion("menu_name_en not in", values, "menuNameEn"); + return (Criteria) this; + } + + public Criteria andMenuNameEnBetween(String value1, String value2) { + addCriterion("menu_name_en between", value1, value2, "menuNameEn"); + return (Criteria) this; + } + + public Criteria andMenuNameEnNotBetween(String value1, String value2) { + addCriterion("menu_name_en not between", value1, value2, "menuNameEn"); + return (Criteria) this; + } + + public Criteria andMenuNameJpIsNull() { + addCriterion("menu_name_jp is null"); + return (Criteria) this; + } + + public Criteria andMenuNameJpIsNotNull() { + addCriterion("menu_name_jp is not null"); + return (Criteria) this; + } + + public Criteria andMenuNameJpEqualTo(String value) { + addCriterion("menu_name_jp =", value, "menuNameJp"); + return (Criteria) this; + } + + public Criteria andMenuNameJpNotEqualTo(String value) { + addCriterion("menu_name_jp <>", value, "menuNameJp"); + return (Criteria) this; + } + + public Criteria andMenuNameJpGreaterThan(String value) { + addCriterion("menu_name_jp >", value, "menuNameJp"); + return (Criteria) this; + } + + public Criteria andMenuNameJpGreaterThanOrEqualTo(String value) { + addCriterion("menu_name_jp >=", value, "menuNameJp"); + return (Criteria) this; + } + + public Criteria andMenuNameJpLessThan(String value) { + addCriterion("menu_name_jp <", value, "menuNameJp"); + return (Criteria) this; + } + + public Criteria andMenuNameJpLessThanOrEqualTo(String value) { + addCriterion("menu_name_jp <=", value, "menuNameJp"); + return (Criteria) this; + } + + public Criteria andMenuNameJpLike(String value) { + addCriterion("menu_name_jp like", value, "menuNameJp"); + return (Criteria) this; + } + + public Criteria andMenuNameJpNotLike(String value) { + addCriterion("menu_name_jp not like", value, "menuNameJp"); + return (Criteria) this; + } + + public Criteria andMenuNameJpIn(List values) { + addCriterion("menu_name_jp in", values, "menuNameJp"); + return (Criteria) this; + } + + public Criteria andMenuNameJpNotIn(List values) { + addCriterion("menu_name_jp not in", values, "menuNameJp"); + return (Criteria) this; + } + + public Criteria andMenuNameJpBetween(String value1, String value2) { + addCriterion("menu_name_jp between", value1, value2, "menuNameJp"); + return (Criteria) this; + } + + public Criteria andMenuNameJpNotBetween(String value1, String value2) { + addCriterion("menu_name_jp not between", value1, value2, "menuNameJp"); + return (Criteria) this; + } + + public Criteria andRemarkIsNull() { + addCriterion("remark is null"); + return (Criteria) this; + } + + public Criteria andRemarkIsNotNull() { + addCriterion("remark is not null"); + return (Criteria) this; + } + + public Criteria andRemarkEqualTo(String value) { + addCriterion("remark =", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkNotEqualTo(String value) { + addCriterion("remark <>", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkGreaterThan(String value) { + addCriterion("remark >", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkGreaterThanOrEqualTo(String value) { + addCriterion("remark >=", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkLessThan(String value) { + addCriterion("remark <", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkLessThanOrEqualTo(String value) { + addCriterion("remark <=", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkLike(String value) { + addCriterion("remark like", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkNotLike(String value) { + addCriterion("remark not like", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkIn(List values) { + addCriterion("remark in", values, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkNotIn(List values) { + addCriterion("remark not in", values, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkBetween(String value1, String value2) { + addCriterion("remark between", value1, value2, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkNotBetween(String value1, String value2) { + addCriterion("remark not between", value1, value2, "remark"); + return (Criteria) this; + } + + public Criteria andMenuLevelIsNull() { + addCriterion("menu_level is null"); + return (Criteria) this; + } + + public Criteria andMenuLevelIsNotNull() { + addCriterion("menu_level is not null"); + return (Criteria) this; + } + + public Criteria andMenuLevelEqualTo(Integer value) { + addCriterion("menu_level =", value, "menuLevel"); + return (Criteria) this; + } + + public Criteria andMenuLevelNotEqualTo(Integer value) { + addCriterion("menu_level <>", value, "menuLevel"); + return (Criteria) this; + } + + public Criteria andMenuLevelGreaterThan(Integer value) { + addCriterion("menu_level >", value, "menuLevel"); + return (Criteria) this; + } + + public Criteria andMenuLevelGreaterThanOrEqualTo(Integer value) { + addCriterion("menu_level >=", value, "menuLevel"); + return (Criteria) this; + } + + public Criteria andMenuLevelLessThan(Integer value) { + addCriterion("menu_level <", value, "menuLevel"); + return (Criteria) this; + } + + public Criteria andMenuLevelLessThanOrEqualTo(Integer value) { + addCriterion("menu_level <=", value, "menuLevel"); + return (Criteria) this; + } + + public Criteria andMenuLevelIn(List values) { + addCriterion("menu_level in", values, "menuLevel"); + return (Criteria) this; + } + + public Criteria andMenuLevelNotIn(List values) { + addCriterion("menu_level not in", values, "menuLevel"); + return (Criteria) this; + } + + public Criteria andMenuLevelBetween(Integer value1, Integer value2) { + addCriterion("menu_level between", value1, value2, "menuLevel"); + return (Criteria) this; + } + + public Criteria andMenuLevelNotBetween(Integer value1, Integer value2) { + addCriterion("menu_level not between", value1, value2, "menuLevel"); + return (Criteria) this; + } + + public Criteria andFlagIsNull() { + addCriterion("flag is null"); + return (Criteria) this; + } + + public Criteria andFlagIsNotNull() { + addCriterion("flag is not null"); + return (Criteria) this; + } + + public Criteria andFlagEqualTo(Integer value) { + addCriterion("flag =", value, "flag"); + return (Criteria) this; + } + + public Criteria andFlagNotEqualTo(Integer value) { + addCriterion("flag <>", value, "flag"); + return (Criteria) this; + } + + public Criteria andFlagGreaterThan(Integer value) { + addCriterion("flag >", value, "flag"); + return (Criteria) this; + } + + public Criteria andFlagGreaterThanOrEqualTo(Integer value) { + addCriterion("flag >=", value, "flag"); + return (Criteria) this; + } + + public Criteria andFlagLessThan(Integer value) { + addCriterion("flag <", value, "flag"); + return (Criteria) this; + } + + public Criteria andFlagLessThanOrEqualTo(Integer value) { + addCriterion("flag <=", value, "flag"); + return (Criteria) this; + } + + public Criteria andFlagIn(List values) { + addCriterion("flag in", values, "flag"); + return (Criteria) this; + } + + public Criteria andFlagNotIn(List values) { + addCriterion("flag not in", values, "flag"); + return (Criteria) this; + } + + public Criteria andFlagBetween(Integer value1, Integer value2) { + addCriterion("flag between", value1, value2, "flag"); + return (Criteria) this; + } + + public Criteria andFlagNotBetween(Integer value1, Integer value2) { + addCriterion("flag not between", value1, value2, "flag"); + return (Criteria) this; + } + + public Criteria andCreateTimeIsNull() { + addCriterion("create_time is null"); + return (Criteria) this; + } + + public Criteria andCreateTimeIsNotNull() { + addCriterion("create_time is not null"); + return (Criteria) this; + } + + public Criteria andCreateTimeEqualTo(Long value) { + addCriterion("create_time =", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeNotEqualTo(Long value) { + addCriterion("create_time <>", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeGreaterThan(Long value) { + addCriterion("create_time >", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeGreaterThanOrEqualTo(Long value) { + addCriterion("create_time >=", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeLessThan(Long value) { + addCriterion("create_time <", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeLessThanOrEqualTo(Long value) { + addCriterion("create_time <=", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeIn(List values) { + addCriterion("create_time in", values, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeNotIn(List values) { + addCriterion("create_time not in", values, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeBetween(Long value1, Long value2) { + addCriterion("create_time between", value1, value2, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeNotBetween(Long value1, Long value2) { + addCriterion("create_time not between", value1, value2, "createTime"); + return (Criteria) this; + } + } + + /** + * This class was generated by MyBatis Generator. + * This class corresponds to the database table basic_menu + * + * @mbg.generated do_not_delete_during_merge + */ + public static class Criteria extends GeneratedCriteria { + + protected Criteria() { + super(); + } + } + + /** + * This class was generated by MyBatis Generator. + * This class corresponds to the database table basic_menu + * + * @mbg.generated + */ + public static class Criterion { + private String condition; + + private Object value; + + private Object secondValue; + + private boolean noValue; + + private boolean singleValue; + + private boolean betweenValue; + + private boolean listValue; + + private String typeHandler; + + public String getCondition() { + return condition; + } + + public Object getValue() { + return value; + } + + public Object getSecondValue() { + return secondValue; + } + + public boolean isNoValue() { + return noValue; + } + + public boolean isSingleValue() { + return singleValue; + } + + public boolean isBetweenValue() { + return betweenValue; + } + + public boolean isListValue() { + return listValue; + } + + public String getTypeHandler() { + return typeHandler; + } + + protected Criterion(String condition) { + super(); + this.condition = condition; + this.typeHandler = null; + this.noValue = true; + } + + protected Criterion(String condition, Object value, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.typeHandler = typeHandler; + if (value instanceof List) { + this.listValue = true; + } else { + this.singleValue = true; + } + } + + protected Criterion(String condition, Object value) { + this(condition, value, null); + } + + protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.secondValue = secondValue; + this.typeHandler = typeHandler; + this.betweenValue = true; + } + + protected Criterion(String condition, Object value, Object secondValue) { + this(condition, value, secondValue, null); + } + } +} \ No newline at end of file diff --git a/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/model/BasicProject.java b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/model/BasicProject.java new file mode 100644 index 0000000..73994c7 --- /dev/null +++ b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/model/BasicProject.java @@ -0,0 +1,52 @@ +package com.dongjian.dashboard.back.model; + +import lombok.Data; + +@Data +public class BasicProject { + + private Long id; + + + private Long companyId; + + + private String projectName; + + + private Integer flag; + + + private Long createTime; + + + private Long creatorId; + + + private Long modifyTime; + + + private Long modifierId; + + + private String udfProjectId; + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append(getClass().getSimpleName()); + sb.append(" ["); + sb.append("Hash = ").append(hashCode()); + sb.append(", id=").append(id); + sb.append(", companyId=").append(companyId); + sb.append(", projectName=").append(projectName); + sb.append(", flag=").append(flag); + sb.append(", createTime=").append(createTime); + sb.append(", creatorId=").append(creatorId); + sb.append(", modifyTime=").append(modifyTime); + sb.append(", modifierId=").append(modifierId); + sb.append(", udfProjectId=").append(udfProjectId); + sb.append("]"); + return sb.toString(); + } +} \ No newline at end of file diff --git a/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/model/BasicRole.java b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/model/BasicRole.java new file mode 100644 index 0000000..59d54f1 --- /dev/null +++ b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/model/BasicRole.java @@ -0,0 +1,336 @@ +package com.dongjian.dashboard.back.model; + +import java.io.Serializable; + +public class BasicRole implements Serializable { + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column basic_role.id + * + * @mbg.generated + */ + private Long id; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column basic_role.company_id + * + * @mbg.generated + */ + private Long companyId; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column basic_role.role_name + * + * @mbg.generated + */ + private String roleName; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column basic_role.description + * + * @mbg.generated + */ + private String description; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column basic_role.flag + * + * @mbg.generated + */ + private Integer flag; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column basic_role.creator_id + * + * @mbg.generated + */ + private Long creatorId; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column basic_role.create_time + * + * @mbg.generated + */ + private Long createTime; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column basic_role.modifier_id + * + * @mbg.generated + */ + private Long modifierId; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column basic_role.modify_time + * + * @mbg.generated + */ + private Long modifyTime; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database table basic_role + * + * @mbg.generated + */ + private static final long serialVersionUID = 1L; + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column basic_role.id + * + * @return the value of basic_role.id + * + * @mbg.generated + */ + public Long getId() { + return id; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column basic_role.id + * + * @param id the value for basic_role.id + * + * @mbg.generated + */ + public void setId(Long id) { + this.id = id; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column basic_role.company_id + * + * @return the value of basic_role.company_id + * + * @mbg.generated + */ + public Long getCompanyId() { + return companyId; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column basic_role.company_id + * + * @param companyId the value for basic_role.company_id + * + * @mbg.generated + */ + public void setCompanyId(Long companyId) { + this.companyId = companyId; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column basic_role.role_name + * + * @return the value of basic_role.role_name + * + * @mbg.generated + */ + public String getRoleName() { + return roleName; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column basic_role.role_name + * + * @param roleName the value for basic_role.role_name + * + * @mbg.generated + */ + public void setRoleName(String roleName) { + this.roleName = roleName == null ? null : roleName.trim(); + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column basic_role.description + * + * @return the value of basic_role.description + * + * @mbg.generated + */ + public String getDescription() { + return description; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column basic_role.description + * + * @param description the value for basic_role.description + * + * @mbg.generated + */ + public void setDescription(String description) { + this.description = description == null ? null : description.trim(); + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column basic_role.flag + * + * @return the value of basic_role.flag + * + * @mbg.generated + */ + public Integer getFlag() { + return flag; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column basic_role.flag + * + * @param flag the value for basic_role.flag + * + * @mbg.generated + */ + public void setFlag(Integer flag) { + this.flag = flag; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column basic_role.creator_id + * + * @return the value of basic_role.creator_id + * + * @mbg.generated + */ + public Long getCreatorId() { + return creatorId; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column basic_role.creator_id + * + * @param creatorId the value for basic_role.creator_id + * + * @mbg.generated + */ + public void setCreatorId(Long creatorId) { + this.creatorId = creatorId; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column basic_role.create_time + * + * @return the value of basic_role.create_time + * + * @mbg.generated + */ + public Long getCreateTime() { + return createTime; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column basic_role.create_time + * + * @param createTime the value for basic_role.create_time + * + * @mbg.generated + */ + public void setCreateTime(Long createTime) { + this.createTime = createTime; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column basic_role.modifier_id + * + * @return the value of basic_role.modifier_id + * + * @mbg.generated + */ + public Long getModifierId() { + return modifierId; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column basic_role.modifier_id + * + * @param modifierId the value for basic_role.modifier_id + * + * @mbg.generated + */ + public void setModifierId(Long modifierId) { + this.modifierId = modifierId; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column basic_role.modify_time + * + * @return the value of basic_role.modify_time + * + * @mbg.generated + */ + public Long getModifyTime() { + return modifyTime; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column basic_role.modify_time + * + * @param modifyTime the value for basic_role.modify_time + * + * @mbg.generated + */ + public void setModifyTime(Long modifyTime) { + this.modifyTime = modifyTime; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table basic_role + * + * @mbg.generated + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append(getClass().getSimpleName()); + sb.append(" ["); + sb.append("Hash = ").append(hashCode()); + sb.append(", id=").append(id); + sb.append(", companyId=").append(companyId); + sb.append(", roleName=").append(roleName); + sb.append(", description=").append(description); + sb.append(", flag=").append(flag); + sb.append(", creatorId=").append(creatorId); + sb.append(", createTime=").append(createTime); + sb.append(", modifierId=").append(modifierId); + sb.append(", modifyTime=").append(modifyTime); + sb.append(", serialVersionUID=").append(serialVersionUID); + sb.append("]"); + return sb.toString(); + } +} \ No newline at end of file diff --git a/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/model/BasicRoleExample.java b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/model/BasicRoleExample.java new file mode 100644 index 0000000..e1727bc --- /dev/null +++ b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/model/BasicRoleExample.java @@ -0,0 +1,862 @@ +package com.dongjian.dashboard.back.model; + +import java.util.ArrayList; +import java.util.List; + +public class BasicRoleExample { + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database table basic_role + * + * @mbg.generated + */ + protected String orderByClause; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database table basic_role + * + * @mbg.generated + */ + protected boolean distinct; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database table basic_role + * + * @mbg.generated + */ + protected List oredCriteria; + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table basic_role + * + * @mbg.generated + */ + public BasicRoleExample() { + oredCriteria = new ArrayList(); + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table basic_role + * + * @mbg.generated + */ + public void setOrderByClause(String orderByClause) { + this.orderByClause = orderByClause; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table basic_role + * + * @mbg.generated + */ + public String getOrderByClause() { + return orderByClause; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table basic_role + * + * @mbg.generated + */ + public void setDistinct(boolean distinct) { + this.distinct = distinct; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table basic_role + * + * @mbg.generated + */ + public boolean isDistinct() { + return distinct; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table basic_role + * + * @mbg.generated + */ + public List getOredCriteria() { + return oredCriteria; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table basic_role + * + * @mbg.generated + */ + public void or(Criteria criteria) { + oredCriteria.add(criteria); + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table basic_role + * + * @mbg.generated + */ + public Criteria or() { + Criteria criteria = createCriteriaInternal(); + oredCriteria.add(criteria); + return criteria; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table basic_role + * + * @mbg.generated + */ + public Criteria createCriteria() { + Criteria criteria = createCriteriaInternal(); + if (oredCriteria.size() == 0) { + oredCriteria.add(criteria); + } + return criteria; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table basic_role + * + * @mbg.generated + */ + protected Criteria createCriteriaInternal() { + Criteria criteria = new Criteria(); + return criteria; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table basic_role + * + * @mbg.generated + */ + public void clear() { + oredCriteria.clear(); + orderByClause = null; + distinct = false; + } + + /** + * This class was generated by MyBatis Generator. + * This class corresponds to the database table basic_role + * + * @mbg.generated + */ + protected abstract static class GeneratedCriteria { + protected List criteria; + + protected GeneratedCriteria() { + super(); + criteria = new ArrayList(); + } + + public boolean isValid() { + return criteria.size() > 0; + } + + public List getAllCriteria() { + return criteria; + } + + public List getCriteria() { + return criteria; + } + + protected void addCriterion(String condition) { + if (condition == null) { + throw new RuntimeException("Value for condition cannot be null"); + } + criteria.add(new Criterion(condition)); + } + + protected void addCriterion(String condition, Object value, String property) { + if (value == null) { + throw new RuntimeException("Value for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value)); + } + + protected void addCriterion(String condition, Object value1, Object value2, String property) { + if (value1 == null || value2 == null) { + throw new RuntimeException("Between values for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value1, value2)); + } + + public Criteria andIdIsNull() { + addCriterion("id is null"); + return (Criteria) this; + } + + public Criteria andIdIsNotNull() { + addCriterion("id is not null"); + return (Criteria) this; + } + + public Criteria andIdEqualTo(Long value) { + addCriterion("id =", value, "id"); + return (Criteria) this; + } + + public Criteria andIdNotEqualTo(Long value) { + addCriterion("id <>", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThan(Long value) { + addCriterion("id >", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThanOrEqualTo(Long value) { + addCriterion("id >=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThan(Long value) { + addCriterion("id <", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThanOrEqualTo(Long value) { + addCriterion("id <=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdIn(List values) { + addCriterion("id in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdNotIn(List values) { + addCriterion("id not in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdBetween(Long value1, Long value2) { + addCriterion("id between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andIdNotBetween(Long value1, Long value2) { + addCriterion("id not between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andCompanyIdIsNull() { + addCriterion("company_id is null"); + return (Criteria) this; + } + + public Criteria andCompanyIdIsNotNull() { + addCriterion("company_id is not null"); + return (Criteria) this; + } + + public Criteria andCompanyIdEqualTo(Long value) { + addCriterion("company_id =", value, "companyId"); + return (Criteria) this; + } + + public Criteria andCompanyIdNotEqualTo(Long value) { + addCriterion("company_id <>", value, "companyId"); + return (Criteria) this; + } + + public Criteria andCompanyIdGreaterThan(Long value) { + addCriterion("company_id >", value, "companyId"); + return (Criteria) this; + } + + public Criteria andCompanyIdGreaterThanOrEqualTo(Long value) { + addCriterion("company_id >=", value, "companyId"); + return (Criteria) this; + } + + public Criteria andCompanyIdLessThan(Long value) { + addCriterion("company_id <", value, "companyId"); + return (Criteria) this; + } + + public Criteria andCompanyIdLessThanOrEqualTo(Long value) { + addCriterion("company_id <=", value, "companyId"); + return (Criteria) this; + } + + public Criteria andCompanyIdIn(List values) { + addCriterion("company_id in", values, "companyId"); + return (Criteria) this; + } + + public Criteria andCompanyIdNotIn(List values) { + addCriterion("company_id not in", values, "companyId"); + return (Criteria) this; + } + + public Criteria andCompanyIdBetween(Long value1, Long value2) { + addCriterion("company_id between", value1, value2, "companyId"); + return (Criteria) this; + } + + public Criteria andCompanyIdNotBetween(Long value1, Long value2) { + addCriterion("company_id not between", value1, value2, "companyId"); + return (Criteria) this; + } + + public Criteria andRoleNameIsNull() { + addCriterion("role_name is null"); + return (Criteria) this; + } + + public Criteria andRoleNameIsNotNull() { + addCriterion("role_name is not null"); + return (Criteria) this; + } + + public Criteria andRoleNameEqualTo(String value) { + addCriterion("role_name =", value, "roleName"); + return (Criteria) this; + } + + public Criteria andRoleNameNotEqualTo(String value) { + addCriterion("role_name <>", value, "roleName"); + return (Criteria) this; + } + + public Criteria andRoleNameGreaterThan(String value) { + addCriterion("role_name >", value, "roleName"); + return (Criteria) this; + } + + public Criteria andRoleNameGreaterThanOrEqualTo(String value) { + addCriterion("role_name >=", value, "roleName"); + return (Criteria) this; + } + + public Criteria andRoleNameLessThan(String value) { + addCriterion("role_name <", value, "roleName"); + return (Criteria) this; + } + + public Criteria andRoleNameLessThanOrEqualTo(String value) { + addCriterion("role_name <=", value, "roleName"); + return (Criteria) this; + } + + public Criteria andRoleNameLike(String value) { + addCriterion("role_name like", value, "roleName"); + return (Criteria) this; + } + + public Criteria andRoleNameNotLike(String value) { + addCriterion("role_name not like", value, "roleName"); + return (Criteria) this; + } + + public Criteria andRoleNameIn(List values) { + addCriterion("role_name in", values, "roleName"); + return (Criteria) this; + } + + public Criteria andRoleNameNotIn(List values) { + addCriterion("role_name not in", values, "roleName"); + return (Criteria) this; + } + + public Criteria andRoleNameBetween(String value1, String value2) { + addCriterion("role_name between", value1, value2, "roleName"); + return (Criteria) this; + } + + public Criteria andRoleNameNotBetween(String value1, String value2) { + addCriterion("role_name not between", value1, value2, "roleName"); + return (Criteria) this; + } + + public Criteria andDescriptionIsNull() { + addCriterion("description is null"); + return (Criteria) this; + } + + public Criteria andDescriptionIsNotNull() { + addCriterion("description is not null"); + return (Criteria) this; + } + + public Criteria andDescriptionEqualTo(String value) { + addCriterion("description =", value, "description"); + return (Criteria) this; + } + + public Criteria andDescriptionNotEqualTo(String value) { + addCriterion("description <>", value, "description"); + return (Criteria) this; + } + + public Criteria andDescriptionGreaterThan(String value) { + addCriterion("description >", value, "description"); + return (Criteria) this; + } + + public Criteria andDescriptionGreaterThanOrEqualTo(String value) { + addCriterion("description >=", value, "description"); + return (Criteria) this; + } + + public Criteria andDescriptionLessThan(String value) { + addCriterion("description <", value, "description"); + return (Criteria) this; + } + + public Criteria andDescriptionLessThanOrEqualTo(String value) { + addCriterion("description <=", value, "description"); + return (Criteria) this; + } + + public Criteria andDescriptionLike(String value) { + addCriterion("description like", value, "description"); + return (Criteria) this; + } + + public Criteria andDescriptionNotLike(String value) { + addCriterion("description not like", value, "description"); + return (Criteria) this; + } + + public Criteria andDescriptionIn(List values) { + addCriterion("description in", values, "description"); + return (Criteria) this; + } + + public Criteria andDescriptionNotIn(List values) { + addCriterion("description not in", values, "description"); + return (Criteria) this; + } + + public Criteria andDescriptionBetween(String value1, String value2) { + addCriterion("description between", value1, value2, "description"); + return (Criteria) this; + } + + public Criteria andDescriptionNotBetween(String value1, String value2) { + addCriterion("description not between", value1, value2, "description"); + return (Criteria) this; + } + + public Criteria andFlagIsNull() { + addCriterion("flag is null"); + return (Criteria) this; + } + + public Criteria andFlagIsNotNull() { + addCriterion("flag is not null"); + return (Criteria) this; + } + + public Criteria andFlagEqualTo(Integer value) { + addCriterion("flag =", value, "flag"); + return (Criteria) this; + } + + public Criteria andFlagNotEqualTo(Integer value) { + addCriterion("flag <>", value, "flag"); + return (Criteria) this; + } + + public Criteria andFlagGreaterThan(Integer value) { + addCriterion("flag >", value, "flag"); + return (Criteria) this; + } + + public Criteria andFlagGreaterThanOrEqualTo(Integer value) { + addCriterion("flag >=", value, "flag"); + return (Criteria) this; + } + + public Criteria andFlagLessThan(Integer value) { + addCriterion("flag <", value, "flag"); + return (Criteria) this; + } + + public Criteria andFlagLessThanOrEqualTo(Integer value) { + addCriterion("flag <=", value, "flag"); + return (Criteria) this; + } + + public Criteria andFlagIn(List values) { + addCriterion("flag in", values, "flag"); + return (Criteria) this; + } + + public Criteria andFlagNotIn(List values) { + addCriterion("flag not in", values, "flag"); + return (Criteria) this; + } + + public Criteria andFlagBetween(Integer value1, Integer value2) { + addCriterion("flag between", value1, value2, "flag"); + return (Criteria) this; + } + + public Criteria andFlagNotBetween(Integer value1, Integer value2) { + addCriterion("flag not between", value1, value2, "flag"); + return (Criteria) this; + } + + public Criteria andCreatorIdIsNull() { + addCriterion("creator_id is null"); + return (Criteria) this; + } + + public Criteria andCreatorIdIsNotNull() { + addCriterion("creator_id is not null"); + return (Criteria) this; + } + + public Criteria andCreatorIdEqualTo(Long value) { + addCriterion("creator_id =", value, "creatorId"); + return (Criteria) this; + } + + public Criteria andCreatorIdNotEqualTo(Long value) { + addCriterion("creator_id <>", value, "creatorId"); + return (Criteria) this; + } + + public Criteria andCreatorIdGreaterThan(Long value) { + addCriterion("creator_id >", value, "creatorId"); + return (Criteria) this; + } + + public Criteria andCreatorIdGreaterThanOrEqualTo(Long value) { + addCriterion("creator_id >=", value, "creatorId"); + return (Criteria) this; + } + + public Criteria andCreatorIdLessThan(Long value) { + addCriterion("creator_id <", value, "creatorId"); + return (Criteria) this; + } + + public Criteria andCreatorIdLessThanOrEqualTo(Long value) { + addCriterion("creator_id <=", value, "creatorId"); + return (Criteria) this; + } + + public Criteria andCreatorIdIn(List values) { + addCriterion("creator_id in", values, "creatorId"); + return (Criteria) this; + } + + public Criteria andCreatorIdNotIn(List values) { + addCriterion("creator_id not in", values, "creatorId"); + return (Criteria) this; + } + + public Criteria andCreatorIdBetween(Long value1, Long value2) { + addCriterion("creator_id between", value1, value2, "creatorId"); + return (Criteria) this; + } + + public Criteria andCreatorIdNotBetween(Long value1, Long value2) { + addCriterion("creator_id not between", value1, value2, "creatorId"); + return (Criteria) this; + } + + public Criteria andCreateTimeIsNull() { + addCriterion("create_time is null"); + return (Criteria) this; + } + + public Criteria andCreateTimeIsNotNull() { + addCriterion("create_time is not null"); + return (Criteria) this; + } + + public Criteria andCreateTimeEqualTo(Long value) { + addCriterion("create_time =", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeNotEqualTo(Long value) { + addCriterion("create_time <>", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeGreaterThan(Long value) { + addCriterion("create_time >", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeGreaterThanOrEqualTo(Long value) { + addCriterion("create_time >=", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeLessThan(Long value) { + addCriterion("create_time <", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeLessThanOrEqualTo(Long value) { + addCriterion("create_time <=", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeIn(List values) { + addCriterion("create_time in", values, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeNotIn(List values) { + addCriterion("create_time not in", values, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeBetween(Long value1, Long value2) { + addCriterion("create_time between", value1, value2, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeNotBetween(Long value1, Long value2) { + addCriterion("create_time not between", value1, value2, "createTime"); + return (Criteria) this; + } + + public Criteria andModifierIdIsNull() { + addCriterion("modifier_id is null"); + return (Criteria) this; + } + + public Criteria andModifierIdIsNotNull() { + addCriterion("modifier_id is not null"); + return (Criteria) this; + } + + public Criteria andModifierIdEqualTo(Long value) { + addCriterion("modifier_id =", value, "modifierId"); + return (Criteria) this; + } + + public Criteria andModifierIdNotEqualTo(Long value) { + addCriterion("modifier_id <>", value, "modifierId"); + return (Criteria) this; + } + + public Criteria andModifierIdGreaterThan(Long value) { + addCriterion("modifier_id >", value, "modifierId"); + return (Criteria) this; + } + + public Criteria andModifierIdGreaterThanOrEqualTo(Long value) { + addCriterion("modifier_id >=", value, "modifierId"); + return (Criteria) this; + } + + public Criteria andModifierIdLessThan(Long value) { + addCriterion("modifier_id <", value, "modifierId"); + return (Criteria) this; + } + + public Criteria andModifierIdLessThanOrEqualTo(Long value) { + addCriterion("modifier_id <=", value, "modifierId"); + return (Criteria) this; + } + + public Criteria andModifierIdIn(List values) { + addCriterion("modifier_id in", values, "modifierId"); + return (Criteria) this; + } + + public Criteria andModifierIdNotIn(List values) { + addCriterion("modifier_id not in", values, "modifierId"); + return (Criteria) this; + } + + public Criteria andModifierIdBetween(Long value1, Long value2) { + addCriterion("modifier_id between", value1, value2, "modifierId"); + return (Criteria) this; + } + + public Criteria andModifierIdNotBetween(Long value1, Long value2) { + addCriterion("modifier_id not between", value1, value2, "modifierId"); + return (Criteria) this; + } + + public Criteria andModifyTimeIsNull() { + addCriterion("modify_time is null"); + return (Criteria) this; + } + + public Criteria andModifyTimeIsNotNull() { + addCriterion("modify_time is not null"); + return (Criteria) this; + } + + public Criteria andModifyTimeEqualTo(Long value) { + addCriterion("modify_time =", value, "modifyTime"); + return (Criteria) this; + } + + public Criteria andModifyTimeNotEqualTo(Long value) { + addCriterion("modify_time <>", value, "modifyTime"); + return (Criteria) this; + } + + public Criteria andModifyTimeGreaterThan(Long value) { + addCriterion("modify_time >", value, "modifyTime"); + return (Criteria) this; + } + + public Criteria andModifyTimeGreaterThanOrEqualTo(Long value) { + addCriterion("modify_time >=", value, "modifyTime"); + return (Criteria) this; + } + + public Criteria andModifyTimeLessThan(Long value) { + addCriterion("modify_time <", value, "modifyTime"); + return (Criteria) this; + } + + public Criteria andModifyTimeLessThanOrEqualTo(Long value) { + addCriterion("modify_time <=", value, "modifyTime"); + return (Criteria) this; + } + + public Criteria andModifyTimeIn(List values) { + addCriterion("modify_time in", values, "modifyTime"); + return (Criteria) this; + } + + public Criteria andModifyTimeNotIn(List values) { + addCriterion("modify_time not in", values, "modifyTime"); + return (Criteria) this; + } + + public Criteria andModifyTimeBetween(Long value1, Long value2) { + addCriterion("modify_time between", value1, value2, "modifyTime"); + return (Criteria) this; + } + + public Criteria andModifyTimeNotBetween(Long value1, Long value2) { + addCriterion("modify_time not between", value1, value2, "modifyTime"); + return (Criteria) this; + } + } + + /** + * This class was generated by MyBatis Generator. + * This class corresponds to the database table basic_role + * + * @mbg.generated do_not_delete_during_merge + */ + public static class Criteria extends GeneratedCriteria { + + protected Criteria() { + super(); + } + } + + /** + * This class was generated by MyBatis Generator. + * This class corresponds to the database table basic_role + * + * @mbg.generated + */ + public static class Criterion { + private String condition; + + private Object value; + + private Object secondValue; + + private boolean noValue; + + private boolean singleValue; + + private boolean betweenValue; + + private boolean listValue; + + private String typeHandler; + + public String getCondition() { + return condition; + } + + public Object getValue() { + return value; + } + + public Object getSecondValue() { + return secondValue; + } + + public boolean isNoValue() { + return noValue; + } + + public boolean isSingleValue() { + return singleValue; + } + + public boolean isBetweenValue() { + return betweenValue; + } + + public boolean isListValue() { + return listValue; + } + + public String getTypeHandler() { + return typeHandler; + } + + protected Criterion(String condition) { + super(); + this.condition = condition; + this.typeHandler = null; + this.noValue = true; + } + + protected Criterion(String condition, Object value, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.typeHandler = typeHandler; + if (value instanceof List) { + this.listValue = true; + } else { + this.singleValue = true; + } + } + + protected Criterion(String condition, Object value) { + this(condition, value, null); + } + + protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.secondValue = secondValue; + this.typeHandler = typeHandler; + this.betweenValue = true; + } + + protected Criterion(String condition, Object value, Object secondValue) { + this(condition, value, secondValue, null); + } + } +} \ No newline at end of file diff --git a/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/model/BasicRoleMenuRelation.java b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/model/BasicRoleMenuRelation.java new file mode 100644 index 0000000..cd9a659 --- /dev/null +++ b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/model/BasicRoleMenuRelation.java @@ -0,0 +1,166 @@ +package com.dongjian.dashboard.back.model; + +import java.io.Serializable; + +public class BasicRoleMenuRelation implements Serializable { + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column basic_role_menu_relation.role_id + * + * @mbg.generated + */ + private Long roleId; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column basic_role_menu_relation.menu_id + * + * @mbg.generated + */ + private Long menuId; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column basic_role_menu_relation.creator_id + * + * @mbg.generated + */ + private Long creatorId; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column basic_role_menu_relation.create_time + * + * @mbg.generated + */ + private Long createTime; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database table basic_role_menu_relation + * + * @mbg.generated + */ + private static final long serialVersionUID = 1L; + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column basic_role_menu_relation.role_id + * + * @return the value of basic_role_menu_relation.role_id + * + * @mbg.generated + */ + public Long getRoleId() { + return roleId; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column basic_role_menu_relation.role_id + * + * @param roleId the value for basic_role_menu_relation.role_id + * + * @mbg.generated + */ + public void setRoleId(Long roleId) { + this.roleId = roleId; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column basic_role_menu_relation.menu_id + * + * @return the value of basic_role_menu_relation.menu_id + * + * @mbg.generated + */ + public Long getMenuId() { + return menuId; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column basic_role_menu_relation.menu_id + * + * @param menuId the value for basic_role_menu_relation.menu_id + * + * @mbg.generated + */ + public void setMenuId(Long menuId) { + this.menuId = menuId; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column basic_role_menu_relation.creator_id + * + * @return the value of basic_role_menu_relation.creator_id + * + * @mbg.generated + */ + public Long getCreatorId() { + return creatorId; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column basic_role_menu_relation.creator_id + * + * @param creatorId the value for basic_role_menu_relation.creator_id + * + * @mbg.generated + */ + public void setCreatorId(Long creatorId) { + this.creatorId = creatorId; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column basic_role_menu_relation.create_time + * + * @return the value of basic_role_menu_relation.create_time + * + * @mbg.generated + */ + public Long getCreateTime() { + return createTime; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column basic_role_menu_relation.create_time + * + * @param createTime the value for basic_role_menu_relation.create_time + * + * @mbg.generated + */ + public void setCreateTime(Long createTime) { + this.createTime = createTime; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table basic_role_menu_relation + * + * @mbg.generated + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append(getClass().getSimpleName()); + sb.append(" ["); + sb.append("Hash = ").append(hashCode()); + sb.append(", roleId=").append(roleId); + sb.append(", menuId=").append(menuId); + sb.append(", creatorId=").append(creatorId); + sb.append(", createTime=").append(createTime); + sb.append(", serialVersionUID=").append(serialVersionUID); + sb.append("]"); + return sb.toString(); + } +} \ No newline at end of file diff --git a/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/model/BasicRoleMenuRelationExample.java b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/model/BasicRoleMenuRelationExample.java new file mode 100644 index 0000000..a5ab977 --- /dev/null +++ b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/model/BasicRoleMenuRelationExample.java @@ -0,0 +1,542 @@ +package com.dongjian.dashboard.back.model; + +import java.util.ArrayList; +import java.util.List; + +public class BasicRoleMenuRelationExample { + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database table basic_role_menu_relation + * + * @mbg.generated + */ + protected String orderByClause; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database table basic_role_menu_relation + * + * @mbg.generated + */ + protected boolean distinct; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database table basic_role_menu_relation + * + * @mbg.generated + */ + protected List oredCriteria; + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table basic_role_menu_relation + * + * @mbg.generated + */ + public BasicRoleMenuRelationExample() { + oredCriteria = new ArrayList(); + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table basic_role_menu_relation + * + * @mbg.generated + */ + public void setOrderByClause(String orderByClause) { + this.orderByClause = orderByClause; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table basic_role_menu_relation + * + * @mbg.generated + */ + public String getOrderByClause() { + return orderByClause; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table basic_role_menu_relation + * + * @mbg.generated + */ + public void setDistinct(boolean distinct) { + this.distinct = distinct; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table basic_role_menu_relation + * + * @mbg.generated + */ + public boolean isDistinct() { + return distinct; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table basic_role_menu_relation + * + * @mbg.generated + */ + public List getOredCriteria() { + return oredCriteria; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table basic_role_menu_relation + * + * @mbg.generated + */ + public void or(Criteria criteria) { + oredCriteria.add(criteria); + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table basic_role_menu_relation + * + * @mbg.generated + */ + public Criteria or() { + Criteria criteria = createCriteriaInternal(); + oredCriteria.add(criteria); + return criteria; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table basic_role_menu_relation + * + * @mbg.generated + */ + public Criteria createCriteria() { + Criteria criteria = createCriteriaInternal(); + if (oredCriteria.size() == 0) { + oredCriteria.add(criteria); + } + return criteria; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table basic_role_menu_relation + * + * @mbg.generated + */ + protected Criteria createCriteriaInternal() { + Criteria criteria = new Criteria(); + return criteria; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table basic_role_menu_relation + * + * @mbg.generated + */ + public void clear() { + oredCriteria.clear(); + orderByClause = null; + distinct = false; + } + + /** + * This class was generated by MyBatis Generator. + * This class corresponds to the database table basic_role_menu_relation + * + * @mbg.generated + */ + protected abstract static class GeneratedCriteria { + protected List criteria; + + protected GeneratedCriteria() { + super(); + criteria = new ArrayList(); + } + + public boolean isValid() { + return criteria.size() > 0; + } + + public List getAllCriteria() { + return criteria; + } + + public List getCriteria() { + return criteria; + } + + protected void addCriterion(String condition) { + if (condition == null) { + throw new RuntimeException("Value for condition cannot be null"); + } + criteria.add(new Criterion(condition)); + } + + protected void addCriterion(String condition, Object value, String property) { + if (value == null) { + throw new RuntimeException("Value for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value)); + } + + protected void addCriterion(String condition, Object value1, Object value2, String property) { + if (value1 == null || value2 == null) { + throw new RuntimeException("Between values for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value1, value2)); + } + + public Criteria andRoleIdIsNull() { + addCriterion("role_id is null"); + return (Criteria) this; + } + + public Criteria andRoleIdIsNotNull() { + addCriterion("role_id is not null"); + return (Criteria) this; + } + + public Criteria andRoleIdEqualTo(Long value) { + addCriterion("role_id =", value, "roleId"); + return (Criteria) this; + } + + public Criteria andRoleIdNotEqualTo(Long value) { + addCriterion("role_id <>", value, "roleId"); + return (Criteria) this; + } + + public Criteria andRoleIdGreaterThan(Long value) { + addCriterion("role_id >", value, "roleId"); + return (Criteria) this; + } + + public Criteria andRoleIdGreaterThanOrEqualTo(Long value) { + addCriterion("role_id >=", value, "roleId"); + return (Criteria) this; + } + + public Criteria andRoleIdLessThan(Long value) { + addCriterion("role_id <", value, "roleId"); + return (Criteria) this; + } + + public Criteria andRoleIdLessThanOrEqualTo(Long value) { + addCriterion("role_id <=", value, "roleId"); + return (Criteria) this; + } + + public Criteria andRoleIdIn(List values) { + addCriterion("role_id in", values, "roleId"); + return (Criteria) this; + } + + public Criteria andRoleIdNotIn(List values) { + addCriterion("role_id not in", values, "roleId"); + return (Criteria) this; + } + + public Criteria andRoleIdBetween(Long value1, Long value2) { + addCriterion("role_id between", value1, value2, "roleId"); + return (Criteria) this; + } + + public Criteria andRoleIdNotBetween(Long value1, Long value2) { + addCriterion("role_id not between", value1, value2, "roleId"); + return (Criteria) this; + } + + public Criteria andMenuIdIsNull() { + addCriterion("menu_id is null"); + return (Criteria) this; + } + + public Criteria andMenuIdIsNotNull() { + addCriterion("menu_id is not null"); + return (Criteria) this; + } + + public Criteria andMenuIdEqualTo(Long value) { + addCriterion("menu_id =", value, "menuId"); + return (Criteria) this; + } + + public Criteria andMenuIdNotEqualTo(Long value) { + addCriterion("menu_id <>", value, "menuId"); + return (Criteria) this; + } + + public Criteria andMenuIdGreaterThan(Long value) { + addCriterion("menu_id >", value, "menuId"); + return (Criteria) this; + } + + public Criteria andMenuIdGreaterThanOrEqualTo(Long value) { + addCriterion("menu_id >=", value, "menuId"); + return (Criteria) this; + } + + public Criteria andMenuIdLessThan(Long value) { + addCriterion("menu_id <", value, "menuId"); + return (Criteria) this; + } + + public Criteria andMenuIdLessThanOrEqualTo(Long value) { + addCriterion("menu_id <=", value, "menuId"); + return (Criteria) this; + } + + public Criteria andMenuIdIn(List values) { + addCriterion("menu_id in", values, "menuId"); + return (Criteria) this; + } + + public Criteria andMenuIdNotIn(List values) { + addCriterion("menu_id not in", values, "menuId"); + return (Criteria) this; + } + + public Criteria andMenuIdBetween(Long value1, Long value2) { + addCriterion("menu_id between", value1, value2, "menuId"); + return (Criteria) this; + } + + public Criteria andMenuIdNotBetween(Long value1, Long value2) { + addCriterion("menu_id not between", value1, value2, "menuId"); + return (Criteria) this; + } + + public Criteria andCreatorIdIsNull() { + addCriterion("creator_id is null"); + return (Criteria) this; + } + + public Criteria andCreatorIdIsNotNull() { + addCriterion("creator_id is not null"); + return (Criteria) this; + } + + public Criteria andCreatorIdEqualTo(Long value) { + addCriterion("creator_id =", value, "creatorId"); + return (Criteria) this; + } + + public Criteria andCreatorIdNotEqualTo(Long value) { + addCriterion("creator_id <>", value, "creatorId"); + return (Criteria) this; + } + + public Criteria andCreatorIdGreaterThan(Long value) { + addCriterion("creator_id >", value, "creatorId"); + return (Criteria) this; + } + + public Criteria andCreatorIdGreaterThanOrEqualTo(Long value) { + addCriterion("creator_id >=", value, "creatorId"); + return (Criteria) this; + } + + public Criteria andCreatorIdLessThan(Long value) { + addCriterion("creator_id <", value, "creatorId"); + return (Criteria) this; + } + + public Criteria andCreatorIdLessThanOrEqualTo(Long value) { + addCriterion("creator_id <=", value, "creatorId"); + return (Criteria) this; + } + + public Criteria andCreatorIdIn(List values) { + addCriterion("creator_id in", values, "creatorId"); + return (Criteria) this; + } + + public Criteria andCreatorIdNotIn(List values) { + addCriterion("creator_id not in", values, "creatorId"); + return (Criteria) this; + } + + public Criteria andCreatorIdBetween(Long value1, Long value2) { + addCriterion("creator_id between", value1, value2, "creatorId"); + return (Criteria) this; + } + + public Criteria andCreatorIdNotBetween(Long value1, Long value2) { + addCriterion("creator_id not between", value1, value2, "creatorId"); + return (Criteria) this; + } + + public Criteria andCreateTimeIsNull() { + addCriterion("create_time is null"); + return (Criteria) this; + } + + public Criteria andCreateTimeIsNotNull() { + addCriterion("create_time is not null"); + return (Criteria) this; + } + + public Criteria andCreateTimeEqualTo(Long value) { + addCriterion("create_time =", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeNotEqualTo(Long value) { + addCriterion("create_time <>", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeGreaterThan(Long value) { + addCriterion("create_time >", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeGreaterThanOrEqualTo(Long value) { + addCriterion("create_time >=", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeLessThan(Long value) { + addCriterion("create_time <", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeLessThanOrEqualTo(Long value) { + addCriterion("create_time <=", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeIn(List values) { + addCriterion("create_time in", values, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeNotIn(List values) { + addCriterion("create_time not in", values, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeBetween(Long value1, Long value2) { + addCriterion("create_time between", value1, value2, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeNotBetween(Long value1, Long value2) { + addCriterion("create_time not between", value1, value2, "createTime"); + return (Criteria) this; + } + } + + /** + * This class was generated by MyBatis Generator. + * This class corresponds to the database table basic_role_menu_relation + * + * @mbg.generated do_not_delete_during_merge + */ + public static class Criteria extends GeneratedCriteria { + + protected Criteria() { + super(); + } + } + + /** + * This class was generated by MyBatis Generator. + * This class corresponds to the database table basic_role_menu_relation + * + * @mbg.generated + */ + public static class Criterion { + private String condition; + + private Object value; + + private Object secondValue; + + private boolean noValue; + + private boolean singleValue; + + private boolean betweenValue; + + private boolean listValue; + + private String typeHandler; + + public String getCondition() { + return condition; + } + + public Object getValue() { + return value; + } + + public Object getSecondValue() { + return secondValue; + } + + public boolean isNoValue() { + return noValue; + } + + public boolean isSingleValue() { + return singleValue; + } + + public boolean isBetweenValue() { + return betweenValue; + } + + public boolean isListValue() { + return listValue; + } + + public String getTypeHandler() { + return typeHandler; + } + + protected Criterion(String condition) { + super(); + this.condition = condition; + this.typeHandler = null; + this.noValue = true; + } + + protected Criterion(String condition, Object value, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.typeHandler = typeHandler; + if (value instanceof List) { + this.listValue = true; + } else { + this.singleValue = true; + } + } + + protected Criterion(String condition, Object value) { + this(condition, value, null); + } + + protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.secondValue = secondValue; + this.typeHandler = typeHandler; + this.betweenValue = true; + } + + protected Criterion(String condition, Object value, Object secondValue) { + this(condition, value, secondValue, null); + } + } +} \ No newline at end of file diff --git a/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/model/BasicRoleUserRelation.java b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/model/BasicRoleUserRelation.java new file mode 100644 index 0000000..9ce8c33 --- /dev/null +++ b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/model/BasicRoleUserRelation.java @@ -0,0 +1,166 @@ +package com.dongjian.dashboard.back.model; + +import java.io.Serializable; + +public class BasicRoleUserRelation implements Serializable { + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column basic_role_user_relation.user_id + * + * @mbg.generated + */ + private Long userId; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column basic_role_user_relation.role_id + * + * @mbg.generated + */ + private Long roleId; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column basic_role_user_relation.creator_id + * + * @mbg.generated + */ + private Long creatorId; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column basic_role_user_relation.create_time + * + * @mbg.generated + */ + private Long createTime; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database table basic_role_user_relation + * + * @mbg.generated + */ + private static final long serialVersionUID = 1L; + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column basic_role_user_relation.user_id + * + * @return the value of basic_role_user_relation.user_id + * + * @mbg.generated + */ + public Long getUserId() { + return userId; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column basic_role_user_relation.user_id + * + * @param userId the value for basic_role_user_relation.user_id + * + * @mbg.generated + */ + public void setUserId(Long userId) { + this.userId = userId; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column basic_role_user_relation.role_id + * + * @return the value of basic_role_user_relation.role_id + * + * @mbg.generated + */ + public Long getRoleId() { + return roleId; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column basic_role_user_relation.role_id + * + * @param roleId the value for basic_role_user_relation.role_id + * + * @mbg.generated + */ + public void setRoleId(Long roleId) { + this.roleId = roleId; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column basic_role_user_relation.creator_id + * + * @return the value of basic_role_user_relation.creator_id + * + * @mbg.generated + */ + public Long getCreatorId() { + return creatorId; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column basic_role_user_relation.creator_id + * + * @param creatorId the value for basic_role_user_relation.creator_id + * + * @mbg.generated + */ + public void setCreatorId(Long creatorId) { + this.creatorId = creatorId; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column basic_role_user_relation.create_time + * + * @return the value of basic_role_user_relation.create_time + * + * @mbg.generated + */ + public Long getCreateTime() { + return createTime; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column basic_role_user_relation.create_time + * + * @param createTime the value for basic_role_user_relation.create_time + * + * @mbg.generated + */ + public void setCreateTime(Long createTime) { + this.createTime = createTime; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table basic_role_user_relation + * + * @mbg.generated + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append(getClass().getSimpleName()); + sb.append(" ["); + sb.append("Hash = ").append(hashCode()); + sb.append(", userId=").append(userId); + sb.append(", roleId=").append(roleId); + sb.append(", creatorId=").append(creatorId); + sb.append(", createTime=").append(createTime); + sb.append(", serialVersionUID=").append(serialVersionUID); + sb.append("]"); + return sb.toString(); + } +} \ No newline at end of file diff --git a/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/model/BasicRoleUserRelationExample.java b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/model/BasicRoleUserRelationExample.java new file mode 100644 index 0000000..cc13054 --- /dev/null +++ b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/model/BasicRoleUserRelationExample.java @@ -0,0 +1,542 @@ +package com.dongjian.dashboard.back.model; + +import java.util.ArrayList; +import java.util.List; + +public class BasicRoleUserRelationExample { + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database table basic_role_user_relation + * + * @mbg.generated + */ + protected String orderByClause; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database table basic_role_user_relation + * + * @mbg.generated + */ + protected boolean distinct; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database table basic_role_user_relation + * + * @mbg.generated + */ + protected List oredCriteria; + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table basic_role_user_relation + * + * @mbg.generated + */ + public BasicRoleUserRelationExample() { + oredCriteria = new ArrayList(); + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table basic_role_user_relation + * + * @mbg.generated + */ + public void setOrderByClause(String orderByClause) { + this.orderByClause = orderByClause; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table basic_role_user_relation + * + * @mbg.generated + */ + public String getOrderByClause() { + return orderByClause; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table basic_role_user_relation + * + * @mbg.generated + */ + public void setDistinct(boolean distinct) { + this.distinct = distinct; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table basic_role_user_relation + * + * @mbg.generated + */ + public boolean isDistinct() { + return distinct; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table basic_role_user_relation + * + * @mbg.generated + */ + public List getOredCriteria() { + return oredCriteria; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table basic_role_user_relation + * + * @mbg.generated + */ + public void or(Criteria criteria) { + oredCriteria.add(criteria); + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table basic_role_user_relation + * + * @mbg.generated + */ + public Criteria or() { + Criteria criteria = createCriteriaInternal(); + oredCriteria.add(criteria); + return criteria; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table basic_role_user_relation + * + * @mbg.generated + */ + public Criteria createCriteria() { + Criteria criteria = createCriteriaInternal(); + if (oredCriteria.size() == 0) { + oredCriteria.add(criteria); + } + return criteria; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table basic_role_user_relation + * + * @mbg.generated + */ + protected Criteria createCriteriaInternal() { + Criteria criteria = new Criteria(); + return criteria; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table basic_role_user_relation + * + * @mbg.generated + */ + public void clear() { + oredCriteria.clear(); + orderByClause = null; + distinct = false; + } + + /** + * This class was generated by MyBatis Generator. + * This class corresponds to the database table basic_role_user_relation + * + * @mbg.generated + */ + protected abstract static class GeneratedCriteria { + protected List criteria; + + protected GeneratedCriteria() { + super(); + criteria = new ArrayList(); + } + + public boolean isValid() { + return criteria.size() > 0; + } + + public List getAllCriteria() { + return criteria; + } + + public List getCriteria() { + return criteria; + } + + protected void addCriterion(String condition) { + if (condition == null) { + throw new RuntimeException("Value for condition cannot be null"); + } + criteria.add(new Criterion(condition)); + } + + protected void addCriterion(String condition, Object value, String property) { + if (value == null) { + throw new RuntimeException("Value for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value)); + } + + protected void addCriterion(String condition, Object value1, Object value2, String property) { + if (value1 == null || value2 == null) { + throw new RuntimeException("Between values for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value1, value2)); + } + + public Criteria andUserIdIsNull() { + addCriterion("user_id is null"); + return (Criteria) this; + } + + public Criteria andUserIdIsNotNull() { + addCriterion("user_id is not null"); + return (Criteria) this; + } + + public Criteria andUserIdEqualTo(Long value) { + addCriterion("user_id =", value, "userId"); + return (Criteria) this; + } + + public Criteria andUserIdNotEqualTo(Long value) { + addCriterion("user_id <>", value, "userId"); + return (Criteria) this; + } + + public Criteria andUserIdGreaterThan(Long value) { + addCriterion("user_id >", value, "userId"); + return (Criteria) this; + } + + public Criteria andUserIdGreaterThanOrEqualTo(Long value) { + addCriterion("user_id >=", value, "userId"); + return (Criteria) this; + } + + public Criteria andUserIdLessThan(Long value) { + addCriterion("user_id <", value, "userId"); + return (Criteria) this; + } + + public Criteria andUserIdLessThanOrEqualTo(Long value) { + addCriterion("user_id <=", value, "userId"); + return (Criteria) this; + } + + public Criteria andUserIdIn(List values) { + addCriterion("user_id in", values, "userId"); + return (Criteria) this; + } + + public Criteria andUserIdNotIn(List values) { + addCriterion("user_id not in", values, "userId"); + return (Criteria) this; + } + + public Criteria andUserIdBetween(Long value1, Long value2) { + addCriterion("user_id between", value1, value2, "userId"); + return (Criteria) this; + } + + public Criteria andUserIdNotBetween(Long value1, Long value2) { + addCriterion("user_id not between", value1, value2, "userId"); + return (Criteria) this; + } + + public Criteria andRoleIdIsNull() { + addCriterion("role_id is null"); + return (Criteria) this; + } + + public Criteria andRoleIdIsNotNull() { + addCriterion("role_id is not null"); + return (Criteria) this; + } + + public Criteria andRoleIdEqualTo(Long value) { + addCriterion("role_id =", value, "roleId"); + return (Criteria) this; + } + + public Criteria andRoleIdNotEqualTo(Long value) { + addCriterion("role_id <>", value, "roleId"); + return (Criteria) this; + } + + public Criteria andRoleIdGreaterThan(Long value) { + addCriterion("role_id >", value, "roleId"); + return (Criteria) this; + } + + public Criteria andRoleIdGreaterThanOrEqualTo(Long value) { + addCriterion("role_id >=", value, "roleId"); + return (Criteria) this; + } + + public Criteria andRoleIdLessThan(Long value) { + addCriterion("role_id <", value, "roleId"); + return (Criteria) this; + } + + public Criteria andRoleIdLessThanOrEqualTo(Long value) { + addCriterion("role_id <=", value, "roleId"); + return (Criteria) this; + } + + public Criteria andRoleIdIn(List values) { + addCriterion("role_id in", values, "roleId"); + return (Criteria) this; + } + + public Criteria andRoleIdNotIn(List values) { + addCriterion("role_id not in", values, "roleId"); + return (Criteria) this; + } + + public Criteria andRoleIdBetween(Long value1, Long value2) { + addCriterion("role_id between", value1, value2, "roleId"); + return (Criteria) this; + } + + public Criteria andRoleIdNotBetween(Long value1, Long value2) { + addCriterion("role_id not between", value1, value2, "roleId"); + return (Criteria) this; + } + + public Criteria andCreatorIdIsNull() { + addCriterion("creator_id is null"); + return (Criteria) this; + } + + public Criteria andCreatorIdIsNotNull() { + addCriterion("creator_id is not null"); + return (Criteria) this; + } + + public Criteria andCreatorIdEqualTo(Long value) { + addCriterion("creator_id =", value, "creatorId"); + return (Criteria) this; + } + + public Criteria andCreatorIdNotEqualTo(Long value) { + addCriterion("creator_id <>", value, "creatorId"); + return (Criteria) this; + } + + public Criteria andCreatorIdGreaterThan(Long value) { + addCriterion("creator_id >", value, "creatorId"); + return (Criteria) this; + } + + public Criteria andCreatorIdGreaterThanOrEqualTo(Long value) { + addCriterion("creator_id >=", value, "creatorId"); + return (Criteria) this; + } + + public Criteria andCreatorIdLessThan(Long value) { + addCriterion("creator_id <", value, "creatorId"); + return (Criteria) this; + } + + public Criteria andCreatorIdLessThanOrEqualTo(Long value) { + addCriterion("creator_id <=", value, "creatorId"); + return (Criteria) this; + } + + public Criteria andCreatorIdIn(List values) { + addCriterion("creator_id in", values, "creatorId"); + return (Criteria) this; + } + + public Criteria andCreatorIdNotIn(List values) { + addCriterion("creator_id not in", values, "creatorId"); + return (Criteria) this; + } + + public Criteria andCreatorIdBetween(Long value1, Long value2) { + addCriterion("creator_id between", value1, value2, "creatorId"); + return (Criteria) this; + } + + public Criteria andCreatorIdNotBetween(Long value1, Long value2) { + addCriterion("creator_id not between", value1, value2, "creatorId"); + return (Criteria) this; + } + + public Criteria andCreateTimeIsNull() { + addCriterion("create_time is null"); + return (Criteria) this; + } + + public Criteria andCreateTimeIsNotNull() { + addCriterion("create_time is not null"); + return (Criteria) this; + } + + public Criteria andCreateTimeEqualTo(Long value) { + addCriterion("create_time =", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeNotEqualTo(Long value) { + addCriterion("create_time <>", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeGreaterThan(Long value) { + addCriterion("create_time >", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeGreaterThanOrEqualTo(Long value) { + addCriterion("create_time >=", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeLessThan(Long value) { + addCriterion("create_time <", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeLessThanOrEqualTo(Long value) { + addCriterion("create_time <=", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeIn(List values) { + addCriterion("create_time in", values, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeNotIn(List values) { + addCriterion("create_time not in", values, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeBetween(Long value1, Long value2) { + addCriterion("create_time between", value1, value2, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeNotBetween(Long value1, Long value2) { + addCriterion("create_time not between", value1, value2, "createTime"); + return (Criteria) this; + } + } + + /** + * This class was generated by MyBatis Generator. + * This class corresponds to the database table basic_role_user_relation + * + * @mbg.generated do_not_delete_during_merge + */ + public static class Criteria extends GeneratedCriteria { + + protected Criteria() { + super(); + } + } + + /** + * This class was generated by MyBatis Generator. + * This class corresponds to the database table basic_role_user_relation + * + * @mbg.generated + */ + public static class Criterion { + private String condition; + + private Object value; + + private Object secondValue; + + private boolean noValue; + + private boolean singleValue; + + private boolean betweenValue; + + private boolean listValue; + + private String typeHandler; + + public String getCondition() { + return condition; + } + + public Object getValue() { + return value; + } + + public Object getSecondValue() { + return secondValue; + } + + public boolean isNoValue() { + return noValue; + } + + public boolean isSingleValue() { + return singleValue; + } + + public boolean isBetweenValue() { + return betweenValue; + } + + public boolean isListValue() { + return listValue; + } + + public String getTypeHandler() { + return typeHandler; + } + + protected Criterion(String condition) { + super(); + this.condition = condition; + this.typeHandler = null; + this.noValue = true; + } + + protected Criterion(String condition, Object value, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.typeHandler = typeHandler; + if (value instanceof List) { + this.listValue = true; + } else { + this.singleValue = true; + } + } + + protected Criterion(String condition, Object value) { + this(condition, value, null); + } + + protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.secondValue = secondValue; + this.typeHandler = typeHandler; + this.betweenValue = true; + } + + protected Criterion(String condition, Object value, Object secondValue) { + this(condition, value, secondValue, null); + } + } +} \ No newline at end of file diff --git a/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/model/BasicUser.java b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/model/BasicUser.java new file mode 100644 index 0000000..3edad96 --- /dev/null +++ b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/model/BasicUser.java @@ -0,0 +1,676 @@ +package com.dongjian.dashboard.back.model; + +import java.io.Serializable; + +public class BasicUser implements Serializable { + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column basic_user.id + * + * @mbg.generated + */ + private Long id; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column basic_user.user_type + * + * @mbg.generated + */ + private Integer userType; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column basic_user.company_id + * + * @mbg.generated + */ + private Long companyId; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column basic_user.username + * + * @mbg.generated + */ + private String username; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column basic_user.login_name + * + * @mbg.generated + */ + private String loginName; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column basic_user.password + * + * @mbg.generated + */ + private String password; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column basic_user.salt + * + * @mbg.generated + */ + private String salt; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column basic_user.email + * + * @mbg.generated + */ + private String email; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column basic_user.mfa_secret + * + * @mbg.generated + */ + private String mfaSecret; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column basic_user.mfa_bind + * + * @mbg.generated + */ + private Integer mfaBind; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column basic_user.mobile_number + * + * @mbg.generated + */ + private String mobileNumber; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column basic_user.last_login_time + * + * @mbg.generated + */ + private Long lastLoginTime; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column basic_user.flag + * + * @mbg.generated + */ + private Integer flag; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column basic_user.expire_time + * + * @mbg.generated + */ + private Long expireTime; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column basic_user.create_time + * + * @mbg.generated + */ + private Long createTime; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column basic_user.creator_id + * + * @mbg.generated + */ + private Long creatorId; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column basic_user.modify_time + * + * @mbg.generated + */ + private Long modifyTime; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column basic_user.modifier_id + * + * @mbg.generated + */ + private Long modifierId; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column basic_user.super_role + * + * @mbg.generated + */ + private Integer superRole; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database table basic_user + * + * @mbg.generated + */ + private static final long serialVersionUID = 1L; + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column basic_user.id + * + * @return the value of basic_user.id + * + * @mbg.generated + */ + public Long getId() { + return id; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column basic_user.id + * + * @param id the value for basic_user.id + * + * @mbg.generated + */ + public void setId(Long id) { + this.id = id; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column basic_user.user_type + * + * @return the value of basic_user.user_type + * + * @mbg.generated + */ + public Integer getUserType() { + return userType; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column basic_user.user_type + * + * @param userType the value for basic_user.user_type + * + * @mbg.generated + */ + public void setUserType(Integer userType) { + this.userType = userType; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column basic_user.company_id + * + * @return the value of basic_user.company_id + * + * @mbg.generated + */ + public Long getCompanyId() { + return companyId; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column basic_user.company_id + * + * @param companyId the value for basic_user.company_id + * + * @mbg.generated + */ + public void setCompanyId(Long companyId) { + this.companyId = companyId; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column basic_user.username + * + * @return the value of basic_user.username + * + * @mbg.generated + */ + public String getUsername() { + return username; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column basic_user.username + * + * @param username the value for basic_user.username + * + * @mbg.generated + */ + public void setUsername(String username) { + this.username = username == null ? null : username.trim(); + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column basic_user.login_name + * + * @return the value of basic_user.login_name + * + * @mbg.generated + */ + public String getLoginName() { + return loginName; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column basic_user.login_name + * + * @param loginName the value for basic_user.login_name + * + * @mbg.generated + */ + public void setLoginName(String loginName) { + this.loginName = loginName == null ? null : loginName.trim(); + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column basic_user.password + * + * @return the value of basic_user.password + * + * @mbg.generated + */ + public String getPassword() { + return password; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column basic_user.password + * + * @param password the value for basic_user.password + * + * @mbg.generated + */ + public void setPassword(String password) { + this.password = password == null ? null : password.trim(); + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column basic_user.salt + * + * @return the value of basic_user.salt + * + * @mbg.generated + */ + public String getSalt() { + return salt; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column basic_user.salt + * + * @param salt the value for basic_user.salt + * + * @mbg.generated + */ + public void setSalt(String salt) { + this.salt = salt == null ? null : salt.trim(); + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column basic_user.email + * + * @return the value of basic_user.email + * + * @mbg.generated + */ + public String getEmail() { + return email; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column basic_user.email + * + * @param email the value for basic_user.email + * + * @mbg.generated + */ + public void setEmail(String email) { + this.email = email == null ? null : email.trim(); + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column basic_user.mfa_secret + * + * @return the value of basic_user.mfa_secret + * + * @mbg.generated + */ + public String getMfaSecret() { + return mfaSecret; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column basic_user.mfa_secret + * + * @param mfaSecret the value for basic_user.mfa_secret + * + * @mbg.generated + */ + public void setMfaSecret(String mfaSecret) { + this.mfaSecret = mfaSecret == null ? null : mfaSecret.trim(); + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column basic_user.mfa_bind + * + * @return the value of basic_user.mfa_bind + * + * @mbg.generated + */ + public Integer getMfaBind() { + return mfaBind; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column basic_user.mfa_bind + * + * @param mfaBind the value for basic_user.mfa_bind + * + * @mbg.generated + */ + public void setMfaBind(Integer mfaBind) { + this.mfaBind = mfaBind; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column basic_user.mobile_number + * + * @return the value of basic_user.mobile_number + * + * @mbg.generated + */ + public String getMobileNumber() { + return mobileNumber; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column basic_user.mobile_number + * + * @param mobileNumber the value for basic_user.mobile_number + * + * @mbg.generated + */ + public void setMobileNumber(String mobileNumber) { + this.mobileNumber = mobileNumber == null ? null : mobileNumber.trim(); + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column basic_user.last_login_time + * + * @return the value of basic_user.last_login_time + * + * @mbg.generated + */ + public Long getLastLoginTime() { + return lastLoginTime; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column basic_user.last_login_time + * + * @param lastLoginTime the value for basic_user.last_login_time + * + * @mbg.generated + */ + public void setLastLoginTime(Long lastLoginTime) { + this.lastLoginTime = lastLoginTime; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column basic_user.flag + * + * @return the value of basic_user.flag + * + * @mbg.generated + */ + public Integer getFlag() { + return flag; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column basic_user.flag + * + * @param flag the value for basic_user.flag + * + * @mbg.generated + */ + public void setFlag(Integer flag) { + this.flag = flag; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column basic_user.expire_time + * + * @return the value of basic_user.expire_time + * + * @mbg.generated + */ + public Long getExpireTime() { + return expireTime; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column basic_user.expire_time + * + * @param expireTime the value for basic_user.expire_time + * + * @mbg.generated + */ + public void setExpireTime(Long expireTime) { + this.expireTime = expireTime; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column basic_user.create_time + * + * @return the value of basic_user.create_time + * + * @mbg.generated + */ + public Long getCreateTime() { + return createTime; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column basic_user.create_time + * + * @param createTime the value for basic_user.create_time + * + * @mbg.generated + */ + public void setCreateTime(Long createTime) { + this.createTime = createTime; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column basic_user.creator_id + * + * @return the value of basic_user.creator_id + * + * @mbg.generated + */ + public Long getCreatorId() { + return creatorId; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column basic_user.creator_id + * + * @param creatorId the value for basic_user.creator_id + * + * @mbg.generated + */ + public void setCreatorId(Long creatorId) { + this.creatorId = creatorId; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column basic_user.modify_time + * + * @return the value of basic_user.modify_time + * + * @mbg.generated + */ + public Long getModifyTime() { + return modifyTime; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column basic_user.modify_time + * + * @param modifyTime the value for basic_user.modify_time + * + * @mbg.generated + */ + public void setModifyTime(Long modifyTime) { + this.modifyTime = modifyTime; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column basic_user.modifier_id + * + * @return the value of basic_user.modifier_id + * + * @mbg.generated + */ + public Long getModifierId() { + return modifierId; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column basic_user.modifier_id + * + * @param modifierId the value for basic_user.modifier_id + * + * @mbg.generated + */ + public void setModifierId(Long modifierId) { + this.modifierId = modifierId; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column basic_user.super_role + * + * @return the value of basic_user.super_role + * + * @mbg.generated + */ + public Integer getSuperRole() { + return superRole; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column basic_user.super_role + * + * @param superRole the value for basic_user.super_role + * + * @mbg.generated + */ + public void setSuperRole(Integer superRole) { + this.superRole = superRole; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table basic_user + * + * @mbg.generated + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append(getClass().getSimpleName()); + sb.append(" ["); + sb.append("Hash = ").append(hashCode()); + sb.append(", id=").append(id); + sb.append(", userType=").append(userType); + sb.append(", companyId=").append(companyId); + sb.append(", username=").append(username); + sb.append(", loginName=").append(loginName); + sb.append(", password=").append(password); + sb.append(", salt=").append(salt); + sb.append(", email=").append(email); + sb.append(", mfaSecret=").append(mfaSecret); + sb.append(", mfaBind=").append(mfaBind); + sb.append(", mobileNumber=").append(mobileNumber); + sb.append(", lastLoginTime=").append(lastLoginTime); + sb.append(", flag=").append(flag); + sb.append(", expireTime=").append(expireTime); + sb.append(", createTime=").append(createTime); + sb.append(", creatorId=").append(creatorId); + sb.append(", modifyTime=").append(modifyTime); + sb.append(", modifierId=").append(modifierId); + sb.append(", superRole=").append(superRole); + sb.append(", serialVersionUID=").append(serialVersionUID); + sb.append("]"); + return sb.toString(); + } +} \ No newline at end of file diff --git a/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/model/BasicUserExample.java b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/model/BasicUserExample.java new file mode 100644 index 0000000..c49f7fc --- /dev/null +++ b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/model/BasicUserExample.java @@ -0,0 +1,1512 @@ +package com.dongjian.dashboard.back.model; + +import java.util.ArrayList; +import java.util.List; + +public class BasicUserExample { + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database table basic_user + * + * @mbg.generated + */ + protected String orderByClause; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database table basic_user + * + * @mbg.generated + */ + protected boolean distinct; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database table basic_user + * + * @mbg.generated + */ + protected List oredCriteria; + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table basic_user + * + * @mbg.generated + */ + public BasicUserExample() { + oredCriteria = new ArrayList(); + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table basic_user + * + * @mbg.generated + */ + public void setOrderByClause(String orderByClause) { + this.orderByClause = orderByClause; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table basic_user + * + * @mbg.generated + */ + public String getOrderByClause() { + return orderByClause; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table basic_user + * + * @mbg.generated + */ + public void setDistinct(boolean distinct) { + this.distinct = distinct; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table basic_user + * + * @mbg.generated + */ + public boolean isDistinct() { + return distinct; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table basic_user + * + * @mbg.generated + */ + public List getOredCriteria() { + return oredCriteria; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table basic_user + * + * @mbg.generated + */ + public void or(Criteria criteria) { + oredCriteria.add(criteria); + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table basic_user + * + * @mbg.generated + */ + public Criteria or() { + Criteria criteria = createCriteriaInternal(); + oredCriteria.add(criteria); + return criteria; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table basic_user + * + * @mbg.generated + */ + public Criteria createCriteria() { + Criteria criteria = createCriteriaInternal(); + if (oredCriteria.size() == 0) { + oredCriteria.add(criteria); + } + return criteria; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table basic_user + * + * @mbg.generated + */ + protected Criteria createCriteriaInternal() { + Criteria criteria = new Criteria(); + return criteria; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table basic_user + * + * @mbg.generated + */ + public void clear() { + oredCriteria.clear(); + orderByClause = null; + distinct = false; + } + + /** + * This class was generated by MyBatis Generator. + * This class corresponds to the database table basic_user + * + * @mbg.generated + */ + protected abstract static class GeneratedCriteria { + protected List criteria; + + protected GeneratedCriteria() { + super(); + criteria = new ArrayList(); + } + + public boolean isValid() { + return criteria.size() > 0; + } + + public List getAllCriteria() { + return criteria; + } + + public List getCriteria() { + return criteria; + } + + protected void addCriterion(String condition) { + if (condition == null) { + throw new RuntimeException("Value for condition cannot be null"); + } + criteria.add(new Criterion(condition)); + } + + protected void addCriterion(String condition, Object value, String property) { + if (value == null) { + throw new RuntimeException("Value for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value)); + } + + protected void addCriterion(String condition, Object value1, Object value2, String property) { + if (value1 == null || value2 == null) { + throw new RuntimeException("Between values for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value1, value2)); + } + + public Criteria andIdIsNull() { + addCriterion("id is null"); + return (Criteria) this; + } + + public Criteria andIdIsNotNull() { + addCriterion("id is not null"); + return (Criteria) this; + } + + public Criteria andIdEqualTo(Long value) { + addCriterion("id =", value, "id"); + return (Criteria) this; + } + + public Criteria andIdNotEqualTo(Long value) { + addCriterion("id <>", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThan(Long value) { + addCriterion("id >", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThanOrEqualTo(Long value) { + addCriterion("id >=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThan(Long value) { + addCriterion("id <", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThanOrEqualTo(Long value) { + addCriterion("id <=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdIn(List values) { + addCriterion("id in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdNotIn(List values) { + addCriterion("id not in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdBetween(Long value1, Long value2) { + addCriterion("id between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andIdNotBetween(Long value1, Long value2) { + addCriterion("id not between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andUserTypeIsNull() { + addCriterion("user_type is null"); + return (Criteria) this; + } + + public Criteria andUserTypeIsNotNull() { + addCriterion("user_type is not null"); + return (Criteria) this; + } + + public Criteria andUserTypeEqualTo(Integer value) { + addCriterion("user_type =", value, "userType"); + return (Criteria) this; + } + + public Criteria andUserTypeNotEqualTo(Integer value) { + addCriterion("user_type <>", value, "userType"); + return (Criteria) this; + } + + public Criteria andUserTypeGreaterThan(Integer value) { + addCriterion("user_type >", value, "userType"); + return (Criteria) this; + } + + public Criteria andUserTypeGreaterThanOrEqualTo(Integer value) { + addCriterion("user_type >=", value, "userType"); + return (Criteria) this; + } + + public Criteria andUserTypeLessThan(Integer value) { + addCriterion("user_type <", value, "userType"); + return (Criteria) this; + } + + public Criteria andUserTypeLessThanOrEqualTo(Integer value) { + addCriterion("user_type <=", value, "userType"); + return (Criteria) this; + } + + public Criteria andUserTypeIn(List values) { + addCriterion("user_type in", values, "userType"); + return (Criteria) this; + } + + public Criteria andUserTypeNotIn(List values) { + addCriterion("user_type not in", values, "userType"); + return (Criteria) this; + } + + public Criteria andUserTypeBetween(Integer value1, Integer value2) { + addCriterion("user_type between", value1, value2, "userType"); + return (Criteria) this; + } + + public Criteria andUserTypeNotBetween(Integer value1, Integer value2) { + addCriterion("user_type not between", value1, value2, "userType"); + return (Criteria) this; + } + + public Criteria andCompanyIdIsNull() { + addCriterion("company_id is null"); + return (Criteria) this; + } + + public Criteria andCompanyIdIsNotNull() { + addCriterion("company_id is not null"); + return (Criteria) this; + } + + public Criteria andCompanyIdEqualTo(Long value) { + addCriterion("company_id =", value, "companyId"); + return (Criteria) this; + } + + public Criteria andCompanyIdNotEqualTo(Long value) { + addCriterion("company_id <>", value, "companyId"); + return (Criteria) this; + } + + public Criteria andCompanyIdGreaterThan(Long value) { + addCriterion("company_id >", value, "companyId"); + return (Criteria) this; + } + + public Criteria andCompanyIdGreaterThanOrEqualTo(Long value) { + addCriterion("company_id >=", value, "companyId"); + return (Criteria) this; + } + + public Criteria andCompanyIdLessThan(Long value) { + addCriterion("company_id <", value, "companyId"); + return (Criteria) this; + } + + public Criteria andCompanyIdLessThanOrEqualTo(Long value) { + addCriterion("company_id <=", value, "companyId"); + return (Criteria) this; + } + + public Criteria andCompanyIdIn(List values) { + addCriterion("company_id in", values, "companyId"); + return (Criteria) this; + } + + public Criteria andCompanyIdNotIn(List values) { + addCriterion("company_id not in", values, "companyId"); + return (Criteria) this; + } + + public Criteria andCompanyIdBetween(Long value1, Long value2) { + addCriterion("company_id between", value1, value2, "companyId"); + return (Criteria) this; + } + + public Criteria andCompanyIdNotBetween(Long value1, Long value2) { + addCriterion("company_id not between", value1, value2, "companyId"); + return (Criteria) this; + } + + public Criteria andUsernameIsNull() { + addCriterion("username is null"); + return (Criteria) this; + } + + public Criteria andUsernameIsNotNull() { + addCriterion("username is not null"); + return (Criteria) this; + } + + public Criteria andUsernameEqualTo(String value) { + addCriterion("username =", value, "username"); + return (Criteria) this; + } + + public Criteria andUsernameNotEqualTo(String value) { + addCriterion("username <>", value, "username"); + return (Criteria) this; + } + + public Criteria andUsernameGreaterThan(String value) { + addCriterion("username >", value, "username"); + return (Criteria) this; + } + + public Criteria andUsernameGreaterThanOrEqualTo(String value) { + addCriterion("username >=", value, "username"); + return (Criteria) this; + } + + public Criteria andUsernameLessThan(String value) { + addCriterion("username <", value, "username"); + return (Criteria) this; + } + + public Criteria andUsernameLessThanOrEqualTo(String value) { + addCriterion("username <=", value, "username"); + return (Criteria) this; + } + + public Criteria andUsernameLike(String value) { + addCriterion("username like", value, "username"); + return (Criteria) this; + } + + public Criteria andUsernameNotLike(String value) { + addCriterion("username not like", value, "username"); + return (Criteria) this; + } + + public Criteria andUsernameIn(List values) { + addCriterion("username in", values, "username"); + return (Criteria) this; + } + + public Criteria andUsernameNotIn(List values) { + addCriterion("username not in", values, "username"); + return (Criteria) this; + } + + public Criteria andUsernameBetween(String value1, String value2) { + addCriterion("username between", value1, value2, "username"); + return (Criteria) this; + } + + public Criteria andUsernameNotBetween(String value1, String value2) { + addCriterion("username not between", value1, value2, "username"); + return (Criteria) this; + } + + public Criteria andLoginNameIsNull() { + addCriterion("login_name is null"); + return (Criteria) this; + } + + public Criteria andLoginNameIsNotNull() { + addCriterion("login_name is not null"); + return (Criteria) this; + } + + public Criteria andLoginNameEqualTo(String value) { + addCriterion("login_name =", value, "loginName"); + return (Criteria) this; + } + + public Criteria andLoginNameNotEqualTo(String value) { + addCriterion("login_name <>", value, "loginName"); + return (Criteria) this; + } + + public Criteria andLoginNameGreaterThan(String value) { + addCriterion("login_name >", value, "loginName"); + return (Criteria) this; + } + + public Criteria andLoginNameGreaterThanOrEqualTo(String value) { + addCriterion("login_name >=", value, "loginName"); + return (Criteria) this; + } + + public Criteria andLoginNameLessThan(String value) { + addCriterion("login_name <", value, "loginName"); + return (Criteria) this; + } + + public Criteria andLoginNameLessThanOrEqualTo(String value) { + addCriterion("login_name <=", value, "loginName"); + return (Criteria) this; + } + + public Criteria andLoginNameLike(String value) { + addCriterion("login_name like", value, "loginName"); + return (Criteria) this; + } + + public Criteria andLoginNameNotLike(String value) { + addCriterion("login_name not like", value, "loginName"); + return (Criteria) this; + } + + public Criteria andLoginNameIn(List values) { + addCriterion("login_name in", values, "loginName"); + return (Criteria) this; + } + + public Criteria andLoginNameNotIn(List values) { + addCriterion("login_name not in", values, "loginName"); + return (Criteria) this; + } + + public Criteria andLoginNameBetween(String value1, String value2) { + addCriterion("login_name between", value1, value2, "loginName"); + return (Criteria) this; + } + + public Criteria andLoginNameNotBetween(String value1, String value2) { + addCriterion("login_name not between", value1, value2, "loginName"); + return (Criteria) this; + } + + public Criteria andPasswordIsNull() { + addCriterion("`password` is null"); + return (Criteria) this; + } + + public Criteria andPasswordIsNotNull() { + addCriterion("`password` is not null"); + return (Criteria) this; + } + + public Criteria andPasswordEqualTo(String value) { + addCriterion("`password` =", value, "password"); + return (Criteria) this; + } + + public Criteria andPasswordNotEqualTo(String value) { + addCriterion("`password` <>", value, "password"); + return (Criteria) this; + } + + public Criteria andPasswordGreaterThan(String value) { + addCriterion("`password` >", value, "password"); + return (Criteria) this; + } + + public Criteria andPasswordGreaterThanOrEqualTo(String value) { + addCriterion("`password` >=", value, "password"); + return (Criteria) this; + } + + public Criteria andPasswordLessThan(String value) { + addCriterion("`password` <", value, "password"); + return (Criteria) this; + } + + public Criteria andPasswordLessThanOrEqualTo(String value) { + addCriterion("`password` <=", value, "password"); + return (Criteria) this; + } + + public Criteria andPasswordLike(String value) { + addCriterion("`password` like", value, "password"); + return (Criteria) this; + } + + public Criteria andPasswordNotLike(String value) { + addCriterion("`password` not like", value, "password"); + return (Criteria) this; + } + + public Criteria andPasswordIn(List values) { + addCriterion("`password` in", values, "password"); + return (Criteria) this; + } + + public Criteria andPasswordNotIn(List values) { + addCriterion("`password` not in", values, "password"); + return (Criteria) this; + } + + public Criteria andPasswordBetween(String value1, String value2) { + addCriterion("`password` between", value1, value2, "password"); + return (Criteria) this; + } + + public Criteria andPasswordNotBetween(String value1, String value2) { + addCriterion("`password` not between", value1, value2, "password"); + return (Criteria) this; + } + + public Criteria andSaltIsNull() { + addCriterion("salt is null"); + return (Criteria) this; + } + + public Criteria andSaltIsNotNull() { + addCriterion("salt is not null"); + return (Criteria) this; + } + + public Criteria andSaltEqualTo(String value) { + addCriterion("salt =", value, "salt"); + return (Criteria) this; + } + + public Criteria andSaltNotEqualTo(String value) { + addCriterion("salt <>", value, "salt"); + return (Criteria) this; + } + + public Criteria andSaltGreaterThan(String value) { + addCriterion("salt >", value, "salt"); + return (Criteria) this; + } + + public Criteria andSaltGreaterThanOrEqualTo(String value) { + addCriterion("salt >=", value, "salt"); + return (Criteria) this; + } + + public Criteria andSaltLessThan(String value) { + addCriterion("salt <", value, "salt"); + return (Criteria) this; + } + + public Criteria andSaltLessThanOrEqualTo(String value) { + addCriterion("salt <=", value, "salt"); + return (Criteria) this; + } + + public Criteria andSaltLike(String value) { + addCriterion("salt like", value, "salt"); + return (Criteria) this; + } + + public Criteria andSaltNotLike(String value) { + addCriterion("salt not like", value, "salt"); + return (Criteria) this; + } + + public Criteria andSaltIn(List values) { + addCriterion("salt in", values, "salt"); + return (Criteria) this; + } + + public Criteria andSaltNotIn(List values) { + addCriterion("salt not in", values, "salt"); + return (Criteria) this; + } + + public Criteria andSaltBetween(String value1, String value2) { + addCriterion("salt between", value1, value2, "salt"); + return (Criteria) this; + } + + public Criteria andSaltNotBetween(String value1, String value2) { + addCriterion("salt not between", value1, value2, "salt"); + return (Criteria) this; + } + + public Criteria andEmailIsNull() { + addCriterion("email is null"); + return (Criteria) this; + } + + public Criteria andEmailIsNotNull() { + addCriterion("email is not null"); + return (Criteria) this; + } + + public Criteria andEmailEqualTo(String value) { + addCriterion("email =", value, "email"); + return (Criteria) this; + } + + public Criteria andEmailNotEqualTo(String value) { + addCriterion("email <>", value, "email"); + return (Criteria) this; + } + + public Criteria andEmailGreaterThan(String value) { + addCriterion("email >", value, "email"); + return (Criteria) this; + } + + public Criteria andEmailGreaterThanOrEqualTo(String value) { + addCriterion("email >=", value, "email"); + return (Criteria) this; + } + + public Criteria andEmailLessThan(String value) { + addCriterion("email <", value, "email"); + return (Criteria) this; + } + + public Criteria andEmailLessThanOrEqualTo(String value) { + addCriterion("email <=", value, "email"); + return (Criteria) this; + } + + public Criteria andEmailLike(String value) { + addCriterion("email like", value, "email"); + return (Criteria) this; + } + + public Criteria andEmailNotLike(String value) { + addCriterion("email not like", value, "email"); + return (Criteria) this; + } + + public Criteria andEmailIn(List values) { + addCriterion("email in", values, "email"); + return (Criteria) this; + } + + public Criteria andEmailNotIn(List values) { + addCriterion("email not in", values, "email"); + return (Criteria) this; + } + + public Criteria andEmailBetween(String value1, String value2) { + addCriterion("email between", value1, value2, "email"); + return (Criteria) this; + } + + public Criteria andEmailNotBetween(String value1, String value2) { + addCriterion("email not between", value1, value2, "email"); + return (Criteria) this; + } + + public Criteria andMfaSecretIsNull() { + addCriterion("mfa_secret is null"); + return (Criteria) this; + } + + public Criteria andMfaSecretIsNotNull() { + addCriterion("mfa_secret is not null"); + return (Criteria) this; + } + + public Criteria andMfaSecretEqualTo(String value) { + addCriterion("mfa_secret =", value, "mfaSecret"); + return (Criteria) this; + } + + public Criteria andMfaSecretNotEqualTo(String value) { + addCriterion("mfa_secret <>", value, "mfaSecret"); + return (Criteria) this; + } + + public Criteria andMfaSecretGreaterThan(String value) { + addCriterion("mfa_secret >", value, "mfaSecret"); + return (Criteria) this; + } + + public Criteria andMfaSecretGreaterThanOrEqualTo(String value) { + addCriterion("mfa_secret >=", value, "mfaSecret"); + return (Criteria) this; + } + + public Criteria andMfaSecretLessThan(String value) { + addCriterion("mfa_secret <", value, "mfaSecret"); + return (Criteria) this; + } + + public Criteria andMfaSecretLessThanOrEqualTo(String value) { + addCriterion("mfa_secret <=", value, "mfaSecret"); + return (Criteria) this; + } + + public Criteria andMfaSecretLike(String value) { + addCriterion("mfa_secret like", value, "mfaSecret"); + return (Criteria) this; + } + + public Criteria andMfaSecretNotLike(String value) { + addCriterion("mfa_secret not like", value, "mfaSecret"); + return (Criteria) this; + } + + public Criteria andMfaSecretIn(List values) { + addCriterion("mfa_secret in", values, "mfaSecret"); + return (Criteria) this; + } + + public Criteria andMfaSecretNotIn(List values) { + addCriterion("mfa_secret not in", values, "mfaSecret"); + return (Criteria) this; + } + + public Criteria andMfaSecretBetween(String value1, String value2) { + addCriterion("mfa_secret between", value1, value2, "mfaSecret"); + return (Criteria) this; + } + + public Criteria andMfaSecretNotBetween(String value1, String value2) { + addCriterion("mfa_secret not between", value1, value2, "mfaSecret"); + return (Criteria) this; + } + + public Criteria andMfaBindIsNull() { + addCriterion("mfa_bind is null"); + return (Criteria) this; + } + + public Criteria andMfaBindIsNotNull() { + addCriterion("mfa_bind is not null"); + return (Criteria) this; + } + + public Criteria andMfaBindEqualTo(Integer value) { + addCriterion("mfa_bind =", value, "mfaBind"); + return (Criteria) this; + } + + public Criteria andMfaBindNotEqualTo(Integer value) { + addCriterion("mfa_bind <>", value, "mfaBind"); + return (Criteria) this; + } + + public Criteria andMfaBindGreaterThan(Integer value) { + addCriterion("mfa_bind >", value, "mfaBind"); + return (Criteria) this; + } + + public Criteria andMfaBindGreaterThanOrEqualTo(Integer value) { + addCriterion("mfa_bind >=", value, "mfaBind"); + return (Criteria) this; + } + + public Criteria andMfaBindLessThan(Integer value) { + addCriterion("mfa_bind <", value, "mfaBind"); + return (Criteria) this; + } + + public Criteria andMfaBindLessThanOrEqualTo(Integer value) { + addCriterion("mfa_bind <=", value, "mfaBind"); + return (Criteria) this; + } + + public Criteria andMfaBindIn(List values) { + addCriterion("mfa_bind in", values, "mfaBind"); + return (Criteria) this; + } + + public Criteria andMfaBindNotIn(List values) { + addCriterion("mfa_bind not in", values, "mfaBind"); + return (Criteria) this; + } + + public Criteria andMfaBindBetween(Integer value1, Integer value2) { + addCriterion("mfa_bind between", value1, value2, "mfaBind"); + return (Criteria) this; + } + + public Criteria andMfaBindNotBetween(Integer value1, Integer value2) { + addCriterion("mfa_bind not between", value1, value2, "mfaBind"); + return (Criteria) this; + } + + public Criteria andMobileNumberIsNull() { + addCriterion("mobile_number is null"); + return (Criteria) this; + } + + public Criteria andMobileNumberIsNotNull() { + addCriterion("mobile_number is not null"); + return (Criteria) this; + } + + public Criteria andMobileNumberEqualTo(String value) { + addCriterion("mobile_number =", value, "mobileNumber"); + return (Criteria) this; + } + + public Criteria andMobileNumberNotEqualTo(String value) { + addCriterion("mobile_number <>", value, "mobileNumber"); + return (Criteria) this; + } + + public Criteria andMobileNumberGreaterThan(String value) { + addCriterion("mobile_number >", value, "mobileNumber"); + return (Criteria) this; + } + + public Criteria andMobileNumberGreaterThanOrEqualTo(String value) { + addCriterion("mobile_number >=", value, "mobileNumber"); + return (Criteria) this; + } + + public Criteria andMobileNumberLessThan(String value) { + addCriterion("mobile_number <", value, "mobileNumber"); + return (Criteria) this; + } + + public Criteria andMobileNumberLessThanOrEqualTo(String value) { + addCriterion("mobile_number <=", value, "mobileNumber"); + return (Criteria) this; + } + + public Criteria andMobileNumberLike(String value) { + addCriterion("mobile_number like", value, "mobileNumber"); + return (Criteria) this; + } + + public Criteria andMobileNumberNotLike(String value) { + addCriterion("mobile_number not like", value, "mobileNumber"); + return (Criteria) this; + } + + public Criteria andMobileNumberIn(List values) { + addCriterion("mobile_number in", values, "mobileNumber"); + return (Criteria) this; + } + + public Criteria andMobileNumberNotIn(List values) { + addCriterion("mobile_number not in", values, "mobileNumber"); + return (Criteria) this; + } + + public Criteria andMobileNumberBetween(String value1, String value2) { + addCriterion("mobile_number between", value1, value2, "mobileNumber"); + return (Criteria) this; + } + + public Criteria andMobileNumberNotBetween(String value1, String value2) { + addCriterion("mobile_number not between", value1, value2, "mobileNumber"); + return (Criteria) this; + } + + public Criteria andLastLoginTimeIsNull() { + addCriterion("last_login_time is null"); + return (Criteria) this; + } + + public Criteria andLastLoginTimeIsNotNull() { + addCriterion("last_login_time is not null"); + return (Criteria) this; + } + + public Criteria andLastLoginTimeEqualTo(Long value) { + addCriterion("last_login_time =", value, "lastLoginTime"); + return (Criteria) this; + } + + public Criteria andLastLoginTimeNotEqualTo(Long value) { + addCriterion("last_login_time <>", value, "lastLoginTime"); + return (Criteria) this; + } + + public Criteria andLastLoginTimeGreaterThan(Long value) { + addCriterion("last_login_time >", value, "lastLoginTime"); + return (Criteria) this; + } + + public Criteria andLastLoginTimeGreaterThanOrEqualTo(Long value) { + addCriterion("last_login_time >=", value, "lastLoginTime"); + return (Criteria) this; + } + + public Criteria andLastLoginTimeLessThan(Long value) { + addCriterion("last_login_time <", value, "lastLoginTime"); + return (Criteria) this; + } + + public Criteria andLastLoginTimeLessThanOrEqualTo(Long value) { + addCriterion("last_login_time <=", value, "lastLoginTime"); + return (Criteria) this; + } + + public Criteria andLastLoginTimeIn(List values) { + addCriterion("last_login_time in", values, "lastLoginTime"); + return (Criteria) this; + } + + public Criteria andLastLoginTimeNotIn(List values) { + addCriterion("last_login_time not in", values, "lastLoginTime"); + return (Criteria) this; + } + + public Criteria andLastLoginTimeBetween(Long value1, Long value2) { + addCriterion("last_login_time between", value1, value2, "lastLoginTime"); + return (Criteria) this; + } + + public Criteria andLastLoginTimeNotBetween(Long value1, Long value2) { + addCriterion("last_login_time not between", value1, value2, "lastLoginTime"); + return (Criteria) this; + } + + public Criteria andFlagIsNull() { + addCriterion("flag is null"); + return (Criteria) this; + } + + public Criteria andFlagIsNotNull() { + addCriterion("flag is not null"); + return (Criteria) this; + } + + public Criteria andFlagEqualTo(Integer value) { + addCriterion("flag =", value, "flag"); + return (Criteria) this; + } + + public Criteria andFlagNotEqualTo(Integer value) { + addCriterion("flag <>", value, "flag"); + return (Criteria) this; + } + + public Criteria andFlagGreaterThan(Integer value) { + addCriterion("flag >", value, "flag"); + return (Criteria) this; + } + + public Criteria andFlagGreaterThanOrEqualTo(Integer value) { + addCriterion("flag >=", value, "flag"); + return (Criteria) this; + } + + public Criteria andFlagLessThan(Integer value) { + addCriterion("flag <", value, "flag"); + return (Criteria) this; + } + + public Criteria andFlagLessThanOrEqualTo(Integer value) { + addCriterion("flag <=", value, "flag"); + return (Criteria) this; + } + + public Criteria andFlagIn(List values) { + addCriterion("flag in", values, "flag"); + return (Criteria) this; + } + + public Criteria andFlagNotIn(List values) { + addCriterion("flag not in", values, "flag"); + return (Criteria) this; + } + + public Criteria andFlagBetween(Integer value1, Integer value2) { + addCriterion("flag between", value1, value2, "flag"); + return (Criteria) this; + } + + public Criteria andFlagNotBetween(Integer value1, Integer value2) { + addCriterion("flag not between", value1, value2, "flag"); + return (Criteria) this; + } + + public Criteria andExpireTimeIsNull() { + addCriterion("expire_time is null"); + return (Criteria) this; + } + + public Criteria andExpireTimeIsNotNull() { + addCriterion("expire_time is not null"); + return (Criteria) this; + } + + public Criteria andExpireTimeEqualTo(Long value) { + addCriterion("expire_time =", value, "expireTime"); + return (Criteria) this; + } + + public Criteria andExpireTimeNotEqualTo(Long value) { + addCriterion("expire_time <>", value, "expireTime"); + return (Criteria) this; + } + + public Criteria andExpireTimeGreaterThan(Long value) { + addCriterion("expire_time >", value, "expireTime"); + return (Criteria) this; + } + + public Criteria andExpireTimeGreaterThanOrEqualTo(Long value) { + addCriterion("expire_time >=", value, "expireTime"); + return (Criteria) this; + } + + public Criteria andExpireTimeLessThan(Long value) { + addCriterion("expire_time <", value, "expireTime"); + return (Criteria) this; + } + + public Criteria andExpireTimeLessThanOrEqualTo(Long value) { + addCriterion("expire_time <=", value, "expireTime"); + return (Criteria) this; + } + + public Criteria andExpireTimeIn(List values) { + addCriterion("expire_time in", values, "expireTime"); + return (Criteria) this; + } + + public Criteria andExpireTimeNotIn(List values) { + addCriterion("expire_time not in", values, "expireTime"); + return (Criteria) this; + } + + public Criteria andExpireTimeBetween(Long value1, Long value2) { + addCriterion("expire_time between", value1, value2, "expireTime"); + return (Criteria) this; + } + + public Criteria andExpireTimeNotBetween(Long value1, Long value2) { + addCriterion("expire_time not between", value1, value2, "expireTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeIsNull() { + addCriterion("create_time is null"); + return (Criteria) this; + } + + public Criteria andCreateTimeIsNotNull() { + addCriterion("create_time is not null"); + return (Criteria) this; + } + + public Criteria andCreateTimeEqualTo(Long value) { + addCriterion("create_time =", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeNotEqualTo(Long value) { + addCriterion("create_time <>", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeGreaterThan(Long value) { + addCriterion("create_time >", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeGreaterThanOrEqualTo(Long value) { + addCriterion("create_time >=", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeLessThan(Long value) { + addCriterion("create_time <", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeLessThanOrEqualTo(Long value) { + addCriterion("create_time <=", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeIn(List values) { + addCriterion("create_time in", values, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeNotIn(List values) { + addCriterion("create_time not in", values, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeBetween(Long value1, Long value2) { + addCriterion("create_time between", value1, value2, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeNotBetween(Long value1, Long value2) { + addCriterion("create_time not between", value1, value2, "createTime"); + return (Criteria) this; + } + + public Criteria andCreatorIdIsNull() { + addCriterion("creator_id is null"); + return (Criteria) this; + } + + public Criteria andCreatorIdIsNotNull() { + addCriterion("creator_id is not null"); + return (Criteria) this; + } + + public Criteria andCreatorIdEqualTo(Long value) { + addCriterion("creator_id =", value, "creatorId"); + return (Criteria) this; + } + + public Criteria andCreatorIdNotEqualTo(Long value) { + addCriterion("creator_id <>", value, "creatorId"); + return (Criteria) this; + } + + public Criteria andCreatorIdGreaterThan(Long value) { + addCriterion("creator_id >", value, "creatorId"); + return (Criteria) this; + } + + public Criteria andCreatorIdGreaterThanOrEqualTo(Long value) { + addCriterion("creator_id >=", value, "creatorId"); + return (Criteria) this; + } + + public Criteria andCreatorIdLessThan(Long value) { + addCriterion("creator_id <", value, "creatorId"); + return (Criteria) this; + } + + public Criteria andCreatorIdLessThanOrEqualTo(Long value) { + addCriterion("creator_id <=", value, "creatorId"); + return (Criteria) this; + } + + public Criteria andCreatorIdIn(List values) { + addCriterion("creator_id in", values, "creatorId"); + return (Criteria) this; + } + + public Criteria andCreatorIdNotIn(List values) { + addCriterion("creator_id not in", values, "creatorId"); + return (Criteria) this; + } + + public Criteria andCreatorIdBetween(Long value1, Long value2) { + addCriterion("creator_id between", value1, value2, "creatorId"); + return (Criteria) this; + } + + public Criteria andCreatorIdNotBetween(Long value1, Long value2) { + addCriterion("creator_id not between", value1, value2, "creatorId"); + return (Criteria) this; + } + + public Criteria andModifyTimeIsNull() { + addCriterion("modify_time is null"); + return (Criteria) this; + } + + public Criteria andModifyTimeIsNotNull() { + addCriterion("modify_time is not null"); + return (Criteria) this; + } + + public Criteria andModifyTimeEqualTo(Long value) { + addCriterion("modify_time =", value, "modifyTime"); + return (Criteria) this; + } + + public Criteria andModifyTimeNotEqualTo(Long value) { + addCriterion("modify_time <>", value, "modifyTime"); + return (Criteria) this; + } + + public Criteria andModifyTimeGreaterThan(Long value) { + addCriterion("modify_time >", value, "modifyTime"); + return (Criteria) this; + } + + public Criteria andModifyTimeGreaterThanOrEqualTo(Long value) { + addCriterion("modify_time >=", value, "modifyTime"); + return (Criteria) this; + } + + public Criteria andModifyTimeLessThan(Long value) { + addCriterion("modify_time <", value, "modifyTime"); + return (Criteria) this; + } + + public Criteria andModifyTimeLessThanOrEqualTo(Long value) { + addCriterion("modify_time <=", value, "modifyTime"); + return (Criteria) this; + } + + public Criteria andModifyTimeIn(List values) { + addCriterion("modify_time in", values, "modifyTime"); + return (Criteria) this; + } + + public Criteria andModifyTimeNotIn(List values) { + addCriterion("modify_time not in", values, "modifyTime"); + return (Criteria) this; + } + + public Criteria andModifyTimeBetween(Long value1, Long value2) { + addCriterion("modify_time between", value1, value2, "modifyTime"); + return (Criteria) this; + } + + public Criteria andModifyTimeNotBetween(Long value1, Long value2) { + addCriterion("modify_time not between", value1, value2, "modifyTime"); + return (Criteria) this; + } + + public Criteria andModifierIdIsNull() { + addCriterion("modifier_id is null"); + return (Criteria) this; + } + + public Criteria andModifierIdIsNotNull() { + addCriterion("modifier_id is not null"); + return (Criteria) this; + } + + public Criteria andModifierIdEqualTo(Long value) { + addCriterion("modifier_id =", value, "modifierId"); + return (Criteria) this; + } + + public Criteria andModifierIdNotEqualTo(Long value) { + addCriterion("modifier_id <>", value, "modifierId"); + return (Criteria) this; + } + + public Criteria andModifierIdGreaterThan(Long value) { + addCriterion("modifier_id >", value, "modifierId"); + return (Criteria) this; + } + + public Criteria andModifierIdGreaterThanOrEqualTo(Long value) { + addCriterion("modifier_id >=", value, "modifierId"); + return (Criteria) this; + } + + public Criteria andModifierIdLessThan(Long value) { + addCriterion("modifier_id <", value, "modifierId"); + return (Criteria) this; + } + + public Criteria andModifierIdLessThanOrEqualTo(Long value) { + addCriterion("modifier_id <=", value, "modifierId"); + return (Criteria) this; + } + + public Criteria andModifierIdIn(List values) { + addCriterion("modifier_id in", values, "modifierId"); + return (Criteria) this; + } + + public Criteria andModifierIdNotIn(List values) { + addCriterion("modifier_id not in", values, "modifierId"); + return (Criteria) this; + } + + public Criteria andModifierIdBetween(Long value1, Long value2) { + addCriterion("modifier_id between", value1, value2, "modifierId"); + return (Criteria) this; + } + + public Criteria andModifierIdNotBetween(Long value1, Long value2) { + addCriterion("modifier_id not between", value1, value2, "modifierId"); + return (Criteria) this; + } + + public Criteria andSuperRoleIsNull() { + addCriterion("super_role is null"); + return (Criteria) this; + } + + public Criteria andSuperRoleIsNotNull() { + addCriterion("super_role is not null"); + return (Criteria) this; + } + + public Criteria andSuperRoleEqualTo(Integer value) { + addCriterion("super_role =", value, "superRole"); + return (Criteria) this; + } + + public Criteria andSuperRoleNotEqualTo(Integer value) { + addCriterion("super_role <>", value, "superRole"); + return (Criteria) this; + } + + public Criteria andSuperRoleGreaterThan(Integer value) { + addCriterion("super_role >", value, "superRole"); + return (Criteria) this; + } + + public Criteria andSuperRoleGreaterThanOrEqualTo(Integer value) { + addCriterion("super_role >=", value, "superRole"); + return (Criteria) this; + } + + public Criteria andSuperRoleLessThan(Integer value) { + addCriterion("super_role <", value, "superRole"); + return (Criteria) this; + } + + public Criteria andSuperRoleLessThanOrEqualTo(Integer value) { + addCriterion("super_role <=", value, "superRole"); + return (Criteria) this; + } + + public Criteria andSuperRoleIn(List values) { + addCriterion("super_role in", values, "superRole"); + return (Criteria) this; + } + + public Criteria andSuperRoleNotIn(List values) { + addCriterion("super_role not in", values, "superRole"); + return (Criteria) this; + } + + public Criteria andSuperRoleBetween(Integer value1, Integer value2) { + addCriterion("super_role between", value1, value2, "superRole"); + return (Criteria) this; + } + + public Criteria andSuperRoleNotBetween(Integer value1, Integer value2) { + addCriterion("super_role not between", value1, value2, "superRole"); + return (Criteria) this; + } + } + + /** + * This class was generated by MyBatis Generator. + * This class corresponds to the database table basic_user + * + * @mbg.generated do_not_delete_during_merge + */ + public static class Criteria extends GeneratedCriteria { + + protected Criteria() { + super(); + } + } + + /** + * This class was generated by MyBatis Generator. + * This class corresponds to the database table basic_user + * + * @mbg.generated + */ + public static class Criterion { + private String condition; + + private Object value; + + private Object secondValue; + + private boolean noValue; + + private boolean singleValue; + + private boolean betweenValue; + + private boolean listValue; + + private String typeHandler; + + public String getCondition() { + return condition; + } + + public Object getValue() { + return value; + } + + public Object getSecondValue() { + return secondValue; + } + + public boolean isNoValue() { + return noValue; + } + + public boolean isSingleValue() { + return singleValue; + } + + public boolean isBetweenValue() { + return betweenValue; + } + + public boolean isListValue() { + return listValue; + } + + public String getTypeHandler() { + return typeHandler; + } + + protected Criterion(String condition) { + super(); + this.condition = condition; + this.typeHandler = null; + this.noValue = true; + } + + protected Criterion(String condition, Object value, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.typeHandler = typeHandler; + if (value instanceof List) { + this.listValue = true; + } else { + this.singleValue = true; + } + } + + protected Criterion(String condition, Object value) { + this(condition, value, null); + } + + protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.secondValue = secondValue; + this.typeHandler = typeHandler; + this.betweenValue = true; + } + + protected Criterion(String condition, Object value, Object secondValue) { + this(condition, value, secondValue, null); + } + } +} \ No newline at end of file diff --git a/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/model/DashboardLevelRole.java b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/model/DashboardLevelRole.java new file mode 100644 index 0000000..6aa918e --- /dev/null +++ b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/model/DashboardLevelRole.java @@ -0,0 +1,302 @@ +package com.dongjian.dashboard.back.model; + +import java.io.Serializable; + +public class DashboardLevelRole implements Serializable { + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column dashboard_level_role.id + * + * @mbg.generated + */ + private Long id; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column dashboard_level_role.company_id + * + * @mbg.generated + */ + private Long companyId; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column dashboard_level_role.name + * + * @mbg.generated + */ + private String name; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column dashboard_level_role.remark + * + * @mbg.generated + */ + private String remark; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column dashboard_level_role.flag + * + * @mbg.generated + */ + private Integer flag; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column dashboard_level_role.created_by + * + * @mbg.generated + */ + private Long createdBy; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column dashboard_level_role.created_at + * + * @mbg.generated + */ + private Long createdAt; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column dashboard_level_role.updated_at + * + * @mbg.generated + */ + private Long updatedAt; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database table dashboard_level_role + * + * @mbg.generated + */ + private static final long serialVersionUID = 1L; + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column dashboard_level_role.id + * + * @return the value of dashboard_level_role.id + * + * @mbg.generated + */ + public Long getId() { + return id; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column dashboard_level_role.id + * + * @param id the value for dashboard_level_role.id + * + * @mbg.generated + */ + public void setId(Long id) { + this.id = id; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column dashboard_level_role.company_id + * + * @return the value of dashboard_level_role.company_id + * + * @mbg.generated + */ + public Long getCompanyId() { + return companyId; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column dashboard_level_role.company_id + * + * @param companyId the value for dashboard_level_role.company_id + * + * @mbg.generated + */ + public void setCompanyId(Long companyId) { + this.companyId = companyId; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column dashboard_level_role.name + * + * @return the value of dashboard_level_role.name + * + * @mbg.generated + */ + public String getName() { + return name; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column dashboard_level_role.name + * + * @param name the value for dashboard_level_role.name + * + * @mbg.generated + */ + public void setName(String name) { + this.name = name == null ? null : name.trim(); + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column dashboard_level_role.remark + * + * @return the value of dashboard_level_role.remark + * + * @mbg.generated + */ + public String getRemark() { + return remark; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column dashboard_level_role.remark + * + * @param remark the value for dashboard_level_role.remark + * + * @mbg.generated + */ + public void setRemark(String remark) { + this.remark = remark == null ? null : remark.trim(); + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column dashboard_level_role.flag + * + * @return the value of dashboard_level_role.flag + * + * @mbg.generated + */ + public Integer getFlag() { + return flag; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column dashboard_level_role.flag + * + * @param flag the value for dashboard_level_role.flag + * + * @mbg.generated + */ + public void setFlag(Integer flag) { + this.flag = flag; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column dashboard_level_role.created_by + * + * @return the value of dashboard_level_role.created_by + * + * @mbg.generated + */ + public Long getCreatedBy() { + return createdBy; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column dashboard_level_role.created_by + * + * @param createdBy the value for dashboard_level_role.created_by + * + * @mbg.generated + */ + public void setCreatedBy(Long createdBy) { + this.createdBy = createdBy; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column dashboard_level_role.created_at + * + * @return the value of dashboard_level_role.created_at + * + * @mbg.generated + */ + public Long getCreatedAt() { + return createdAt; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column dashboard_level_role.created_at + * + * @param createdAt the value for dashboard_level_role.created_at + * + * @mbg.generated + */ + public void setCreatedAt(Long createdAt) { + this.createdAt = createdAt; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column dashboard_level_role.updated_at + * + * @return the value of dashboard_level_role.updated_at + * + * @mbg.generated + */ + public Long getUpdatedAt() { + return updatedAt; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column dashboard_level_role.updated_at + * + * @param updatedAt the value for dashboard_level_role.updated_at + * + * @mbg.generated + */ + public void setUpdatedAt(Long updatedAt) { + this.updatedAt = updatedAt; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table dashboard_level_role + * + * @mbg.generated + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append(getClass().getSimpleName()); + sb.append(" ["); + sb.append("Hash = ").append(hashCode()); + sb.append(", id=").append(id); + sb.append(", companyId=").append(companyId); + sb.append(", name=").append(name); + sb.append(", remark=").append(remark); + sb.append(", flag=").append(flag); + sb.append(", createdBy=").append(createdBy); + sb.append(", createdAt=").append(createdAt); + sb.append(", updatedAt=").append(updatedAt); + sb.append(", serialVersionUID=").append(serialVersionUID); + sb.append("]"); + return sb.toString(); + } +} \ No newline at end of file diff --git a/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/model/DashboardLevelRoleExample.java b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/model/DashboardLevelRoleExample.java new file mode 100644 index 0000000..5b213e8 --- /dev/null +++ b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/model/DashboardLevelRoleExample.java @@ -0,0 +1,802 @@ +package com.dongjian.dashboard.back.model; + +import java.util.ArrayList; +import java.util.List; + +public class DashboardLevelRoleExample { + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database table dashboard_level_role + * + * @mbg.generated + */ + protected String orderByClause; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database table dashboard_level_role + * + * @mbg.generated + */ + protected boolean distinct; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database table dashboard_level_role + * + * @mbg.generated + */ + protected List oredCriteria; + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table dashboard_level_role + * + * @mbg.generated + */ + public DashboardLevelRoleExample() { + oredCriteria = new ArrayList(); + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table dashboard_level_role + * + * @mbg.generated + */ + public void setOrderByClause(String orderByClause) { + this.orderByClause = orderByClause; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table dashboard_level_role + * + * @mbg.generated + */ + public String getOrderByClause() { + return orderByClause; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table dashboard_level_role + * + * @mbg.generated + */ + public void setDistinct(boolean distinct) { + this.distinct = distinct; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table dashboard_level_role + * + * @mbg.generated + */ + public boolean isDistinct() { + return distinct; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table dashboard_level_role + * + * @mbg.generated + */ + public List getOredCriteria() { + return oredCriteria; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table dashboard_level_role + * + * @mbg.generated + */ + public void or(Criteria criteria) { + oredCriteria.add(criteria); + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table dashboard_level_role + * + * @mbg.generated + */ + public Criteria or() { + Criteria criteria = createCriteriaInternal(); + oredCriteria.add(criteria); + return criteria; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table dashboard_level_role + * + * @mbg.generated + */ + public Criteria createCriteria() { + Criteria criteria = createCriteriaInternal(); + if (oredCriteria.size() == 0) { + oredCriteria.add(criteria); + } + return criteria; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table dashboard_level_role + * + * @mbg.generated + */ + protected Criteria createCriteriaInternal() { + Criteria criteria = new Criteria(); + return criteria; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table dashboard_level_role + * + * @mbg.generated + */ + public void clear() { + oredCriteria.clear(); + orderByClause = null; + distinct = false; + } + + /** + * This class was generated by MyBatis Generator. + * This class corresponds to the database table dashboard_level_role + * + * @mbg.generated + */ + protected abstract static class GeneratedCriteria { + protected List criteria; + + protected GeneratedCriteria() { + super(); + criteria = new ArrayList(); + } + + public boolean isValid() { + return criteria.size() > 0; + } + + public List getAllCriteria() { + return criteria; + } + + public List getCriteria() { + return criteria; + } + + protected void addCriterion(String condition) { + if (condition == null) { + throw new RuntimeException("Value for condition cannot be null"); + } + criteria.add(new Criterion(condition)); + } + + protected void addCriterion(String condition, Object value, String property) { + if (value == null) { + throw new RuntimeException("Value for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value)); + } + + protected void addCriterion(String condition, Object value1, Object value2, String property) { + if (value1 == null || value2 == null) { + throw new RuntimeException("Between values for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value1, value2)); + } + + public Criteria andIdIsNull() { + addCriterion("id is null"); + return (Criteria) this; + } + + public Criteria andIdIsNotNull() { + addCriterion("id is not null"); + return (Criteria) this; + } + + public Criteria andIdEqualTo(Long value) { + addCriterion("id =", value, "id"); + return (Criteria) this; + } + + public Criteria andIdNotEqualTo(Long value) { + addCriterion("id <>", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThan(Long value) { + addCriterion("id >", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThanOrEqualTo(Long value) { + addCriterion("id >=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThan(Long value) { + addCriterion("id <", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThanOrEqualTo(Long value) { + addCriterion("id <=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdIn(List values) { + addCriterion("id in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdNotIn(List values) { + addCriterion("id not in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdBetween(Long value1, Long value2) { + addCriterion("id between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andIdNotBetween(Long value1, Long value2) { + addCriterion("id not between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andCompanyIdIsNull() { + addCriterion("company_id is null"); + return (Criteria) this; + } + + public Criteria andCompanyIdIsNotNull() { + addCriterion("company_id is not null"); + return (Criteria) this; + } + + public Criteria andCompanyIdEqualTo(Long value) { + addCriterion("company_id =", value, "companyId"); + return (Criteria) this; + } + + public Criteria andCompanyIdNotEqualTo(Long value) { + addCriterion("company_id <>", value, "companyId"); + return (Criteria) this; + } + + public Criteria andCompanyIdGreaterThan(Long value) { + addCriterion("company_id >", value, "companyId"); + return (Criteria) this; + } + + public Criteria andCompanyIdGreaterThanOrEqualTo(Long value) { + addCriterion("company_id >=", value, "companyId"); + return (Criteria) this; + } + + public Criteria andCompanyIdLessThan(Long value) { + addCriterion("company_id <", value, "companyId"); + return (Criteria) this; + } + + public Criteria andCompanyIdLessThanOrEqualTo(Long value) { + addCriterion("company_id <=", value, "companyId"); + return (Criteria) this; + } + + public Criteria andCompanyIdIn(List values) { + addCriterion("company_id in", values, "companyId"); + return (Criteria) this; + } + + public Criteria andCompanyIdNotIn(List values) { + addCriterion("company_id not in", values, "companyId"); + return (Criteria) this; + } + + public Criteria andCompanyIdBetween(Long value1, Long value2) { + addCriterion("company_id between", value1, value2, "companyId"); + return (Criteria) this; + } + + public Criteria andCompanyIdNotBetween(Long value1, Long value2) { + addCriterion("company_id not between", value1, value2, "companyId"); + return (Criteria) this; + } + + public Criteria andNameIsNull() { + addCriterion("`name` is null"); + return (Criteria) this; + } + + public Criteria andNameIsNotNull() { + addCriterion("`name` is not null"); + return (Criteria) this; + } + + public Criteria andNameEqualTo(String value) { + addCriterion("`name` =", value, "name"); + return (Criteria) this; + } + + public Criteria andNameNotEqualTo(String value) { + addCriterion("`name` <>", value, "name"); + return (Criteria) this; + } + + public Criteria andNameGreaterThan(String value) { + addCriterion("`name` >", value, "name"); + return (Criteria) this; + } + + public Criteria andNameGreaterThanOrEqualTo(String value) { + addCriterion("`name` >=", value, "name"); + return (Criteria) this; + } + + public Criteria andNameLessThan(String value) { + addCriterion("`name` <", value, "name"); + return (Criteria) this; + } + + public Criteria andNameLessThanOrEqualTo(String value) { + addCriterion("`name` <=", value, "name"); + return (Criteria) this; + } + + public Criteria andNameLike(String value) { + addCriterion("`name` like", value, "name"); + return (Criteria) this; + } + + public Criteria andNameNotLike(String value) { + addCriterion("`name` not like", value, "name"); + return (Criteria) this; + } + + public Criteria andNameIn(List values) { + addCriterion("`name` in", values, "name"); + return (Criteria) this; + } + + public Criteria andNameNotIn(List values) { + addCriterion("`name` not in", values, "name"); + return (Criteria) this; + } + + public Criteria andNameBetween(String value1, String value2) { + addCriterion("`name` between", value1, value2, "name"); + return (Criteria) this; + } + + public Criteria andNameNotBetween(String value1, String value2) { + addCriterion("`name` not between", value1, value2, "name"); + return (Criteria) this; + } + + public Criteria andRemarkIsNull() { + addCriterion("remark is null"); + return (Criteria) this; + } + + public Criteria andRemarkIsNotNull() { + addCriterion("remark is not null"); + return (Criteria) this; + } + + public Criteria andRemarkEqualTo(String value) { + addCriterion("remark =", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkNotEqualTo(String value) { + addCriterion("remark <>", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkGreaterThan(String value) { + addCriterion("remark >", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkGreaterThanOrEqualTo(String value) { + addCriterion("remark >=", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkLessThan(String value) { + addCriterion("remark <", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkLessThanOrEqualTo(String value) { + addCriterion("remark <=", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkLike(String value) { + addCriterion("remark like", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkNotLike(String value) { + addCriterion("remark not like", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkIn(List values) { + addCriterion("remark in", values, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkNotIn(List values) { + addCriterion("remark not in", values, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkBetween(String value1, String value2) { + addCriterion("remark between", value1, value2, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkNotBetween(String value1, String value2) { + addCriterion("remark not between", value1, value2, "remark"); + return (Criteria) this; + } + + public Criteria andFlagIsNull() { + addCriterion("flag is null"); + return (Criteria) this; + } + + public Criteria andFlagIsNotNull() { + addCriterion("flag is not null"); + return (Criteria) this; + } + + public Criteria andFlagEqualTo(Integer value) { + addCriterion("flag =", value, "flag"); + return (Criteria) this; + } + + public Criteria andFlagNotEqualTo(Integer value) { + addCriterion("flag <>", value, "flag"); + return (Criteria) this; + } + + public Criteria andFlagGreaterThan(Integer value) { + addCriterion("flag >", value, "flag"); + return (Criteria) this; + } + + public Criteria andFlagGreaterThanOrEqualTo(Integer value) { + addCriterion("flag >=", value, "flag"); + return (Criteria) this; + } + + public Criteria andFlagLessThan(Integer value) { + addCriterion("flag <", value, "flag"); + return (Criteria) this; + } + + public Criteria andFlagLessThanOrEqualTo(Integer value) { + addCriterion("flag <=", value, "flag"); + return (Criteria) this; + } + + public Criteria andFlagIn(List values) { + addCriterion("flag in", values, "flag"); + return (Criteria) this; + } + + public Criteria andFlagNotIn(List values) { + addCriterion("flag not in", values, "flag"); + return (Criteria) this; + } + + public Criteria andFlagBetween(Integer value1, Integer value2) { + addCriterion("flag between", value1, value2, "flag"); + return (Criteria) this; + } + + public Criteria andFlagNotBetween(Integer value1, Integer value2) { + addCriterion("flag not between", value1, value2, "flag"); + return (Criteria) this; + } + + public Criteria andCreatedByIsNull() { + addCriterion("created_by is null"); + return (Criteria) this; + } + + public Criteria andCreatedByIsNotNull() { + addCriterion("created_by is not null"); + return (Criteria) this; + } + + public Criteria andCreatedByEqualTo(Long value) { + addCriterion("created_by =", value, "createdBy"); + return (Criteria) this; + } + + public Criteria andCreatedByNotEqualTo(Long value) { + addCriterion("created_by <>", value, "createdBy"); + return (Criteria) this; + } + + public Criteria andCreatedByGreaterThan(Long value) { + addCriterion("created_by >", value, "createdBy"); + return (Criteria) this; + } + + public Criteria andCreatedByGreaterThanOrEqualTo(Long value) { + addCriterion("created_by >=", value, "createdBy"); + return (Criteria) this; + } + + public Criteria andCreatedByLessThan(Long value) { + addCriterion("created_by <", value, "createdBy"); + return (Criteria) this; + } + + public Criteria andCreatedByLessThanOrEqualTo(Long value) { + addCriterion("created_by <=", value, "createdBy"); + return (Criteria) this; + } + + public Criteria andCreatedByIn(List values) { + addCriterion("created_by in", values, "createdBy"); + return (Criteria) this; + } + + public Criteria andCreatedByNotIn(List values) { + addCriterion("created_by not in", values, "createdBy"); + return (Criteria) this; + } + + public Criteria andCreatedByBetween(Long value1, Long value2) { + addCriterion("created_by between", value1, value2, "createdBy"); + return (Criteria) this; + } + + public Criteria andCreatedByNotBetween(Long value1, Long value2) { + addCriterion("created_by not between", value1, value2, "createdBy"); + return (Criteria) this; + } + + public Criteria andCreatedAtIsNull() { + addCriterion("created_at is null"); + return (Criteria) this; + } + + public Criteria andCreatedAtIsNotNull() { + addCriterion("created_at is not null"); + return (Criteria) this; + } + + public Criteria andCreatedAtEqualTo(Long value) { + addCriterion("created_at =", value, "createdAt"); + return (Criteria) this; + } + + public Criteria andCreatedAtNotEqualTo(Long value) { + addCriterion("created_at <>", value, "createdAt"); + return (Criteria) this; + } + + public Criteria andCreatedAtGreaterThan(Long value) { + addCriterion("created_at >", value, "createdAt"); + return (Criteria) this; + } + + public Criteria andCreatedAtGreaterThanOrEqualTo(Long value) { + addCriterion("created_at >=", value, "createdAt"); + return (Criteria) this; + } + + public Criteria andCreatedAtLessThan(Long value) { + addCriterion("created_at <", value, "createdAt"); + return (Criteria) this; + } + + public Criteria andCreatedAtLessThanOrEqualTo(Long value) { + addCriterion("created_at <=", value, "createdAt"); + return (Criteria) this; + } + + public Criteria andCreatedAtIn(List values) { + addCriterion("created_at in", values, "createdAt"); + return (Criteria) this; + } + + public Criteria andCreatedAtNotIn(List values) { + addCriterion("created_at not in", values, "createdAt"); + return (Criteria) this; + } + + public Criteria andCreatedAtBetween(Long value1, Long value2) { + addCriterion("created_at between", value1, value2, "createdAt"); + return (Criteria) this; + } + + public Criteria andCreatedAtNotBetween(Long value1, Long value2) { + addCriterion("created_at not between", value1, value2, "createdAt"); + return (Criteria) this; + } + + public Criteria andUpdatedAtIsNull() { + addCriterion("updated_at is null"); + return (Criteria) this; + } + + public Criteria andUpdatedAtIsNotNull() { + addCriterion("updated_at is not null"); + return (Criteria) this; + } + + public Criteria andUpdatedAtEqualTo(Long value) { + addCriterion("updated_at =", value, "updatedAt"); + return (Criteria) this; + } + + public Criteria andUpdatedAtNotEqualTo(Long value) { + addCriterion("updated_at <>", value, "updatedAt"); + return (Criteria) this; + } + + public Criteria andUpdatedAtGreaterThan(Long value) { + addCriterion("updated_at >", value, "updatedAt"); + return (Criteria) this; + } + + public Criteria andUpdatedAtGreaterThanOrEqualTo(Long value) { + addCriterion("updated_at >=", value, "updatedAt"); + return (Criteria) this; + } + + public Criteria andUpdatedAtLessThan(Long value) { + addCriterion("updated_at <", value, "updatedAt"); + return (Criteria) this; + } + + public Criteria andUpdatedAtLessThanOrEqualTo(Long value) { + addCriterion("updated_at <=", value, "updatedAt"); + return (Criteria) this; + } + + public Criteria andUpdatedAtIn(List values) { + addCriterion("updated_at in", values, "updatedAt"); + return (Criteria) this; + } + + public Criteria andUpdatedAtNotIn(List values) { + addCriterion("updated_at not in", values, "updatedAt"); + return (Criteria) this; + } + + public Criteria andUpdatedAtBetween(Long value1, Long value2) { + addCriterion("updated_at between", value1, value2, "updatedAt"); + return (Criteria) this; + } + + public Criteria andUpdatedAtNotBetween(Long value1, Long value2) { + addCriterion("updated_at not between", value1, value2, "updatedAt"); + return (Criteria) this; + } + } + + /** + * This class was generated by MyBatis Generator. + * This class corresponds to the database table dashboard_level_role + * + * @mbg.generated do_not_delete_during_merge + */ + public static class Criteria extends GeneratedCriteria { + + protected Criteria() { + super(); + } + } + + /** + * This class was generated by MyBatis Generator. + * This class corresponds to the database table dashboard_level_role + * + * @mbg.generated + */ + public static class Criterion { + private String condition; + + private Object value; + + private Object secondValue; + + private boolean noValue; + + private boolean singleValue; + + private boolean betweenValue; + + private boolean listValue; + + private String typeHandler; + + public String getCondition() { + return condition; + } + + public Object getValue() { + return value; + } + + public Object getSecondValue() { + return secondValue; + } + + public boolean isNoValue() { + return noValue; + } + + public boolean isSingleValue() { + return singleValue; + } + + public boolean isBetweenValue() { + return betweenValue; + } + + public boolean isListValue() { + return listValue; + } + + public String getTypeHandler() { + return typeHandler; + } + + protected Criterion(String condition) { + super(); + this.condition = condition; + this.typeHandler = null; + this.noValue = true; + } + + protected Criterion(String condition, Object value, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.typeHandler = typeHandler; + if (value instanceof List) { + this.listValue = true; + } else { + this.singleValue = true; + } + } + + protected Criterion(String condition, Object value) { + this(condition, value, null); + } + + protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.secondValue = secondValue; + this.typeHandler = typeHandler; + this.betweenValue = true; + } + + protected Criterion(String condition, Object value, Object secondValue) { + this(condition, value, secondValue, null); + } + } +} \ No newline at end of file diff --git a/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/model/DashboardOperationLog.java b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/model/DashboardOperationLog.java new file mode 100644 index 0000000..96fb511 --- /dev/null +++ b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/model/DashboardOperationLog.java @@ -0,0 +1,438 @@ +package com.dongjian.dashboard.back.model; + +import java.io.Serializable; + +public class DashboardOperationLog implements Serializable { + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column dashboard_operation_log.id + * + * @mbg.generated + */ + private Long id; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column dashboard_operation_log.user_id + * + * @mbg.generated + */ + private Long userId; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column dashboard_operation_log.company_id + * + * @mbg.generated + */ + private Long companyId; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column dashboard_operation_log.operation + * + * @mbg.generated + */ + private String operation; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column dashboard_operation_log.operation_remark + * + * @mbg.generated + */ + private String operationRemark; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column dashboard_operation_log.uri + * + * @mbg.generated + */ + private String uri; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column dashboard_operation_log.method_name + * + * @mbg.generated + */ + private String methodName; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column dashboard_operation_log.class_name + * + * @mbg.generated + */ + private String className; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column dashboard_operation_log.ip_address + * + * @mbg.generated + */ + private String ipAddress; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column dashboard_operation_log.execution_time_ms + * + * @mbg.generated + */ + private Long executionTimeMs; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column dashboard_operation_log.created_at + * + * @mbg.generated + */ + private Long createdAt; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column dashboard_operation_log.request_params + * + * @mbg.generated + */ + private String requestParams; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database table dashboard_operation_log + * + * @mbg.generated + */ + private static final long serialVersionUID = 1L; + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column dashboard_operation_log.id + * + * @return the value of dashboard_operation_log.id + * + * @mbg.generated + */ + public Long getId() { + return id; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column dashboard_operation_log.id + * + * @param id the value for dashboard_operation_log.id + * + * @mbg.generated + */ + public void setId(Long id) { + this.id = id; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column dashboard_operation_log.user_id + * + * @return the value of dashboard_operation_log.user_id + * + * @mbg.generated + */ + public Long getUserId() { + return userId; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column dashboard_operation_log.user_id + * + * @param userId the value for dashboard_operation_log.user_id + * + * @mbg.generated + */ + public void setUserId(Long userId) { + this.userId = userId; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column dashboard_operation_log.company_id + * + * @return the value of dashboard_operation_log.company_id + * + * @mbg.generated + */ + public Long getCompanyId() { + return companyId; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column dashboard_operation_log.company_id + * + * @param companyId the value for dashboard_operation_log.company_id + * + * @mbg.generated + */ + public void setCompanyId(Long companyId) { + this.companyId = companyId; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column dashboard_operation_log.operation + * + * @return the value of dashboard_operation_log.operation + * + * @mbg.generated + */ + public String getOperation() { + return operation; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column dashboard_operation_log.operation + * + * @param operation the value for dashboard_operation_log.operation + * + * @mbg.generated + */ + public void setOperation(String operation) { + this.operation = operation == null ? null : operation.trim(); + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column dashboard_operation_log.operation_remark + * + * @return the value of dashboard_operation_log.operation_remark + * + * @mbg.generated + */ + public String getOperationRemark() { + return operationRemark; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column dashboard_operation_log.operation_remark + * + * @param operationRemark the value for dashboard_operation_log.operation_remark + * + * @mbg.generated + */ + public void setOperationRemark(String operationRemark) { + this.operationRemark = operationRemark == null ? null : operationRemark.trim(); + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column dashboard_operation_log.uri + * + * @return the value of dashboard_operation_log.uri + * + * @mbg.generated + */ + public String getUri() { + return uri; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column dashboard_operation_log.uri + * + * @param uri the value for dashboard_operation_log.uri + * + * @mbg.generated + */ + public void setUri(String uri) { + this.uri = uri == null ? null : uri.trim(); + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column dashboard_operation_log.method_name + * + * @return the value of dashboard_operation_log.method_name + * + * @mbg.generated + */ + public String getMethodName() { + return methodName; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column dashboard_operation_log.method_name + * + * @param methodName the value for dashboard_operation_log.method_name + * + * @mbg.generated + */ + public void setMethodName(String methodName) { + this.methodName = methodName == null ? null : methodName.trim(); + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column dashboard_operation_log.class_name + * + * @return the value of dashboard_operation_log.class_name + * + * @mbg.generated + */ + public String getClassName() { + return className; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column dashboard_operation_log.class_name + * + * @param className the value for dashboard_operation_log.class_name + * + * @mbg.generated + */ + public void setClassName(String className) { + this.className = className == null ? null : className.trim(); + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column dashboard_operation_log.ip_address + * + * @return the value of dashboard_operation_log.ip_address + * + * @mbg.generated + */ + public String getIpAddress() { + return ipAddress; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column dashboard_operation_log.ip_address + * + * @param ipAddress the value for dashboard_operation_log.ip_address + * + * @mbg.generated + */ + public void setIpAddress(String ipAddress) { + this.ipAddress = ipAddress == null ? null : ipAddress.trim(); + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column dashboard_operation_log.execution_time_ms + * + * @return the value of dashboard_operation_log.execution_time_ms + * + * @mbg.generated + */ + public Long getExecutionTimeMs() { + return executionTimeMs; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column dashboard_operation_log.execution_time_ms + * + * @param executionTimeMs the value for dashboard_operation_log.execution_time_ms + * + * @mbg.generated + */ + public void setExecutionTimeMs(Long executionTimeMs) { + this.executionTimeMs = executionTimeMs; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column dashboard_operation_log.created_at + * + * @return the value of dashboard_operation_log.created_at + * + * @mbg.generated + */ + public Long getCreatedAt() { + return createdAt; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column dashboard_operation_log.created_at + * + * @param createdAt the value for dashboard_operation_log.created_at + * + * @mbg.generated + */ + public void setCreatedAt(Long createdAt) { + this.createdAt = createdAt; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column dashboard_operation_log.request_params + * + * @return the value of dashboard_operation_log.request_params + * + * @mbg.generated + */ + public String getRequestParams() { + return requestParams; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column dashboard_operation_log.request_params + * + * @param requestParams the value for dashboard_operation_log.request_params + * + * @mbg.generated + */ + public void setRequestParams(String requestParams) { + this.requestParams = requestParams == null ? null : requestParams.trim(); + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table dashboard_operation_log + * + * @mbg.generated + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append(getClass().getSimpleName()); + sb.append(" ["); + sb.append("Hash = ").append(hashCode()); + sb.append(", id=").append(id); + sb.append(", userId=").append(userId); + sb.append(", companyId=").append(companyId); + sb.append(", operation=").append(operation); + sb.append(", operationRemark=").append(operationRemark); + sb.append(", uri=").append(uri); + sb.append(", methodName=").append(methodName); + sb.append(", className=").append(className); + sb.append(", ipAddress=").append(ipAddress); + sb.append(", executionTimeMs=").append(executionTimeMs); + sb.append(", createdAt=").append(createdAt); + sb.append(", requestParams=").append(requestParams); + sb.append(", serialVersionUID=").append(serialVersionUID); + sb.append("]"); + return sb.toString(); + } +} \ No newline at end of file diff --git a/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/model/DashboardOperationLogExample.java b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/model/DashboardOperationLogExample.java new file mode 100644 index 0000000..e1f1190 --- /dev/null +++ b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/model/DashboardOperationLogExample.java @@ -0,0 +1,1022 @@ +package com.dongjian.dashboard.back.model; + +import java.util.ArrayList; +import java.util.List; + +public class DashboardOperationLogExample { + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database table dashboard_operation_log + * + * @mbg.generated + */ + protected String orderByClause; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database table dashboard_operation_log + * + * @mbg.generated + */ + protected boolean distinct; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database table dashboard_operation_log + * + * @mbg.generated + */ + protected List oredCriteria; + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table dashboard_operation_log + * + * @mbg.generated + */ + public DashboardOperationLogExample() { + oredCriteria = new ArrayList(); + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table dashboard_operation_log + * + * @mbg.generated + */ + public void setOrderByClause(String orderByClause) { + this.orderByClause = orderByClause; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table dashboard_operation_log + * + * @mbg.generated + */ + public String getOrderByClause() { + return orderByClause; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table dashboard_operation_log + * + * @mbg.generated + */ + public void setDistinct(boolean distinct) { + this.distinct = distinct; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table dashboard_operation_log + * + * @mbg.generated + */ + public boolean isDistinct() { + return distinct; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table dashboard_operation_log + * + * @mbg.generated + */ + public List getOredCriteria() { + return oredCriteria; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table dashboard_operation_log + * + * @mbg.generated + */ + public void or(Criteria criteria) { + oredCriteria.add(criteria); + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table dashboard_operation_log + * + * @mbg.generated + */ + public Criteria or() { + Criteria criteria = createCriteriaInternal(); + oredCriteria.add(criteria); + return criteria; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table dashboard_operation_log + * + * @mbg.generated + */ + public Criteria createCriteria() { + Criteria criteria = createCriteriaInternal(); + if (oredCriteria.size() == 0) { + oredCriteria.add(criteria); + } + return criteria; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table dashboard_operation_log + * + * @mbg.generated + */ + protected Criteria createCriteriaInternal() { + Criteria criteria = new Criteria(); + return criteria; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table dashboard_operation_log + * + * @mbg.generated + */ + public void clear() { + oredCriteria.clear(); + orderByClause = null; + distinct = false; + } + + /** + * This class was generated by MyBatis Generator. + * This class corresponds to the database table dashboard_operation_log + * + * @mbg.generated + */ + protected abstract static class GeneratedCriteria { + protected List criteria; + + protected GeneratedCriteria() { + super(); + criteria = new ArrayList(); + } + + public boolean isValid() { + return criteria.size() > 0; + } + + public List getAllCriteria() { + return criteria; + } + + public List getCriteria() { + return criteria; + } + + protected void addCriterion(String condition) { + if (condition == null) { + throw new RuntimeException("Value for condition cannot be null"); + } + criteria.add(new Criterion(condition)); + } + + protected void addCriterion(String condition, Object value, String property) { + if (value == null) { + throw new RuntimeException("Value for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value)); + } + + protected void addCriterion(String condition, Object value1, Object value2, String property) { + if (value1 == null || value2 == null) { + throw new RuntimeException("Between values for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value1, value2)); + } + + public Criteria andIdIsNull() { + addCriterion("id is null"); + return (Criteria) this; + } + + public Criteria andIdIsNotNull() { + addCriterion("id is not null"); + return (Criteria) this; + } + + public Criteria andIdEqualTo(Long value) { + addCriterion("id =", value, "id"); + return (Criteria) this; + } + + public Criteria andIdNotEqualTo(Long value) { + addCriterion("id <>", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThan(Long value) { + addCriterion("id >", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThanOrEqualTo(Long value) { + addCriterion("id >=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThan(Long value) { + addCriterion("id <", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThanOrEqualTo(Long value) { + addCriterion("id <=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdIn(List values) { + addCriterion("id in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdNotIn(List values) { + addCriterion("id not in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdBetween(Long value1, Long value2) { + addCriterion("id between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andIdNotBetween(Long value1, Long value2) { + addCriterion("id not between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andUserIdIsNull() { + addCriterion("user_id is null"); + return (Criteria) this; + } + + public Criteria andUserIdIsNotNull() { + addCriterion("user_id is not null"); + return (Criteria) this; + } + + public Criteria andUserIdEqualTo(Long value) { + addCriterion("user_id =", value, "userId"); + return (Criteria) this; + } + + public Criteria andUserIdNotEqualTo(Long value) { + addCriterion("user_id <>", value, "userId"); + return (Criteria) this; + } + + public Criteria andUserIdGreaterThan(Long value) { + addCriterion("user_id >", value, "userId"); + return (Criteria) this; + } + + public Criteria andUserIdGreaterThanOrEqualTo(Long value) { + addCriterion("user_id >=", value, "userId"); + return (Criteria) this; + } + + public Criteria andUserIdLessThan(Long value) { + addCriterion("user_id <", value, "userId"); + return (Criteria) this; + } + + public Criteria andUserIdLessThanOrEqualTo(Long value) { + addCriterion("user_id <=", value, "userId"); + return (Criteria) this; + } + + public Criteria andUserIdIn(List values) { + addCriterion("user_id in", values, "userId"); + return (Criteria) this; + } + + public Criteria andUserIdNotIn(List values) { + addCriterion("user_id not in", values, "userId"); + return (Criteria) this; + } + + public Criteria andUserIdBetween(Long value1, Long value2) { + addCriterion("user_id between", value1, value2, "userId"); + return (Criteria) this; + } + + public Criteria andUserIdNotBetween(Long value1, Long value2) { + addCriterion("user_id not between", value1, value2, "userId"); + return (Criteria) this; + } + + public Criteria andCompanyIdIsNull() { + addCriterion("company_id is null"); + return (Criteria) this; + } + + public Criteria andCompanyIdIsNotNull() { + addCriterion("company_id is not null"); + return (Criteria) this; + } + + public Criteria andCompanyIdEqualTo(Long value) { + addCriterion("company_id =", value, "companyId"); + return (Criteria) this; + } + + public Criteria andCompanyIdNotEqualTo(Long value) { + addCriterion("company_id <>", value, "companyId"); + return (Criteria) this; + } + + public Criteria andCompanyIdGreaterThan(Long value) { + addCriterion("company_id >", value, "companyId"); + return (Criteria) this; + } + + public Criteria andCompanyIdGreaterThanOrEqualTo(Long value) { + addCriterion("company_id >=", value, "companyId"); + return (Criteria) this; + } + + public Criteria andCompanyIdLessThan(Long value) { + addCriterion("company_id <", value, "companyId"); + return (Criteria) this; + } + + public Criteria andCompanyIdLessThanOrEqualTo(Long value) { + addCriterion("company_id <=", value, "companyId"); + return (Criteria) this; + } + + public Criteria andCompanyIdIn(List values) { + addCriterion("company_id in", values, "companyId"); + return (Criteria) this; + } + + public Criteria andCompanyIdNotIn(List values) { + addCriterion("company_id not in", values, "companyId"); + return (Criteria) this; + } + + public Criteria andCompanyIdBetween(Long value1, Long value2) { + addCriterion("company_id between", value1, value2, "companyId"); + return (Criteria) this; + } + + public Criteria andCompanyIdNotBetween(Long value1, Long value2) { + addCriterion("company_id not between", value1, value2, "companyId"); + return (Criteria) this; + } + + public Criteria andOperationIsNull() { + addCriterion("`operation` is null"); + return (Criteria) this; + } + + public Criteria andOperationIsNotNull() { + addCriterion("`operation` is not null"); + return (Criteria) this; + } + + public Criteria andOperationEqualTo(String value) { + addCriterion("`operation` =", value, "operation"); + return (Criteria) this; + } + + public Criteria andOperationNotEqualTo(String value) { + addCriterion("`operation` <>", value, "operation"); + return (Criteria) this; + } + + public Criteria andOperationGreaterThan(String value) { + addCriterion("`operation` >", value, "operation"); + return (Criteria) this; + } + + public Criteria andOperationGreaterThanOrEqualTo(String value) { + addCriterion("`operation` >=", value, "operation"); + return (Criteria) this; + } + + public Criteria andOperationLessThan(String value) { + addCriterion("`operation` <", value, "operation"); + return (Criteria) this; + } + + public Criteria andOperationLessThanOrEqualTo(String value) { + addCriterion("`operation` <=", value, "operation"); + return (Criteria) this; + } + + public Criteria andOperationLike(String value) { + addCriterion("`operation` like", value, "operation"); + return (Criteria) this; + } + + public Criteria andOperationNotLike(String value) { + addCriterion("`operation` not like", value, "operation"); + return (Criteria) this; + } + + public Criteria andOperationIn(List values) { + addCriterion("`operation` in", values, "operation"); + return (Criteria) this; + } + + public Criteria andOperationNotIn(List values) { + addCriterion("`operation` not in", values, "operation"); + return (Criteria) this; + } + + public Criteria andOperationBetween(String value1, String value2) { + addCriterion("`operation` between", value1, value2, "operation"); + return (Criteria) this; + } + + public Criteria andOperationNotBetween(String value1, String value2) { + addCriterion("`operation` not between", value1, value2, "operation"); + return (Criteria) this; + } + + public Criteria andOperationRemarkIsNull() { + addCriterion("operation_remark is null"); + return (Criteria) this; + } + + public Criteria andOperationRemarkIsNotNull() { + addCriterion("operation_remark is not null"); + return (Criteria) this; + } + + public Criteria andOperationRemarkEqualTo(String value) { + addCriterion("operation_remark =", value, "operationRemark"); + return (Criteria) this; + } + + public Criteria andOperationRemarkNotEqualTo(String value) { + addCriterion("operation_remark <>", value, "operationRemark"); + return (Criteria) this; + } + + public Criteria andOperationRemarkGreaterThan(String value) { + addCriterion("operation_remark >", value, "operationRemark"); + return (Criteria) this; + } + + public Criteria andOperationRemarkGreaterThanOrEqualTo(String value) { + addCriterion("operation_remark >=", value, "operationRemark"); + return (Criteria) this; + } + + public Criteria andOperationRemarkLessThan(String value) { + addCriterion("operation_remark <", value, "operationRemark"); + return (Criteria) this; + } + + public Criteria andOperationRemarkLessThanOrEqualTo(String value) { + addCriterion("operation_remark <=", value, "operationRemark"); + return (Criteria) this; + } + + public Criteria andOperationRemarkLike(String value) { + addCriterion("operation_remark like", value, "operationRemark"); + return (Criteria) this; + } + + public Criteria andOperationRemarkNotLike(String value) { + addCriterion("operation_remark not like", value, "operationRemark"); + return (Criteria) this; + } + + public Criteria andOperationRemarkIn(List values) { + addCriterion("operation_remark in", values, "operationRemark"); + return (Criteria) this; + } + + public Criteria andOperationRemarkNotIn(List values) { + addCriterion("operation_remark not in", values, "operationRemark"); + return (Criteria) this; + } + + public Criteria andOperationRemarkBetween(String value1, String value2) { + addCriterion("operation_remark between", value1, value2, "operationRemark"); + return (Criteria) this; + } + + public Criteria andOperationRemarkNotBetween(String value1, String value2) { + addCriterion("operation_remark not between", value1, value2, "operationRemark"); + return (Criteria) this; + } + + public Criteria andUriIsNull() { + addCriterion("uri is null"); + return (Criteria) this; + } + + public Criteria andUriIsNotNull() { + addCriterion("uri is not null"); + return (Criteria) this; + } + + public Criteria andUriEqualTo(String value) { + addCriterion("uri =", value, "uri"); + return (Criteria) this; + } + + public Criteria andUriNotEqualTo(String value) { + addCriterion("uri <>", value, "uri"); + return (Criteria) this; + } + + public Criteria andUriGreaterThan(String value) { + addCriterion("uri >", value, "uri"); + return (Criteria) this; + } + + public Criteria andUriGreaterThanOrEqualTo(String value) { + addCriterion("uri >=", value, "uri"); + return (Criteria) this; + } + + public Criteria andUriLessThan(String value) { + addCriterion("uri <", value, "uri"); + return (Criteria) this; + } + + public Criteria andUriLessThanOrEqualTo(String value) { + addCriterion("uri <=", value, "uri"); + return (Criteria) this; + } + + public Criteria andUriLike(String value) { + addCriterion("uri like", value, "uri"); + return (Criteria) this; + } + + public Criteria andUriNotLike(String value) { + addCriterion("uri not like", value, "uri"); + return (Criteria) this; + } + + public Criteria andUriIn(List values) { + addCriterion("uri in", values, "uri"); + return (Criteria) this; + } + + public Criteria andUriNotIn(List values) { + addCriterion("uri not in", values, "uri"); + return (Criteria) this; + } + + public Criteria andUriBetween(String value1, String value2) { + addCriterion("uri between", value1, value2, "uri"); + return (Criteria) this; + } + + public Criteria andUriNotBetween(String value1, String value2) { + addCriterion("uri not between", value1, value2, "uri"); + return (Criteria) this; + } + + public Criteria andMethodNameIsNull() { + addCriterion("method_name is null"); + return (Criteria) this; + } + + public Criteria andMethodNameIsNotNull() { + addCriterion("method_name is not null"); + return (Criteria) this; + } + + public Criteria andMethodNameEqualTo(String value) { + addCriterion("method_name =", value, "methodName"); + return (Criteria) this; + } + + public Criteria andMethodNameNotEqualTo(String value) { + addCriterion("method_name <>", value, "methodName"); + return (Criteria) this; + } + + public Criteria andMethodNameGreaterThan(String value) { + addCriterion("method_name >", value, "methodName"); + return (Criteria) this; + } + + public Criteria andMethodNameGreaterThanOrEqualTo(String value) { + addCriterion("method_name >=", value, "methodName"); + return (Criteria) this; + } + + public Criteria andMethodNameLessThan(String value) { + addCriterion("method_name <", value, "methodName"); + return (Criteria) this; + } + + public Criteria andMethodNameLessThanOrEqualTo(String value) { + addCriterion("method_name <=", value, "methodName"); + return (Criteria) this; + } + + public Criteria andMethodNameLike(String value) { + addCriterion("method_name like", value, "methodName"); + return (Criteria) this; + } + + public Criteria andMethodNameNotLike(String value) { + addCriterion("method_name not like", value, "methodName"); + return (Criteria) this; + } + + public Criteria andMethodNameIn(List values) { + addCriterion("method_name in", values, "methodName"); + return (Criteria) this; + } + + public Criteria andMethodNameNotIn(List values) { + addCriterion("method_name not in", values, "methodName"); + return (Criteria) this; + } + + public Criteria andMethodNameBetween(String value1, String value2) { + addCriterion("method_name between", value1, value2, "methodName"); + return (Criteria) this; + } + + public Criteria andMethodNameNotBetween(String value1, String value2) { + addCriterion("method_name not between", value1, value2, "methodName"); + return (Criteria) this; + } + + public Criteria andClassNameIsNull() { + addCriterion("class_name is null"); + return (Criteria) this; + } + + public Criteria andClassNameIsNotNull() { + addCriterion("class_name is not null"); + return (Criteria) this; + } + + public Criteria andClassNameEqualTo(String value) { + addCriterion("class_name =", value, "className"); + return (Criteria) this; + } + + public Criteria andClassNameNotEqualTo(String value) { + addCriterion("class_name <>", value, "className"); + return (Criteria) this; + } + + public Criteria andClassNameGreaterThan(String value) { + addCriterion("class_name >", value, "className"); + return (Criteria) this; + } + + public Criteria andClassNameGreaterThanOrEqualTo(String value) { + addCriterion("class_name >=", value, "className"); + return (Criteria) this; + } + + public Criteria andClassNameLessThan(String value) { + addCriterion("class_name <", value, "className"); + return (Criteria) this; + } + + public Criteria andClassNameLessThanOrEqualTo(String value) { + addCriterion("class_name <=", value, "className"); + return (Criteria) this; + } + + public Criteria andClassNameLike(String value) { + addCriterion("class_name like", value, "className"); + return (Criteria) this; + } + + public Criteria andClassNameNotLike(String value) { + addCriterion("class_name not like", value, "className"); + return (Criteria) this; + } + + public Criteria andClassNameIn(List values) { + addCriterion("class_name in", values, "className"); + return (Criteria) this; + } + + public Criteria andClassNameNotIn(List values) { + addCriterion("class_name not in", values, "className"); + return (Criteria) this; + } + + public Criteria andClassNameBetween(String value1, String value2) { + addCriterion("class_name between", value1, value2, "className"); + return (Criteria) this; + } + + public Criteria andClassNameNotBetween(String value1, String value2) { + addCriterion("class_name not between", value1, value2, "className"); + return (Criteria) this; + } + + public Criteria andIpAddressIsNull() { + addCriterion("ip_address is null"); + return (Criteria) this; + } + + public Criteria andIpAddressIsNotNull() { + addCriterion("ip_address is not null"); + return (Criteria) this; + } + + public Criteria andIpAddressEqualTo(String value) { + addCriterion("ip_address =", value, "ipAddress"); + return (Criteria) this; + } + + public Criteria andIpAddressNotEqualTo(String value) { + addCriterion("ip_address <>", value, "ipAddress"); + return (Criteria) this; + } + + public Criteria andIpAddressGreaterThan(String value) { + addCriterion("ip_address >", value, "ipAddress"); + return (Criteria) this; + } + + public Criteria andIpAddressGreaterThanOrEqualTo(String value) { + addCriterion("ip_address >=", value, "ipAddress"); + return (Criteria) this; + } + + public Criteria andIpAddressLessThan(String value) { + addCriterion("ip_address <", value, "ipAddress"); + return (Criteria) this; + } + + public Criteria andIpAddressLessThanOrEqualTo(String value) { + addCriterion("ip_address <=", value, "ipAddress"); + return (Criteria) this; + } + + public Criteria andIpAddressLike(String value) { + addCriterion("ip_address like", value, "ipAddress"); + return (Criteria) this; + } + + public Criteria andIpAddressNotLike(String value) { + addCriterion("ip_address not like", value, "ipAddress"); + return (Criteria) this; + } + + public Criteria andIpAddressIn(List values) { + addCriterion("ip_address in", values, "ipAddress"); + return (Criteria) this; + } + + public Criteria andIpAddressNotIn(List values) { + addCriterion("ip_address not in", values, "ipAddress"); + return (Criteria) this; + } + + public Criteria andIpAddressBetween(String value1, String value2) { + addCriterion("ip_address between", value1, value2, "ipAddress"); + return (Criteria) this; + } + + public Criteria andIpAddressNotBetween(String value1, String value2) { + addCriterion("ip_address not between", value1, value2, "ipAddress"); + return (Criteria) this; + } + + public Criteria andExecutionTimeMsIsNull() { + addCriterion("execution_time_ms is null"); + return (Criteria) this; + } + + public Criteria andExecutionTimeMsIsNotNull() { + addCriterion("execution_time_ms is not null"); + return (Criteria) this; + } + + public Criteria andExecutionTimeMsEqualTo(Long value) { + addCriterion("execution_time_ms =", value, "executionTimeMs"); + return (Criteria) this; + } + + public Criteria andExecutionTimeMsNotEqualTo(Long value) { + addCriterion("execution_time_ms <>", value, "executionTimeMs"); + return (Criteria) this; + } + + public Criteria andExecutionTimeMsGreaterThan(Long value) { + addCriterion("execution_time_ms >", value, "executionTimeMs"); + return (Criteria) this; + } + + public Criteria andExecutionTimeMsGreaterThanOrEqualTo(Long value) { + addCriterion("execution_time_ms >=", value, "executionTimeMs"); + return (Criteria) this; + } + + public Criteria andExecutionTimeMsLessThan(Long value) { + addCriterion("execution_time_ms <", value, "executionTimeMs"); + return (Criteria) this; + } + + public Criteria andExecutionTimeMsLessThanOrEqualTo(Long value) { + addCriterion("execution_time_ms <=", value, "executionTimeMs"); + return (Criteria) this; + } + + public Criteria andExecutionTimeMsIn(List values) { + addCriterion("execution_time_ms in", values, "executionTimeMs"); + return (Criteria) this; + } + + public Criteria andExecutionTimeMsNotIn(List values) { + addCriterion("execution_time_ms not in", values, "executionTimeMs"); + return (Criteria) this; + } + + public Criteria andExecutionTimeMsBetween(Long value1, Long value2) { + addCriterion("execution_time_ms between", value1, value2, "executionTimeMs"); + return (Criteria) this; + } + + public Criteria andExecutionTimeMsNotBetween(Long value1, Long value2) { + addCriterion("execution_time_ms not between", value1, value2, "executionTimeMs"); + return (Criteria) this; + } + + public Criteria andCreatedAtIsNull() { + addCriterion("created_at is null"); + return (Criteria) this; + } + + public Criteria andCreatedAtIsNotNull() { + addCriterion("created_at is not null"); + return (Criteria) this; + } + + public Criteria andCreatedAtEqualTo(Long value) { + addCriterion("created_at =", value, "createdAt"); + return (Criteria) this; + } + + public Criteria andCreatedAtNotEqualTo(Long value) { + addCriterion("created_at <>", value, "createdAt"); + return (Criteria) this; + } + + public Criteria andCreatedAtGreaterThan(Long value) { + addCriterion("created_at >", value, "createdAt"); + return (Criteria) this; + } + + public Criteria andCreatedAtGreaterThanOrEqualTo(Long value) { + addCriterion("created_at >=", value, "createdAt"); + return (Criteria) this; + } + + public Criteria andCreatedAtLessThan(Long value) { + addCriterion("created_at <", value, "createdAt"); + return (Criteria) this; + } + + public Criteria andCreatedAtLessThanOrEqualTo(Long value) { + addCriterion("created_at <=", value, "createdAt"); + return (Criteria) this; + } + + public Criteria andCreatedAtIn(List values) { + addCriterion("created_at in", values, "createdAt"); + return (Criteria) this; + } + + public Criteria andCreatedAtNotIn(List values) { + addCriterion("created_at not in", values, "createdAt"); + return (Criteria) this; + } + + public Criteria andCreatedAtBetween(Long value1, Long value2) { + addCriterion("created_at between", value1, value2, "createdAt"); + return (Criteria) this; + } + + public Criteria andCreatedAtNotBetween(Long value1, Long value2) { + addCriterion("created_at not between", value1, value2, "createdAt"); + return (Criteria) this; + } + } + + /** + * This class was generated by MyBatis Generator. + * This class corresponds to the database table dashboard_operation_log + * + * @mbg.generated do_not_delete_during_merge + */ + public static class Criteria extends GeneratedCriteria { + + protected Criteria() { + super(); + } + } + + /** + * This class was generated by MyBatis Generator. + * This class corresponds to the database table dashboard_operation_log + * + * @mbg.generated + */ + public static class Criterion { + private String condition; + + private Object value; + + private Object secondValue; + + private boolean noValue; + + private boolean singleValue; + + private boolean betweenValue; + + private boolean listValue; + + private String typeHandler; + + public String getCondition() { + return condition; + } + + public Object getValue() { + return value; + } + + public Object getSecondValue() { + return secondValue; + } + + public boolean isNoValue() { + return noValue; + } + + public boolean isSingleValue() { + return singleValue; + } + + public boolean isBetweenValue() { + return betweenValue; + } + + public boolean isListValue() { + return listValue; + } + + public String getTypeHandler() { + return typeHandler; + } + + protected Criterion(String condition) { + super(); + this.condition = condition; + this.typeHandler = null; + this.noValue = true; + } + + protected Criterion(String condition, Object value, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.typeHandler = typeHandler; + if (value instanceof List) { + this.listValue = true; + } else { + this.singleValue = true; + } + } + + protected Criterion(String condition, Object value) { + this(condition, value, null); + } + + protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.secondValue = secondValue; + this.typeHandler = typeHandler; + this.betweenValue = true; + } + + protected Criterion(String condition, Object value, Object secondValue) { + this(condition, value, secondValue, null); + } + } +} \ No newline at end of file diff --git a/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/model/DashboardRealtimeMeasure.java b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/model/DashboardRealtimeMeasure.java new file mode 100644 index 0000000..cc5753e --- /dev/null +++ b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/model/DashboardRealtimeMeasure.java @@ -0,0 +1,404 @@ +package com.dongjian.dashboard.back.model; + +import java.io.Serializable; + +public class DashboardRealtimeMeasure implements Serializable { + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column dashboard_realtime_measure.device_id + * + * @mbg.generated + */ + private String deviceId; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column dashboard_realtime_measure.date_year + * + * @mbg.generated + */ + private Integer dateYear; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column dashboard_realtime_measure.date_month + * + * @mbg.generated + */ + private Integer dateMonth; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column dashboard_realtime_measure.date_day + * + * @mbg.generated + */ + private Integer dateDay; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column dashboard_realtime_measure.date_hour + * + * @mbg.generated + */ + private Integer dateHour; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column dashboard_realtime_measure.date_minute + * + * @mbg.generated + */ + private Integer dateMinute; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column dashboard_realtime_measure.date_second + * + * @mbg.generated + */ + private Integer dateSecond; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column dashboard_realtime_measure.upload_value + * + * @mbg.generated + */ + private String uploadValue; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column dashboard_realtime_measure.min_value + * + * @mbg.generated + */ + private String minValue; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column dashboard_realtime_measure.max_value + * + * @mbg.generated + */ + private String maxValue; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column dashboard_realtime_measure.upload_at + * + * @mbg.generated + */ + private Long uploadAt; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database table dashboard_realtime_measure + * + * @mbg.generated + */ + private static final long serialVersionUID = 1L; + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column dashboard_realtime_measure.device_id + * + * @return the value of dashboard_realtime_measure.device_id + * + * @mbg.generated + */ + public String getDeviceId() { + return deviceId; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column dashboard_realtime_measure.device_id + * + * @param deviceId the value for dashboard_realtime_measure.device_id + * + * @mbg.generated + */ + public void setDeviceId(String deviceId) { + this.deviceId = deviceId == null ? null : deviceId.trim(); + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column dashboard_realtime_measure.date_year + * + * @return the value of dashboard_realtime_measure.date_year + * + * @mbg.generated + */ + public Integer getDateYear() { + return dateYear; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column dashboard_realtime_measure.date_year + * + * @param dateYear the value for dashboard_realtime_measure.date_year + * + * @mbg.generated + */ + public void setDateYear(Integer dateYear) { + this.dateYear = dateYear; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column dashboard_realtime_measure.date_month + * + * @return the value of dashboard_realtime_measure.date_month + * + * @mbg.generated + */ + public Integer getDateMonth() { + return dateMonth; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column dashboard_realtime_measure.date_month + * + * @param dateMonth the value for dashboard_realtime_measure.date_month + * + * @mbg.generated + */ + public void setDateMonth(Integer dateMonth) { + this.dateMonth = dateMonth; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column dashboard_realtime_measure.date_day + * + * @return the value of dashboard_realtime_measure.date_day + * + * @mbg.generated + */ + public Integer getDateDay() { + return dateDay; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column dashboard_realtime_measure.date_day + * + * @param dateDay the value for dashboard_realtime_measure.date_day + * + * @mbg.generated + */ + public void setDateDay(Integer dateDay) { + this.dateDay = dateDay; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column dashboard_realtime_measure.date_hour + * + * @return the value of dashboard_realtime_measure.date_hour + * + * @mbg.generated + */ + public Integer getDateHour() { + return dateHour; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column dashboard_realtime_measure.date_hour + * + * @param dateHour the value for dashboard_realtime_measure.date_hour + * + * @mbg.generated + */ + public void setDateHour(Integer dateHour) { + this.dateHour = dateHour; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column dashboard_realtime_measure.date_minute + * + * @return the value of dashboard_realtime_measure.date_minute + * + * @mbg.generated + */ + public Integer getDateMinute() { + return dateMinute; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column dashboard_realtime_measure.date_minute + * + * @param dateMinute the value for dashboard_realtime_measure.date_minute + * + * @mbg.generated + */ + public void setDateMinute(Integer dateMinute) { + this.dateMinute = dateMinute; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column dashboard_realtime_measure.date_second + * + * @return the value of dashboard_realtime_measure.date_second + * + * @mbg.generated + */ + public Integer getDateSecond() { + return dateSecond; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column dashboard_realtime_measure.date_second + * + * @param dateSecond the value for dashboard_realtime_measure.date_second + * + * @mbg.generated + */ + public void setDateSecond(Integer dateSecond) { + this.dateSecond = dateSecond; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column dashboard_realtime_measure.upload_value + * + * @return the value of dashboard_realtime_measure.upload_value + * + * @mbg.generated + */ + public String getUploadValue() { + return uploadValue; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column dashboard_realtime_measure.upload_value + * + * @param uploadValue the value for dashboard_realtime_measure.upload_value + * + * @mbg.generated + */ + public void setUploadValue(String uploadValue) { + this.uploadValue = uploadValue == null ? null : uploadValue.trim(); + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column dashboard_realtime_measure.min_value + * + * @return the value of dashboard_realtime_measure.min_value + * + * @mbg.generated + */ + public String getMinValue() { + return minValue; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column dashboard_realtime_measure.min_value + * + * @param minValue the value for dashboard_realtime_measure.min_value + * + * @mbg.generated + */ + public void setMinValue(String minValue) { + this.minValue = minValue == null ? null : minValue.trim(); + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column dashboard_realtime_measure.max_value + * + * @return the value of dashboard_realtime_measure.max_value + * + * @mbg.generated + */ + public String getMaxValue() { + return maxValue; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column dashboard_realtime_measure.max_value + * + * @param maxValue the value for dashboard_realtime_measure.max_value + * + * @mbg.generated + */ + public void setMaxValue(String maxValue) { + this.maxValue = maxValue == null ? null : maxValue.trim(); + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column dashboard_realtime_measure.upload_at + * + * @return the value of dashboard_realtime_measure.upload_at + * + * @mbg.generated + */ + public Long getUploadAt() { + return uploadAt; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column dashboard_realtime_measure.upload_at + * + * @param uploadAt the value for dashboard_realtime_measure.upload_at + * + * @mbg.generated + */ + public void setUploadAt(Long uploadAt) { + this.uploadAt = uploadAt; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table dashboard_realtime_measure + * + * @mbg.generated + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append(getClass().getSimpleName()); + sb.append(" ["); + sb.append("Hash = ").append(hashCode()); + sb.append(", deviceId=").append(deviceId); + sb.append(", dateYear=").append(dateYear); + sb.append(", dateMonth=").append(dateMonth); + sb.append(", dateDay=").append(dateDay); + sb.append(", dateHour=").append(dateHour); + sb.append(", dateMinute=").append(dateMinute); + sb.append(", dateSecond=").append(dateSecond); + sb.append(", uploadValue=").append(uploadValue); + sb.append(", minValue=").append(minValue); + sb.append(", maxValue=").append(maxValue); + sb.append(", uploadAt=").append(uploadAt); + sb.append(", serialVersionUID=").append(serialVersionUID); + sb.append("]"); + return sb.toString(); + } +} \ No newline at end of file diff --git a/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/model/DashboardRealtimeMeasureExample.java b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/model/DashboardRealtimeMeasureExample.java new file mode 100644 index 0000000..4130e01 --- /dev/null +++ b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/model/DashboardRealtimeMeasureExample.java @@ -0,0 +1,1002 @@ +package com.dongjian.dashboard.back.model; + +import java.util.ArrayList; +import java.util.List; + +public class DashboardRealtimeMeasureExample { + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database table dashboard_realtime_measure + * + * @mbg.generated + */ + protected String orderByClause; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database table dashboard_realtime_measure + * + * @mbg.generated + */ + protected boolean distinct; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database table dashboard_realtime_measure + * + * @mbg.generated + */ + protected List oredCriteria; + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table dashboard_realtime_measure + * + * @mbg.generated + */ + public DashboardRealtimeMeasureExample() { + oredCriteria = new ArrayList(); + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table dashboard_realtime_measure + * + * @mbg.generated + */ + public void setOrderByClause(String orderByClause) { + this.orderByClause = orderByClause; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table dashboard_realtime_measure + * + * @mbg.generated + */ + public String getOrderByClause() { + return orderByClause; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table dashboard_realtime_measure + * + * @mbg.generated + */ + public void setDistinct(boolean distinct) { + this.distinct = distinct; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table dashboard_realtime_measure + * + * @mbg.generated + */ + public boolean isDistinct() { + return distinct; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table dashboard_realtime_measure + * + * @mbg.generated + */ + public List getOredCriteria() { + return oredCriteria; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table dashboard_realtime_measure + * + * @mbg.generated + */ + public void or(Criteria criteria) { + oredCriteria.add(criteria); + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table dashboard_realtime_measure + * + * @mbg.generated + */ + public Criteria or() { + Criteria criteria = createCriteriaInternal(); + oredCriteria.add(criteria); + return criteria; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table dashboard_realtime_measure + * + * @mbg.generated + */ + public Criteria createCriteria() { + Criteria criteria = createCriteriaInternal(); + if (oredCriteria.size() == 0) { + oredCriteria.add(criteria); + } + return criteria; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table dashboard_realtime_measure + * + * @mbg.generated + */ + protected Criteria createCriteriaInternal() { + Criteria criteria = new Criteria(); + return criteria; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table dashboard_realtime_measure + * + * @mbg.generated + */ + public void clear() { + oredCriteria.clear(); + orderByClause = null; + distinct = false; + } + + /** + * This class was generated by MyBatis Generator. + * This class corresponds to the database table dashboard_realtime_measure + * + * @mbg.generated + */ + protected abstract static class GeneratedCriteria { + protected List criteria; + + protected GeneratedCriteria() { + super(); + criteria = new ArrayList(); + } + + public boolean isValid() { + return criteria.size() > 0; + } + + public List getAllCriteria() { + return criteria; + } + + public List getCriteria() { + return criteria; + } + + protected void addCriterion(String condition) { + if (condition == null) { + throw new RuntimeException("Value for condition cannot be null"); + } + criteria.add(new Criterion(condition)); + } + + protected void addCriterion(String condition, Object value, String property) { + if (value == null) { + throw new RuntimeException("Value for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value)); + } + + protected void addCriterion(String condition, Object value1, Object value2, String property) { + if (value1 == null || value2 == null) { + throw new RuntimeException("Between values for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value1, value2)); + } + + public Criteria andDeviceIdIsNull() { + addCriterion("device_id is null"); + return (Criteria) this; + } + + public Criteria andDeviceIdIsNotNull() { + addCriterion("device_id is not null"); + return (Criteria) this; + } + + public Criteria andDeviceIdEqualTo(String value) { + addCriterion("device_id =", value, "deviceId"); + return (Criteria) this; + } + + public Criteria andDeviceIdNotEqualTo(String value) { + addCriterion("device_id <>", value, "deviceId"); + return (Criteria) this; + } + + public Criteria andDeviceIdGreaterThan(String value) { + addCriterion("device_id >", value, "deviceId"); + return (Criteria) this; + } + + public Criteria andDeviceIdGreaterThanOrEqualTo(String value) { + addCriterion("device_id >=", value, "deviceId"); + return (Criteria) this; + } + + public Criteria andDeviceIdLessThan(String value) { + addCriterion("device_id <", value, "deviceId"); + return (Criteria) this; + } + + public Criteria andDeviceIdLessThanOrEqualTo(String value) { + addCriterion("device_id <=", value, "deviceId"); + return (Criteria) this; + } + + public Criteria andDeviceIdLike(String value) { + addCriterion("device_id like", value, "deviceId"); + return (Criteria) this; + } + + public Criteria andDeviceIdNotLike(String value) { + addCriterion("device_id not like", value, "deviceId"); + return (Criteria) this; + } + + public Criteria andDeviceIdIn(List values) { + addCriterion("device_id in", values, "deviceId"); + return (Criteria) this; + } + + public Criteria andDeviceIdNotIn(List values) { + addCriterion("device_id not in", values, "deviceId"); + return (Criteria) this; + } + + public Criteria andDeviceIdBetween(String value1, String value2) { + addCriterion("device_id between", value1, value2, "deviceId"); + return (Criteria) this; + } + + public Criteria andDeviceIdNotBetween(String value1, String value2) { + addCriterion("device_id not between", value1, value2, "deviceId"); + return (Criteria) this; + } + + public Criteria andDateYearIsNull() { + addCriterion("date_year is null"); + return (Criteria) this; + } + + public Criteria andDateYearIsNotNull() { + addCriterion("date_year is not null"); + return (Criteria) this; + } + + public Criteria andDateYearEqualTo(Integer value) { + addCriterion("date_year =", value, "dateYear"); + return (Criteria) this; + } + + public Criteria andDateYearNotEqualTo(Integer value) { + addCriterion("date_year <>", value, "dateYear"); + return (Criteria) this; + } + + public Criteria andDateYearGreaterThan(Integer value) { + addCriterion("date_year >", value, "dateYear"); + return (Criteria) this; + } + + public Criteria andDateYearGreaterThanOrEqualTo(Integer value) { + addCriterion("date_year >=", value, "dateYear"); + return (Criteria) this; + } + + public Criteria andDateYearLessThan(Integer value) { + addCriterion("date_year <", value, "dateYear"); + return (Criteria) this; + } + + public Criteria andDateYearLessThanOrEqualTo(Integer value) { + addCriterion("date_year <=", value, "dateYear"); + return (Criteria) this; + } + + public Criteria andDateYearIn(List values) { + addCriterion("date_year in", values, "dateYear"); + return (Criteria) this; + } + + public Criteria andDateYearNotIn(List values) { + addCriterion("date_year not in", values, "dateYear"); + return (Criteria) this; + } + + public Criteria andDateYearBetween(Integer value1, Integer value2) { + addCriterion("date_year between", value1, value2, "dateYear"); + return (Criteria) this; + } + + public Criteria andDateYearNotBetween(Integer value1, Integer value2) { + addCriterion("date_year not between", value1, value2, "dateYear"); + return (Criteria) this; + } + + public Criteria andDateMonthIsNull() { + addCriterion("date_month is null"); + return (Criteria) this; + } + + public Criteria andDateMonthIsNotNull() { + addCriterion("date_month is not null"); + return (Criteria) this; + } + + public Criteria andDateMonthEqualTo(Integer value) { + addCriterion("date_month =", value, "dateMonth"); + return (Criteria) this; + } + + public Criteria andDateMonthNotEqualTo(Integer value) { + addCriterion("date_month <>", value, "dateMonth"); + return (Criteria) this; + } + + public Criteria andDateMonthGreaterThan(Integer value) { + addCriterion("date_month >", value, "dateMonth"); + return (Criteria) this; + } + + public Criteria andDateMonthGreaterThanOrEqualTo(Integer value) { + addCriterion("date_month >=", value, "dateMonth"); + return (Criteria) this; + } + + public Criteria andDateMonthLessThan(Integer value) { + addCriterion("date_month <", value, "dateMonth"); + return (Criteria) this; + } + + public Criteria andDateMonthLessThanOrEqualTo(Integer value) { + addCriterion("date_month <=", value, "dateMonth"); + return (Criteria) this; + } + + public Criteria andDateMonthIn(List values) { + addCriterion("date_month in", values, "dateMonth"); + return (Criteria) this; + } + + public Criteria andDateMonthNotIn(List values) { + addCriterion("date_month not in", values, "dateMonth"); + return (Criteria) this; + } + + public Criteria andDateMonthBetween(Integer value1, Integer value2) { + addCriterion("date_month between", value1, value2, "dateMonth"); + return (Criteria) this; + } + + public Criteria andDateMonthNotBetween(Integer value1, Integer value2) { + addCriterion("date_month not between", value1, value2, "dateMonth"); + return (Criteria) this; + } + + public Criteria andDateDayIsNull() { + addCriterion("date_day is null"); + return (Criteria) this; + } + + public Criteria andDateDayIsNotNull() { + addCriterion("date_day is not null"); + return (Criteria) this; + } + + public Criteria andDateDayEqualTo(Integer value) { + addCriterion("date_day =", value, "dateDay"); + return (Criteria) this; + } + + public Criteria andDateDayNotEqualTo(Integer value) { + addCriterion("date_day <>", value, "dateDay"); + return (Criteria) this; + } + + public Criteria andDateDayGreaterThan(Integer value) { + addCriterion("date_day >", value, "dateDay"); + return (Criteria) this; + } + + public Criteria andDateDayGreaterThanOrEqualTo(Integer value) { + addCriterion("date_day >=", value, "dateDay"); + return (Criteria) this; + } + + public Criteria andDateDayLessThan(Integer value) { + addCriterion("date_day <", value, "dateDay"); + return (Criteria) this; + } + + public Criteria andDateDayLessThanOrEqualTo(Integer value) { + addCriterion("date_day <=", value, "dateDay"); + return (Criteria) this; + } + + public Criteria andDateDayIn(List values) { + addCriterion("date_day in", values, "dateDay"); + return (Criteria) this; + } + + public Criteria andDateDayNotIn(List values) { + addCriterion("date_day not in", values, "dateDay"); + return (Criteria) this; + } + + public Criteria andDateDayBetween(Integer value1, Integer value2) { + addCriterion("date_day between", value1, value2, "dateDay"); + return (Criteria) this; + } + + public Criteria andDateDayNotBetween(Integer value1, Integer value2) { + addCriterion("date_day not between", value1, value2, "dateDay"); + return (Criteria) this; + } + + public Criteria andDateHourIsNull() { + addCriterion("date_hour is null"); + return (Criteria) this; + } + + public Criteria andDateHourIsNotNull() { + addCriterion("date_hour is not null"); + return (Criteria) this; + } + + public Criteria andDateHourEqualTo(Integer value) { + addCriterion("date_hour =", value, "dateHour"); + return (Criteria) this; + } + + public Criteria andDateHourNotEqualTo(Integer value) { + addCriterion("date_hour <>", value, "dateHour"); + return (Criteria) this; + } + + public Criteria andDateHourGreaterThan(Integer value) { + addCriterion("date_hour >", value, "dateHour"); + return (Criteria) this; + } + + public Criteria andDateHourGreaterThanOrEqualTo(Integer value) { + addCriterion("date_hour >=", value, "dateHour"); + return (Criteria) this; + } + + public Criteria andDateHourLessThan(Integer value) { + addCriterion("date_hour <", value, "dateHour"); + return (Criteria) this; + } + + public Criteria andDateHourLessThanOrEqualTo(Integer value) { + addCriterion("date_hour <=", value, "dateHour"); + return (Criteria) this; + } + + public Criteria andDateHourIn(List values) { + addCriterion("date_hour in", values, "dateHour"); + return (Criteria) this; + } + + public Criteria andDateHourNotIn(List values) { + addCriterion("date_hour not in", values, "dateHour"); + return (Criteria) this; + } + + public Criteria andDateHourBetween(Integer value1, Integer value2) { + addCriterion("date_hour between", value1, value2, "dateHour"); + return (Criteria) this; + } + + public Criteria andDateHourNotBetween(Integer value1, Integer value2) { + addCriterion("date_hour not between", value1, value2, "dateHour"); + return (Criteria) this; + } + + public Criteria andDateMinuteIsNull() { + addCriterion("date_minute is null"); + return (Criteria) this; + } + + public Criteria andDateMinuteIsNotNull() { + addCriterion("date_minute is not null"); + return (Criteria) this; + } + + public Criteria andDateMinuteEqualTo(Integer value) { + addCriterion("date_minute =", value, "dateMinute"); + return (Criteria) this; + } + + public Criteria andDateMinuteNotEqualTo(Integer value) { + addCriterion("date_minute <>", value, "dateMinute"); + return (Criteria) this; + } + + public Criteria andDateMinuteGreaterThan(Integer value) { + addCriterion("date_minute >", value, "dateMinute"); + return (Criteria) this; + } + + public Criteria andDateMinuteGreaterThanOrEqualTo(Integer value) { + addCriterion("date_minute >=", value, "dateMinute"); + return (Criteria) this; + } + + public Criteria andDateMinuteLessThan(Integer value) { + addCriterion("date_minute <", value, "dateMinute"); + return (Criteria) this; + } + + public Criteria andDateMinuteLessThanOrEqualTo(Integer value) { + addCriterion("date_minute <=", value, "dateMinute"); + return (Criteria) this; + } + + public Criteria andDateMinuteIn(List values) { + addCriterion("date_minute in", values, "dateMinute"); + return (Criteria) this; + } + + public Criteria andDateMinuteNotIn(List values) { + addCriterion("date_minute not in", values, "dateMinute"); + return (Criteria) this; + } + + public Criteria andDateMinuteBetween(Integer value1, Integer value2) { + addCriterion("date_minute between", value1, value2, "dateMinute"); + return (Criteria) this; + } + + public Criteria andDateMinuteNotBetween(Integer value1, Integer value2) { + addCriterion("date_minute not between", value1, value2, "dateMinute"); + return (Criteria) this; + } + + public Criteria andDateSecondIsNull() { + addCriterion("date_second is null"); + return (Criteria) this; + } + + public Criteria andDateSecondIsNotNull() { + addCriterion("date_second is not null"); + return (Criteria) this; + } + + public Criteria andDateSecondEqualTo(Integer value) { + addCriterion("date_second =", value, "dateSecond"); + return (Criteria) this; + } + + public Criteria andDateSecondNotEqualTo(Integer value) { + addCriterion("date_second <>", value, "dateSecond"); + return (Criteria) this; + } + + public Criteria andDateSecondGreaterThan(Integer value) { + addCriterion("date_second >", value, "dateSecond"); + return (Criteria) this; + } + + public Criteria andDateSecondGreaterThanOrEqualTo(Integer value) { + addCriterion("date_second >=", value, "dateSecond"); + return (Criteria) this; + } + + public Criteria andDateSecondLessThan(Integer value) { + addCriterion("date_second <", value, "dateSecond"); + return (Criteria) this; + } + + public Criteria andDateSecondLessThanOrEqualTo(Integer value) { + addCriterion("date_second <=", value, "dateSecond"); + return (Criteria) this; + } + + public Criteria andDateSecondIn(List values) { + addCriterion("date_second in", values, "dateSecond"); + return (Criteria) this; + } + + public Criteria andDateSecondNotIn(List values) { + addCriterion("date_second not in", values, "dateSecond"); + return (Criteria) this; + } + + public Criteria andDateSecondBetween(Integer value1, Integer value2) { + addCriterion("date_second between", value1, value2, "dateSecond"); + return (Criteria) this; + } + + public Criteria andDateSecondNotBetween(Integer value1, Integer value2) { + addCriterion("date_second not between", value1, value2, "dateSecond"); + return (Criteria) this; + } + + public Criteria andUploadValueIsNull() { + addCriterion("upload_value is null"); + return (Criteria) this; + } + + public Criteria andUploadValueIsNotNull() { + addCriterion("upload_value is not null"); + return (Criteria) this; + } + + public Criteria andUploadValueEqualTo(String value) { + addCriterion("upload_value =", value, "uploadValue"); + return (Criteria) this; + } + + public Criteria andUploadValueNotEqualTo(String value) { + addCriterion("upload_value <>", value, "uploadValue"); + return (Criteria) this; + } + + public Criteria andUploadValueGreaterThan(String value) { + addCriterion("upload_value >", value, "uploadValue"); + return (Criteria) this; + } + + public Criteria andUploadValueGreaterThanOrEqualTo(String value) { + addCriterion("upload_value >=", value, "uploadValue"); + return (Criteria) this; + } + + public Criteria andUploadValueLessThan(String value) { + addCriterion("upload_value <", value, "uploadValue"); + return (Criteria) this; + } + + public Criteria andUploadValueLessThanOrEqualTo(String value) { + addCriterion("upload_value <=", value, "uploadValue"); + return (Criteria) this; + } + + public Criteria andUploadValueLike(String value) { + addCriterion("upload_value like", value, "uploadValue"); + return (Criteria) this; + } + + public Criteria andUploadValueNotLike(String value) { + addCriterion("upload_value not like", value, "uploadValue"); + return (Criteria) this; + } + + public Criteria andUploadValueIn(List values) { + addCriterion("upload_value in", values, "uploadValue"); + return (Criteria) this; + } + + public Criteria andUploadValueNotIn(List values) { + addCriterion("upload_value not in", values, "uploadValue"); + return (Criteria) this; + } + + public Criteria andUploadValueBetween(String value1, String value2) { + addCriterion("upload_value between", value1, value2, "uploadValue"); + return (Criteria) this; + } + + public Criteria andUploadValueNotBetween(String value1, String value2) { + addCriterion("upload_value not between", value1, value2, "uploadValue"); + return (Criteria) this; + } + + public Criteria andMinValueIsNull() { + addCriterion("min_value is null"); + return (Criteria) this; + } + + public Criteria andMinValueIsNotNull() { + addCriterion("min_value is not null"); + return (Criteria) this; + } + + public Criteria andMinValueEqualTo(String value) { + addCriterion("min_value =", value, "minValue"); + return (Criteria) this; + } + + public Criteria andMinValueNotEqualTo(String value) { + addCriterion("min_value <>", value, "minValue"); + return (Criteria) this; + } + + public Criteria andMinValueGreaterThan(String value) { + addCriterion("min_value >", value, "minValue"); + return (Criteria) this; + } + + public Criteria andMinValueGreaterThanOrEqualTo(String value) { + addCriterion("min_value >=", value, "minValue"); + return (Criteria) this; + } + + public Criteria andMinValueLessThan(String value) { + addCriterion("min_value <", value, "minValue"); + return (Criteria) this; + } + + public Criteria andMinValueLessThanOrEqualTo(String value) { + addCriterion("min_value <=", value, "minValue"); + return (Criteria) this; + } + + public Criteria andMinValueLike(String value) { + addCriterion("min_value like", value, "minValue"); + return (Criteria) this; + } + + public Criteria andMinValueNotLike(String value) { + addCriterion("min_value not like", value, "minValue"); + return (Criteria) this; + } + + public Criteria andMinValueIn(List values) { + addCriterion("min_value in", values, "minValue"); + return (Criteria) this; + } + + public Criteria andMinValueNotIn(List values) { + addCriterion("min_value not in", values, "minValue"); + return (Criteria) this; + } + + public Criteria andMinValueBetween(String value1, String value2) { + addCriterion("min_value between", value1, value2, "minValue"); + return (Criteria) this; + } + + public Criteria andMinValueNotBetween(String value1, String value2) { + addCriterion("min_value not between", value1, value2, "minValue"); + return (Criteria) this; + } + + public Criteria andMaxValueIsNull() { + addCriterion("max_value is null"); + return (Criteria) this; + } + + public Criteria andMaxValueIsNotNull() { + addCriterion("max_value is not null"); + return (Criteria) this; + } + + public Criteria andMaxValueEqualTo(String value) { + addCriterion("max_value =", value, "maxValue"); + return (Criteria) this; + } + + public Criteria andMaxValueNotEqualTo(String value) { + addCriterion("max_value <>", value, "maxValue"); + return (Criteria) this; + } + + public Criteria andMaxValueGreaterThan(String value) { + addCriterion("max_value >", value, "maxValue"); + return (Criteria) this; + } + + public Criteria andMaxValueGreaterThanOrEqualTo(String value) { + addCriterion("max_value >=", value, "maxValue"); + return (Criteria) this; + } + + public Criteria andMaxValueLessThan(String value) { + addCriterion("max_value <", value, "maxValue"); + return (Criteria) this; + } + + public Criteria andMaxValueLessThanOrEqualTo(String value) { + addCriterion("max_value <=", value, "maxValue"); + return (Criteria) this; + } + + public Criteria andMaxValueLike(String value) { + addCriterion("max_value like", value, "maxValue"); + return (Criteria) this; + } + + public Criteria andMaxValueNotLike(String value) { + addCriterion("max_value not like", value, "maxValue"); + return (Criteria) this; + } + + public Criteria andMaxValueIn(List values) { + addCriterion("max_value in", values, "maxValue"); + return (Criteria) this; + } + + public Criteria andMaxValueNotIn(List values) { + addCriterion("max_value not in", values, "maxValue"); + return (Criteria) this; + } + + public Criteria andMaxValueBetween(String value1, String value2) { + addCriterion("max_value between", value1, value2, "maxValue"); + return (Criteria) this; + } + + public Criteria andMaxValueNotBetween(String value1, String value2) { + addCriterion("max_value not between", value1, value2, "maxValue"); + return (Criteria) this; + } + + public Criteria andUploadAtIsNull() { + addCriterion("upload_at is null"); + return (Criteria) this; + } + + public Criteria andUploadAtIsNotNull() { + addCriterion("upload_at is not null"); + return (Criteria) this; + } + + public Criteria andUploadAtEqualTo(Long value) { + addCriterion("upload_at =", value, "uploadAt"); + return (Criteria) this; + } + + public Criteria andUploadAtNotEqualTo(Long value) { + addCriterion("upload_at <>", value, "uploadAt"); + return (Criteria) this; + } + + public Criteria andUploadAtGreaterThan(Long value) { + addCriterion("upload_at >", value, "uploadAt"); + return (Criteria) this; + } + + public Criteria andUploadAtGreaterThanOrEqualTo(Long value) { + addCriterion("upload_at >=", value, "uploadAt"); + return (Criteria) this; + } + + public Criteria andUploadAtLessThan(Long value) { + addCriterion("upload_at <", value, "uploadAt"); + return (Criteria) this; + } + + public Criteria andUploadAtLessThanOrEqualTo(Long value) { + addCriterion("upload_at <=", value, "uploadAt"); + return (Criteria) this; + } + + public Criteria andUploadAtIn(List values) { + addCriterion("upload_at in", values, "uploadAt"); + return (Criteria) this; + } + + public Criteria andUploadAtNotIn(List values) { + addCriterion("upload_at not in", values, "uploadAt"); + return (Criteria) this; + } + + public Criteria andUploadAtBetween(Long value1, Long value2) { + addCriterion("upload_at between", value1, value2, "uploadAt"); + return (Criteria) this; + } + + public Criteria andUploadAtNotBetween(Long value1, Long value2) { + addCriterion("upload_at not between", value1, value2, "uploadAt"); + return (Criteria) this; + } + } + + /** + * This class was generated by MyBatis Generator. + * This class corresponds to the database table dashboard_realtime_measure + * + * @mbg.generated do_not_delete_during_merge + */ + public static class Criteria extends GeneratedCriteria { + + protected Criteria() { + super(); + } + } + + /** + * This class was generated by MyBatis Generator. + * This class corresponds to the database table dashboard_realtime_measure + * + * @mbg.generated + */ + public static class Criterion { + private String condition; + + private Object value; + + private Object secondValue; + + private boolean noValue; + + private boolean singleValue; + + private boolean betweenValue; + + private boolean listValue; + + private String typeHandler; + + public String getCondition() { + return condition; + } + + public Object getValue() { + return value; + } + + public Object getSecondValue() { + return secondValue; + } + + public boolean isNoValue() { + return noValue; + } + + public boolean isSingleValue() { + return singleValue; + } + + public boolean isBetweenValue() { + return betweenValue; + } + + public boolean isListValue() { + return listValue; + } + + public String getTypeHandler() { + return typeHandler; + } + + protected Criterion(String condition) { + super(); + this.condition = condition; + this.typeHandler = null; + this.noValue = true; + } + + protected Criterion(String condition, Object value, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.typeHandler = typeHandler; + if (value instanceof List) { + this.listValue = true; + } else { + this.singleValue = true; + } + } + + protected Criterion(String condition, Object value) { + this(condition, value, null); + } + + protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.secondValue = secondValue; + this.typeHandler = typeHandler; + this.betweenValue = true; + } + + protected Criterion(String condition, Object value, Object secondValue) { + this(condition, value, secondValue, null); + } + } +} \ No newline at end of file diff --git a/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/model/DashboardRecordAccumulate.java b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/model/DashboardRecordAccumulate.java new file mode 100644 index 0000000..0e7d38c --- /dev/null +++ b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/model/DashboardRecordAccumulate.java @@ -0,0 +1,438 @@ +package com.dongjian.dashboard.back.model; + +import java.io.Serializable; + +public class DashboardRecordAccumulate implements Serializable { + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column dashboard_record_accumulate.id + * + * @mbg.generated + */ + private Long id; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column dashboard_record_accumulate.device_id + * + * @mbg.generated + */ + private String deviceId; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column dashboard_record_accumulate.date_year + * + * @mbg.generated + */ + private Integer dateYear; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column dashboard_record_accumulate.date_month + * + * @mbg.generated + */ + private Integer dateMonth; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column dashboard_record_accumulate.date_day + * + * @mbg.generated + */ + private Integer dateDay; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column dashboard_record_accumulate.date_hour + * + * @mbg.generated + */ + private Integer dateHour; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column dashboard_record_accumulate.date_minute + * + * @mbg.generated + */ + private Integer dateMinute; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column dashboard_record_accumulate.date_second + * + * @mbg.generated + */ + private Integer dateSecond; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column dashboard_record_accumulate.upload_value + * + * @mbg.generated + */ + private String uploadValue; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column dashboard_record_accumulate.increment_today + * + * @mbg.generated + */ + private String incrementToday; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column dashboard_record_accumulate.increment_minute + * + * @mbg.generated + */ + private String incrementMinute; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column dashboard_record_accumulate.upload_at + * + * @mbg.generated + */ + private Long uploadAt; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database table dashboard_record_accumulate + * + * @mbg.generated + */ + private static final long serialVersionUID = 1L; + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column dashboard_record_accumulate.id + * + * @return the value of dashboard_record_accumulate.id + * + * @mbg.generated + */ + public Long getId() { + return id; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column dashboard_record_accumulate.id + * + * @param id the value for dashboard_record_accumulate.id + * + * @mbg.generated + */ + public void setId(Long id) { + this.id = id; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column dashboard_record_accumulate.device_id + * + * @return the value of dashboard_record_accumulate.device_id + * + * @mbg.generated + */ + public String getDeviceId() { + return deviceId; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column dashboard_record_accumulate.device_id + * + * @param deviceId the value for dashboard_record_accumulate.device_id + * + * @mbg.generated + */ + public void setDeviceId(String deviceId) { + this.deviceId = deviceId == null ? null : deviceId.trim(); + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column dashboard_record_accumulate.date_year + * + * @return the value of dashboard_record_accumulate.date_year + * + * @mbg.generated + */ + public Integer getDateYear() { + return dateYear; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column dashboard_record_accumulate.date_year + * + * @param dateYear the value for dashboard_record_accumulate.date_year + * + * @mbg.generated + */ + public void setDateYear(Integer dateYear) { + this.dateYear = dateYear; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column dashboard_record_accumulate.date_month + * + * @return the value of dashboard_record_accumulate.date_month + * + * @mbg.generated + */ + public Integer getDateMonth() { + return dateMonth; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column dashboard_record_accumulate.date_month + * + * @param dateMonth the value for dashboard_record_accumulate.date_month + * + * @mbg.generated + */ + public void setDateMonth(Integer dateMonth) { + this.dateMonth = dateMonth; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column dashboard_record_accumulate.date_day + * + * @return the value of dashboard_record_accumulate.date_day + * + * @mbg.generated + */ + public Integer getDateDay() { + return dateDay; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column dashboard_record_accumulate.date_day + * + * @param dateDay the value for dashboard_record_accumulate.date_day + * + * @mbg.generated + */ + public void setDateDay(Integer dateDay) { + this.dateDay = dateDay; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column dashboard_record_accumulate.date_hour + * + * @return the value of dashboard_record_accumulate.date_hour + * + * @mbg.generated + */ + public Integer getDateHour() { + return dateHour; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column dashboard_record_accumulate.date_hour + * + * @param dateHour the value for dashboard_record_accumulate.date_hour + * + * @mbg.generated + */ + public void setDateHour(Integer dateHour) { + this.dateHour = dateHour; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column dashboard_record_accumulate.date_minute + * + * @return the value of dashboard_record_accumulate.date_minute + * + * @mbg.generated + */ + public Integer getDateMinute() { + return dateMinute; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column dashboard_record_accumulate.date_minute + * + * @param dateMinute the value for dashboard_record_accumulate.date_minute + * + * @mbg.generated + */ + public void setDateMinute(Integer dateMinute) { + this.dateMinute = dateMinute; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column dashboard_record_accumulate.date_second + * + * @return the value of dashboard_record_accumulate.date_second + * + * @mbg.generated + */ + public Integer getDateSecond() { + return dateSecond; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column dashboard_record_accumulate.date_second + * + * @param dateSecond the value for dashboard_record_accumulate.date_second + * + * @mbg.generated + */ + public void setDateSecond(Integer dateSecond) { + this.dateSecond = dateSecond; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column dashboard_record_accumulate.upload_value + * + * @return the value of dashboard_record_accumulate.upload_value + * + * @mbg.generated + */ + public String getUploadValue() { + return uploadValue; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column dashboard_record_accumulate.upload_value + * + * @param uploadValue the value for dashboard_record_accumulate.upload_value + * + * @mbg.generated + */ + public void setUploadValue(String uploadValue) { + this.uploadValue = uploadValue == null ? null : uploadValue.trim(); + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column dashboard_record_accumulate.increment_today + * + * @return the value of dashboard_record_accumulate.increment_today + * + * @mbg.generated + */ + public String getIncrementToday() { + return incrementToday; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column dashboard_record_accumulate.increment_today + * + * @param incrementToday the value for dashboard_record_accumulate.increment_today + * + * @mbg.generated + */ + public void setIncrementToday(String incrementToday) { + this.incrementToday = incrementToday == null ? null : incrementToday.trim(); + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column dashboard_record_accumulate.increment_minute + * + * @return the value of dashboard_record_accumulate.increment_minute + * + * @mbg.generated + */ + public String getIncrementMinute() { + return incrementMinute; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column dashboard_record_accumulate.increment_minute + * + * @param incrementMinute the value for dashboard_record_accumulate.increment_minute + * + * @mbg.generated + */ + public void setIncrementMinute(String incrementMinute) { + this.incrementMinute = incrementMinute == null ? null : incrementMinute.trim(); + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column dashboard_record_accumulate.upload_at + * + * @return the value of dashboard_record_accumulate.upload_at + * + * @mbg.generated + */ + public Long getUploadAt() { + return uploadAt; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column dashboard_record_accumulate.upload_at + * + * @param uploadAt the value for dashboard_record_accumulate.upload_at + * + * @mbg.generated + */ + public void setUploadAt(Long uploadAt) { + this.uploadAt = uploadAt; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table dashboard_record_accumulate + * + * @mbg.generated + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append(getClass().getSimpleName()); + sb.append(" ["); + sb.append("Hash = ").append(hashCode()); + sb.append(", id=").append(id); + sb.append(", deviceId=").append(deviceId); + sb.append(", dateYear=").append(dateYear); + sb.append(", dateMonth=").append(dateMonth); + sb.append(", dateDay=").append(dateDay); + sb.append(", dateHour=").append(dateHour); + sb.append(", dateMinute=").append(dateMinute); + sb.append(", dateSecond=").append(dateSecond); + sb.append(", uploadValue=").append(uploadValue); + sb.append(", incrementToday=").append(incrementToday); + sb.append(", incrementMinute=").append(incrementMinute); + sb.append(", uploadAt=").append(uploadAt); + sb.append(", serialVersionUID=").append(serialVersionUID); + sb.append("]"); + return sb.toString(); + } +} \ No newline at end of file diff --git a/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/model/DashboardRecordAccumulateExample.java b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/model/DashboardRecordAccumulateExample.java new file mode 100644 index 0000000..bd2af43 --- /dev/null +++ b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/model/DashboardRecordAccumulateExample.java @@ -0,0 +1,1062 @@ +package com.dongjian.dashboard.back.model; + +import java.util.ArrayList; +import java.util.List; + +public class DashboardRecordAccumulateExample { + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database table dashboard_record_accumulate + * + * @mbg.generated + */ + protected String orderByClause; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database table dashboard_record_accumulate + * + * @mbg.generated + */ + protected boolean distinct; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database table dashboard_record_accumulate + * + * @mbg.generated + */ + protected List oredCriteria; + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table dashboard_record_accumulate + * + * @mbg.generated + */ + public DashboardRecordAccumulateExample() { + oredCriteria = new ArrayList(); + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table dashboard_record_accumulate + * + * @mbg.generated + */ + public void setOrderByClause(String orderByClause) { + this.orderByClause = orderByClause; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table dashboard_record_accumulate + * + * @mbg.generated + */ + public String getOrderByClause() { + return orderByClause; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table dashboard_record_accumulate + * + * @mbg.generated + */ + public void setDistinct(boolean distinct) { + this.distinct = distinct; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table dashboard_record_accumulate + * + * @mbg.generated + */ + public boolean isDistinct() { + return distinct; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table dashboard_record_accumulate + * + * @mbg.generated + */ + public List getOredCriteria() { + return oredCriteria; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table dashboard_record_accumulate + * + * @mbg.generated + */ + public void or(Criteria criteria) { + oredCriteria.add(criteria); + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table dashboard_record_accumulate + * + * @mbg.generated + */ + public Criteria or() { + Criteria criteria = createCriteriaInternal(); + oredCriteria.add(criteria); + return criteria; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table dashboard_record_accumulate + * + * @mbg.generated + */ + public Criteria createCriteria() { + Criteria criteria = createCriteriaInternal(); + if (oredCriteria.size() == 0) { + oredCriteria.add(criteria); + } + return criteria; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table dashboard_record_accumulate + * + * @mbg.generated + */ + protected Criteria createCriteriaInternal() { + Criteria criteria = new Criteria(); + return criteria; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table dashboard_record_accumulate + * + * @mbg.generated + */ + public void clear() { + oredCriteria.clear(); + orderByClause = null; + distinct = false; + } + + /** + * This class was generated by MyBatis Generator. + * This class corresponds to the database table dashboard_record_accumulate + * + * @mbg.generated + */ + protected abstract static class GeneratedCriteria { + protected List criteria; + + protected GeneratedCriteria() { + super(); + criteria = new ArrayList(); + } + + public boolean isValid() { + return criteria.size() > 0; + } + + public List getAllCriteria() { + return criteria; + } + + public List getCriteria() { + return criteria; + } + + protected void addCriterion(String condition) { + if (condition == null) { + throw new RuntimeException("Value for condition cannot be null"); + } + criteria.add(new Criterion(condition)); + } + + protected void addCriterion(String condition, Object value, String property) { + if (value == null) { + throw new RuntimeException("Value for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value)); + } + + protected void addCriterion(String condition, Object value1, Object value2, String property) { + if (value1 == null || value2 == null) { + throw new RuntimeException("Between values for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value1, value2)); + } + + public Criteria andIdIsNull() { + addCriterion("id is null"); + return (Criteria) this; + } + + public Criteria andIdIsNotNull() { + addCriterion("id is not null"); + return (Criteria) this; + } + + public Criteria andIdEqualTo(Long value) { + addCriterion("id =", value, "id"); + return (Criteria) this; + } + + public Criteria andIdNotEqualTo(Long value) { + addCriterion("id <>", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThan(Long value) { + addCriterion("id >", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThanOrEqualTo(Long value) { + addCriterion("id >=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThan(Long value) { + addCriterion("id <", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThanOrEqualTo(Long value) { + addCriterion("id <=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdIn(List values) { + addCriterion("id in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdNotIn(List values) { + addCriterion("id not in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdBetween(Long value1, Long value2) { + addCriterion("id between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andIdNotBetween(Long value1, Long value2) { + addCriterion("id not between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andDeviceIdIsNull() { + addCriterion("device_id is null"); + return (Criteria) this; + } + + public Criteria andDeviceIdIsNotNull() { + addCriterion("device_id is not null"); + return (Criteria) this; + } + + public Criteria andDeviceIdEqualTo(String value) { + addCriterion("device_id =", value, "deviceId"); + return (Criteria) this; + } + + public Criteria andDeviceIdNotEqualTo(String value) { + addCriterion("device_id <>", value, "deviceId"); + return (Criteria) this; + } + + public Criteria andDeviceIdGreaterThan(String value) { + addCriterion("device_id >", value, "deviceId"); + return (Criteria) this; + } + + public Criteria andDeviceIdGreaterThanOrEqualTo(String value) { + addCriterion("device_id >=", value, "deviceId"); + return (Criteria) this; + } + + public Criteria andDeviceIdLessThan(String value) { + addCriterion("device_id <", value, "deviceId"); + return (Criteria) this; + } + + public Criteria andDeviceIdLessThanOrEqualTo(String value) { + addCriterion("device_id <=", value, "deviceId"); + return (Criteria) this; + } + + public Criteria andDeviceIdLike(String value) { + addCriterion("device_id like", value, "deviceId"); + return (Criteria) this; + } + + public Criteria andDeviceIdNotLike(String value) { + addCriterion("device_id not like", value, "deviceId"); + return (Criteria) this; + } + + public Criteria andDeviceIdIn(List values) { + addCriterion("device_id in", values, "deviceId"); + return (Criteria) this; + } + + public Criteria andDeviceIdNotIn(List values) { + addCriterion("device_id not in", values, "deviceId"); + return (Criteria) this; + } + + public Criteria andDeviceIdBetween(String value1, String value2) { + addCriterion("device_id between", value1, value2, "deviceId"); + return (Criteria) this; + } + + public Criteria andDeviceIdNotBetween(String value1, String value2) { + addCriterion("device_id not between", value1, value2, "deviceId"); + return (Criteria) this; + } + + public Criteria andDateYearIsNull() { + addCriterion("date_year is null"); + return (Criteria) this; + } + + public Criteria andDateYearIsNotNull() { + addCriterion("date_year is not null"); + return (Criteria) this; + } + + public Criteria andDateYearEqualTo(Integer value) { + addCriterion("date_year =", value, "dateYear"); + return (Criteria) this; + } + + public Criteria andDateYearNotEqualTo(Integer value) { + addCriterion("date_year <>", value, "dateYear"); + return (Criteria) this; + } + + public Criteria andDateYearGreaterThan(Integer value) { + addCriterion("date_year >", value, "dateYear"); + return (Criteria) this; + } + + public Criteria andDateYearGreaterThanOrEqualTo(Integer value) { + addCriterion("date_year >=", value, "dateYear"); + return (Criteria) this; + } + + public Criteria andDateYearLessThan(Integer value) { + addCriterion("date_year <", value, "dateYear"); + return (Criteria) this; + } + + public Criteria andDateYearLessThanOrEqualTo(Integer value) { + addCriterion("date_year <=", value, "dateYear"); + return (Criteria) this; + } + + public Criteria andDateYearIn(List values) { + addCriterion("date_year in", values, "dateYear"); + return (Criteria) this; + } + + public Criteria andDateYearNotIn(List values) { + addCriterion("date_year not in", values, "dateYear"); + return (Criteria) this; + } + + public Criteria andDateYearBetween(Integer value1, Integer value2) { + addCriterion("date_year between", value1, value2, "dateYear"); + return (Criteria) this; + } + + public Criteria andDateYearNotBetween(Integer value1, Integer value2) { + addCriterion("date_year not between", value1, value2, "dateYear"); + return (Criteria) this; + } + + public Criteria andDateMonthIsNull() { + addCriterion("date_month is null"); + return (Criteria) this; + } + + public Criteria andDateMonthIsNotNull() { + addCriterion("date_month is not null"); + return (Criteria) this; + } + + public Criteria andDateMonthEqualTo(Integer value) { + addCriterion("date_month =", value, "dateMonth"); + return (Criteria) this; + } + + public Criteria andDateMonthNotEqualTo(Integer value) { + addCriterion("date_month <>", value, "dateMonth"); + return (Criteria) this; + } + + public Criteria andDateMonthGreaterThan(Integer value) { + addCriterion("date_month >", value, "dateMonth"); + return (Criteria) this; + } + + public Criteria andDateMonthGreaterThanOrEqualTo(Integer value) { + addCriterion("date_month >=", value, "dateMonth"); + return (Criteria) this; + } + + public Criteria andDateMonthLessThan(Integer value) { + addCriterion("date_month <", value, "dateMonth"); + return (Criteria) this; + } + + public Criteria andDateMonthLessThanOrEqualTo(Integer value) { + addCriterion("date_month <=", value, "dateMonth"); + return (Criteria) this; + } + + public Criteria andDateMonthIn(List values) { + addCriterion("date_month in", values, "dateMonth"); + return (Criteria) this; + } + + public Criteria andDateMonthNotIn(List values) { + addCriterion("date_month not in", values, "dateMonth"); + return (Criteria) this; + } + + public Criteria andDateMonthBetween(Integer value1, Integer value2) { + addCriterion("date_month between", value1, value2, "dateMonth"); + return (Criteria) this; + } + + public Criteria andDateMonthNotBetween(Integer value1, Integer value2) { + addCriterion("date_month not between", value1, value2, "dateMonth"); + return (Criteria) this; + } + + public Criteria andDateDayIsNull() { + addCriterion("date_day is null"); + return (Criteria) this; + } + + public Criteria andDateDayIsNotNull() { + addCriterion("date_day is not null"); + return (Criteria) this; + } + + public Criteria andDateDayEqualTo(Integer value) { + addCriterion("date_day =", value, "dateDay"); + return (Criteria) this; + } + + public Criteria andDateDayNotEqualTo(Integer value) { + addCriterion("date_day <>", value, "dateDay"); + return (Criteria) this; + } + + public Criteria andDateDayGreaterThan(Integer value) { + addCriterion("date_day >", value, "dateDay"); + return (Criteria) this; + } + + public Criteria andDateDayGreaterThanOrEqualTo(Integer value) { + addCriterion("date_day >=", value, "dateDay"); + return (Criteria) this; + } + + public Criteria andDateDayLessThan(Integer value) { + addCriterion("date_day <", value, "dateDay"); + return (Criteria) this; + } + + public Criteria andDateDayLessThanOrEqualTo(Integer value) { + addCriterion("date_day <=", value, "dateDay"); + return (Criteria) this; + } + + public Criteria andDateDayIn(List values) { + addCriterion("date_day in", values, "dateDay"); + return (Criteria) this; + } + + public Criteria andDateDayNotIn(List values) { + addCriterion("date_day not in", values, "dateDay"); + return (Criteria) this; + } + + public Criteria andDateDayBetween(Integer value1, Integer value2) { + addCriterion("date_day between", value1, value2, "dateDay"); + return (Criteria) this; + } + + public Criteria andDateDayNotBetween(Integer value1, Integer value2) { + addCriterion("date_day not between", value1, value2, "dateDay"); + return (Criteria) this; + } + + public Criteria andDateHourIsNull() { + addCriterion("date_hour is null"); + return (Criteria) this; + } + + public Criteria andDateHourIsNotNull() { + addCriterion("date_hour is not null"); + return (Criteria) this; + } + + public Criteria andDateHourEqualTo(Integer value) { + addCriterion("date_hour =", value, "dateHour"); + return (Criteria) this; + } + + public Criteria andDateHourNotEqualTo(Integer value) { + addCriterion("date_hour <>", value, "dateHour"); + return (Criteria) this; + } + + public Criteria andDateHourGreaterThan(Integer value) { + addCriterion("date_hour >", value, "dateHour"); + return (Criteria) this; + } + + public Criteria andDateHourGreaterThanOrEqualTo(Integer value) { + addCriterion("date_hour >=", value, "dateHour"); + return (Criteria) this; + } + + public Criteria andDateHourLessThan(Integer value) { + addCriterion("date_hour <", value, "dateHour"); + return (Criteria) this; + } + + public Criteria andDateHourLessThanOrEqualTo(Integer value) { + addCriterion("date_hour <=", value, "dateHour"); + return (Criteria) this; + } + + public Criteria andDateHourIn(List values) { + addCriterion("date_hour in", values, "dateHour"); + return (Criteria) this; + } + + public Criteria andDateHourNotIn(List values) { + addCriterion("date_hour not in", values, "dateHour"); + return (Criteria) this; + } + + public Criteria andDateHourBetween(Integer value1, Integer value2) { + addCriterion("date_hour between", value1, value2, "dateHour"); + return (Criteria) this; + } + + public Criteria andDateHourNotBetween(Integer value1, Integer value2) { + addCriterion("date_hour not between", value1, value2, "dateHour"); + return (Criteria) this; + } + + public Criteria andDateMinuteIsNull() { + addCriterion("date_minute is null"); + return (Criteria) this; + } + + public Criteria andDateMinuteIsNotNull() { + addCriterion("date_minute is not null"); + return (Criteria) this; + } + + public Criteria andDateMinuteEqualTo(Integer value) { + addCriterion("date_minute =", value, "dateMinute"); + return (Criteria) this; + } + + public Criteria andDateMinuteNotEqualTo(Integer value) { + addCriterion("date_minute <>", value, "dateMinute"); + return (Criteria) this; + } + + public Criteria andDateMinuteGreaterThan(Integer value) { + addCriterion("date_minute >", value, "dateMinute"); + return (Criteria) this; + } + + public Criteria andDateMinuteGreaterThanOrEqualTo(Integer value) { + addCriterion("date_minute >=", value, "dateMinute"); + return (Criteria) this; + } + + public Criteria andDateMinuteLessThan(Integer value) { + addCriterion("date_minute <", value, "dateMinute"); + return (Criteria) this; + } + + public Criteria andDateMinuteLessThanOrEqualTo(Integer value) { + addCriterion("date_minute <=", value, "dateMinute"); + return (Criteria) this; + } + + public Criteria andDateMinuteIn(List values) { + addCriterion("date_minute in", values, "dateMinute"); + return (Criteria) this; + } + + public Criteria andDateMinuteNotIn(List values) { + addCriterion("date_minute not in", values, "dateMinute"); + return (Criteria) this; + } + + public Criteria andDateMinuteBetween(Integer value1, Integer value2) { + addCriterion("date_minute between", value1, value2, "dateMinute"); + return (Criteria) this; + } + + public Criteria andDateMinuteNotBetween(Integer value1, Integer value2) { + addCriterion("date_minute not between", value1, value2, "dateMinute"); + return (Criteria) this; + } + + public Criteria andDateSecondIsNull() { + addCriterion("date_second is null"); + return (Criteria) this; + } + + public Criteria andDateSecondIsNotNull() { + addCriterion("date_second is not null"); + return (Criteria) this; + } + + public Criteria andDateSecondEqualTo(Integer value) { + addCriterion("date_second =", value, "dateSecond"); + return (Criteria) this; + } + + public Criteria andDateSecondNotEqualTo(Integer value) { + addCriterion("date_second <>", value, "dateSecond"); + return (Criteria) this; + } + + public Criteria andDateSecondGreaterThan(Integer value) { + addCriterion("date_second >", value, "dateSecond"); + return (Criteria) this; + } + + public Criteria andDateSecondGreaterThanOrEqualTo(Integer value) { + addCriterion("date_second >=", value, "dateSecond"); + return (Criteria) this; + } + + public Criteria andDateSecondLessThan(Integer value) { + addCriterion("date_second <", value, "dateSecond"); + return (Criteria) this; + } + + public Criteria andDateSecondLessThanOrEqualTo(Integer value) { + addCriterion("date_second <=", value, "dateSecond"); + return (Criteria) this; + } + + public Criteria andDateSecondIn(List values) { + addCriterion("date_second in", values, "dateSecond"); + return (Criteria) this; + } + + public Criteria andDateSecondNotIn(List values) { + addCriterion("date_second not in", values, "dateSecond"); + return (Criteria) this; + } + + public Criteria andDateSecondBetween(Integer value1, Integer value2) { + addCriterion("date_second between", value1, value2, "dateSecond"); + return (Criteria) this; + } + + public Criteria andDateSecondNotBetween(Integer value1, Integer value2) { + addCriterion("date_second not between", value1, value2, "dateSecond"); + return (Criteria) this; + } + + public Criteria andUploadValueIsNull() { + addCriterion("upload_value is null"); + return (Criteria) this; + } + + public Criteria andUploadValueIsNotNull() { + addCriterion("upload_value is not null"); + return (Criteria) this; + } + + public Criteria andUploadValueEqualTo(String value) { + addCriterion("upload_value =", value, "uploadValue"); + return (Criteria) this; + } + + public Criteria andUploadValueNotEqualTo(String value) { + addCriterion("upload_value <>", value, "uploadValue"); + return (Criteria) this; + } + + public Criteria andUploadValueGreaterThan(String value) { + addCriterion("upload_value >", value, "uploadValue"); + return (Criteria) this; + } + + public Criteria andUploadValueGreaterThanOrEqualTo(String value) { + addCriterion("upload_value >=", value, "uploadValue"); + return (Criteria) this; + } + + public Criteria andUploadValueLessThan(String value) { + addCriterion("upload_value <", value, "uploadValue"); + return (Criteria) this; + } + + public Criteria andUploadValueLessThanOrEqualTo(String value) { + addCriterion("upload_value <=", value, "uploadValue"); + return (Criteria) this; + } + + public Criteria andUploadValueLike(String value) { + addCriterion("upload_value like", value, "uploadValue"); + return (Criteria) this; + } + + public Criteria andUploadValueNotLike(String value) { + addCriterion("upload_value not like", value, "uploadValue"); + return (Criteria) this; + } + + public Criteria andUploadValueIn(List values) { + addCriterion("upload_value in", values, "uploadValue"); + return (Criteria) this; + } + + public Criteria andUploadValueNotIn(List values) { + addCriterion("upload_value not in", values, "uploadValue"); + return (Criteria) this; + } + + public Criteria andUploadValueBetween(String value1, String value2) { + addCriterion("upload_value between", value1, value2, "uploadValue"); + return (Criteria) this; + } + + public Criteria andUploadValueNotBetween(String value1, String value2) { + addCriterion("upload_value not between", value1, value2, "uploadValue"); + return (Criteria) this; + } + + public Criteria andIncrementTodayIsNull() { + addCriterion("increment_today is null"); + return (Criteria) this; + } + + public Criteria andIncrementTodayIsNotNull() { + addCriterion("increment_today is not null"); + return (Criteria) this; + } + + public Criteria andIncrementTodayEqualTo(String value) { + addCriterion("increment_today =", value, "incrementToday"); + return (Criteria) this; + } + + public Criteria andIncrementTodayNotEqualTo(String value) { + addCriterion("increment_today <>", value, "incrementToday"); + return (Criteria) this; + } + + public Criteria andIncrementTodayGreaterThan(String value) { + addCriterion("increment_today >", value, "incrementToday"); + return (Criteria) this; + } + + public Criteria andIncrementTodayGreaterThanOrEqualTo(String value) { + addCriterion("increment_today >=", value, "incrementToday"); + return (Criteria) this; + } + + public Criteria andIncrementTodayLessThan(String value) { + addCriterion("increment_today <", value, "incrementToday"); + return (Criteria) this; + } + + public Criteria andIncrementTodayLessThanOrEqualTo(String value) { + addCriterion("increment_today <=", value, "incrementToday"); + return (Criteria) this; + } + + public Criteria andIncrementTodayLike(String value) { + addCriterion("increment_today like", value, "incrementToday"); + return (Criteria) this; + } + + public Criteria andIncrementTodayNotLike(String value) { + addCriterion("increment_today not like", value, "incrementToday"); + return (Criteria) this; + } + + public Criteria andIncrementTodayIn(List values) { + addCriterion("increment_today in", values, "incrementToday"); + return (Criteria) this; + } + + public Criteria andIncrementTodayNotIn(List values) { + addCriterion("increment_today not in", values, "incrementToday"); + return (Criteria) this; + } + + public Criteria andIncrementTodayBetween(String value1, String value2) { + addCriterion("increment_today between", value1, value2, "incrementToday"); + return (Criteria) this; + } + + public Criteria andIncrementTodayNotBetween(String value1, String value2) { + addCriterion("increment_today not between", value1, value2, "incrementToday"); + return (Criteria) this; + } + + public Criteria andIncrementMinuteIsNull() { + addCriterion("increment_minute is null"); + return (Criteria) this; + } + + public Criteria andIncrementMinuteIsNotNull() { + addCriterion("increment_minute is not null"); + return (Criteria) this; + } + + public Criteria andIncrementMinuteEqualTo(String value) { + addCriterion("increment_minute =", value, "incrementMinute"); + return (Criteria) this; + } + + public Criteria andIncrementMinuteNotEqualTo(String value) { + addCriterion("increment_minute <>", value, "incrementMinute"); + return (Criteria) this; + } + + public Criteria andIncrementMinuteGreaterThan(String value) { + addCriterion("increment_minute >", value, "incrementMinute"); + return (Criteria) this; + } + + public Criteria andIncrementMinuteGreaterThanOrEqualTo(String value) { + addCriterion("increment_minute >=", value, "incrementMinute"); + return (Criteria) this; + } + + public Criteria andIncrementMinuteLessThan(String value) { + addCriterion("increment_minute <", value, "incrementMinute"); + return (Criteria) this; + } + + public Criteria andIncrementMinuteLessThanOrEqualTo(String value) { + addCriterion("increment_minute <=", value, "incrementMinute"); + return (Criteria) this; + } + + public Criteria andIncrementMinuteLike(String value) { + addCriterion("increment_minute like", value, "incrementMinute"); + return (Criteria) this; + } + + public Criteria andIncrementMinuteNotLike(String value) { + addCriterion("increment_minute not like", value, "incrementMinute"); + return (Criteria) this; + } + + public Criteria andIncrementMinuteIn(List values) { + addCriterion("increment_minute in", values, "incrementMinute"); + return (Criteria) this; + } + + public Criteria andIncrementMinuteNotIn(List values) { + addCriterion("increment_minute not in", values, "incrementMinute"); + return (Criteria) this; + } + + public Criteria andIncrementMinuteBetween(String value1, String value2) { + addCriterion("increment_minute between", value1, value2, "incrementMinute"); + return (Criteria) this; + } + + public Criteria andIncrementMinuteNotBetween(String value1, String value2) { + addCriterion("increment_minute not between", value1, value2, "incrementMinute"); + return (Criteria) this; + } + + public Criteria andUploadAtIsNull() { + addCriterion("upload_at is null"); + return (Criteria) this; + } + + public Criteria andUploadAtIsNotNull() { + addCriterion("upload_at is not null"); + return (Criteria) this; + } + + public Criteria andUploadAtEqualTo(Long value) { + addCriterion("upload_at =", value, "uploadAt"); + return (Criteria) this; + } + + public Criteria andUploadAtNotEqualTo(Long value) { + addCriterion("upload_at <>", value, "uploadAt"); + return (Criteria) this; + } + + public Criteria andUploadAtGreaterThan(Long value) { + addCriterion("upload_at >", value, "uploadAt"); + return (Criteria) this; + } + + public Criteria andUploadAtGreaterThanOrEqualTo(Long value) { + addCriterion("upload_at >=", value, "uploadAt"); + return (Criteria) this; + } + + public Criteria andUploadAtLessThan(Long value) { + addCriterion("upload_at <", value, "uploadAt"); + return (Criteria) this; + } + + public Criteria andUploadAtLessThanOrEqualTo(Long value) { + addCriterion("upload_at <=", value, "uploadAt"); + return (Criteria) this; + } + + public Criteria andUploadAtIn(List values) { + addCriterion("upload_at in", values, "uploadAt"); + return (Criteria) this; + } + + public Criteria andUploadAtNotIn(List values) { + addCriterion("upload_at not in", values, "uploadAt"); + return (Criteria) this; + } + + public Criteria andUploadAtBetween(Long value1, Long value2) { + addCriterion("upload_at between", value1, value2, "uploadAt"); + return (Criteria) this; + } + + public Criteria andUploadAtNotBetween(Long value1, Long value2) { + addCriterion("upload_at not between", value1, value2, "uploadAt"); + return (Criteria) this; + } + } + + /** + * This class was generated by MyBatis Generator. + * This class corresponds to the database table dashboard_record_accumulate + * + * @mbg.generated do_not_delete_during_merge + */ + public static class Criteria extends GeneratedCriteria { + + protected Criteria() { + super(); + } + } + + /** + * This class was generated by MyBatis Generator. + * This class corresponds to the database table dashboard_record_accumulate + * + * @mbg.generated + */ + public static class Criterion { + private String condition; + + private Object value; + + private Object secondValue; + + private boolean noValue; + + private boolean singleValue; + + private boolean betweenValue; + + private boolean listValue; + + private String typeHandler; + + public String getCondition() { + return condition; + } + + public Object getValue() { + return value; + } + + public Object getSecondValue() { + return secondValue; + } + + public boolean isNoValue() { + return noValue; + } + + public boolean isSingleValue() { + return singleValue; + } + + public boolean isBetweenValue() { + return betweenValue; + } + + public boolean isListValue() { + return listValue; + } + + public String getTypeHandler() { + return typeHandler; + } + + protected Criterion(String condition) { + super(); + this.condition = condition; + this.typeHandler = null; + this.noValue = true; + } + + protected Criterion(String condition, Object value, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.typeHandler = typeHandler; + if (value instanceof List) { + this.listValue = true; + } else { + this.singleValue = true; + } + } + + protected Criterion(String condition, Object value) { + this(condition, value, null); + } + + protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.secondValue = secondValue; + this.typeHandler = typeHandler; + this.betweenValue = true; + } + + protected Criterion(String condition, Object value, Object secondValue) { + this(condition, value, secondValue, null); + } + } +} \ No newline at end of file diff --git a/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/model/DeviceGroup.java b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/model/DeviceGroup.java new file mode 100644 index 0000000..5e79e38 --- /dev/null +++ b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/model/DeviceGroup.java @@ -0,0 +1,336 @@ +package com.dongjian.dashboard.back.model; + +import java.io.Serializable; + +public class DeviceGroup implements Serializable { + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column device_group.id + * + * @mbg.generated + */ + private Long id; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column device_group.company_id + * + * @mbg.generated + */ + private Long companyId; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column device_group.building_id + * + * @mbg.generated + */ + private Long buildingId; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column device_group.name + * + * @mbg.generated + */ + private String name; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column device_group.group_type + * + * @mbg.generated + */ + private Integer groupType; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column device_group.remark + * + * @mbg.generated + */ + private String remark; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column device_group.flag + * + * @mbg.generated + */ + private Integer flag; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column device_group.created_by + * + * @mbg.generated + */ + private Long createdBy; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column device_group.created_at + * + * @mbg.generated + */ + private Long createdAt; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database table device_group + * + * @mbg.generated + */ + private static final long serialVersionUID = 1L; + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column device_group.id + * + * @return the value of device_group.id + * + * @mbg.generated + */ + public Long getId() { + return id; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column device_group.id + * + * @param id the value for device_group.id + * + * @mbg.generated + */ + public void setId(Long id) { + this.id = id; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column device_group.company_id + * + * @return the value of device_group.company_id + * + * @mbg.generated + */ + public Long getCompanyId() { + return companyId; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column device_group.company_id + * + * @param companyId the value for device_group.company_id + * + * @mbg.generated + */ + public void setCompanyId(Long companyId) { + this.companyId = companyId; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column device_group.building_id + * + * @return the value of device_group.building_id + * + * @mbg.generated + */ + public Long getBuildingId() { + return buildingId; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column device_group.building_id + * + * @param buildingId the value for device_group.building_id + * + * @mbg.generated + */ + public void setBuildingId(Long buildingId) { + this.buildingId = buildingId; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column device_group.name + * + * @return the value of device_group.name + * + * @mbg.generated + */ + public String getName() { + return name; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column device_group.name + * + * @param name the value for device_group.name + * + * @mbg.generated + */ + public void setName(String name) { + this.name = name == null ? null : name.trim(); + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column device_group.group_type + * + * @return the value of device_group.group_type + * + * @mbg.generated + */ + public Integer getGroupType() { + return groupType; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column device_group.group_type + * + * @param groupType the value for device_group.group_type + * + * @mbg.generated + */ + public void setGroupType(Integer groupType) { + this.groupType = groupType; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column device_group.remark + * + * @return the value of device_group.remark + * + * @mbg.generated + */ + public String getRemark() { + return remark; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column device_group.remark + * + * @param remark the value for device_group.remark + * + * @mbg.generated + */ + public void setRemark(String remark) { + this.remark = remark == null ? null : remark.trim(); + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column device_group.flag + * + * @return the value of device_group.flag + * + * @mbg.generated + */ + public Integer getFlag() { + return flag; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column device_group.flag + * + * @param flag the value for device_group.flag + * + * @mbg.generated + */ + public void setFlag(Integer flag) { + this.flag = flag; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column device_group.created_by + * + * @return the value of device_group.created_by + * + * @mbg.generated + */ + public Long getCreatedBy() { + return createdBy; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column device_group.created_by + * + * @param createdBy the value for device_group.created_by + * + * @mbg.generated + */ + public void setCreatedBy(Long createdBy) { + this.createdBy = createdBy; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column device_group.created_at + * + * @return the value of device_group.created_at + * + * @mbg.generated + */ + public Long getCreatedAt() { + return createdAt; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column device_group.created_at + * + * @param createdAt the value for device_group.created_at + * + * @mbg.generated + */ + public void setCreatedAt(Long createdAt) { + this.createdAt = createdAt; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table device_group + * + * @mbg.generated + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append(getClass().getSimpleName()); + sb.append(" ["); + sb.append("Hash = ").append(hashCode()); + sb.append(", id=").append(id); + sb.append(", companyId=").append(companyId); + sb.append(", buildingId=").append(buildingId); + sb.append(", name=").append(name); + sb.append(", groupType=").append(groupType); + sb.append(", remark=").append(remark); + sb.append(", flag=").append(flag); + sb.append(", createdBy=").append(createdBy); + sb.append(", createdAt=").append(createdAt); + sb.append(", serialVersionUID=").append(serialVersionUID); + sb.append("]"); + return sb.toString(); + } +} \ No newline at end of file diff --git a/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/model/DeviceGroupExample.java b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/model/DeviceGroupExample.java new file mode 100644 index 0000000..5451787 --- /dev/null +++ b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/model/DeviceGroupExample.java @@ -0,0 +1,862 @@ +package com.dongjian.dashboard.back.model; + +import java.util.ArrayList; +import java.util.List; + +public class DeviceGroupExample { + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database table device_group + * + * @mbg.generated + */ + protected String orderByClause; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database table device_group + * + * @mbg.generated + */ + protected boolean distinct; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database table device_group + * + * @mbg.generated + */ + protected List oredCriteria; + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table device_group + * + * @mbg.generated + */ + public DeviceGroupExample() { + oredCriteria = new ArrayList(); + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table device_group + * + * @mbg.generated + */ + public void setOrderByClause(String orderByClause) { + this.orderByClause = orderByClause; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table device_group + * + * @mbg.generated + */ + public String getOrderByClause() { + return orderByClause; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table device_group + * + * @mbg.generated + */ + public void setDistinct(boolean distinct) { + this.distinct = distinct; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table device_group + * + * @mbg.generated + */ + public boolean isDistinct() { + return distinct; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table device_group + * + * @mbg.generated + */ + public List getOredCriteria() { + return oredCriteria; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table device_group + * + * @mbg.generated + */ + public void or(Criteria criteria) { + oredCriteria.add(criteria); + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table device_group + * + * @mbg.generated + */ + public Criteria or() { + Criteria criteria = createCriteriaInternal(); + oredCriteria.add(criteria); + return criteria; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table device_group + * + * @mbg.generated + */ + public Criteria createCriteria() { + Criteria criteria = createCriteriaInternal(); + if (oredCriteria.size() == 0) { + oredCriteria.add(criteria); + } + return criteria; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table device_group + * + * @mbg.generated + */ + protected Criteria createCriteriaInternal() { + Criteria criteria = new Criteria(); + return criteria; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table device_group + * + * @mbg.generated + */ + public void clear() { + oredCriteria.clear(); + orderByClause = null; + distinct = false; + } + + /** + * This class was generated by MyBatis Generator. + * This class corresponds to the database table device_group + * + * @mbg.generated + */ + protected abstract static class GeneratedCriteria { + protected List criteria; + + protected GeneratedCriteria() { + super(); + criteria = new ArrayList(); + } + + public boolean isValid() { + return criteria.size() > 0; + } + + public List getAllCriteria() { + return criteria; + } + + public List getCriteria() { + return criteria; + } + + protected void addCriterion(String condition) { + if (condition == null) { + throw new RuntimeException("Value for condition cannot be null"); + } + criteria.add(new Criterion(condition)); + } + + protected void addCriterion(String condition, Object value, String property) { + if (value == null) { + throw new RuntimeException("Value for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value)); + } + + protected void addCriterion(String condition, Object value1, Object value2, String property) { + if (value1 == null || value2 == null) { + throw new RuntimeException("Between values for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value1, value2)); + } + + public Criteria andIdIsNull() { + addCriterion("id is null"); + return (Criteria) this; + } + + public Criteria andIdIsNotNull() { + addCriterion("id is not null"); + return (Criteria) this; + } + + public Criteria andIdEqualTo(Long value) { + addCriterion("id =", value, "id"); + return (Criteria) this; + } + + public Criteria andIdNotEqualTo(Long value) { + addCriterion("id <>", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThan(Long value) { + addCriterion("id >", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThanOrEqualTo(Long value) { + addCriterion("id >=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThan(Long value) { + addCriterion("id <", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThanOrEqualTo(Long value) { + addCriterion("id <=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdIn(List values) { + addCriterion("id in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdNotIn(List values) { + addCriterion("id not in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdBetween(Long value1, Long value2) { + addCriterion("id between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andIdNotBetween(Long value1, Long value2) { + addCriterion("id not between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andCompanyIdIsNull() { + addCriterion("company_id is null"); + return (Criteria) this; + } + + public Criteria andCompanyIdIsNotNull() { + addCriterion("company_id is not null"); + return (Criteria) this; + } + + public Criteria andCompanyIdEqualTo(Long value) { + addCriterion("company_id =", value, "companyId"); + return (Criteria) this; + } + + public Criteria andCompanyIdNotEqualTo(Long value) { + addCriterion("company_id <>", value, "companyId"); + return (Criteria) this; + } + + public Criteria andCompanyIdGreaterThan(Long value) { + addCriterion("company_id >", value, "companyId"); + return (Criteria) this; + } + + public Criteria andCompanyIdGreaterThanOrEqualTo(Long value) { + addCriterion("company_id >=", value, "companyId"); + return (Criteria) this; + } + + public Criteria andCompanyIdLessThan(Long value) { + addCriterion("company_id <", value, "companyId"); + return (Criteria) this; + } + + public Criteria andCompanyIdLessThanOrEqualTo(Long value) { + addCriterion("company_id <=", value, "companyId"); + return (Criteria) this; + } + + public Criteria andCompanyIdIn(List values) { + addCriterion("company_id in", values, "companyId"); + return (Criteria) this; + } + + public Criteria andCompanyIdNotIn(List values) { + addCriterion("company_id not in", values, "companyId"); + return (Criteria) this; + } + + public Criteria andCompanyIdBetween(Long value1, Long value2) { + addCriterion("company_id between", value1, value2, "companyId"); + return (Criteria) this; + } + + public Criteria andCompanyIdNotBetween(Long value1, Long value2) { + addCriterion("company_id not between", value1, value2, "companyId"); + return (Criteria) this; + } + + public Criteria andBuildingIdIsNull() { + addCriterion("building_id is null"); + return (Criteria) this; + } + + public Criteria andBuildingIdIsNotNull() { + addCriterion("building_id is not null"); + return (Criteria) this; + } + + public Criteria andBuildingIdEqualTo(Long value) { + addCriterion("building_id =", value, "buildingId"); + return (Criteria) this; + } + + public Criteria andBuildingIdNotEqualTo(Long value) { + addCriterion("building_id <>", value, "buildingId"); + return (Criteria) this; + } + + public Criteria andBuildingIdGreaterThan(Long value) { + addCriterion("building_id >", value, "buildingId"); + return (Criteria) this; + } + + public Criteria andBuildingIdGreaterThanOrEqualTo(Long value) { + addCriterion("building_id >=", value, "buildingId"); + return (Criteria) this; + } + + public Criteria andBuildingIdLessThan(Long value) { + addCriterion("building_id <", value, "buildingId"); + return (Criteria) this; + } + + public Criteria andBuildingIdLessThanOrEqualTo(Long value) { + addCriterion("building_id <=", value, "buildingId"); + return (Criteria) this; + } + + public Criteria andBuildingIdIn(List values) { + addCriterion("building_id in", values, "buildingId"); + return (Criteria) this; + } + + public Criteria andBuildingIdNotIn(List values) { + addCriterion("building_id not in", values, "buildingId"); + return (Criteria) this; + } + + public Criteria andBuildingIdBetween(Long value1, Long value2) { + addCriterion("building_id between", value1, value2, "buildingId"); + return (Criteria) this; + } + + public Criteria andBuildingIdNotBetween(Long value1, Long value2) { + addCriterion("building_id not between", value1, value2, "buildingId"); + return (Criteria) this; + } + + public Criteria andNameIsNull() { + addCriterion("`name` is null"); + return (Criteria) this; + } + + public Criteria andNameIsNotNull() { + addCriterion("`name` is not null"); + return (Criteria) this; + } + + public Criteria andNameEqualTo(String value) { + addCriterion("`name` =", value, "name"); + return (Criteria) this; + } + + public Criteria andNameNotEqualTo(String value) { + addCriterion("`name` <>", value, "name"); + return (Criteria) this; + } + + public Criteria andNameGreaterThan(String value) { + addCriterion("`name` >", value, "name"); + return (Criteria) this; + } + + public Criteria andNameGreaterThanOrEqualTo(String value) { + addCriterion("`name` >=", value, "name"); + return (Criteria) this; + } + + public Criteria andNameLessThan(String value) { + addCriterion("`name` <", value, "name"); + return (Criteria) this; + } + + public Criteria andNameLessThanOrEqualTo(String value) { + addCriterion("`name` <=", value, "name"); + return (Criteria) this; + } + + public Criteria andNameLike(String value) { + addCriterion("`name` like", value, "name"); + return (Criteria) this; + } + + public Criteria andNameNotLike(String value) { + addCriterion("`name` not like", value, "name"); + return (Criteria) this; + } + + public Criteria andNameIn(List values) { + addCriterion("`name` in", values, "name"); + return (Criteria) this; + } + + public Criteria andNameNotIn(List values) { + addCriterion("`name` not in", values, "name"); + return (Criteria) this; + } + + public Criteria andNameBetween(String value1, String value2) { + addCriterion("`name` between", value1, value2, "name"); + return (Criteria) this; + } + + public Criteria andNameNotBetween(String value1, String value2) { + addCriterion("`name` not between", value1, value2, "name"); + return (Criteria) this; + } + + public Criteria andGroupTypeIsNull() { + addCriterion("group_type is null"); + return (Criteria) this; + } + + public Criteria andGroupTypeIsNotNull() { + addCriterion("group_type is not null"); + return (Criteria) this; + } + + public Criteria andGroupTypeEqualTo(Integer value) { + addCriterion("group_type =", value, "groupType"); + return (Criteria) this; + } + + public Criteria andGroupTypeNotEqualTo(Integer value) { + addCriterion("group_type <>", value, "groupType"); + return (Criteria) this; + } + + public Criteria andGroupTypeGreaterThan(Integer value) { + addCriterion("group_type >", value, "groupType"); + return (Criteria) this; + } + + public Criteria andGroupTypeGreaterThanOrEqualTo(Integer value) { + addCriterion("group_type >=", value, "groupType"); + return (Criteria) this; + } + + public Criteria andGroupTypeLessThan(Integer value) { + addCriterion("group_type <", value, "groupType"); + return (Criteria) this; + } + + public Criteria andGroupTypeLessThanOrEqualTo(Integer value) { + addCriterion("group_type <=", value, "groupType"); + return (Criteria) this; + } + + public Criteria andGroupTypeIn(List values) { + addCriterion("group_type in", values, "groupType"); + return (Criteria) this; + } + + public Criteria andGroupTypeNotIn(List values) { + addCriterion("group_type not in", values, "groupType"); + return (Criteria) this; + } + + public Criteria andGroupTypeBetween(Integer value1, Integer value2) { + addCriterion("group_type between", value1, value2, "groupType"); + return (Criteria) this; + } + + public Criteria andGroupTypeNotBetween(Integer value1, Integer value2) { + addCriterion("group_type not between", value1, value2, "groupType"); + return (Criteria) this; + } + + public Criteria andRemarkIsNull() { + addCriterion("remark is null"); + return (Criteria) this; + } + + public Criteria andRemarkIsNotNull() { + addCriterion("remark is not null"); + return (Criteria) this; + } + + public Criteria andRemarkEqualTo(String value) { + addCriterion("remark =", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkNotEqualTo(String value) { + addCriterion("remark <>", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkGreaterThan(String value) { + addCriterion("remark >", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkGreaterThanOrEqualTo(String value) { + addCriterion("remark >=", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkLessThan(String value) { + addCriterion("remark <", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkLessThanOrEqualTo(String value) { + addCriterion("remark <=", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkLike(String value) { + addCriterion("remark like", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkNotLike(String value) { + addCriterion("remark not like", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkIn(List values) { + addCriterion("remark in", values, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkNotIn(List values) { + addCriterion("remark not in", values, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkBetween(String value1, String value2) { + addCriterion("remark between", value1, value2, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkNotBetween(String value1, String value2) { + addCriterion("remark not between", value1, value2, "remark"); + return (Criteria) this; + } + + public Criteria andFlagIsNull() { + addCriterion("flag is null"); + return (Criteria) this; + } + + public Criteria andFlagIsNotNull() { + addCriterion("flag is not null"); + return (Criteria) this; + } + + public Criteria andFlagEqualTo(Integer value) { + addCriterion("flag =", value, "flag"); + return (Criteria) this; + } + + public Criteria andFlagNotEqualTo(Integer value) { + addCriterion("flag <>", value, "flag"); + return (Criteria) this; + } + + public Criteria andFlagGreaterThan(Integer value) { + addCriterion("flag >", value, "flag"); + return (Criteria) this; + } + + public Criteria andFlagGreaterThanOrEqualTo(Integer value) { + addCriterion("flag >=", value, "flag"); + return (Criteria) this; + } + + public Criteria andFlagLessThan(Integer value) { + addCriterion("flag <", value, "flag"); + return (Criteria) this; + } + + public Criteria andFlagLessThanOrEqualTo(Integer value) { + addCriterion("flag <=", value, "flag"); + return (Criteria) this; + } + + public Criteria andFlagIn(List values) { + addCriterion("flag in", values, "flag"); + return (Criteria) this; + } + + public Criteria andFlagNotIn(List values) { + addCriterion("flag not in", values, "flag"); + return (Criteria) this; + } + + public Criteria andFlagBetween(Integer value1, Integer value2) { + addCriterion("flag between", value1, value2, "flag"); + return (Criteria) this; + } + + public Criteria andFlagNotBetween(Integer value1, Integer value2) { + addCriterion("flag not between", value1, value2, "flag"); + return (Criteria) this; + } + + public Criteria andCreatedByIsNull() { + addCriterion("created_by is null"); + return (Criteria) this; + } + + public Criteria andCreatedByIsNotNull() { + addCriterion("created_by is not null"); + return (Criteria) this; + } + + public Criteria andCreatedByEqualTo(Long value) { + addCriterion("created_by =", value, "createdBy"); + return (Criteria) this; + } + + public Criteria andCreatedByNotEqualTo(Long value) { + addCriterion("created_by <>", value, "createdBy"); + return (Criteria) this; + } + + public Criteria andCreatedByGreaterThan(Long value) { + addCriterion("created_by >", value, "createdBy"); + return (Criteria) this; + } + + public Criteria andCreatedByGreaterThanOrEqualTo(Long value) { + addCriterion("created_by >=", value, "createdBy"); + return (Criteria) this; + } + + public Criteria andCreatedByLessThan(Long value) { + addCriterion("created_by <", value, "createdBy"); + return (Criteria) this; + } + + public Criteria andCreatedByLessThanOrEqualTo(Long value) { + addCriterion("created_by <=", value, "createdBy"); + return (Criteria) this; + } + + public Criteria andCreatedByIn(List values) { + addCriterion("created_by in", values, "createdBy"); + return (Criteria) this; + } + + public Criteria andCreatedByNotIn(List values) { + addCriterion("created_by not in", values, "createdBy"); + return (Criteria) this; + } + + public Criteria andCreatedByBetween(Long value1, Long value2) { + addCriterion("created_by between", value1, value2, "createdBy"); + return (Criteria) this; + } + + public Criteria andCreatedByNotBetween(Long value1, Long value2) { + addCriterion("created_by not between", value1, value2, "createdBy"); + return (Criteria) this; + } + + public Criteria andCreatedAtIsNull() { + addCriterion("created_at is null"); + return (Criteria) this; + } + + public Criteria andCreatedAtIsNotNull() { + addCriterion("created_at is not null"); + return (Criteria) this; + } + + public Criteria andCreatedAtEqualTo(Long value) { + addCriterion("created_at =", value, "createdAt"); + return (Criteria) this; + } + + public Criteria andCreatedAtNotEqualTo(Long value) { + addCriterion("created_at <>", value, "createdAt"); + return (Criteria) this; + } + + public Criteria andCreatedAtGreaterThan(Long value) { + addCriterion("created_at >", value, "createdAt"); + return (Criteria) this; + } + + public Criteria andCreatedAtGreaterThanOrEqualTo(Long value) { + addCriterion("created_at >=", value, "createdAt"); + return (Criteria) this; + } + + public Criteria andCreatedAtLessThan(Long value) { + addCriterion("created_at <", value, "createdAt"); + return (Criteria) this; + } + + public Criteria andCreatedAtLessThanOrEqualTo(Long value) { + addCriterion("created_at <=", value, "createdAt"); + return (Criteria) this; + } + + public Criteria andCreatedAtIn(List values) { + addCriterion("created_at in", values, "createdAt"); + return (Criteria) this; + } + + public Criteria andCreatedAtNotIn(List values) { + addCriterion("created_at not in", values, "createdAt"); + return (Criteria) this; + } + + public Criteria andCreatedAtBetween(Long value1, Long value2) { + addCriterion("created_at between", value1, value2, "createdAt"); + return (Criteria) this; + } + + public Criteria andCreatedAtNotBetween(Long value1, Long value2) { + addCriterion("created_at not between", value1, value2, "createdAt"); + return (Criteria) this; + } + } + + /** + * This class was generated by MyBatis Generator. + * This class corresponds to the database table device_group + * + * @mbg.generated do_not_delete_during_merge + */ + public static class Criteria extends GeneratedCriteria { + + protected Criteria() { + super(); + } + } + + /** + * This class was generated by MyBatis Generator. + * This class corresponds to the database table device_group + * + * @mbg.generated + */ + public static class Criterion { + private String condition; + + private Object value; + + private Object secondValue; + + private boolean noValue; + + private boolean singleValue; + + private boolean betweenValue; + + private boolean listValue; + + private String typeHandler; + + public String getCondition() { + return condition; + } + + public Object getValue() { + return value; + } + + public Object getSecondValue() { + return secondValue; + } + + public boolean isNoValue() { + return noValue; + } + + public boolean isSingleValue() { + return singleValue; + } + + public boolean isBetweenValue() { + return betweenValue; + } + + public boolean isListValue() { + return listValue; + } + + public String getTypeHandler() { + return typeHandler; + } + + protected Criterion(String condition) { + super(); + this.condition = condition; + this.typeHandler = null; + this.noValue = true; + } + + protected Criterion(String condition, Object value, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.typeHandler = typeHandler; + if (value instanceof List) { + this.listValue = true; + } else { + this.singleValue = true; + } + } + + protected Criterion(String condition, Object value) { + this(condition, value, null); + } + + protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.secondValue = secondValue; + this.typeHandler = typeHandler; + this.betweenValue = true; + } + + protected Criterion(String condition, Object value, Object secondValue) { + this(condition, value, secondValue, null); + } + } +} \ No newline at end of file diff --git a/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/model/DeviceGroupRelation.java b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/model/DeviceGroupRelation.java new file mode 100644 index 0000000..e019434 --- /dev/null +++ b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/model/DeviceGroupRelation.java @@ -0,0 +1,98 @@ +package com.dongjian.dashboard.back.model; + +import java.io.Serializable; + +public class DeviceGroupRelation implements Serializable { + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column device_group_relation.device_info_id + * + * @mbg.generated + */ + private Integer deviceInfoId; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column device_group_relation.device_group_id + * + * @mbg.generated + */ + private Long deviceGroupId; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database table device_group_relation + * + * @mbg.generated + */ + private static final long serialVersionUID = 1L; + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column device_group_relation.device_info_id + * + * @return the value of device_group_relation.device_info_id + * + * @mbg.generated + */ + public Integer getDeviceInfoId() { + return deviceInfoId; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column device_group_relation.device_info_id + * + * @param deviceInfoId the value for device_group_relation.device_info_id + * + * @mbg.generated + */ + public void setDeviceInfoId(Integer deviceInfoId) { + this.deviceInfoId = deviceInfoId; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column device_group_relation.device_group_id + * + * @return the value of device_group_relation.device_group_id + * + * @mbg.generated + */ + public Long getDeviceGroupId() { + return deviceGroupId; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column device_group_relation.device_group_id + * + * @param deviceGroupId the value for device_group_relation.device_group_id + * + * @mbg.generated + */ + public void setDeviceGroupId(Long deviceGroupId) { + this.deviceGroupId = deviceGroupId; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table device_group_relation + * + * @mbg.generated + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append(getClass().getSimpleName()); + sb.append(" ["); + sb.append("Hash = ").append(hashCode()); + sb.append(", deviceInfoId=").append(deviceInfoId); + sb.append(", deviceGroupId=").append(deviceGroupId); + sb.append(", serialVersionUID=").append(serialVersionUID); + sb.append("]"); + return sb.toString(); + } +} \ No newline at end of file diff --git a/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/model/DeviceGroupRelationExample.java b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/model/DeviceGroupRelationExample.java new file mode 100644 index 0000000..6aedd2a --- /dev/null +++ b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/model/DeviceGroupRelationExample.java @@ -0,0 +1,422 @@ +package com.dongjian.dashboard.back.model; + +import java.util.ArrayList; +import java.util.List; + +public class DeviceGroupRelationExample { + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database table device_group_relation + * + * @mbg.generated + */ + protected String orderByClause; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database table device_group_relation + * + * @mbg.generated + */ + protected boolean distinct; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database table device_group_relation + * + * @mbg.generated + */ + protected List oredCriteria; + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table device_group_relation + * + * @mbg.generated + */ + public DeviceGroupRelationExample() { + oredCriteria = new ArrayList(); + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table device_group_relation + * + * @mbg.generated + */ + public void setOrderByClause(String orderByClause) { + this.orderByClause = orderByClause; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table device_group_relation + * + * @mbg.generated + */ + public String getOrderByClause() { + return orderByClause; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table device_group_relation + * + * @mbg.generated + */ + public void setDistinct(boolean distinct) { + this.distinct = distinct; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table device_group_relation + * + * @mbg.generated + */ + public boolean isDistinct() { + return distinct; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table device_group_relation + * + * @mbg.generated + */ + public List getOredCriteria() { + return oredCriteria; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table device_group_relation + * + * @mbg.generated + */ + public void or(Criteria criteria) { + oredCriteria.add(criteria); + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table device_group_relation + * + * @mbg.generated + */ + public Criteria or() { + Criteria criteria = createCriteriaInternal(); + oredCriteria.add(criteria); + return criteria; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table device_group_relation + * + * @mbg.generated + */ + public Criteria createCriteria() { + Criteria criteria = createCriteriaInternal(); + if (oredCriteria.size() == 0) { + oredCriteria.add(criteria); + } + return criteria; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table device_group_relation + * + * @mbg.generated + */ + protected Criteria createCriteriaInternal() { + Criteria criteria = new Criteria(); + return criteria; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table device_group_relation + * + * @mbg.generated + */ + public void clear() { + oredCriteria.clear(); + orderByClause = null; + distinct = false; + } + + /** + * This class was generated by MyBatis Generator. + * This class corresponds to the database table device_group_relation + * + * @mbg.generated + */ + protected abstract static class GeneratedCriteria { + protected List criteria; + + protected GeneratedCriteria() { + super(); + criteria = new ArrayList(); + } + + public boolean isValid() { + return criteria.size() > 0; + } + + public List getAllCriteria() { + return criteria; + } + + public List getCriteria() { + return criteria; + } + + protected void addCriterion(String condition) { + if (condition == null) { + throw new RuntimeException("Value for condition cannot be null"); + } + criteria.add(new Criterion(condition)); + } + + protected void addCriterion(String condition, Object value, String property) { + if (value == null) { + throw new RuntimeException("Value for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value)); + } + + protected void addCriterion(String condition, Object value1, Object value2, String property) { + if (value1 == null || value2 == null) { + throw new RuntimeException("Between values for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value1, value2)); + } + + public Criteria andDeviceInfoIdIsNull() { + addCriterion("device_info_id is null"); + return (Criteria) this; + } + + public Criteria andDeviceInfoIdIsNotNull() { + addCriterion("device_info_id is not null"); + return (Criteria) this; + } + + public Criteria andDeviceInfoIdEqualTo(Integer value) { + addCriterion("device_info_id =", value, "deviceInfoId"); + return (Criteria) this; + } + + public Criteria andDeviceInfoIdNotEqualTo(Integer value) { + addCriterion("device_info_id <>", value, "deviceInfoId"); + return (Criteria) this; + } + + public Criteria andDeviceInfoIdGreaterThan(Integer value) { + addCriterion("device_info_id >", value, "deviceInfoId"); + return (Criteria) this; + } + + public Criteria andDeviceInfoIdGreaterThanOrEqualTo(Integer value) { + addCriterion("device_info_id >=", value, "deviceInfoId"); + return (Criteria) this; + } + + public Criteria andDeviceInfoIdLessThan(Integer value) { + addCriterion("device_info_id <", value, "deviceInfoId"); + return (Criteria) this; + } + + public Criteria andDeviceInfoIdLessThanOrEqualTo(Integer value) { + addCriterion("device_info_id <=", value, "deviceInfoId"); + return (Criteria) this; + } + + public Criteria andDeviceInfoIdIn(List values) { + addCriterion("device_info_id in", values, "deviceInfoId"); + return (Criteria) this; + } + + public Criteria andDeviceInfoIdNotIn(List values) { + addCriterion("device_info_id not in", values, "deviceInfoId"); + return (Criteria) this; + } + + public Criteria andDeviceInfoIdBetween(Integer value1, Integer value2) { + addCriterion("device_info_id between", value1, value2, "deviceInfoId"); + return (Criteria) this; + } + + public Criteria andDeviceInfoIdNotBetween(Integer value1, Integer value2) { + addCriterion("device_info_id not between", value1, value2, "deviceInfoId"); + return (Criteria) this; + } + + public Criteria andDeviceGroupIdIsNull() { + addCriterion("device_group_id is null"); + return (Criteria) this; + } + + public Criteria andDeviceGroupIdIsNotNull() { + addCriterion("device_group_id is not null"); + return (Criteria) this; + } + + public Criteria andDeviceGroupIdEqualTo(Long value) { + addCriterion("device_group_id =", value, "deviceGroupId"); + return (Criteria) this; + } + + public Criteria andDeviceGroupIdNotEqualTo(Long value) { + addCriterion("device_group_id <>", value, "deviceGroupId"); + return (Criteria) this; + } + + public Criteria andDeviceGroupIdGreaterThan(Long value) { + addCriterion("device_group_id >", value, "deviceGroupId"); + return (Criteria) this; + } + + public Criteria andDeviceGroupIdGreaterThanOrEqualTo(Long value) { + addCriterion("device_group_id >=", value, "deviceGroupId"); + return (Criteria) this; + } + + public Criteria andDeviceGroupIdLessThan(Long value) { + addCriterion("device_group_id <", value, "deviceGroupId"); + return (Criteria) this; + } + + public Criteria andDeviceGroupIdLessThanOrEqualTo(Long value) { + addCriterion("device_group_id <=", value, "deviceGroupId"); + return (Criteria) this; + } + + public Criteria andDeviceGroupIdIn(List values) { + addCriterion("device_group_id in", values, "deviceGroupId"); + return (Criteria) this; + } + + public Criteria andDeviceGroupIdNotIn(List values) { + addCriterion("device_group_id not in", values, "deviceGroupId"); + return (Criteria) this; + } + + public Criteria andDeviceGroupIdBetween(Long value1, Long value2) { + addCriterion("device_group_id between", value1, value2, "deviceGroupId"); + return (Criteria) this; + } + + public Criteria andDeviceGroupIdNotBetween(Long value1, Long value2) { + addCriterion("device_group_id not between", value1, value2, "deviceGroupId"); + return (Criteria) this; + } + } + + /** + * This class was generated by MyBatis Generator. + * This class corresponds to the database table device_group_relation + * + * @mbg.generated do_not_delete_during_merge + */ + public static class Criteria extends GeneratedCriteria { + + protected Criteria() { + super(); + } + } + + /** + * This class was generated by MyBatis Generator. + * This class corresponds to the database table device_group_relation + * + * @mbg.generated + */ + public static class Criterion { + private String condition; + + private Object value; + + private Object secondValue; + + private boolean noValue; + + private boolean singleValue; + + private boolean betweenValue; + + private boolean listValue; + + private String typeHandler; + + public String getCondition() { + return condition; + } + + public Object getValue() { + return value; + } + + public Object getSecondValue() { + return secondValue; + } + + public boolean isNoValue() { + return noValue; + } + + public boolean isSingleValue() { + return singleValue; + } + + public boolean isBetweenValue() { + return betweenValue; + } + + public boolean isListValue() { + return listValue; + } + + public String getTypeHandler() { + return typeHandler; + } + + protected Criterion(String condition) { + super(); + this.condition = condition; + this.typeHandler = null; + this.noValue = true; + } + + protected Criterion(String condition, Object value, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.typeHandler = typeHandler; + if (value instanceof List) { + this.listValue = true; + } else { + this.singleValue = true; + } + } + + protected Criterion(String condition, Object value) { + this(condition, value, null); + } + + protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.secondValue = secondValue; + this.typeHandler = typeHandler; + this.betweenValue = true; + } + + protected Criterion(String condition, Object value, Object secondValue) { + this(condition, value, secondValue, null); + } + } +} \ No newline at end of file diff --git a/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/model/DeviceInfo.java b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/model/DeviceInfo.java new file mode 100644 index 0000000..62b1e96 --- /dev/null +++ b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/model/DeviceInfo.java @@ -0,0 +1,847 @@ +package com.dongjian.dashboard.back.model; + +import java.io.Serializable; +import java.util.Date; + +public class DeviceInfo implements Serializable { + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column device_info.id + * + * @mbg.generated + */ + private Integer id; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column device_info.device_id + * + * @mbg.generated + */ + private String deviceId; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column device_info.device_sn + * + * @mbg.generated + */ + private String deviceSn; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column device_info.type_id + * + * @mbg.generated + */ + private Integer typeId; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column device_info.wsclient_id + * + * @mbg.generated + */ + private Integer wsclientId; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column device_info.space_id + * + * @mbg.generated + */ + private Long spaceId; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column device_info.device_name + * + * @mbg.generated + */ + private String deviceName; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column device_info.remark + * + * @mbg.generated + */ + private String remark; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column device_info.building_id + * + * @mbg.generated + */ + private Long buildingId; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column device_info.asset_id + * + * @mbg.generated + */ + private Long assetId; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column device_info.flag + * + * @mbg.generated + */ + private Integer flag; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column device_info.company_id + * + * @mbg.generated + */ + private Long companyId; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column device_info.created_by + * + * @mbg.generated + */ + private Long createdBy; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column device_info.created_timestamp + * + * @mbg.generated + */ + private Date createdTimestamp; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column device_info.updated_by + * + * @mbg.generated + */ + private Long updatedBy; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column device_info.updated_timestamp + * + * @mbg.generated + */ + private Long updatedTimestamp; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column device_info.project_id + * + * @mbg.generated + */ + private Long projectId; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column device_info.floor_id + * + * @mbg.generated + */ + private Long floorId; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column device_info.monitoring_point_name + * + * @mbg.generated + */ + private String monitoringPointName; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column device_info.monitoring_point_category_id + * + * @mbg.generated + */ + private Long monitoringPointCategoryId; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column device_info.data_provider_id + * + * @mbg.generated + */ + private Long dataProviderId; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column device_info.gateway_info_id + * + * @mbg.generated + */ + private Long gatewayInfoId; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column device_info.alarm_level + * + * @mbg.generated + */ + private Integer alarmLevel; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column device_info.retain_alert + * + * @mbg.generated + */ + private Integer retainAlert; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database table device_info + * + * @mbg.generated + */ + private static final long serialVersionUID = 1L; + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column device_info.id + * + * @return the value of device_info.id + * + * @mbg.generated + */ + public Integer getId() { + return id; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column device_info.id + * + * @param id the value for device_info.id + * + * @mbg.generated + */ + public void setId(Integer id) { + this.id = id; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column device_info.device_id + * + * @return the value of device_info.device_id + * + * @mbg.generated + */ + public String getDeviceId() { + return deviceId; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column device_info.device_id + * + * @param deviceId the value for device_info.device_id + * + * @mbg.generated + */ + public void setDeviceId(String deviceId) { + this.deviceId = deviceId == null ? null : deviceId.trim(); + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column device_info.device_sn + * + * @return the value of device_info.device_sn + * + * @mbg.generated + */ + public String getDeviceSn() { + return deviceSn; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column device_info.device_sn + * + * @param deviceSn the value for device_info.device_sn + * + * @mbg.generated + */ + public void setDeviceSn(String deviceSn) { + this.deviceSn = deviceSn == null ? null : deviceSn.trim(); + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column device_info.type_id + * + * @return the value of device_info.type_id + * + * @mbg.generated + */ + public Integer getTypeId() { + return typeId; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column device_info.type_id + * + * @param typeId the value for device_info.type_id + * + * @mbg.generated + */ + public void setTypeId(Integer typeId) { + this.typeId = typeId; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column device_info.wsclient_id + * + * @return the value of device_info.wsclient_id + * + * @mbg.generated + */ + public Integer getWsclientId() { + return wsclientId; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column device_info.wsclient_id + * + * @param wsclientId the value for device_info.wsclient_id + * + * @mbg.generated + */ + public void setWsclientId(Integer wsclientId) { + this.wsclientId = wsclientId; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column device_info.space_id + * + * @return the value of device_info.space_id + * + * @mbg.generated + */ + public Long getSpaceId() { + return spaceId; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column device_info.space_id + * + * @param spaceId the value for device_info.space_id + * + * @mbg.generated + */ + public void setSpaceId(Long spaceId) { + this.spaceId = spaceId; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column device_info.device_name + * + * @return the value of device_info.device_name + * + * @mbg.generated + */ + public String getDeviceName() { + return deviceName; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column device_info.device_name + * + * @param deviceName the value for device_info.device_name + * + * @mbg.generated + */ + public void setDeviceName(String deviceName) { + this.deviceName = deviceName == null ? null : deviceName.trim(); + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column device_info.remark + * + * @return the value of device_info.remark + * + * @mbg.generated + */ + public String getRemark() { + return remark; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column device_info.remark + * + * @param remark the value for device_info.remark + * + * @mbg.generated + */ + public void setRemark(String remark) { + this.remark = remark == null ? null : remark.trim(); + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column device_info.building_id + * + * @return the value of device_info.building_id + * + * @mbg.generated + */ + public Long getBuildingId() { + return buildingId; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column device_info.building_id + * + * @param buildingId the value for device_info.building_id + * + * @mbg.generated + */ + public void setBuildingId(Long buildingId) { + this.buildingId = buildingId; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column device_info.asset_id + * + * @return the value of device_info.asset_id + * + * @mbg.generated + */ + public Long getAssetId() { + return assetId; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column device_info.asset_id + * + * @param assetId the value for device_info.asset_id + * + * @mbg.generated + */ + public void setAssetId(Long assetId) { + this.assetId = assetId; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column device_info.flag + * + * @return the value of device_info.flag + * + * @mbg.generated + */ + public Integer getFlag() { + return flag; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column device_info.flag + * + * @param flag the value for device_info.flag + * + * @mbg.generated + */ + public void setFlag(Integer flag) { + this.flag = flag; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column device_info.company_id + * + * @return the value of device_info.company_id + * + * @mbg.generated + */ + public Long getCompanyId() { + return companyId; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column device_info.company_id + * + * @param companyId the value for device_info.company_id + * + * @mbg.generated + */ + public void setCompanyId(Long companyId) { + this.companyId = companyId; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column device_info.created_by + * + * @return the value of device_info.created_by + * + * @mbg.generated + */ + public Long getCreatedBy() { + return createdBy; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column device_info.created_by + * + * @param createdBy the value for device_info.created_by + * + * @mbg.generated + */ + public void setCreatedBy(Long createdBy) { + this.createdBy = createdBy; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column device_info.created_timestamp + * + * @return the value of device_info.created_timestamp + * + * @mbg.generated + */ + public Date getCreatedTimestamp() { + return createdTimestamp; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column device_info.created_timestamp + * + * @param createdTimestamp the value for device_info.created_timestamp + * + * @mbg.generated + */ + public void setCreatedTimestamp(Date createdTimestamp) { + this.createdTimestamp = createdTimestamp; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column device_info.updated_by + * + * @return the value of device_info.updated_by + * + * @mbg.generated + */ + public Long getUpdatedBy() { + return updatedBy; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column device_info.updated_by + * + * @param updatedBy the value for device_info.updated_by + * + * @mbg.generated + */ + public void setUpdatedBy(Long updatedBy) { + this.updatedBy = updatedBy; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column device_info.updated_timestamp + * + * @return the value of device_info.updated_timestamp + * + * @mbg.generated + */ + public Long getUpdatedTimestamp() { + return updatedTimestamp; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column device_info.updated_timestamp + * + * @param updatedTimestamp the value for device_info.updated_timestamp + * + * @mbg.generated + */ + public void setUpdatedTimestamp(Long updatedTimestamp) { + this.updatedTimestamp = updatedTimestamp; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column device_info.project_id + * + * @return the value of device_info.project_id + * + * @mbg.generated + */ + public Long getProjectId() { + return projectId; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column device_info.project_id + * + * @param projectId the value for device_info.project_id + * + * @mbg.generated + */ + public void setProjectId(Long projectId) { + this.projectId = projectId; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column device_info.floor_id + * + * @return the value of device_info.floor_id + * + * @mbg.generated + */ + public Long getFloorId() { + return floorId; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column device_info.floor_id + * + * @param floorId the value for device_info.floor_id + * + * @mbg.generated + */ + public void setFloorId(Long floorId) { + this.floorId = floorId; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column device_info.monitoring_point_name + * + * @return the value of device_info.monitoring_point_name + * + * @mbg.generated + */ + public String getMonitoringPointName() { + return monitoringPointName; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column device_info.monitoring_point_name + * + * @param monitoringPointName the value for device_info.monitoring_point_name + * + * @mbg.generated + */ + public void setMonitoringPointName(String monitoringPointName) { + this.monitoringPointName = monitoringPointName == null ? null : monitoringPointName.trim(); + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column device_info.monitoring_point_category_id + * + * @return the value of device_info.monitoring_point_category_id + * + * @mbg.generated + */ + public Long getMonitoringPointCategoryId() { + return monitoringPointCategoryId; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column device_info.monitoring_point_category_id + * + * @param monitoringPointCategoryId the value for device_info.monitoring_point_category_id + * + * @mbg.generated + */ + public void setMonitoringPointCategoryId(Long monitoringPointCategoryId) { + this.monitoringPointCategoryId = monitoringPointCategoryId; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column device_info.data_provider_id + * + * @return the value of device_info.data_provider_id + * + * @mbg.generated + */ + public Long getDataProviderId() { + return dataProviderId; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column device_info.data_provider_id + * + * @param dataProviderId the value for device_info.data_provider_id + * + * @mbg.generated + */ + public void setDataProviderId(Long dataProviderId) { + this.dataProviderId = dataProviderId; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column device_info.gateway_info_id + * + * @return the value of device_info.gateway_info_id + * + * @mbg.generated + */ + public Long getGatewayInfoId() { + return gatewayInfoId; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column device_info.gateway_info_id + * + * @param gatewayInfoId the value for device_info.gateway_info_id + * + * @mbg.generated + */ + public void setGatewayInfoId(Long gatewayInfoId) { + this.gatewayInfoId = gatewayInfoId; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column device_info.alarm_level + * + * @return the value of device_info.alarm_level + * + * @mbg.generated + */ + public Integer getAlarmLevel() { + return alarmLevel; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column device_info.alarm_level + * + * @param alarmLevel the value for device_info.alarm_level + * + * @mbg.generated + */ + public void setAlarmLevel(Integer alarmLevel) { + this.alarmLevel = alarmLevel; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column device_info.retain_alert + * + * @return the value of device_info.retain_alert + * + * @mbg.generated + */ + public Integer getRetainAlert() { + return retainAlert; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column device_info.retain_alert + * + * @param retainAlert the value for device_info.retain_alert + * + * @mbg.generated + */ + public void setRetainAlert(Integer retainAlert) { + this.retainAlert = retainAlert; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table device_info + * + * @mbg.generated + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append(getClass().getSimpleName()); + sb.append(" ["); + sb.append("Hash = ").append(hashCode()); + sb.append(", id=").append(id); + sb.append(", deviceId=").append(deviceId); + sb.append(", deviceSn=").append(deviceSn); + sb.append(", typeId=").append(typeId); + sb.append(", wsclientId=").append(wsclientId); + sb.append(", spaceId=").append(spaceId); + sb.append(", deviceName=").append(deviceName); + sb.append(", remark=").append(remark); + sb.append(", buildingId=").append(buildingId); + sb.append(", assetId=").append(assetId); + sb.append(", flag=").append(flag); + sb.append(", companyId=").append(companyId); + sb.append(", createdBy=").append(createdBy); + sb.append(", createdTimestamp=").append(createdTimestamp); + sb.append(", updatedBy=").append(updatedBy); + sb.append(", updatedTimestamp=").append(updatedTimestamp); + sb.append(", projectId=").append(projectId); + sb.append(", floorId=").append(floorId); + sb.append(", monitoringPointName=").append(monitoringPointName); + sb.append(", monitoringPointCategoryId=").append(monitoringPointCategoryId); + sb.append(", dataProviderId=").append(dataProviderId); + sb.append(", gatewayInfoId=").append(gatewayInfoId); + sb.append(", alarmLevel=").append(alarmLevel); + sb.append(", retainAlert=").append(retainAlert); + sb.append(", serialVersionUID=").append(serialVersionUID); + sb.append("]"); + return sb.toString(); + } +} \ No newline at end of file diff --git a/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/model/DeviceInfoExample.java b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/model/DeviceInfoExample.java new file mode 100644 index 0000000..f2706b7 --- /dev/null +++ b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/model/DeviceInfoExample.java @@ -0,0 +1,1793 @@ +package com.dongjian.dashboard.back.model; + +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +public class DeviceInfoExample { + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database table device_info + * + * @mbg.generated + */ + protected String orderByClause; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database table device_info + * + * @mbg.generated + */ + protected boolean distinct; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database table device_info + * + * @mbg.generated + */ + protected List oredCriteria; + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table device_info + * + * @mbg.generated + */ + public DeviceInfoExample() { + oredCriteria = new ArrayList(); + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table device_info + * + * @mbg.generated + */ + public void setOrderByClause(String orderByClause) { + this.orderByClause = orderByClause; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table device_info + * + * @mbg.generated + */ + public String getOrderByClause() { + return orderByClause; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table device_info + * + * @mbg.generated + */ + public void setDistinct(boolean distinct) { + this.distinct = distinct; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table device_info + * + * @mbg.generated + */ + public boolean isDistinct() { + return distinct; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table device_info + * + * @mbg.generated + */ + public List getOredCriteria() { + return oredCriteria; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table device_info + * + * @mbg.generated + */ + public void or(Criteria criteria) { + oredCriteria.add(criteria); + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table device_info + * + * @mbg.generated + */ + public Criteria or() { + Criteria criteria = createCriteriaInternal(); + oredCriteria.add(criteria); + return criteria; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table device_info + * + * @mbg.generated + */ + public Criteria createCriteria() { + Criteria criteria = createCriteriaInternal(); + if (oredCriteria.size() == 0) { + oredCriteria.add(criteria); + } + return criteria; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table device_info + * + * @mbg.generated + */ + protected Criteria createCriteriaInternal() { + Criteria criteria = new Criteria(); + return criteria; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table device_info + * + * @mbg.generated + */ + public void clear() { + oredCriteria.clear(); + orderByClause = null; + distinct = false; + } + + /** + * This class was generated by MyBatis Generator. + * This class corresponds to the database table device_info + * + * @mbg.generated + */ + protected abstract static class GeneratedCriteria { + protected List criteria; + + protected GeneratedCriteria() { + super(); + criteria = new ArrayList(); + } + + public boolean isValid() { + return criteria.size() > 0; + } + + public List getAllCriteria() { + return criteria; + } + + public List getCriteria() { + return criteria; + } + + protected void addCriterion(String condition) { + if (condition == null) { + throw new RuntimeException("Value for condition cannot be null"); + } + criteria.add(new Criterion(condition)); + } + + protected void addCriterion(String condition, Object value, String property) { + if (value == null) { + throw new RuntimeException("Value for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value)); + } + + protected void addCriterion(String condition, Object value1, Object value2, String property) { + if (value1 == null || value2 == null) { + throw new RuntimeException("Between values for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value1, value2)); + } + + public Criteria andIdIsNull() { + addCriterion("id is null"); + return (Criteria) this; + } + + public Criteria andIdIsNotNull() { + addCriterion("id is not null"); + return (Criteria) this; + } + + public Criteria andIdEqualTo(Integer value) { + addCriterion("id =", value, "id"); + return (Criteria) this; + } + + public Criteria andIdNotEqualTo(Integer value) { + addCriterion("id <>", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThan(Integer value) { + addCriterion("id >", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThanOrEqualTo(Integer value) { + addCriterion("id >=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThan(Integer value) { + addCriterion("id <", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThanOrEqualTo(Integer value) { + addCriterion("id <=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdIn(List values) { + addCriterion("id in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdNotIn(List values) { + addCriterion("id not in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdBetween(Integer value1, Integer value2) { + addCriterion("id between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andIdNotBetween(Integer value1, Integer value2) { + addCriterion("id not between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andDeviceIdIsNull() { + addCriterion("device_id is null"); + return (Criteria) this; + } + + public Criteria andDeviceIdIsNotNull() { + addCriterion("device_id is not null"); + return (Criteria) this; + } + + public Criteria andDeviceIdEqualTo(String value) { + addCriterion("device_id =", value, "deviceId"); + return (Criteria) this; + } + + public Criteria andDeviceIdNotEqualTo(String value) { + addCriterion("device_id <>", value, "deviceId"); + return (Criteria) this; + } + + public Criteria andDeviceIdGreaterThan(String value) { + addCriterion("device_id >", value, "deviceId"); + return (Criteria) this; + } + + public Criteria andDeviceIdGreaterThanOrEqualTo(String value) { + addCriterion("device_id >=", value, "deviceId"); + return (Criteria) this; + } + + public Criteria andDeviceIdLessThan(String value) { + addCriterion("device_id <", value, "deviceId"); + return (Criteria) this; + } + + public Criteria andDeviceIdLessThanOrEqualTo(String value) { + addCriterion("device_id <=", value, "deviceId"); + return (Criteria) this; + } + + public Criteria andDeviceIdLike(String value) { + addCriterion("device_id like", value, "deviceId"); + return (Criteria) this; + } + + public Criteria andDeviceIdNotLike(String value) { + addCriterion("device_id not like", value, "deviceId"); + return (Criteria) this; + } + + public Criteria andDeviceIdIn(List values) { + addCriterion("device_id in", values, "deviceId"); + return (Criteria) this; + } + + public Criteria andDeviceIdNotIn(List values) { + addCriterion("device_id not in", values, "deviceId"); + return (Criteria) this; + } + + public Criteria andDeviceIdBetween(String value1, String value2) { + addCriterion("device_id between", value1, value2, "deviceId"); + return (Criteria) this; + } + + public Criteria andDeviceIdNotBetween(String value1, String value2) { + addCriterion("device_id not between", value1, value2, "deviceId"); + return (Criteria) this; + } + + public Criteria andDeviceSnIsNull() { + addCriterion("device_sn is null"); + return (Criteria) this; + } + + public Criteria andDeviceSnIsNotNull() { + addCriterion("device_sn is not null"); + return (Criteria) this; + } + + public Criteria andDeviceSnEqualTo(String value) { + addCriterion("device_sn =", value, "deviceSn"); + return (Criteria) this; + } + + public Criteria andDeviceSnNotEqualTo(String value) { + addCriterion("device_sn <>", value, "deviceSn"); + return (Criteria) this; + } + + public Criteria andDeviceSnGreaterThan(String value) { + addCriterion("device_sn >", value, "deviceSn"); + return (Criteria) this; + } + + public Criteria andDeviceSnGreaterThanOrEqualTo(String value) { + addCriterion("device_sn >=", value, "deviceSn"); + return (Criteria) this; + } + + public Criteria andDeviceSnLessThan(String value) { + addCriterion("device_sn <", value, "deviceSn"); + return (Criteria) this; + } + + public Criteria andDeviceSnLessThanOrEqualTo(String value) { + addCriterion("device_sn <=", value, "deviceSn"); + return (Criteria) this; + } + + public Criteria andDeviceSnLike(String value) { + addCriterion("device_sn like", value, "deviceSn"); + return (Criteria) this; + } + + public Criteria andDeviceSnNotLike(String value) { + addCriterion("device_sn not like", value, "deviceSn"); + return (Criteria) this; + } + + public Criteria andDeviceSnIn(List values) { + addCriterion("device_sn in", values, "deviceSn"); + return (Criteria) this; + } + + public Criteria andDeviceSnNotIn(List values) { + addCriterion("device_sn not in", values, "deviceSn"); + return (Criteria) this; + } + + public Criteria andDeviceSnBetween(String value1, String value2) { + addCriterion("device_sn between", value1, value2, "deviceSn"); + return (Criteria) this; + } + + public Criteria andDeviceSnNotBetween(String value1, String value2) { + addCriterion("device_sn not between", value1, value2, "deviceSn"); + return (Criteria) this; + } + + public Criteria andTypeIdIsNull() { + addCriterion("type_id is null"); + return (Criteria) this; + } + + public Criteria andTypeIdIsNotNull() { + addCriterion("type_id is not null"); + return (Criteria) this; + } + + public Criteria andTypeIdEqualTo(Integer value) { + addCriterion("type_id =", value, "typeId"); + return (Criteria) this; + } + + public Criteria andTypeIdNotEqualTo(Integer value) { + addCriterion("type_id <>", value, "typeId"); + return (Criteria) this; + } + + public Criteria andTypeIdGreaterThan(Integer value) { + addCriterion("type_id >", value, "typeId"); + return (Criteria) this; + } + + public Criteria andTypeIdGreaterThanOrEqualTo(Integer value) { + addCriterion("type_id >=", value, "typeId"); + return (Criteria) this; + } + + public Criteria andTypeIdLessThan(Integer value) { + addCriterion("type_id <", value, "typeId"); + return (Criteria) this; + } + + public Criteria andTypeIdLessThanOrEqualTo(Integer value) { + addCriterion("type_id <=", value, "typeId"); + return (Criteria) this; + } + + public Criteria andTypeIdIn(List values) { + addCriterion("type_id in", values, "typeId"); + return (Criteria) this; + } + + public Criteria andTypeIdNotIn(List values) { + addCriterion("type_id not in", values, "typeId"); + return (Criteria) this; + } + + public Criteria andTypeIdBetween(Integer value1, Integer value2) { + addCriterion("type_id between", value1, value2, "typeId"); + return (Criteria) this; + } + + public Criteria andTypeIdNotBetween(Integer value1, Integer value2) { + addCriterion("type_id not between", value1, value2, "typeId"); + return (Criteria) this; + } + + public Criteria andWsclientIdIsNull() { + addCriterion("wsclient_id is null"); + return (Criteria) this; + } + + public Criteria andWsclientIdIsNotNull() { + addCriterion("wsclient_id is not null"); + return (Criteria) this; + } + + public Criteria andWsclientIdEqualTo(Integer value) { + addCriterion("wsclient_id =", value, "wsclientId"); + return (Criteria) this; + } + + public Criteria andWsclientIdNotEqualTo(Integer value) { + addCriterion("wsclient_id <>", value, "wsclientId"); + return (Criteria) this; + } + + public Criteria andWsclientIdGreaterThan(Integer value) { + addCriterion("wsclient_id >", value, "wsclientId"); + return (Criteria) this; + } + + public Criteria andWsclientIdGreaterThanOrEqualTo(Integer value) { + addCriterion("wsclient_id >=", value, "wsclientId"); + return (Criteria) this; + } + + public Criteria andWsclientIdLessThan(Integer value) { + addCriterion("wsclient_id <", value, "wsclientId"); + return (Criteria) this; + } + + public Criteria andWsclientIdLessThanOrEqualTo(Integer value) { + addCriterion("wsclient_id <=", value, "wsclientId"); + return (Criteria) this; + } + + public Criteria andWsclientIdIn(List values) { + addCriterion("wsclient_id in", values, "wsclientId"); + return (Criteria) this; + } + + public Criteria andWsclientIdNotIn(List values) { + addCriterion("wsclient_id not in", values, "wsclientId"); + return (Criteria) this; + } + + public Criteria andWsclientIdBetween(Integer value1, Integer value2) { + addCriterion("wsclient_id between", value1, value2, "wsclientId"); + return (Criteria) this; + } + + public Criteria andWsclientIdNotBetween(Integer value1, Integer value2) { + addCriterion("wsclient_id not between", value1, value2, "wsclientId"); + return (Criteria) this; + } + + public Criteria andSpaceIdIsNull() { + addCriterion("space_id is null"); + return (Criteria) this; + } + + public Criteria andSpaceIdIsNotNull() { + addCriterion("space_id is not null"); + return (Criteria) this; + } + + public Criteria andSpaceIdEqualTo(Long value) { + addCriterion("space_id =", value, "spaceId"); + return (Criteria) this; + } + + public Criteria andSpaceIdNotEqualTo(Long value) { + addCriterion("space_id <>", value, "spaceId"); + return (Criteria) this; + } + + public Criteria andSpaceIdGreaterThan(Long value) { + addCriterion("space_id >", value, "spaceId"); + return (Criteria) this; + } + + public Criteria andSpaceIdGreaterThanOrEqualTo(Long value) { + addCriterion("space_id >=", value, "spaceId"); + return (Criteria) this; + } + + public Criteria andSpaceIdLessThan(Long value) { + addCriterion("space_id <", value, "spaceId"); + return (Criteria) this; + } + + public Criteria andSpaceIdLessThanOrEqualTo(Long value) { + addCriterion("space_id <=", value, "spaceId"); + return (Criteria) this; + } + + public Criteria andSpaceIdIn(List values) { + addCriterion("space_id in", values, "spaceId"); + return (Criteria) this; + } + + public Criteria andSpaceIdNotIn(List values) { + addCriterion("space_id not in", values, "spaceId"); + return (Criteria) this; + } + + public Criteria andSpaceIdBetween(Long value1, Long value2) { + addCriterion("space_id between", value1, value2, "spaceId"); + return (Criteria) this; + } + + public Criteria andSpaceIdNotBetween(Long value1, Long value2) { + addCriterion("space_id not between", value1, value2, "spaceId"); + return (Criteria) this; + } + + public Criteria andDeviceNameIsNull() { + addCriterion("device_name is null"); + return (Criteria) this; + } + + public Criteria andDeviceNameIsNotNull() { + addCriterion("device_name is not null"); + return (Criteria) this; + } + + public Criteria andDeviceNameEqualTo(String value) { + addCriterion("device_name =", value, "deviceName"); + return (Criteria) this; + } + + public Criteria andDeviceNameNotEqualTo(String value) { + addCriterion("device_name <>", value, "deviceName"); + return (Criteria) this; + } + + public Criteria andDeviceNameGreaterThan(String value) { + addCriterion("device_name >", value, "deviceName"); + return (Criteria) this; + } + + public Criteria andDeviceNameGreaterThanOrEqualTo(String value) { + addCriterion("device_name >=", value, "deviceName"); + return (Criteria) this; + } + + public Criteria andDeviceNameLessThan(String value) { + addCriterion("device_name <", value, "deviceName"); + return (Criteria) this; + } + + public Criteria andDeviceNameLessThanOrEqualTo(String value) { + addCriterion("device_name <=", value, "deviceName"); + return (Criteria) this; + } + + public Criteria andDeviceNameLike(String value) { + addCriterion("device_name like", value, "deviceName"); + return (Criteria) this; + } + + public Criteria andDeviceNameNotLike(String value) { + addCriterion("device_name not like", value, "deviceName"); + return (Criteria) this; + } + + public Criteria andDeviceNameIn(List values) { + addCriterion("device_name in", values, "deviceName"); + return (Criteria) this; + } + + public Criteria andDeviceNameNotIn(List values) { + addCriterion("device_name not in", values, "deviceName"); + return (Criteria) this; + } + + public Criteria andDeviceNameBetween(String value1, String value2) { + addCriterion("device_name between", value1, value2, "deviceName"); + return (Criteria) this; + } + + public Criteria andDeviceNameNotBetween(String value1, String value2) { + addCriterion("device_name not between", value1, value2, "deviceName"); + return (Criteria) this; + } + + public Criteria andRemarkIsNull() { + addCriterion("remark is null"); + return (Criteria) this; + } + + public Criteria andRemarkIsNotNull() { + addCriterion("remark is not null"); + return (Criteria) this; + } + + public Criteria andRemarkEqualTo(String value) { + addCriterion("remark =", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkNotEqualTo(String value) { + addCriterion("remark <>", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkGreaterThan(String value) { + addCriterion("remark >", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkGreaterThanOrEqualTo(String value) { + addCriterion("remark >=", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkLessThan(String value) { + addCriterion("remark <", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkLessThanOrEqualTo(String value) { + addCriterion("remark <=", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkLike(String value) { + addCriterion("remark like", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkNotLike(String value) { + addCriterion("remark not like", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkIn(List values) { + addCriterion("remark in", values, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkNotIn(List values) { + addCriterion("remark not in", values, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkBetween(String value1, String value2) { + addCriterion("remark between", value1, value2, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkNotBetween(String value1, String value2) { + addCriterion("remark not between", value1, value2, "remark"); + return (Criteria) this; + } + + public Criteria andBuildingIdIsNull() { + addCriterion("building_id is null"); + return (Criteria) this; + } + + public Criteria andBuildingIdIsNotNull() { + addCriterion("building_id is not null"); + return (Criteria) this; + } + + public Criteria andBuildingIdEqualTo(Long value) { + addCriterion("building_id =", value, "buildingId"); + return (Criteria) this; + } + + public Criteria andBuildingIdNotEqualTo(Long value) { + addCriterion("building_id <>", value, "buildingId"); + return (Criteria) this; + } + + public Criteria andBuildingIdGreaterThan(Long value) { + addCriterion("building_id >", value, "buildingId"); + return (Criteria) this; + } + + public Criteria andBuildingIdGreaterThanOrEqualTo(Long value) { + addCriterion("building_id >=", value, "buildingId"); + return (Criteria) this; + } + + public Criteria andBuildingIdLessThan(Long value) { + addCriterion("building_id <", value, "buildingId"); + return (Criteria) this; + } + + public Criteria andBuildingIdLessThanOrEqualTo(Long value) { + addCriterion("building_id <=", value, "buildingId"); + return (Criteria) this; + } + + public Criteria andBuildingIdIn(List values) { + addCriterion("building_id in", values, "buildingId"); + return (Criteria) this; + } + + public Criteria andBuildingIdNotIn(List values) { + addCriterion("building_id not in", values, "buildingId"); + return (Criteria) this; + } + + public Criteria andBuildingIdBetween(Long value1, Long value2) { + addCriterion("building_id between", value1, value2, "buildingId"); + return (Criteria) this; + } + + public Criteria andBuildingIdNotBetween(Long value1, Long value2) { + addCriterion("building_id not between", value1, value2, "buildingId"); + return (Criteria) this; + } + + public Criteria andAssetIdIsNull() { + addCriterion("asset_id is null"); + return (Criteria) this; + } + + public Criteria andAssetIdIsNotNull() { + addCriterion("asset_id is not null"); + return (Criteria) this; + } + + public Criteria andAssetIdEqualTo(Long value) { + addCriterion("asset_id =", value, "assetId"); + return (Criteria) this; + } + + public Criteria andAssetIdNotEqualTo(Long value) { + addCriterion("asset_id <>", value, "assetId"); + return (Criteria) this; + } + + public Criteria andAssetIdGreaterThan(Long value) { + addCriterion("asset_id >", value, "assetId"); + return (Criteria) this; + } + + public Criteria andAssetIdGreaterThanOrEqualTo(Long value) { + addCriterion("asset_id >=", value, "assetId"); + return (Criteria) this; + } + + public Criteria andAssetIdLessThan(Long value) { + addCriterion("asset_id <", value, "assetId"); + return (Criteria) this; + } + + public Criteria andAssetIdLessThanOrEqualTo(Long value) { + addCriterion("asset_id <=", value, "assetId"); + return (Criteria) this; + } + + public Criteria andAssetIdIn(List values) { + addCriterion("asset_id in", values, "assetId"); + return (Criteria) this; + } + + public Criteria andAssetIdNotIn(List values) { + addCriterion("asset_id not in", values, "assetId"); + return (Criteria) this; + } + + public Criteria andAssetIdBetween(Long value1, Long value2) { + addCriterion("asset_id between", value1, value2, "assetId"); + return (Criteria) this; + } + + public Criteria andAssetIdNotBetween(Long value1, Long value2) { + addCriterion("asset_id not between", value1, value2, "assetId"); + return (Criteria) this; + } + + public Criteria andFlagIsNull() { + addCriterion("flag is null"); + return (Criteria) this; + } + + public Criteria andFlagIsNotNull() { + addCriterion("flag is not null"); + return (Criteria) this; + } + + public Criteria andFlagEqualTo(Integer value) { + addCriterion("flag =", value, "flag"); + return (Criteria) this; + } + + public Criteria andFlagNotEqualTo(Integer value) { + addCriterion("flag <>", value, "flag"); + return (Criteria) this; + } + + public Criteria andFlagGreaterThan(Integer value) { + addCriterion("flag >", value, "flag"); + return (Criteria) this; + } + + public Criteria andFlagGreaterThanOrEqualTo(Integer value) { + addCriterion("flag >=", value, "flag"); + return (Criteria) this; + } + + public Criteria andFlagLessThan(Integer value) { + addCriterion("flag <", value, "flag"); + return (Criteria) this; + } + + public Criteria andFlagLessThanOrEqualTo(Integer value) { + addCriterion("flag <=", value, "flag"); + return (Criteria) this; + } + + public Criteria andFlagIn(List values) { + addCriterion("flag in", values, "flag"); + return (Criteria) this; + } + + public Criteria andFlagNotIn(List values) { + addCriterion("flag not in", values, "flag"); + return (Criteria) this; + } + + public Criteria andFlagBetween(Integer value1, Integer value2) { + addCriterion("flag between", value1, value2, "flag"); + return (Criteria) this; + } + + public Criteria andFlagNotBetween(Integer value1, Integer value2) { + addCriterion("flag not between", value1, value2, "flag"); + return (Criteria) this; + } + + public Criteria andCompanyIdIsNull() { + addCriterion("company_id is null"); + return (Criteria) this; + } + + public Criteria andCompanyIdIsNotNull() { + addCriterion("company_id is not null"); + return (Criteria) this; + } + + public Criteria andCompanyIdEqualTo(Long value) { + addCriterion("company_id =", value, "companyId"); + return (Criteria) this; + } + + public Criteria andCompanyIdNotEqualTo(Long value) { + addCriterion("company_id <>", value, "companyId"); + return (Criteria) this; + } + + public Criteria andCompanyIdGreaterThan(Long value) { + addCriterion("company_id >", value, "companyId"); + return (Criteria) this; + } + + public Criteria andCompanyIdGreaterThanOrEqualTo(Long value) { + addCriterion("company_id >=", value, "companyId"); + return (Criteria) this; + } + + public Criteria andCompanyIdLessThan(Long value) { + addCriterion("company_id <", value, "companyId"); + return (Criteria) this; + } + + public Criteria andCompanyIdLessThanOrEqualTo(Long value) { + addCriterion("company_id <=", value, "companyId"); + return (Criteria) this; + } + + public Criteria andCompanyIdIn(List values) { + addCriterion("company_id in", values, "companyId"); + return (Criteria) this; + } + + public Criteria andCompanyIdNotIn(List values) { + addCriterion("company_id not in", values, "companyId"); + return (Criteria) this; + } + + public Criteria andCompanyIdBetween(Long value1, Long value2) { + addCriterion("company_id between", value1, value2, "companyId"); + return (Criteria) this; + } + + public Criteria andCompanyIdNotBetween(Long value1, Long value2) { + addCriterion("company_id not between", value1, value2, "companyId"); + return (Criteria) this; + } + + public Criteria andCreatedByIsNull() { + addCriterion("created_by is null"); + return (Criteria) this; + } + + public Criteria andCreatedByIsNotNull() { + addCriterion("created_by is not null"); + return (Criteria) this; + } + + public Criteria andCreatedByEqualTo(Long value) { + addCriterion("created_by =", value, "createdBy"); + return (Criteria) this; + } + + public Criteria andCreatedByNotEqualTo(Long value) { + addCriterion("created_by <>", value, "createdBy"); + return (Criteria) this; + } + + public Criteria andCreatedByGreaterThan(Long value) { + addCriterion("created_by >", value, "createdBy"); + return (Criteria) this; + } + + public Criteria andCreatedByGreaterThanOrEqualTo(Long value) { + addCriterion("created_by >=", value, "createdBy"); + return (Criteria) this; + } + + public Criteria andCreatedByLessThan(Long value) { + addCriterion("created_by <", value, "createdBy"); + return (Criteria) this; + } + + public Criteria andCreatedByLessThanOrEqualTo(Long value) { + addCriterion("created_by <=", value, "createdBy"); + return (Criteria) this; + } + + public Criteria andCreatedByIn(List values) { + addCriterion("created_by in", values, "createdBy"); + return (Criteria) this; + } + + public Criteria andCreatedByNotIn(List values) { + addCriterion("created_by not in", values, "createdBy"); + return (Criteria) this; + } + + public Criteria andCreatedByBetween(Long value1, Long value2) { + addCriterion("created_by between", value1, value2, "createdBy"); + return (Criteria) this; + } + + public Criteria andCreatedByNotBetween(Long value1, Long value2) { + addCriterion("created_by not between", value1, value2, "createdBy"); + return (Criteria) this; + } + + public Criteria andCreatedTimestampIsNull() { + addCriterion("created_timestamp is null"); + return (Criteria) this; + } + + public Criteria andCreatedTimestampIsNotNull() { + addCriterion("created_timestamp is not null"); + return (Criteria) this; + } + + public Criteria andCreatedTimestampEqualTo(Date value) { + addCriterion("created_timestamp =", value, "createdTimestamp"); + return (Criteria) this; + } + + public Criteria andCreatedTimestampNotEqualTo(Date value) { + addCriterion("created_timestamp <>", value, "createdTimestamp"); + return (Criteria) this; + } + + public Criteria andCreatedTimestampGreaterThan(Date value) { + addCriterion("created_timestamp >", value, "createdTimestamp"); + return (Criteria) this; + } + + public Criteria andCreatedTimestampGreaterThanOrEqualTo(Date value) { + addCriterion("created_timestamp >=", value, "createdTimestamp"); + return (Criteria) this; + } + + public Criteria andCreatedTimestampLessThan(Date value) { + addCriterion("created_timestamp <", value, "createdTimestamp"); + return (Criteria) this; + } + + public Criteria andCreatedTimestampLessThanOrEqualTo(Date value) { + addCriterion("created_timestamp <=", value, "createdTimestamp"); + return (Criteria) this; + } + + public Criteria andCreatedTimestampIn(List values) { + addCriterion("created_timestamp in", values, "createdTimestamp"); + return (Criteria) this; + } + + public Criteria andCreatedTimestampNotIn(List values) { + addCriterion("created_timestamp not in", values, "createdTimestamp"); + return (Criteria) this; + } + + public Criteria andCreatedTimestampBetween(Date value1, Date value2) { + addCriterion("created_timestamp between", value1, value2, "createdTimestamp"); + return (Criteria) this; + } + + public Criteria andCreatedTimestampNotBetween(Date value1, Date value2) { + addCriterion("created_timestamp not between", value1, value2, "createdTimestamp"); + return (Criteria) this; + } + + public Criteria andUpdatedByIsNull() { + addCriterion("updated_by is null"); + return (Criteria) this; + } + + public Criteria andUpdatedByIsNotNull() { + addCriterion("updated_by is not null"); + return (Criteria) this; + } + + public Criteria andUpdatedByEqualTo(Long value) { + addCriterion("updated_by =", value, "updatedBy"); + return (Criteria) this; + } + + public Criteria andUpdatedByNotEqualTo(Long value) { + addCriterion("updated_by <>", value, "updatedBy"); + return (Criteria) this; + } + + public Criteria andUpdatedByGreaterThan(Long value) { + addCriterion("updated_by >", value, "updatedBy"); + return (Criteria) this; + } + + public Criteria andUpdatedByGreaterThanOrEqualTo(Long value) { + addCriterion("updated_by >=", value, "updatedBy"); + return (Criteria) this; + } + + public Criteria andUpdatedByLessThan(Long value) { + addCriterion("updated_by <", value, "updatedBy"); + return (Criteria) this; + } + + public Criteria andUpdatedByLessThanOrEqualTo(Long value) { + addCriterion("updated_by <=", value, "updatedBy"); + return (Criteria) this; + } + + public Criteria andUpdatedByIn(List values) { + addCriterion("updated_by in", values, "updatedBy"); + return (Criteria) this; + } + + public Criteria andUpdatedByNotIn(List values) { + addCriterion("updated_by not in", values, "updatedBy"); + return (Criteria) this; + } + + public Criteria andUpdatedByBetween(Long value1, Long value2) { + addCriterion("updated_by between", value1, value2, "updatedBy"); + return (Criteria) this; + } + + public Criteria andUpdatedByNotBetween(Long value1, Long value2) { + addCriterion("updated_by not between", value1, value2, "updatedBy"); + return (Criteria) this; + } + + public Criteria andUpdatedTimestampIsNull() { + addCriterion("updated_timestamp is null"); + return (Criteria) this; + } + + public Criteria andUpdatedTimestampIsNotNull() { + addCriterion("updated_timestamp is not null"); + return (Criteria) this; + } + + public Criteria andUpdatedTimestampEqualTo(Long value) { + addCriterion("updated_timestamp =", value, "updatedTimestamp"); + return (Criteria) this; + } + + public Criteria andUpdatedTimestampNotEqualTo(Long value) { + addCriterion("updated_timestamp <>", value, "updatedTimestamp"); + return (Criteria) this; + } + + public Criteria andUpdatedTimestampGreaterThan(Long value) { + addCriterion("updated_timestamp >", value, "updatedTimestamp"); + return (Criteria) this; + } + + public Criteria andUpdatedTimestampGreaterThanOrEqualTo(Long value) { + addCriterion("updated_timestamp >=", value, "updatedTimestamp"); + return (Criteria) this; + } + + public Criteria andUpdatedTimestampLessThan(Long value) { + addCriterion("updated_timestamp <", value, "updatedTimestamp"); + return (Criteria) this; + } + + public Criteria andUpdatedTimestampLessThanOrEqualTo(Long value) { + addCriterion("updated_timestamp <=", value, "updatedTimestamp"); + return (Criteria) this; + } + + public Criteria andUpdatedTimestampIn(List values) { + addCriterion("updated_timestamp in", values, "updatedTimestamp"); + return (Criteria) this; + } + + public Criteria andUpdatedTimestampNotIn(List values) { + addCriterion("updated_timestamp not in", values, "updatedTimestamp"); + return (Criteria) this; + } + + public Criteria andUpdatedTimestampBetween(Long value1, Long value2) { + addCriterion("updated_timestamp between", value1, value2, "updatedTimestamp"); + return (Criteria) this; + } + + public Criteria andUpdatedTimestampNotBetween(Long value1, Long value2) { + addCriterion("updated_timestamp not between", value1, value2, "updatedTimestamp"); + return (Criteria) this; + } + + public Criteria andProjectIdIsNull() { + addCriterion("project_id is null"); + return (Criteria) this; + } + + public Criteria andProjectIdIsNotNull() { + addCriterion("project_id is not null"); + return (Criteria) this; + } + + public Criteria andProjectIdEqualTo(Long value) { + addCriterion("project_id =", value, "projectId"); + return (Criteria) this; + } + + public Criteria andProjectIdNotEqualTo(Long value) { + addCriterion("project_id <>", value, "projectId"); + return (Criteria) this; + } + + public Criteria andProjectIdGreaterThan(Long value) { + addCriterion("project_id >", value, "projectId"); + return (Criteria) this; + } + + public Criteria andProjectIdGreaterThanOrEqualTo(Long value) { + addCriterion("project_id >=", value, "projectId"); + return (Criteria) this; + } + + public Criteria andProjectIdLessThan(Long value) { + addCriterion("project_id <", value, "projectId"); + return (Criteria) this; + } + + public Criteria andProjectIdLessThanOrEqualTo(Long value) { + addCriterion("project_id <=", value, "projectId"); + return (Criteria) this; + } + + public Criteria andProjectIdIn(List values) { + addCriterion("project_id in", values, "projectId"); + return (Criteria) this; + } + + public Criteria andProjectIdNotIn(List values) { + addCriterion("project_id not in", values, "projectId"); + return (Criteria) this; + } + + public Criteria andProjectIdBetween(Long value1, Long value2) { + addCriterion("project_id between", value1, value2, "projectId"); + return (Criteria) this; + } + + public Criteria andProjectIdNotBetween(Long value1, Long value2) { + addCriterion("project_id not between", value1, value2, "projectId"); + return (Criteria) this; + } + + public Criteria andFloorIdIsNull() { + addCriterion("floor_id is null"); + return (Criteria) this; + } + + public Criteria andFloorIdIsNotNull() { + addCriterion("floor_id is not null"); + return (Criteria) this; + } + + public Criteria andFloorIdEqualTo(Long value) { + addCriterion("floor_id =", value, "floorId"); + return (Criteria) this; + } + + public Criteria andFloorIdNotEqualTo(Long value) { + addCriterion("floor_id <>", value, "floorId"); + return (Criteria) this; + } + + public Criteria andFloorIdGreaterThan(Long value) { + addCriterion("floor_id >", value, "floorId"); + return (Criteria) this; + } + + public Criteria andFloorIdGreaterThanOrEqualTo(Long value) { + addCriterion("floor_id >=", value, "floorId"); + return (Criteria) this; + } + + public Criteria andFloorIdLessThan(Long value) { + addCriterion("floor_id <", value, "floorId"); + return (Criteria) this; + } + + public Criteria andFloorIdLessThanOrEqualTo(Long value) { + addCriterion("floor_id <=", value, "floorId"); + return (Criteria) this; + } + + public Criteria andFloorIdIn(List values) { + addCriterion("floor_id in", values, "floorId"); + return (Criteria) this; + } + + public Criteria andFloorIdNotIn(List values) { + addCriterion("floor_id not in", values, "floorId"); + return (Criteria) this; + } + + public Criteria andFloorIdBetween(Long value1, Long value2) { + addCriterion("floor_id between", value1, value2, "floorId"); + return (Criteria) this; + } + + public Criteria andFloorIdNotBetween(Long value1, Long value2) { + addCriterion("floor_id not between", value1, value2, "floorId"); + return (Criteria) this; + } + + public Criteria andMonitoringPointNameIsNull() { + addCriterion("monitoring_point_name is null"); + return (Criteria) this; + } + + public Criteria andMonitoringPointNameIsNotNull() { + addCriterion("monitoring_point_name is not null"); + return (Criteria) this; + } + + public Criteria andMonitoringPointNameEqualTo(String value) { + addCriterion("monitoring_point_name =", value, "monitoringPointName"); + return (Criteria) this; + } + + public Criteria andMonitoringPointNameNotEqualTo(String value) { + addCriterion("monitoring_point_name <>", value, "monitoringPointName"); + return (Criteria) this; + } + + public Criteria andMonitoringPointNameGreaterThan(String value) { + addCriterion("monitoring_point_name >", value, "monitoringPointName"); + return (Criteria) this; + } + + public Criteria andMonitoringPointNameGreaterThanOrEqualTo(String value) { + addCriterion("monitoring_point_name >=", value, "monitoringPointName"); + return (Criteria) this; + } + + public Criteria andMonitoringPointNameLessThan(String value) { + addCriterion("monitoring_point_name <", value, "monitoringPointName"); + return (Criteria) this; + } + + public Criteria andMonitoringPointNameLessThanOrEqualTo(String value) { + addCriterion("monitoring_point_name <=", value, "monitoringPointName"); + return (Criteria) this; + } + + public Criteria andMonitoringPointNameLike(String value) { + addCriterion("monitoring_point_name like", value, "monitoringPointName"); + return (Criteria) this; + } + + public Criteria andMonitoringPointNameNotLike(String value) { + addCriterion("monitoring_point_name not like", value, "monitoringPointName"); + return (Criteria) this; + } + + public Criteria andMonitoringPointNameIn(List values) { + addCriterion("monitoring_point_name in", values, "monitoringPointName"); + return (Criteria) this; + } + + public Criteria andMonitoringPointNameNotIn(List values) { + addCriterion("monitoring_point_name not in", values, "monitoringPointName"); + return (Criteria) this; + } + + public Criteria andMonitoringPointNameBetween(String value1, String value2) { + addCriterion("monitoring_point_name between", value1, value2, "monitoringPointName"); + return (Criteria) this; + } + + public Criteria andMonitoringPointNameNotBetween(String value1, String value2) { + addCriterion("monitoring_point_name not between", value1, value2, "monitoringPointName"); + return (Criteria) this; + } + + public Criteria andMonitoringPointCategoryIdIsNull() { + addCriterion("monitoring_point_category_id is null"); + return (Criteria) this; + } + + public Criteria andMonitoringPointCategoryIdIsNotNull() { + addCriterion("monitoring_point_category_id is not null"); + return (Criteria) this; + } + + public Criteria andMonitoringPointCategoryIdEqualTo(Long value) { + addCriterion("monitoring_point_category_id =", value, "monitoringPointCategoryId"); + return (Criteria) this; + } + + public Criteria andMonitoringPointCategoryIdNotEqualTo(Long value) { + addCriterion("monitoring_point_category_id <>", value, "monitoringPointCategoryId"); + return (Criteria) this; + } + + public Criteria andMonitoringPointCategoryIdGreaterThan(Long value) { + addCriterion("monitoring_point_category_id >", value, "monitoringPointCategoryId"); + return (Criteria) this; + } + + public Criteria andMonitoringPointCategoryIdGreaterThanOrEqualTo(Long value) { + addCriterion("monitoring_point_category_id >=", value, "monitoringPointCategoryId"); + return (Criteria) this; + } + + public Criteria andMonitoringPointCategoryIdLessThan(Long value) { + addCriterion("monitoring_point_category_id <", value, "monitoringPointCategoryId"); + return (Criteria) this; + } + + public Criteria andMonitoringPointCategoryIdLessThanOrEqualTo(Long value) { + addCriterion("monitoring_point_category_id <=", value, "monitoringPointCategoryId"); + return (Criteria) this; + } + + public Criteria andMonitoringPointCategoryIdIn(List values) { + addCriterion("monitoring_point_category_id in", values, "monitoringPointCategoryId"); + return (Criteria) this; + } + + public Criteria andMonitoringPointCategoryIdNotIn(List values) { + addCriterion("monitoring_point_category_id not in", values, "monitoringPointCategoryId"); + return (Criteria) this; + } + + public Criteria andMonitoringPointCategoryIdBetween(Long value1, Long value2) { + addCriterion("monitoring_point_category_id between", value1, value2, "monitoringPointCategoryId"); + return (Criteria) this; + } + + public Criteria andMonitoringPointCategoryIdNotBetween(Long value1, Long value2) { + addCriterion("monitoring_point_category_id not between", value1, value2, "monitoringPointCategoryId"); + return (Criteria) this; + } + + public Criteria andDataProviderIdIsNull() { + addCriterion("data_provider_id is null"); + return (Criteria) this; + } + + public Criteria andDataProviderIdIsNotNull() { + addCriterion("data_provider_id is not null"); + return (Criteria) this; + } + + public Criteria andDataProviderIdEqualTo(Long value) { + addCriterion("data_provider_id =", value, "dataProviderId"); + return (Criteria) this; + } + + public Criteria andDataProviderIdNotEqualTo(Long value) { + addCriterion("data_provider_id <>", value, "dataProviderId"); + return (Criteria) this; + } + + public Criteria andDataProviderIdGreaterThan(Long value) { + addCriterion("data_provider_id >", value, "dataProviderId"); + return (Criteria) this; + } + + public Criteria andDataProviderIdGreaterThanOrEqualTo(Long value) { + addCriterion("data_provider_id >=", value, "dataProviderId"); + return (Criteria) this; + } + + public Criteria andDataProviderIdLessThan(Long value) { + addCriterion("data_provider_id <", value, "dataProviderId"); + return (Criteria) this; + } + + public Criteria andDataProviderIdLessThanOrEqualTo(Long value) { + addCriterion("data_provider_id <=", value, "dataProviderId"); + return (Criteria) this; + } + + public Criteria andDataProviderIdIn(List values) { + addCriterion("data_provider_id in", values, "dataProviderId"); + return (Criteria) this; + } + + public Criteria andDataProviderIdNotIn(List values) { + addCriterion("data_provider_id not in", values, "dataProviderId"); + return (Criteria) this; + } + + public Criteria andDataProviderIdBetween(Long value1, Long value2) { + addCriterion("data_provider_id between", value1, value2, "dataProviderId"); + return (Criteria) this; + } + + public Criteria andDataProviderIdNotBetween(Long value1, Long value2) { + addCriterion("data_provider_id not between", value1, value2, "dataProviderId"); + return (Criteria) this; + } + + public Criteria andGatewayInfoIdIsNull() { + addCriterion("gateway_info_id is null"); + return (Criteria) this; + } + + public Criteria andGatewayInfoIdIsNotNull() { + addCriterion("gateway_info_id is not null"); + return (Criteria) this; + } + + public Criteria andGatewayInfoIdEqualTo(Long value) { + addCriterion("gateway_info_id =", value, "gatewayInfoId"); + return (Criteria) this; + } + + public Criteria andGatewayInfoIdNotEqualTo(Long value) { + addCriterion("gateway_info_id <>", value, "gatewayInfoId"); + return (Criteria) this; + } + + public Criteria andGatewayInfoIdGreaterThan(Long value) { + addCriterion("gateway_info_id >", value, "gatewayInfoId"); + return (Criteria) this; + } + + public Criteria andGatewayInfoIdGreaterThanOrEqualTo(Long value) { + addCriterion("gateway_info_id >=", value, "gatewayInfoId"); + return (Criteria) this; + } + + public Criteria andGatewayInfoIdLessThan(Long value) { + addCriterion("gateway_info_id <", value, "gatewayInfoId"); + return (Criteria) this; + } + + public Criteria andGatewayInfoIdLessThanOrEqualTo(Long value) { + addCriterion("gateway_info_id <=", value, "gatewayInfoId"); + return (Criteria) this; + } + + public Criteria andGatewayInfoIdIn(List values) { + addCriterion("gateway_info_id in", values, "gatewayInfoId"); + return (Criteria) this; + } + + public Criteria andGatewayInfoIdNotIn(List values) { + addCriterion("gateway_info_id not in", values, "gatewayInfoId"); + return (Criteria) this; + } + + public Criteria andGatewayInfoIdBetween(Long value1, Long value2) { + addCriterion("gateway_info_id between", value1, value2, "gatewayInfoId"); + return (Criteria) this; + } + + public Criteria andGatewayInfoIdNotBetween(Long value1, Long value2) { + addCriterion("gateway_info_id not between", value1, value2, "gatewayInfoId"); + return (Criteria) this; + } + + public Criteria andAlarmLevelIsNull() { + addCriterion("alarm_level is null"); + return (Criteria) this; + } + + public Criteria andAlarmLevelIsNotNull() { + addCriterion("alarm_level is not null"); + return (Criteria) this; + } + + public Criteria andAlarmLevelEqualTo(Integer value) { + addCriterion("alarm_level =", value, "alarmLevel"); + return (Criteria) this; + } + + public Criteria andAlarmLevelNotEqualTo(Integer value) { + addCriterion("alarm_level <>", value, "alarmLevel"); + return (Criteria) this; + } + + public Criteria andAlarmLevelGreaterThan(Integer value) { + addCriterion("alarm_level >", value, "alarmLevel"); + return (Criteria) this; + } + + public Criteria andAlarmLevelGreaterThanOrEqualTo(Integer value) { + addCriterion("alarm_level >=", value, "alarmLevel"); + return (Criteria) this; + } + + public Criteria andAlarmLevelLessThan(Integer value) { + addCriterion("alarm_level <", value, "alarmLevel"); + return (Criteria) this; + } + + public Criteria andAlarmLevelLessThanOrEqualTo(Integer value) { + addCriterion("alarm_level <=", value, "alarmLevel"); + return (Criteria) this; + } + + public Criteria andAlarmLevelIn(List values) { + addCriterion("alarm_level in", values, "alarmLevel"); + return (Criteria) this; + } + + public Criteria andAlarmLevelNotIn(List values) { + addCriterion("alarm_level not in", values, "alarmLevel"); + return (Criteria) this; + } + + public Criteria andAlarmLevelBetween(Integer value1, Integer value2) { + addCriterion("alarm_level between", value1, value2, "alarmLevel"); + return (Criteria) this; + } + + public Criteria andAlarmLevelNotBetween(Integer value1, Integer value2) { + addCriterion("alarm_level not between", value1, value2, "alarmLevel"); + return (Criteria) this; + } + + public Criteria andRetainAlertIsNull() { + addCriterion("retain_alert is null"); + return (Criteria) this; + } + + public Criteria andRetainAlertIsNotNull() { + addCriterion("retain_alert is not null"); + return (Criteria) this; + } + + public Criteria andRetainAlertEqualTo(Integer value) { + addCriterion("retain_alert =", value, "retainAlert"); + return (Criteria) this; + } + + public Criteria andRetainAlertNotEqualTo(Integer value) { + addCriterion("retain_alert <>", value, "retainAlert"); + return (Criteria) this; + } + + public Criteria andRetainAlertGreaterThan(Integer value) { + addCriterion("retain_alert >", value, "retainAlert"); + return (Criteria) this; + } + + public Criteria andRetainAlertGreaterThanOrEqualTo(Integer value) { + addCriterion("retain_alert >=", value, "retainAlert"); + return (Criteria) this; + } + + public Criteria andRetainAlertLessThan(Integer value) { + addCriterion("retain_alert <", value, "retainAlert"); + return (Criteria) this; + } + + public Criteria andRetainAlertLessThanOrEqualTo(Integer value) { + addCriterion("retain_alert <=", value, "retainAlert"); + return (Criteria) this; + } + + public Criteria andRetainAlertIn(List values) { + addCriterion("retain_alert in", values, "retainAlert"); + return (Criteria) this; + } + + public Criteria andRetainAlertNotIn(List values) { + addCriterion("retain_alert not in", values, "retainAlert"); + return (Criteria) this; + } + + public Criteria andRetainAlertBetween(Integer value1, Integer value2) { + addCriterion("retain_alert between", value1, value2, "retainAlert"); + return (Criteria) this; + } + + public Criteria andRetainAlertNotBetween(Integer value1, Integer value2) { + addCriterion("retain_alert not between", value1, value2, "retainAlert"); + return (Criteria) this; + } + } + + /** + * This class was generated by MyBatis Generator. + * This class corresponds to the database table device_info + * + * @mbg.generated do_not_delete_during_merge + */ + public static class Criteria extends GeneratedCriteria { + + protected Criteria() { + super(); + } + } + + /** + * This class was generated by MyBatis Generator. + * This class corresponds to the database table device_info + * + * @mbg.generated + */ + public static class Criterion { + private String condition; + + private Object value; + + private Object secondValue; + + private boolean noValue; + + private boolean singleValue; + + private boolean betweenValue; + + private boolean listValue; + + private String typeHandler; + + public String getCondition() { + return condition; + } + + public Object getValue() { + return value; + } + + public Object getSecondValue() { + return secondValue; + } + + public boolean isNoValue() { + return noValue; + } + + public boolean isSingleValue() { + return singleValue; + } + + public boolean isBetweenValue() { + return betweenValue; + } + + public boolean isListValue() { + return listValue; + } + + public String getTypeHandler() { + return typeHandler; + } + + protected Criterion(String condition) { + super(); + this.condition = condition; + this.typeHandler = null; + this.noValue = true; + } + + protected Criterion(String condition, Object value, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.typeHandler = typeHandler; + if (value instanceof List) { + this.listValue = true; + } else { + this.singleValue = true; + } + } + + protected Criterion(String condition, Object value) { + this(condition, value, null); + } + + protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.secondValue = secondValue; + this.typeHandler = typeHandler; + this.betweenValue = true; + } + + protected Criterion(String condition, Object value, Object secondValue) { + this(condition, value, secondValue, null); + } + } +} \ No newline at end of file diff --git a/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/model/DeviceRawdataRealtime.java b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/model/DeviceRawdataRealtime.java new file mode 100644 index 0000000..c30f549 --- /dev/null +++ b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/model/DeviceRawdataRealtime.java @@ -0,0 +1,438 @@ +package com.dongjian.dashboard.back.model; + +import java.io.Serializable; + +public class DeviceRawdataRealtime implements Serializable { + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column device_rawdata_realtime.device_id + * + * @mbg.generated + */ + private String deviceId; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column device_rawdata_realtime.building_id + * + * @mbg.generated + */ + private Long buildingId; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column device_rawdata_realtime.status + * + * @mbg.generated + */ + private String status; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column device_rawdata_realtime.receive_ts + * + * @mbg.generated + */ + private Long receiveTs; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column device_rawdata_realtime.alert_title + * + * @mbg.generated + */ + private String alertTitle; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column device_rawdata_realtime.alert_cancel_title + * + * @mbg.generated + */ + private String alertCancelTitle; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column device_rawdata_realtime.upload_year + * + * @mbg.generated + */ + private Integer uploadYear; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column device_rawdata_realtime.upload_month + * + * @mbg.generated + */ + private Integer uploadMonth; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column device_rawdata_realtime.upload_day + * + * @mbg.generated + */ + private Integer uploadDay; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column device_rawdata_realtime.alert_content + * + * @mbg.generated + */ + private String alertContent; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column device_rawdata_realtime.alert_cancel_content + * + * @mbg.generated + */ + private String alertCancelContent; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column device_rawdata_realtime.raw_data + * + * @mbg.generated + */ + private String rawData; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database table device_rawdata_realtime + * + * @mbg.generated + */ + private static final long serialVersionUID = 1L; + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column device_rawdata_realtime.device_id + * + * @return the value of device_rawdata_realtime.device_id + * + * @mbg.generated + */ + public String getDeviceId() { + return deviceId; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column device_rawdata_realtime.device_id + * + * @param deviceId the value for device_rawdata_realtime.device_id + * + * @mbg.generated + */ + public void setDeviceId(String deviceId) { + this.deviceId = deviceId == null ? null : deviceId.trim(); + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column device_rawdata_realtime.building_id + * + * @return the value of device_rawdata_realtime.building_id + * + * @mbg.generated + */ + public Long getBuildingId() { + return buildingId; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column device_rawdata_realtime.building_id + * + * @param buildingId the value for device_rawdata_realtime.building_id + * + * @mbg.generated + */ + public void setBuildingId(Long buildingId) { + this.buildingId = buildingId; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column device_rawdata_realtime.status + * + * @return the value of device_rawdata_realtime.status + * + * @mbg.generated + */ + public String getStatus() { + return status; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column device_rawdata_realtime.status + * + * @param status the value for device_rawdata_realtime.status + * + * @mbg.generated + */ + public void setStatus(String status) { + this.status = status == null ? null : status.trim(); + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column device_rawdata_realtime.receive_ts + * + * @return the value of device_rawdata_realtime.receive_ts + * + * @mbg.generated + */ + public Long getReceiveTs() { + return receiveTs; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column device_rawdata_realtime.receive_ts + * + * @param receiveTs the value for device_rawdata_realtime.receive_ts + * + * @mbg.generated + */ + public void setReceiveTs(Long receiveTs) { + this.receiveTs = receiveTs; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column device_rawdata_realtime.alert_title + * + * @return the value of device_rawdata_realtime.alert_title + * + * @mbg.generated + */ + public String getAlertTitle() { + return alertTitle; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column device_rawdata_realtime.alert_title + * + * @param alertTitle the value for device_rawdata_realtime.alert_title + * + * @mbg.generated + */ + public void setAlertTitle(String alertTitle) { + this.alertTitle = alertTitle == null ? null : alertTitle.trim(); + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column device_rawdata_realtime.alert_cancel_title + * + * @return the value of device_rawdata_realtime.alert_cancel_title + * + * @mbg.generated + */ + public String getAlertCancelTitle() { + return alertCancelTitle; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column device_rawdata_realtime.alert_cancel_title + * + * @param alertCancelTitle the value for device_rawdata_realtime.alert_cancel_title + * + * @mbg.generated + */ + public void setAlertCancelTitle(String alertCancelTitle) { + this.alertCancelTitle = alertCancelTitle == null ? null : alertCancelTitle.trim(); + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column device_rawdata_realtime.upload_year + * + * @return the value of device_rawdata_realtime.upload_year + * + * @mbg.generated + */ + public Integer getUploadYear() { + return uploadYear; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column device_rawdata_realtime.upload_year + * + * @param uploadYear the value for device_rawdata_realtime.upload_year + * + * @mbg.generated + */ + public void setUploadYear(Integer uploadYear) { + this.uploadYear = uploadYear; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column device_rawdata_realtime.upload_month + * + * @return the value of device_rawdata_realtime.upload_month + * + * @mbg.generated + */ + public Integer getUploadMonth() { + return uploadMonth; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column device_rawdata_realtime.upload_month + * + * @param uploadMonth the value for device_rawdata_realtime.upload_month + * + * @mbg.generated + */ + public void setUploadMonth(Integer uploadMonth) { + this.uploadMonth = uploadMonth; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column device_rawdata_realtime.upload_day + * + * @return the value of device_rawdata_realtime.upload_day + * + * @mbg.generated + */ + public Integer getUploadDay() { + return uploadDay; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column device_rawdata_realtime.upload_day + * + * @param uploadDay the value for device_rawdata_realtime.upload_day + * + * @mbg.generated + */ + public void setUploadDay(Integer uploadDay) { + this.uploadDay = uploadDay; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column device_rawdata_realtime.alert_content + * + * @return the value of device_rawdata_realtime.alert_content + * + * @mbg.generated + */ + public String getAlertContent() { + return alertContent; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column device_rawdata_realtime.alert_content + * + * @param alertContent the value for device_rawdata_realtime.alert_content + * + * @mbg.generated + */ + public void setAlertContent(String alertContent) { + this.alertContent = alertContent == null ? null : alertContent.trim(); + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column device_rawdata_realtime.alert_cancel_content + * + * @return the value of device_rawdata_realtime.alert_cancel_content + * + * @mbg.generated + */ + public String getAlertCancelContent() { + return alertCancelContent; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column device_rawdata_realtime.alert_cancel_content + * + * @param alertCancelContent the value for device_rawdata_realtime.alert_cancel_content + * + * @mbg.generated + */ + public void setAlertCancelContent(String alertCancelContent) { + this.alertCancelContent = alertCancelContent == null ? null : alertCancelContent.trim(); + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column device_rawdata_realtime.raw_data + * + * @return the value of device_rawdata_realtime.raw_data + * + * @mbg.generated + */ + public String getRawData() { + return rawData; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column device_rawdata_realtime.raw_data + * + * @param rawData the value for device_rawdata_realtime.raw_data + * + * @mbg.generated + */ + public void setRawData(String rawData) { + this.rawData = rawData == null ? null : rawData.trim(); + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table device_rawdata_realtime + * + * @mbg.generated + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append(getClass().getSimpleName()); + sb.append(" ["); + sb.append("Hash = ").append(hashCode()); + sb.append(", deviceId=").append(deviceId); + sb.append(", buildingId=").append(buildingId); + sb.append(", status=").append(status); + sb.append(", receiveTs=").append(receiveTs); + sb.append(", alertTitle=").append(alertTitle); + sb.append(", alertCancelTitle=").append(alertCancelTitle); + sb.append(", uploadYear=").append(uploadYear); + sb.append(", uploadMonth=").append(uploadMonth); + sb.append(", uploadDay=").append(uploadDay); + sb.append(", alertContent=").append(alertContent); + sb.append(", alertCancelContent=").append(alertCancelContent); + sb.append(", rawData=").append(rawData); + sb.append(", serialVersionUID=").append(serialVersionUID); + sb.append("]"); + return sb.toString(); + } +} \ No newline at end of file diff --git a/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/model/DeviceRawdataRealtimeExample.java b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/model/DeviceRawdataRealtimeExample.java new file mode 100644 index 0000000..180dd57 --- /dev/null +++ b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/model/DeviceRawdataRealtimeExample.java @@ -0,0 +1,882 @@ +package com.dongjian.dashboard.back.model; + +import java.util.ArrayList; +import java.util.List; + +public class DeviceRawdataRealtimeExample { + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database table device_rawdata_realtime + * + * @mbg.generated + */ + protected String orderByClause; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database table device_rawdata_realtime + * + * @mbg.generated + */ + protected boolean distinct; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database table device_rawdata_realtime + * + * @mbg.generated + */ + protected List oredCriteria; + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table device_rawdata_realtime + * + * @mbg.generated + */ + public DeviceRawdataRealtimeExample() { + oredCriteria = new ArrayList(); + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table device_rawdata_realtime + * + * @mbg.generated + */ + public void setOrderByClause(String orderByClause) { + this.orderByClause = orderByClause; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table device_rawdata_realtime + * + * @mbg.generated + */ + public String getOrderByClause() { + return orderByClause; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table device_rawdata_realtime + * + * @mbg.generated + */ + public void setDistinct(boolean distinct) { + this.distinct = distinct; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table device_rawdata_realtime + * + * @mbg.generated + */ + public boolean isDistinct() { + return distinct; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table device_rawdata_realtime + * + * @mbg.generated + */ + public List getOredCriteria() { + return oredCriteria; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table device_rawdata_realtime + * + * @mbg.generated + */ + public void or(Criteria criteria) { + oredCriteria.add(criteria); + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table device_rawdata_realtime + * + * @mbg.generated + */ + public Criteria or() { + Criteria criteria = createCriteriaInternal(); + oredCriteria.add(criteria); + return criteria; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table device_rawdata_realtime + * + * @mbg.generated + */ + public Criteria createCriteria() { + Criteria criteria = createCriteriaInternal(); + if (oredCriteria.size() == 0) { + oredCriteria.add(criteria); + } + return criteria; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table device_rawdata_realtime + * + * @mbg.generated + */ + protected Criteria createCriteriaInternal() { + Criteria criteria = new Criteria(); + return criteria; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table device_rawdata_realtime + * + * @mbg.generated + */ + public void clear() { + oredCriteria.clear(); + orderByClause = null; + distinct = false; + } + + /** + * This class was generated by MyBatis Generator. + * This class corresponds to the database table device_rawdata_realtime + * + * @mbg.generated + */ + protected abstract static class GeneratedCriteria { + protected List criteria; + + protected GeneratedCriteria() { + super(); + criteria = new ArrayList(); + } + + public boolean isValid() { + return criteria.size() > 0; + } + + public List getAllCriteria() { + return criteria; + } + + public List getCriteria() { + return criteria; + } + + protected void addCriterion(String condition) { + if (condition == null) { + throw new RuntimeException("Value for condition cannot be null"); + } + criteria.add(new Criterion(condition)); + } + + protected void addCriterion(String condition, Object value, String property) { + if (value == null) { + throw new RuntimeException("Value for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value)); + } + + protected void addCriterion(String condition, Object value1, Object value2, String property) { + if (value1 == null || value2 == null) { + throw new RuntimeException("Between values for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value1, value2)); + } + + public Criteria andDeviceIdIsNull() { + addCriterion("device_id is null"); + return (Criteria) this; + } + + public Criteria andDeviceIdIsNotNull() { + addCriterion("device_id is not null"); + return (Criteria) this; + } + + public Criteria andDeviceIdEqualTo(String value) { + addCriterion("device_id =", value, "deviceId"); + return (Criteria) this; + } + + public Criteria andDeviceIdNotEqualTo(String value) { + addCriterion("device_id <>", value, "deviceId"); + return (Criteria) this; + } + + public Criteria andDeviceIdGreaterThan(String value) { + addCriterion("device_id >", value, "deviceId"); + return (Criteria) this; + } + + public Criteria andDeviceIdGreaterThanOrEqualTo(String value) { + addCriterion("device_id >=", value, "deviceId"); + return (Criteria) this; + } + + public Criteria andDeviceIdLessThan(String value) { + addCriterion("device_id <", value, "deviceId"); + return (Criteria) this; + } + + public Criteria andDeviceIdLessThanOrEqualTo(String value) { + addCriterion("device_id <=", value, "deviceId"); + return (Criteria) this; + } + + public Criteria andDeviceIdLike(String value) { + addCriterion("device_id like", value, "deviceId"); + return (Criteria) this; + } + + public Criteria andDeviceIdNotLike(String value) { + addCriterion("device_id not like", value, "deviceId"); + return (Criteria) this; + } + + public Criteria andDeviceIdIn(List values) { + addCriterion("device_id in", values, "deviceId"); + return (Criteria) this; + } + + public Criteria andDeviceIdNotIn(List values) { + addCriterion("device_id not in", values, "deviceId"); + return (Criteria) this; + } + + public Criteria andDeviceIdBetween(String value1, String value2) { + addCriterion("device_id between", value1, value2, "deviceId"); + return (Criteria) this; + } + + public Criteria andDeviceIdNotBetween(String value1, String value2) { + addCriterion("device_id not between", value1, value2, "deviceId"); + return (Criteria) this; + } + + public Criteria andBuildingIdIsNull() { + addCriterion("building_id is null"); + return (Criteria) this; + } + + public Criteria andBuildingIdIsNotNull() { + addCriterion("building_id is not null"); + return (Criteria) this; + } + + public Criteria andBuildingIdEqualTo(Long value) { + addCriterion("building_id =", value, "buildingId"); + return (Criteria) this; + } + + public Criteria andBuildingIdNotEqualTo(Long value) { + addCriterion("building_id <>", value, "buildingId"); + return (Criteria) this; + } + + public Criteria andBuildingIdGreaterThan(Long value) { + addCriterion("building_id >", value, "buildingId"); + return (Criteria) this; + } + + public Criteria andBuildingIdGreaterThanOrEqualTo(Long value) { + addCriterion("building_id >=", value, "buildingId"); + return (Criteria) this; + } + + public Criteria andBuildingIdLessThan(Long value) { + addCriterion("building_id <", value, "buildingId"); + return (Criteria) this; + } + + public Criteria andBuildingIdLessThanOrEqualTo(Long value) { + addCriterion("building_id <=", value, "buildingId"); + return (Criteria) this; + } + + public Criteria andBuildingIdIn(List values) { + addCriterion("building_id in", values, "buildingId"); + return (Criteria) this; + } + + public Criteria andBuildingIdNotIn(List values) { + addCriterion("building_id not in", values, "buildingId"); + return (Criteria) this; + } + + public Criteria andBuildingIdBetween(Long value1, Long value2) { + addCriterion("building_id between", value1, value2, "buildingId"); + return (Criteria) this; + } + + public Criteria andBuildingIdNotBetween(Long value1, Long value2) { + addCriterion("building_id not between", value1, value2, "buildingId"); + return (Criteria) this; + } + + public Criteria andStatusIsNull() { + addCriterion("`status` is null"); + return (Criteria) this; + } + + public Criteria andStatusIsNotNull() { + addCriterion("`status` is not null"); + return (Criteria) this; + } + + public Criteria andStatusEqualTo(String value) { + addCriterion("`status` =", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusNotEqualTo(String value) { + addCriterion("`status` <>", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusGreaterThan(String value) { + addCriterion("`status` >", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusGreaterThanOrEqualTo(String value) { + addCriterion("`status` >=", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusLessThan(String value) { + addCriterion("`status` <", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusLessThanOrEqualTo(String value) { + addCriterion("`status` <=", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusLike(String value) { + addCriterion("`status` like", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusNotLike(String value) { + addCriterion("`status` not like", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusIn(List values) { + addCriterion("`status` in", values, "status"); + return (Criteria) this; + } + + public Criteria andStatusNotIn(List values) { + addCriterion("`status` not in", values, "status"); + return (Criteria) this; + } + + public Criteria andStatusBetween(String value1, String value2) { + addCriterion("`status` between", value1, value2, "status"); + return (Criteria) this; + } + + public Criteria andStatusNotBetween(String value1, String value2) { + addCriterion("`status` not between", value1, value2, "status"); + return (Criteria) this; + } + + public Criteria andReceiveTsIsNull() { + addCriterion("receive_ts is null"); + return (Criteria) this; + } + + public Criteria andReceiveTsIsNotNull() { + addCriterion("receive_ts is not null"); + return (Criteria) this; + } + + public Criteria andReceiveTsEqualTo(Long value) { + addCriterion("receive_ts =", value, "receiveTs"); + return (Criteria) this; + } + + public Criteria andReceiveTsNotEqualTo(Long value) { + addCriterion("receive_ts <>", value, "receiveTs"); + return (Criteria) this; + } + + public Criteria andReceiveTsGreaterThan(Long value) { + addCriterion("receive_ts >", value, "receiveTs"); + return (Criteria) this; + } + + public Criteria andReceiveTsGreaterThanOrEqualTo(Long value) { + addCriterion("receive_ts >=", value, "receiveTs"); + return (Criteria) this; + } + + public Criteria andReceiveTsLessThan(Long value) { + addCriterion("receive_ts <", value, "receiveTs"); + return (Criteria) this; + } + + public Criteria andReceiveTsLessThanOrEqualTo(Long value) { + addCriterion("receive_ts <=", value, "receiveTs"); + return (Criteria) this; + } + + public Criteria andReceiveTsIn(List values) { + addCriterion("receive_ts in", values, "receiveTs"); + return (Criteria) this; + } + + public Criteria andReceiveTsNotIn(List values) { + addCriterion("receive_ts not in", values, "receiveTs"); + return (Criteria) this; + } + + public Criteria andReceiveTsBetween(Long value1, Long value2) { + addCriterion("receive_ts between", value1, value2, "receiveTs"); + return (Criteria) this; + } + + public Criteria andReceiveTsNotBetween(Long value1, Long value2) { + addCriterion("receive_ts not between", value1, value2, "receiveTs"); + return (Criteria) this; + } + + public Criteria andAlertTitleIsNull() { + addCriterion("alert_title is null"); + return (Criteria) this; + } + + public Criteria andAlertTitleIsNotNull() { + addCriterion("alert_title is not null"); + return (Criteria) this; + } + + public Criteria andAlertTitleEqualTo(String value) { + addCriterion("alert_title =", value, "alertTitle"); + return (Criteria) this; + } + + public Criteria andAlertTitleNotEqualTo(String value) { + addCriterion("alert_title <>", value, "alertTitle"); + return (Criteria) this; + } + + public Criteria andAlertTitleGreaterThan(String value) { + addCriterion("alert_title >", value, "alertTitle"); + return (Criteria) this; + } + + public Criteria andAlertTitleGreaterThanOrEqualTo(String value) { + addCriterion("alert_title >=", value, "alertTitle"); + return (Criteria) this; + } + + public Criteria andAlertTitleLessThan(String value) { + addCriterion("alert_title <", value, "alertTitle"); + return (Criteria) this; + } + + public Criteria andAlertTitleLessThanOrEqualTo(String value) { + addCriterion("alert_title <=", value, "alertTitle"); + return (Criteria) this; + } + + public Criteria andAlertTitleLike(String value) { + addCriterion("alert_title like", value, "alertTitle"); + return (Criteria) this; + } + + public Criteria andAlertTitleNotLike(String value) { + addCriterion("alert_title not like", value, "alertTitle"); + return (Criteria) this; + } + + public Criteria andAlertTitleIn(List values) { + addCriterion("alert_title in", values, "alertTitle"); + return (Criteria) this; + } + + public Criteria andAlertTitleNotIn(List values) { + addCriterion("alert_title not in", values, "alertTitle"); + return (Criteria) this; + } + + public Criteria andAlertTitleBetween(String value1, String value2) { + addCriterion("alert_title between", value1, value2, "alertTitle"); + return (Criteria) this; + } + + public Criteria andAlertTitleNotBetween(String value1, String value2) { + addCriterion("alert_title not between", value1, value2, "alertTitle"); + return (Criteria) this; + } + + public Criteria andAlertCancelTitleIsNull() { + addCriterion("alert_cancel_title is null"); + return (Criteria) this; + } + + public Criteria andAlertCancelTitleIsNotNull() { + addCriterion("alert_cancel_title is not null"); + return (Criteria) this; + } + + public Criteria andAlertCancelTitleEqualTo(String value) { + addCriterion("alert_cancel_title =", value, "alertCancelTitle"); + return (Criteria) this; + } + + public Criteria andAlertCancelTitleNotEqualTo(String value) { + addCriterion("alert_cancel_title <>", value, "alertCancelTitle"); + return (Criteria) this; + } + + public Criteria andAlertCancelTitleGreaterThan(String value) { + addCriterion("alert_cancel_title >", value, "alertCancelTitle"); + return (Criteria) this; + } + + public Criteria andAlertCancelTitleGreaterThanOrEqualTo(String value) { + addCriterion("alert_cancel_title >=", value, "alertCancelTitle"); + return (Criteria) this; + } + + public Criteria andAlertCancelTitleLessThan(String value) { + addCriterion("alert_cancel_title <", value, "alertCancelTitle"); + return (Criteria) this; + } + + public Criteria andAlertCancelTitleLessThanOrEqualTo(String value) { + addCriterion("alert_cancel_title <=", value, "alertCancelTitle"); + return (Criteria) this; + } + + public Criteria andAlertCancelTitleLike(String value) { + addCriterion("alert_cancel_title like", value, "alertCancelTitle"); + return (Criteria) this; + } + + public Criteria andAlertCancelTitleNotLike(String value) { + addCriterion("alert_cancel_title not like", value, "alertCancelTitle"); + return (Criteria) this; + } + + public Criteria andAlertCancelTitleIn(List values) { + addCriterion("alert_cancel_title in", values, "alertCancelTitle"); + return (Criteria) this; + } + + public Criteria andAlertCancelTitleNotIn(List values) { + addCriterion("alert_cancel_title not in", values, "alertCancelTitle"); + return (Criteria) this; + } + + public Criteria andAlertCancelTitleBetween(String value1, String value2) { + addCriterion("alert_cancel_title between", value1, value2, "alertCancelTitle"); + return (Criteria) this; + } + + public Criteria andAlertCancelTitleNotBetween(String value1, String value2) { + addCriterion("alert_cancel_title not between", value1, value2, "alertCancelTitle"); + return (Criteria) this; + } + + public Criteria andUploadYearIsNull() { + addCriterion("upload_year is null"); + return (Criteria) this; + } + + public Criteria andUploadYearIsNotNull() { + addCriterion("upload_year is not null"); + return (Criteria) this; + } + + public Criteria andUploadYearEqualTo(Integer value) { + addCriterion("upload_year =", value, "uploadYear"); + return (Criteria) this; + } + + public Criteria andUploadYearNotEqualTo(Integer value) { + addCriterion("upload_year <>", value, "uploadYear"); + return (Criteria) this; + } + + public Criteria andUploadYearGreaterThan(Integer value) { + addCriterion("upload_year >", value, "uploadYear"); + return (Criteria) this; + } + + public Criteria andUploadYearGreaterThanOrEqualTo(Integer value) { + addCriterion("upload_year >=", value, "uploadYear"); + return (Criteria) this; + } + + public Criteria andUploadYearLessThan(Integer value) { + addCriterion("upload_year <", value, "uploadYear"); + return (Criteria) this; + } + + public Criteria andUploadYearLessThanOrEqualTo(Integer value) { + addCriterion("upload_year <=", value, "uploadYear"); + return (Criteria) this; + } + + public Criteria andUploadYearIn(List values) { + addCriterion("upload_year in", values, "uploadYear"); + return (Criteria) this; + } + + public Criteria andUploadYearNotIn(List values) { + addCriterion("upload_year not in", values, "uploadYear"); + return (Criteria) this; + } + + public Criteria andUploadYearBetween(Integer value1, Integer value2) { + addCriterion("upload_year between", value1, value2, "uploadYear"); + return (Criteria) this; + } + + public Criteria andUploadYearNotBetween(Integer value1, Integer value2) { + addCriterion("upload_year not between", value1, value2, "uploadYear"); + return (Criteria) this; + } + + public Criteria andUploadMonthIsNull() { + addCriterion("upload_month is null"); + return (Criteria) this; + } + + public Criteria andUploadMonthIsNotNull() { + addCriterion("upload_month is not null"); + return (Criteria) this; + } + + public Criteria andUploadMonthEqualTo(Integer value) { + addCriterion("upload_month =", value, "uploadMonth"); + return (Criteria) this; + } + + public Criteria andUploadMonthNotEqualTo(Integer value) { + addCriterion("upload_month <>", value, "uploadMonth"); + return (Criteria) this; + } + + public Criteria andUploadMonthGreaterThan(Integer value) { + addCriterion("upload_month >", value, "uploadMonth"); + return (Criteria) this; + } + + public Criteria andUploadMonthGreaterThanOrEqualTo(Integer value) { + addCriterion("upload_month >=", value, "uploadMonth"); + return (Criteria) this; + } + + public Criteria andUploadMonthLessThan(Integer value) { + addCriterion("upload_month <", value, "uploadMonth"); + return (Criteria) this; + } + + public Criteria andUploadMonthLessThanOrEqualTo(Integer value) { + addCriterion("upload_month <=", value, "uploadMonth"); + return (Criteria) this; + } + + public Criteria andUploadMonthIn(List values) { + addCriterion("upload_month in", values, "uploadMonth"); + return (Criteria) this; + } + + public Criteria andUploadMonthNotIn(List values) { + addCriterion("upload_month not in", values, "uploadMonth"); + return (Criteria) this; + } + + public Criteria andUploadMonthBetween(Integer value1, Integer value2) { + addCriterion("upload_month between", value1, value2, "uploadMonth"); + return (Criteria) this; + } + + public Criteria andUploadMonthNotBetween(Integer value1, Integer value2) { + addCriterion("upload_month not between", value1, value2, "uploadMonth"); + return (Criteria) this; + } + + public Criteria andUploadDayIsNull() { + addCriterion("upload_day is null"); + return (Criteria) this; + } + + public Criteria andUploadDayIsNotNull() { + addCriterion("upload_day is not null"); + return (Criteria) this; + } + + public Criteria andUploadDayEqualTo(Integer value) { + addCriterion("upload_day =", value, "uploadDay"); + return (Criteria) this; + } + + public Criteria andUploadDayNotEqualTo(Integer value) { + addCriterion("upload_day <>", value, "uploadDay"); + return (Criteria) this; + } + + public Criteria andUploadDayGreaterThan(Integer value) { + addCriterion("upload_day >", value, "uploadDay"); + return (Criteria) this; + } + + public Criteria andUploadDayGreaterThanOrEqualTo(Integer value) { + addCriterion("upload_day >=", value, "uploadDay"); + return (Criteria) this; + } + + public Criteria andUploadDayLessThan(Integer value) { + addCriterion("upload_day <", value, "uploadDay"); + return (Criteria) this; + } + + public Criteria andUploadDayLessThanOrEqualTo(Integer value) { + addCriterion("upload_day <=", value, "uploadDay"); + return (Criteria) this; + } + + public Criteria andUploadDayIn(List values) { + addCriterion("upload_day in", values, "uploadDay"); + return (Criteria) this; + } + + public Criteria andUploadDayNotIn(List values) { + addCriterion("upload_day not in", values, "uploadDay"); + return (Criteria) this; + } + + public Criteria andUploadDayBetween(Integer value1, Integer value2) { + addCriterion("upload_day between", value1, value2, "uploadDay"); + return (Criteria) this; + } + + public Criteria andUploadDayNotBetween(Integer value1, Integer value2) { + addCriterion("upload_day not between", value1, value2, "uploadDay"); + return (Criteria) this; + } + } + + /** + * This class was generated by MyBatis Generator. + * This class corresponds to the database table device_rawdata_realtime + * + * @mbg.generated do_not_delete_during_merge + */ + public static class Criteria extends GeneratedCriteria { + + protected Criteria() { + super(); + } + } + + /** + * This class was generated by MyBatis Generator. + * This class corresponds to the database table device_rawdata_realtime + * + * @mbg.generated + */ + public static class Criterion { + private String condition; + + private Object value; + + private Object secondValue; + + private boolean noValue; + + private boolean singleValue; + + private boolean betweenValue; + + private boolean listValue; + + private String typeHandler; + + public String getCondition() { + return condition; + } + + public Object getValue() { + return value; + } + + public Object getSecondValue() { + return secondValue; + } + + public boolean isNoValue() { + return noValue; + } + + public boolean isSingleValue() { + return singleValue; + } + + public boolean isBetweenValue() { + return betweenValue; + } + + public boolean isListValue() { + return listValue; + } + + public String getTypeHandler() { + return typeHandler; + } + + protected Criterion(String condition) { + super(); + this.condition = condition; + this.typeHandler = null; + this.noValue = true; + } + + protected Criterion(String condition, Object value, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.typeHandler = typeHandler; + if (value instanceof List) { + this.listValue = true; + } else { + this.singleValue = true; + } + } + + protected Criterion(String condition, Object value) { + this(condition, value, null); + } + + protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.secondValue = secondValue; + this.typeHandler = typeHandler; + this.betweenValue = true; + } + + protected Criterion(String condition, Object value, Object secondValue) { + this(condition, value, secondValue, null); + } + } +} \ No newline at end of file diff --git a/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/model/FavoritedDevice.java b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/model/FavoritedDevice.java new file mode 100644 index 0000000..577c41c --- /dev/null +++ b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/model/FavoritedDevice.java @@ -0,0 +1,98 @@ +package com.dongjian.dashboard.back.model; + +import java.io.Serializable; + +public class FavoritedDevice implements Serializable { + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column favorited_device.device_id + * + * @mbg.generated + */ + private String deviceId; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column favorited_device.create_at + * + * @mbg.generated + */ + private Long createAt; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database table favorited_device + * + * @mbg.generated + */ + private static final long serialVersionUID = 1L; + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column favorited_device.device_id + * + * @return the value of favorited_device.device_id + * + * @mbg.generated + */ + public String getDeviceId() { + return deviceId; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column favorited_device.device_id + * + * @param deviceId the value for favorited_device.device_id + * + * @mbg.generated + */ + public void setDeviceId(String deviceId) { + this.deviceId = deviceId == null ? null : deviceId.trim(); + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column favorited_device.create_at + * + * @return the value of favorited_device.create_at + * + * @mbg.generated + */ + public Long getCreateAt() { + return createAt; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column favorited_device.create_at + * + * @param createAt the value for favorited_device.create_at + * + * @mbg.generated + */ + public void setCreateAt(Long createAt) { + this.createAt = createAt; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table favorited_device + * + * @mbg.generated + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append(getClass().getSimpleName()); + sb.append(" ["); + sb.append("Hash = ").append(hashCode()); + sb.append(", deviceId=").append(deviceId); + sb.append(", createAt=").append(createAt); + sb.append(", serialVersionUID=").append(serialVersionUID); + sb.append("]"); + return sb.toString(); + } +} \ No newline at end of file diff --git a/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/model/FavoritedDeviceExample.java b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/model/FavoritedDeviceExample.java new file mode 100644 index 0000000..320f66f --- /dev/null +++ b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/model/FavoritedDeviceExample.java @@ -0,0 +1,432 @@ +package com.dongjian.dashboard.back.model; + +import java.util.ArrayList; +import java.util.List; + +public class FavoritedDeviceExample { + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database table favorited_device + * + * @mbg.generated + */ + protected String orderByClause; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database table favorited_device + * + * @mbg.generated + */ + protected boolean distinct; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database table favorited_device + * + * @mbg.generated + */ + protected List oredCriteria; + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table favorited_device + * + * @mbg.generated + */ + public FavoritedDeviceExample() { + oredCriteria = new ArrayList(); + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table favorited_device + * + * @mbg.generated + */ + public void setOrderByClause(String orderByClause) { + this.orderByClause = orderByClause; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table favorited_device + * + * @mbg.generated + */ + public String getOrderByClause() { + return orderByClause; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table favorited_device + * + * @mbg.generated + */ + public void setDistinct(boolean distinct) { + this.distinct = distinct; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table favorited_device + * + * @mbg.generated + */ + public boolean isDistinct() { + return distinct; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table favorited_device + * + * @mbg.generated + */ + public List getOredCriteria() { + return oredCriteria; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table favorited_device + * + * @mbg.generated + */ + public void or(Criteria criteria) { + oredCriteria.add(criteria); + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table favorited_device + * + * @mbg.generated + */ + public Criteria or() { + Criteria criteria = createCriteriaInternal(); + oredCriteria.add(criteria); + return criteria; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table favorited_device + * + * @mbg.generated + */ + public Criteria createCriteria() { + Criteria criteria = createCriteriaInternal(); + if (oredCriteria.size() == 0) { + oredCriteria.add(criteria); + } + return criteria; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table favorited_device + * + * @mbg.generated + */ + protected Criteria createCriteriaInternal() { + Criteria criteria = new Criteria(); + return criteria; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table favorited_device + * + * @mbg.generated + */ + public void clear() { + oredCriteria.clear(); + orderByClause = null; + distinct = false; + } + + /** + * This class was generated by MyBatis Generator. + * This class corresponds to the database table favorited_device + * + * @mbg.generated + */ + protected abstract static class GeneratedCriteria { + protected List criteria; + + protected GeneratedCriteria() { + super(); + criteria = new ArrayList(); + } + + public boolean isValid() { + return criteria.size() > 0; + } + + public List getAllCriteria() { + return criteria; + } + + public List getCriteria() { + return criteria; + } + + protected void addCriterion(String condition) { + if (condition == null) { + throw new RuntimeException("Value for condition cannot be null"); + } + criteria.add(new Criterion(condition)); + } + + protected void addCriterion(String condition, Object value, String property) { + if (value == null) { + throw new RuntimeException("Value for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value)); + } + + protected void addCriterion(String condition, Object value1, Object value2, String property) { + if (value1 == null || value2 == null) { + throw new RuntimeException("Between values for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value1, value2)); + } + + public Criteria andDeviceIdIsNull() { + addCriterion("device_id is null"); + return (Criteria) this; + } + + public Criteria andDeviceIdIsNotNull() { + addCriterion("device_id is not null"); + return (Criteria) this; + } + + public Criteria andDeviceIdEqualTo(String value) { + addCriterion("device_id =", value, "deviceId"); + return (Criteria) this; + } + + public Criteria andDeviceIdNotEqualTo(String value) { + addCriterion("device_id <>", value, "deviceId"); + return (Criteria) this; + } + + public Criteria andDeviceIdGreaterThan(String value) { + addCriterion("device_id >", value, "deviceId"); + return (Criteria) this; + } + + public Criteria andDeviceIdGreaterThanOrEqualTo(String value) { + addCriterion("device_id >=", value, "deviceId"); + return (Criteria) this; + } + + public Criteria andDeviceIdLessThan(String value) { + addCriterion("device_id <", value, "deviceId"); + return (Criteria) this; + } + + public Criteria andDeviceIdLessThanOrEqualTo(String value) { + addCriterion("device_id <=", value, "deviceId"); + return (Criteria) this; + } + + public Criteria andDeviceIdLike(String value) { + addCriterion("device_id like", value, "deviceId"); + return (Criteria) this; + } + + public Criteria andDeviceIdNotLike(String value) { + addCriterion("device_id not like", value, "deviceId"); + return (Criteria) this; + } + + public Criteria andDeviceIdIn(List values) { + addCriterion("device_id in", values, "deviceId"); + return (Criteria) this; + } + + public Criteria andDeviceIdNotIn(List values) { + addCriterion("device_id not in", values, "deviceId"); + return (Criteria) this; + } + + public Criteria andDeviceIdBetween(String value1, String value2) { + addCriterion("device_id between", value1, value2, "deviceId"); + return (Criteria) this; + } + + public Criteria andDeviceIdNotBetween(String value1, String value2) { + addCriterion("device_id not between", value1, value2, "deviceId"); + return (Criteria) this; + } + + public Criteria andCreateAtIsNull() { + addCriterion("create_at is null"); + return (Criteria) this; + } + + public Criteria andCreateAtIsNotNull() { + addCriterion("create_at is not null"); + return (Criteria) this; + } + + public Criteria andCreateAtEqualTo(Long value) { + addCriterion("create_at =", value, "createAt"); + return (Criteria) this; + } + + public Criteria andCreateAtNotEqualTo(Long value) { + addCriterion("create_at <>", value, "createAt"); + return (Criteria) this; + } + + public Criteria andCreateAtGreaterThan(Long value) { + addCriterion("create_at >", value, "createAt"); + return (Criteria) this; + } + + public Criteria andCreateAtGreaterThanOrEqualTo(Long value) { + addCriterion("create_at >=", value, "createAt"); + return (Criteria) this; + } + + public Criteria andCreateAtLessThan(Long value) { + addCriterion("create_at <", value, "createAt"); + return (Criteria) this; + } + + public Criteria andCreateAtLessThanOrEqualTo(Long value) { + addCriterion("create_at <=", value, "createAt"); + return (Criteria) this; + } + + public Criteria andCreateAtIn(List values) { + addCriterion("create_at in", values, "createAt"); + return (Criteria) this; + } + + public Criteria andCreateAtNotIn(List values) { + addCriterion("create_at not in", values, "createAt"); + return (Criteria) this; + } + + public Criteria andCreateAtBetween(Long value1, Long value2) { + addCriterion("create_at between", value1, value2, "createAt"); + return (Criteria) this; + } + + public Criteria andCreateAtNotBetween(Long value1, Long value2) { + addCriterion("create_at not between", value1, value2, "createAt"); + return (Criteria) this; + } + } + + /** + * This class was generated by MyBatis Generator. + * This class corresponds to the database table favorited_device + * + * @mbg.generated do_not_delete_during_merge + */ + public static class Criteria extends GeneratedCriteria { + + protected Criteria() { + super(); + } + } + + /** + * This class was generated by MyBatis Generator. + * This class corresponds to the database table favorited_device + * + * @mbg.generated + */ + public static class Criterion { + private String condition; + + private Object value; + + private Object secondValue; + + private boolean noValue; + + private boolean singleValue; + + private boolean betweenValue; + + private boolean listValue; + + private String typeHandler; + + public String getCondition() { + return condition; + } + + public Object getValue() { + return value; + } + + public Object getSecondValue() { + return secondValue; + } + + public boolean isNoValue() { + return noValue; + } + + public boolean isSingleValue() { + return singleValue; + } + + public boolean isBetweenValue() { + return betweenValue; + } + + public boolean isListValue() { + return listValue; + } + + public String getTypeHandler() { + return typeHandler; + } + + protected Criterion(String condition) { + super(); + this.condition = condition; + this.typeHandler = null; + this.noValue = true; + } + + protected Criterion(String condition, Object value, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.typeHandler = typeHandler; + if (value instanceof List) { + this.listValue = true; + } else { + this.singleValue = true; + } + } + + protected Criterion(String condition, Object value) { + this(condition, value, null); + } + + protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.secondValue = secondValue; + this.typeHandler = typeHandler; + this.betweenValue = true; + } + + protected Criterion(String condition, Object value, Object secondValue) { + this(condition, value, secondValue, null); + } + } +} \ No newline at end of file diff --git a/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/model/LoginHistory.java b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/model/LoginHistory.java new file mode 100644 index 0000000..d8aca8d --- /dev/null +++ b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/model/LoginHistory.java @@ -0,0 +1,166 @@ +package com.dongjian.dashboard.back.model; + +import java.io.Serializable; + +public class LoginHistory implements Serializable { + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column login_history.id + * + * @mbg.generated + */ + private Long id; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column login_history.user_id + * + * @mbg.generated + */ + private Long userId; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column login_history.request_ip + * + * @mbg.generated + */ + private String requestIp; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column login_history.login_time + * + * @mbg.generated + */ + private Long loginTime; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database table login_history + * + * @mbg.generated + */ + private static final long serialVersionUID = 1L; + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column login_history.id + * + * @return the value of login_history.id + * + * @mbg.generated + */ + public Long getId() { + return id; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column login_history.id + * + * @param id the value for login_history.id + * + * @mbg.generated + */ + public void setId(Long id) { + this.id = id; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column login_history.user_id + * + * @return the value of login_history.user_id + * + * @mbg.generated + */ + public Long getUserId() { + return userId; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column login_history.user_id + * + * @param userId the value for login_history.user_id + * + * @mbg.generated + */ + public void setUserId(Long userId) { + this.userId = userId; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column login_history.request_ip + * + * @return the value of login_history.request_ip + * + * @mbg.generated + */ + public String getRequestIp() { + return requestIp; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column login_history.request_ip + * + * @param requestIp the value for login_history.request_ip + * + * @mbg.generated + */ + public void setRequestIp(String requestIp) { + this.requestIp = requestIp == null ? null : requestIp.trim(); + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column login_history.login_time + * + * @return the value of login_history.login_time + * + * @mbg.generated + */ + public Long getLoginTime() { + return loginTime; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column login_history.login_time + * + * @param loginTime the value for login_history.login_time + * + * @mbg.generated + */ + public void setLoginTime(Long loginTime) { + this.loginTime = loginTime; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table login_history + * + * @mbg.generated + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append(getClass().getSimpleName()); + sb.append(" ["); + sb.append("Hash = ").append(hashCode()); + sb.append(", id=").append(id); + sb.append(", userId=").append(userId); + sb.append(", requestIp=").append(requestIp); + sb.append(", loginTime=").append(loginTime); + sb.append(", serialVersionUID=").append(serialVersionUID); + sb.append("]"); + return sb.toString(); + } +} \ No newline at end of file diff --git a/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/model/LoginHistoryExample.java b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/model/LoginHistoryExample.java new file mode 100644 index 0000000..d88b4be --- /dev/null +++ b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/model/LoginHistoryExample.java @@ -0,0 +1,552 @@ +package com.dongjian.dashboard.back.model; + +import java.util.ArrayList; +import java.util.List; + +public class LoginHistoryExample { + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database table login_history + * + * @mbg.generated + */ + protected String orderByClause; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database table login_history + * + * @mbg.generated + */ + protected boolean distinct; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database table login_history + * + * @mbg.generated + */ + protected List oredCriteria; + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table login_history + * + * @mbg.generated + */ + public LoginHistoryExample() { + oredCriteria = new ArrayList(); + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table login_history + * + * @mbg.generated + */ + public void setOrderByClause(String orderByClause) { + this.orderByClause = orderByClause; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table login_history + * + * @mbg.generated + */ + public String getOrderByClause() { + return orderByClause; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table login_history + * + * @mbg.generated + */ + public void setDistinct(boolean distinct) { + this.distinct = distinct; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table login_history + * + * @mbg.generated + */ + public boolean isDistinct() { + return distinct; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table login_history + * + * @mbg.generated + */ + public List getOredCriteria() { + return oredCriteria; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table login_history + * + * @mbg.generated + */ + public void or(Criteria criteria) { + oredCriteria.add(criteria); + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table login_history + * + * @mbg.generated + */ + public Criteria or() { + Criteria criteria = createCriteriaInternal(); + oredCriteria.add(criteria); + return criteria; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table login_history + * + * @mbg.generated + */ + public Criteria createCriteria() { + Criteria criteria = createCriteriaInternal(); + if (oredCriteria.size() == 0) { + oredCriteria.add(criteria); + } + return criteria; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table login_history + * + * @mbg.generated + */ + protected Criteria createCriteriaInternal() { + Criteria criteria = new Criteria(); + return criteria; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table login_history + * + * @mbg.generated + */ + public void clear() { + oredCriteria.clear(); + orderByClause = null; + distinct = false; + } + + /** + * This class was generated by MyBatis Generator. + * This class corresponds to the database table login_history + * + * @mbg.generated + */ + protected abstract static class GeneratedCriteria { + protected List criteria; + + protected GeneratedCriteria() { + super(); + criteria = new ArrayList(); + } + + public boolean isValid() { + return criteria.size() > 0; + } + + public List getAllCriteria() { + return criteria; + } + + public List getCriteria() { + return criteria; + } + + protected void addCriterion(String condition) { + if (condition == null) { + throw new RuntimeException("Value for condition cannot be null"); + } + criteria.add(new Criterion(condition)); + } + + protected void addCriterion(String condition, Object value, String property) { + if (value == null) { + throw new RuntimeException("Value for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value)); + } + + protected void addCriterion(String condition, Object value1, Object value2, String property) { + if (value1 == null || value2 == null) { + throw new RuntimeException("Between values for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value1, value2)); + } + + public Criteria andIdIsNull() { + addCriterion("id is null"); + return (Criteria) this; + } + + public Criteria andIdIsNotNull() { + addCriterion("id is not null"); + return (Criteria) this; + } + + public Criteria andIdEqualTo(Long value) { + addCriterion("id =", value, "id"); + return (Criteria) this; + } + + public Criteria andIdNotEqualTo(Long value) { + addCriterion("id <>", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThan(Long value) { + addCriterion("id >", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThanOrEqualTo(Long value) { + addCriterion("id >=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThan(Long value) { + addCriterion("id <", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThanOrEqualTo(Long value) { + addCriterion("id <=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdIn(List values) { + addCriterion("id in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdNotIn(List values) { + addCriterion("id not in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdBetween(Long value1, Long value2) { + addCriterion("id between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andIdNotBetween(Long value1, Long value2) { + addCriterion("id not between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andUserIdIsNull() { + addCriterion("user_id is null"); + return (Criteria) this; + } + + public Criteria andUserIdIsNotNull() { + addCriterion("user_id is not null"); + return (Criteria) this; + } + + public Criteria andUserIdEqualTo(Long value) { + addCriterion("user_id =", value, "userId"); + return (Criteria) this; + } + + public Criteria andUserIdNotEqualTo(Long value) { + addCriterion("user_id <>", value, "userId"); + return (Criteria) this; + } + + public Criteria andUserIdGreaterThan(Long value) { + addCriterion("user_id >", value, "userId"); + return (Criteria) this; + } + + public Criteria andUserIdGreaterThanOrEqualTo(Long value) { + addCriterion("user_id >=", value, "userId"); + return (Criteria) this; + } + + public Criteria andUserIdLessThan(Long value) { + addCriterion("user_id <", value, "userId"); + return (Criteria) this; + } + + public Criteria andUserIdLessThanOrEqualTo(Long value) { + addCriterion("user_id <=", value, "userId"); + return (Criteria) this; + } + + public Criteria andUserIdIn(List values) { + addCriterion("user_id in", values, "userId"); + return (Criteria) this; + } + + public Criteria andUserIdNotIn(List values) { + addCriterion("user_id not in", values, "userId"); + return (Criteria) this; + } + + public Criteria andUserIdBetween(Long value1, Long value2) { + addCriterion("user_id between", value1, value2, "userId"); + return (Criteria) this; + } + + public Criteria andUserIdNotBetween(Long value1, Long value2) { + addCriterion("user_id not between", value1, value2, "userId"); + return (Criteria) this; + } + + public Criteria andRequestIpIsNull() { + addCriterion("request_ip is null"); + return (Criteria) this; + } + + public Criteria andRequestIpIsNotNull() { + addCriterion("request_ip is not null"); + return (Criteria) this; + } + + public Criteria andRequestIpEqualTo(String value) { + addCriterion("request_ip =", value, "requestIp"); + return (Criteria) this; + } + + public Criteria andRequestIpNotEqualTo(String value) { + addCriterion("request_ip <>", value, "requestIp"); + return (Criteria) this; + } + + public Criteria andRequestIpGreaterThan(String value) { + addCriterion("request_ip >", value, "requestIp"); + return (Criteria) this; + } + + public Criteria andRequestIpGreaterThanOrEqualTo(String value) { + addCriterion("request_ip >=", value, "requestIp"); + return (Criteria) this; + } + + public Criteria andRequestIpLessThan(String value) { + addCriterion("request_ip <", value, "requestIp"); + return (Criteria) this; + } + + public Criteria andRequestIpLessThanOrEqualTo(String value) { + addCriterion("request_ip <=", value, "requestIp"); + return (Criteria) this; + } + + public Criteria andRequestIpLike(String value) { + addCriterion("request_ip like", value, "requestIp"); + return (Criteria) this; + } + + public Criteria andRequestIpNotLike(String value) { + addCriterion("request_ip not like", value, "requestIp"); + return (Criteria) this; + } + + public Criteria andRequestIpIn(List values) { + addCriterion("request_ip in", values, "requestIp"); + return (Criteria) this; + } + + public Criteria andRequestIpNotIn(List values) { + addCriterion("request_ip not in", values, "requestIp"); + return (Criteria) this; + } + + public Criteria andRequestIpBetween(String value1, String value2) { + addCriterion("request_ip between", value1, value2, "requestIp"); + return (Criteria) this; + } + + public Criteria andRequestIpNotBetween(String value1, String value2) { + addCriterion("request_ip not between", value1, value2, "requestIp"); + return (Criteria) this; + } + + public Criteria andLoginTimeIsNull() { + addCriterion("login_time is null"); + return (Criteria) this; + } + + public Criteria andLoginTimeIsNotNull() { + addCriterion("login_time is not null"); + return (Criteria) this; + } + + public Criteria andLoginTimeEqualTo(Long value) { + addCriterion("login_time =", value, "loginTime"); + return (Criteria) this; + } + + public Criteria andLoginTimeNotEqualTo(Long value) { + addCriterion("login_time <>", value, "loginTime"); + return (Criteria) this; + } + + public Criteria andLoginTimeGreaterThan(Long value) { + addCriterion("login_time >", value, "loginTime"); + return (Criteria) this; + } + + public Criteria andLoginTimeGreaterThanOrEqualTo(Long value) { + addCriterion("login_time >=", value, "loginTime"); + return (Criteria) this; + } + + public Criteria andLoginTimeLessThan(Long value) { + addCriterion("login_time <", value, "loginTime"); + return (Criteria) this; + } + + public Criteria andLoginTimeLessThanOrEqualTo(Long value) { + addCriterion("login_time <=", value, "loginTime"); + return (Criteria) this; + } + + public Criteria andLoginTimeIn(List values) { + addCriterion("login_time in", values, "loginTime"); + return (Criteria) this; + } + + public Criteria andLoginTimeNotIn(List values) { + addCriterion("login_time not in", values, "loginTime"); + return (Criteria) this; + } + + public Criteria andLoginTimeBetween(Long value1, Long value2) { + addCriterion("login_time between", value1, value2, "loginTime"); + return (Criteria) this; + } + + public Criteria andLoginTimeNotBetween(Long value1, Long value2) { + addCriterion("login_time not between", value1, value2, "loginTime"); + return (Criteria) this; + } + } + + /** + * This class was generated by MyBatis Generator. + * This class corresponds to the database table login_history + * + * @mbg.generated do_not_delete_during_merge + */ + public static class Criteria extends GeneratedCriteria { + + protected Criteria() { + super(); + } + } + + /** + * This class was generated by MyBatis Generator. + * This class corresponds to the database table login_history + * + * @mbg.generated + */ + public static class Criterion { + private String condition; + + private Object value; + + private Object secondValue; + + private boolean noValue; + + private boolean singleValue; + + private boolean betweenValue; + + private boolean listValue; + + private String typeHandler; + + public String getCondition() { + return condition; + } + + public Object getValue() { + return value; + } + + public Object getSecondValue() { + return secondValue; + } + + public boolean isNoValue() { + return noValue; + } + + public boolean isSingleValue() { + return singleValue; + } + + public boolean isBetweenValue() { + return betweenValue; + } + + public boolean isListValue() { + return listValue; + } + + public String getTypeHandler() { + return typeHandler; + } + + protected Criterion(String condition) { + super(); + this.condition = condition; + this.typeHandler = null; + this.noValue = true; + } + + protected Criterion(String condition, Object value, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.typeHandler = typeHandler; + if (value instanceof List) { + this.listValue = true; + } else { + this.singleValue = true; + } + } + + protected Criterion(String condition, Object value) { + this(condition, value, null); + } + + protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.secondValue = secondValue; + this.typeHandler = typeHandler; + this.betweenValue = true; + } + + protected Criterion(String condition, Object value, Object secondValue) { + this(condition, value, secondValue, null); + } + } +} \ No newline at end of file diff --git a/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/model/MonitoringPointCategory.java b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/model/MonitoringPointCategory.java new file mode 100644 index 0000000..fff8a16 --- /dev/null +++ b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/model/MonitoringPointCategory.java @@ -0,0 +1,336 @@ +package com.dongjian.dashboard.back.model; + +import java.io.Serializable; + +public class MonitoringPointCategory implements Serializable { + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column monitoring_point_category.id + * + * @mbg.generated + */ + private Long id; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column monitoring_point_category.company_id + * + * @mbg.generated + */ + private Long companyId; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column monitoring_point_category.name + * + * @mbg.generated + */ + private String name; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column monitoring_point_category.remark + * + * @mbg.generated + */ + private String remark; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column monitoring_point_category.flag + * + * @mbg.generated + */ + private Integer flag; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column monitoring_point_category.created_by + * + * @mbg.generated + */ + private Long createdBy; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column monitoring_point_category.created_at + * + * @mbg.generated + */ + private Long createdAt; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column monitoring_point_category.thumbnail_normal_base64 + * + * @mbg.generated + */ + private String thumbnailNormalBase64; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column monitoring_point_category.thumbnail_alarm_base64 + * + * @mbg.generated + */ + private String thumbnailAlarmBase64; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database table monitoring_point_category + * + * @mbg.generated + */ + private static final long serialVersionUID = 1L; + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column monitoring_point_category.id + * + * @return the value of monitoring_point_category.id + * + * @mbg.generated + */ + public Long getId() { + return id; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column monitoring_point_category.id + * + * @param id the value for monitoring_point_category.id + * + * @mbg.generated + */ + public void setId(Long id) { + this.id = id; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column monitoring_point_category.company_id + * + * @return the value of monitoring_point_category.company_id + * + * @mbg.generated + */ + public Long getCompanyId() { + return companyId; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column monitoring_point_category.company_id + * + * @param companyId the value for monitoring_point_category.company_id + * + * @mbg.generated + */ + public void setCompanyId(Long companyId) { + this.companyId = companyId; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column monitoring_point_category.name + * + * @return the value of monitoring_point_category.name + * + * @mbg.generated + */ + public String getName() { + return name; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column monitoring_point_category.name + * + * @param name the value for monitoring_point_category.name + * + * @mbg.generated + */ + public void setName(String name) { + this.name = name == null ? null : name.trim(); + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column monitoring_point_category.remark + * + * @return the value of monitoring_point_category.remark + * + * @mbg.generated + */ + public String getRemark() { + return remark; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column monitoring_point_category.remark + * + * @param remark the value for monitoring_point_category.remark + * + * @mbg.generated + */ + public void setRemark(String remark) { + this.remark = remark == null ? null : remark.trim(); + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column monitoring_point_category.flag + * + * @return the value of monitoring_point_category.flag + * + * @mbg.generated + */ + public Integer getFlag() { + return flag; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column monitoring_point_category.flag + * + * @param flag the value for monitoring_point_category.flag + * + * @mbg.generated + */ + public void setFlag(Integer flag) { + this.flag = flag; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column monitoring_point_category.created_by + * + * @return the value of monitoring_point_category.created_by + * + * @mbg.generated + */ + public Long getCreatedBy() { + return createdBy; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column monitoring_point_category.created_by + * + * @param createdBy the value for monitoring_point_category.created_by + * + * @mbg.generated + */ + public void setCreatedBy(Long createdBy) { + this.createdBy = createdBy; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column monitoring_point_category.created_at + * + * @return the value of monitoring_point_category.created_at + * + * @mbg.generated + */ + public Long getCreatedAt() { + return createdAt; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column monitoring_point_category.created_at + * + * @param createdAt the value for monitoring_point_category.created_at + * + * @mbg.generated + */ + public void setCreatedAt(Long createdAt) { + this.createdAt = createdAt; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column monitoring_point_category.thumbnail_normal_base64 + * + * @return the value of monitoring_point_category.thumbnail_normal_base64 + * + * @mbg.generated + */ + public String getThumbnailNormalBase64() { + return thumbnailNormalBase64; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column monitoring_point_category.thumbnail_normal_base64 + * + * @param thumbnailNormalBase64 the value for monitoring_point_category.thumbnail_normal_base64 + * + * @mbg.generated + */ + public void setThumbnailNormalBase64(String thumbnailNormalBase64) { + this.thumbnailNormalBase64 = thumbnailNormalBase64 == null ? null : thumbnailNormalBase64.trim(); + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column monitoring_point_category.thumbnail_alarm_base64 + * + * @return the value of monitoring_point_category.thumbnail_alarm_base64 + * + * @mbg.generated + */ + public String getThumbnailAlarmBase64() { + return thumbnailAlarmBase64; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column monitoring_point_category.thumbnail_alarm_base64 + * + * @param thumbnailAlarmBase64 the value for monitoring_point_category.thumbnail_alarm_base64 + * + * @mbg.generated + */ + public void setThumbnailAlarmBase64(String thumbnailAlarmBase64) { + this.thumbnailAlarmBase64 = thumbnailAlarmBase64 == null ? null : thumbnailAlarmBase64.trim(); + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table monitoring_point_category + * + * @mbg.generated + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append(getClass().getSimpleName()); + sb.append(" ["); + sb.append("Hash = ").append(hashCode()); + sb.append(", id=").append(id); + sb.append(", companyId=").append(companyId); + sb.append(", name=").append(name); + sb.append(", remark=").append(remark); + sb.append(", flag=").append(flag); + sb.append(", createdBy=").append(createdBy); + sb.append(", createdAt=").append(createdAt); + sb.append(", thumbnailNormalBase64=").append(thumbnailNormalBase64); + sb.append(", thumbnailAlarmBase64=").append(thumbnailAlarmBase64); + sb.append(", serialVersionUID=").append(serialVersionUID); + sb.append("]"); + return sb.toString(); + } +} \ No newline at end of file diff --git a/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/model/MonitoringPointCategoryExample.java b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/model/MonitoringPointCategoryExample.java new file mode 100644 index 0000000..7570a31 --- /dev/null +++ b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/model/MonitoringPointCategoryExample.java @@ -0,0 +1,742 @@ +package com.dongjian.dashboard.back.model; + +import java.util.ArrayList; +import java.util.List; + +public class MonitoringPointCategoryExample { + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database table monitoring_point_category + * + * @mbg.generated + */ + protected String orderByClause; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database table monitoring_point_category + * + * @mbg.generated + */ + protected boolean distinct; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database table monitoring_point_category + * + * @mbg.generated + */ + protected List oredCriteria; + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table monitoring_point_category + * + * @mbg.generated + */ + public MonitoringPointCategoryExample() { + oredCriteria = new ArrayList(); + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table monitoring_point_category + * + * @mbg.generated + */ + public void setOrderByClause(String orderByClause) { + this.orderByClause = orderByClause; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table monitoring_point_category + * + * @mbg.generated + */ + public String getOrderByClause() { + return orderByClause; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table monitoring_point_category + * + * @mbg.generated + */ + public void setDistinct(boolean distinct) { + this.distinct = distinct; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table monitoring_point_category + * + * @mbg.generated + */ + public boolean isDistinct() { + return distinct; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table monitoring_point_category + * + * @mbg.generated + */ + public List getOredCriteria() { + return oredCriteria; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table monitoring_point_category + * + * @mbg.generated + */ + public void or(Criteria criteria) { + oredCriteria.add(criteria); + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table monitoring_point_category + * + * @mbg.generated + */ + public Criteria or() { + Criteria criteria = createCriteriaInternal(); + oredCriteria.add(criteria); + return criteria; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table monitoring_point_category + * + * @mbg.generated + */ + public Criteria createCriteria() { + Criteria criteria = createCriteriaInternal(); + if (oredCriteria.size() == 0) { + oredCriteria.add(criteria); + } + return criteria; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table monitoring_point_category + * + * @mbg.generated + */ + protected Criteria createCriteriaInternal() { + Criteria criteria = new Criteria(); + return criteria; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table monitoring_point_category + * + * @mbg.generated + */ + public void clear() { + oredCriteria.clear(); + orderByClause = null; + distinct = false; + } + + /** + * This class was generated by MyBatis Generator. + * This class corresponds to the database table monitoring_point_category + * + * @mbg.generated + */ + protected abstract static class GeneratedCriteria { + protected List criteria; + + protected GeneratedCriteria() { + super(); + criteria = new ArrayList(); + } + + public boolean isValid() { + return criteria.size() > 0; + } + + public List getAllCriteria() { + return criteria; + } + + public List getCriteria() { + return criteria; + } + + protected void addCriterion(String condition) { + if (condition == null) { + throw new RuntimeException("Value for condition cannot be null"); + } + criteria.add(new Criterion(condition)); + } + + protected void addCriterion(String condition, Object value, String property) { + if (value == null) { + throw new RuntimeException("Value for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value)); + } + + protected void addCriterion(String condition, Object value1, Object value2, String property) { + if (value1 == null || value2 == null) { + throw new RuntimeException("Between values for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value1, value2)); + } + + public Criteria andIdIsNull() { + addCriterion("id is null"); + return (Criteria) this; + } + + public Criteria andIdIsNotNull() { + addCriterion("id is not null"); + return (Criteria) this; + } + + public Criteria andIdEqualTo(Long value) { + addCriterion("id =", value, "id"); + return (Criteria) this; + } + + public Criteria andIdNotEqualTo(Long value) { + addCriterion("id <>", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThan(Long value) { + addCriterion("id >", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThanOrEqualTo(Long value) { + addCriterion("id >=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThan(Long value) { + addCriterion("id <", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThanOrEqualTo(Long value) { + addCriterion("id <=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdIn(List values) { + addCriterion("id in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdNotIn(List values) { + addCriterion("id not in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdBetween(Long value1, Long value2) { + addCriterion("id between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andIdNotBetween(Long value1, Long value2) { + addCriterion("id not between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andCompanyIdIsNull() { + addCriterion("company_id is null"); + return (Criteria) this; + } + + public Criteria andCompanyIdIsNotNull() { + addCriterion("company_id is not null"); + return (Criteria) this; + } + + public Criteria andCompanyIdEqualTo(Long value) { + addCriterion("company_id =", value, "companyId"); + return (Criteria) this; + } + + public Criteria andCompanyIdNotEqualTo(Long value) { + addCriterion("company_id <>", value, "companyId"); + return (Criteria) this; + } + + public Criteria andCompanyIdGreaterThan(Long value) { + addCriterion("company_id >", value, "companyId"); + return (Criteria) this; + } + + public Criteria andCompanyIdGreaterThanOrEqualTo(Long value) { + addCriterion("company_id >=", value, "companyId"); + return (Criteria) this; + } + + public Criteria andCompanyIdLessThan(Long value) { + addCriterion("company_id <", value, "companyId"); + return (Criteria) this; + } + + public Criteria andCompanyIdLessThanOrEqualTo(Long value) { + addCriterion("company_id <=", value, "companyId"); + return (Criteria) this; + } + + public Criteria andCompanyIdIn(List values) { + addCriterion("company_id in", values, "companyId"); + return (Criteria) this; + } + + public Criteria andCompanyIdNotIn(List values) { + addCriterion("company_id not in", values, "companyId"); + return (Criteria) this; + } + + public Criteria andCompanyIdBetween(Long value1, Long value2) { + addCriterion("company_id between", value1, value2, "companyId"); + return (Criteria) this; + } + + public Criteria andCompanyIdNotBetween(Long value1, Long value2) { + addCriterion("company_id not between", value1, value2, "companyId"); + return (Criteria) this; + } + + public Criteria andNameIsNull() { + addCriterion("`name` is null"); + return (Criteria) this; + } + + public Criteria andNameIsNotNull() { + addCriterion("`name` is not null"); + return (Criteria) this; + } + + public Criteria andNameEqualTo(String value) { + addCriterion("`name` =", value, "name"); + return (Criteria) this; + } + + public Criteria andNameNotEqualTo(String value) { + addCriterion("`name` <>", value, "name"); + return (Criteria) this; + } + + public Criteria andNameGreaterThan(String value) { + addCriterion("`name` >", value, "name"); + return (Criteria) this; + } + + public Criteria andNameGreaterThanOrEqualTo(String value) { + addCriterion("`name` >=", value, "name"); + return (Criteria) this; + } + + public Criteria andNameLessThan(String value) { + addCriterion("`name` <", value, "name"); + return (Criteria) this; + } + + public Criteria andNameLessThanOrEqualTo(String value) { + addCriterion("`name` <=", value, "name"); + return (Criteria) this; + } + + public Criteria andNameLike(String value) { + addCriterion("`name` like", value, "name"); + return (Criteria) this; + } + + public Criteria andNameNotLike(String value) { + addCriterion("`name` not like", value, "name"); + return (Criteria) this; + } + + public Criteria andNameIn(List values) { + addCriterion("`name` in", values, "name"); + return (Criteria) this; + } + + public Criteria andNameNotIn(List values) { + addCriterion("`name` not in", values, "name"); + return (Criteria) this; + } + + public Criteria andNameBetween(String value1, String value2) { + addCriterion("`name` between", value1, value2, "name"); + return (Criteria) this; + } + + public Criteria andNameNotBetween(String value1, String value2) { + addCriterion("`name` not between", value1, value2, "name"); + return (Criteria) this; + } + + public Criteria andRemarkIsNull() { + addCriterion("remark is null"); + return (Criteria) this; + } + + public Criteria andRemarkIsNotNull() { + addCriterion("remark is not null"); + return (Criteria) this; + } + + public Criteria andRemarkEqualTo(String value) { + addCriterion("remark =", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkNotEqualTo(String value) { + addCriterion("remark <>", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkGreaterThan(String value) { + addCriterion("remark >", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkGreaterThanOrEqualTo(String value) { + addCriterion("remark >=", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkLessThan(String value) { + addCriterion("remark <", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkLessThanOrEqualTo(String value) { + addCriterion("remark <=", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkLike(String value) { + addCriterion("remark like", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkNotLike(String value) { + addCriterion("remark not like", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkIn(List values) { + addCriterion("remark in", values, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkNotIn(List values) { + addCriterion("remark not in", values, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkBetween(String value1, String value2) { + addCriterion("remark between", value1, value2, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkNotBetween(String value1, String value2) { + addCriterion("remark not between", value1, value2, "remark"); + return (Criteria) this; + } + + public Criteria andFlagIsNull() { + addCriterion("flag is null"); + return (Criteria) this; + } + + public Criteria andFlagIsNotNull() { + addCriterion("flag is not null"); + return (Criteria) this; + } + + public Criteria andFlagEqualTo(Integer value) { + addCriterion("flag =", value, "flag"); + return (Criteria) this; + } + + public Criteria andFlagNotEqualTo(Integer value) { + addCriterion("flag <>", value, "flag"); + return (Criteria) this; + } + + public Criteria andFlagGreaterThan(Integer value) { + addCriterion("flag >", value, "flag"); + return (Criteria) this; + } + + public Criteria andFlagGreaterThanOrEqualTo(Integer value) { + addCriterion("flag >=", value, "flag"); + return (Criteria) this; + } + + public Criteria andFlagLessThan(Integer value) { + addCriterion("flag <", value, "flag"); + return (Criteria) this; + } + + public Criteria andFlagLessThanOrEqualTo(Integer value) { + addCriterion("flag <=", value, "flag"); + return (Criteria) this; + } + + public Criteria andFlagIn(List values) { + addCriterion("flag in", values, "flag"); + return (Criteria) this; + } + + public Criteria andFlagNotIn(List values) { + addCriterion("flag not in", values, "flag"); + return (Criteria) this; + } + + public Criteria andFlagBetween(Integer value1, Integer value2) { + addCriterion("flag between", value1, value2, "flag"); + return (Criteria) this; + } + + public Criteria andFlagNotBetween(Integer value1, Integer value2) { + addCriterion("flag not between", value1, value2, "flag"); + return (Criteria) this; + } + + public Criteria andCreatedByIsNull() { + addCriterion("created_by is null"); + return (Criteria) this; + } + + public Criteria andCreatedByIsNotNull() { + addCriterion("created_by is not null"); + return (Criteria) this; + } + + public Criteria andCreatedByEqualTo(Long value) { + addCriterion("created_by =", value, "createdBy"); + return (Criteria) this; + } + + public Criteria andCreatedByNotEqualTo(Long value) { + addCriterion("created_by <>", value, "createdBy"); + return (Criteria) this; + } + + public Criteria andCreatedByGreaterThan(Long value) { + addCriterion("created_by >", value, "createdBy"); + return (Criteria) this; + } + + public Criteria andCreatedByGreaterThanOrEqualTo(Long value) { + addCriterion("created_by >=", value, "createdBy"); + return (Criteria) this; + } + + public Criteria andCreatedByLessThan(Long value) { + addCriterion("created_by <", value, "createdBy"); + return (Criteria) this; + } + + public Criteria andCreatedByLessThanOrEqualTo(Long value) { + addCriterion("created_by <=", value, "createdBy"); + return (Criteria) this; + } + + public Criteria andCreatedByIn(List values) { + addCriterion("created_by in", values, "createdBy"); + return (Criteria) this; + } + + public Criteria andCreatedByNotIn(List values) { + addCriterion("created_by not in", values, "createdBy"); + return (Criteria) this; + } + + public Criteria andCreatedByBetween(Long value1, Long value2) { + addCriterion("created_by between", value1, value2, "createdBy"); + return (Criteria) this; + } + + public Criteria andCreatedByNotBetween(Long value1, Long value2) { + addCriterion("created_by not between", value1, value2, "createdBy"); + return (Criteria) this; + } + + public Criteria andCreatedAtIsNull() { + addCriterion("created_at is null"); + return (Criteria) this; + } + + public Criteria andCreatedAtIsNotNull() { + addCriterion("created_at is not null"); + return (Criteria) this; + } + + public Criteria andCreatedAtEqualTo(Long value) { + addCriterion("created_at =", value, "createdAt"); + return (Criteria) this; + } + + public Criteria andCreatedAtNotEqualTo(Long value) { + addCriterion("created_at <>", value, "createdAt"); + return (Criteria) this; + } + + public Criteria andCreatedAtGreaterThan(Long value) { + addCriterion("created_at >", value, "createdAt"); + return (Criteria) this; + } + + public Criteria andCreatedAtGreaterThanOrEqualTo(Long value) { + addCriterion("created_at >=", value, "createdAt"); + return (Criteria) this; + } + + public Criteria andCreatedAtLessThan(Long value) { + addCriterion("created_at <", value, "createdAt"); + return (Criteria) this; + } + + public Criteria andCreatedAtLessThanOrEqualTo(Long value) { + addCriterion("created_at <=", value, "createdAt"); + return (Criteria) this; + } + + public Criteria andCreatedAtIn(List values) { + addCriterion("created_at in", values, "createdAt"); + return (Criteria) this; + } + + public Criteria andCreatedAtNotIn(List values) { + addCriterion("created_at not in", values, "createdAt"); + return (Criteria) this; + } + + public Criteria andCreatedAtBetween(Long value1, Long value2) { + addCriterion("created_at between", value1, value2, "createdAt"); + return (Criteria) this; + } + + public Criteria andCreatedAtNotBetween(Long value1, Long value2) { + addCriterion("created_at not between", value1, value2, "createdAt"); + return (Criteria) this; + } + } + + /** + * This class was generated by MyBatis Generator. + * This class corresponds to the database table monitoring_point_category + * + * @mbg.generated do_not_delete_during_merge + */ + public static class Criteria extends GeneratedCriteria { + + protected Criteria() { + super(); + } + } + + /** + * This class was generated by MyBatis Generator. + * This class corresponds to the database table monitoring_point_category + * + * @mbg.generated + */ + public static class Criterion { + private String condition; + + private Object value; + + private Object secondValue; + + private boolean noValue; + + private boolean singleValue; + + private boolean betweenValue; + + private boolean listValue; + + private String typeHandler; + + public String getCondition() { + return condition; + } + + public Object getValue() { + return value; + } + + public Object getSecondValue() { + return secondValue; + } + + public boolean isNoValue() { + return noValue; + } + + public boolean isSingleValue() { + return singleValue; + } + + public boolean isBetweenValue() { + return betweenValue; + } + + public boolean isListValue() { + return listValue; + } + + public String getTypeHandler() { + return typeHandler; + } + + protected Criterion(String condition) { + super(); + this.condition = condition; + this.typeHandler = null; + this.noValue = true; + } + + protected Criterion(String condition, Object value, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.typeHandler = typeHandler; + if (value instanceof List) { + this.listValue = true; + } else { + this.singleValue = true; + } + } + + protected Criterion(String condition, Object value) { + this(condition, value, null); + } + + protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.secondValue = secondValue; + this.typeHandler = typeHandler; + this.betweenValue = true; + } + + protected Criterion(String condition, Object value, Object secondValue) { + this(condition, value, secondValue, null); + } + } +} \ No newline at end of file diff --git a/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/model/MonitoringPointCategoryGroup.java b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/model/MonitoringPointCategoryGroup.java new file mode 100644 index 0000000..9a02e01 --- /dev/null +++ b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/model/MonitoringPointCategoryGroup.java @@ -0,0 +1,302 @@ +package com.dongjian.dashboard.back.model; + +import java.io.Serializable; + +public class MonitoringPointCategoryGroup implements Serializable { + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column monitoring_point_category_group.id + * + * @mbg.generated + */ + private Long id; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column monitoring_point_category_group.company_id + * + * @mbg.generated + */ + private Long companyId; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column monitoring_point_category_group.building_id + * + * @mbg.generated + */ + private Long buildingId; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column monitoring_point_category_group.name + * + * @mbg.generated + */ + private String name; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column monitoring_point_category_group.remark + * + * @mbg.generated + */ + private String remark; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column monitoring_point_category_group.flag + * + * @mbg.generated + */ + private Integer flag; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column monitoring_point_category_group.created_by + * + * @mbg.generated + */ + private Long createdBy; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column monitoring_point_category_group.created_at + * + * @mbg.generated + */ + private Long createdAt; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database table monitoring_point_category_group + * + * @mbg.generated + */ + private static final long serialVersionUID = 1L; + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column monitoring_point_category_group.id + * + * @return the value of monitoring_point_category_group.id + * + * @mbg.generated + */ + public Long getId() { + return id; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column monitoring_point_category_group.id + * + * @param id the value for monitoring_point_category_group.id + * + * @mbg.generated + */ + public void setId(Long id) { + this.id = id; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column monitoring_point_category_group.company_id + * + * @return the value of monitoring_point_category_group.company_id + * + * @mbg.generated + */ + public Long getCompanyId() { + return companyId; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column monitoring_point_category_group.company_id + * + * @param companyId the value for monitoring_point_category_group.company_id + * + * @mbg.generated + */ + public void setCompanyId(Long companyId) { + this.companyId = companyId; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column monitoring_point_category_group.building_id + * + * @return the value of monitoring_point_category_group.building_id + * + * @mbg.generated + */ + public Long getBuildingId() { + return buildingId; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column monitoring_point_category_group.building_id + * + * @param buildingId the value for monitoring_point_category_group.building_id + * + * @mbg.generated + */ + public void setBuildingId(Long buildingId) { + this.buildingId = buildingId; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column monitoring_point_category_group.name + * + * @return the value of monitoring_point_category_group.name + * + * @mbg.generated + */ + public String getName() { + return name; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column monitoring_point_category_group.name + * + * @param name the value for monitoring_point_category_group.name + * + * @mbg.generated + */ + public void setName(String name) { + this.name = name == null ? null : name.trim(); + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column monitoring_point_category_group.remark + * + * @return the value of monitoring_point_category_group.remark + * + * @mbg.generated + */ + public String getRemark() { + return remark; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column monitoring_point_category_group.remark + * + * @param remark the value for monitoring_point_category_group.remark + * + * @mbg.generated + */ + public void setRemark(String remark) { + this.remark = remark == null ? null : remark.trim(); + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column monitoring_point_category_group.flag + * + * @return the value of monitoring_point_category_group.flag + * + * @mbg.generated + */ + public Integer getFlag() { + return flag; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column monitoring_point_category_group.flag + * + * @param flag the value for monitoring_point_category_group.flag + * + * @mbg.generated + */ + public void setFlag(Integer flag) { + this.flag = flag; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column monitoring_point_category_group.created_by + * + * @return the value of monitoring_point_category_group.created_by + * + * @mbg.generated + */ + public Long getCreatedBy() { + return createdBy; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column monitoring_point_category_group.created_by + * + * @param createdBy the value for monitoring_point_category_group.created_by + * + * @mbg.generated + */ + public void setCreatedBy(Long createdBy) { + this.createdBy = createdBy; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column monitoring_point_category_group.created_at + * + * @return the value of monitoring_point_category_group.created_at + * + * @mbg.generated + */ + public Long getCreatedAt() { + return createdAt; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column monitoring_point_category_group.created_at + * + * @param createdAt the value for monitoring_point_category_group.created_at + * + * @mbg.generated + */ + public void setCreatedAt(Long createdAt) { + this.createdAt = createdAt; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table monitoring_point_category_group + * + * @mbg.generated + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append(getClass().getSimpleName()); + sb.append(" ["); + sb.append("Hash = ").append(hashCode()); + sb.append(", id=").append(id); + sb.append(", companyId=").append(companyId); + sb.append(", buildingId=").append(buildingId); + sb.append(", name=").append(name); + sb.append(", remark=").append(remark); + sb.append(", flag=").append(flag); + sb.append(", createdBy=").append(createdBy); + sb.append(", createdAt=").append(createdAt); + sb.append(", serialVersionUID=").append(serialVersionUID); + sb.append("]"); + return sb.toString(); + } +} \ No newline at end of file diff --git a/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/model/MonitoringPointCategoryGroupExample.java b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/model/MonitoringPointCategoryGroupExample.java new file mode 100644 index 0000000..433c583 --- /dev/null +++ b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/model/MonitoringPointCategoryGroupExample.java @@ -0,0 +1,802 @@ +package com.dongjian.dashboard.back.model; + +import java.util.ArrayList; +import java.util.List; + +public class MonitoringPointCategoryGroupExample { + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database table monitoring_point_category_group + * + * @mbg.generated + */ + protected String orderByClause; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database table monitoring_point_category_group + * + * @mbg.generated + */ + protected boolean distinct; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database table monitoring_point_category_group + * + * @mbg.generated + */ + protected List oredCriteria; + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table monitoring_point_category_group + * + * @mbg.generated + */ + public MonitoringPointCategoryGroupExample() { + oredCriteria = new ArrayList(); + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table monitoring_point_category_group + * + * @mbg.generated + */ + public void setOrderByClause(String orderByClause) { + this.orderByClause = orderByClause; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table monitoring_point_category_group + * + * @mbg.generated + */ + public String getOrderByClause() { + return orderByClause; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table monitoring_point_category_group + * + * @mbg.generated + */ + public void setDistinct(boolean distinct) { + this.distinct = distinct; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table monitoring_point_category_group + * + * @mbg.generated + */ + public boolean isDistinct() { + return distinct; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table monitoring_point_category_group + * + * @mbg.generated + */ + public List getOredCriteria() { + return oredCriteria; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table monitoring_point_category_group + * + * @mbg.generated + */ + public void or(Criteria criteria) { + oredCriteria.add(criteria); + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table monitoring_point_category_group + * + * @mbg.generated + */ + public Criteria or() { + Criteria criteria = createCriteriaInternal(); + oredCriteria.add(criteria); + return criteria; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table monitoring_point_category_group + * + * @mbg.generated + */ + public Criteria createCriteria() { + Criteria criteria = createCriteriaInternal(); + if (oredCriteria.size() == 0) { + oredCriteria.add(criteria); + } + return criteria; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table monitoring_point_category_group + * + * @mbg.generated + */ + protected Criteria createCriteriaInternal() { + Criteria criteria = new Criteria(); + return criteria; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table monitoring_point_category_group + * + * @mbg.generated + */ + public void clear() { + oredCriteria.clear(); + orderByClause = null; + distinct = false; + } + + /** + * This class was generated by MyBatis Generator. + * This class corresponds to the database table monitoring_point_category_group + * + * @mbg.generated + */ + protected abstract static class GeneratedCriteria { + protected List criteria; + + protected GeneratedCriteria() { + super(); + criteria = new ArrayList(); + } + + public boolean isValid() { + return criteria.size() > 0; + } + + public List getAllCriteria() { + return criteria; + } + + public List getCriteria() { + return criteria; + } + + protected void addCriterion(String condition) { + if (condition == null) { + throw new RuntimeException("Value for condition cannot be null"); + } + criteria.add(new Criterion(condition)); + } + + protected void addCriterion(String condition, Object value, String property) { + if (value == null) { + throw new RuntimeException("Value for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value)); + } + + protected void addCriterion(String condition, Object value1, Object value2, String property) { + if (value1 == null || value2 == null) { + throw new RuntimeException("Between values for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value1, value2)); + } + + public Criteria andIdIsNull() { + addCriterion("id is null"); + return (Criteria) this; + } + + public Criteria andIdIsNotNull() { + addCriterion("id is not null"); + return (Criteria) this; + } + + public Criteria andIdEqualTo(Long value) { + addCriterion("id =", value, "id"); + return (Criteria) this; + } + + public Criteria andIdNotEqualTo(Long value) { + addCriterion("id <>", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThan(Long value) { + addCriterion("id >", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThanOrEqualTo(Long value) { + addCriterion("id >=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThan(Long value) { + addCriterion("id <", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThanOrEqualTo(Long value) { + addCriterion("id <=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdIn(List values) { + addCriterion("id in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdNotIn(List values) { + addCriterion("id not in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdBetween(Long value1, Long value2) { + addCriterion("id between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andIdNotBetween(Long value1, Long value2) { + addCriterion("id not between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andCompanyIdIsNull() { + addCriterion("company_id is null"); + return (Criteria) this; + } + + public Criteria andCompanyIdIsNotNull() { + addCriterion("company_id is not null"); + return (Criteria) this; + } + + public Criteria andCompanyIdEqualTo(Long value) { + addCriterion("company_id =", value, "companyId"); + return (Criteria) this; + } + + public Criteria andCompanyIdNotEqualTo(Long value) { + addCriterion("company_id <>", value, "companyId"); + return (Criteria) this; + } + + public Criteria andCompanyIdGreaterThan(Long value) { + addCriterion("company_id >", value, "companyId"); + return (Criteria) this; + } + + public Criteria andCompanyIdGreaterThanOrEqualTo(Long value) { + addCriterion("company_id >=", value, "companyId"); + return (Criteria) this; + } + + public Criteria andCompanyIdLessThan(Long value) { + addCriterion("company_id <", value, "companyId"); + return (Criteria) this; + } + + public Criteria andCompanyIdLessThanOrEqualTo(Long value) { + addCriterion("company_id <=", value, "companyId"); + return (Criteria) this; + } + + public Criteria andCompanyIdIn(List values) { + addCriterion("company_id in", values, "companyId"); + return (Criteria) this; + } + + public Criteria andCompanyIdNotIn(List values) { + addCriterion("company_id not in", values, "companyId"); + return (Criteria) this; + } + + public Criteria andCompanyIdBetween(Long value1, Long value2) { + addCriterion("company_id between", value1, value2, "companyId"); + return (Criteria) this; + } + + public Criteria andCompanyIdNotBetween(Long value1, Long value2) { + addCriterion("company_id not between", value1, value2, "companyId"); + return (Criteria) this; + } + + public Criteria andBuildingIdIsNull() { + addCriterion("building_id is null"); + return (Criteria) this; + } + + public Criteria andBuildingIdIsNotNull() { + addCriterion("building_id is not null"); + return (Criteria) this; + } + + public Criteria andBuildingIdEqualTo(Long value) { + addCriterion("building_id =", value, "buildingId"); + return (Criteria) this; + } + + public Criteria andBuildingIdNotEqualTo(Long value) { + addCriterion("building_id <>", value, "buildingId"); + return (Criteria) this; + } + + public Criteria andBuildingIdGreaterThan(Long value) { + addCriterion("building_id >", value, "buildingId"); + return (Criteria) this; + } + + public Criteria andBuildingIdGreaterThanOrEqualTo(Long value) { + addCriterion("building_id >=", value, "buildingId"); + return (Criteria) this; + } + + public Criteria andBuildingIdLessThan(Long value) { + addCriterion("building_id <", value, "buildingId"); + return (Criteria) this; + } + + public Criteria andBuildingIdLessThanOrEqualTo(Long value) { + addCriterion("building_id <=", value, "buildingId"); + return (Criteria) this; + } + + public Criteria andBuildingIdIn(List values) { + addCriterion("building_id in", values, "buildingId"); + return (Criteria) this; + } + + public Criteria andBuildingIdNotIn(List values) { + addCriterion("building_id not in", values, "buildingId"); + return (Criteria) this; + } + + public Criteria andBuildingIdBetween(Long value1, Long value2) { + addCriterion("building_id between", value1, value2, "buildingId"); + return (Criteria) this; + } + + public Criteria andBuildingIdNotBetween(Long value1, Long value2) { + addCriterion("building_id not between", value1, value2, "buildingId"); + return (Criteria) this; + } + + public Criteria andNameIsNull() { + addCriterion("`name` is null"); + return (Criteria) this; + } + + public Criteria andNameIsNotNull() { + addCriterion("`name` is not null"); + return (Criteria) this; + } + + public Criteria andNameEqualTo(String value) { + addCriterion("`name` =", value, "name"); + return (Criteria) this; + } + + public Criteria andNameNotEqualTo(String value) { + addCriterion("`name` <>", value, "name"); + return (Criteria) this; + } + + public Criteria andNameGreaterThan(String value) { + addCriterion("`name` >", value, "name"); + return (Criteria) this; + } + + public Criteria andNameGreaterThanOrEqualTo(String value) { + addCriterion("`name` >=", value, "name"); + return (Criteria) this; + } + + public Criteria andNameLessThan(String value) { + addCriterion("`name` <", value, "name"); + return (Criteria) this; + } + + public Criteria andNameLessThanOrEqualTo(String value) { + addCriterion("`name` <=", value, "name"); + return (Criteria) this; + } + + public Criteria andNameLike(String value) { + addCriterion("`name` like", value, "name"); + return (Criteria) this; + } + + public Criteria andNameNotLike(String value) { + addCriterion("`name` not like", value, "name"); + return (Criteria) this; + } + + public Criteria andNameIn(List values) { + addCriterion("`name` in", values, "name"); + return (Criteria) this; + } + + public Criteria andNameNotIn(List values) { + addCriterion("`name` not in", values, "name"); + return (Criteria) this; + } + + public Criteria andNameBetween(String value1, String value2) { + addCriterion("`name` between", value1, value2, "name"); + return (Criteria) this; + } + + public Criteria andNameNotBetween(String value1, String value2) { + addCriterion("`name` not between", value1, value2, "name"); + return (Criteria) this; + } + + public Criteria andRemarkIsNull() { + addCriterion("remark is null"); + return (Criteria) this; + } + + public Criteria andRemarkIsNotNull() { + addCriterion("remark is not null"); + return (Criteria) this; + } + + public Criteria andRemarkEqualTo(String value) { + addCriterion("remark =", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkNotEqualTo(String value) { + addCriterion("remark <>", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkGreaterThan(String value) { + addCriterion("remark >", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkGreaterThanOrEqualTo(String value) { + addCriterion("remark >=", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkLessThan(String value) { + addCriterion("remark <", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkLessThanOrEqualTo(String value) { + addCriterion("remark <=", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkLike(String value) { + addCriterion("remark like", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkNotLike(String value) { + addCriterion("remark not like", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkIn(List values) { + addCriterion("remark in", values, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkNotIn(List values) { + addCriterion("remark not in", values, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkBetween(String value1, String value2) { + addCriterion("remark between", value1, value2, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkNotBetween(String value1, String value2) { + addCriterion("remark not between", value1, value2, "remark"); + return (Criteria) this; + } + + public Criteria andFlagIsNull() { + addCriterion("flag is null"); + return (Criteria) this; + } + + public Criteria andFlagIsNotNull() { + addCriterion("flag is not null"); + return (Criteria) this; + } + + public Criteria andFlagEqualTo(Integer value) { + addCriterion("flag =", value, "flag"); + return (Criteria) this; + } + + public Criteria andFlagNotEqualTo(Integer value) { + addCriterion("flag <>", value, "flag"); + return (Criteria) this; + } + + public Criteria andFlagGreaterThan(Integer value) { + addCriterion("flag >", value, "flag"); + return (Criteria) this; + } + + public Criteria andFlagGreaterThanOrEqualTo(Integer value) { + addCriterion("flag >=", value, "flag"); + return (Criteria) this; + } + + public Criteria andFlagLessThan(Integer value) { + addCriterion("flag <", value, "flag"); + return (Criteria) this; + } + + public Criteria andFlagLessThanOrEqualTo(Integer value) { + addCriterion("flag <=", value, "flag"); + return (Criteria) this; + } + + public Criteria andFlagIn(List values) { + addCriterion("flag in", values, "flag"); + return (Criteria) this; + } + + public Criteria andFlagNotIn(List values) { + addCriterion("flag not in", values, "flag"); + return (Criteria) this; + } + + public Criteria andFlagBetween(Integer value1, Integer value2) { + addCriterion("flag between", value1, value2, "flag"); + return (Criteria) this; + } + + public Criteria andFlagNotBetween(Integer value1, Integer value2) { + addCriterion("flag not between", value1, value2, "flag"); + return (Criteria) this; + } + + public Criteria andCreatedByIsNull() { + addCriterion("created_by is null"); + return (Criteria) this; + } + + public Criteria andCreatedByIsNotNull() { + addCriterion("created_by is not null"); + return (Criteria) this; + } + + public Criteria andCreatedByEqualTo(Long value) { + addCriterion("created_by =", value, "createdBy"); + return (Criteria) this; + } + + public Criteria andCreatedByNotEqualTo(Long value) { + addCriterion("created_by <>", value, "createdBy"); + return (Criteria) this; + } + + public Criteria andCreatedByGreaterThan(Long value) { + addCriterion("created_by >", value, "createdBy"); + return (Criteria) this; + } + + public Criteria andCreatedByGreaterThanOrEqualTo(Long value) { + addCriterion("created_by >=", value, "createdBy"); + return (Criteria) this; + } + + public Criteria andCreatedByLessThan(Long value) { + addCriterion("created_by <", value, "createdBy"); + return (Criteria) this; + } + + public Criteria andCreatedByLessThanOrEqualTo(Long value) { + addCriterion("created_by <=", value, "createdBy"); + return (Criteria) this; + } + + public Criteria andCreatedByIn(List values) { + addCriterion("created_by in", values, "createdBy"); + return (Criteria) this; + } + + public Criteria andCreatedByNotIn(List values) { + addCriterion("created_by not in", values, "createdBy"); + return (Criteria) this; + } + + public Criteria andCreatedByBetween(Long value1, Long value2) { + addCriterion("created_by between", value1, value2, "createdBy"); + return (Criteria) this; + } + + public Criteria andCreatedByNotBetween(Long value1, Long value2) { + addCriterion("created_by not between", value1, value2, "createdBy"); + return (Criteria) this; + } + + public Criteria andCreatedAtIsNull() { + addCriterion("created_at is null"); + return (Criteria) this; + } + + public Criteria andCreatedAtIsNotNull() { + addCriterion("created_at is not null"); + return (Criteria) this; + } + + public Criteria andCreatedAtEqualTo(Long value) { + addCriterion("created_at =", value, "createdAt"); + return (Criteria) this; + } + + public Criteria andCreatedAtNotEqualTo(Long value) { + addCriterion("created_at <>", value, "createdAt"); + return (Criteria) this; + } + + public Criteria andCreatedAtGreaterThan(Long value) { + addCriterion("created_at >", value, "createdAt"); + return (Criteria) this; + } + + public Criteria andCreatedAtGreaterThanOrEqualTo(Long value) { + addCriterion("created_at >=", value, "createdAt"); + return (Criteria) this; + } + + public Criteria andCreatedAtLessThan(Long value) { + addCriterion("created_at <", value, "createdAt"); + return (Criteria) this; + } + + public Criteria andCreatedAtLessThanOrEqualTo(Long value) { + addCriterion("created_at <=", value, "createdAt"); + return (Criteria) this; + } + + public Criteria andCreatedAtIn(List values) { + addCriterion("created_at in", values, "createdAt"); + return (Criteria) this; + } + + public Criteria andCreatedAtNotIn(List values) { + addCriterion("created_at not in", values, "createdAt"); + return (Criteria) this; + } + + public Criteria andCreatedAtBetween(Long value1, Long value2) { + addCriterion("created_at between", value1, value2, "createdAt"); + return (Criteria) this; + } + + public Criteria andCreatedAtNotBetween(Long value1, Long value2) { + addCriterion("created_at not between", value1, value2, "createdAt"); + return (Criteria) this; + } + } + + /** + * This class was generated by MyBatis Generator. + * This class corresponds to the database table monitoring_point_category_group + * + * @mbg.generated do_not_delete_during_merge + */ + public static class Criteria extends GeneratedCriteria { + + protected Criteria() { + super(); + } + } + + /** + * This class was generated by MyBatis Generator. + * This class corresponds to the database table monitoring_point_category_group + * + * @mbg.generated + */ + public static class Criterion { + private String condition; + + private Object value; + + private Object secondValue; + + private boolean noValue; + + private boolean singleValue; + + private boolean betweenValue; + + private boolean listValue; + + private String typeHandler; + + public String getCondition() { + return condition; + } + + public Object getValue() { + return value; + } + + public Object getSecondValue() { + return secondValue; + } + + public boolean isNoValue() { + return noValue; + } + + public boolean isSingleValue() { + return singleValue; + } + + public boolean isBetweenValue() { + return betweenValue; + } + + public boolean isListValue() { + return listValue; + } + + public String getTypeHandler() { + return typeHandler; + } + + protected Criterion(String condition) { + super(); + this.condition = condition; + this.typeHandler = null; + this.noValue = true; + } + + protected Criterion(String condition, Object value, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.typeHandler = typeHandler; + if (value instanceof List) { + this.listValue = true; + } else { + this.singleValue = true; + } + } + + protected Criterion(String condition, Object value) { + this(condition, value, null); + } + + protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.secondValue = secondValue; + this.typeHandler = typeHandler; + this.betweenValue = true; + } + + protected Criterion(String condition, Object value, Object secondValue) { + this(condition, value, secondValue, null); + } + } +} \ No newline at end of file diff --git a/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/model/MonitoringPointCategoryGroupRelation.java b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/model/MonitoringPointCategoryGroupRelation.java new file mode 100644 index 0000000..4f0a20f --- /dev/null +++ b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/model/MonitoringPointCategoryGroupRelation.java @@ -0,0 +1,98 @@ +package com.dongjian.dashboard.back.model; + +import java.io.Serializable; + +public class MonitoringPointCategoryGroupRelation implements Serializable { + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column monitoring_point_category_group_relation.monitoring_point_category_id + * + * @mbg.generated + */ + private Long monitoringPointCategoryId; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column monitoring_point_category_group_relation.monitoring_point_category_group_id + * + * @mbg.generated + */ + private Long monitoringPointCategoryGroupId; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database table monitoring_point_category_group_relation + * + * @mbg.generated + */ + private static final long serialVersionUID = 1L; + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column monitoring_point_category_group_relation.monitoring_point_category_id + * + * @return the value of monitoring_point_category_group_relation.monitoring_point_category_id + * + * @mbg.generated + */ + public Long getMonitoringPointCategoryId() { + return monitoringPointCategoryId; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column monitoring_point_category_group_relation.monitoring_point_category_id + * + * @param monitoringPointCategoryId the value for monitoring_point_category_group_relation.monitoring_point_category_id + * + * @mbg.generated + */ + public void setMonitoringPointCategoryId(Long monitoringPointCategoryId) { + this.monitoringPointCategoryId = monitoringPointCategoryId; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column monitoring_point_category_group_relation.monitoring_point_category_group_id + * + * @return the value of monitoring_point_category_group_relation.monitoring_point_category_group_id + * + * @mbg.generated + */ + public Long getMonitoringPointCategoryGroupId() { + return monitoringPointCategoryGroupId; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column monitoring_point_category_group_relation.monitoring_point_category_group_id + * + * @param monitoringPointCategoryGroupId the value for monitoring_point_category_group_relation.monitoring_point_category_group_id + * + * @mbg.generated + */ + public void setMonitoringPointCategoryGroupId(Long monitoringPointCategoryGroupId) { + this.monitoringPointCategoryGroupId = monitoringPointCategoryGroupId; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table monitoring_point_category_group_relation + * + * @mbg.generated + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append(getClass().getSimpleName()); + sb.append(" ["); + sb.append("Hash = ").append(hashCode()); + sb.append(", monitoringPointCategoryId=").append(monitoringPointCategoryId); + sb.append(", monitoringPointCategoryGroupId=").append(monitoringPointCategoryGroupId); + sb.append(", serialVersionUID=").append(serialVersionUID); + sb.append("]"); + return sb.toString(); + } +} \ No newline at end of file diff --git a/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/model/MonitoringPointCategoryGroupRelationExample.java b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/model/MonitoringPointCategoryGroupRelationExample.java new file mode 100644 index 0000000..5401c07 --- /dev/null +++ b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/model/MonitoringPointCategoryGroupRelationExample.java @@ -0,0 +1,422 @@ +package com.dongjian.dashboard.back.model; + +import java.util.ArrayList; +import java.util.List; + +public class MonitoringPointCategoryGroupRelationExample { + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database table monitoring_point_category_group_relation + * + * @mbg.generated + */ + protected String orderByClause; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database table monitoring_point_category_group_relation + * + * @mbg.generated + */ + protected boolean distinct; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database table monitoring_point_category_group_relation + * + * @mbg.generated + */ + protected List oredCriteria; + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table monitoring_point_category_group_relation + * + * @mbg.generated + */ + public MonitoringPointCategoryGroupRelationExample() { + oredCriteria = new ArrayList(); + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table monitoring_point_category_group_relation + * + * @mbg.generated + */ + public void setOrderByClause(String orderByClause) { + this.orderByClause = orderByClause; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table monitoring_point_category_group_relation + * + * @mbg.generated + */ + public String getOrderByClause() { + return orderByClause; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table monitoring_point_category_group_relation + * + * @mbg.generated + */ + public void setDistinct(boolean distinct) { + this.distinct = distinct; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table monitoring_point_category_group_relation + * + * @mbg.generated + */ + public boolean isDistinct() { + return distinct; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table monitoring_point_category_group_relation + * + * @mbg.generated + */ + public List getOredCriteria() { + return oredCriteria; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table monitoring_point_category_group_relation + * + * @mbg.generated + */ + public void or(Criteria criteria) { + oredCriteria.add(criteria); + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table monitoring_point_category_group_relation + * + * @mbg.generated + */ + public Criteria or() { + Criteria criteria = createCriteriaInternal(); + oredCriteria.add(criteria); + return criteria; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table monitoring_point_category_group_relation + * + * @mbg.generated + */ + public Criteria createCriteria() { + Criteria criteria = createCriteriaInternal(); + if (oredCriteria.size() == 0) { + oredCriteria.add(criteria); + } + return criteria; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table monitoring_point_category_group_relation + * + * @mbg.generated + */ + protected Criteria createCriteriaInternal() { + Criteria criteria = new Criteria(); + return criteria; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table monitoring_point_category_group_relation + * + * @mbg.generated + */ + public void clear() { + oredCriteria.clear(); + orderByClause = null; + distinct = false; + } + + /** + * This class was generated by MyBatis Generator. + * This class corresponds to the database table monitoring_point_category_group_relation + * + * @mbg.generated + */ + protected abstract static class GeneratedCriteria { + protected List criteria; + + protected GeneratedCriteria() { + super(); + criteria = new ArrayList(); + } + + public boolean isValid() { + return criteria.size() > 0; + } + + public List getAllCriteria() { + return criteria; + } + + public List getCriteria() { + return criteria; + } + + protected void addCriterion(String condition) { + if (condition == null) { + throw new RuntimeException("Value for condition cannot be null"); + } + criteria.add(new Criterion(condition)); + } + + protected void addCriterion(String condition, Object value, String property) { + if (value == null) { + throw new RuntimeException("Value for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value)); + } + + protected void addCriterion(String condition, Object value1, Object value2, String property) { + if (value1 == null || value2 == null) { + throw new RuntimeException("Between values for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value1, value2)); + } + + public Criteria andMonitoringPointCategoryIdIsNull() { + addCriterion("monitoring_point_category_id is null"); + return (Criteria) this; + } + + public Criteria andMonitoringPointCategoryIdIsNotNull() { + addCriterion("monitoring_point_category_id is not null"); + return (Criteria) this; + } + + public Criteria andMonitoringPointCategoryIdEqualTo(Long value) { + addCriterion("monitoring_point_category_id =", value, "monitoringPointCategoryId"); + return (Criteria) this; + } + + public Criteria andMonitoringPointCategoryIdNotEqualTo(Long value) { + addCriterion("monitoring_point_category_id <>", value, "monitoringPointCategoryId"); + return (Criteria) this; + } + + public Criteria andMonitoringPointCategoryIdGreaterThan(Long value) { + addCriterion("monitoring_point_category_id >", value, "monitoringPointCategoryId"); + return (Criteria) this; + } + + public Criteria andMonitoringPointCategoryIdGreaterThanOrEqualTo(Long value) { + addCriterion("monitoring_point_category_id >=", value, "monitoringPointCategoryId"); + return (Criteria) this; + } + + public Criteria andMonitoringPointCategoryIdLessThan(Long value) { + addCriterion("monitoring_point_category_id <", value, "monitoringPointCategoryId"); + return (Criteria) this; + } + + public Criteria andMonitoringPointCategoryIdLessThanOrEqualTo(Long value) { + addCriterion("monitoring_point_category_id <=", value, "monitoringPointCategoryId"); + return (Criteria) this; + } + + public Criteria andMonitoringPointCategoryIdIn(List values) { + addCriterion("monitoring_point_category_id in", values, "monitoringPointCategoryId"); + return (Criteria) this; + } + + public Criteria andMonitoringPointCategoryIdNotIn(List values) { + addCriterion("monitoring_point_category_id not in", values, "monitoringPointCategoryId"); + return (Criteria) this; + } + + public Criteria andMonitoringPointCategoryIdBetween(Long value1, Long value2) { + addCriterion("monitoring_point_category_id between", value1, value2, "monitoringPointCategoryId"); + return (Criteria) this; + } + + public Criteria andMonitoringPointCategoryIdNotBetween(Long value1, Long value2) { + addCriterion("monitoring_point_category_id not between", value1, value2, "monitoringPointCategoryId"); + return (Criteria) this; + } + + public Criteria andMonitoringPointCategoryGroupIdIsNull() { + addCriterion("monitoring_point_category_group_id is null"); + return (Criteria) this; + } + + public Criteria andMonitoringPointCategoryGroupIdIsNotNull() { + addCriterion("monitoring_point_category_group_id is not null"); + return (Criteria) this; + } + + public Criteria andMonitoringPointCategoryGroupIdEqualTo(Long value) { + addCriterion("monitoring_point_category_group_id =", value, "monitoringPointCategoryGroupId"); + return (Criteria) this; + } + + public Criteria andMonitoringPointCategoryGroupIdNotEqualTo(Long value) { + addCriterion("monitoring_point_category_group_id <>", value, "monitoringPointCategoryGroupId"); + return (Criteria) this; + } + + public Criteria andMonitoringPointCategoryGroupIdGreaterThan(Long value) { + addCriterion("monitoring_point_category_group_id >", value, "monitoringPointCategoryGroupId"); + return (Criteria) this; + } + + public Criteria andMonitoringPointCategoryGroupIdGreaterThanOrEqualTo(Long value) { + addCriterion("monitoring_point_category_group_id >=", value, "monitoringPointCategoryGroupId"); + return (Criteria) this; + } + + public Criteria andMonitoringPointCategoryGroupIdLessThan(Long value) { + addCriterion("monitoring_point_category_group_id <", value, "monitoringPointCategoryGroupId"); + return (Criteria) this; + } + + public Criteria andMonitoringPointCategoryGroupIdLessThanOrEqualTo(Long value) { + addCriterion("monitoring_point_category_group_id <=", value, "monitoringPointCategoryGroupId"); + return (Criteria) this; + } + + public Criteria andMonitoringPointCategoryGroupIdIn(List values) { + addCriterion("monitoring_point_category_group_id in", values, "monitoringPointCategoryGroupId"); + return (Criteria) this; + } + + public Criteria andMonitoringPointCategoryGroupIdNotIn(List values) { + addCriterion("monitoring_point_category_group_id not in", values, "monitoringPointCategoryGroupId"); + return (Criteria) this; + } + + public Criteria andMonitoringPointCategoryGroupIdBetween(Long value1, Long value2) { + addCriterion("monitoring_point_category_group_id between", value1, value2, "monitoringPointCategoryGroupId"); + return (Criteria) this; + } + + public Criteria andMonitoringPointCategoryGroupIdNotBetween(Long value1, Long value2) { + addCriterion("monitoring_point_category_group_id not between", value1, value2, "monitoringPointCategoryGroupId"); + return (Criteria) this; + } + } + + /** + * This class was generated by MyBatis Generator. + * This class corresponds to the database table monitoring_point_category_group_relation + * + * @mbg.generated do_not_delete_during_merge + */ + public static class Criteria extends GeneratedCriteria { + + protected Criteria() { + super(); + } + } + + /** + * This class was generated by MyBatis Generator. + * This class corresponds to the database table monitoring_point_category_group_relation + * + * @mbg.generated + */ + public static class Criterion { + private String condition; + + private Object value; + + private Object secondValue; + + private boolean noValue; + + private boolean singleValue; + + private boolean betweenValue; + + private boolean listValue; + + private String typeHandler; + + public String getCondition() { + return condition; + } + + public Object getValue() { + return value; + } + + public Object getSecondValue() { + return secondValue; + } + + public boolean isNoValue() { + return noValue; + } + + public boolean isSingleValue() { + return singleValue; + } + + public boolean isBetweenValue() { + return betweenValue; + } + + public boolean isListValue() { + return listValue; + } + + public String getTypeHandler() { + return typeHandler; + } + + protected Criterion(String condition) { + super(); + this.condition = condition; + this.typeHandler = null; + this.noValue = true; + } + + protected Criterion(String condition, Object value, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.typeHandler = typeHandler; + if (value instanceof List) { + this.listValue = true; + } else { + this.singleValue = true; + } + } + + protected Criterion(String condition, Object value) { + this(condition, value, null); + } + + protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.secondValue = secondValue; + this.typeHandler = typeHandler; + this.betweenValue = true; + } + + protected Criterion(String condition, Object value, Object secondValue) { + this(condition, value, secondValue, null); + } + } +} \ No newline at end of file diff --git a/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/model/NotificationSlack.java b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/model/NotificationSlack.java new file mode 100644 index 0000000..5669c82 --- /dev/null +++ b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/model/NotificationSlack.java @@ -0,0 +1,302 @@ +package com.dongjian.dashboard.back.model; + +import java.io.Serializable; + +public class NotificationSlack implements Serializable { + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column notification_slack.id + * + * @mbg.generated + */ + private Long id; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column notification_slack.company_id + * + * @mbg.generated + */ + private Long companyId; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column notification_slack.identity + * + * @mbg.generated + */ + private String identity; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column notification_slack.webhook + * + * @mbg.generated + */ + private String webhook; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column notification_slack.remark + * + * @mbg.generated + */ + private String remark; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column notification_slack.flag + * + * @mbg.generated + */ + private Integer flag; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column notification_slack.created_by + * + * @mbg.generated + */ + private Long createdBy; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column notification_slack.created_at + * + * @mbg.generated + */ + private Long createdAt; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database table notification_slack + * + * @mbg.generated + */ + private static final long serialVersionUID = 1L; + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column notification_slack.id + * + * @return the value of notification_slack.id + * + * @mbg.generated + */ + public Long getId() { + return id; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column notification_slack.id + * + * @param id the value for notification_slack.id + * + * @mbg.generated + */ + public void setId(Long id) { + this.id = id; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column notification_slack.company_id + * + * @return the value of notification_slack.company_id + * + * @mbg.generated + */ + public Long getCompanyId() { + return companyId; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column notification_slack.company_id + * + * @param companyId the value for notification_slack.company_id + * + * @mbg.generated + */ + public void setCompanyId(Long companyId) { + this.companyId = companyId; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column notification_slack.identity + * + * @return the value of notification_slack.identity + * + * @mbg.generated + */ + public String getIdentity() { + return identity; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column notification_slack.identity + * + * @param identity the value for notification_slack.identity + * + * @mbg.generated + */ + public void setIdentity(String identity) { + this.identity = identity == null ? null : identity.trim(); + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column notification_slack.webhook + * + * @return the value of notification_slack.webhook + * + * @mbg.generated + */ + public String getWebhook() { + return webhook; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column notification_slack.webhook + * + * @param webhook the value for notification_slack.webhook + * + * @mbg.generated + */ + public void setWebhook(String webhook) { + this.webhook = webhook == null ? null : webhook.trim(); + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column notification_slack.remark + * + * @return the value of notification_slack.remark + * + * @mbg.generated + */ + public String getRemark() { + return remark; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column notification_slack.remark + * + * @param remark the value for notification_slack.remark + * + * @mbg.generated + */ + public void setRemark(String remark) { + this.remark = remark == null ? null : remark.trim(); + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column notification_slack.flag + * + * @return the value of notification_slack.flag + * + * @mbg.generated + */ + public Integer getFlag() { + return flag; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column notification_slack.flag + * + * @param flag the value for notification_slack.flag + * + * @mbg.generated + */ + public void setFlag(Integer flag) { + this.flag = flag; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column notification_slack.created_by + * + * @return the value of notification_slack.created_by + * + * @mbg.generated + */ + public Long getCreatedBy() { + return createdBy; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column notification_slack.created_by + * + * @param createdBy the value for notification_slack.created_by + * + * @mbg.generated + */ + public void setCreatedBy(Long createdBy) { + this.createdBy = createdBy; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column notification_slack.created_at + * + * @return the value of notification_slack.created_at + * + * @mbg.generated + */ + public Long getCreatedAt() { + return createdAt; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column notification_slack.created_at + * + * @param createdAt the value for notification_slack.created_at + * + * @mbg.generated + */ + public void setCreatedAt(Long createdAt) { + this.createdAt = createdAt; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table notification_slack + * + * @mbg.generated + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append(getClass().getSimpleName()); + sb.append(" ["); + sb.append("Hash = ").append(hashCode()); + sb.append(", id=").append(id); + sb.append(", companyId=").append(companyId); + sb.append(", identity=").append(identity); + sb.append(", webhook=").append(webhook); + sb.append(", remark=").append(remark); + sb.append(", flag=").append(flag); + sb.append(", createdBy=").append(createdBy); + sb.append(", createdAt=").append(createdAt); + sb.append(", serialVersionUID=").append(serialVersionUID); + sb.append("]"); + return sb.toString(); + } +} \ No newline at end of file diff --git a/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/model/NotificationSlackExample.java b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/model/NotificationSlackExample.java new file mode 100644 index 0000000..f788366 --- /dev/null +++ b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/model/NotificationSlackExample.java @@ -0,0 +1,812 @@ +package com.dongjian.dashboard.back.model; + +import java.util.ArrayList; +import java.util.List; + +public class NotificationSlackExample { + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database table notification_slack + * + * @mbg.generated + */ + protected String orderByClause; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database table notification_slack + * + * @mbg.generated + */ + protected boolean distinct; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database table notification_slack + * + * @mbg.generated + */ + protected List oredCriteria; + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table notification_slack + * + * @mbg.generated + */ + public NotificationSlackExample() { + oredCriteria = new ArrayList(); + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table notification_slack + * + * @mbg.generated + */ + public void setOrderByClause(String orderByClause) { + this.orderByClause = orderByClause; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table notification_slack + * + * @mbg.generated + */ + public String getOrderByClause() { + return orderByClause; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table notification_slack + * + * @mbg.generated + */ + public void setDistinct(boolean distinct) { + this.distinct = distinct; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table notification_slack + * + * @mbg.generated + */ + public boolean isDistinct() { + return distinct; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table notification_slack + * + * @mbg.generated + */ + public List getOredCriteria() { + return oredCriteria; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table notification_slack + * + * @mbg.generated + */ + public void or(Criteria criteria) { + oredCriteria.add(criteria); + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table notification_slack + * + * @mbg.generated + */ + public Criteria or() { + Criteria criteria = createCriteriaInternal(); + oredCriteria.add(criteria); + return criteria; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table notification_slack + * + * @mbg.generated + */ + public Criteria createCriteria() { + Criteria criteria = createCriteriaInternal(); + if (oredCriteria.size() == 0) { + oredCriteria.add(criteria); + } + return criteria; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table notification_slack + * + * @mbg.generated + */ + protected Criteria createCriteriaInternal() { + Criteria criteria = new Criteria(); + return criteria; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table notification_slack + * + * @mbg.generated + */ + public void clear() { + oredCriteria.clear(); + orderByClause = null; + distinct = false; + } + + /** + * This class was generated by MyBatis Generator. + * This class corresponds to the database table notification_slack + * + * @mbg.generated + */ + protected abstract static class GeneratedCriteria { + protected List criteria; + + protected GeneratedCriteria() { + super(); + criteria = new ArrayList(); + } + + public boolean isValid() { + return criteria.size() > 0; + } + + public List getAllCriteria() { + return criteria; + } + + public List getCriteria() { + return criteria; + } + + protected void addCriterion(String condition) { + if (condition == null) { + throw new RuntimeException("Value for condition cannot be null"); + } + criteria.add(new Criterion(condition)); + } + + protected void addCriterion(String condition, Object value, String property) { + if (value == null) { + throw new RuntimeException("Value for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value)); + } + + protected void addCriterion(String condition, Object value1, Object value2, String property) { + if (value1 == null || value2 == null) { + throw new RuntimeException("Between values for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value1, value2)); + } + + public Criteria andIdIsNull() { + addCriterion("id is null"); + return (Criteria) this; + } + + public Criteria andIdIsNotNull() { + addCriterion("id is not null"); + return (Criteria) this; + } + + public Criteria andIdEqualTo(Long value) { + addCriterion("id =", value, "id"); + return (Criteria) this; + } + + public Criteria andIdNotEqualTo(Long value) { + addCriterion("id <>", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThan(Long value) { + addCriterion("id >", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThanOrEqualTo(Long value) { + addCriterion("id >=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThan(Long value) { + addCriterion("id <", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThanOrEqualTo(Long value) { + addCriterion("id <=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdIn(List values) { + addCriterion("id in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdNotIn(List values) { + addCriterion("id not in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdBetween(Long value1, Long value2) { + addCriterion("id between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andIdNotBetween(Long value1, Long value2) { + addCriterion("id not between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andCompanyIdIsNull() { + addCriterion("company_id is null"); + return (Criteria) this; + } + + public Criteria andCompanyIdIsNotNull() { + addCriterion("company_id is not null"); + return (Criteria) this; + } + + public Criteria andCompanyIdEqualTo(Long value) { + addCriterion("company_id =", value, "companyId"); + return (Criteria) this; + } + + public Criteria andCompanyIdNotEqualTo(Long value) { + addCriterion("company_id <>", value, "companyId"); + return (Criteria) this; + } + + public Criteria andCompanyIdGreaterThan(Long value) { + addCriterion("company_id >", value, "companyId"); + return (Criteria) this; + } + + public Criteria andCompanyIdGreaterThanOrEqualTo(Long value) { + addCriterion("company_id >=", value, "companyId"); + return (Criteria) this; + } + + public Criteria andCompanyIdLessThan(Long value) { + addCriterion("company_id <", value, "companyId"); + return (Criteria) this; + } + + public Criteria andCompanyIdLessThanOrEqualTo(Long value) { + addCriterion("company_id <=", value, "companyId"); + return (Criteria) this; + } + + public Criteria andCompanyIdIn(List values) { + addCriterion("company_id in", values, "companyId"); + return (Criteria) this; + } + + public Criteria andCompanyIdNotIn(List values) { + addCriterion("company_id not in", values, "companyId"); + return (Criteria) this; + } + + public Criteria andCompanyIdBetween(Long value1, Long value2) { + addCriterion("company_id between", value1, value2, "companyId"); + return (Criteria) this; + } + + public Criteria andCompanyIdNotBetween(Long value1, Long value2) { + addCriterion("company_id not between", value1, value2, "companyId"); + return (Criteria) this; + } + + public Criteria andIdentityIsNull() { + addCriterion("`identity` is null"); + return (Criteria) this; + } + + public Criteria andIdentityIsNotNull() { + addCriterion("`identity` is not null"); + return (Criteria) this; + } + + public Criteria andIdentityEqualTo(String value) { + addCriterion("`identity` =", value, "identity"); + return (Criteria) this; + } + + public Criteria andIdentityNotEqualTo(String value) { + addCriterion("`identity` <>", value, "identity"); + return (Criteria) this; + } + + public Criteria andIdentityGreaterThan(String value) { + addCriterion("`identity` >", value, "identity"); + return (Criteria) this; + } + + public Criteria andIdentityGreaterThanOrEqualTo(String value) { + addCriterion("`identity` >=", value, "identity"); + return (Criteria) this; + } + + public Criteria andIdentityLessThan(String value) { + addCriterion("`identity` <", value, "identity"); + return (Criteria) this; + } + + public Criteria andIdentityLessThanOrEqualTo(String value) { + addCriterion("`identity` <=", value, "identity"); + return (Criteria) this; + } + + public Criteria andIdentityLike(String value) { + addCriterion("`identity` like", value, "identity"); + return (Criteria) this; + } + + public Criteria andIdentityNotLike(String value) { + addCriterion("`identity` not like", value, "identity"); + return (Criteria) this; + } + + public Criteria andIdentityIn(List values) { + addCriterion("`identity` in", values, "identity"); + return (Criteria) this; + } + + public Criteria andIdentityNotIn(List values) { + addCriterion("`identity` not in", values, "identity"); + return (Criteria) this; + } + + public Criteria andIdentityBetween(String value1, String value2) { + addCriterion("`identity` between", value1, value2, "identity"); + return (Criteria) this; + } + + public Criteria andIdentityNotBetween(String value1, String value2) { + addCriterion("`identity` not between", value1, value2, "identity"); + return (Criteria) this; + } + + public Criteria andWebhookIsNull() { + addCriterion("webhook is null"); + return (Criteria) this; + } + + public Criteria andWebhookIsNotNull() { + addCriterion("webhook is not null"); + return (Criteria) this; + } + + public Criteria andWebhookEqualTo(String value) { + addCriterion("webhook =", value, "webhook"); + return (Criteria) this; + } + + public Criteria andWebhookNotEqualTo(String value) { + addCriterion("webhook <>", value, "webhook"); + return (Criteria) this; + } + + public Criteria andWebhookGreaterThan(String value) { + addCriterion("webhook >", value, "webhook"); + return (Criteria) this; + } + + public Criteria andWebhookGreaterThanOrEqualTo(String value) { + addCriterion("webhook >=", value, "webhook"); + return (Criteria) this; + } + + public Criteria andWebhookLessThan(String value) { + addCriterion("webhook <", value, "webhook"); + return (Criteria) this; + } + + public Criteria andWebhookLessThanOrEqualTo(String value) { + addCriterion("webhook <=", value, "webhook"); + return (Criteria) this; + } + + public Criteria andWebhookLike(String value) { + addCriterion("webhook like", value, "webhook"); + return (Criteria) this; + } + + public Criteria andWebhookNotLike(String value) { + addCriterion("webhook not like", value, "webhook"); + return (Criteria) this; + } + + public Criteria andWebhookIn(List values) { + addCriterion("webhook in", values, "webhook"); + return (Criteria) this; + } + + public Criteria andWebhookNotIn(List values) { + addCriterion("webhook not in", values, "webhook"); + return (Criteria) this; + } + + public Criteria andWebhookBetween(String value1, String value2) { + addCriterion("webhook between", value1, value2, "webhook"); + return (Criteria) this; + } + + public Criteria andWebhookNotBetween(String value1, String value2) { + addCriterion("webhook not between", value1, value2, "webhook"); + return (Criteria) this; + } + + public Criteria andRemarkIsNull() { + addCriterion("remark is null"); + return (Criteria) this; + } + + public Criteria andRemarkIsNotNull() { + addCriterion("remark is not null"); + return (Criteria) this; + } + + public Criteria andRemarkEqualTo(String value) { + addCriterion("remark =", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkNotEqualTo(String value) { + addCriterion("remark <>", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkGreaterThan(String value) { + addCriterion("remark >", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkGreaterThanOrEqualTo(String value) { + addCriterion("remark >=", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkLessThan(String value) { + addCriterion("remark <", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkLessThanOrEqualTo(String value) { + addCriterion("remark <=", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkLike(String value) { + addCriterion("remark like", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkNotLike(String value) { + addCriterion("remark not like", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkIn(List values) { + addCriterion("remark in", values, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkNotIn(List values) { + addCriterion("remark not in", values, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkBetween(String value1, String value2) { + addCriterion("remark between", value1, value2, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkNotBetween(String value1, String value2) { + addCriterion("remark not between", value1, value2, "remark"); + return (Criteria) this; + } + + public Criteria andFlagIsNull() { + addCriterion("flag is null"); + return (Criteria) this; + } + + public Criteria andFlagIsNotNull() { + addCriterion("flag is not null"); + return (Criteria) this; + } + + public Criteria andFlagEqualTo(Integer value) { + addCriterion("flag =", value, "flag"); + return (Criteria) this; + } + + public Criteria andFlagNotEqualTo(Integer value) { + addCriterion("flag <>", value, "flag"); + return (Criteria) this; + } + + public Criteria andFlagGreaterThan(Integer value) { + addCriterion("flag >", value, "flag"); + return (Criteria) this; + } + + public Criteria andFlagGreaterThanOrEqualTo(Integer value) { + addCriterion("flag >=", value, "flag"); + return (Criteria) this; + } + + public Criteria andFlagLessThan(Integer value) { + addCriterion("flag <", value, "flag"); + return (Criteria) this; + } + + public Criteria andFlagLessThanOrEqualTo(Integer value) { + addCriterion("flag <=", value, "flag"); + return (Criteria) this; + } + + public Criteria andFlagIn(List values) { + addCriterion("flag in", values, "flag"); + return (Criteria) this; + } + + public Criteria andFlagNotIn(List values) { + addCriterion("flag not in", values, "flag"); + return (Criteria) this; + } + + public Criteria andFlagBetween(Integer value1, Integer value2) { + addCriterion("flag between", value1, value2, "flag"); + return (Criteria) this; + } + + public Criteria andFlagNotBetween(Integer value1, Integer value2) { + addCriterion("flag not between", value1, value2, "flag"); + return (Criteria) this; + } + + public Criteria andCreatedByIsNull() { + addCriterion("created_by is null"); + return (Criteria) this; + } + + public Criteria andCreatedByIsNotNull() { + addCriterion("created_by is not null"); + return (Criteria) this; + } + + public Criteria andCreatedByEqualTo(Long value) { + addCriterion("created_by =", value, "createdBy"); + return (Criteria) this; + } + + public Criteria andCreatedByNotEqualTo(Long value) { + addCriterion("created_by <>", value, "createdBy"); + return (Criteria) this; + } + + public Criteria andCreatedByGreaterThan(Long value) { + addCriterion("created_by >", value, "createdBy"); + return (Criteria) this; + } + + public Criteria andCreatedByGreaterThanOrEqualTo(Long value) { + addCriterion("created_by >=", value, "createdBy"); + return (Criteria) this; + } + + public Criteria andCreatedByLessThan(Long value) { + addCriterion("created_by <", value, "createdBy"); + return (Criteria) this; + } + + public Criteria andCreatedByLessThanOrEqualTo(Long value) { + addCriterion("created_by <=", value, "createdBy"); + return (Criteria) this; + } + + public Criteria andCreatedByIn(List values) { + addCriterion("created_by in", values, "createdBy"); + return (Criteria) this; + } + + public Criteria andCreatedByNotIn(List values) { + addCriterion("created_by not in", values, "createdBy"); + return (Criteria) this; + } + + public Criteria andCreatedByBetween(Long value1, Long value2) { + addCriterion("created_by between", value1, value2, "createdBy"); + return (Criteria) this; + } + + public Criteria andCreatedByNotBetween(Long value1, Long value2) { + addCriterion("created_by not between", value1, value2, "createdBy"); + return (Criteria) this; + } + + public Criteria andCreatedAtIsNull() { + addCriterion("created_at is null"); + return (Criteria) this; + } + + public Criteria andCreatedAtIsNotNull() { + addCriterion("created_at is not null"); + return (Criteria) this; + } + + public Criteria andCreatedAtEqualTo(Long value) { + addCriterion("created_at =", value, "createdAt"); + return (Criteria) this; + } + + public Criteria andCreatedAtNotEqualTo(Long value) { + addCriterion("created_at <>", value, "createdAt"); + return (Criteria) this; + } + + public Criteria andCreatedAtGreaterThan(Long value) { + addCriterion("created_at >", value, "createdAt"); + return (Criteria) this; + } + + public Criteria andCreatedAtGreaterThanOrEqualTo(Long value) { + addCriterion("created_at >=", value, "createdAt"); + return (Criteria) this; + } + + public Criteria andCreatedAtLessThan(Long value) { + addCriterion("created_at <", value, "createdAt"); + return (Criteria) this; + } + + public Criteria andCreatedAtLessThanOrEqualTo(Long value) { + addCriterion("created_at <=", value, "createdAt"); + return (Criteria) this; + } + + public Criteria andCreatedAtIn(List values) { + addCriterion("created_at in", values, "createdAt"); + return (Criteria) this; + } + + public Criteria andCreatedAtNotIn(List values) { + addCriterion("created_at not in", values, "createdAt"); + return (Criteria) this; + } + + public Criteria andCreatedAtBetween(Long value1, Long value2) { + addCriterion("created_at between", value1, value2, "createdAt"); + return (Criteria) this; + } + + public Criteria andCreatedAtNotBetween(Long value1, Long value2) { + addCriterion("created_at not between", value1, value2, "createdAt"); + return (Criteria) this; + } + } + + /** + * This class was generated by MyBatis Generator. + * This class corresponds to the database table notification_slack + * + * @mbg.generated do_not_delete_during_merge + */ + public static class Criteria extends GeneratedCriteria { + + protected Criteria() { + super(); + } + } + + /** + * This class was generated by MyBatis Generator. + * This class corresponds to the database table notification_slack + * + * @mbg.generated + */ + public static class Criterion { + private String condition; + + private Object value; + + private Object secondValue; + + private boolean noValue; + + private boolean singleValue; + + private boolean betweenValue; + + private boolean listValue; + + private String typeHandler; + + public String getCondition() { + return condition; + } + + public Object getValue() { + return value; + } + + public Object getSecondValue() { + return secondValue; + } + + public boolean isNoValue() { + return noValue; + } + + public boolean isSingleValue() { + return singleValue; + } + + public boolean isBetweenValue() { + return betweenValue; + } + + public boolean isListValue() { + return listValue; + } + + public String getTypeHandler() { + return typeHandler; + } + + protected Criterion(String condition) { + super(); + this.condition = condition; + this.typeHandler = null; + this.noValue = true; + } + + protected Criterion(String condition, Object value, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.typeHandler = typeHandler; + if (value instanceof List) { + this.listValue = true; + } else { + this.singleValue = true; + } + } + + protected Criterion(String condition, Object value) { + this(condition, value, null); + } + + protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.secondValue = secondValue; + this.typeHandler = typeHandler; + this.betweenValue = true; + } + + protected Criterion(String condition, Object value, Object secondValue) { + this(condition, value, secondValue, null); + } + } +} \ No newline at end of file diff --git a/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/model/NotificationTeams.java b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/model/NotificationTeams.java new file mode 100644 index 0000000..620018e --- /dev/null +++ b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/model/NotificationTeams.java @@ -0,0 +1,302 @@ +package com.dongjian.dashboard.back.model; + +import java.io.Serializable; + +public class NotificationTeams implements Serializable { + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column notification_teams.id + * + * @mbg.generated + */ + private Long id; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column notification_teams.company_id + * + * @mbg.generated + */ + private Long companyId; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column notification_teams.identity + * + * @mbg.generated + */ + private String identity; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column notification_teams.webhook + * + * @mbg.generated + */ + private String webhook; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column notification_teams.remark + * + * @mbg.generated + */ + private String remark; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column notification_teams.flag + * + * @mbg.generated + */ + private Integer flag; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column notification_teams.created_by + * + * @mbg.generated + */ + private Long createdBy; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column notification_teams.created_at + * + * @mbg.generated + */ + private Long createdAt; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database table notification_teams + * + * @mbg.generated + */ + private static final long serialVersionUID = 1L; + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column notification_teams.id + * + * @return the value of notification_teams.id + * + * @mbg.generated + */ + public Long getId() { + return id; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column notification_teams.id + * + * @param id the value for notification_teams.id + * + * @mbg.generated + */ + public void setId(Long id) { + this.id = id; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column notification_teams.company_id + * + * @return the value of notification_teams.company_id + * + * @mbg.generated + */ + public Long getCompanyId() { + return companyId; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column notification_teams.company_id + * + * @param companyId the value for notification_teams.company_id + * + * @mbg.generated + */ + public void setCompanyId(Long companyId) { + this.companyId = companyId; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column notification_teams.identity + * + * @return the value of notification_teams.identity + * + * @mbg.generated + */ + public String getIdentity() { + return identity; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column notification_teams.identity + * + * @param identity the value for notification_teams.identity + * + * @mbg.generated + */ + public void setIdentity(String identity) { + this.identity = identity == null ? null : identity.trim(); + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column notification_teams.webhook + * + * @return the value of notification_teams.webhook + * + * @mbg.generated + */ + public String getWebhook() { + return webhook; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column notification_teams.webhook + * + * @param webhook the value for notification_teams.webhook + * + * @mbg.generated + */ + public void setWebhook(String webhook) { + this.webhook = webhook == null ? null : webhook.trim(); + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column notification_teams.remark + * + * @return the value of notification_teams.remark + * + * @mbg.generated + */ + public String getRemark() { + return remark; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column notification_teams.remark + * + * @param remark the value for notification_teams.remark + * + * @mbg.generated + */ + public void setRemark(String remark) { + this.remark = remark == null ? null : remark.trim(); + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column notification_teams.flag + * + * @return the value of notification_teams.flag + * + * @mbg.generated + */ + public Integer getFlag() { + return flag; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column notification_teams.flag + * + * @param flag the value for notification_teams.flag + * + * @mbg.generated + */ + public void setFlag(Integer flag) { + this.flag = flag; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column notification_teams.created_by + * + * @return the value of notification_teams.created_by + * + * @mbg.generated + */ + public Long getCreatedBy() { + return createdBy; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column notification_teams.created_by + * + * @param createdBy the value for notification_teams.created_by + * + * @mbg.generated + */ + public void setCreatedBy(Long createdBy) { + this.createdBy = createdBy; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column notification_teams.created_at + * + * @return the value of notification_teams.created_at + * + * @mbg.generated + */ + public Long getCreatedAt() { + return createdAt; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column notification_teams.created_at + * + * @param createdAt the value for notification_teams.created_at + * + * @mbg.generated + */ + public void setCreatedAt(Long createdAt) { + this.createdAt = createdAt; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table notification_teams + * + * @mbg.generated + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append(getClass().getSimpleName()); + sb.append(" ["); + sb.append("Hash = ").append(hashCode()); + sb.append(", id=").append(id); + sb.append(", companyId=").append(companyId); + sb.append(", identity=").append(identity); + sb.append(", webhook=").append(webhook); + sb.append(", remark=").append(remark); + sb.append(", flag=").append(flag); + sb.append(", createdBy=").append(createdBy); + sb.append(", createdAt=").append(createdAt); + sb.append(", serialVersionUID=").append(serialVersionUID); + sb.append("]"); + return sb.toString(); + } +} \ No newline at end of file diff --git a/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/model/NotificationTeamsExample.java b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/model/NotificationTeamsExample.java new file mode 100644 index 0000000..bec89cc --- /dev/null +++ b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/model/NotificationTeamsExample.java @@ -0,0 +1,812 @@ +package com.dongjian.dashboard.back.model; + +import java.util.ArrayList; +import java.util.List; + +public class NotificationTeamsExample { + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database table notification_teams + * + * @mbg.generated + */ + protected String orderByClause; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database table notification_teams + * + * @mbg.generated + */ + protected boolean distinct; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database table notification_teams + * + * @mbg.generated + */ + protected List oredCriteria; + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table notification_teams + * + * @mbg.generated + */ + public NotificationTeamsExample() { + oredCriteria = new ArrayList(); + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table notification_teams + * + * @mbg.generated + */ + public void setOrderByClause(String orderByClause) { + this.orderByClause = orderByClause; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table notification_teams + * + * @mbg.generated + */ + public String getOrderByClause() { + return orderByClause; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table notification_teams + * + * @mbg.generated + */ + public void setDistinct(boolean distinct) { + this.distinct = distinct; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table notification_teams + * + * @mbg.generated + */ + public boolean isDistinct() { + return distinct; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table notification_teams + * + * @mbg.generated + */ + public List getOredCriteria() { + return oredCriteria; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table notification_teams + * + * @mbg.generated + */ + public void or(Criteria criteria) { + oredCriteria.add(criteria); + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table notification_teams + * + * @mbg.generated + */ + public Criteria or() { + Criteria criteria = createCriteriaInternal(); + oredCriteria.add(criteria); + return criteria; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table notification_teams + * + * @mbg.generated + */ + public Criteria createCriteria() { + Criteria criteria = createCriteriaInternal(); + if (oredCriteria.size() == 0) { + oredCriteria.add(criteria); + } + return criteria; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table notification_teams + * + * @mbg.generated + */ + protected Criteria createCriteriaInternal() { + Criteria criteria = new Criteria(); + return criteria; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table notification_teams + * + * @mbg.generated + */ + public void clear() { + oredCriteria.clear(); + orderByClause = null; + distinct = false; + } + + /** + * This class was generated by MyBatis Generator. + * This class corresponds to the database table notification_teams + * + * @mbg.generated + */ + protected abstract static class GeneratedCriteria { + protected List criteria; + + protected GeneratedCriteria() { + super(); + criteria = new ArrayList(); + } + + public boolean isValid() { + return criteria.size() > 0; + } + + public List getAllCriteria() { + return criteria; + } + + public List getCriteria() { + return criteria; + } + + protected void addCriterion(String condition) { + if (condition == null) { + throw new RuntimeException("Value for condition cannot be null"); + } + criteria.add(new Criterion(condition)); + } + + protected void addCriterion(String condition, Object value, String property) { + if (value == null) { + throw new RuntimeException("Value for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value)); + } + + protected void addCriterion(String condition, Object value1, Object value2, String property) { + if (value1 == null || value2 == null) { + throw new RuntimeException("Between values for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value1, value2)); + } + + public Criteria andIdIsNull() { + addCriterion("id is null"); + return (Criteria) this; + } + + public Criteria andIdIsNotNull() { + addCriterion("id is not null"); + return (Criteria) this; + } + + public Criteria andIdEqualTo(Long value) { + addCriterion("id =", value, "id"); + return (Criteria) this; + } + + public Criteria andIdNotEqualTo(Long value) { + addCriterion("id <>", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThan(Long value) { + addCriterion("id >", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThanOrEqualTo(Long value) { + addCriterion("id >=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThan(Long value) { + addCriterion("id <", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThanOrEqualTo(Long value) { + addCriterion("id <=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdIn(List values) { + addCriterion("id in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdNotIn(List values) { + addCriterion("id not in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdBetween(Long value1, Long value2) { + addCriterion("id between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andIdNotBetween(Long value1, Long value2) { + addCriterion("id not between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andCompanyIdIsNull() { + addCriterion("company_id is null"); + return (Criteria) this; + } + + public Criteria andCompanyIdIsNotNull() { + addCriterion("company_id is not null"); + return (Criteria) this; + } + + public Criteria andCompanyIdEqualTo(Long value) { + addCriterion("company_id =", value, "companyId"); + return (Criteria) this; + } + + public Criteria andCompanyIdNotEqualTo(Long value) { + addCriterion("company_id <>", value, "companyId"); + return (Criteria) this; + } + + public Criteria andCompanyIdGreaterThan(Long value) { + addCriterion("company_id >", value, "companyId"); + return (Criteria) this; + } + + public Criteria andCompanyIdGreaterThanOrEqualTo(Long value) { + addCriterion("company_id >=", value, "companyId"); + return (Criteria) this; + } + + public Criteria andCompanyIdLessThan(Long value) { + addCriterion("company_id <", value, "companyId"); + return (Criteria) this; + } + + public Criteria andCompanyIdLessThanOrEqualTo(Long value) { + addCriterion("company_id <=", value, "companyId"); + return (Criteria) this; + } + + public Criteria andCompanyIdIn(List values) { + addCriterion("company_id in", values, "companyId"); + return (Criteria) this; + } + + public Criteria andCompanyIdNotIn(List values) { + addCriterion("company_id not in", values, "companyId"); + return (Criteria) this; + } + + public Criteria andCompanyIdBetween(Long value1, Long value2) { + addCriterion("company_id between", value1, value2, "companyId"); + return (Criteria) this; + } + + public Criteria andCompanyIdNotBetween(Long value1, Long value2) { + addCriterion("company_id not between", value1, value2, "companyId"); + return (Criteria) this; + } + + public Criteria andIdentityIsNull() { + addCriterion("`identity` is null"); + return (Criteria) this; + } + + public Criteria andIdentityIsNotNull() { + addCriterion("`identity` is not null"); + return (Criteria) this; + } + + public Criteria andIdentityEqualTo(String value) { + addCriterion("`identity` =", value, "identity"); + return (Criteria) this; + } + + public Criteria andIdentityNotEqualTo(String value) { + addCriterion("`identity` <>", value, "identity"); + return (Criteria) this; + } + + public Criteria andIdentityGreaterThan(String value) { + addCriterion("`identity` >", value, "identity"); + return (Criteria) this; + } + + public Criteria andIdentityGreaterThanOrEqualTo(String value) { + addCriterion("`identity` >=", value, "identity"); + return (Criteria) this; + } + + public Criteria andIdentityLessThan(String value) { + addCriterion("`identity` <", value, "identity"); + return (Criteria) this; + } + + public Criteria andIdentityLessThanOrEqualTo(String value) { + addCriterion("`identity` <=", value, "identity"); + return (Criteria) this; + } + + public Criteria andIdentityLike(String value) { + addCriterion("`identity` like", value, "identity"); + return (Criteria) this; + } + + public Criteria andIdentityNotLike(String value) { + addCriterion("`identity` not like", value, "identity"); + return (Criteria) this; + } + + public Criteria andIdentityIn(List values) { + addCriterion("`identity` in", values, "identity"); + return (Criteria) this; + } + + public Criteria andIdentityNotIn(List values) { + addCriterion("`identity` not in", values, "identity"); + return (Criteria) this; + } + + public Criteria andIdentityBetween(String value1, String value2) { + addCriterion("`identity` between", value1, value2, "identity"); + return (Criteria) this; + } + + public Criteria andIdentityNotBetween(String value1, String value2) { + addCriterion("`identity` not between", value1, value2, "identity"); + return (Criteria) this; + } + + public Criteria andWebhookIsNull() { + addCriterion("webhook is null"); + return (Criteria) this; + } + + public Criteria andWebhookIsNotNull() { + addCriterion("webhook is not null"); + return (Criteria) this; + } + + public Criteria andWebhookEqualTo(String value) { + addCriterion("webhook =", value, "webhook"); + return (Criteria) this; + } + + public Criteria andWebhookNotEqualTo(String value) { + addCriterion("webhook <>", value, "webhook"); + return (Criteria) this; + } + + public Criteria andWebhookGreaterThan(String value) { + addCriterion("webhook >", value, "webhook"); + return (Criteria) this; + } + + public Criteria andWebhookGreaterThanOrEqualTo(String value) { + addCriterion("webhook >=", value, "webhook"); + return (Criteria) this; + } + + public Criteria andWebhookLessThan(String value) { + addCriterion("webhook <", value, "webhook"); + return (Criteria) this; + } + + public Criteria andWebhookLessThanOrEqualTo(String value) { + addCriterion("webhook <=", value, "webhook"); + return (Criteria) this; + } + + public Criteria andWebhookLike(String value) { + addCriterion("webhook like", value, "webhook"); + return (Criteria) this; + } + + public Criteria andWebhookNotLike(String value) { + addCriterion("webhook not like", value, "webhook"); + return (Criteria) this; + } + + public Criteria andWebhookIn(List values) { + addCriterion("webhook in", values, "webhook"); + return (Criteria) this; + } + + public Criteria andWebhookNotIn(List values) { + addCriterion("webhook not in", values, "webhook"); + return (Criteria) this; + } + + public Criteria andWebhookBetween(String value1, String value2) { + addCriterion("webhook between", value1, value2, "webhook"); + return (Criteria) this; + } + + public Criteria andWebhookNotBetween(String value1, String value2) { + addCriterion("webhook not between", value1, value2, "webhook"); + return (Criteria) this; + } + + public Criteria andRemarkIsNull() { + addCriterion("remark is null"); + return (Criteria) this; + } + + public Criteria andRemarkIsNotNull() { + addCriterion("remark is not null"); + return (Criteria) this; + } + + public Criteria andRemarkEqualTo(String value) { + addCriterion("remark =", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkNotEqualTo(String value) { + addCriterion("remark <>", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkGreaterThan(String value) { + addCriterion("remark >", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkGreaterThanOrEqualTo(String value) { + addCriterion("remark >=", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkLessThan(String value) { + addCriterion("remark <", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkLessThanOrEqualTo(String value) { + addCriterion("remark <=", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkLike(String value) { + addCriterion("remark like", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkNotLike(String value) { + addCriterion("remark not like", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkIn(List values) { + addCriterion("remark in", values, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkNotIn(List values) { + addCriterion("remark not in", values, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkBetween(String value1, String value2) { + addCriterion("remark between", value1, value2, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkNotBetween(String value1, String value2) { + addCriterion("remark not between", value1, value2, "remark"); + return (Criteria) this; + } + + public Criteria andFlagIsNull() { + addCriterion("flag is null"); + return (Criteria) this; + } + + public Criteria andFlagIsNotNull() { + addCriterion("flag is not null"); + return (Criteria) this; + } + + public Criteria andFlagEqualTo(Integer value) { + addCriterion("flag =", value, "flag"); + return (Criteria) this; + } + + public Criteria andFlagNotEqualTo(Integer value) { + addCriterion("flag <>", value, "flag"); + return (Criteria) this; + } + + public Criteria andFlagGreaterThan(Integer value) { + addCriterion("flag >", value, "flag"); + return (Criteria) this; + } + + public Criteria andFlagGreaterThanOrEqualTo(Integer value) { + addCriterion("flag >=", value, "flag"); + return (Criteria) this; + } + + public Criteria andFlagLessThan(Integer value) { + addCriterion("flag <", value, "flag"); + return (Criteria) this; + } + + public Criteria andFlagLessThanOrEqualTo(Integer value) { + addCriterion("flag <=", value, "flag"); + return (Criteria) this; + } + + public Criteria andFlagIn(List values) { + addCriterion("flag in", values, "flag"); + return (Criteria) this; + } + + public Criteria andFlagNotIn(List values) { + addCriterion("flag not in", values, "flag"); + return (Criteria) this; + } + + public Criteria andFlagBetween(Integer value1, Integer value2) { + addCriterion("flag between", value1, value2, "flag"); + return (Criteria) this; + } + + public Criteria andFlagNotBetween(Integer value1, Integer value2) { + addCriterion("flag not between", value1, value2, "flag"); + return (Criteria) this; + } + + public Criteria andCreatedByIsNull() { + addCriterion("created_by is null"); + return (Criteria) this; + } + + public Criteria andCreatedByIsNotNull() { + addCriterion("created_by is not null"); + return (Criteria) this; + } + + public Criteria andCreatedByEqualTo(Long value) { + addCriterion("created_by =", value, "createdBy"); + return (Criteria) this; + } + + public Criteria andCreatedByNotEqualTo(Long value) { + addCriterion("created_by <>", value, "createdBy"); + return (Criteria) this; + } + + public Criteria andCreatedByGreaterThan(Long value) { + addCriterion("created_by >", value, "createdBy"); + return (Criteria) this; + } + + public Criteria andCreatedByGreaterThanOrEqualTo(Long value) { + addCriterion("created_by >=", value, "createdBy"); + return (Criteria) this; + } + + public Criteria andCreatedByLessThan(Long value) { + addCriterion("created_by <", value, "createdBy"); + return (Criteria) this; + } + + public Criteria andCreatedByLessThanOrEqualTo(Long value) { + addCriterion("created_by <=", value, "createdBy"); + return (Criteria) this; + } + + public Criteria andCreatedByIn(List values) { + addCriterion("created_by in", values, "createdBy"); + return (Criteria) this; + } + + public Criteria andCreatedByNotIn(List values) { + addCriterion("created_by not in", values, "createdBy"); + return (Criteria) this; + } + + public Criteria andCreatedByBetween(Long value1, Long value2) { + addCriterion("created_by between", value1, value2, "createdBy"); + return (Criteria) this; + } + + public Criteria andCreatedByNotBetween(Long value1, Long value2) { + addCriterion("created_by not between", value1, value2, "createdBy"); + return (Criteria) this; + } + + public Criteria andCreatedAtIsNull() { + addCriterion("created_at is null"); + return (Criteria) this; + } + + public Criteria andCreatedAtIsNotNull() { + addCriterion("created_at is not null"); + return (Criteria) this; + } + + public Criteria andCreatedAtEqualTo(Long value) { + addCriterion("created_at =", value, "createdAt"); + return (Criteria) this; + } + + public Criteria andCreatedAtNotEqualTo(Long value) { + addCriterion("created_at <>", value, "createdAt"); + return (Criteria) this; + } + + public Criteria andCreatedAtGreaterThan(Long value) { + addCriterion("created_at >", value, "createdAt"); + return (Criteria) this; + } + + public Criteria andCreatedAtGreaterThanOrEqualTo(Long value) { + addCriterion("created_at >=", value, "createdAt"); + return (Criteria) this; + } + + public Criteria andCreatedAtLessThan(Long value) { + addCriterion("created_at <", value, "createdAt"); + return (Criteria) this; + } + + public Criteria andCreatedAtLessThanOrEqualTo(Long value) { + addCriterion("created_at <=", value, "createdAt"); + return (Criteria) this; + } + + public Criteria andCreatedAtIn(List values) { + addCriterion("created_at in", values, "createdAt"); + return (Criteria) this; + } + + public Criteria andCreatedAtNotIn(List values) { + addCriterion("created_at not in", values, "createdAt"); + return (Criteria) this; + } + + public Criteria andCreatedAtBetween(Long value1, Long value2) { + addCriterion("created_at between", value1, value2, "createdAt"); + return (Criteria) this; + } + + public Criteria andCreatedAtNotBetween(Long value1, Long value2) { + addCriterion("created_at not between", value1, value2, "createdAt"); + return (Criteria) this; + } + } + + /** + * This class was generated by MyBatis Generator. + * This class corresponds to the database table notification_teams + * + * @mbg.generated do_not_delete_during_merge + */ + public static class Criteria extends GeneratedCriteria { + + protected Criteria() { + super(); + } + } + + /** + * This class was generated by MyBatis Generator. + * This class corresponds to the database table notification_teams + * + * @mbg.generated + */ + public static class Criterion { + private String condition; + + private Object value; + + private Object secondValue; + + private boolean noValue; + + private boolean singleValue; + + private boolean betweenValue; + + private boolean listValue; + + private String typeHandler; + + public String getCondition() { + return condition; + } + + public Object getValue() { + return value; + } + + public Object getSecondValue() { + return secondValue; + } + + public boolean isNoValue() { + return noValue; + } + + public boolean isSingleValue() { + return singleValue; + } + + public boolean isBetweenValue() { + return betweenValue; + } + + public boolean isListValue() { + return listValue; + } + + public String getTypeHandler() { + return typeHandler; + } + + protected Criterion(String condition) { + super(); + this.condition = condition; + this.typeHandler = null; + this.noValue = true; + } + + protected Criterion(String condition, Object value, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.typeHandler = typeHandler; + if (value instanceof List) { + this.listValue = true; + } else { + this.singleValue = true; + } + } + + protected Criterion(String condition, Object value) { + this(condition, value, null); + } + + protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.secondValue = secondValue; + this.typeHandler = typeHandler; + this.betweenValue = true; + } + + protected Criterion(String condition, Object value, Object secondValue) { + this(condition, value, secondValue, null); + } + } +} \ No newline at end of file diff --git a/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/model/SysEnv.java b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/model/SysEnv.java new file mode 100644 index 0000000..1cc77cd --- /dev/null +++ b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/model/SysEnv.java @@ -0,0 +1,98 @@ +package com.dongjian.dashboard.back.model; + +import java.io.Serializable; + +public class SysEnv implements Serializable { + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column sys_env.env_key + * + * @mbg.generated + */ + private String envKey; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column sys_env.env_value + * + * @mbg.generated + */ + private String envValue; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database table sys_env + * + * @mbg.generated + */ + private static final long serialVersionUID = 1L; + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column sys_env.env_key + * + * @return the value of sys_env.env_key + * + * @mbg.generated + */ + public String getEnvKey() { + return envKey; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column sys_env.env_key + * + * @param envKey the value for sys_env.env_key + * + * @mbg.generated + */ + public void setEnvKey(String envKey) { + this.envKey = envKey == null ? null : envKey.trim(); + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column sys_env.env_value + * + * @return the value of sys_env.env_value + * + * @mbg.generated + */ + public String getEnvValue() { + return envValue; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column sys_env.env_value + * + * @param envValue the value for sys_env.env_value + * + * @mbg.generated + */ + public void setEnvValue(String envValue) { + this.envValue = envValue == null ? null : envValue.trim(); + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table sys_env + * + * @mbg.generated + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append(getClass().getSimpleName()); + sb.append(" ["); + sb.append("Hash = ").append(hashCode()); + sb.append(", envKey=").append(envKey); + sb.append(", envValue=").append(envValue); + sb.append(", serialVersionUID=").append(serialVersionUID); + sb.append("]"); + return sb.toString(); + } +} \ No newline at end of file diff --git a/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/model/SysEnvExample.java b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/model/SysEnvExample.java new file mode 100644 index 0000000..3ba0454 --- /dev/null +++ b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/model/SysEnvExample.java @@ -0,0 +1,442 @@ +package com.dongjian.dashboard.back.model; + +import java.util.ArrayList; +import java.util.List; + +public class SysEnvExample { + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database table sys_env + * + * @mbg.generated + */ + protected String orderByClause; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database table sys_env + * + * @mbg.generated + */ + protected boolean distinct; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database table sys_env + * + * @mbg.generated + */ + protected List oredCriteria; + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table sys_env + * + * @mbg.generated + */ + public SysEnvExample() { + oredCriteria = new ArrayList(); + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table sys_env + * + * @mbg.generated + */ + public void setOrderByClause(String orderByClause) { + this.orderByClause = orderByClause; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table sys_env + * + * @mbg.generated + */ + public String getOrderByClause() { + return orderByClause; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table sys_env + * + * @mbg.generated + */ + public void setDistinct(boolean distinct) { + this.distinct = distinct; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table sys_env + * + * @mbg.generated + */ + public boolean isDistinct() { + return distinct; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table sys_env + * + * @mbg.generated + */ + public List getOredCriteria() { + return oredCriteria; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table sys_env + * + * @mbg.generated + */ + public void or(Criteria criteria) { + oredCriteria.add(criteria); + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table sys_env + * + * @mbg.generated + */ + public Criteria or() { + Criteria criteria = createCriteriaInternal(); + oredCriteria.add(criteria); + return criteria; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table sys_env + * + * @mbg.generated + */ + public Criteria createCriteria() { + Criteria criteria = createCriteriaInternal(); + if (oredCriteria.size() == 0) { + oredCriteria.add(criteria); + } + return criteria; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table sys_env + * + * @mbg.generated + */ + protected Criteria createCriteriaInternal() { + Criteria criteria = new Criteria(); + return criteria; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table sys_env + * + * @mbg.generated + */ + public void clear() { + oredCriteria.clear(); + orderByClause = null; + distinct = false; + } + + /** + * This class was generated by MyBatis Generator. + * This class corresponds to the database table sys_env + * + * @mbg.generated + */ + protected abstract static class GeneratedCriteria { + protected List criteria; + + protected GeneratedCriteria() { + super(); + criteria = new ArrayList(); + } + + public boolean isValid() { + return criteria.size() > 0; + } + + public List getAllCriteria() { + return criteria; + } + + public List getCriteria() { + return criteria; + } + + protected void addCriterion(String condition) { + if (condition == null) { + throw new RuntimeException("Value for condition cannot be null"); + } + criteria.add(new Criterion(condition)); + } + + protected void addCriterion(String condition, Object value, String property) { + if (value == null) { + throw new RuntimeException("Value for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value)); + } + + protected void addCriterion(String condition, Object value1, Object value2, String property) { + if (value1 == null || value2 == null) { + throw new RuntimeException("Between values for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value1, value2)); + } + + public Criteria andEnvKeyIsNull() { + addCriterion("env_key is null"); + return (Criteria) this; + } + + public Criteria andEnvKeyIsNotNull() { + addCriterion("env_key is not null"); + return (Criteria) this; + } + + public Criteria andEnvKeyEqualTo(String value) { + addCriterion("env_key =", value, "envKey"); + return (Criteria) this; + } + + public Criteria andEnvKeyNotEqualTo(String value) { + addCriterion("env_key <>", value, "envKey"); + return (Criteria) this; + } + + public Criteria andEnvKeyGreaterThan(String value) { + addCriterion("env_key >", value, "envKey"); + return (Criteria) this; + } + + public Criteria andEnvKeyGreaterThanOrEqualTo(String value) { + addCriterion("env_key >=", value, "envKey"); + return (Criteria) this; + } + + public Criteria andEnvKeyLessThan(String value) { + addCriterion("env_key <", value, "envKey"); + return (Criteria) this; + } + + public Criteria andEnvKeyLessThanOrEqualTo(String value) { + addCriterion("env_key <=", value, "envKey"); + return (Criteria) this; + } + + public Criteria andEnvKeyLike(String value) { + addCriterion("env_key like", value, "envKey"); + return (Criteria) this; + } + + public Criteria andEnvKeyNotLike(String value) { + addCriterion("env_key not like", value, "envKey"); + return (Criteria) this; + } + + public Criteria andEnvKeyIn(List values) { + addCriterion("env_key in", values, "envKey"); + return (Criteria) this; + } + + public Criteria andEnvKeyNotIn(List values) { + addCriterion("env_key not in", values, "envKey"); + return (Criteria) this; + } + + public Criteria andEnvKeyBetween(String value1, String value2) { + addCriterion("env_key between", value1, value2, "envKey"); + return (Criteria) this; + } + + public Criteria andEnvKeyNotBetween(String value1, String value2) { + addCriterion("env_key not between", value1, value2, "envKey"); + return (Criteria) this; + } + + public Criteria andEnvValueIsNull() { + addCriterion("env_value is null"); + return (Criteria) this; + } + + public Criteria andEnvValueIsNotNull() { + addCriterion("env_value is not null"); + return (Criteria) this; + } + + public Criteria andEnvValueEqualTo(String value) { + addCriterion("env_value =", value, "envValue"); + return (Criteria) this; + } + + public Criteria andEnvValueNotEqualTo(String value) { + addCriterion("env_value <>", value, "envValue"); + return (Criteria) this; + } + + public Criteria andEnvValueGreaterThan(String value) { + addCriterion("env_value >", value, "envValue"); + return (Criteria) this; + } + + public Criteria andEnvValueGreaterThanOrEqualTo(String value) { + addCriterion("env_value >=", value, "envValue"); + return (Criteria) this; + } + + public Criteria andEnvValueLessThan(String value) { + addCriterion("env_value <", value, "envValue"); + return (Criteria) this; + } + + public Criteria andEnvValueLessThanOrEqualTo(String value) { + addCriterion("env_value <=", value, "envValue"); + return (Criteria) this; + } + + public Criteria andEnvValueLike(String value) { + addCriterion("env_value like", value, "envValue"); + return (Criteria) this; + } + + public Criteria andEnvValueNotLike(String value) { + addCriterion("env_value not like", value, "envValue"); + return (Criteria) this; + } + + public Criteria andEnvValueIn(List values) { + addCriterion("env_value in", values, "envValue"); + return (Criteria) this; + } + + public Criteria andEnvValueNotIn(List values) { + addCriterion("env_value not in", values, "envValue"); + return (Criteria) this; + } + + public Criteria andEnvValueBetween(String value1, String value2) { + addCriterion("env_value between", value1, value2, "envValue"); + return (Criteria) this; + } + + public Criteria andEnvValueNotBetween(String value1, String value2) { + addCriterion("env_value not between", value1, value2, "envValue"); + return (Criteria) this; + } + } + + /** + * This class was generated by MyBatis Generator. + * This class corresponds to the database table sys_env + * + * @mbg.generated do_not_delete_during_merge + */ + public static class Criteria extends GeneratedCriteria { + + protected Criteria() { + super(); + } + } + + /** + * This class was generated by MyBatis Generator. + * This class corresponds to the database table sys_env + * + * @mbg.generated + */ + public static class Criterion { + private String condition; + + private Object value; + + private Object secondValue; + + private boolean noValue; + + private boolean singleValue; + + private boolean betweenValue; + + private boolean listValue; + + private String typeHandler; + + public String getCondition() { + return condition; + } + + public Object getValue() { + return value; + } + + public Object getSecondValue() { + return secondValue; + } + + public boolean isNoValue() { + return noValue; + } + + public boolean isSingleValue() { + return singleValue; + } + + public boolean isBetweenValue() { + return betweenValue; + } + + public boolean isListValue() { + return listValue; + } + + public String getTypeHandler() { + return typeHandler; + } + + protected Criterion(String condition) { + super(); + this.condition = condition; + this.typeHandler = null; + this.noValue = true; + } + + protected Criterion(String condition, Object value, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.typeHandler = typeHandler; + if (value instanceof List) { + this.listValue = true; + } else { + this.singleValue = true; + } + } + + protected Criterion(String condition, Object value) { + this(condition, value, null); + } + + protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.secondValue = secondValue; + this.typeHandler = typeHandler; + this.betweenValue = true; + } + + protected Criterion(String condition, Object value, Object secondValue) { + this(condition, value, secondValue, null); + } + } +} \ No newline at end of file diff --git a/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/model/UserBuildingRelation.java b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/model/UserBuildingRelation.java new file mode 100644 index 0000000..6feeef0 --- /dev/null +++ b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/model/UserBuildingRelation.java @@ -0,0 +1,132 @@ +package com.dongjian.dashboard.back.model; + +import java.io.Serializable; + +public class UserBuildingRelation implements Serializable { + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column user_building_relation.user_id + * + * @mbg.generated + */ + private Long userId; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column user_building_relation.building_id + * + * @mbg.generated + */ + private Long buildingId; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column user_building_relation.create_time + * + * @mbg.generated + */ + private Long createTime; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database table user_building_relation + * + * @mbg.generated + */ + private static final long serialVersionUID = 1L; + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column user_building_relation.user_id + * + * @return the value of user_building_relation.user_id + * + * @mbg.generated + */ + public Long getUserId() { + return userId; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column user_building_relation.user_id + * + * @param userId the value for user_building_relation.user_id + * + * @mbg.generated + */ + public void setUserId(Long userId) { + this.userId = userId; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column user_building_relation.building_id + * + * @return the value of user_building_relation.building_id + * + * @mbg.generated + */ + public Long getBuildingId() { + return buildingId; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column user_building_relation.building_id + * + * @param buildingId the value for user_building_relation.building_id + * + * @mbg.generated + */ + public void setBuildingId(Long buildingId) { + this.buildingId = buildingId; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column user_building_relation.create_time + * + * @return the value of user_building_relation.create_time + * + * @mbg.generated + */ + public Long getCreateTime() { + return createTime; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column user_building_relation.create_time + * + * @param createTime the value for user_building_relation.create_time + * + * @mbg.generated + */ + public void setCreateTime(Long createTime) { + this.createTime = createTime; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table user_building_relation + * + * @mbg.generated + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append(getClass().getSimpleName()); + sb.append(" ["); + sb.append("Hash = ").append(hashCode()); + sb.append(", userId=").append(userId); + sb.append(", buildingId=").append(buildingId); + sb.append(", createTime=").append(createTime); + sb.append(", serialVersionUID=").append(serialVersionUID); + sb.append("]"); + return sb.toString(); + } +} \ No newline at end of file diff --git a/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/model/UserBuildingRelationExample.java b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/model/UserBuildingRelationExample.java new file mode 100644 index 0000000..50f25e7 --- /dev/null +++ b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/model/UserBuildingRelationExample.java @@ -0,0 +1,482 @@ +package com.dongjian.dashboard.back.model; + +import java.util.ArrayList; +import java.util.List; + +public class UserBuildingRelationExample { + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database table user_building_relation + * + * @mbg.generated + */ + protected String orderByClause; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database table user_building_relation + * + * @mbg.generated + */ + protected boolean distinct; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database table user_building_relation + * + * @mbg.generated + */ + protected List oredCriteria; + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table user_building_relation + * + * @mbg.generated + */ + public UserBuildingRelationExample() { + oredCriteria = new ArrayList(); + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table user_building_relation + * + * @mbg.generated + */ + public void setOrderByClause(String orderByClause) { + this.orderByClause = orderByClause; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table user_building_relation + * + * @mbg.generated + */ + public String getOrderByClause() { + return orderByClause; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table user_building_relation + * + * @mbg.generated + */ + public void setDistinct(boolean distinct) { + this.distinct = distinct; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table user_building_relation + * + * @mbg.generated + */ + public boolean isDistinct() { + return distinct; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table user_building_relation + * + * @mbg.generated + */ + public List getOredCriteria() { + return oredCriteria; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table user_building_relation + * + * @mbg.generated + */ + public void or(Criteria criteria) { + oredCriteria.add(criteria); + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table user_building_relation + * + * @mbg.generated + */ + public Criteria or() { + Criteria criteria = createCriteriaInternal(); + oredCriteria.add(criteria); + return criteria; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table user_building_relation + * + * @mbg.generated + */ + public Criteria createCriteria() { + Criteria criteria = createCriteriaInternal(); + if (oredCriteria.size() == 0) { + oredCriteria.add(criteria); + } + return criteria; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table user_building_relation + * + * @mbg.generated + */ + protected Criteria createCriteriaInternal() { + Criteria criteria = new Criteria(); + return criteria; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table user_building_relation + * + * @mbg.generated + */ + public void clear() { + oredCriteria.clear(); + orderByClause = null; + distinct = false; + } + + /** + * This class was generated by MyBatis Generator. + * This class corresponds to the database table user_building_relation + * + * @mbg.generated + */ + protected abstract static class GeneratedCriteria { + protected List criteria; + + protected GeneratedCriteria() { + super(); + criteria = new ArrayList(); + } + + public boolean isValid() { + return criteria.size() > 0; + } + + public List getAllCriteria() { + return criteria; + } + + public List getCriteria() { + return criteria; + } + + protected void addCriterion(String condition) { + if (condition == null) { + throw new RuntimeException("Value for condition cannot be null"); + } + criteria.add(new Criterion(condition)); + } + + protected void addCriterion(String condition, Object value, String property) { + if (value == null) { + throw new RuntimeException("Value for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value)); + } + + protected void addCriterion(String condition, Object value1, Object value2, String property) { + if (value1 == null || value2 == null) { + throw new RuntimeException("Between values for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value1, value2)); + } + + public Criteria andUserIdIsNull() { + addCriterion("user_id is null"); + return (Criteria) this; + } + + public Criteria andUserIdIsNotNull() { + addCriterion("user_id is not null"); + return (Criteria) this; + } + + public Criteria andUserIdEqualTo(Long value) { + addCriterion("user_id =", value, "userId"); + return (Criteria) this; + } + + public Criteria andUserIdNotEqualTo(Long value) { + addCriterion("user_id <>", value, "userId"); + return (Criteria) this; + } + + public Criteria andUserIdGreaterThan(Long value) { + addCriterion("user_id >", value, "userId"); + return (Criteria) this; + } + + public Criteria andUserIdGreaterThanOrEqualTo(Long value) { + addCriterion("user_id >=", value, "userId"); + return (Criteria) this; + } + + public Criteria andUserIdLessThan(Long value) { + addCriterion("user_id <", value, "userId"); + return (Criteria) this; + } + + public Criteria andUserIdLessThanOrEqualTo(Long value) { + addCriterion("user_id <=", value, "userId"); + return (Criteria) this; + } + + public Criteria andUserIdIn(List values) { + addCriterion("user_id in", values, "userId"); + return (Criteria) this; + } + + public Criteria andUserIdNotIn(List values) { + addCriterion("user_id not in", values, "userId"); + return (Criteria) this; + } + + public Criteria andUserIdBetween(Long value1, Long value2) { + addCriterion("user_id between", value1, value2, "userId"); + return (Criteria) this; + } + + public Criteria andUserIdNotBetween(Long value1, Long value2) { + addCriterion("user_id not between", value1, value2, "userId"); + return (Criteria) this; + } + + public Criteria andBuildingIdIsNull() { + addCriterion("building_id is null"); + return (Criteria) this; + } + + public Criteria andBuildingIdIsNotNull() { + addCriterion("building_id is not null"); + return (Criteria) this; + } + + public Criteria andBuildingIdEqualTo(Long value) { + addCriterion("building_id =", value, "buildingId"); + return (Criteria) this; + } + + public Criteria andBuildingIdNotEqualTo(Long value) { + addCriterion("building_id <>", value, "buildingId"); + return (Criteria) this; + } + + public Criteria andBuildingIdGreaterThan(Long value) { + addCriterion("building_id >", value, "buildingId"); + return (Criteria) this; + } + + public Criteria andBuildingIdGreaterThanOrEqualTo(Long value) { + addCriterion("building_id >=", value, "buildingId"); + return (Criteria) this; + } + + public Criteria andBuildingIdLessThan(Long value) { + addCriterion("building_id <", value, "buildingId"); + return (Criteria) this; + } + + public Criteria andBuildingIdLessThanOrEqualTo(Long value) { + addCriterion("building_id <=", value, "buildingId"); + return (Criteria) this; + } + + public Criteria andBuildingIdIn(List values) { + addCriterion("building_id in", values, "buildingId"); + return (Criteria) this; + } + + public Criteria andBuildingIdNotIn(List values) { + addCriterion("building_id not in", values, "buildingId"); + return (Criteria) this; + } + + public Criteria andBuildingIdBetween(Long value1, Long value2) { + addCriterion("building_id between", value1, value2, "buildingId"); + return (Criteria) this; + } + + public Criteria andBuildingIdNotBetween(Long value1, Long value2) { + addCriterion("building_id not between", value1, value2, "buildingId"); + return (Criteria) this; + } + + public Criteria andCreateTimeIsNull() { + addCriterion("create_time is null"); + return (Criteria) this; + } + + public Criteria andCreateTimeIsNotNull() { + addCriterion("create_time is not null"); + return (Criteria) this; + } + + public Criteria andCreateTimeEqualTo(Long value) { + addCriterion("create_time =", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeNotEqualTo(Long value) { + addCriterion("create_time <>", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeGreaterThan(Long value) { + addCriterion("create_time >", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeGreaterThanOrEqualTo(Long value) { + addCriterion("create_time >=", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeLessThan(Long value) { + addCriterion("create_time <", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeLessThanOrEqualTo(Long value) { + addCriterion("create_time <=", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeIn(List values) { + addCriterion("create_time in", values, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeNotIn(List values) { + addCriterion("create_time not in", values, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeBetween(Long value1, Long value2) { + addCriterion("create_time between", value1, value2, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeNotBetween(Long value1, Long value2) { + addCriterion("create_time not between", value1, value2, "createTime"); + return (Criteria) this; + } + } + + /** + * This class was generated by MyBatis Generator. + * This class corresponds to the database table user_building_relation + * + * @mbg.generated do_not_delete_during_merge + */ + public static class Criteria extends GeneratedCriteria { + + protected Criteria() { + super(); + } + } + + /** + * This class was generated by MyBatis Generator. + * This class corresponds to the database table user_building_relation + * + * @mbg.generated + */ + public static class Criterion { + private String condition; + + private Object value; + + private Object secondValue; + + private boolean noValue; + + private boolean singleValue; + + private boolean betweenValue; + + private boolean listValue; + + private String typeHandler; + + public String getCondition() { + return condition; + } + + public Object getValue() { + return value; + } + + public Object getSecondValue() { + return secondValue; + } + + public boolean isNoValue() { + return noValue; + } + + public boolean isSingleValue() { + return singleValue; + } + + public boolean isBetweenValue() { + return betweenValue; + } + + public boolean isListValue() { + return listValue; + } + + public String getTypeHandler() { + return typeHandler; + } + + protected Criterion(String condition) { + super(); + this.condition = condition; + this.typeHandler = null; + this.noValue = true; + } + + protected Criterion(String condition, Object value, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.typeHandler = typeHandler; + if (value instanceof List) { + this.listValue = true; + } else { + this.singleValue = true; + } + } + + protected Criterion(String condition, Object value) { + this(condition, value, null); + } + + protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.secondValue = secondValue; + this.typeHandler = typeHandler; + this.betweenValue = true; + } + + protected Criterion(String condition, Object value, Object secondValue) { + this(condition, value, secondValue, null); + } + } +} \ No newline at end of file diff --git a/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/vo/TreeMenusDTO.java b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/vo/TreeMenusDTO.java new file mode 100644 index 0000000..79aa6d5 --- /dev/null +++ b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/vo/TreeMenusDTO.java @@ -0,0 +1,27 @@ +package com.dongjian.dashboard.back.vo; + +import java.util.List; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** +* @author Mr.Jiang +* @time 2022年7月29日 下午4:37:50 +*/ +@Data +public class TreeMenusDTO { + + @Schema(description = "节点ID",example = "11", required = true) + private String key; + + @Schema(description = "父节点ID",example = "2", hidden = true) + private String parentKey; + + @Schema(description = "节点名称",example = "添加", required = true) + private String label; + + @Schema(description = "子节点",example = "[]", required = false) + private List children; + +} diff --git a/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/vo/building/BindedBuildingVO.java b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/vo/building/BindedBuildingVO.java new file mode 100644 index 0000000..0dda61d --- /dev/null +++ b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/vo/building/BindedBuildingVO.java @@ -0,0 +1,26 @@ +package com.dongjian.dashboard.back.vo.building; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** +* @author Mr.Jiang +* @time 2022年7月21日 下午8:50:31 +*/ +@Data +public class BindedBuildingVO{ + + @Schema(description = "Building ID (unique identifier, not applicable for new entries)", example = "2738967") + private Long buildingId; + + @Schema(description = "Building name", example = "testBuilding1", required = true) + private String buildingName; + + @Schema(description = "Address", example = "日本我孙子市", required = true) + private String address; + + @Schema(description = "User-defined building ID", example = "123AAA6", required = true) + private String udfBuildingId; + + +} diff --git a/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/vo/building/BuildingPageVO.java b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/vo/building/BuildingPageVO.java new file mode 100644 index 0000000..d1cde54 --- /dev/null +++ b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/vo/building/BuildingPageVO.java @@ -0,0 +1,50 @@ +package com.dongjian.dashboard.back.vo.building; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** +* @author Mr.Jiang +* @time 2022年7月21日 下午8:50:31 +*/ +@Data +public class BuildingPageVO{ + + @Schema(description = "Building ID (unique identifier, not applicable for new entries)", example = "2738967") + private Long buildingId; + + @Schema(description = "Company ID", example = "2738967") + private Long companyId; + + @Schema(description = "Company name", example = "testCompany1", required = true) + private String companyName; + + @Schema(description = "Building name", example = "testBuilding1", required = true) + private String buildingName; + + @Schema(description = "Address", example = "日本我孙子市", required = true) + private String address; + + @Schema(description = "User-defined building ID", example = "123AAA6", required = true) + private String udfBuildingId; + + @Schema(description ="Autodesk Cloud BIM Model Key", example = "123AAA6", required = true) + private String buildingBucket; + + @Schema(description ="Custom floor info", example = "[]", required = true) + private String floorInfoList; + + @Schema(description ="Building image number", example = "2") + private Integer thumbnailNum; + + @Schema(description ="displayed on the 2d3d, 0-yes, 1-no", example = "1") + private Integer showSwitch2d3d; + + @Schema(description ="Brief Introduction", example = "123AAA6", required = false) + private String briefIntroduction; + + @Schema(description = "images info", example = "{}", hidden = false) + private String pictureIntroduction; + + +} diff --git a/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/vo/company/AuroraInfo.java b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/vo/company/AuroraInfo.java new file mode 100644 index 0000000..89b68bf --- /dev/null +++ b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/vo/company/AuroraInfo.java @@ -0,0 +1,20 @@ +package com.dongjian.dashboard.back.vo.company; + +import lombok.Data; + +@Data +public class AuroraInfo { + + private Long id; + + private Long parentId; + + private String auroraUrl; + + private String auroraReadUrl; + + private String auroraUsername; + + private String auroraPassword; + +} diff --git a/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/vo/company/CompanyPageDTO.java b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/vo/company/CompanyPageDTO.java new file mode 100644 index 0000000..a016949 --- /dev/null +++ b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/vo/company/CompanyPageDTO.java @@ -0,0 +1,42 @@ +package com.dongjian.dashboard.back.vo.company; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** +* @author Mr.Jiang +* @time 2022年7月21日 下午8:50:31 +*/ +@Data +public class CompanyPageDTO{ + + @Schema(description = "企业唯一标识ID,新增时无此参数",example = "2738967") + private Long companyId; + + @Schema(description = "企业名称",example = "testAccount1", required = true) + private String companyName; + + @Schema(description = "所属企业ID",example = "2738967") + private Long parentId; + + @Schema(description = "所属企业名称",example = "testAccount1", required = true) + private String parentCompanyName; + + @Schema(description = "mfa开关,0-关闭,1-开启",example = "1", required = true) + private Integer mfaSwitch; + +// @Schema(description = "Aurora等组件状态,0-未创建,1-创建中,2-创建成功,3-创建失败",example = "1", required = true) +// private Integer auroraFlag; + + @Schema(description = "apikey",example = "4sr8323set347", required = true) + private String apikey; + + @Schema(description = "Bearer Token",example = "Bearer Token1111111", required = true) + private String bearerToken; + + @Schema(description = "third api host",example = "www.baiduc.com", required = true) + private String thirdApiHost; + + @Schema(description = "Lock the account after 5 failed login attempts. 0 - Off, 1 - On", example = "1") + private Integer lockSwitch; +} diff --git a/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/vo/data/BaseData.java b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/vo/data/BaseData.java new file mode 100644 index 0000000..de8b255 --- /dev/null +++ b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/vo/data/BaseData.java @@ -0,0 +1,48 @@ +package com.dongjian.dashboard.back.vo.data; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +@Data +public class BaseData { + + @Schema(description = "id", example = "1740033000234", hidden = true) + private Long id; + + @Schema(description = "deviceId", example = "12-34") + private String deviceId; + + @Schema(description = "upload timestamp", example = "1740033000234") + private Long uploadTimestamp; + + @Schema(description = "monitoring point name", example = "name11") + private String monitoringPointName; + + @Schema(description = "floor name", example = "floor 2") + private String floorName; + + @Schema(description = "monitoring point category name", example = "category2") + private String monitoringPointCategoryName; + + @Schema(description = "gateway info name", example = "2738967") + private String gatewayInfoName; + + @Schema(description = "data provider name", example = "aliyun") + private String dataProviderName; + + @Schema(description = "data provider icon", example = "") + private String dataProviderThumbnailBase64; + + @Schema(description = "device type", example = "86") + private Integer typeId; + + @Schema(description = "1-警报设备,2-积算设备,3-计测设备,4-运行状态设备",example = "1") + private Integer classId; + + @Schema(description = "0 - Not Favorite, 1 - Favorite", example = "1") + private Integer collected; + + @Schema(description = "dashboard自动恢复告警时是否保留告警:0-不保留,1-保留", example = "1") + private Integer retainAlert; + +} diff --git a/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/vo/data/DeviceAccumulateData.java b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/vo/data/DeviceAccumulateData.java new file mode 100644 index 0000000..0605b5b --- /dev/null +++ b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/vo/data/DeviceAccumulateData.java @@ -0,0 +1,26 @@ +package com.dongjian.dashboard.back.vo.data; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import lombok.EqualsAndHashCode; + +@EqualsAndHashCode(callSuper = true) +@Data +public class DeviceAccumulateData extends BaseData{ + + @Schema(description = "cumulative value", example = "12.557") + private String cumulativeValue; + + @Schema(description = "yesterday's value", example = "10.4") + private String yesterdayValue; + + @Schema(description = "Last Year's Value", example = "11") + private String lastYearValue; + + @Schema(description = "unit", example = "cm") + private String unit; + + @Schema(description = "raw data", example = "", hidden = true) + private String rawData; + +} diff --git a/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/vo/data/DeviceAlarmData.java b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/vo/data/DeviceAlarmData.java new file mode 100644 index 0000000..21651db --- /dev/null +++ b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/vo/data/DeviceAlarmData.java @@ -0,0 +1,34 @@ +package com.dongjian.dashboard.back.vo.data; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import lombok.EqualsAndHashCode; + +@EqualsAndHashCode(callSuper = true) +@Data +public class DeviceAlarmData extends BaseData{ + + @Schema(description = "告警记录ID",example = "122") + private Long alertHistoryId; + + @Schema(description = "警报级别,1-正常,2-紧急,3-严重故障,4-中等故障,5-轻微故障", example = "12.557") + private Integer alertLevel; + + @Schema(description = "警报级别", example = "12.557") + private String alertLevelStr; + + @Schema(description = "处理状态, 1-未对应,2-对应中,3-完了,4-自动恢复", example = "3") + private Integer handleStatus; + + @Schema(description = "处理状态", example = "完了") + private String handleStatusStr; + + + @Schema(description = "确认状态,0-未确认,1-确认", example = "1") + private Integer confirmStatus; + + @Schema(description = "确认状态", example = "未確認") + private String confirmStatusStr; + + +} diff --git a/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/vo/data/DeviceBaStatusData.java b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/vo/data/DeviceBaStatusData.java new file mode 100644 index 0000000..f943e1f --- /dev/null +++ b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/vo/data/DeviceBaStatusData.java @@ -0,0 +1,26 @@ +package com.dongjian.dashboard.back.vo.data; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import lombok.EqualsAndHashCode; + +@EqualsAndHashCode(callSuper = true) +@Data +public class DeviceBaStatusData extends BaseData{ + + @Schema(description = "running status: 0-停止, 1-运行", example = "1") + private Integer runningStatus; + + @Schema(description = "last start time", example = "1720000000000") + private Long lastStartTime; + + @Schema(description = "last stop time", example = "1720000000000") + private Long lastStopTime; + + @Schema(description = "continuous running time", example = "117", hidden = true) + private Long continuousRunningTime; + + @Schema(description = "continuous running time", example = "0h 11m 45s") + private String continuousRunningTimeStr; + +} diff --git a/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/vo/data/DeviceMeasureData.java b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/vo/data/DeviceMeasureData.java new file mode 100644 index 0000000..669b63d --- /dev/null +++ b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/vo/data/DeviceMeasureData.java @@ -0,0 +1,26 @@ +package com.dongjian.dashboard.back.vo.data; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import lombok.EqualsAndHashCode; + +@EqualsAndHashCode(callSuper = true) +@Data +public class DeviceMeasureData extends BaseData{ + + @Schema(description = "cumulative value", example = "12.557") + private String measurementValue; + + @Schema(description = "Maximum value", example = "10.4") + private String maxValue; + + @Schema(description = "Minimum value", example = "11") + private String minValue; + + @Schema(description = "unit", example = "cm") + private String unit; + + @Schema(description = "raw data", example = "", hidden = true) + private String rawData; + +} diff --git a/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/vo/data/HandleHistoryDataVO.java b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/vo/data/HandleHistoryDataVO.java new file mode 100644 index 0000000..20938d4 --- /dev/null +++ b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/vo/data/HandleHistoryDataVO.java @@ -0,0 +1,32 @@ +package com.dongjian.dashboard.back.vo.data; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import lombok.EqualsAndHashCode; + +@Data +public class HandleHistoryDataVO{ + + @Schema(description = "记录ID",example = "122") + private Long id; + + @Schema(description = "处理时间", example = "12.557") + private Long handleAt; + + @Schema(description = "处理者", example = "12.557") + private String handler; + + @Schema(description = "处理内容", example = "3") + private String remark; + + @Schema(description = "处理前状态,0-未确认,1-确认了未对应,2-对应中", example = "2") + private Integer lastStatus; + + @Schema(description = "处理后状态,1-未对应,2-对应中,3-完成,4-自动恢复", example = "1") + private Integer status; + + @Schema(description = "告警状态,0-处于警报,1-警报解除", example = "1") + private Integer alertStatus; + + +} diff --git a/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/vo/data/OverviewInfo.java b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/vo/data/OverviewInfo.java new file mode 100644 index 0000000..ea14984 --- /dev/null +++ b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/vo/data/OverviewInfo.java @@ -0,0 +1,22 @@ +package com.dongjian.dashboard.back.vo.data; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +@Data +public class OverviewInfo { + + private Long buildingId; + + private String buildingName; + + private String deviceId; + + private Long receiveTs; + + private Long monitoringPointCategoryId; + + private String monitoringPointCategoryName; + + +} diff --git a/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/vo/data/OverviewVO.java b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/vo/data/OverviewVO.java new file mode 100644 index 0000000..f8de4c6 --- /dev/null +++ b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/vo/data/OverviewVO.java @@ -0,0 +1,41 @@ +package com.dongjian.dashboard.back.vo.data; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.util.ArrayList; +import java.util.List; + +@Data +public class OverviewVO { + + private Long buildingId; + + private String buildingName; + + @Schema(description = "全部告警数量",example = "1111") + private Integer alarmCountAll = 0; + + @Schema(description = "今天告警数量",example = "1111") + private Integer alarmCountToday = 0; + + @Schema(description = "监视点分类告警数量",example = "1111") + private List monitoringPointCategoryAlarmList = new ArrayList<>(); + + + @Data + public static class MonitoringPointCategoryAlarm { + + @Schema(description = "monitoring point category id", example = "22") + private Long monitoringPointCategoryId; + + @Schema(description = "monitoring point category name", example = "2name") + private String monitoringPointCategoryName; + + @Schema(description = "Number of alarm",example = "1") + private Integer alarmCount = 0; + + } + + +} diff --git a/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/vo/device/DeviceIncrement.java b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/vo/device/DeviceIncrement.java new file mode 100644 index 0000000..e20243c --- /dev/null +++ b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/vo/device/DeviceIncrement.java @@ -0,0 +1,12 @@ +package com.dongjian.dashboard.back.vo.device; + +import lombok.Data; + +@Data +public class DeviceIncrement { + private String deviceId; + private Double todayIncrement; + private Double yesterdayIncrement; + private Double lastYearIncrement; +} + diff --git a/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/vo/device/DeviceVO.java b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/vo/device/DeviceVO.java new file mode 100644 index 0000000..fece756 --- /dev/null +++ b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/vo/device/DeviceVO.java @@ -0,0 +1,72 @@ +package com.dongjian.dashboard.back.vo.device; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + + +@Data +public class DeviceVO { + + private Long id; + + private Long companyId; + + private Integer flag; + + @Schema(description = "device name", example = "Device-Monitoring") + private String deviceName; + + @Schema(description = "device Id", example = "Device-Monitoring") + private String deviceId; + + @Schema(description = "device sn", example = "Device-Monitoring") + private String deviceSn; + + private Integer typeId; + + @Schema(description = "category name", example = "Device-Monitoring") + private String typeName; + + private Long buildingId; + + private String buildingName; + + private Long floorId; + + private String floorName; + + private Long spaceId; + + private String spaceName; + + private Long projectId; + + private String projectName; + + private Long assetId; + + private String assetSymbol; + + private String remark; + + @Schema(description = "Monitoring point name", example = "Device-Monitoring") + private String monitoringPointName; + + @Schema(description = "monitoring point category id", example = "22") + private Long monitoringPointCategoryId; + + @Schema(description = "monitoring point category name", example = "2name") + private String monitoringPointCategoryName; + + @Schema(description = "data provider id", example = "33") + private Long dataProviderId; + + @Schema(description = "data provider", example = "33") + private String dataProviderName; + + @Schema(description = "gateway info id", example = "44") + private Long gatewayInfoId; + + @Schema(description = "gateway info", example = "33") + private String gatewayInfoName; +} diff --git a/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/vo/device/FavoritedDeviceVO.java b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/vo/device/FavoritedDeviceVO.java new file mode 100644 index 0000000..06c4439 --- /dev/null +++ b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/vo/device/FavoritedDeviceVO.java @@ -0,0 +1,25 @@ +package com.dongjian.dashboard.back.vo.device; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + + +@Data +public class FavoritedDeviceVO { + + @Schema(description = "Device primary key ID", example = "6", hidden = true) + private Long id; + + @Schema(description = "device Id", example = "Device-Monitoring") + private String deviceId; + + @Schema(description = "Favorite time", example = "1760010000223") + private Long createAt; + + @Schema(description = "type id", example = "46") + private Integer typeId; + + @Schema(description = "dashboard自动恢复告警时是否保留告警:0-不保留,1-保留", example = "1") + private Integer retainAlert; + +} diff --git a/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/vo/device/LineData.java b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/vo/device/LineData.java new file mode 100644 index 0000000..546eca6 --- /dev/null +++ b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/vo/device/LineData.java @@ -0,0 +1,18 @@ +package com.dongjian.dashboard.back.vo.device; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.util.ArrayList; +import java.util.List; + +@Data +public class LineData { + + @Schema(description = "X-axis data", example = "[]") + private List xData = new ArrayList<>(); + + @Schema(description = "Y-axis data", example = "[]") + private List yData = new ArrayList<>(); + +} diff --git a/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/vo/devicegroup/DeviceGroupPageVO.java b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/vo/devicegroup/DeviceGroupPageVO.java new file mode 100644 index 0000000..72abc3f --- /dev/null +++ b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/vo/devicegroup/DeviceGroupPageVO.java @@ -0,0 +1,30 @@ +package com.dongjian.dashboard.back.vo.devicegroup; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +@Data +public class DeviceGroupPageVO { + + @Schema(description = "项目唯一标识ID,新增时无此参数",example = "2738967") + private Long deviceGroupId; + + @Schema(description = "楼宇ID",example = "222") + private Long buildingId; + + @Schema(description = "楼宇名称",example = "楼宇222") + private String buildingName; + + @Schema(description = "分组下的设备分类, 1-报警、2-累积、3-计测、4-振动",example = "1") + private Integer groupType; + + @Schema(description = "所属企业ID",example = "2738967") + private Long companyId; + + @Schema(description = "项目名称",example = "testDeviceGroup1", required = true) + private String name; + + @Schema(description = "remark", example = "remark") + private String remark; + +} diff --git a/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/vo/levelhierarchy/LevelHierarchyPageDTO.java b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/vo/levelhierarchy/LevelHierarchyPageDTO.java new file mode 100644 index 0000000..05517a0 --- /dev/null +++ b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/vo/levelhierarchy/LevelHierarchyPageDTO.java @@ -0,0 +1,25 @@ +package com.dongjian.dashboard.back.vo.levelhierarchy; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** +* @author Mr.Jiang +* @time 2022年5月22日 下午10:37:02 +*/ +@Data +public class LevelHierarchyPageDTO { + + @Schema(description = "层级ID",example = "111", required = true) + private Long id; + + @Schema(description = "层级名称",example = "建筑A", required = true) + private String levelHierarchyName; + + @Schema(description = "描述",example = "这是管理员描述", required = true) + private String remark; + + @Schema(description = "创建时间",example = "1700011000110", required = false) + private Long createdAt; + +} diff --git a/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/vo/levelhierarchy/LevelHierarchyRolePageDTO.java b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/vo/levelhierarchy/LevelHierarchyRolePageDTO.java new file mode 100644 index 0000000..9bc98c8 --- /dev/null +++ b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/vo/levelhierarchy/LevelHierarchyRolePageDTO.java @@ -0,0 +1,25 @@ +package com.dongjian.dashboard.back.vo.levelhierarchy; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** +* @author Mr.Jiang +* @time 2022年5月22日 下午10:37:02 +*/ +@Data +public class LevelHierarchyRolePageDTO { + + @Schema(description = "层级ID",example = "111", required = true) + private Long id; + + @Schema(description = "名称",example = "建筑A", required = true) + private String name; + + @Schema(description = "描述",example = "这是管理员描述", required = true) + private String remark; + + @Schema(description = "创建时间",example = "1700011000110", required = false) + private Long createdAt; + +} diff --git a/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/vo/levelhierarchy/LevelHierarchyTreeVO.java b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/vo/levelhierarchy/LevelHierarchyTreeVO.java new file mode 100644 index 0000000..db29397 --- /dev/null +++ b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/vo/levelhierarchy/LevelHierarchyTreeVO.java @@ -0,0 +1,29 @@ +package com.dongjian.dashboard.back.vo.levelhierarchy; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.util.ArrayList; +import java.util.List; + +@Data +public class LevelHierarchyTreeVO { + + @Schema(description = "层级ID", example = "1") + private Long id; + + @Schema(description = "层级名称", example = "东京支社") + private String name; + + @Schema(description = "层级类型", example = "BRANCH/STORE/AREA/SITE/BUILDING") + private String type; + + @Schema(description = "备注") + private String remark; + + @Schema(description = "父级ID(内存组装用)") + private Long parentId; + + @Schema(description = "子节点") + private List children = new ArrayList<>(); +} diff --git a/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/vo/monitoringpointcategory/MonitoringPointCategoryPageVO.java b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/vo/monitoringpointcategory/MonitoringPointCategoryPageVO.java new file mode 100644 index 0000000..00aa3c4 --- /dev/null +++ b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/vo/monitoringpointcategory/MonitoringPointCategoryPageVO.java @@ -0,0 +1,27 @@ +package com.dongjian.dashboard.back.vo.monitoringpointcategory; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +@Data +public class MonitoringPointCategoryPageVO { + + @Schema(description = "唯一标识ID,新增时无此参数",example = "2738967") + private Long monitoringPointCategoryId; + + @Schema(description = "所属企业ID",example = "2738967") + private Long companyId; + + @Schema(description = "组名",example = "testMonitoringPointCategory1", required = true) + private String name; + + @Schema(description = "remark", example = "remark") + private String remark; + + @Schema(description = "正常图标", example = "data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAnormal") + private String thumbnailNormalBase64; + + @Schema(description = "告警图标", example = "data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAalarm") + private String thumbnailAlarmBase64; + +} diff --git a/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/vo/monitoringpointcategorygroup/MonitoringPointCategoryGroupPageVO.java b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/vo/monitoringpointcategorygroup/MonitoringPointCategoryGroupPageVO.java new file mode 100644 index 0000000..e9e42be --- /dev/null +++ b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/vo/monitoringpointcategorygroup/MonitoringPointCategoryGroupPageVO.java @@ -0,0 +1,30 @@ +package com.dongjian.dashboard.back.vo.monitoringpointcategorygroup; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +@Data +public class MonitoringPointCategoryGroupPageVO { + + @Schema(description = "唯一标识ID,新增时无此参数",example = "2738967") + private Long monitoringPointCategoryGroupId; + + @Schema(description = "所属企业ID",example = "2738967") + private Long companyId; + + @Schema(description = "楼宇ID",example = "222") + private Long buildingId; + + @Schema(description = "楼宇名称",example = "楼宇222") + private String buildingName; + + @Schema(description = "User-defined building ID", example = "123AAA6", required = true) + private String udfBuildingId; + + @Schema(description = "名称",example = "testMonitoringPointCategoryGroup1", required = true) + private String name; + + @Schema(description = "remark", example = "remark") + private String remark; + +} diff --git a/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/vo/notificationconfig/SlackPageVO.java b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/vo/notificationconfig/SlackPageVO.java new file mode 100644 index 0000000..121f8be --- /dev/null +++ b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/vo/notificationconfig/SlackPageVO.java @@ -0,0 +1,31 @@ +package com.dongjian.dashboard.back.vo.notificationconfig; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** +* @author Mr.Jiang +* @time 2022年7月21日 下午8:50:31 +*/ +@Data +public class SlackPageVO{ + + @Schema(description = "Slack unique identifier ID, not required for new entries", example = "2738967") + private Long slackId; + +// @Schema(description = "Company ID", example = "2738967", hidden = true) +// private Long companyId; + + @Schema(description = "unique identification", example = "testSlack1", required = true) + private String identity; + + @Schema(description = "webhook info", example = "webhook", required = true) + private String webhook; + + @Schema(description = "remark", example = "remark") + private String remark; + + @Schema(description = "created time", example = "2738967") + private Long createdAt; + +} diff --git a/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/vo/notificationconfig/TeamsPageVO.java b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/vo/notificationconfig/TeamsPageVO.java new file mode 100644 index 0000000..a0dcc43 --- /dev/null +++ b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/vo/notificationconfig/TeamsPageVO.java @@ -0,0 +1,31 @@ +package com.dongjian.dashboard.back.vo.notificationconfig; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** +* @author Mr.Jiang +* @time 2022年7月21日 下午8:50:31 +*/ +@Data +public class TeamsPageVO{ + + @Schema(description = "Teams unique identifier ID, not required for new entries", example = "2738967") + private Long teamsId; + +// @Schema(description = "Company ID", example = "2738967", hidden = true) +// private Long companyId; + + @Schema(description = "unique identification", example = "testTeams1", required = true) + private String identity; + + @Schema(description = "webhook info", example = "webhook", required = true) + private String webhook; + + @Schema(description = "remark", example = "remark") + private String remark; + + @Schema(description = "created time", example = "2738967") + private Long createdAt; + +} diff --git a/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/vo/operationlog/OperationLogPageVO.java b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/vo/operationlog/OperationLogPageVO.java new file mode 100644 index 0000000..4b16145 --- /dev/null +++ b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/vo/operationlog/OperationLogPageVO.java @@ -0,0 +1,48 @@ +package com.dongjian.dashboard.back.vo.operationlog; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +@Data +public class OperationLogPageVO { + + @Schema(description = "日志ID", example = "1001") + private Long id; + + @Schema(description = "操作用户ID", example = "1", hidden = true) + private Long userId; + + @Schema(description = "操作用户", example = "addUser") + private String user; + + @Schema(description = "公司ID", example = "101", hidden = true) + private Long companyId; + + @Schema(description = "操作", example = "addUser") + private String operation; + + @Schema(description = "操作备注", example = "添加用户") + private String operationRemark; + + @Schema(description = "路径", example = "/user/add", hidden = true) + private String uri; + +// @Schema(description = "方法名", example = "add", hidden = true) +// private String methodName; + +// @Schema(description = "类名", example = "com.dongjian.dashboard.back.controller.UserController", hidden = true) +// private String className; + + @Schema(description = "请求IP地址", example = "127.0.0.1") + private String ipAddress; + +// @Schema(description = "请求参数", example = "[{\"name\":\"张三\",\"id\":123}]", hidden = true) +// private String requestParams; + + @Schema(description = "执行耗时(ms)", example = "153", hidden = true) + private Long executionTimeMs; + + @Schema(description = "操作时间(毫秒级时间戳)", example = "1721106800000") + private Long createdAt; + +} diff --git a/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/vo/project/ProjectPageVO.java b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/vo/project/ProjectPageVO.java new file mode 100644 index 0000000..c40c09b --- /dev/null +++ b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/vo/project/ProjectPageVO.java @@ -0,0 +1,27 @@ +package com.dongjian.dashboard.back.vo.project; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** +* @author Mr.Jiang +* @time 2022年7月21日 下午8:50:31 +*/ +@Data +public class ProjectPageVO{ + + @Schema(description = "项目唯一标识ID,新增时无此参数",example = "2738967") + private Long projectId; + + @Schema(description = "所属企业ID",example = "2738967") + private Long companyId; + + @Schema(description = "所属企业名称",example = "testCompany1", required = true) + private String companyName; + + @Schema(description = "项目名称",example = "testProject1", required = true) + private String projectName; + + @Schema(description = "用户自定义ID",example = "XXXX", required = true) + private String udfProjectId; +} diff --git a/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/vo/role/RoleMenuDTO.java b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/vo/role/RoleMenuDTO.java new file mode 100644 index 0000000..187a2e1 --- /dev/null +++ b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/vo/role/RoleMenuDTO.java @@ -0,0 +1,27 @@ +package com.dongjian.dashboard.back.vo.role; + +import java.util.List; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** +* @author Mr.Jiang +* @time 2022年7月29日 下午4:37:50 +*/ +@Data +public class RoleMenuDTO { + + @Schema(description = "菜单ID",example = "11", required = true) + private String key; + + @Schema(description = "父菜单ID",example = "2", hidden = true) + private String parentKey; + + @Schema(description = "菜单名称",example = "添加", required = true) + private String label; + + @Schema(description = "子菜单",example = "[]", required = false) + private List children; + +} diff --git a/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/vo/role/RolePageDTO.java b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/vo/role/RolePageDTO.java new file mode 100644 index 0000000..aeacb61 --- /dev/null +++ b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/vo/role/RolePageDTO.java @@ -0,0 +1,25 @@ +package com.dongjian.dashboard.back.vo.role; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** +* @author Mr.Jiang +* @time 2022年5月22日 下午10:37:02 +*/ +@Data +public class RolePageDTO { + + @Schema(description = "角色ID",example = "111", required = true) + private Long roleId; + + @Schema(description = "角色名称",example = "管理员", required = true) + private String roleName; + + @Schema(description = "描述",example = "这是管理员描述", required = true) + private String description; + + @Schema(description = "最后更新时间",example = "1689878789647", required = true) + private Long modifyTime; + +} diff --git a/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/vo/s3/TemporaryCredentials.java b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/vo/s3/TemporaryCredentials.java new file mode 100644 index 0000000..70954f4 --- /dev/null +++ b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/vo/s3/TemporaryCredentials.java @@ -0,0 +1,16 @@ +package com.dongjian.dashboard.back.vo.s3; + +import lombok.Data; + +@Data +public class TemporaryCredentials { + + private String accessKeyId; + private String secretAccessKey; + private String sessionToken; + private String region; + private String bucketName; + private String basePrefix; + + +} diff --git a/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/vo/user/UserInfoVO.java b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/vo/user/UserInfoVO.java new file mode 100644 index 0000000..d5b173c --- /dev/null +++ b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/vo/user/UserInfoVO.java @@ -0,0 +1,19 @@ +package com.dongjian.dashboard.back.vo.user; + +import com.dongjian.dashboard.back.model.BasicUser; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** +* @author Mr.Jiang +* @time 2022年5月22日 下午10:37:02 +*/ +@Data +public class UserInfoVO extends BasicUser{ + + private Long parentCompanyId; + + private Integer lockSwitch; + +} diff --git a/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/vo/user/UserPageDTO.java b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/vo/user/UserPageDTO.java new file mode 100644 index 0000000..cbe182a --- /dev/null +++ b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/vo/user/UserPageDTO.java @@ -0,0 +1,52 @@ +package com.dongjian.dashboard.back.vo.user; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** +* @author Mr.Jiang +* @time 2022年5月22日 下午10:37:02 +*/ +@Data +public class UserPageDTO { + + @Schema(description = "企业唯一标识ID,新增时无此参数",example = "2738967") + private Long companyId; + + @Schema(description = "企业名称",example = "testAccount1", required = true) + private String companyName; + + @Schema(description = "用户ID, 新增时无此参数",example = "111", required = false) + private Long userId; + + @Schema(description = "用户类型,1-管理平台用户,2-普通平台用户",example = "2", required = true) + private Integer userType; + + @Schema(description = "角色ID",example = "24", required = false) + private Long roleId; + + @Schema(description = "角色名",example = "24", required = false) + private String roleName; + +// @Schema(description = "所属组名",example = "组1,组2", required = false) +// private String userGroupNames; + + @Schema(description = "用户名",example = "管理员", required = true) + private String username; + +// @Schema(description = "登录名",example = "adminmin", required = true) +// private String loginName; + + @Schema(description = "用户邮箱",example = "1057897@qq.com", required = true) + private String email; + + @Schema(description = "是否绑定了MFA设备,0-未绑定,1-已绑定。如果绑定了,则不允许跳过mfa,没有绑定可以跳过mfa",example = "1") + private Integer mfaBind; + + @Schema(description = "手机号码,这里要加上国际区号,比如日本是+81,传给后台的就是+81-08041165856,中国是+86,传给后台的就是+86-18841165856",example = "+81-08041165856", required = false) + private String mobileNumber; + + @Schema(description = "创建时间",example = "1678990326897", required = false) + private Long createTime; + +} diff --git a/dongjian-dashboard-back-service/.gitignore b/dongjian-dashboard-back-service/.gitignore new file mode 100644 index 0000000..aa23915 --- /dev/null +++ b/dongjian-dashboard-back-service/.gitignore @@ -0,0 +1,15 @@ +/target/ +/logs/ +/.idea/ +*.iml +*.bak +*.log +/.settings/ +*.project +*.classpath +*.factorypath +*.springBeans +/.apt_generated/ +/.externalToolBuilders/ +/bin/ +application-*.properties diff --git a/dongjian-dashboard-back-service/pom.xml b/dongjian-dashboard-back-service/pom.xml new file mode 100644 index 0000000..9540b2d --- /dev/null +++ b/dongjian-dashboard-back-service/pom.xml @@ -0,0 +1,55 @@ + + + 4.0.0 + + com.techsor + dongjian-dashboard-back + 0.0.1-SNAPSHOT + + dongjian-dashboard-back-service + dongjian-dashboard-back-service + http://maven.apache.org + + UTF-8 + + + + + com.techsor + dongjian-dashboard-back-dao + 0.0.1-SNAPSHOT + + + + com.techsor + dongjian-dashboard-back-model + 0.0.1-SNAPSHOT + + + + com.techsor + dongjian-dashboard-back-util + 0.0.1-SNAPSHOT + + + + com.techsor + dongjian-dashboard-back-common + 0.0.1-SNAPSHOT + + + + junit + junit + test + + + + com.github.penggle + kaptcha + 2.3.2 + + + + diff --git a/dongjian-dashboard-back-service/src/main/java/com/dongjian/dashboard/back/service/AccountService.java b/dongjian-dashboard-back-service/src/main/java/com/dongjian/dashboard/back/service/AccountService.java new file mode 100644 index 0000000..a242ca4 --- /dev/null +++ b/dongjian-dashboard-back-service/src/main/java/com/dongjian/dashboard/back/service/AccountService.java @@ -0,0 +1,12 @@ +package com.dongjian.dashboard.back.service; + +import com.alibaba.fastjson.JSONObject; + +/** + * 账户信息Service + */ +public interface AccountService { + + boolean accessAuth(String userName, String companyId, String userId, String accessToken, String languageType, JSONObject jsonObject, Long keytimeout); + +} diff --git a/dongjian-dashboard-back-service/src/main/java/com/dongjian/dashboard/back/service/BuildingService.java b/dongjian-dashboard-back-service/src/main/java/com/dongjian/dashboard/back/service/BuildingService.java new file mode 100644 index 0000000..aa5c38b --- /dev/null +++ b/dongjian-dashboard-back-service/src/main/java/com/dongjian/dashboard/back/service/BuildingService.java @@ -0,0 +1,17 @@ +package com.dongjian.dashboard.back.service; + +import com.dongjian.dashboard.back.common.response.PageInfo; +import com.dongjian.dashboard.back.dto.building.BuildingSearchParams; +import com.dongjian.dashboard.back.vo.building.BuildingPageVO; + +/** + * + * @author jwy-style + * + */ +public interface BuildingService { + + PageInfo getListPage(BuildingSearchParams pageSearchParam, Long companyId, Long userId, + Integer languageType, Integer uTCOffset); + +} diff --git a/dongjian-dashboard-back-service/src/main/java/com/dongjian/dashboard/back/service/CommonService.java b/dongjian-dashboard-back-service/src/main/java/com/dongjian/dashboard/back/service/CommonService.java new file mode 100644 index 0000000..ee24bf2 --- /dev/null +++ b/dongjian-dashboard-back-service/src/main/java/com/dongjian/dashboard/back/service/CommonService.java @@ -0,0 +1,23 @@ +package com.dongjian.dashboard.back.service; + +import java.util.List; + +import com.dongjian.dashboard.back.common.response.SimpleDataResponse; +import com.dongjian.dashboard.back.dto.common.DatacenterV1QueryParams; + +/** + * + * @author jwy-style + * + */ +public interface CommonService { + + SimpleDataResponse checkApikey(String apikey); + + SimpleDataResponse initDatabase(Long companyId); + + SimpleDataResponse initAurora(Long companyId); + + SimpleDataResponse destroyAurora(Long companyId); + +} diff --git a/dongjian-dashboard-back-service/src/main/java/com/dongjian/dashboard/back/service/CompanyService.java b/dongjian-dashboard-back-service/src/main/java/com/dongjian/dashboard/back/service/CompanyService.java new file mode 100644 index 0000000..dddadf4 --- /dev/null +++ b/dongjian-dashboard-back-service/src/main/java/com/dongjian/dashboard/back/service/CompanyService.java @@ -0,0 +1,37 @@ +package com.dongjian.dashboard.back.service; + +import java.io.IOException; +import java.sql.SQLException; +import java.util.List; + +import com.dongjian.dashboard.back.common.response.PageInfo; +import com.dongjian.dashboard.back.common.response.SimpleDataResponse; +import com.dongjian.dashboard.back.dto.company.CompanySearchParams; +import com.dongjian.dashboard.back.dto.company.DeleteCompanyParams; +import com.dongjian.dashboard.back.dto.company.OptCompanyParams; +import com.dongjian.dashboard.back.vo.TreeMenusDTO; +import com.dongjian.dashboard.back.vo.company.CompanyPageDTO; + +/** + * + * @author jwy-style + * + */ +public interface CompanyService { + + boolean idsAuth(Long valueOf, String needAuthIds); + + SimpleDataResponse add(OptCompanyParams optCompanyParams, Long companyId, Long userId, Integer languageType); + + SimpleDataResponse edit(OptCompanyParams optCompanyParams, Long companyId, Long userId, Integer languageType); + + SimpleDataResponse batchDelete(DeleteCompanyParams deleteCompanyParams, Long companyId, Long userId, Integer languageType); + + PageInfo getListPage(CompanySearchParams pageSearchParam, Long companyId, Long userId, + Integer languageType, Integer uTCOffset); + + SimpleDataResponse> getCompanyTree(Long companyId, Long userId, Integer languageType); + + SimpleDataResponse osakaInitAurora(); + +} diff --git a/dongjian-dashboard-back-service/src/main/java/com/dongjian/dashboard/back/service/DeviceDataAccumulateService.java b/dongjian-dashboard-back-service/src/main/java/com/dongjian/dashboard/back/service/DeviceDataAccumulateService.java new file mode 100644 index 0000000..bcc38fa --- /dev/null +++ b/dongjian-dashboard-back-service/src/main/java/com/dongjian/dashboard/back/service/DeviceDataAccumulateService.java @@ -0,0 +1,22 @@ +package com.dongjian.dashboard.back.service; + +import com.dongjian.dashboard.back.common.response.PageInfo; +import com.dongjian.dashboard.back.common.response.SimpleDataResponse; +import com.dongjian.dashboard.back.dto.data.AccumulateDataSearchParam; +import com.dongjian.dashboard.back.dto.device.LineDataSearchParams; +import com.dongjian.dashboard.back.vo.data.DeviceAccumulateData; +import com.dongjian.dashboard.back.vo.device.LineData; + +import java.util.List; + +/** + * Service. + */ +public interface DeviceDataAccumulateService { + + PageInfo getDataList(AccumulateDataSearchParam pageSearchParam, Long companyId, Long userId, Integer languageType); + + List handleDeviceAccumulateData(AccumulateDataSearchParam pageSearchParam); + + SimpleDataResponse getLineData(LineDataSearchParams lineDataSearchParams, Long companyId, Long userId, Integer languageType); +} diff --git a/dongjian-dashboard-back-service/src/main/java/com/dongjian/dashboard/back/service/DeviceDataAlarmService.java b/dongjian-dashboard-back-service/src/main/java/com/dongjian/dashboard/back/service/DeviceDataAlarmService.java new file mode 100644 index 0000000..1414885 --- /dev/null +++ b/dongjian-dashboard-back-service/src/main/java/com/dongjian/dashboard/back/service/DeviceDataAlarmService.java @@ -0,0 +1,25 @@ +package com.dongjian.dashboard.back.service; + +import com.dongjian.dashboard.back.common.response.PageInfo; +import com.dongjian.dashboard.back.common.response.SimpleDataResponse; +import com.dongjian.dashboard.back.dto.data.AlarmDataSearchParam; +import com.dongjian.dashboard.back.dto.data.HandleAlarmParams; +import com.dongjian.dashboard.back.dto.data.HandleHistorySearchParam; +import com.dongjian.dashboard.back.vo.data.DeviceAlarmData; +import com.dongjian.dashboard.back.vo.data.HandleHistoryDataVO; + +import java.util.List; + +/** + * Service. + */ +public interface DeviceDataAlarmService { + + PageInfo getDataList(AlarmDataSearchParam pageSearchParam, Long companyId, Long userId, Integer languageType); + + List handleDeviceAlarmData(Integer languageType, AlarmDataSearchParam pageSearchParam); + + SimpleDataResponse handleAlarm(HandleAlarmParams handleAlarmParams, Long userId, Long companyId, Integer languageType); + + PageInfo getHandleHistory(HandleHistorySearchParam pageSearchParam, Long companyId, Long userId, Integer languageType); +} diff --git a/dongjian-dashboard-back-service/src/main/java/com/dongjian/dashboard/back/service/DeviceDataBaStatusService.java b/dongjian-dashboard-back-service/src/main/java/com/dongjian/dashboard/back/service/DeviceDataBaStatusService.java new file mode 100644 index 0000000..a8b238b --- /dev/null +++ b/dongjian-dashboard-back-service/src/main/java/com/dongjian/dashboard/back/service/DeviceDataBaStatusService.java @@ -0,0 +1,17 @@ +package com.dongjian.dashboard.back.service; + +import com.dongjian.dashboard.back.common.response.PageInfo; +import com.dongjian.dashboard.back.dto.data.BaStatusDataSearchParam; +import com.dongjian.dashboard.back.vo.data.DeviceBaStatusData; + +import java.util.List; + +/** + * Service. + */ +public interface DeviceDataBaStatusService { + + PageInfo getDataList(BaStatusDataSearchParam pageSearchParam, Long companyId, Long userId, Integer languageType); + + List handleDeviceBaStatusData(BaStatusDataSearchParam pageSearchParam); +} diff --git a/dongjian-dashboard-back-service/src/main/java/com/dongjian/dashboard/back/service/DeviceDataMeasureService.java b/dongjian-dashboard-back-service/src/main/java/com/dongjian/dashboard/back/service/DeviceDataMeasureService.java new file mode 100644 index 0000000..ce90aa3 --- /dev/null +++ b/dongjian-dashboard-back-service/src/main/java/com/dongjian/dashboard/back/service/DeviceDataMeasureService.java @@ -0,0 +1,22 @@ +package com.dongjian.dashboard.back.service; + +import com.dongjian.dashboard.back.common.response.PageInfo; +import com.dongjian.dashboard.back.common.response.SimpleDataResponse; +import com.dongjian.dashboard.back.dto.data.MeasureDataSearchParam; +import com.dongjian.dashboard.back.dto.device.LineDataSearchParams; +import com.dongjian.dashboard.back.vo.data.DeviceMeasureData; +import com.dongjian.dashboard.back.vo.device.LineData; + +import java.util.List; + +/** + * Service. + */ +public interface DeviceDataMeasureService { + + PageInfo getDataList(MeasureDataSearchParam pageSearchParam, Long companyId, Long userId, Integer languageType); + + List handleDeviceMeasureData(MeasureDataSearchParam pageSearchParam); + + SimpleDataResponse getLineData(LineDataSearchParams lineDataSearchParams, Long companyId, Long userId, Integer languageType); +} diff --git a/dongjian-dashboard-back-service/src/main/java/com/dongjian/dashboard/back/service/DeviceGroupService.java b/dongjian-dashboard-back-service/src/main/java/com/dongjian/dashboard/back/service/DeviceGroupService.java new file mode 100644 index 0000000..b43740b --- /dev/null +++ b/dongjian-dashboard-back-service/src/main/java/com/dongjian/dashboard/back/service/DeviceGroupService.java @@ -0,0 +1,32 @@ +package com.dongjian.dashboard.back.service; + +import com.dongjian.dashboard.back.common.response.PageInfo; +import com.dongjian.dashboard.back.common.response.SimpleDataResponse; +import com.dongjian.dashboard.back.dto.devicegroup.*; +import com.dongjian.dashboard.back.vo.devicegroup.DeviceGroupPageVO; + +import java.util.List; + +/** + * 设备分组服务接口 + * @author jwy-style + */ +public interface DeviceGroupService { + + SimpleDataResponse add(OptDeviceGroupParams optDeviceGroupParams, Long userId, Long companyId, Integer languageType); + + SimpleDataResponse edit(OptDeviceGroupParams optDeviceGroupParams, Long userId, Long companyId, Integer languageType); + + SimpleDataResponse batchDelete(DeleteDeviceGroupParams deleteDeviceGroupParams, Long userId, Long companyId, Integer languageType); + + PageInfo getListPage(DeviceGroupSearchParams pageSearchParam, Long companyId, Long userId, + Integer languageType, Integer uTCOffset); + + SimpleDataResponse bindGroupForDevice(BindGroupForDeviceParams bindDeviceGroupByDeviceParams, Long userId, Long companyId, Integer languageType); + + SimpleDataResponse bindDeviceForGroup(BindDeviceForGroupParams bindDeviceForGroupParams, Long userId, Long companyId, Integer languageType); + + SimpleDataResponse getBindedGroupByDevice(Integer deviceInfoId, Long userId, Long companyId, Integer languageType); + + SimpleDataResponse getBindedDeviceByGroup(Long deviceGroupId, Long userId, Long companyId, Integer languageType); +} diff --git a/dongjian-dashboard-back-service/src/main/java/com/dongjian/dashboard/back/service/DeviceService.java b/dongjian-dashboard-back-service/src/main/java/com/dongjian/dashboard/back/service/DeviceService.java new file mode 100644 index 0000000..fd9b4d6 --- /dev/null +++ b/dongjian-dashboard-back-service/src/main/java/com/dongjian/dashboard/back/service/DeviceService.java @@ -0,0 +1,18 @@ +package com.dongjian.dashboard.back.service; + +import com.dongjian.dashboard.back.common.response.PageInfo; +import com.dongjian.dashboard.back.common.response.SimpleDataResponse; +import com.dongjian.dashboard.back.dto.device.DeviceSearchParams; +import com.dongjian.dashboard.back.dto.device.OptDeviceFieldParams; +import com.dongjian.dashboard.back.vo.device.DeviceVO; + +/** + * Service. + */ +public interface DeviceService { + + + PageInfo getListPage(DeviceSearchParams pageSearchParam, Long companyId, Long userId, Integer languageType); + + SimpleDataResponse editField(OptDeviceFieldParams optDeviceFieldParams, Long companyId, Long userId, Integer languageType); +} diff --git a/dongjian-dashboard-back-service/src/main/java/com/dongjian/dashboard/back/service/FavoritedDeviceService.java b/dongjian-dashboard-back-service/src/main/java/com/dongjian/dashboard/back/service/FavoritedDeviceService.java new file mode 100644 index 0000000..3ae2d45 --- /dev/null +++ b/dongjian-dashboard-back-service/src/main/java/com/dongjian/dashboard/back/service/FavoritedDeviceService.java @@ -0,0 +1,18 @@ +package com.dongjian.dashboard.back.service; + +import com.dongjian.dashboard.back.common.response.PageInfo; +import com.dongjian.dashboard.back.common.response.SimpleDataResponse; +import com.dongjian.dashboard.back.dto.device.FavoritedDeviceSearchParams; +import com.dongjian.dashboard.back.dto.device.OptFavoritedDeviceParams; + +/** + * Service. + */ +public interface FavoritedDeviceService { + + PageInfo getListPage(FavoritedDeviceSearchParams pageSearchParam, Long companyId, Long userId, Integer languageType, Integer utcOffset); + + SimpleDataResponse addToFavorite(OptFavoritedDeviceParams optFavoritedDeviceParams, Long userId, Long companyId, Integer languageType); + + SimpleDataResponse removeFavoriteDevice(OptFavoritedDeviceParams optFavoritedDeviceParams, Long userId, Long companyId, Integer languageType); +} diff --git a/dongjian-dashboard-back-service/src/main/java/com/dongjian/dashboard/back/service/LevelHierarchyRoleService.java b/dongjian-dashboard-back-service/src/main/java/com/dongjian/dashboard/back/service/LevelHierarchyRoleService.java new file mode 100644 index 0000000..ca9257f --- /dev/null +++ b/dongjian-dashboard-back-service/src/main/java/com/dongjian/dashboard/back/service/LevelHierarchyRoleService.java @@ -0,0 +1,27 @@ +package com.dongjian.dashboard.back.service; + +import com.dongjian.dashboard.back.common.response.PageInfo; +import com.dongjian.dashboard.back.common.response.SimpleDataResponse; +import com.dongjian.dashboard.back.dto.levelhierarchy.DeleteLevelHierarchyRoleParam; +import com.dongjian.dashboard.back.dto.levelhierarchy.OptLevelHierarchyRoleParam; +import com.dongjian.dashboard.back.dto.levelhierarchy.PageLevelHierarchyRoleSearchParam; +import com.dongjian.dashboard.back.vo.levelhierarchy.LevelHierarchyRolePageDTO; +import com.dongjian.dashboard.back.vo.levelhierarchy.LevelHierarchyTreeVO; + +import java.util.List; + +/** + * Service. + */ +public interface LevelHierarchyRoleService { + + SimpleDataResponse add(OptLevelHierarchyRoleParam param, Long companyId, Long userId, Integer languageType); + + SimpleDataResponse edit(OptLevelHierarchyRoleParam param, Long companyId, Long userId, Integer languageType); + + SimpleDataResponse batchDelete(DeleteLevelHierarchyRoleParam deleteLevelHierarchyRoleParam, Long companyId, Long userId, Integer languageType); + + PageInfo getListPage(PageLevelHierarchyRoleSearchParam pageSearchParam, Long companyId, Long userId, Integer languageType); + + SimpleDataResponse> getHierarchyTree(Long roleId, Long companyId, Long userId, Integer languageType); +} diff --git a/dongjian-dashboard-back-service/src/main/java/com/dongjian/dashboard/back/service/LevelHierarchyService.java b/dongjian-dashboard-back-service/src/main/java/com/dongjian/dashboard/back/service/LevelHierarchyService.java new file mode 100644 index 0000000..a5fd6c6 --- /dev/null +++ b/dongjian-dashboard-back-service/src/main/java/com/dongjian/dashboard/back/service/LevelHierarchyService.java @@ -0,0 +1,24 @@ +package com.dongjian.dashboard.back.service; + +import com.dongjian.dashboard.back.common.response.PageInfo; +import com.dongjian.dashboard.back.common.response.SimpleDataResponse; +import com.dongjian.dashboard.back.dto.levelhierarchy.DeleteLevelHierarchyParam; +import com.dongjian.dashboard.back.dto.levelhierarchy.OptLevelHierarchyParam; +import com.dongjian.dashboard.back.dto.levelhierarchy.PageLevelHierarchySearchParam; +import com.dongjian.dashboard.back.vo.levelhierarchy.LevelHierarchyPageDTO; + +/** + * Service. + */ +public interface LevelHierarchyService { + + SimpleDataResponse add(OptLevelHierarchyParam param, Long companyId, Long userId, Integer languageType); + + SimpleDataResponse edit(OptLevelHierarchyParam param, Long companyId, Long userId, Integer languageType); + + SimpleDataResponse batchDelete(DeleteLevelHierarchyParam deleteLevelHierarchyParam, Long companyId, Long userId, Integer languageType); + + PageInfo getListPage(PageLevelHierarchySearchParam pageSearchParam, Long companyId, Long userId, Integer languageType); + + +} diff --git a/dongjian-dashboard-back-service/src/main/java/com/dongjian/dashboard/back/service/MonitoringPointCategoryGroupService.java b/dongjian-dashboard-back-service/src/main/java/com/dongjian/dashboard/back/service/MonitoringPointCategoryGroupService.java new file mode 100644 index 0000000..23c450d --- /dev/null +++ b/dongjian-dashboard-back-service/src/main/java/com/dongjian/dashboard/back/service/MonitoringPointCategoryGroupService.java @@ -0,0 +1,29 @@ +package com.dongjian.dashboard.back.service; + +import com.dongjian.dashboard.back.common.response.PageInfo; +import com.dongjian.dashboard.back.common.response.SimpleDataResponse; +import com.dongjian.dashboard.back.dto.monitoringpointcategorygroup.*; +import com.dongjian.dashboard.back.vo.monitoringpointcategory.MonitoringPointCategoryPageVO; +import com.dongjian.dashboard.back.vo.monitoringpointcategorygroup.MonitoringPointCategoryGroupPageVO; + +import java.util.List; + +public interface MonitoringPointCategoryGroupService { + + SimpleDataResponse add(OptMonitoringPointCategoryGroupParams optMonitoringPointCategoryGroupParams, Long userId, Long companyId, Integer languageType); + + SimpleDataResponse edit(OptMonitoringPointCategoryGroupParams optMonitoringPointCategoryGroupParams, Long userId, Long companyId, Integer languageType); + + SimpleDataResponse batchDelete(DeleteMonitoringPointCategoryGroupParams deleteMonitoringPointCategoryGroupParams, Long userId, Long companyId, Integer languageType); + + PageInfo getListPage(MonitoringPointCategoryGroupSearchParams pageSearchParam, Long companyId, Long userId, + Integer languageType, Integer uTCOffset); + + SimpleDataResponse bindGroupForCategory(BindGroupForCategoryParams bindGroupForCategoryParams, Long userId, Long companyId, Integer languageType); + + SimpleDataResponse bindCategoryForGroup(BindCategoryForGroupParams bindCategoryForGroupParams, Long userId, Long companyId, Integer languageType); + + SimpleDataResponse> getBindedGroupByCategory(Long monitoringPointCategoryId, Long userId, Long companyId, Integer languageType); + + SimpleDataResponse> getBindedCategoryByGroup(Long monitoringPointCategoryGroupId, Long userId, Long companyId, Integer languageType); +} diff --git a/dongjian-dashboard-back-service/src/main/java/com/dongjian/dashboard/back/service/MonitoringPointCategoryService.java b/dongjian-dashboard-back-service/src/main/java/com/dongjian/dashboard/back/service/MonitoringPointCategoryService.java new file mode 100644 index 0000000..f413ab0 --- /dev/null +++ b/dongjian-dashboard-back-service/src/main/java/com/dongjian/dashboard/back/service/MonitoringPointCategoryService.java @@ -0,0 +1,19 @@ +package com.dongjian.dashboard.back.service; + +import com.dongjian.dashboard.back.common.response.PageInfo; +import com.dongjian.dashboard.back.common.response.SimpleDataResponse; +import com.dongjian.dashboard.back.dto.monitoringpointcategory.*; +import com.dongjian.dashboard.back.vo.monitoringpointcategory.MonitoringPointCategoryPageVO; + + +public interface MonitoringPointCategoryService { + + SimpleDataResponse add(OptMonitoringPointCategoryParams optMonitoringPointCategoryParams, Long userId, Long companyId, Integer languageType); + + SimpleDataResponse edit(OptMonitoringPointCategoryParams optMonitoringPointCategoryParams, Long userId, Long companyId, Integer languageType); + + SimpleDataResponse batchDelete(DeleteMonitoringPointCategoryParams deleteMonitoringPointCategoryParams, Long userId, Long companyId, Integer languageType); + + PageInfo getListPage(MonitoringPointCategorySearchParams pageSearchParam, Long companyId, Long userId, + Integer languageType, Integer uTCOffset); +} diff --git a/dongjian-dashboard-back-service/src/main/java/com/dongjian/dashboard/back/service/NotificationConfigService.java b/dongjian-dashboard-back-service/src/main/java/com/dongjian/dashboard/back/service/NotificationConfigService.java new file mode 100644 index 0000000..00ae480 --- /dev/null +++ b/dongjian-dashboard-back-service/src/main/java/com/dongjian/dashboard/back/service/NotificationConfigService.java @@ -0,0 +1,41 @@ +package com.dongjian.dashboard.back.service; + +import com.dongjian.dashboard.back.common.response.PageInfo; +import com.dongjian.dashboard.back.common.response.SimpleDataResponse; +import com.dongjian.dashboard.back.dto.notificationconfig.DeleteSlackParams; +import com.dongjian.dashboard.back.dto.notificationconfig.DeleteTeamsParams; +import com.dongjian.dashboard.back.dto.notificationconfig.OptSlackParams; +import com.dongjian.dashboard.back.dto.notificationconfig.OptTeamsParams; +import com.dongjian.dashboard.back.dto.notificationconfig.SlackSearchParams; +import com.dongjian.dashboard.back.dto.notificationconfig.TeamsSearchParams; +import com.dongjian.dashboard.back.vo.notificationconfig.SlackPageVO; +import com.dongjian.dashboard.back.vo.notificationconfig.TeamsPageVO; + +/** + * + * @author jwy-style + * + */ +public interface NotificationConfigService { + + SimpleDataResponse add(OptSlackParams optSlackParams, Long userId, Long companyId, Integer languageType); + + SimpleDataResponse edit(OptSlackParams optSlackParams, Long userId, Long companyId, Integer languageType); + + SimpleDataResponse batchDelete(DeleteSlackParams deleteSlackParams, Long userId, Long companyId, + Integer languageType); + + PageInfo getListPage(SlackSearchParams pageSearchParam, Long companyId, Long userId, + Integer languageType, Integer uTCOffset); + + SimpleDataResponse add(OptTeamsParams optTeamsParams, Long userId, Long companyId, Integer languageType); + + SimpleDataResponse edit(OptTeamsParams optTeamsParams, Long userId, Long companyId, Integer languageType); + + SimpleDataResponse batchDelete(DeleteTeamsParams deleteTeamsParams, Long userId, Long companyId, + Integer languageType); + + PageInfo getListPage(TeamsSearchParams pageSearchParam, Long companyId, Long userId, + Integer languageType, Integer uTCOffset); + +} diff --git a/dongjian-dashboard-back-service/src/main/java/com/dongjian/dashboard/back/service/OperationLogService.java b/dongjian-dashboard-back-service/src/main/java/com/dongjian/dashboard/back/service/OperationLogService.java new file mode 100644 index 0000000..5b13e33 --- /dev/null +++ b/dongjian-dashboard-back-service/src/main/java/com/dongjian/dashboard/back/service/OperationLogService.java @@ -0,0 +1,14 @@ +package com.dongjian.dashboard.back.service; + +import com.dongjian.dashboard.back.common.response.PageInfo; +import com.dongjian.dashboard.back.dto.operationlog.LogSearchParam; +import com.dongjian.dashboard.back.vo.operationlog.OperationLogPageVO; + +/** + * Service. + */ +public interface OperationLogService { + + + PageInfo getListPage(LogSearchParam pageSearchParam, Long companyId, Long userId, Integer languageType); +} diff --git a/dongjian-dashboard-back-service/src/main/java/com/dongjian/dashboard/back/service/OverviewService.java b/dongjian-dashboard-back-service/src/main/java/com/dongjian/dashboard/back/service/OverviewService.java new file mode 100644 index 0000000..865a40c --- /dev/null +++ b/dongjian-dashboard-back-service/src/main/java/com/dongjian/dashboard/back/service/OverviewService.java @@ -0,0 +1,15 @@ +package com.dongjian.dashboard.back.service; + +import com.dongjian.dashboard.back.common.response.SimpleDataResponse; +import com.dongjian.dashboard.back.vo.data.OverviewVO; + +import java.util.List; + +/** + * Service. + */ +public interface OverviewService { + + SimpleDataResponse> getOverviewInfo(Long userId, Long companyId, Integer languageType, Integer UTCOffset); + +} diff --git a/dongjian-dashboard-back-service/src/main/java/com/dongjian/dashboard/back/service/ProjectService.java b/dongjian-dashboard-back-service/src/main/java/com/dongjian/dashboard/back/service/ProjectService.java new file mode 100644 index 0000000..4ad3364 --- /dev/null +++ b/dongjian-dashboard-back-service/src/main/java/com/dongjian/dashboard/back/service/ProjectService.java @@ -0,0 +1,26 @@ +package com.dongjian.dashboard.back.service; + +import com.dongjian.dashboard.back.common.response.PageInfo; +import com.dongjian.dashboard.back.common.response.SimpleDataResponse; +import com.dongjian.dashboard.back.dto.project.DeleteProjectParams; +import com.dongjian.dashboard.back.dto.project.OptProjectParams; +import com.dongjian.dashboard.back.dto.project.ProjectSearchParams; +import com.dongjian.dashboard.back.vo.project.ProjectPageVO; + +/** + * + * @author jwy-style + * + */ +public interface ProjectService { + + SimpleDataResponse add(OptProjectParams optProjectParams, Long userId, Long companyId, Integer languageType); + + SimpleDataResponse edit(OptProjectParams optProjectParams, Long userId, Long companyId, Integer languageType); + + SimpleDataResponse batchDelete(DeleteProjectParams deleteProjectParams, Long userId, Long companyId, Integer languageType); + + PageInfo getListPage(ProjectSearchParams pageSearchParam, Long companyId, Long userId, + Integer languageType, Integer uTCOffset); + +} diff --git a/dongjian-dashboard-back-service/src/main/java/com/dongjian/dashboard/back/service/RoleService.java b/dongjian-dashboard-back-service/src/main/java/com/dongjian/dashboard/back/service/RoleService.java new file mode 100644 index 0000000..8b8b468 --- /dev/null +++ b/dongjian-dashboard-back-service/src/main/java/com/dongjian/dashboard/back/service/RoleService.java @@ -0,0 +1,31 @@ +package com.dongjian.dashboard.back.service; + +import java.util.List; + +import com.dongjian.dashboard.back.common.response.PageInfo; +import com.dongjian.dashboard.back.common.response.SimpleDataResponse; +import com.dongjian.dashboard.back.dto.role.DeleteRoleParam; +import com.dongjian.dashboard.back.dto.role.OptRoleParam; +import com.dongjian.dashboard.back.vo.TreeMenusDTO; +import com.dongjian.dashboard.back.vo.role.RolePageDTO; + +/** + * Service. + */ +public interface RoleService { + + SimpleDataResponse add(OptRoleParam param, Long companyId, Long userId, Integer languageType); + + SimpleDataResponse edit(OptRoleParam param, Long companyId, Long userId, Integer languageType); + + SimpleDataResponse batchDelete(DeleteRoleParam deleteRoleParam, Long companyId, Long userId, Integer languageType); + + SimpleDataResponse> getOwnMenuIds(Long companyId, Long userId, Integer languageType); + + SimpleDataResponse getMenuIdsByRoleId(Long roleId, Long companyId, Long userId, Integer languageType); + + PageInfo getListPage(com.dongjian.dashboard.back.dto.role.PageSearchParam pageSearchParam, + Long companyId, Long userId, Integer languageType); + + +} diff --git a/dongjian-dashboard-back-service/src/main/java/com/dongjian/dashboard/back/service/S3FileService.java b/dongjian-dashboard-back-service/src/main/java/com/dongjian/dashboard/back/service/S3FileService.java new file mode 100644 index 0000000..0863a39 --- /dev/null +++ b/dongjian-dashboard-back-service/src/main/java/com/dongjian/dashboard/back/service/S3FileService.java @@ -0,0 +1,10 @@ +package com.dongjian.dashboard.back.service; + +import com.dongjian.dashboard.back.common.response.SimpleDataResponse; +import com.dongjian.dashboard.back.vo.s3.TemporaryCredentials; + +public interface S3FileService { + + SimpleDataResponse getTemporaryCredentials(); + +} diff --git a/dongjian-dashboard-back-service/src/main/java/com/dongjian/dashboard/back/service/UserService.java b/dongjian-dashboard-back-service/src/main/java/com/dongjian/dashboard/back/service/UserService.java new file mode 100644 index 0000000..3d1335c --- /dev/null +++ b/dongjian-dashboard-back-service/src/main/java/com/dongjian/dashboard/back/service/UserService.java @@ -0,0 +1,33 @@ +package com.dongjian.dashboard.back.service; + +import com.dongjian.dashboard.back.common.response.PageInfo; +import com.dongjian.dashboard.back.common.response.SimpleDataResponse; +import com.dongjian.dashboard.back.dto.user.DeleteUserParam; +import com.dongjian.dashboard.back.dto.user.ModifyPassword; +import com.dongjian.dashboard.back.dto.user.OptUserParam; +import com.dongjian.dashboard.back.dto.user.ResetPassword; +import com.dongjian.dashboard.back.dto.user.SwitchMfaBind; +import com.dongjian.dashboard.back.vo.user.UserPageDTO; + +/** + * Agent Service. + */ +public interface UserService { + + SimpleDataResponse add(OptUserParam optUserParam, Long companyId, Long userId, Integer languageType); + + SimpleDataResponse edit(OptUserParam optUserParam, Long companyId, Long userId, Integer languageType); + + SimpleDataResponse batchDelete(DeleteUserParam deleteUserParam, Long companyId, Long userId, Integer languageType); + + PageInfo getListPage(com.dongjian.dashboard.back.dto.user.PageSearchParam pageSearchParam, + Long companyId, Long userId, Integer languageType); + + SimpleDataResponse batchResetPassword(ResetPassword resetPassword, Long companyId, Long userId, + Integer languageType); + + SimpleDataResponse modifyPassword(ModifyPassword modifyPassword, Long companyId, Long userId, Integer languageType); + + SimpleDataResponse unbindMfa(SwitchMfaBind switchMfaBind, Long companyId, Long userId, Integer languageType); + +} diff --git a/dongjian-dashboard-back-service/src/main/java/com/dongjian/dashboard/back/service/captcha/CaptchaService.java b/dongjian-dashboard-back-service/src/main/java/com/dongjian/dashboard/back/service/captcha/CaptchaService.java new file mode 100644 index 0000000..d2197ac --- /dev/null +++ b/dongjian-dashboard-back-service/src/main/java/com/dongjian/dashboard/back/service/captcha/CaptchaService.java @@ -0,0 +1,31 @@ +package com.dongjian.dashboard.back.service.captcha; + +import java.util.UUID; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import com.dongjian.dashboard.back.common.Constants; +import com.dongjian.dashboard.back.util.redis.RedisUtil; + + +@Service +public class CaptchaService { + + private static final long CAPTCHA_TIMEOUT = 120L; + + @Autowired + private RedisUtil redisUtils; + + public CaptchaVO cacheCaptcha(String captcha){ + //生成一个随机标识符 + String captchaKey = UUID.randomUUID().toString(); + //缓存验证码并设置过期时间 + redisUtils.set(Constants.CAPTCHA_VERIFICATION.concat(captchaKey),captcha,CAPTCHA_TIMEOUT); + CaptchaVO captchaVO = new CaptchaVO(); + captchaVO.setCaptchaRequestId(captchaKey); + return captchaVO; + } + +} + diff --git a/dongjian-dashboard-back-service/src/main/java/com/dongjian/dashboard/back/service/captcha/CaptchaVO.java b/dongjian-dashboard-back-service/src/main/java/com/dongjian/dashboard/back/service/captcha/CaptchaVO.java new file mode 100644 index 0000000..63dd28a --- /dev/null +++ b/dongjian-dashboard-back-service/src/main/java/com/dongjian/dashboard/back/service/captcha/CaptchaVO.java @@ -0,0 +1,18 @@ +package com.dongjian.dashboard.back.service.captcha; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +@Data +public class CaptchaVO { + /** + * + */ + @Schema(description = "验证码的请求标识ID",example = "12313-12313-123213-12313") + private String captchaRequestId; + /** + * base64字符串 + */ + @Schema(description = "验证码图片的base64编码结果",example = "data:image/jpeg;base64,/9j/4AAQSkZJRgABAgAAAQABAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRofHh0aHBwgJC4nICIsIxwcKDcpLDAxNDQ0Hyc5PTgyPC4zNDL/2wBDAQkJCQwLDBgNDRgyIRwhMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjL/wAARCAAoAG4DASIAAhEBAxEB/8QAHwAAAQUBAQEBAQEAAAAAAAAAAAECAwQFBgcICQoL/8QAtRAAAgEDAwIEAwUFBAQAAAF9AQIDAAQRBRIhMUEGE1FhByJxFDKBkaEII0KxwRVS0fAkM2JyggkKFhcYGRolJicoKSo0NTY3ODk6Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqDhIWGh4iJipKTlJWWl5iZmqKjpKWmp6ipqrKztLW2t7i5usLDxMXGx8jJytLT1NXW19jZ2uHi4+Tl5ufo6erx8vP09fb3+Pn6/8QAHwEAAwEBAQEBAQEBAQAAAAAAAAECAwQFBgcICQoL/8QAtREAAgECBAQDBAcFBAQAAQJ3AAECAxEEBSExBhJBUQdhcRMiMoEIFEKRobHBCSMzUvAVYnLRChYkNOEl8RcYGRomJygpKjU2Nzg5OkNERUZHSElKU1RVVldYWVpjZGVmZ2hpanN0dXZ3eHl6goOEhYaHiImKkpOUlZaXmJmaoqOkpaanqKmqsrO0tba3uLm6wsPExcbHyMnK0tPU1dbX2Nna4uPk5ebn6Onq8vP09fb3+Pn6/9oADAMBAAIRAxEAPwD0JRUiimKKkUUAPUVIBTFFSCgB6ipFFMXHrXnWp+MNVg8UmysB56tuCR7gANu7e5PHyqUkX1JXvkAgHpiipAK5Twv4yg1+8uLB4ZILy24lR0f5TkgBjtCqxxnbn6ZFaWreIYNJuoYZQ37w8uq7wnBPzAHIHHXB4DHoCQAbqipFFcJqHjSW612w0PQzbzTzgPJcrJviCfNuVSMjfhHOCR9w9c1H41+I9v4Ms44I1+23wYxMpOMFURiT+EiH8/SgD0NRUgFeAwfG7xSsnmyeG1kt+h2o4xzjr9QRXovw68fz+OTe79NNkLTZv3EnJcEjH5H9PWgDvVFSAU1RUgFAHGKKkUUxRUiigCC/vodNsZbuc4SNS31wCcfpXkNrrPiv4kX9ydMvv7M0uIkF168KeD9Qa9K8a2c194O1KC3UtO0XyY6g5H9M14L4X0nQ5rmay13Wri0hjLGSGNtoZg2PQg8DNAHcfDrV9QtfHl1oM+qG+ijLgzM25SQB0P1x/wB81asVa7+Lk5lLHTyQU+bETYPmRAH13hm9zW34APhj7Rc2/hixIii/193MCWJAOCuc55z6VhSJc6P41kvxYO1rGTtUKTkAZ2jGOQOV+hHrQAeJ7dNE+K2m6nb3BR2IMvK5ZOjEkHJ4IOADwcmt3x7FeWVnc65bgIfL85WOzcNuBjdtbjkEcA57iuTiXU/F/wASLO8t9PuIdNjmVnyvy8DIJweODkd8H06db4tjGqauNGY3GDkRw4G0gA/NlwcgE5LDGMDkYoAZ8FLGBtCuNSmuI7m7knwzE5KbQVXBPP3Sw+ntXB6vAus/GrT7LUzuVpwlyCflLAnOPwCj8K6jQtG1fwL4ns4IrSW7sJQB5mzoSAp45xuwMZPABzyaufFHwNfSS23ifQIw8to5nliUct82/cPXnt6UAevQ2VtHEI0t4gmScBBjJOSfzJP41NbWlva7vIgji3kFtigbjjHOPavK/CXxr0a8sEt9fkay1GMbZCyfK59R6V6B4c8V6P4qW6fSLnz1tnCSMBgZIyMUAbqipAKaoqQCgDjFFSKKKKAHgAjBHBrl9R+G/hrVb37VcWWGJJYIdoY7cc/kD9R70UUAdRY6faadbrb2dvHBEvRY1wOuf61ZeCKZCkkaOp6hhmiigBtrpllZyeZbWkELbduY41XAznHA9earN4ftptaGpS7WZV2qoXHXruIPzA8cHjgUUUAbQVSQSASKlVRjGOPSiigDk9b+F/hPxBeG7vNMC3DEFpIWKbvqBx+la3hbwfo/hG1e30mBo1kILszZZiABz+WfxNFFAHRKKkAoooA//9k=") + private String base64Img; +} diff --git a/dongjian-dashboard-back-service/src/main/java/com/dongjian/dashboard/back/service/captcha/KaptchaConfig.java b/dongjian-dashboard-back-service/src/main/java/com/dongjian/dashboard/back/service/captcha/KaptchaConfig.java new file mode 100644 index 0000000..7ea5e0d --- /dev/null +++ b/dongjian-dashboard-back-service/src/main/java/com/dongjian/dashboard/back/service/captcha/KaptchaConfig.java @@ -0,0 +1,36 @@ +package com.dongjian.dashboard.back.service.captcha; + +import java.util.Properties; + +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +import com.google.code.kaptcha.impl.DefaultKaptcha; +import com.google.code.kaptcha.util.Config; + +@Configuration +public class KaptchaConfig { + @Bean + public DefaultKaptcha producer(){ + + DefaultKaptcha defaultKaptcha = new DefaultKaptcha(); + Properties properties = new Properties(); + properties.setProperty("kaptcha.border", "no"); + properties.setProperty("kaptcha.border.color", "105,179,90"); + properties.setProperty("kaptcha.textproducer.font.color", "black"); + properties.setProperty("kaptcha.image.width", "110"); + properties.setProperty("kaptcha.image.height", "40"); + properties.setProperty("kaptcha.textproducer.char.string","23456789abcdefghkmnpqrstuvwxyzABCDEFGHKMNPRSTUVWXYZ"); + properties.setProperty("kaptcha.textproducer.font.size", "30"); + properties.setProperty("kaptcha.textproducer.char.space","3"); + properties.setProperty("kaptcha.session.key", "code"); + properties.setProperty("kaptcha.textproducer.char.length", "4"); + properties.setProperty("kaptcha.textproducer.font.names", "宋体,楷体,微软雅黑"); +// properties.setProperty("kaptcha.obscurificator.impl","com.xxx");可以重写实现类 + properties.setProperty("kaptcha.noise.impl","com.google.code.kaptcha.impl.NoNoise"); + Config config = new Config(properties); + defaultKaptcha.setConfig(config); + + return defaultKaptcha; + } +} \ No newline at end of file diff --git a/dongjian-dashboard-back-service/src/main/java/com/dongjian/dashboard/back/service/common/CommonOpt.java b/dongjian-dashboard-back-service/src/main/java/com/dongjian/dashboard/back/service/common/CommonOpt.java new file mode 100644 index 0000000..866df73 --- /dev/null +++ b/dongjian-dashboard-back-service/src/main/java/com/dongjian/dashboard/back/service/common/CommonOpt.java @@ -0,0 +1,288 @@ +package com.dongjian.dashboard.back.service.common; + +import java.sql.Connection; +import java.sql.DriverManager; +import java.sql.PreparedStatement; +import java.sql.ResultSet; +import java.time.Instant; +import java.time.LocalDate; +import java.time.ZoneId; +import java.time.format.DateTimeFormatter; +import java.util.*; +import java.util.regex.Matcher; +import java.util.regex.Pattern; +import java.util.stream.Collectors; + +import com.dongjian.dashboard.back.common.Constants; +import com.dongjian.dashboard.back.common.response.ResponseCode; +import com.dongjian.dashboard.back.common.response.SimpleDataResponse; +import com.dongjian.dashboard.back.dao.ex.BasicUserMapperExt; +import com.dongjian.dashboard.back.dao.ex.UserBuildingRelationMapperExt; +import com.dongjian.dashboard.back.dto.device.LineDataSearchParams; +import com.dongjian.dashboard.back.util.DESUtil; +import com.dongjian.dashboard.back.vo.building.BindedBuildingVO; +import com.dongjian.dashboard.back.vo.company.AuroraInfo; +import com.dongjian.dashboard.back.vo.device.LineData; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.ObjectMapper; +import org.apache.commons.collections.CollectionUtils; +import org.apache.commons.lang3.StringUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.stereotype.Component; + +import com.dongjian.dashboard.back.dao.ex.BasicCompanyMapperExt; +import com.dongjian.dashboard.back.model.BasicCompany; +import com.dongjian.dashboard.back.util.CommonUtil; + +/** +* @author Mr.Jiang +* @time 2022年5月28日 上午7:41:40 +*/ +@Component +public class CommonOpt { + + private static Logger logger = LoggerFactory.getLogger(CommonOpt.class); + + @Value("${spring.datasource.url}") + private String dbUrl; + + @Autowired + private BasicCompanyMapperExt basicCompanyMapperExt; + @Autowired + private BasicUserMapperExt basicUserMapperExt; + @Autowired + private UserBuildingRelationMapperExt userBuildingRelationMapperExt; + + + /** + * 根据自身企业ID获取子企业ID的list,list包含自身ID + * + * @param companyId 自身ID + * + * @return + */ + public List getSelfAndSubCompanyId(Long companyId) { + List idsList = new ArrayList(); + idsList.add(companyId); + collectChildIds(idsList, companyId+""); + return idsList; + } + + + private void collectChildIds(List idsList, String parentCompanyIds) { + Map searchChildMap = new HashMap(); + searchChildMap.put("companyIds", parentCompanyIds); + List childCompanyList = basicCompanyMapperExt.getSubCompanyByParentId(searchChildMap); + if (CollectionUtils.isNotEmpty(childCompanyList)) { + List childIdsList = childCompanyList.stream().map(BasicCompany::getId).collect(Collectors.toList()); + idsList.addAll(childIdsList); + collectChildIds(idsList, StringUtils.join(childIdsList, ",")); + } + } + + + /** + * 过滤掉不属于targetCompany和它子企业的ID + * + * @param targetCompanyId 指定企业ID + * + * @param needProcessedCompanyIds 需要被处理的企业ID + * + */ + public List filterCompanyIds(Long targetCompanyId, String needProcessedCompanyIds) { + List selfAndSubCompanyList = getSelfAndSubCompanyId(targetCompanyId); + if (StringUtils.isNotBlank(needProcessedCompanyIds)) { + List needProcessedCompanyIdList = CommonUtil.commaStr2LongList(needProcessedCompanyIds); + return needProcessedCompanyIdList.stream().filter(selfAndSubCompanyList::contains).collect(Collectors.toList()); + } + return null; + } + + /** + * 判断subId在不在parentId子企业下 + * @param parentId + * @param subId + * @return + */ + public boolean isSubCompany(Long parentId, Long subId) { + List selfAndSubCompanyList = getSelfAndSubCompanyId(parentId); + if (selfAndSubCompanyList.contains(subId)) { + return true; + } else { + return false; + } + } + + public AuroraInfo getAuroraInfoByApikey(Map paramMap) { + AuroraInfo result = basicCompanyMapperExt.getAuroraInfoByApikey(paramMap); + if (null == result) { + return null; + } else { + if (1 == result.getParentId().intValue() || -1 == result.getParentId().intValue()) { + return result; + } else { + Map parentMap = new HashMap<>(); + parentMap.put("companyId", result.getParentId()); + return getAuroraInfoByApikey(parentMap); + } + } + } + + public AuroraInfo getAuroraUrl(Long companyId) { + Map paramMap = new HashMap<>(); + paramMap.put("companyId", companyId); + return getAuroraInfoByApikey(paramMap); + } + + public String buildAuroraJdbcUrl(String dbUrl, String auroraHost) { + String regex = "(jdbc:mysql://)([^/]+)(/data_center_new.*)"; + return dbUrl.replaceAll(regex, "$1" + auroraHost + "$3"); + } + + public String extractFirstValue(ObjectMapper mapper, String rawData) { + if (StringUtils.isBlank(rawData)){ + return ""; + } + try { + JsonNode node = mapper.readTree(rawData); + Iterator> fields = node.fields(); + if (fields.hasNext()) { + return fields.next().getValue().asText(); + } + } catch (Exception e) { + logger.error("Failed to parse rawData JSON: " + rawData, e); + } + return ""; + } + + public List getBindBuildingIdList(Long userId) { + Integer buildingManager = basicUserMapperExt.checkBuildingManager(userId); + if (buildingManager > 0) { + return null;//null表示不限制, sql里面判定bindedBuildingList=null的话,就不限制楼宇 + } else { + List bindedBuildingList = userBuildingRelationMapperExt.getBindedBuilding(userId); + if (CollectionUtils.isEmpty(bindedBuildingList)) { + return Collections.singletonList(-1L);//-1的话,表示没有绑定 + } else { + return bindedBuildingList.stream().map(BindedBuildingVO::getBuildingId).collect(Collectors.toList()); + } + } + } + + public List getPreDay(int days) { + // 获取当前日期 + LocalDate currentDate = LocalDate.now(); + // 设置日期格式化 + DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy_MM_dd"); + // 用于存储日期的列表 + List dateList = new ArrayList<>(); + // 获取当前日期到7天前的日期,按从早到晚的顺序添加 + for (int i = days - 1; i >= 0; i--) { // 包含今天 + LocalDate date = currentDate.minusDays(i); + // 格式化日期并添加到列表 + dateList.add(date.format(formatter)); + } + return dateList; + } + + public LineData getLineData(Long companyId, LineDataSearchParams lineDataSearchParams) { + LineData lineData = new LineData(); + try { + Map apikeyParamMap = new HashMap<>(); + apikeyParamMap.put("companyId", companyId); + AuroraInfo apikeyInfo = getAuroraInfoByApikey(apikeyParamMap); + + if (null == apikeyInfo) { + logger.error("Failed to get AuroraInfo for companyId: {}", companyId); + return lineData; + } + + if (StringUtils.isNotBlank(apikeyInfo.getAuroraUrl())) { + Class.forName("com.mysql.cj.jdbc.Driver"); + + String regex = "(jdbc:mysql://)([^/]+)(/data_center_new.*)"; + Pattern pattern = Pattern.compile(regex); + Matcher matcher = pattern.matcher(dbUrl); + String newJdbcUrl = ""; + if (matcher.find()) { + newJdbcUrl = matcher.replaceAll("$1" + apikeyInfo.getAuroraUrl() + "$3"); + } + + try (Connection conn = DriverManager.getConnection( + newJdbcUrl.replace("data_center_new", "third") + "&allowPublicKeyRetrieval=true", + DESUtil.decrypt(apikeyInfo.getAuroraUsername(), Constants.DES_SALT), + DESUtil.decrypt(apikeyInfo.getAuroraPassword(), Constants.DES_SALT))) { + + List dateList = getPreDay(1); + + for (String date : dateList) { + String baseSql = "SELECT rawData, receive_ts FROM rawData_" + date + " WHERE deviceId = ? order by receive_ts "; + String sql = baseSql; + logger.info("getLineData sql: {}", sql); + try (PreparedStatement preparedStatement = conn.prepareStatement(sql)) { + preparedStatement.setString(1, lineDataSearchParams.getDeviceId()); + try (ResultSet result = preparedStatement.executeQuery()) { + if (result.next()) { + processResult(result, lineData); + } + } + } + } + } catch (Exception e) { + logger.error("getLineData processing aurora error", e); + } + } + + } catch (Exception e) { + logger.error("getLineData error", e); + } + return lineData; + } + + private void processResult(ResultSet result, LineData lineData) { + try { + // 用于存储 xData 和 yData + List xDataList = new ArrayList<>(); + List yDataList = new ArrayList<>(); + + // 使用 DateTimeFormatter 来格式化时间 + DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"); + ObjectMapper mapper = new ObjectMapper(); + + // 遍历查询结果 + do { + // 获取 receive_ts 和 rawData + long receiveTs = result.getLong("receive_ts"); + String rawData = result.getString("rawData"); + + // 如果 receiveTs 为 0(表示无效时间戳),跳过当前行 + if (receiveTs == 0) { + continue; // 跳过当前循环的剩余部分,继续处理下一行 + } + + // 将 long 时间戳转换为 LocalDateTime(日本时区) + Instant instant = Instant.ofEpochMilli(receiveTs); + String formattedDate = instant.atZone(ZoneId.of("Asia/Tokyo")) + .toLocalDateTime() + .format(formatter); + + xDataList.add(formattedDate); + + // 将 rawData解析 添加到 yData + String value = extractFirstValue(mapper, rawData); + yDataList.add(StringUtils.isBlank(value) ? "0" : value); + + } while (result.next()); + + lineData.getXData().addAll(xDataList); + lineData.getYData().addAll(yDataList); + + } catch (Exception e) { + logger.error("Error processing result set", e); + } + } + +} diff --git a/dongjian-dashboard-back-service/src/main/java/com/dongjian/dashboard/back/service/common/LevelHierarchyTreeBuilder.java b/dongjian-dashboard-back-service/src/main/java/com/dongjian/dashboard/back/service/common/LevelHierarchyTreeBuilder.java new file mode 100644 index 0000000..2db50ee --- /dev/null +++ b/dongjian-dashboard-back-service/src/main/java/com/dongjian/dashboard/back/service/common/LevelHierarchyTreeBuilder.java @@ -0,0 +1,203 @@ +package com.dongjian.dashboard.back.service.common; + +import com.dongjian.dashboard.back.vo.levelhierarchy.LevelHierarchyTreeVO; + +import java.util.*; +import java.util.stream.Collectors; + +/** + * 动态层级树构建器(支持从任意层级开始的结构) + * 如果某个 BUILDING 没有对应的 SITE 上级,则该 BUILDING 不会被返回(避免单独楼宇作为根) + */ +public class LevelHierarchyTreeBuilder { + + // 层级顺序 + private static final List TYPE_ORDER = Arrays.asList("BRANCH", "STORE", "AREA", "SITE", "BUILDING"); + + /** + * 从 SQL 返回的所有节点构建树,剔除孤立的 BUILDING + * @param allList SQL 返回的所有节点(每项包含 id,name,type,remark,parentId) + * @return 层级树(roots) + */ + public static List buildHierarchyTree(List allList) { + if (allList == null || allList.isEmpty()) { + return Collections.emptyList(); + } + + // 1) 分组按 type + Map> grouped = + allList.stream().collect(Collectors.groupingBy(LevelHierarchyTreeVO::getType)); + + // 2) 构建 type+id -> node 映射(use list to allow duplicate ids across rows if needed) + Map> typeIdMap = new HashMap<>(); + for (LevelHierarchyTreeVO node : allList) { + String key = typeIdKey(node.getType(), node.getId()); + typeIdMap.computeIfAbsent(key, k -> new ArrayList<>()).add(node); + } + + // 3) 剔除孤立 BUILDING:如果某个 building 的 parentId 指向的 SITE 在数据里不存在,则不要返回该 building(也不作为子节点) + // 这里我们从 allList 中制作一个 filteredList + Set siteKeys = allList.stream() + .filter(n -> "SITE".equals(n.getType())) + .map(n -> typeIdKey(n.getType(), n.getId())) + .collect(Collectors.toSet()); + + List filtered = new ArrayList<>(); + for (LevelHierarchyTreeVO node : allList) { + if ("BUILDING".equals(node.getType())) { + // 如果 building 的 parentId 对应 site 存在,则保留;否则丢弃 + if (node.getParentId() != null) { + String parentSiteKey = typeIdKey("SITE", node.getParentId()); + if (siteKeys.contains(parentSiteKey)) { + filtered.add(node); + } else { + // 父 site 不存在 => 丢弃该孤立 building + } + } else { + // parentId null 的 building 也直接丢弃 + } + } else { + filtered.add(node); + } + } + + // 4) 用 filtered 做后续处理(避免孤立 building 干扰 parent detection) + Map> filteredTypeIdMap = new HashMap<>(); + for (LevelHierarchyTreeVO node : filtered) { + String key = typeIdKey(node.getType(), node.getId()); + filteredTypeIdMap.computeIfAbsent(key, k -> new ArrayList<>()).add(node); + } + + // 5) 构建 parentId -> children 索引(针对每个层级) + Map>> indexByType = new HashMap<>(); + for (String type : TYPE_ORDER) { + List list = filtered.stream() + .filter(n -> type.equals(n.getType())) + .collect(Collectors.toList()); + Map> idx = list.stream() + .filter(n -> n.getParentId() != null) + .collect(Collectors.groupingBy(LevelHierarchyTreeVO::getParentId)); + indexByType.put(type, idx); + } + + // 6) 找 root candidates: + // root = 节点的 parentType 不存在 或 parentId 为 null 或 parent 不在 filtered 集合中 + List rootCandidates = new ArrayList<>(); + for (LevelHierarchyTreeVO node : filtered) { + String parentType = getParentType(node.getType()); + if (parentType == null || node.getParentId() == null) { + // BRANCH 或 没有 parentId => root candidate + rootCandidates.add(node); + } else { + // 检查 parent 是否存在于 filtered + String parentKey = typeIdKey(parentType, node.getParentId()); + if (!filteredTypeIdMap.containsKey(parentKey)) { + rootCandidates.add(node); + } + } + } + + // 7) 去重 rootCandidates(按 type+id 去重) + List rootsUnique = rootCandidates.stream() + .collect(Collectors.collectingAndThen( + Collectors.toMap(n -> typeIdKey(n.getType(), n.getId()), n -> n, (a, b) -> a), + m -> new ArrayList<>(m.values()) + )); + + // 8) 为每个 root 递归构建子树(使用 indexByType) + List roots = new ArrayList<>(); + for (LevelHierarchyTreeVO root : rootsUnique) { + LevelHierarchyTreeVO built = buildSubTreeRecursive(copyNode(root), indexByType); + roots.add(built); + } + + // 9) 按 type 顺序排序根节点(BRANCH 首) + roots.sort(Comparator.comparingInt(n -> typeOrderIndex(n.getType()))); + + // 10) 最终 deep copy,防止引用问题 + return deepCopyList(roots); + } + + /** 递归构造某个节点的子树(依据 indexByType) */ + private static LevelHierarchyTreeVO buildSubTreeRecursive(LevelHierarchyTreeVO parent, + Map>> indexByType) { + String nextType = getNextType(parent.getType()); + if (nextType == null) { + return parent; + } + Map> nextIdx = indexByType.get(nextType); + if (nextIdx != null && parent.getId() != null) { + List children = nextIdx.get(parent.getId()); + if (children != null && !children.isEmpty()) { + List childCopies = new ArrayList<>(); + for (LevelHierarchyTreeVO ch : children) { + LevelHierarchyTreeVO childNode = copyNode(ch); + // 递归为 child 构建更深层次的子树 + LevelHierarchyTreeVO builtChild = buildSubTreeRecursive(childNode, indexByType); + childCopies.add(builtChild); + } + parent.setChildren(childCopies); + } + } + return parent; + } + + /* ----------------- 辅助方法 ------------------ */ + + private static String getParentType(String type) { + int idx = TYPE_ORDER.indexOf(type); + return (idx > 0) ? TYPE_ORDER.get(idx - 1) : null; + } + + private static String getNextType(String type) { + int idx = TYPE_ORDER.indexOf(type); + return (idx >= 0 && idx < TYPE_ORDER.size() - 1) ? TYPE_ORDER.get(idx + 1) : null; + } + + private static String typeIdKey(String type, Long id) { + return (type == null ? "null" : type) + "_" + (id == null ? "null" : id.toString()); + } + + private static LevelHierarchyTreeVO copyNode(LevelHierarchyTreeVO src) { + LevelHierarchyTreeVO copy = new LevelHierarchyTreeVO(); + copy.setId(src.getId()); + copy.setName(src.getName()); + copy.setType(src.getType()); + copy.setRemark(src.getRemark()); + copy.setParentId(src.getParentId()); + copy.setChildren(null); + return copy; + } + + private static List deepCopyList(List list) { + List out = new ArrayList<>(); + for (LevelHierarchyTreeVO n : list) { + out.add(deepCopyNode(n)); + } + return out; + } + + private static LevelHierarchyTreeVO deepCopyNode(LevelHierarchyTreeVO src) { + if (src == null) return null; + LevelHierarchyTreeVO copy = copyNode(src); + if (src.getChildren() != null) { + List ch = new ArrayList<>(); + for (LevelHierarchyTreeVO c : src.getChildren()) { + ch.add(deepCopyNode(c)); + } + copy.setChildren(ch); + } + return copy; + } + + private static int typeOrderIndex(String type) { + switch (type) { + case "BRANCH": return 0; + case "STORE": return 1; + case "AREA": return 2; + case "SITE": return 3; + case "BUILDING": return 4; + default: return 10; + } + } +} diff --git a/dongjian-dashboard-back-service/src/main/java/com/dongjian/dashboard/back/service/common/MenuTree.java b/dongjian-dashboard-back-service/src/main/java/com/dongjian/dashboard/back/service/common/MenuTree.java new file mode 100644 index 0000000..3e895d1 --- /dev/null +++ b/dongjian-dashboard-back-service/src/main/java/com/dongjian/dashboard/back/service/common/MenuTree.java @@ -0,0 +1,69 @@ +package com.dongjian.dashboard.back.service.common; + +import java.util.ArrayList; +import java.util.List; + +import com.dongjian.dashboard.back.vo.TreeMenusDTO; + +/** +* @author Mr.Jiang +* @time 2022年7月29日 下午4:50:26 +*/ +public class MenuTree { + + /** + * 所有的菜单数据 + */ + private List menuList = new ArrayList(); + + public MenuTree(List menuList) { + this.menuList = menuList; + } + + /** + * 建立树形结构 + * + * @return + */ + public List buildTree(String rootNodeKey) { + List treeMenus = new ArrayList(); + for (TreeMenusDTO menuNode : getRootNode(rootNodeKey)) { + menuNode = buildChildTree(menuNode); + treeMenus.add(menuNode); + } + return treeMenus; + } + + /** + * 递归,建立子树形结构 + * + * @param pNode + * @return + */ + private TreeMenusDTO buildChildTree(TreeMenusDTO pNode) { + List childMenus = new ArrayList(); + for (TreeMenusDTO menuNode : menuList) { + if (menuNode.getParentKey().equals(pNode.getKey())) { + childMenus.add(buildChildTree(menuNode)); + } + } + pNode.setChildren(childMenus); + return pNode; + } + + /** + * 获取根节点 + * @param rootNodeKey + * + * @return + */ + private List getRootNode(String rootNodeKey) { + List rootMenuLists = new ArrayList(); + for (TreeMenusDTO menuNode : menuList) { + if (menuNode.getParentKey().equalsIgnoreCase(rootNodeKey)) { + rootMenuLists.add(menuNode); + } + } + return rootMenuLists; + } +} diff --git a/dongjian-dashboard-back-service/src/main/java/com/dongjian/dashboard/back/service/impl/AccountServiceImpl.java b/dongjian-dashboard-back-service/src/main/java/com/dongjian/dashboard/back/service/impl/AccountServiceImpl.java new file mode 100644 index 0000000..3b15b3e --- /dev/null +++ b/dongjian-dashboard-back-service/src/main/java/com/dongjian/dashboard/back/service/impl/AccountServiceImpl.java @@ -0,0 +1,87 @@ +package com.dongjian.dashboard.back.service.impl; + +import java.text.MessageFormat; + +import org.apache.commons.lang3.StringUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.stereotype.Service; + +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONObject; +import com.alibaba.fastjson.TypeReference; +import com.dongjian.dashboard.back.common.Constants; +import com.dongjian.dashboard.back.common.language.msg.MsgLanguageChange; +import com.dongjian.dashboard.back.common.response.ResponseCode; +import com.dongjian.dashboard.back.dao.ex.BasicUserMapperExt; +import com.dongjian.dashboard.back.dao.ex.LoginHistoryMapperExt; +import com.dongjian.dashboard.back.dto.account.CacheUserData; +import com.dongjian.dashboard.back.service.AccountService; +import com.dongjian.dashboard.back.util.redis.RedisUtil; + +/** + * 账户信息ServiceImpl + */ +@Service +public class AccountServiceImpl implements AccountService { + + private Logger logger = LoggerFactory.getLogger(AccountServiceImpl.class); + + @Value("${user.login.keytimeout:3600}") + private long loginTimeOut; + + + private static final long CAPTCHA_TIMEOUT = 120L; + + + @Autowired + private BasicUserMapperExt basicUserMapperExt; + @Autowired + private LoginHistoryMapperExt loginHistoryMapperExt; + @Autowired + private MsgLanguageChange msgLanguageChange; + @Autowired + private RedisUtil redisUtil; + + @Override + public boolean accessAuth(String loginName, String companyId, String userId, String accessToken, String languageType, JSONObject jsonObject, Long keytimeout) { + if (StringUtils.isBlank(languageType)) { + languageType = "2"; + } + //如果user_name,token不为空,则判定token合法性后取值权限,为空则返回token为空请求参数错误401 + if (StringUtils.isBlank(accessToken) || StringUtils.isBlank(loginName) + || StringUtils.isBlank(companyId) || StringUtils.isBlank(userId)) { + jsonObject.put("code", ResponseCode.AUTHORIZE_FAILED); + jsonObject.put("msg", msgLanguageChange.getParameterMapByCode(Integer.valueOf(languageType), "tokenError")); + return false; + } else { + String key = MessageFormat.format(Constants.ACCESS_TOKEN_FORMAT, userId, loginName, companyId, accessToken); + Object userDataStr = redisUtil.get(key); + if (null != userDataStr) { + CacheUserData cacheUserData = (CacheUserData) JSON.parseObject(userDataStr.toString(), new TypeReference() {}); + if (cacheUserData != null) { + String accessTokenOld = cacheUserData.getAccessToken(); + if (!StringUtils.equals(accessToken, accessTokenOld)) { + jsonObject.put("code", ResponseCode.AUTHORIZE_FAILED); + jsonObject.put("msg", msgLanguageChange.getParameterMapByCode(Integer.valueOf(languageType), "tokenError")); + return false; + } else { + redisUtil.set(key, JSONObject.toJSONString(cacheUserData), loginTimeOut); + return true; + } + } else { + jsonObject.put("code", ResponseCode.AUTHORIZE_FAILED); + jsonObject.put("msg", msgLanguageChange.getParameterMapByCode(Integer.valueOf(languageType), "tokenError")); + return false; + } + } else{ + jsonObject.put("code", ResponseCode.AUTHORIZE_FAILED); + jsonObject.put("msg", msgLanguageChange.getParameterMapByCode(Integer.valueOf(languageType), "tokenError")); + return false; + } + } + } + +} diff --git a/dongjian-dashboard-back-service/src/main/java/com/dongjian/dashboard/back/service/impl/BuildingServiceImpl.java b/dongjian-dashboard-back-service/src/main/java/com/dongjian/dashboard/back/service/impl/BuildingServiceImpl.java new file mode 100644 index 0000000..b83ba30 --- /dev/null +++ b/dongjian-dashboard-back-service/src/main/java/com/dongjian/dashboard/back/service/impl/BuildingServiceImpl.java @@ -0,0 +1,58 @@ +package com.dongjian.dashboard.back.service.impl; + +import java.util.Arrays; +import java.util.List; + +import com.dongjian.dashboard.back.common.response.PageInfo; +import com.dongjian.dashboard.back.dao.ex.BasicBuildingMapperExt; +import com.dongjian.dashboard.back.dto.building.BuildingSearchParams; +import com.dongjian.dashboard.back.service.BuildingService; +import com.dongjian.dashboard.back.service.common.CommonOpt; +import com.dongjian.dashboard.back.util.CommonUtil; +import com.dongjian.dashboard.back.vo.building.BuildingPageVO; +import org.apache.commons.lang3.StringUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import com.github.pagehelper.PageHelper; + +/** + * + * @author jwy-style + * + */ +@Service +public class BuildingServiceImpl implements BuildingService { + + private static Logger logger = LoggerFactory.getLogger(BuildingServiceImpl.class); + + + @Autowired + private CommonOpt commonOpt; + @Autowired + private BasicBuildingMapperExt basicBuildingMapperExt; + + + @Override + public PageInfo getListPage(BuildingSearchParams pageSearchParam, Long companyId, + Long userId, Integer languageType, Integer uTCOffset) { + if (StringUtils.isBlank(pageSearchParam.getCompanyIds())) { + pageSearchParam.setCompanyIdList(Arrays.asList(companyId)); + } else { + pageSearchParam.setCompanyIdList(commonOpt.filterCompanyIds(companyId, pageSearchParam.getCompanyIds())); + } + if (StringUtils.isNotBlank(pageSearchParam.getBuildingIds())) { + pageSearchParam.setBuildingIdList(CommonUtil.commaStr2LongList(pageSearchParam.getBuildingIds())); + } + +// pageSearchParam.setBindBuildingIdList(commonOpt.getBindBuildingIdList(userId)); + + PageHelper.startPage(pageSearchParam.getPageNum() == null ? 1 : pageSearchParam.getPageNum(), pageSearchParam.getPageSize() == null ? 20 : pageSearchParam.getPageSize()); + List resultList = basicBuildingMapperExt.getListPage(pageSearchParam); + + return new PageInfo<>(resultList); + } + +} diff --git a/dongjian-dashboard-back-service/src/main/java/com/dongjian/dashboard/back/service/impl/CommonServiceImpl.java b/dongjian-dashboard-back-service/src/main/java/com/dongjian/dashboard/back/service/impl/CommonServiceImpl.java new file mode 100644 index 0000000..6e851d7 --- /dev/null +++ b/dongjian-dashboard-back-service/src/main/java/com/dongjian/dashboard/back/service/impl/CommonServiceImpl.java @@ -0,0 +1,78 @@ +package com.dongjian.dashboard.back.service.impl; + +import java.util.ArrayList; +import java.util.List; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import com.dongjian.dashboard.back.common.response.SimpleDataResponse; +import com.dongjian.dashboard.back.dao.ex.BasicCompanyMapperExt; +import com.dongjian.dashboard.back.model.BasicCompanyExample; +import com.dongjian.dashboard.back.service.CommonService; +import com.dongjian.dashboard.back.service.common.CommonOpt; + +/** + * + * @author jwy-style + * + */ +@Service +public class CommonServiceImpl implements CommonService { + + private static Logger logger = LoggerFactory.getLogger(CommonServiceImpl.class); + + + @Autowired + private CommonOpt commonOpt; + + @Autowired + private BasicCompanyMapperExt basicCompanyMapperExt; + + + @Override + public SimpleDataResponse checkApikey(String apikey) { + SimpleDataResponse resp = new SimpleDataResponse(); + try { + BasicCompanyExample basicCompanyExample = new BasicCompanyExample(); + BasicCompanyExample.Criteria criteria = basicCompanyExample.createCriteria(); + criteria.andFlagNotEqualTo(1); + + resp.setCode(200); + if (basicCompanyMapperExt.countByExample(basicCompanyExample) > 0) { + resp.setData(true); + } else { + resp.setData(false); + } + } catch (Exception e) { + resp.setCode(500); + resp.setData(e.getMessage()); + } + return resp; + } + + + + @Override + public SimpleDataResponse initDatabase(Long companyId) { + SimpleDataResponse resp = new SimpleDataResponse(); + return resp; + } + + @Override + public SimpleDataResponse initAurora(Long companyId) { +// commonOpt.createAurora(companyId); + return SimpleDataResponse.success(); + } + + @Override + public SimpleDataResponse destroyAurora(Long companyId) { + List comList = new ArrayList<>(); + comList.add(companyId); +// commonOpt.destroyAurora(comList); + return SimpleDataResponse.success(); + } + +} diff --git a/dongjian-dashboard-back-service/src/main/java/com/dongjian/dashboard/back/service/impl/CompanyServiceImpl.java b/dongjian-dashboard-back-service/src/main/java/com/dongjian/dashboard/back/service/impl/CompanyServiceImpl.java new file mode 100644 index 0000000..61bdfa1 --- /dev/null +++ b/dongjian-dashboard-back-service/src/main/java/com/dongjian/dashboard/back/service/impl/CompanyServiceImpl.java @@ -0,0 +1,281 @@ +package com.dongjian.dashboard.back.service.impl; + +import java.text.MessageFormat; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Base64; +import java.util.List; +import java.util.stream.Collectors; + +import org.apache.commons.collections.CollectionUtils; +import org.apache.commons.lang3.ObjectUtils; +import org.apache.commons.lang3.StringUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.BeanUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.transaction.interceptor.TransactionAspectSupport; + +import com.github.pagehelper.PageHelper; +import com.dongjian.dashboard.back.common.Constants; +import com.dongjian.dashboard.back.common.exception.MsgCodeException; +import com.dongjian.dashboard.back.common.language.msg.MsgLanguageChange; +import com.dongjian.dashboard.back.common.response.PageInfo; +import com.dongjian.dashboard.back.common.response.ResponseCode; +import com.dongjian.dashboard.back.common.response.SimpleDataResponse; +import com.dongjian.dashboard.back.dao.ex.BasicCompanyMapperExt; +import com.dongjian.dashboard.back.dto.company.CompanySearchParams; +import com.dongjian.dashboard.back.dto.company.DeleteCompanyParams; +import com.dongjian.dashboard.back.dto.company.OptCompanyParams; +import com.dongjian.dashboard.back.model.BasicCompany; +import com.dongjian.dashboard.back.model.BasicCompanyExample; +import com.dongjian.dashboard.back.service.CompanyService; +import com.dongjian.dashboard.back.service.common.CommonOpt; +import com.dongjian.dashboard.back.service.common.MenuTree; +import com.dongjian.dashboard.back.util.CommonUtil; +import com.dongjian.dashboard.back.util.DESUtil; +import com.dongjian.dashboard.back.util.async.OptAsync; +import com.dongjian.dashboard.back.vo.TreeMenusDTO; +import com.dongjian.dashboard.back.vo.company.CompanyPageDTO; + +/** + * + * @author jwy-style + * + */ +@Service +public class CompanyServiceImpl implements CompanyService { + + private static Logger logger = LoggerFactory.getLogger(CompanyServiceImpl.class); + + //{0}:时间戳变量 {1}:企业ID + private static final String APIKEY_FORMAT = "cp_{0}_{1}"; + + @Autowired + private OptAsync optAsync; + @Autowired + private MsgLanguageChange msgLanguageChange; + @Autowired + private BasicCompanyMapperExt basicCompanyMapperExt; + @Autowired + private CommonOpt commonOpt; + + + @Override + public boolean idsAuth(Long companyId, String needAuthIds) { +// if (StringUtils.isBlank(needAuthIds)) { +// return false; +// } +// +// List ids = Arrays.asList(StringUtils.split(needAuthIds, ",")).stream() +// .map(id -> CommonUtil.String2Long(id.trim())).collect(Collectors.toList()); +// +// BasicCompanyExample basicCompanyExample = new BasicCompanyExample(); +// BasicCompanyExample.Criteria criteria = basicCompanyExample.createCriteria(); +// criteria.andFlagNotEqualTo(1).andCompanyIdEqualTo(companyId).andIdIn(ids); +// Long count = basicCompanyMapperExt.countByExample(basicCompanyExample); + +// Set idSet = new HashSet<>(ids); +// if (Objects.equals(count, (long)idSet.size())) { +// return true; +// } + return false; + } + + + @Override + @Transactional + public SimpleDataResponse add(OptCompanyParams optCompanyParams, Long companyId, Long userId, + Integer languageType) { + try { + + + return SimpleDataResponse.success(); + } catch (Exception e) { + logger.error("新增企业出错", e); + TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); + return new SimpleDataResponse(ResponseCode.SERVER_ERROR, ResponseCode.SERVER_ERROR_MSG); + } + } + + + private SimpleDataResponse checkLimit(Integer languageType) { + BasicCompanyExample selectCompanyExample = new BasicCompanyExample(); + BasicCompanyExample.Criteria selectCriteria = selectCompanyExample.createCriteria(); + selectCriteria.andFlagNotEqualTo(1); + if (basicCompanyMapperExt.countByExample(selectCompanyExample) == 15) { + return new SimpleDataResponse(ResponseCode.MSG_ERROR, msgLanguageChange.getParameterMapByCode(languageType, "companyLimit")); + } + return SimpleDataResponse.success(); + } + + + private SimpleDataResponse checkExist(OptCompanyParams optCompanyParams, Integer languageType) { + if (basicCompanyMapperExt.checkExist(optCompanyParams) > 0) { + return new SimpleDataResponse(ResponseCode.MSG_ERROR, msgLanguageChange.getParameterMapByCode(languageType, "companyNameHasExisted")); + } + return SimpleDataResponse.success(); + } + + + private SimpleDataResponse checkParam(OptCompanyParams optCompanyParams, Integer languageType) { + if(StringUtils.isBlank(optCompanyParams.getCompanyName()) || optCompanyParams.getCompanyName().length() > 500){ + return new SimpleDataResponse(ResponseCode.MSG_ERROR, "Parameter [companyName] error"); + } +// if(null != optCompanyParams.getCompanyId() && optCompanyParams.getCompanyId().longValue() == optCompanyParams.getParentId().longValue()){ +// return new SimpleDataResponse(ResponseCode.MSG_ERROR, "parentId can not be the same as companyId"); +// } + return SimpleDataResponse.success(); + } + + + @Override + @Transactional + public SimpleDataResponse edit(OptCompanyParams optCompanyParams, Long companyId, Long userId, + Integer languageType) { + try { +// optCompanyParams.setParentId(companyId); + //校验参数 + SimpleDataResponse checkResult = checkParam(optCompanyParams, languageType); + if (200 != checkResult.getCode()) { + return checkResult; + } + + BasicCompany oldBC = basicCompanyMapperExt.selectByPrimaryKey(optCompanyParams.getCompanyId()); + //不存在, 这基本不可能,给个英文提示就行,省得翻译 + if (ObjectUtils.isEmpty(oldBC) || 1 == oldBC.getFlag()){ + return new SimpleDataResponse(ResponseCode.MSG_ERROR, "Not found"); + } + /**一些权限校验操作**/ + try { + List selfAndSubCompanyList = commonOpt.getSelfAndSubCompanyId(companyId); + //编辑的企业不属于自己所管的企业 + if (!selfAndSubCompanyList.contains(oldBC.getId())){ + throw new MsgCodeException(msgLanguageChange.getParameterMapByCode(languageType, "noOperationAuth")); + } + //父企业ID不属于自己所管的企业 +// if (!selfAndSubCompanyList.contains(optCompanyParams.getParentId())){ +// throw new MsgCodeException(msgLanguageChange.getParameterMapByCode(languageType, "noOperationAuth")); +// } + } catch (MsgCodeException e) { + return new SimpleDataResponse(ResponseCode.MSG_ERROR, e.getMessage()); + } + + //防止套娃 +// List idsList = commonOpt.getSelfAndSubCompanyId(optCompanyParams.getCompanyId()); +// if (CollectionUtils.isNotEmpty(idsList) && idsList.contains(optCompanyParams.getParentId())) { +// return new SimpleDataResponse(ResponseCode.MSG_ERROR, msgLanguageChange.getParameterMapByCode(languageType, "taowaComapny")); +// } + + //重复校验 + SimpleDataResponse checkExistResult = checkExist(optCompanyParams, languageType); + if (200 != checkExistResult.getCode()) { + return checkExistResult; + } + BasicCompany basicCompany = new BasicCompany(); + BeanUtils.copyProperties(optCompanyParams,basicCompany); + basicCompany.setId(optCompanyParams.getCompanyId()); + basicCompany.setParentId(null); + basicCompany.setModifyTime(System.currentTimeMillis()); + basicCompanyMapperExt.updateByPrimaryKeySelective(basicCompany); + + return SimpleDataResponse.success(); + } catch (Exception e) { + logger.error("编辑企业出错", e); + TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); + return new SimpleDataResponse(ResponseCode.SERVER_ERROR, ResponseCode.SERVER_ERROR_MSG); + } + } + + + @Override + @Transactional + public SimpleDataResponse batchDelete(DeleteCompanyParams deleteCompanyParams, Long companyId, Long userId, + Integer languageType) { + if (StringUtils.isBlank(deleteCompanyParams.getCompanyIds())) { + return SimpleDataResponse.success(); + } + try { + List ids = Arrays.asList(StringUtils.split(deleteCompanyParams.getCompanyIds(), ",")).stream() + .map(id -> CommonUtil.String2Long(id.trim())).collect(Collectors.toList()); + + if (ids.contains(companyId)) { + return new SimpleDataResponse(ResponseCode.MSG_ERROR, "can not delete your own company"); + } + + //删除的企业拥有下级企业,需先处理下级企业 + BasicCompanyExample basicCompanyExample = new BasicCompanyExample(); + BasicCompanyExample.Criteria criteria = basicCompanyExample.createCriteria(); + criteria.andParentIdIn(ids).andFlagEqualTo(0); + List childList = basicCompanyMapperExt.selectByExample(basicCompanyExample); + if (CollectionUtils.isNotEmpty(childList)) { + return new SimpleDataResponse(ResponseCode.MSG_ERROR, msgLanguageChange.getParameterMapByCode(languageType, "hasSubsidiary")); + } + + BasicCompanyExample updateCompanyExample = new BasicCompanyExample(); + BasicCompanyExample.Criteria updateCriteria = updateCompanyExample.createCriteria(); + updateCriteria.andIdIn(commonOpt.filterCompanyIds(companyId, deleteCompanyParams.getCompanyIds()));//这里要过滤掉不属于自己子企业的id + BasicCompany basicCompany = new BasicCompany(); + basicCompany.setFlag(1); + basicCompanyMapperExt.updateByExampleSelective(basicCompany, updateCompanyExample); + + return SimpleDataResponse.success(); + } catch (Exception e) { + logger.error("删除企业出错", e); + TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); + return new SimpleDataResponse(ResponseCode.SERVER_ERROR, ResponseCode.SERVER_ERROR_MSG); + } + } + + + @Override + public PageInfo getListPage(CompanySearchParams pageSearchParam, Long companyId, + Long userId, Integer languageType, Integer uTCOffset) { +// pageSearchParam.setSelfCompanyId(companyId); + //list防${}注入 + if (StringUtils.isBlank(pageSearchParam.getCompanyIds())) { + pageSearchParam.setCompanyIdList(commonOpt.getSelfAndSubCompanyId(companyId)); + } else { + pageSearchParam.setCompanyIdList(commonOpt.filterCompanyIds(companyId, pageSearchParam.getCompanyIds())); + } + + PageHelper.startPage(pageSearchParam.getPageNum() == null ? 1 : pageSearchParam.getPageNum(), pageSearchParam.getPageSize() == null ? 20 : pageSearchParam.getPageSize()); + List resultList = basicCompanyMapperExt.getListPage(pageSearchParam); + + return new PageInfo<>(resultList); + } + + + @Override + public SimpleDataResponse> getCompanyTree(Long companyId, Long userId, Integer languageType) { + List companyList = basicCompanyMapperExt.getListForTree(); + if (CollectionUtils.isNotEmpty(companyList)) { + TreeMenusDTO rootTree = new TreeMenusDTO(); + //先把自身节点作为根节点 + String rootId = companyId+""; + for (TreeMenusDTO treeMenusDTO : companyList) { + if (rootId.equals(treeMenusDTO.getKey())) { + rootTree = treeMenusDTO; + break; + } + } + + MenuTree menuTree =new MenuTree(companyList); + companyList = menuTree.buildTree(rootId); + + rootTree.setChildren(companyList); + + return SimpleDataResponse.success(rootTree); + } else { + return SimpleDataResponse.success(new ArrayList()); + } + } + + + @Override + public SimpleDataResponse osakaInitAurora() { + return SimpleDataResponse.success(); + } +} diff --git a/dongjian-dashboard-back-service/src/main/java/com/dongjian/dashboard/back/service/impl/DeviceDataAccumulateServiceImpl.java b/dongjian-dashboard-back-service/src/main/java/com/dongjian/dashboard/back/service/impl/DeviceDataAccumulateServiceImpl.java new file mode 100644 index 0000000..2ea3ca1 --- /dev/null +++ b/dongjian-dashboard-back-service/src/main/java/com/dongjian/dashboard/back/service/impl/DeviceDataAccumulateServiceImpl.java @@ -0,0 +1,136 @@ +package com.dongjian.dashboard.back.service.impl; + +import java.time.LocalDate; +import java.time.LocalDateTime; +import java.time.ZoneId; +import java.util.*; +import java.util.function.Function; +import java.util.stream.Collectors; + +import com.dongjian.dashboard.back.common.Constants; +import com.dongjian.dashboard.back.common.language.msg.MsgLanguageChange; +import com.dongjian.dashboard.back.common.response.PageInfo; +import com.dongjian.dashboard.back.common.response.SimpleDataResponse; +import com.dongjian.dashboard.back.dao.ex.DashboardRecordAccumulateMapperExt; +import com.dongjian.dashboard.back.dao.ex.DeviceInfoMapperExt; +import com.dongjian.dashboard.back.dao.ex.FavoritedDeviceMapperExt; +import com.dongjian.dashboard.back.dto.data.AccumulateDataSearchParam; +import com.dongjian.dashboard.back.dto.device.LineDataSearchParams; +import com.dongjian.dashboard.back.service.DeviceDataAccumulateService; +import com.dongjian.dashboard.back.service.common.CommonOpt; +import com.dongjian.dashboard.back.util.DateUtil; +import com.dongjian.dashboard.back.vo.data.DeviceAccumulateData; +import com.dongjian.dashboard.back.vo.device.DeviceIncrement; +import com.dongjian.dashboard.back.vo.device.LineData; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.github.pagehelper.PageHelper; +import org.apache.commons.collections.CollectionUtils; +import org.apache.commons.lang3.StringUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +@Service +public class DeviceDataAccumulateServiceImpl implements DeviceDataAccumulateService { + + private static final Logger logger = LoggerFactory.getLogger(DeviceDataAccumulateServiceImpl.class); + + @Autowired + private DeviceInfoMapperExt deviceInfoMapperExt; + @Autowired + private FavoritedDeviceMapperExt favoritedDeviceMapperExt; + @Autowired + private DashboardRecordAccumulateMapperExt dashboardRecordAccumulateMapperExt; + @Autowired + private MsgLanguageChange msgLanguageChange; + @Autowired + private CommonOpt commonOpt; + + + + + @Override + public PageInfo getDataList(AccumulateDataSearchParam pageSearchParam, Long companyId, Long userId, Integer languageType) { + if (null == pageSearchParam.getBuildingId()) { + return new PageInfo<>(new ArrayList<>()); + } + + //list防${}注入 + if (StringUtils.isBlank(pageSearchParam.getCompanyIds())) { + pageSearchParam.setCompanyIdList(List.of(companyId)); + } else { + pageSearchParam.setCompanyIdList(commonOpt.filterCompanyIds(companyId, pageSearchParam.getCompanyIds())); + } + + PageHelper.startPage(pageSearchParam.getPageNum() == null ? 1 : pageSearchParam.getPageNum(), pageSearchParam.getPageSize() == null ? 20 : pageSearchParam.getPageSize()); + return new PageInfo<>(handleDeviceAccumulateData(pageSearchParam)); + } + + public List handleDeviceAccumulateData(AccumulateDataSearchParam pageSearchParam) { + List resultList; + + pageSearchParam.setTypeIdList(Constants.CATEGORY_DEVICE_TYPE_MAP.get(Constants.CATEGORY_ACCUMULATE)); + if (null != pageSearchParam.getMonitoringPointCategoryGroupId()){ + resultList = deviceInfoMapperExt.getDevice4AccumulateDataByGroup(pageSearchParam); + } else { + resultList = deviceInfoMapperExt.getDevice4AccumulateData(pageSearchParam); + } + + if (CollectionUtils.isNotEmpty(resultList)) { + // 查询 favorited_device 表中所有设备的 device_id,转为 Set 提高 contains 性能 + Set favoritedDeviceIds = new HashSet<>(favoritedDeviceMapperExt.getFavoritedDeviceIds()); + + List deviceIds = resultList.stream() + .map(DeviceAccumulateData::getDeviceId) + .collect(Collectors.toList()); + + LocalDateTime now = LocalDateTime.now(ZoneId.of("Asia/Tokyo")); + LocalDate today = now.toLocalDate(); + LocalDate yesterday = today.minusDays(1); + LocalDate lastYear = DateUtil.getLastYearSameIsoWeekDay(today); + + int targetSeconds = now.toLocalTime().toSecondOfDay(); + + // 批量查询增量数据并构建 Map + Map todayMap = dashboardRecordAccumulateMapperExt.selectTodayIncrement(deviceIds, today.getYear(), today.getMonthValue(), today.getDayOfMonth()) + .stream().collect(Collectors.toMap(DeviceIncrement::getDeviceId, Function.identity())); + Map yesterdayMap = dashboardRecordAccumulateMapperExt.selectYesterdayIncrement(deviceIds, yesterday.getYear(), yesterday.getMonthValue(), yesterday.getDayOfMonth(), targetSeconds) + .stream().collect(Collectors.toMap(DeviceIncrement::getDeviceId, Function.identity())); + Map lastYearMap = dashboardRecordAccumulateMapperExt.selectLastYearIncrement(deviceIds, lastYear.getYear(), lastYear.getMonthValue(), lastYear.getDayOfMonth(), targetSeconds) + .stream().collect(Collectors.toMap(DeviceIncrement::getDeviceId, Function.identity())); + + ObjectMapper mapper = new ObjectMapper(); + + resultList.forEach(data -> { + String deviceId = data.getDeviceId(); + + // 填充今天/昨天/去年值 + data.setCumulativeValue(getIncrement(todayMap.get(deviceId), DeviceIncrement::getTodayIncrement)); + data.setYesterdayValue(getIncrement(yesterdayMap.get(deviceId), DeviceIncrement::getYesterdayIncrement)); + data.setLastYearValue(getIncrement(lastYearMap.get(deviceId), DeviceIncrement::getLastYearIncrement)); + + // favorited 判断 + data.setCollected(favoritedDeviceIds.contains(deviceId) ? 1 : 0); + }); + } + + + return resultList; + } + + //统一处理 null 判断和转字符串 + private String getIncrement(DeviceIncrement inc, Function getter) { + if (inc == null || getter.apply(inc) == null) return null; + return getter.apply(inc).toString(); + } + + @Override + public SimpleDataResponse getLineData(LineDataSearchParams lineDataSearchParams, + Long companyId, Long userId, Integer languageType) { + return SimpleDataResponse.success(commonOpt.getLineData(companyId, lineDataSearchParams)); + } + + + +} diff --git a/dongjian-dashboard-back-service/src/main/java/com/dongjian/dashboard/back/service/impl/DeviceDataAlarmServiceImpl.java b/dongjian-dashboard-back-service/src/main/java/com/dongjian/dashboard/back/service/impl/DeviceDataAlarmServiceImpl.java new file mode 100644 index 0000000..37fabdd --- /dev/null +++ b/dongjian-dashboard-back-service/src/main/java/com/dongjian/dashboard/back/service/impl/DeviceDataAlarmServiceImpl.java @@ -0,0 +1,168 @@ +package com.dongjian.dashboard.back.service.impl; + +import com.dongjian.dashboard.back.common.Constants; +import com.dongjian.dashboard.back.common.language.msg.MsgLanguageChange; +import com.dongjian.dashboard.back.common.response.PageInfo; +import com.dongjian.dashboard.back.common.response.ResponseCode; +import com.dongjian.dashboard.back.common.response.SimpleDataResponse; +import com.dongjian.dashboard.back.dao.ex.*; +import com.dongjian.dashboard.back.dto.data.AlarmDataSearchParam; +import com.dongjian.dashboard.back.dto.data.HandleAlarmParams; +import com.dongjian.dashboard.back.dto.data.HandleHistorySearchParam; +import com.dongjian.dashboard.back.model.AlertHandleHistory; +import com.dongjian.dashboard.back.model.AlertHistory; +import com.dongjian.dashboard.back.model.DeviceRawdataRealtime; +import com.dongjian.dashboard.back.service.DeviceDataAlarmService; +import com.dongjian.dashboard.back.service.common.CommonOpt; +import com.dongjian.dashboard.back.vo.data.DeviceAlarmData; +import com.dongjian.dashboard.back.vo.data.HandleHistoryDataVO; +import com.github.pagehelper.PageHelper; +import org.apache.commons.collections.CollectionUtils; +import org.apache.commons.lang3.StringUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.transaction.interceptor.TransactionAspectSupport; + +import java.util.*; + +@Service +public class DeviceDataAlarmServiceImpl implements DeviceDataAlarmService { + + private static final Logger logger = LoggerFactory.getLogger(DeviceDataAlarmServiceImpl.class); + + @Value("${spring.datasource.url}") + private String dbUrl; + + @Autowired + private DeviceInfoMapperExt deviceInfoMapperExt; + @Autowired + private AlertHistoryMapperExt alertHistoryMapperExt; + @Autowired + private AlertHandleHistoryMapperExt alertHandleHistoryMapperExt; + @Autowired + private FavoritedDeviceMapperExt favoritedDeviceMapperExt; + @Autowired + private DeviceRawdataRealtimeMapperExt deviceRawdataRealtimeMapperExt; + @Autowired + private MsgLanguageChange msgLanguageChange; + @Autowired + private CommonOpt commonOpt; + + + + + @Override + public PageInfo getDataList(AlarmDataSearchParam pageSearchParam, Long companyId, Long userId, Integer languageType) { + if (null == pageSearchParam.getBuildingId()) { + return new PageInfo<>(new ArrayList<>()); + } + + //list防${}注入 + if (StringUtils.isBlank(pageSearchParam.getCompanyIds())) { + pageSearchParam.setCompanyIdList(List.of(companyId)); + } else { + pageSearchParam.setCompanyIdList(commonOpt.filterCompanyIds(companyId, pageSearchParam.getCompanyIds())); + } + + PageHelper.startPage(pageSearchParam.getPageNum() == null ? 1 : pageSearchParam.getPageNum(), pageSearchParam.getPageSize() == null ? 20 : pageSearchParam.getPageSize()); + return new PageInfo<>(handleDeviceAlarmData(languageType, pageSearchParam)); + } + + @Override + public List handleDeviceAlarmData(Integer languageType, AlarmDataSearchParam pageSearchParam) { + List resultList; + + pageSearchParam.setTypeIdList(Constants.CATEGORY_DEVICE_TYPE_MAP.get(Constants.CATEGORY_ALARM)); + if (null != pageSearchParam.getMonitoringPointCategoryGroupId()){ + resultList = deviceInfoMapperExt.getDevice4AlarmDataByGroup(pageSearchParam); + } else { + resultList = deviceInfoMapperExt.getDevice4AlarmData(pageSearchParam); + } + + if (CollectionUtils.isNotEmpty(resultList)) { + // 查询 favorited_device 表中所有设备的 device_id + List favoritedDeviceIds = favoritedDeviceMapperExt.getFavoritedDeviceIds(); + for (DeviceAlarmData data : resultList){ + // 判断设备是否在 favorited_device 表中 + if (favoritedDeviceIds.contains(data.getDeviceId())) { + data.setCollected(1); + } else { + data.setCollected(0); + } + data.setAlertLevelStr(msgLanguageChange.getParameterMapByCode(languageType, "alertLevel_" + data.getAlertLevel())); + data.setConfirmStatusStr(msgLanguageChange.getParameterMapByCode(languageType, "confirmStatus_" + data.getConfirmStatus())); + data.setHandleStatusStr(msgLanguageChange.getParameterMapByCode(languageType, "handleStatus_" + data.getHandleStatus())); + } + } + + return resultList; + } + + @Override + @Transactional + public SimpleDataResponse handleAlarm(HandleAlarmParams handleAlarmParams, Long userId, Long companyId, Integer languageType) { + if (0 == handleAlarmParams.getTargetStatus()){ + return new SimpleDataResponse(ResponseCode.MSG_ERROR, "Error target status"); + } + + AlertHistory oldAlertHistory = alertHistoryMapperExt.selectByPrimaryKey(handleAlarmParams.getAlertHistoryId()); + if (null == oldAlertHistory){ + return new SimpleDataResponse(ResponseCode.MSG_ERROR, "Not found"); + } + if (3 == oldAlertHistory.getHandleStatus() || 4 == oldAlertHistory.getHandleStatus()){ + return new SimpleDataResponse(ResponseCode.MSG_ERROR, msgLanguageChange.getParameterMapByCode(languageType, "canNotProcessed")); + } + try { + long currentUnix = System.currentTimeMillis(); + + AlertHistory updateAlertHistory = new AlertHistory(); + + AlertHandleHistory alertHandleHistory = new AlertHandleHistory(); + alertHandleHistory.setAlertHistoryId(handleAlarmParams.getAlertHistoryId()); + alertHandleHistory.setDeviceId(oldAlertHistory.getDeviceId()); + alertHandleHistory.setLastStatus(handleAlarmParams.getOldStatus()); + alertHandleHistory.setStatus(handleAlarmParams.getTargetStatus()); + alertHandleHistory.setHandler(handleAlarmParams.getHandler()); + alertHandleHistory.setRemark(handleAlarmParams.getRemark()); + alertHandleHistory.setHandleAt(currentUnix); + if (3 == handleAlarmParams.getTargetStatus()){ + alertHandleHistory.setAlertStatus(1); + updateAlertHistory.setAlertStatus(1); + + DeviceRawdataRealtime deviceRawdataRealtime = new DeviceRawdataRealtime(); + deviceRawdataRealtime.setDeviceId(oldAlertHistory.getDeviceId()); + deviceRawdataRealtime.setStatus("manually_process"); + deviceRawdataRealtimeMapperExt.updateByPrimaryKeySelective(deviceRawdataRealtime); + } + alertHandleHistoryMapperExt.insertSelective(alertHandleHistory); + + + updateAlertHistory.setId(oldAlertHistory.getId()); + if (0 == oldAlertHistory.getConfirmStatus()){ + updateAlertHistory.setConfirmStatus(1); + } + updateAlertHistory.setHandleStatus(handleAlarmParams.getTargetStatus()); + alertHistoryMapperExt.updateByPrimaryKeySelective(updateAlertHistory); + + return SimpleDataResponse.success(); + } catch (Exception e) { + logger.error("handleAlarm error", e); + TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); + return new SimpleDataResponse(ResponseCode.SERVER_ERROR, ResponseCode.SERVER_ERROR_MSG); + } + } + + @Override + public PageInfo getHandleHistory(HandleHistorySearchParam pageSearchParam, Long companyId, Long userId, Integer languageType) { + PageHelper.startPage(pageSearchParam.getPageNum() == null ? 1 : pageSearchParam.getPageNum(), + pageSearchParam.getPageSize() == null ? 20 : pageSearchParam.getPageSize()); + + List list = alertHandleHistoryMapperExt.getListPage(pageSearchParam); + return new PageInfo<>(list); + } + +} diff --git a/dongjian-dashboard-back-service/src/main/java/com/dongjian/dashboard/back/service/impl/DeviceDataBaStatusServiceImpl.java b/dongjian-dashboard-back-service/src/main/java/com/dongjian/dashboard/back/service/impl/DeviceDataBaStatusServiceImpl.java new file mode 100644 index 0000000..d20f48f --- /dev/null +++ b/dongjian-dashboard-back-service/src/main/java/com/dongjian/dashboard/back/service/impl/DeviceDataBaStatusServiceImpl.java @@ -0,0 +1,89 @@ +package com.dongjian.dashboard.back.service.impl; + +import com.dongjian.dashboard.back.common.Constants; +import com.dongjian.dashboard.back.common.language.msg.MsgLanguageChange; +import com.dongjian.dashboard.back.common.response.PageInfo; +import com.dongjian.dashboard.back.dao.ex.DeviceInfoMapperExt; +import com.dongjian.dashboard.back.dao.ex.FavoritedDeviceMapperExt; +import com.dongjian.dashboard.back.dto.data.BaStatusDataSearchParam; +import com.dongjian.dashboard.back.easyexcel.SecondsToHMSConverter; +import com.dongjian.dashboard.back.service.DeviceDataBaStatusService; +import com.dongjian.dashboard.back.service.common.CommonOpt; +import com.dongjian.dashboard.back.vo.data.DeviceBaStatusData; +import com.github.pagehelper.PageHelper; +import org.apache.commons.collections.CollectionUtils; +import org.apache.commons.lang3.StringUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.stereotype.Service; + +import java.util.*; + +@Service +public class DeviceDataBaStatusServiceImpl implements DeviceDataBaStatusService { + + private static final Logger logger = LoggerFactory.getLogger(DeviceDataBaStatusServiceImpl.class); + + @Value("${spring.datasource.url}") + private String dbUrl; + + @Autowired + private DeviceInfoMapperExt deviceInfoMapperExt; + @Autowired + private FavoritedDeviceMapperExt favoritedDeviceMapperExt; + @Autowired + private MsgLanguageChange msgLanguageChange; + @Autowired + private CommonOpt commonOpt; + + + + + @Override + public PageInfo getDataList(BaStatusDataSearchParam pageSearchParam, Long companyId, Long userId, Integer languageType) { + if (null == pageSearchParam.getBuildingId()) { + return new PageInfo<>(new ArrayList<>()); + } + + //list防${}注入 + if (StringUtils.isBlank(pageSearchParam.getCompanyIds())) { + pageSearchParam.setCompanyIdList(List.of(companyId)); + } else { + pageSearchParam.setCompanyIdList(commonOpt.filterCompanyIds(companyId, pageSearchParam.getCompanyIds())); + } + + PageHelper.startPage(pageSearchParam.getPageNum() == null ? 1 : pageSearchParam.getPageNum(), pageSearchParam.getPageSize() == null ? 20 : pageSearchParam.getPageSize()); + return new PageInfo<>(handleDeviceBaStatusData(pageSearchParam)); + } + + @Override + public List handleDeviceBaStatusData(BaStatusDataSearchParam pageSearchParam) { + List resultList; + + pageSearchParam.setTypeIdList(Constants.CATEGORY_DEVICE_TYPE_MAP.get(Constants.CATEGORY_STATUS)); + if (null != pageSearchParam.getMonitoringPointCategoryGroupId()){ + resultList = deviceInfoMapperExt.getDevice4BaStatusDataByGroup(pageSearchParam); + } else { + resultList = deviceInfoMapperExt.getDevice4BaStatusData(pageSearchParam); + } + + if (CollectionUtils.isNotEmpty(resultList)) { + // 查询 favorited_device 表中所有设备的 device_id + List favoritedDeviceIds = favoritedDeviceMapperExt.getFavoritedDeviceIds(); + for (DeviceBaStatusData data : resultList){ + data.setContinuousRunningTimeStr(SecondsToHMSConverter.covertSeconds(data.getContinuousRunningTime())); + // 判断设备是否在 favorited_device 表中 + if (favoritedDeviceIds.contains(data.getDeviceId())) { + data.setCollected(1); + } else { + data.setCollected(0); + } + } + } + + return resultList; + } + +} diff --git a/dongjian-dashboard-back-service/src/main/java/com/dongjian/dashboard/back/service/impl/DeviceDataMeasureServiceImpl.java b/dongjian-dashboard-back-service/src/main/java/com/dongjian/dashboard/back/service/impl/DeviceDataMeasureServiceImpl.java new file mode 100644 index 0000000..783f7b6 --- /dev/null +++ b/dongjian-dashboard-back-service/src/main/java/com/dongjian/dashboard/back/service/impl/DeviceDataMeasureServiceImpl.java @@ -0,0 +1,142 @@ +package com.dongjian.dashboard.back.service.impl; + +import com.dongjian.dashboard.back.common.Constants; +import com.dongjian.dashboard.back.common.language.msg.MsgLanguageChange; +import com.dongjian.dashboard.back.common.response.PageInfo; +import com.dongjian.dashboard.back.common.response.SimpleDataResponse; +import com.dongjian.dashboard.back.dao.ex.DashboardRealtimeMeasureMapperExt; +import com.dongjian.dashboard.back.dao.ex.DeviceInfoMapperExt; +import com.dongjian.dashboard.back.dao.ex.FavoritedDeviceMapperExt; +import com.dongjian.dashboard.back.dto.data.MeasureDataSearchParam; +import com.dongjian.dashboard.back.dto.device.LineDataSearchParams; +import com.dongjian.dashboard.back.model.DashboardRealtimeMeasure; +import com.dongjian.dashboard.back.service.DeviceDataMeasureService; +import com.dongjian.dashboard.back.service.common.CommonOpt; +import com.dongjian.dashboard.back.vo.data.DeviceMeasureData; +import com.dongjian.dashboard.back.vo.device.LineData; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.github.pagehelper.PageHelper; +import org.apache.commons.collections.CollectionUtils; +import org.apache.commons.lang3.StringUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.stereotype.Service; + +import java.time.LocalDate; +import java.time.LocalDateTime; +import java.time.ZoneId; +import java.util.*; +import java.util.function.Function; +import java.util.stream.Collectors; + +@Service +public class DeviceDataMeasureServiceImpl implements DeviceDataMeasureService { + + private static final Logger logger = LoggerFactory.getLogger(DeviceDataMeasureServiceImpl.class); + + @Value("${spring.datasource.url}") + private String dbUrl; + + @Autowired + private DeviceInfoMapperExt deviceInfoMapperExt; + @Autowired + private FavoritedDeviceMapperExt favoritedDeviceMapperExt; + @Autowired + private DashboardRealtimeMeasureMapperExt dashboardRealtimeMeasureMapperExt; + @Autowired + private MsgLanguageChange msgLanguageChange; + @Autowired + private CommonOpt commonOpt; + + + + + @Override + public PageInfo getDataList(MeasureDataSearchParam pageSearchParam, Long companyId, Long userId, Integer languageType) { + if (null == pageSearchParam.getBuildingId()) { + return new PageInfo<>(new ArrayList<>()); + } + + //list防${}注入 + if (StringUtils.isBlank(pageSearchParam.getCompanyIds())) { + pageSearchParam.setCompanyIdList(List.of(companyId)); + } else { + pageSearchParam.setCompanyIdList(commonOpt.filterCompanyIds(companyId, pageSearchParam.getCompanyIds())); + } + + PageHelper.startPage(pageSearchParam.getPageNum() == null ? 1 : pageSearchParam.getPageNum(), pageSearchParam.getPageSize() == null ? 20 : pageSearchParam.getPageSize()); + return new PageInfo<>(handleDeviceMeasureData(pageSearchParam)); + } + + @Override + public List handleDeviceMeasureData(MeasureDataSearchParam pageSearchParam) { + List resultList; + + pageSearchParam.setTypeIdList(Constants.CATEGORY_DEVICE_TYPE_MAP.get(Constants.CATEGORY_MEASURE)); + if (null != pageSearchParam.getMonitoringPointCategoryGroupId()){ + resultList = deviceInfoMapperExt.getDevice4MeasureDataByGroup(pageSearchParam); + } else { + resultList = deviceInfoMapperExt.getDevice4MeasureData(pageSearchParam); + } + + if (CollectionUtils.isNotEmpty(resultList)) { + // 查询 favorited_device 表中所有设备的 device_id + List favoritedDeviceIds = favoritedDeviceMapperExt.getFavoritedDeviceIds(); + + List deviceIds = resultList.stream() + .map(DeviceMeasureData::getDeviceId) + .filter(Objects::nonNull).toList(); + + ZoneId tokyoZone = ZoneId.of("Asia/Tokyo"); + LocalDate tokyoToday = LocalDate.now(tokyoZone); + int year = tokyoToday.getYear(); + int month = tokyoToday.getMonthValue(); + int day = tokyoToday.getDayOfMonth(); + + // 查询 dashboard_realtime_measure 数据 + List realtimeList = + dashboardRealtimeMeasureMapperExt.selectRealtimeMeasureByDevices(deviceIds); + + // 转 map:device_id -> 数据对象 + Map realtimeMap = realtimeList.stream() + .collect(Collectors.toMap(DashboardRealtimeMeasure::getDeviceId, Function.identity())); + + ObjectMapper mapper = new ObjectMapper(); + + for (DeviceMeasureData data : resultList) { + String deviceId = data.getDeviceId(); + + // 默认 measurementValue 从 rawData 提取 + data.setMeasurementValue(commonOpt.extractFirstValue(mapper, data.getRawData())); + + // 如果在实时表中存在记录,则更新 measurementValue/max/min + DashboardRealtimeMeasure realtime = realtimeMap.get(deviceId); + if (realtime != null) { + // upload_value 始终作为 measurementValue + if (StringUtils.isNotBlank(realtime.getUploadValue())) { + data.setMeasurementValue(realtime.getUploadValue()); + } + + // 仅当日期 == 今天时才设置 max/min + if (year == realtime.getDateYear() && month == realtime.getDateMonth() && day == realtime.getDateDay()) { + data.setMaxValue(realtime.getMaxValue()); + data.setMinValue(realtime.getMinValue()); + } + } + + // 收藏状态 + data.setCollected(favoritedDeviceIds.contains(deviceId) ? 1 : 0); + } + } + + return resultList; + } + + @Override + public SimpleDataResponse getLineData(LineDataSearchParams lineDataSearchParams, Long companyId, Long userId, Integer languageType) { + return SimpleDataResponse.success(commonOpt.getLineData(companyId, lineDataSearchParams)); + } + +} diff --git a/dongjian-dashboard-back-service/src/main/java/com/dongjian/dashboard/back/service/impl/DeviceGroupServiceImpl.java b/dongjian-dashboard-back-service/src/main/java/com/dongjian/dashboard/back/service/impl/DeviceGroupServiceImpl.java new file mode 100644 index 0000000..ebda27e --- /dev/null +++ b/dongjian-dashboard-back-service/src/main/java/com/dongjian/dashboard/back/service/impl/DeviceGroupServiceImpl.java @@ -0,0 +1,347 @@ +package com.dongjian.dashboard.back.service.impl; + +import com.dongjian.dashboard.back.common.Constants; +import com.dongjian.dashboard.back.common.exception.MsgCodeException; +import com.dongjian.dashboard.back.common.language.msg.MsgLanguageChange; +import com.dongjian.dashboard.back.common.response.PageInfo; +import com.dongjian.dashboard.back.common.response.ResponseCode; +import com.dongjian.dashboard.back.common.response.SimpleDataResponse; +import com.dongjian.dashboard.back.dao.ex.BasicBuildingMapperExt; +import com.dongjian.dashboard.back.dao.ex.DeviceGroupMapperExt; +import com.dongjian.dashboard.back.dao.ex.DeviceGroupRelationMapperExt; +import com.dongjian.dashboard.back.dao.ex.DeviceInfoMapperExt; +import com.dongjian.dashboard.back.dto.devicegroup.*; +import com.dongjian.dashboard.back.model.*; +import com.dongjian.dashboard.back.service.DeviceGroupService; +import com.dongjian.dashboard.back.service.common.CommonOpt; +import com.dongjian.dashboard.back.util.CommonUtil; +import com.dongjian.dashboard.back.vo.device.DeviceVO; +import com.dongjian.dashboard.back.vo.devicegroup.DeviceGroupPageVO; +import com.github.pagehelper.PageHelper; +import org.apache.commons.collections.CollectionUtils; +import org.apache.commons.lang3.StringUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.BeanUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.transaction.interceptor.TransactionAspectSupport; +import org.springframework.util.ObjectUtils; + +import java.util.*; +import java.util.stream.Collectors; + +@Service +public class DeviceGroupServiceImpl implements DeviceGroupService { + + private static final Logger logger = LoggerFactory.getLogger(DeviceGroupServiceImpl.class); + + @Autowired + private CommonOpt commonOpt; + @Autowired + private MsgLanguageChange msgLanguageChange; + @Autowired + private DeviceGroupMapperExt deviceGroupMapperExt; + @Autowired + private DeviceGroupRelationMapperExt deviceGroupRelationMapperExt; + @Autowired + private DeviceInfoMapperExt deviceInfoMapperExt; + @Autowired + private BasicBuildingMapperExt basicBuildingMapperExt; + + + + @Override + @Transactional + public SimpleDataResponse add(OptDeviceGroupParams optDeviceGroupParams, Long userId, Long companyId, Integer languageType) { + try { + optDeviceGroupParams.setDeviceGroupId(null); + + try { + optDeviceGroupParams.setCompanyId(companyId); + commonVerifyOpt(optDeviceGroupParams, companyId, languageType); + } catch (MsgCodeException e) { + return new SimpleDataResponse(ResponseCode.MSG_ERROR, e.getMessage()); + } + + long currentUnix = System.currentTimeMillis(); + DeviceGroup entity = new DeviceGroup(); + BeanUtils.copyProperties(optDeviceGroupParams, entity); + entity.setId(null); + entity.setCreatedAt(currentUnix); + entity.setCreatedBy(userId); + deviceGroupMapperExt.insertSelective(entity); + + return SimpleDataResponse.success(); + } catch (Exception e) { + logger.error("新增设备分组出错", e); + TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); + return new SimpleDataResponse(ResponseCode.SERVER_ERROR, ResponseCode.SERVER_ERROR_MSG); + } + } + + private void checkCompany(OptDeviceGroupParams param, Integer languageType, Long companyId) { + if (!commonOpt.isSubCompany(companyId, param.getCompanyId())) { + throw new MsgCodeException(msgLanguageChange.getParameterMapByCode(languageType, "noOperationAuth")); + } + } + + private void checkExist(OptDeviceGroupParams param, Integer languageType) { + if (deviceGroupMapperExt.checkExist(param) > 0) { + throw new MsgCodeException(msgLanguageChange.getParameterMapByCode(languageType, "deviceGroupNameHasExisted")); + } + } + + private void checkParam(OptDeviceGroupParams param, Integer languageType) { + if (StringUtils.isBlank(param.getName()) || param.getName().length() > 500) { + throw new MsgCodeException("Parameter error [deviceGroupName]"); + } + if(StringUtils.isNotBlank(param.getRemark()) && param.getRemark().length() > 500){ + throw new MsgCodeException("Parameter error [remark]"); + } + if(null == param.getBuildingId()){ + throw new MsgCodeException("Parameter error [buildingId]"); + } else { + BasicBuilding building = basicBuildingMapperExt.selectByPrimaryKey(param.getBuildingId()); + if (1 == building.getFlag()){ + throw new MsgCodeException("building not found"); + } else if (!Objects.equals(building.getCompanyId(), param.getCompanyId())) { + throw new MsgCodeException(msgLanguageChange.getParameterMapByCode(languageType, "noOperationAuth")); + } + } + } + + private void commonVerifyOpt(OptDeviceGroupParams param, Long companyId, Integer languageType) { + checkParam(param, languageType); + checkExist(param, languageType); + } + + @Override + @Transactional + public SimpleDataResponse edit(OptDeviceGroupParams param, Long userId, Long companyId, Integer languageType) { + try { + DeviceGroup oldBP = deviceGroupMapperExt.selectByPrimaryKey(param.getDeviceGroupId()); + if (ObjectUtils.isEmpty(oldBP) || 1 == oldBP.getFlag()){ + return new SimpleDataResponse(ResponseCode.MSG_ERROR, "Not found"); + } + try { + List selfAndSubCompanyList = commonOpt.getSelfAndSubCompanyId(companyId); + if (!selfAndSubCompanyList.contains(oldBP.getCompanyId())){ + throw new MsgCodeException(msgLanguageChange.getParameterMapByCode(languageType, "noOperationAuth")); + } + + param.setCompanyId(oldBP.getCompanyId()); + commonVerifyOpt(param, companyId, languageType); + + } catch (MsgCodeException e) { + return new SimpleDataResponse(ResponseCode.MSG_ERROR, e.getMessage()); + } + + DeviceGroup deviceGroup = new DeviceGroup(); + BeanUtils.copyProperties(param, deviceGroup); + if (StringUtils.isBlank(param.getRemark())) { + deviceGroup.setRemark(""); + } + + DeviceGroupExample example = new DeviceGroupExample(); + DeviceGroupExample.Criteria criteria = example.createCriteria(); + criteria.andIdEqualTo(param.getDeviceGroupId()); + + + deviceGroupMapperExt.updateByExampleSelective(deviceGroup, example); + + return SimpleDataResponse.success(); + } catch (Exception e) { + logger.error("编辑设备分组出错", e); + TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); + return new SimpleDataResponse(ResponseCode.SERVER_ERROR, ResponseCode.SERVER_ERROR_MSG); + } + } + + @Override + @Transactional + public SimpleDataResponse batchDelete(DeleteDeviceGroupParams param, Long userId, Long companyId, Integer languageType) { + if (StringUtils.isBlank(param.getDeviceGroupIds())) { + return SimpleDataResponse.success(); + } + try { + List ids = Arrays.asList(StringUtils.split(param.getDeviceGroupIds(), ",")).stream() + .map(id -> CommonUtil.String2Long(id.trim())).collect(Collectors.toList()); + + DeviceGroupExample deviceGroupExample = new DeviceGroupExample(); + DeviceGroupExample.Criteria criteria = deviceGroupExample.createCriteria(); + criteria.andIdIn(ids).andCompanyIdIn(commonOpt.getSelfAndSubCompanyId(companyId)); + + DeviceGroup deviceGroup = new DeviceGroup(); + deviceGroup.setFlag(1); + deviceGroupMapperExt.updateByExampleSelective(deviceGroup, deviceGroupExample); + + return SimpleDataResponse.success(); + } catch (Exception e) { + logger.error("删除设备分组出错", e); + TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); + return new SimpleDataResponse(ResponseCode.SERVER_ERROR, ResponseCode.SERVER_ERROR_MSG); + } + } + + @Override + public PageInfo getListPage(DeviceGroupSearchParams pageSearchParam, Long companyId, Long userId, Integer languageType, Integer uTCOffset) { + if (StringUtils.isBlank(pageSearchParam.getCompanyIds())) { + pageSearchParam.setCompanyIdList(List.of(companyId)); + } else { + pageSearchParam.setCompanyIdList(commonOpt.filterCompanyIds(companyId, pageSearchParam.getCompanyIds())); + } + + if (StringUtils.isNotBlank(pageSearchParam.getDeviceGroupIds())) { + pageSearchParam.setDeviceGroupIdList(CommonUtil.commaStr2LongList(pageSearchParam.getDeviceGroupIds())); + } + + PageHelper.startPage(pageSearchParam.getPageNum() == null ? 1 : pageSearchParam.getPageNum(), + pageSearchParam.getPageSize() == null ? 20 : pageSearchParam.getPageSize()); + + List list = deviceGroupMapperExt.getListPage(pageSearchParam); + return new PageInfo<>(list); + } + + @Override + @Transactional + public SimpleDataResponse bindGroupForDevice(BindGroupForDeviceParams bindGroupForDeviceParams, Long userId, Long companyId, Integer languageType) { + try { + // 1. 获取设备信息 + DeviceInfo deviceInfo = deviceInfoMapperExt.selectByPrimaryKey(bindGroupForDeviceParams.getDeviceInfoId()); + if (deviceInfo == null || deviceInfo.getFlag() != 0) { + return new SimpleDataResponse(ResponseCode.MSG_ERROR, "Device not found"); + } + + Integer deviceTypeId = deviceInfo.getTypeId(); + if (deviceTypeId == null) { + return new SimpleDataResponse(ResponseCode.MSG_ERROR, "Device type not set"); + } + + List deviceGroupIdList = CommonUtil.commaStr2LongList(bindGroupForDeviceParams.getDeviceGroupIds()); + + // 2. 校验设备列表的类型是否符合分组要求 + if (CollectionUtils.isNotEmpty(deviceGroupIdList)) { + for (Long deviceGroupId : deviceGroupIdList) { + DeviceGroup deviceGroup = deviceGroupMapperExt.selectByPrimaryKey(deviceGroupId); + if (deviceGroup == null || deviceGroup.getFlag() != 0) { + return new SimpleDataResponse(ResponseCode.MSG_ERROR, "Device group not found"); + } + + // 检查设备和分组是否属于同一 building + if (!Objects.equals(deviceGroup.getBuildingId(), deviceInfo.getBuildingId())) { + return new SimpleDataResponse(ResponseCode.MSG_ERROR, "Device and group are not in the same building"); + } + + Integer groupType = deviceGroup.getGroupType(); + if (groupType == null || isNotTypeMatch(groupType, deviceTypeId)) { + return new SimpleDataResponse(ResponseCode.MSG_ERROR, msgLanguageChange.getParameterMapByCode(languageType, "groupTypeNotMatch")); + } + } + } + + // 3. 删除原绑定关系 + DeviceGroupRelationExample deviceGroupRelationExample = new DeviceGroupRelationExample(); + DeviceGroupRelationExample.Criteria criteria = deviceGroupRelationExample.createCriteria(); + criteria.andDeviceInfoIdEqualTo(bindGroupForDeviceParams.getDeviceInfoId()); + deviceGroupRelationMapperExt.deleteByExample(deviceGroupRelationExample); + + // 4. 插入新绑定关系 + if (CollectionUtils.isNotEmpty(deviceGroupIdList)) { + for (Long deviceGroupId : deviceGroupIdList){ + DeviceGroupRelation deviceGroupRelation = new DeviceGroupRelation(); + deviceGroupRelation.setDeviceGroupId(deviceGroupId); + deviceGroupRelation.setDeviceInfoId(bindGroupForDeviceParams.getDeviceInfoId()); + deviceGroupRelationMapperExt.insertSelective(deviceGroupRelation); + } + } + + return SimpleDataResponse.success(); + } catch (Exception e) { + logger.error("bindGroupForDevice error", e); + TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); + return new SimpleDataResponse(ResponseCode.SERVER_ERROR, ResponseCode.SERVER_ERROR_MSG); + } + } + + public static boolean isNotTypeMatch(int groupType, int deviceTypeId) { + List allowedTypes = Constants.CATEGORY_DEVICE_TYPE_MAP.get(groupType); + return allowedTypes == null || !allowedTypes.contains(deviceTypeId); + } + + @Override + @Transactional + public SimpleDataResponse bindDeviceForGroup(BindDeviceForGroupParams bindDeviceForGroupParams, Long userId, Long companyId, Integer languageType) { + + try { + // 1. 获取目标分组信息 + DeviceGroup deviceGroup = deviceGroupMapperExt.selectByPrimaryKey(bindDeviceForGroupParams.getDeviceGroupId()); + if (deviceGroup == null || deviceGroup.getFlag() != 0) { + return new SimpleDataResponse(ResponseCode.MSG_ERROR, "Device group not set"); + } + + Integer groupType = deviceGroup.getGroupType(); + Long groupBuildingId = deviceGroup.getBuildingId(); + if (groupType == null || groupBuildingId == null) { + return new SimpleDataResponse(ResponseCode.MSG_ERROR, "Invalid device group info"); + } + + List deviceInfoIdList = CommonUtil.commaStr2LongList(bindDeviceForGroupParams.getDeviceInfoIds()); + + if (CollectionUtils.isNotEmpty(deviceInfoIdList)) { + // 2. 校验设备列表的类型是否符合分组要求 + for (Long deviceInfoId : deviceInfoIdList) { + DeviceVO deviceVO = deviceInfoMapperExt.selectOne(deviceInfoId.intValue()); + if (deviceVO == null || deviceVO.getFlag() != 0) { + return new SimpleDataResponse(ResponseCode.MSG_ERROR, "Device not found: " + deviceInfoId); + } + + // **类型不匹配** + Integer deviceTypeId = deviceVO.getTypeId(); + if (deviceTypeId == null || isNotTypeMatch(groupType, deviceTypeId)) { + return new SimpleDataResponse(ResponseCode.MSG_ERROR, msgLanguageChange.getParameterMapByCode(languageType, "groupTypeNotMatch")); + } + + // **building 不一致** + Long deviceBuildingId = deviceVO.getBuildingId(); + if (deviceBuildingId == null || !deviceBuildingId.equals(groupBuildingId)) { + return new SimpleDataResponse(ResponseCode.MSG_ERROR, "Device and group are not in the same building"); + } + } + } + + // 3. 删除原绑定关系 + DeviceGroupRelationExample deviceGroupRelationExample = new DeviceGroupRelationExample(); + DeviceGroupRelationExample.Criteria criteria = deviceGroupRelationExample.createCriteria(); + criteria.andDeviceGroupIdEqualTo(bindDeviceForGroupParams.getDeviceGroupId()); + deviceGroupRelationMapperExt.deleteByExample(deviceGroupRelationExample); + + // 4. 插入新绑定关系 + if (CollectionUtils.isNotEmpty(deviceInfoIdList)) { + for (Long deviceInfoId : deviceInfoIdList){ + DeviceGroupRelation deviceGroupRelation = new DeviceGroupRelation(); + deviceGroupRelation.setDeviceGroupId(bindDeviceForGroupParams.getDeviceGroupId()); + deviceGroupRelation.setDeviceInfoId(deviceInfoId.intValue()); + deviceGroupRelationMapperExt.insertSelective(deviceGroupRelation); + } + } + + return SimpleDataResponse.success(); + } catch (Exception e) { + logger.error("bindDeviceForGroup error", e); + TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); + return new SimpleDataResponse(ResponseCode.SERVER_ERROR, ResponseCode.SERVER_ERROR_MSG); + } + } + + @Override + public SimpleDataResponse> getBindedGroupByDevice(Integer deviceInfoId, Long userId, Long companyId, Integer languageType) { + return SimpleDataResponse.success(deviceGroupMapperExt.getBindedGroupByDevice(deviceInfoId)); + } + + @Override + public SimpleDataResponse> getBindedDeviceByGroup(Long deviceGroupId, Long userId, Long companyId, Integer languageType) { + return SimpleDataResponse.success(deviceGroupMapperExt.getBindedDeviceByGroup(deviceGroupId)); + } +} diff --git a/dongjian-dashboard-back-service/src/main/java/com/dongjian/dashboard/back/service/impl/DeviceServiceImpl.java b/dongjian-dashboard-back-service/src/main/java/com/dongjian/dashboard/back/service/impl/DeviceServiceImpl.java new file mode 100644 index 0000000..b69eaef --- /dev/null +++ b/dongjian-dashboard-back-service/src/main/java/com/dongjian/dashboard/back/service/impl/DeviceServiceImpl.java @@ -0,0 +1,78 @@ +package com.dongjian.dashboard.back.service.impl; + +import com.dongjian.dashboard.back.common.Constants; +import com.dongjian.dashboard.back.common.language.msg.MsgLanguageChange; +import com.dongjian.dashboard.back.common.response.PageInfo; +import com.dongjian.dashboard.back.common.response.ResponseCode; +import com.dongjian.dashboard.back.common.response.SimpleDataResponse; +import com.dongjian.dashboard.back.dao.ex.DeviceInfoMapperExt; +import com.dongjian.dashboard.back.dto.device.DeviceSearchParams; +import com.dongjian.dashboard.back.dto.device.OptDeviceFieldParams; +import com.dongjian.dashboard.back.model.DeviceInfo; +import com.dongjian.dashboard.back.service.DeviceService; +import com.dongjian.dashboard.back.service.common.CommonOpt; +import com.dongjian.dashboard.back.vo.device.DeviceVO; +import com.github.pagehelper.PageHelper; +import org.apache.commons.lang3.StringUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.transaction.interceptor.TransactionAspectSupport; + +import java.util.List; + +@Service +public class DeviceServiceImpl implements DeviceService { + + private static final Logger logger = LoggerFactory.getLogger(DeviceServiceImpl.class); + + @Autowired + private DeviceInfoMapperExt deviceInfoMapperExt; + @Autowired + private MsgLanguageChange msgLanguageChange; + @Autowired + private CommonOpt commonOpt; + + + + @Override + public PageInfo getListPage(DeviceSearchParams pageSearchParam, Long companyId, Long userId, Integer languageType) { + //list防${}注入 + if (StringUtils.isBlank(pageSearchParam.getCompanyIds())) { + pageSearchParam.setCompanyIdList(commonOpt.getSelfAndSubCompanyId(companyId)); + } else { + pageSearchParam.setCompanyIdList(commonOpt.filterCompanyIds(companyId, pageSearchParam.getCompanyIds())); + } + pageSearchParam.setTypeIdList(Constants.ALL_DEVICE_TYPE_IDS); + + + PageHelper.startPage(pageSearchParam.getPageNum() == null ? 1 : pageSearchParam.getPageNum(), pageSearchParam.getPageSize() == null ? 20 : pageSearchParam.getPageSize()); + List resultList = deviceInfoMapperExt.getListPage(pageSearchParam); + + return new PageInfo<>(resultList); + } + + @Override + @Transactional + public SimpleDataResponse editField(OptDeviceFieldParams optDeviceFieldParams, Long companyId, Long userId, Integer languageType) { + try { + if (1 != optDeviceFieldParams.getRetainAlert() && 0 != optDeviceFieldParams.getRetainAlert()){ + return new SimpleDataResponse(ResponseCode.MSG_ERROR, "Parameter [retainAlert] error"); + } + + DeviceInfo deviceInfo = new DeviceInfo(); + deviceInfo.setId(optDeviceFieldParams.getId()); + deviceInfo.setRetainAlert(optDeviceFieldParams.getRetainAlert()); + + deviceInfoMapperExt.updateByPrimaryKeySelective(deviceInfo); + + return SimpleDataResponse.success(); + } catch (Exception e){ + logger.error("Error editing device information", e); + TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); + return new SimpleDataResponse(ResponseCode.SERVER_ERROR, msgLanguageChange.getParameterMapByCode(languageType, "serviceError")); + } + } +} diff --git a/dongjian-dashboard-back-service/src/main/java/com/dongjian/dashboard/back/service/impl/FavoritedDeviceServiceImpl.java b/dongjian-dashboard-back-service/src/main/java/com/dongjian/dashboard/back/service/impl/FavoritedDeviceServiceImpl.java new file mode 100644 index 0000000..fb116f8 --- /dev/null +++ b/dongjian-dashboard-back-service/src/main/java/com/dongjian/dashboard/back/service/impl/FavoritedDeviceServiceImpl.java @@ -0,0 +1,209 @@ +package com.dongjian.dashboard.back.service.impl; + +import com.dongjian.dashboard.back.common.Constants; +import com.dongjian.dashboard.back.common.language.msg.MsgLanguageChange; +import com.dongjian.dashboard.back.common.response.PageInfo; +import com.dongjian.dashboard.back.common.response.ResponseCode; +import com.dongjian.dashboard.back.common.response.SimpleDataResponse; +import com.dongjian.dashboard.back.dao.ex.FavoritedDeviceMapperExt; +import com.dongjian.dashboard.back.dto.data.AccumulateDataSearchParam; +import com.dongjian.dashboard.back.dto.data.BaStatusDataSearchParam; +import com.dongjian.dashboard.back.dto.data.MeasureDataSearchParam; +import com.dongjian.dashboard.back.dto.device.FavoritedDeviceSearchParams; +import com.dongjian.dashboard.back.dto.device.OptFavoritedDeviceParams; +import com.dongjian.dashboard.back.service.DeviceDataAccumulateService; +import com.dongjian.dashboard.back.service.DeviceDataBaStatusService; +import com.dongjian.dashboard.back.service.DeviceDataMeasureService; +import com.dongjian.dashboard.back.service.FavoritedDeviceService; +import com.dongjian.dashboard.back.service.common.CommonOpt; +import com.dongjian.dashboard.back.vo.data.DeviceAccumulateData; +import com.dongjian.dashboard.back.vo.data.DeviceBaStatusData; +import com.dongjian.dashboard.back.vo.data.DeviceMeasureData; +import com.dongjian.dashboard.back.vo.device.FavoritedDeviceVO; +import org.apache.commons.collections.CollectionUtils; +import org.apache.commons.lang3.StringUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.transaction.interceptor.TransactionAspectSupport; + +import java.util.*; +import java.util.function.Function; +import java.util.stream.Collectors; + +@Service +public class FavoritedDeviceServiceImpl implements FavoritedDeviceService { + + private static final Logger logger = LoggerFactory.getLogger(FavoritedDeviceServiceImpl.class); + + + + @Autowired + private FavoritedDeviceMapperExt favoritedDeviceMapperExt; + @Autowired + private MsgLanguageChange msgLanguageChange; + @Autowired + private CommonOpt commonOpt; + @Autowired + DeviceDataAccumulateService deviceDataAccumulateService; + @Autowired + DeviceDataBaStatusService deviceDataBaStatusService; + @Autowired + DeviceDataMeasureService deviceDataMeasureService; + + + @Override + public PageInfo getListPage(FavoritedDeviceSearchParams pageSearchParam, Long companyId, Long userId, Integer languageType, Integer utcOffset) { + // 防止 ${} 注入 + if (StringUtils.isBlank(pageSearchParam.getCompanyIds())) { + pageSearchParam.setCompanyIdList(List.of(companyId)); + } else { + pageSearchParam.setCompanyIdList(commonOpt.filterCompanyIds(companyId, pageSearchParam.getCompanyIds())); + } + if (null != pageSearchParam.getClassId()){ + pageSearchParam.setTypeIdList(Constants.CATEGORY_DEVICE_TYPE_MAP.get(pageSearchParam.getClassId())); + } + + List favoritedDeviceVOList = favoritedDeviceMapperExt.getListPage(pageSearchParam); + + List resultList = new ArrayList<>(); + if (CollectionUtils.isEmpty(favoritedDeviceVOList)) { + return new PageInfo<>(resultList); + } + + // 分类设备ID + List accumulateDeviceIds = new ArrayList<>(); + List measureDeviceIds = new ArrayList<>(); + List statusDeviceIds = new ArrayList<>(); + + for (FavoritedDeviceVO vo : favoritedDeviceVOList) { + Integer typeId = vo.getTypeId(); + if (Constants.CATEGORY_DEVICE_TYPE_MAP.get(Constants.CATEGORY_ACCUMULATE).contains(typeId)) { + accumulateDeviceIds.add(vo.getDeviceId()); + } else if (Constants.CATEGORY_DEVICE_TYPE_MAP.get(Constants.CATEGORY_MEASURE).contains(typeId)) { + measureDeviceIds.add(vo.getDeviceId()); + } else if (Constants.CATEGORY_DEVICE_TYPE_MAP.get(Constants.CATEGORY_STATUS).contains(typeId)) { + statusDeviceIds.add(vo.getDeviceId()); + } + } + + // 查询并构建 deviceId -> Data 映射 + Map accumulateDataMap = buildAccumulateDataMap(companyId, accumulateDeviceIds); + Map measureDataMap = buildMeasureDataMap(companyId, measureDeviceIds); + Map statusDataMap = buildStatusDataMap(companyId, statusDeviceIds); + + // 按收藏顺序生成结果 + for (FavoritedDeviceVO vo : favoritedDeviceVOList) { + Integer typeId = vo.getTypeId(); + String deviceId = vo.getDeviceId(); + Object data = null; + + if (Constants.CATEGORY_DEVICE_TYPE_MAP.get(Constants.CATEGORY_ACCUMULATE).contains(typeId)) { + data = accumulateDataMap.get(deviceId); + } else if (Constants.CATEGORY_DEVICE_TYPE_MAP.get(Constants.CATEGORY_MEASURE).contains(typeId)) { + data = measureDataMap.get(deviceId); + } else if (Constants.CATEGORY_DEVICE_TYPE_MAP.get(Constants.CATEGORY_STATUS).contains(typeId)) { + data = statusDataMap.get(deviceId); + } + + if (data != null) { + resultList.add(data); + } + } + + return new PageInfo<>(resultList); + } + + private Map buildAccumulateDataMap(Long companyId, List deviceIds) { + if (CollectionUtils.isEmpty(deviceIds)) return Collections.emptyMap(); + + AccumulateDataSearchParam param = new AccumulateDataSearchParam(); + param.setDeviceIdList(deviceIds); + param.setCompanyIdList(List.of(companyId)); + return deviceDataAccumulateService.handleDeviceAccumulateData(param).stream() + .collect(Collectors.toMap(DeviceAccumulateData::getDeviceId, Function.identity(), (existing, replacement) -> replacement)); + } + + private Map buildMeasureDataMap(Long companyId, List deviceIds) { + if (CollectionUtils.isEmpty(deviceIds)) return Collections.emptyMap(); + + MeasureDataSearchParam param = new MeasureDataSearchParam(); + param.setDeviceIdList(deviceIds); + param.setCompanyIdList(List.of(companyId)); + return deviceDataMeasureService.handleDeviceMeasureData(param).stream() + .collect(Collectors.toMap(DeviceMeasureData::getDeviceId, Function.identity(), (existing, replacement) -> replacement)); + } + + private Map buildStatusDataMap(Long companyId, List deviceIds) { + if (CollectionUtils.isEmpty(deviceIds)) return Collections.emptyMap(); + + BaStatusDataSearchParam param = new BaStatusDataSearchParam(); + param.setDeviceIdList(deviceIds); + param.setCompanyIdList(List.of(companyId)); + return deviceDataBaStatusService.handleDeviceBaStatusData(param).stream() + .collect(Collectors.toMap(DeviceBaStatusData::getDeviceId, Function.identity(), (existing, replacement) -> replacement)); + } + + + @Override + @Transactional + public SimpleDataResponse addToFavorite(OptFavoritedDeviceParams optFavoritedDeviceParams, Long userId, Long companyId, Integer languageType) { + try { + List deviceIdList = optFavoritedDeviceParams.getDeviceIdList(); + + if (CollectionUtils.isEmpty(deviceIdList)) { + return SimpleDataResponse.fail(ResponseCode.MSG_ERROR,"Device ID list is empty"); + } + + // 查询已存在的收藏,避免主键冲突(可选优化) + List existedIds = favoritedDeviceMapperExt.selectExistsByIds(deviceIdList); + + // 排除已存在的 deviceId(避免重复收藏) + List toInsertIds = deviceIdList.stream() + .filter(id -> !existedIds.contains(id)) + .distinct() + .collect(Collectors.toList()); + + if (CollectionUtils.isEmpty(toInsertIds)) { + return SimpleDataResponse.success(); + } + + long now = System.currentTimeMillis(); + Map insertMap = new HashMap<>(); + insertMap.put("deviceIdList", toInsertIds); + insertMap.put("createAt", now); + favoritedDeviceMapperExt.batchInsert(insertMap); + + return SimpleDataResponse.success(); + + } catch (Exception e) { + logger.error("addToFavorite error", e); + TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); + return new SimpleDataResponse(ResponseCode.SERVER_ERROR, ResponseCode.SERVER_ERROR_MSG); + } + } + + @Override + @Transactional + public SimpleDataResponse removeFavoriteDevice(OptFavoritedDeviceParams optFavoritedDeviceParams, Long userId, Long companyId, Integer languageType) { + try { + List deviceIdList = optFavoritedDeviceParams.getDeviceIdList(); + + if (CollectionUtils.isEmpty(deviceIdList)) { + return SimpleDataResponse.fail(ResponseCode.MSG_ERROR, "Device ID list cannot be empty."); + } + + favoritedDeviceMapperExt.deleteByDeviceIds(deviceIdList); + + return SimpleDataResponse.success(); + + } catch (Exception e) { + logger.error("removeFavoriteDevice error", e); + TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); + return new SimpleDataResponse(ResponseCode.SERVER_ERROR, ResponseCode.SERVER_ERROR_MSG); + } + } + +} diff --git a/dongjian-dashboard-back-service/src/main/java/com/dongjian/dashboard/back/service/impl/LevelHierarchyRoleServiceImpl.java b/dongjian-dashboard-back-service/src/main/java/com/dongjian/dashboard/back/service/impl/LevelHierarchyRoleServiceImpl.java new file mode 100644 index 0000000..5a74759 --- /dev/null +++ b/dongjian-dashboard-back-service/src/main/java/com/dongjian/dashboard/back/service/impl/LevelHierarchyRoleServiceImpl.java @@ -0,0 +1,198 @@ +package com.dongjian.dashboard.back.service.impl; + +import com.dongjian.dashboard.back.common.language.msg.MsgLanguageChange; +import com.dongjian.dashboard.back.common.response.PageInfo; +import com.dongjian.dashboard.back.common.response.ResponseCode; +import com.dongjian.dashboard.back.common.response.SimpleDataResponse; +import com.dongjian.dashboard.back.dao.ex.DashboardLevelRoleMapperExt; +import com.dongjian.dashboard.back.dao.ex.LevelHierarchyMapperExt; +import com.dongjian.dashboard.back.dto.levelhierarchy.DeleteLevelHierarchyRoleParam; +import com.dongjian.dashboard.back.dto.levelhierarchy.OptLevelHierarchyRoleParam; +import com.dongjian.dashboard.back.dto.levelhierarchy.PageLevelHierarchyRoleSearchParam; +import com.dongjian.dashboard.back.model.DashboardLevelRole; +import com.dongjian.dashboard.back.model.DashboardLevelRoleExample; +import com.dongjian.dashboard.back.service.LevelHierarchyRoleService; +import com.dongjian.dashboard.back.service.common.CommonOpt; +import com.dongjian.dashboard.back.service.common.LevelHierarchyTreeBuilder; +import com.dongjian.dashboard.back.vo.levelhierarchy.LevelHierarchyRolePageDTO; +import com.dongjian.dashboard.back.vo.levelhierarchy.LevelHierarchyTreeVO; +import com.github.pagehelper.PageHelper; +import org.apache.commons.lang3.ObjectUtils; +import org.apache.commons.lang3.StringUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.BeanUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.transaction.interceptor.TransactionAspectSupport; + +import java.util.*; +import java.util.stream.Collectors; + +@Service +public class LevelHierarchyRoleServiceImpl implements LevelHierarchyRoleService { + + private static Logger logger = LoggerFactory.getLogger(LevelHierarchyRoleServiceImpl.class); + + @Autowired + private DashboardLevelRoleMapperExt dashboardLevelRoleMapperExt; + @Autowired + private LevelHierarchyMapperExt levelHierarchyMapperExt; + @Autowired + private MsgLanguageChange msgLanguageChange; + @Autowired + private CommonOpt commonOpt; + + + + @Override + @Transactional + public SimpleDataResponse add(OptLevelHierarchyRoleParam param, Long companyId, Long userId, Integer languageType) { + try { + param.setCompanyId(companyId); + param.setId(null); + //校验参数 + SimpleDataResponse checkResult = checkParam(param, languageType); + if (200 != checkResult.getCode()) { + return checkResult; + } + //重复校验 + if (checkExist(param) > 0) { + return new SimpleDataResponse(ResponseCode.MSG_ERROR, msgLanguageChange.getParameterMapByCode(languageType, "alreadyExists")); + } + + long currentUnix = System.currentTimeMillis(); + + DashboardLevelRole dashboardLevelRole = new DashboardLevelRole(); + BeanUtils.copyProperties(param, dashboardLevelRole); + dashboardLevelRole.setCreatedBy(userId); + dashboardLevelRole.setCreatedAt(currentUnix); + + dashboardLevelRoleMapperExt.insertSelective(dashboardLevelRole); + + return SimpleDataResponse.success(); + } catch (Exception e) { + logger.error("添加层级角色报错", e); + TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); + return new SimpleDataResponse(ResponseCode.SERVER_ERROR, e.getMessage()); + } + } + + private long checkExist(OptLevelHierarchyRoleParam param) { + return dashboardLevelRoleMapperExt.checkExist(param); + } + + private SimpleDataResponse checkParam(OptLevelHierarchyRoleParam param, Integer languageType) { + if(StringUtils.isBlank(param.getName()) || param.getName().length() > 100){ + return new SimpleDataResponse(ResponseCode.MSG_ERROR, "Parameter [name] error"); + } + if(StringUtils.isNotBlank(param.getRemark()) && param.getRemark().length() > 255){ + return new SimpleDataResponse(ResponseCode.MSG_ERROR, "Parameter [remark] length error"); + } + return SimpleDataResponse.success(); + } + + @Override + @Transactional + public SimpleDataResponse edit(OptLevelHierarchyRoleParam param, Long companyId, Long userId, Integer languageType) { + try { +// param.setCompanyId(companyId); + //校验参数 + SimpleDataResponse checkResult = checkParam(param, languageType); + if (200 != checkResult.getCode()) { + return checkResult; + } + + DashboardLevelRole oldBR= dashboardLevelRoleMapperExt.selectByPrimaryKey(param.getId()); + //不存在, 这基本不可能,给个英文提示就行,省得翻译 + if (ObjectUtils.isEmpty(oldBR) || 1 == oldBR.getFlag()){ + return new SimpleDataResponse(ResponseCode.MSG_ERROR, "Not found"); + } + + param.setCompanyId(oldBR.getCompanyId()); + //重复校验 + if (checkExist(param) > 0) { + return new SimpleDataResponse(ResponseCode.MSG_ERROR, msgLanguageChange.getParameterMapByCode(languageType, "alreadyExists")); + } + + long currentUnix = System.currentTimeMillis(); + DashboardLevelRole dashboardLevelRole = new DashboardLevelRole(); + BeanUtils.copyProperties(param, dashboardLevelRole); + dashboardLevelRole.setId(param.getId()); + dashboardLevelRole.setUpdatedAt(currentUnix); + dashboardLevelRoleMapperExt.updateByPrimaryKeySelective(dashboardLevelRole); + + return SimpleDataResponse.success(); + } catch (Exception e) { + logger.error("编辑层级角色报错", e); + TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); + return new SimpleDataResponse(ResponseCode.SERVER_ERROR, e.getMessage()); + } + } + + @Override + @Transactional + public SimpleDataResponse batchDelete(DeleteLevelHierarchyRoleParam deleteLevelHierarchyRoleParam, Long companyId, Long userId, + Integer languageType) { + try { + List idList = Arrays.stream(deleteLevelHierarchyRoleParam.getIds().split(",")) + .map(Long::valueOf) + .collect(Collectors.toList()); + + // 检查是否有下级 + long checkCount = dashboardLevelRoleMapperExt.checkBound(idList); + if (checkCount > 0) { + return new SimpleDataResponse(ResponseCode.MSG_ERROR, msgLanguageChange.getParameterMapByCode(languageType, "roleHasBinded")); + } + + // 执行删除 + DashboardLevelRoleExample roleExample = new DashboardLevelRoleExample(); + DashboardLevelRoleExample.Criteria roleCriteria = roleExample.createCriteria(); + roleCriteria.andIdIn(idList).andCompanyIdIn(commonOpt.getSelfAndSubCompanyId(companyId)); + DashboardLevelRole record = new DashboardLevelRole(); + record.setFlag(1); + dashboardLevelRoleMapperExt.updateByExampleSelective(record, roleExample); + + dashboardLevelRoleMapperExt.deleteUserRelation(idList); + + return SimpleDataResponse.success(); + } catch (Exception e) { + logger.error("删除层级角色报错", e); + TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); + return new SimpleDataResponse(ResponseCode.SERVER_ERROR, e.getMessage()); + } + } + + @Override + public PageInfo getListPage(PageLevelHierarchyRoleSearchParam pageSearchParam, Long companyId, Long userId, + Integer languageType) { + //list防${}注入 + if (StringUtils.isBlank(pageSearchParam.getCompanyIds())) { + pageSearchParam.setCompanyIdList(Collections.singletonList(companyId)); + } else { + pageSearchParam.setCompanyIdList(commonOpt.filterCompanyIds(companyId, pageSearchParam.getCompanyIds())); + } + + PageHelper.startPage(pageSearchParam.getPageNum() == null ? 1 : pageSearchParam.getPageNum(), pageSearchParam.getPageSize() == null ? 20 : pageSearchParam.getPageSize()); + List resultList = dashboardLevelRoleMapperExt.getListPage(pageSearchParam); + return new PageInfo<>(resultList); + } + + @Override + public SimpleDataResponse> getHierarchyTree(Long roleId, Long companyId, Long userId, Integer languageType) { + //先判断当前用户有没有物件管理权限,有物件管理权限就是全部,没有物件管理权限就看绑定的层级角色 + int checkPermission = dashboardLevelRoleMapperExt.checkAdministrativePrivileges(userId); + + List allList = new ArrayList<>(); + if (checkPermission > 0) { + allList = levelHierarchyMapperExt.selectAllHierarchyByCompanyId(companyId); + } else { + + } + List tree = LevelHierarchyTreeBuilder.buildHierarchyTree(allList); + + return SimpleDataResponse.success(tree); + } + +} diff --git a/dongjian-dashboard-back-service/src/main/java/com/dongjian/dashboard/back/service/impl/LevelHierarchyServiceImpl.java b/dongjian-dashboard-back-service/src/main/java/com/dongjian/dashboard/back/service/impl/LevelHierarchyServiceImpl.java new file mode 100644 index 0000000..d58acae --- /dev/null +++ b/dongjian-dashboard-back-service/src/main/java/com/dongjian/dashboard/back/service/impl/LevelHierarchyServiceImpl.java @@ -0,0 +1,189 @@ +package com.dongjian.dashboard.back.service.impl; + +import com.dongjian.dashboard.back.common.language.msg.MsgLanguageChange; +import com.dongjian.dashboard.back.common.response.PageInfo; +import com.dongjian.dashboard.back.common.response.ResponseCode; +import com.dongjian.dashboard.back.common.response.SimpleDataResponse; +import com.dongjian.dashboard.back.dao.ex.LevelHierarchyMapperExt; +import com.dongjian.dashboard.back.dto.levelhierarchy.DeleteLevelHierarchyParam; +import com.dongjian.dashboard.back.dto.levelhierarchy.OptLevelHierarchyParam; +import com.dongjian.dashboard.back.dto.levelhierarchy.PageLevelHierarchySearchParam; +import com.dongjian.dashboard.back.service.LevelHierarchyService; +import com.dongjian.dashboard.back.service.common.CommonOpt; +import com.dongjian.dashboard.back.vo.levelhierarchy.LevelHierarchyPageDTO; +import com.github.pagehelper.PageHelper; +import org.apache.commons.collections.CollectionUtils; +import org.apache.commons.lang3.StringUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.transaction.interceptor.TransactionAspectSupport; + +import java.util.*; +import java.util.stream.Collectors; + +@Service +public class LevelHierarchyServiceImpl implements LevelHierarchyService { + + private static Logger logger = LoggerFactory.getLogger(LevelHierarchyServiceImpl.class); + + @Autowired + private LevelHierarchyMapperExt levelHierarchyMapperExt; + @Autowired + private MsgLanguageChange msgLanguageChange; + @Autowired + private CommonOpt commonOpt; + + + + @Override + @Transactional + public SimpleDataResponse add(OptLevelHierarchyParam param, Long companyId, Long userId, Integer languageType) { + try { + param.setCompanyId(companyId); + param.setId(null); + //校验参数 + SimpleDataResponse checkResult = checkParam(param, languageType); + if (200 != checkResult.getCode()) { + return checkResult; + } + //重复校验 + if (checkExist(param) > 0) { + return new SimpleDataResponse(ResponseCode.MSG_ERROR, msgLanguageChange.getParameterMapByCode(languageType, "alreadyExists")); + } + + long currentUnix = System.currentTimeMillis(); + param.setCreatedBy(userId); + param.setCreatedAt(currentUnix); + + levelHierarchyMapperExt.insertHierarchy(param); + + insertRelation(param.getType(), param.getParentIdList(), param.getId(), param.getCreatedBy(), param.getCreatedAt()); + + return SimpleDataResponse.success(); + } catch (Exception e) { + logger.error("添加层级报错", e); + TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); + return new SimpleDataResponse(ResponseCode.SERVER_ERROR, e.getMessage()); + } + } + + private void insertRelation(String type, List parentIdList, Long childId, Long createdBy, Long createdAt) { + String relationType = switch (type) { + case "STORE" -> "BRANCH_STORE"; + case "AREA" -> "STORE_AREA"; + case "SITE" -> "AREA_SITE"; + case "BUILDING" -> "SITE_BUILDING"; + default -> null; + }; + if (null != relationType){ + levelHierarchyMapperExt.deleteRelations(relationType, childId); + if (CollectionUtils.isNotEmpty(parentIdList)) { + levelHierarchyMapperExt.insertHierarchyRelation(relationType, parentIdList, childId, createdBy, createdAt); + } + } + } + + private long checkExist(OptLevelHierarchyParam param) { + return levelHierarchyMapperExt.checkExist(param); + } + + private SimpleDataResponse checkParam(OptLevelHierarchyParam param, Integer languageType) { + if(StringUtils.isBlank(param.getLevelHierarchyName()) || param.getLevelHierarchyName().length() > 255){ + return new SimpleDataResponse(ResponseCode.MSG_ERROR, "Parameter [levelHierarchyName] error"); + } + if(StringUtils.isBlank(param.getType())){ + return new SimpleDataResponse(ResponseCode.MSG_ERROR, "Parameter [type] error"); + } else if(!param.getType().equals("BRANCH") && !param.getType().equals("STORE") && !param.getType().equals("AREA") && !param.getType().equals("SITE")){ + return new SimpleDataResponse(ResponseCode.MSG_ERROR, "Parameter [type] error"); + } + if(StringUtils.isNotBlank(param.getRemark()) && param.getRemark().length() > 255){ + return new SimpleDataResponse(ResponseCode.MSG_ERROR, "Parameter [remark] length error"); + } + if (!param.getType().equals("BRANCH") && CollectionUtils.isEmpty(param.getParentIdList())){ + return new SimpleDataResponse(ResponseCode.MSG_ERROR, "parentIdList is required"); + } + return SimpleDataResponse.success(); + } + + @Override + @Transactional + public SimpleDataResponse edit(OptLevelHierarchyParam param, Long companyId, Long userId, Integer languageType) { + try { +// param.setCompanyId(companyId); + //校验参数 + SimpleDataResponse checkResult = checkParam(param, languageType); + if (200 != checkResult.getCode()) { + return checkResult; + } + + long exist = levelHierarchyMapperExt.checkOld(param); + //不存在, 这基本不可能,给个英文提示就行,省得翻译 + if (0 == exist){ + return new SimpleDataResponse(ResponseCode.MSG_ERROR, "Not found"); + } + + //重复校验 + if (checkExist(param) > 0) { + return new SimpleDataResponse(ResponseCode.MSG_ERROR, msgLanguageChange.getParameterMapByCode(languageType, "alreadyExists")); + } + + long currentUnix = System.currentTimeMillis(); + param.setUpdatedAt(currentUnix); + + levelHierarchyMapperExt.updateHierarchy(param); + + insertRelation(param.getType(), param.getParentIdList(), param.getId(), userId, currentUnix); + + return SimpleDataResponse.success(); + } catch (Exception e) { + logger.error("编辑层级报错", e); + TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); + return new SimpleDataResponse(ResponseCode.SERVER_ERROR, e.getMessage()); + } + } + + @Override + @Transactional + public SimpleDataResponse batchDelete(DeleteLevelHierarchyParam deleteLevelHierarchyParam, Long companyId, Long userId, + Integer languageType) { + try { + List idList = Arrays.stream(deleteLevelHierarchyParam.getIds().split(",")) + .map(Long::valueOf) + .collect(Collectors.toList()); + + // 检查是否有下级 + Long childCount = levelHierarchyMapperExt.countChildrenByType(deleteLevelHierarchyParam.getType(), idList); + if (childCount != null && childCount > 0) { + return new SimpleDataResponse(ResponseCode.MSG_ERROR, msgLanguageChange.getParameterMapByCode(languageType, "hasChildLevel")); + } + + // 执行删除 + levelHierarchyMapperExt.deleteHierarchyByType(deleteLevelHierarchyParam.getType(), idList); + + return SimpleDataResponse.success(); + } catch (Exception e) { + logger.error("删除层级报错", e); + TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); + return new SimpleDataResponse(ResponseCode.SERVER_ERROR, e.getMessage()); + } + } + + @Override + public PageInfo getListPage(PageLevelHierarchySearchParam pageSearchParam, Long companyId, Long userId, + Integer languageType) { + //list防${}注入 + if (StringUtils.isBlank(pageSearchParam.getCompanyIds())) { + pageSearchParam.setCompanyIdList(Collections.singletonList(companyId)); + } else { + pageSearchParam.setCompanyIdList(commonOpt.filterCompanyIds(companyId, pageSearchParam.getCompanyIds())); + } + + PageHelper.startPage(pageSearchParam.getPageNum() == null ? 1 : pageSearchParam.getPageNum(), pageSearchParam.getPageSize() == null ? 20 : pageSearchParam.getPageSize()); + List resultList = levelHierarchyMapperExt.getListPage(pageSearchParam); + return new PageInfo<>(resultList); + } + +} diff --git a/dongjian-dashboard-back-service/src/main/java/com/dongjian/dashboard/back/service/impl/MonitoringPointCategoryGroupServiceImpl.java b/dongjian-dashboard-back-service/src/main/java/com/dongjian/dashboard/back/service/impl/MonitoringPointCategoryGroupServiceImpl.java new file mode 100644 index 0000000..bf34433 --- /dev/null +++ b/dongjian-dashboard-back-service/src/main/java/com/dongjian/dashboard/back/service/impl/MonitoringPointCategoryGroupServiceImpl.java @@ -0,0 +1,326 @@ +package com.dongjian.dashboard.back.service.impl; + +import com.dongjian.dashboard.back.common.Constants; +import com.dongjian.dashboard.back.common.exception.MsgCodeException; +import com.dongjian.dashboard.back.common.language.msg.MsgLanguageChange; +import com.dongjian.dashboard.back.common.response.PageInfo; +import com.dongjian.dashboard.back.common.response.ResponseCode; +import com.dongjian.dashboard.back.common.response.SimpleDataResponse; +import com.dongjian.dashboard.back.dao.ex.*; +import com.dongjian.dashboard.back.dto.devicegroup.BindDeviceForGroupParams; +import com.dongjian.dashboard.back.dto.monitoringpointcategorygroup.*; +import com.dongjian.dashboard.back.model.*; +import com.dongjian.dashboard.back.service.MonitoringPointCategoryGroupService; +import com.dongjian.dashboard.back.service.common.CommonOpt; +import com.dongjian.dashboard.back.util.CommonUtil; +import com.dongjian.dashboard.back.vo.device.DeviceVO; +import com.dongjian.dashboard.back.vo.monitoringpointcategory.MonitoringPointCategoryPageVO; +import com.dongjian.dashboard.back.vo.monitoringpointcategorygroup.MonitoringPointCategoryGroupPageVO; +import com.github.pagehelper.PageHelper; +import org.apache.commons.collections.CollectionUtils; +import org.apache.commons.lang3.StringUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.BeanUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.transaction.interceptor.TransactionAspectSupport; +import org.springframework.util.ObjectUtils; + +import java.util.Arrays; +import java.util.List; +import java.util.Objects; +import java.util.stream.Collectors; + +@Service +public class MonitoringPointCategoryGroupServiceImpl implements MonitoringPointCategoryGroupService { + + private static final Logger logger = LoggerFactory.getLogger(MonitoringPointCategoryGroupServiceImpl.class); + + @Autowired + private CommonOpt commonOpt; + @Autowired + private MsgLanguageChange msgLanguageChange; + @Autowired + private MonitoringPointCategoryGroupMapperExt monitoringPointCategoryGroupMapperExt; + @Autowired + private MonitoringPointCategoryGroupRelationMapperExt monitoringPointCategoryGroupRelationMapperExt; + @Autowired + private MonitoringPointCategoryMapperExt monitoringPointCategoryMapperExt; + @Autowired + private BasicBuildingMapperExt basicBuildingMapperExt; + + + + @Override + @Transactional + public SimpleDataResponse add(OptMonitoringPointCategoryGroupParams optMonitoringPointCategoryGroupParams, Long userId, Long companyId, Integer languageType) { + try { + optMonitoringPointCategoryGroupParams.setMonitoringPointCategoryGroupId(null); + + try { + optMonitoringPointCategoryGroupParams.setCompanyId(companyId); + commonVerifyOpt(optMonitoringPointCategoryGroupParams, companyId, languageType); + } catch (MsgCodeException e) { + return new SimpleDataResponse(ResponseCode.MSG_ERROR, e.getMessage()); + } + + long currentUnix = System.currentTimeMillis(); + MonitoringPointCategoryGroup entity = new MonitoringPointCategoryGroup(); + BeanUtils.copyProperties(optMonitoringPointCategoryGroupParams, entity); + entity.setId(null); + entity.setCreatedAt(currentUnix); + entity.setCreatedBy(userId); + monitoringPointCategoryGroupMapperExt.insertSelective(entity); + + return SimpleDataResponse.success(); + } catch (Exception e) { + logger.error("新增分组出错", e); + TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); + return new SimpleDataResponse(ResponseCode.SERVER_ERROR, ResponseCode.SERVER_ERROR_MSG); + } + } + + private void checkCompany(OptMonitoringPointCategoryGroupParams param, Integer languageType, Long companyId) { + if (!commonOpt.isSubCompany(companyId, param.getCompanyId())) { + throw new MsgCodeException(msgLanguageChange.getParameterMapByCode(languageType, "noOperationAuth")); + } + } + + private void checkExist(OptMonitoringPointCategoryGroupParams param, Integer languageType) { + if (monitoringPointCategoryGroupMapperExt.checkExist(param) > 0) { + throw new MsgCodeException(msgLanguageChange.getParameterMapByCode(languageType, "monitoringPointCategoryGroupNameHasExisted")); + } + } + + private void checkParam(OptMonitoringPointCategoryGroupParams param, Integer languageType) { + if (StringUtils.isBlank(param.getName()) || param.getName().length() > 500) { + throw new MsgCodeException("Parameter error [monitoringPointCategoryGroupName]"); + } + if(StringUtils.isNotBlank(param.getRemark()) && param.getRemark().length() > 500){ + throw new MsgCodeException("Parameter error [remark]"); + } + if(null == param.getBuildingId()){ + throw new MsgCodeException("Parameter error [buildingId]"); + } else { + BasicBuilding building = basicBuildingMapperExt.selectByPrimaryKey(param.getBuildingId()); + if (null == building || 1 == building.getFlag()){ + throw new MsgCodeException("building not found"); + } else if (!Objects.equals(building.getCompanyId(), param.getCompanyId())) { + throw new MsgCodeException(msgLanguageChange.getParameterMapByCode(languageType, "noOperationAuth")); + } + } + } + + private void commonVerifyOpt(OptMonitoringPointCategoryGroupParams param, Long companyId, Integer languageType) { + checkParam(param, languageType); + checkExist(param, languageType); + } + + @Override + @Transactional + public SimpleDataResponse edit(OptMonitoringPointCategoryGroupParams param, Long userId, Long companyId, Integer languageType) { + try { + MonitoringPointCategoryGroup oldBP = monitoringPointCategoryGroupMapperExt.selectByPrimaryKey(param.getMonitoringPointCategoryGroupId()); + if (ObjectUtils.isEmpty(oldBP) || 1 == oldBP.getFlag()){ + return new SimpleDataResponse(ResponseCode.MSG_ERROR, "Not found"); + } + try { + List selfAndSubCompanyList = commonOpt.getSelfAndSubCompanyId(companyId); + if (!selfAndSubCompanyList.contains(oldBP.getCompanyId())){ + throw new MsgCodeException(msgLanguageChange.getParameterMapByCode(languageType, "noOperationAuth")); + } + + param.setCompanyId(oldBP.getCompanyId()); + commonVerifyOpt(param, companyId, languageType); + + } catch (MsgCodeException e) { + return new SimpleDataResponse(ResponseCode.MSG_ERROR, e.getMessage()); + } + + MonitoringPointCategoryGroup monitoringPointCategoryGroup = new MonitoringPointCategoryGroup(); + BeanUtils.copyProperties(param, monitoringPointCategoryGroup); + if (StringUtils.isBlank(param.getRemark())) { + monitoringPointCategoryGroup.setRemark(""); + } + + MonitoringPointCategoryGroupExample example = new MonitoringPointCategoryGroupExample(); + MonitoringPointCategoryGroupExample.Criteria criteria = example.createCriteria(); + criteria.andIdEqualTo(param.getMonitoringPointCategoryGroupId()); + + + monitoringPointCategoryGroupMapperExt.updateByExampleSelective(monitoringPointCategoryGroup, example); + + return SimpleDataResponse.success(); + } catch (Exception e) { + logger.error("编辑分组出错", e); + TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); + return new SimpleDataResponse(ResponseCode.SERVER_ERROR, ResponseCode.SERVER_ERROR_MSG); + } + } + + @Override + @Transactional + public SimpleDataResponse batchDelete(DeleteMonitoringPointCategoryGroupParams param, Long userId, Long companyId, Integer languageType) { + if (StringUtils.isBlank(param.getMonitoringPointCategoryGroupIds())) { + return SimpleDataResponse.success(); + } + try { + List ids = Arrays.asList(StringUtils.split(param.getMonitoringPointCategoryGroupIds(), ",")).stream() + .map(id -> CommonUtil.String2Long(id.trim())).collect(Collectors.toList()); + + MonitoringPointCategoryGroupExample monitoringPointCategoryGroupExample = new MonitoringPointCategoryGroupExample(); + MonitoringPointCategoryGroupExample.Criteria criteria = monitoringPointCategoryGroupExample.createCriteria(); + criteria.andIdIn(ids).andCompanyIdIn(commonOpt.getSelfAndSubCompanyId(companyId)); + + MonitoringPointCategoryGroup monitoringPointCategoryGroup = new MonitoringPointCategoryGroup(); + monitoringPointCategoryGroup.setFlag(1); + monitoringPointCategoryGroupMapperExt.updateByExampleSelective(monitoringPointCategoryGroup, monitoringPointCategoryGroupExample); + + return SimpleDataResponse.success(); + } catch (Exception e) { + logger.error("删除分组出错", e); + TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); + return new SimpleDataResponse(ResponseCode.SERVER_ERROR, ResponseCode.SERVER_ERROR_MSG); + } + } + + @Override + public PageInfo getListPage(MonitoringPointCategoryGroupSearchParams pageSearchParam, Long companyId, Long userId, Integer languageType, Integer uTCOffset) { + if (StringUtils.isBlank(pageSearchParam.getCompanyIds())) { + pageSearchParam.setCompanyIdList(List.of(companyId)); + } else { + pageSearchParam.setCompanyIdList(commonOpt.filterCompanyIds(companyId, pageSearchParam.getCompanyIds())); + } + + if (StringUtils.isNotBlank(pageSearchParam.getMonitoringPointCategoryGroupIds())) { + pageSearchParam.setMonitoringPointCategoryGroupIdList(CommonUtil.commaStr2LongList(pageSearchParam.getMonitoringPointCategoryGroupIds())); + } + + PageHelper.startPage(pageSearchParam.getPageNum() == null ? 1 : pageSearchParam.getPageNum(), + pageSearchParam.getPageSize() == null ? 20 : pageSearchParam.getPageSize()); + + List list = monitoringPointCategoryGroupMapperExt.getListPage(pageSearchParam); + return new PageInfo<>(list); + } + + @Override + @Transactional + public SimpleDataResponse bindGroupForCategory(BindGroupForCategoryParams bindGroupForCategoryParams, Long userId, Long companyId, Integer languageType) { + try { + // 1. 获取分类信息 + MonitoringPointCategory monitoringPointCategory = monitoringPointCategoryMapperExt.selectByPrimaryKey(bindGroupForCategoryParams.getMonitoringPointCategoryId()); + if (monitoringPointCategory == null || monitoringPointCategory.getFlag() != 0) { + return new SimpleDataResponse(ResponseCode.MSG_ERROR, "Category not found"); + } + + List monitoringPointCategoryGroupIdList = CommonUtil.commaStr2LongList(bindGroupForCategoryParams.getMonitoringPointCategoryGroupIds()); + + // 2. 校验分组列表的类型是否符合分组要求 + if (CollectionUtils.isNotEmpty(monitoringPointCategoryGroupIdList)) { + for (Long monitoringPointCategoryGroupId : monitoringPointCategoryGroupIdList) { + MonitoringPointCategoryGroup monitoringPointCategoryGroup = monitoringPointCategoryGroupMapperExt.selectByPrimaryKey(monitoringPointCategoryGroupId); + if (monitoringPointCategoryGroup == null || monitoringPointCategoryGroup.getFlag() != 0) { + return new SimpleDataResponse(ResponseCode.MSG_ERROR, "Device group not found"); + } + + // 检查分组和分类是否属于同一企业 + if (!Objects.equals(monitoringPointCategoryGroup.getCompanyId(), monitoringPointCategory.getCompanyId())) { + return new SimpleDataResponse(ResponseCode.MSG_ERROR, "Device and group are not in the same company"); + } + } + } + + // 3. 删除原绑定关系 + MonitoringPointCategoryGroupRelationExample monitoringPointCategoryGroupRelationExample = new MonitoringPointCategoryGroupRelationExample(); + MonitoringPointCategoryGroupRelationExample.Criteria criteria = monitoringPointCategoryGroupRelationExample.createCriteria(); + criteria.andMonitoringPointCategoryIdEqualTo(bindGroupForCategoryParams.getMonitoringPointCategoryId()); + monitoringPointCategoryGroupRelationMapperExt.deleteByExample(monitoringPointCategoryGroupRelationExample); + + // 4. 插入新绑定关系 + if (CollectionUtils.isNotEmpty(monitoringPointCategoryGroupIdList)) { + for (Long monitoringPointCategoryGroupId : monitoringPointCategoryGroupIdList){ + MonitoringPointCategoryGroupRelation monitoringPointCategoryGroupRelation = new MonitoringPointCategoryGroupRelation(); + monitoringPointCategoryGroupRelation.setMonitoringPointCategoryGroupId(monitoringPointCategoryGroupId); + monitoringPointCategoryGroupRelation.setMonitoringPointCategoryId(bindGroupForCategoryParams.getMonitoringPointCategoryId()); + monitoringPointCategoryGroupRelationMapperExt.insertSelective(monitoringPointCategoryGroupRelation); + } + } + + return SimpleDataResponse.success(); + } catch (Exception e) { + logger.error("bindGroupForCategory error", e); + TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); + return new SimpleDataResponse(ResponseCode.SERVER_ERROR, ResponseCode.SERVER_ERROR_MSG); + } + } + + public static boolean isNotTypeMatch(int groupType, int deviceTypeId) { + List allowedTypes = Constants.CATEGORY_DEVICE_TYPE_MAP.get(groupType); + return allowedTypes == null || !allowedTypes.contains(deviceTypeId); + } + + @Override + @Transactional + public SimpleDataResponse bindCategoryForGroup(BindCategoryForGroupParams bindDeviceForGroupParams, Long userId, Long companyId, Integer languageType) { + + try { + // 1. 获取目标分组信息 + MonitoringPointCategoryGroup monitoringPointCategoryGroup = monitoringPointCategoryGroupMapperExt.selectByPrimaryKey(bindDeviceForGroupParams.getMonitoringPointCategoryGroupId()); + if (monitoringPointCategoryGroup == null || monitoringPointCategoryGroup.getFlag() != 0) { + return new SimpleDataResponse(ResponseCode.MSG_ERROR, "Group not set"); + } + + List monitoringPointCategoryIdList = CommonUtil.commaStr2LongList(bindDeviceForGroupParams.getMonitoringPointCategoryIds()); + + if (CollectionUtils.isNotEmpty(monitoringPointCategoryIdList)) { + // 2. 校验分组列表的类型是否符合分组要求 + for (Long monitoringPointCategoryId : monitoringPointCategoryIdList) { + MonitoringPointCategory monitoringPointCategory = monitoringPointCategoryMapperExt.selectByPrimaryKey(monitoringPointCategoryId); + if (monitoringPointCategory == null || monitoringPointCategory.getFlag() != 0) { + return new SimpleDataResponse(ResponseCode.MSG_ERROR, "Category not found: " + monitoringPointCategoryId); + } + + // **building 不一致** + Long categoryCompanyId = monitoringPointCategory.getCompanyId(); + if (!Objects.equals(categoryCompanyId, monitoringPointCategoryGroup.getCompanyId())) { + return new SimpleDataResponse(ResponseCode.MSG_ERROR, "Category and group are not in the same company"); + } + } + } + + // 3. 删除原绑定关系 + MonitoringPointCategoryGroupRelationExample monitoringPointCategoryGroupRelationExample = new MonitoringPointCategoryGroupRelationExample(); + MonitoringPointCategoryGroupRelationExample.Criteria criteria = monitoringPointCategoryGroupRelationExample.createCriteria(); + criteria.andMonitoringPointCategoryGroupIdEqualTo(bindDeviceForGroupParams.getMonitoringPointCategoryGroupId()); + monitoringPointCategoryGroupRelationMapperExt.deleteByExample(monitoringPointCategoryGroupRelationExample); + + // 4. 插入新绑定关系 + if (CollectionUtils.isNotEmpty(monitoringPointCategoryIdList)) { + for (Long monitoringPointCategoryId : monitoringPointCategoryIdList) { + MonitoringPointCategoryGroupRelation monitoringPointCategoryGroupRelation = new MonitoringPointCategoryGroupRelation(); + monitoringPointCategoryGroupRelation.setMonitoringPointCategoryGroupId(bindDeviceForGroupParams.getMonitoringPointCategoryGroupId()); + monitoringPointCategoryGroupRelation.setMonitoringPointCategoryId(monitoringPointCategoryId); + monitoringPointCategoryGroupRelationMapperExt.insertSelective(monitoringPointCategoryGroupRelation); + } + } + + return SimpleDataResponse.success(); + } catch (Exception e) { + logger.error("bindCategoryForGroup error", e); + TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); + return new SimpleDataResponse(ResponseCode.SERVER_ERROR, ResponseCode.SERVER_ERROR_MSG); + } + } + + @Override + public SimpleDataResponse> getBindedGroupByCategory(Long monitoringPointCategoryId, Long userId, Long companyId, Integer languageType) { + return SimpleDataResponse.success(monitoringPointCategoryGroupMapperExt.getBindedGroupByCategory(monitoringPointCategoryId)); + } + + @Override + public SimpleDataResponse> getBindedCategoryByGroup(Long monitoringPointCategoryGroupId, Long userId, Long companyId, Integer languageType) { + return SimpleDataResponse.success(monitoringPointCategoryGroupMapperExt.getBindedCategoryByGroup(monitoringPointCategoryGroupId)); + } +} diff --git a/dongjian-dashboard-back-service/src/main/java/com/dongjian/dashboard/back/service/impl/MonitoringPointCategoryServiceImpl.java b/dongjian-dashboard-back-service/src/main/java/com/dongjian/dashboard/back/service/impl/MonitoringPointCategoryServiceImpl.java new file mode 100644 index 0000000..23187a6 --- /dev/null +++ b/dongjian-dashboard-back-service/src/main/java/com/dongjian/dashboard/back/service/impl/MonitoringPointCategoryServiceImpl.java @@ -0,0 +1,183 @@ +package com.dongjian.dashboard.back.service.impl; + +import com.dongjian.dashboard.back.common.exception.MsgCodeException; +import com.dongjian.dashboard.back.common.language.msg.MsgLanguageChange; +import com.dongjian.dashboard.back.common.response.PageInfo; +import com.dongjian.dashboard.back.common.response.ResponseCode; +import com.dongjian.dashboard.back.common.response.SimpleDataResponse; +import com.dongjian.dashboard.back.dao.ex.BasicBuildingMapperExt; +import com.dongjian.dashboard.back.dao.ex.MonitoringPointCategoryMapperExt; +import com.dongjian.dashboard.back.dto.monitoringpointcategory.*; +import com.dongjian.dashboard.back.model.*; +import com.dongjian.dashboard.back.service.MonitoringPointCategoryService; +import com.dongjian.dashboard.back.service.common.CommonOpt; +import com.dongjian.dashboard.back.util.CommonUtil; +import com.dongjian.dashboard.back.vo.monitoringpointcategory.MonitoringPointCategoryPageVO; +import com.github.pagehelper.PageHelper; +import org.apache.commons.lang3.StringUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.BeanUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.transaction.interceptor.TransactionAspectSupport; +import org.springframework.util.ObjectUtils; + +import java.util.Arrays; +import java.util.List; +import java.util.stream.Collectors; + +@Service +public class MonitoringPointCategoryServiceImpl implements MonitoringPointCategoryService { + + private static final Logger logger = LoggerFactory.getLogger(MonitoringPointCategoryServiceImpl.class); + + @Autowired + private CommonOpt commonOpt; + @Autowired + private MsgLanguageChange msgLanguageChange; + @Autowired + private MonitoringPointCategoryMapperExt monitoringPointCategoryMapperExt; + @Autowired + private BasicBuildingMapperExt basicBuildingMapperExt; + + + + @Override + @Transactional + public SimpleDataResponse add(OptMonitoringPointCategoryParams optMonitoringPointCategoryParams, Long userId, Long companyId, Integer languageType) { + try { + optMonitoringPointCategoryParams.setMonitoringPointCategoryId(null); + + try { + optMonitoringPointCategoryParams.setCompanyId(companyId); + commonVerifyOpt(optMonitoringPointCategoryParams, companyId, languageType); + } catch (MsgCodeException e) { + return new SimpleDataResponse(ResponseCode.MSG_ERROR, e.getMessage()); + } + + long currentUnix = System.currentTimeMillis(); + MonitoringPointCategory entity = new MonitoringPointCategory(); + BeanUtils.copyProperties(optMonitoringPointCategoryParams, entity); + entity.setId(null); + entity.setCreatedAt(currentUnix); + entity.setCreatedBy(userId); + monitoringPointCategoryMapperExt.insertSelective(entity); + + return SimpleDataResponse.success(); + } catch (Exception e) { + logger.error("新增监视点分类出错", e); + TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); + return new SimpleDataResponse(ResponseCode.SERVER_ERROR, ResponseCode.SERVER_ERROR_MSG); + } + } + + private void checkExist(OptMonitoringPointCategoryParams param, Integer languageType) { + if (monitoringPointCategoryMapperExt.checkExist(param) > 0) { + throw new MsgCodeException(msgLanguageChange.getParameterMapByCode(languageType, "monitoringPointCategoryNameHasExisted")); + } + } + + private void checkParam(OptMonitoringPointCategoryParams param, Integer languageType) { + if (StringUtils.isBlank(param.getName()) || param.getName().length() > 500) { + throw new MsgCodeException("Parameter error [monitoringPointCategoryName]"); + } + if(StringUtils.isNotBlank(param.getRemark()) && param.getRemark().length() > 500){ + throw new MsgCodeException("Parameter error [remark]"); + } + } + + private void commonVerifyOpt(OptMonitoringPointCategoryParams param, Long companyId, Integer languageType) { + checkParam(param, languageType); + checkExist(param, languageType); + } + + @Override + @Transactional + public SimpleDataResponse edit(OptMonitoringPointCategoryParams param, Long userId, Long companyId, Integer languageType) { + try { + MonitoringPointCategory oldBP = monitoringPointCategoryMapperExt.selectByPrimaryKey(param.getMonitoringPointCategoryId()); + if (ObjectUtils.isEmpty(oldBP) || 1 == oldBP.getFlag()){ + return new SimpleDataResponse(ResponseCode.MSG_ERROR, "Not found"); + } + try { + List selfAndSubCompanyList = commonOpt.getSelfAndSubCompanyId(companyId); + if (!selfAndSubCompanyList.contains(oldBP.getCompanyId())){ + throw new MsgCodeException(msgLanguageChange.getParameterMapByCode(languageType, "noOperationAuth")); + } + + param.setCompanyId(oldBP.getCompanyId()); + commonVerifyOpt(param, companyId, languageType); + + } catch (MsgCodeException e) { + return new SimpleDataResponse(ResponseCode.MSG_ERROR, e.getMessage()); + } + + MonitoringPointCategory monitoringPointCategory = new MonitoringPointCategory(); + BeanUtils.copyProperties(param, monitoringPointCategory); + if (StringUtils.isBlank(param.getRemark())) { + monitoringPointCategory.setRemark(""); + } + + MonitoringPointCategoryExample example = new MonitoringPointCategoryExample(); + MonitoringPointCategoryExample.Criteria criteria = example.createCriteria(); + criteria.andIdEqualTo(param.getMonitoringPointCategoryId()); + + + monitoringPointCategoryMapperExt.updateByExampleSelective(monitoringPointCategory, example); + + return SimpleDataResponse.success(); + } catch (Exception e) { + logger.error("编辑监视点分类出错", e); + TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); + return new SimpleDataResponse(ResponseCode.SERVER_ERROR, ResponseCode.SERVER_ERROR_MSG); + } + } + + @Override + @Transactional + public SimpleDataResponse batchDelete(DeleteMonitoringPointCategoryParams param, Long userId, Long companyId, Integer languageType) { + if (StringUtils.isBlank(param.getMonitoringPointCategoryIds())) { + return SimpleDataResponse.success(); + } + try { + List ids = Arrays.asList(StringUtils.split(param.getMonitoringPointCategoryIds(), ",")).stream() + .map(id -> CommonUtil.String2Long(id.trim())).collect(Collectors.toList()); + + MonitoringPointCategoryExample monitoringPointCategoryExample = new MonitoringPointCategoryExample(); + MonitoringPointCategoryExample.Criteria criteria = monitoringPointCategoryExample.createCriteria(); + criteria.andIdIn(ids).andCompanyIdIn(commonOpt.getSelfAndSubCompanyId(companyId)); + + MonitoringPointCategory monitoringPointCategory = new MonitoringPointCategory(); + monitoringPointCategory.setFlag(1); + monitoringPointCategoryMapperExt.updateByExampleSelective(monitoringPointCategory, monitoringPointCategoryExample); + + return SimpleDataResponse.success(); + } catch (Exception e) { + logger.error("删除监视点分类出错", e); + TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); + return new SimpleDataResponse(ResponseCode.SERVER_ERROR, ResponseCode.SERVER_ERROR_MSG); + } + } + + @Override + public PageInfo getListPage(MonitoringPointCategorySearchParams pageSearchParam, Long companyId, Long userId, Integer languageType, Integer uTCOffset) { + if (StringUtils.isBlank(pageSearchParam.getCompanyIds())) { + pageSearchParam.setCompanyIdList(List.of(companyId)); + } else { + pageSearchParam.setCompanyIdList(commonOpt.filterCompanyIds(companyId, pageSearchParam.getCompanyIds())); + } + + if (StringUtils.isNotBlank(pageSearchParam.getMonitoringPointCategoryIds())) { + pageSearchParam.setMonitoringPointCategoryIdList(CommonUtil.commaStr2LongList(pageSearchParam.getMonitoringPointCategoryIds())); + } + + PageHelper.startPage(pageSearchParam.getPageNum() == null ? 1 : pageSearchParam.getPageNum(), + pageSearchParam.getPageSize() == null ? 20 : pageSearchParam.getPageSize()); + + List list = monitoringPointCategoryMapperExt.getListPage(pageSearchParam); + return new PageInfo<>(list); + } + +} diff --git a/dongjian-dashboard-back-service/src/main/java/com/dongjian/dashboard/back/service/impl/NotificationConfigServiceImpl.java b/dongjian-dashboard-back-service/src/main/java/com/dongjian/dashboard/back/service/impl/NotificationConfigServiceImpl.java new file mode 100644 index 0000000..f7a75ee --- /dev/null +++ b/dongjian-dashboard-back-service/src/main/java/com/dongjian/dashboard/back/service/impl/NotificationConfigServiceImpl.java @@ -0,0 +1,434 @@ +package com.dongjian.dashboard.back.service.impl; + +import java.util.Arrays; +import java.util.List; +import java.util.stream.Collectors; + +import org.apache.commons.lang3.StringUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.BeanUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.transaction.interceptor.TransactionAspectSupport; +import org.springframework.util.ObjectUtils; + +import com.github.pagehelper.PageHelper; +import com.dongjian.dashboard.back.common.exception.MsgCodeException; +import com.dongjian.dashboard.back.common.language.msg.MsgLanguageChange; +import com.dongjian.dashboard.back.common.response.PageInfo; +import com.dongjian.dashboard.back.common.response.ResponseCode; +import com.dongjian.dashboard.back.common.response.SimpleDataResponse; +import com.dongjian.dashboard.back.dao.ex.NotificationSlackMapperExt; +import com.dongjian.dashboard.back.dao.ex.NotificationTeamsMapperExt; +import com.dongjian.dashboard.back.dto.notificationconfig.DeleteSlackParams; +import com.dongjian.dashboard.back.dto.notificationconfig.DeleteTeamsParams; +import com.dongjian.dashboard.back.dto.notificationconfig.OptSlackParams; +import com.dongjian.dashboard.back.dto.notificationconfig.OptTeamsParams; +import com.dongjian.dashboard.back.dto.notificationconfig.SlackSearchParams; +import com.dongjian.dashboard.back.dto.notificationconfig.TeamsSearchParams; +import com.dongjian.dashboard.back.model.NotificationSlack; +import com.dongjian.dashboard.back.model.NotificationSlackExample; +import com.dongjian.dashboard.back.model.NotificationTeams; +import com.dongjian.dashboard.back.model.NotificationTeamsExample; +import com.dongjian.dashboard.back.service.NotificationConfigService; +import com.dongjian.dashboard.back.service.common.CommonOpt; +import com.dongjian.dashboard.back.util.CommonUtil; +import com.dongjian.dashboard.back.vo.notificationconfig.SlackPageVO; +import com.dongjian.dashboard.back.vo.notificationconfig.TeamsPageVO; + +/** + * + * @author jwy-style + * + */ +@Service +public class NotificationConfigServiceImpl implements NotificationConfigService { + + private static Logger logger = LoggerFactory.getLogger(NotificationConfigServiceImpl.class); + + + @Autowired + private CommonOpt commonOpt; + @Autowired + private MsgLanguageChange msgLanguageChange; + @Autowired + private NotificationSlackMapperExt notificationSlackMapperExt; + @Autowired + private NotificationTeamsMapperExt notificationTeamsMapperExt; + + + /** + * Adds a new notificationConfig based on the provided parameters. + * Validates company ownership, performs common verification, and inserts the notificationConfig into the database. + * @param optSlackParams + * @param userId + * @param companyId + * @param languageType + * @return + */ + @Override + @Transactional + public SimpleDataResponse add(OptSlackParams optSlackParams, Long userId, Long companyId, Integer languageType) { + try { + optSlackParams.setSlackId(null); + try { + // Validate company ownership to prevent unauthorized operations + optSlackParams.setCompanyId(companyId); + + // Perform common verification for the notificationConfig parameters + commonVerifyOpt(optSlackParams, companyId, languageType); + + } catch (MsgCodeException e) { + return new SimpleDataResponse(ResponseCode.MSG_ERROR, e.getMessage()); + } + + long currentUnix = System.currentTimeMillis(); + NotificationSlack notificationSlack = new NotificationSlack(); + BeanUtils.copyProperties(optSlackParams, notificationSlack); + notificationSlack.setId(null); + notificationSlack.setCreatedAt(currentUnix); + notificationSlack.setCreatedBy(userId); + notificationSlackMapperExt.insertSelective(notificationSlack); + + return SimpleDataResponse.success(); + } catch (Exception e) { + logger.error("Error occurred while adding a new notificationConfig", e); + TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); + return new SimpleDataResponse(ResponseCode.SERVER_ERROR, ResponseCode.SERVER_ERROR_MSG); + } + } + + /** + * Performs common verification operations on the notificationConfig parameters. + * Checks parameter validity and existence of the notificationConfig name. + * @param optSlackParams + * @param companyId + * @param languageType + */ + private void commonVerifyOpt(OptSlackParams optSlackParams, Long companyId, Integer languageType) { + checkParam(optSlackParams, languageType); + checkExist(optSlackParams, languageType); + } + + /** + * Checks if the specified notificationConfig's company ID matches the logged-in user's company or its subsidiary. + * Throws a MsgCodeException if the company ID does not match. + * @param optSlackParams + * @param languageType + * @param companyId + */ + private void checkCompany(OptSlackParams optSlackParams, Integer languageType, Long companyId) { + if (!commonOpt.isSubCompany(companyId, optSlackParams.getCompanyId())) { + throw new MsgCodeException(msgLanguageChange.getParameterMapByCode(languageType, "noOperationAuth")); + } + } + + /** + * Checks if a notificationConfig with the same name already exists in the database. + * Throws a MsgCodeException if the notificationConfig name is already in use. + * @param optSlackParams + * @param languageType + */ + private void checkExist(OptSlackParams optSlackParams, Integer languageType) { + if (notificationSlackMapperExt.checkExist(optSlackParams) > 0) { + throw new MsgCodeException(msgLanguageChange.getParameterMapByCode(languageType, "slackHasExisted")); + } + } + + /** + * Checks the validity of the notificationConfig name parameter. + * Throws a MsgCodeException if the notificationConfig name is blank or exceeds 100 characters. + * @param optSlackParams + * @param languageType + */ + private void checkParam(OptSlackParams optSlackParams, Integer languageType) { + if(StringUtils.isBlank(optSlackParams.getIdentity()) || optSlackParams.getIdentity().length() > 100){ + throw new MsgCodeException("Parameter error [identity]"); + } + if(StringUtils.isBlank(optSlackParams.getWebhook()) || optSlackParams.getWebhook().length() > 1000){ + throw new MsgCodeException("Parameter error [webhook]"); + } + if(StringUtils.isNotBlank(optSlackParams.getRemark()) && optSlackParams.getRemark().length() > 500){ + throw new MsgCodeException("Parameter error [remark]"); + } + } + + + /** + * Updates an existing notificationConfig with the provided parameters. + * Performs validation checks on the notificationConfig parameters and authorization. + * @param optSlackParams + * @param userId + * @param companyId + * @param languageType + * @return + */ + @Override + @Transactional + public SimpleDataResponse edit(OptSlackParams optSlackParams, Long userId, Long companyId, + Integer languageType) { + try { + NotificationSlack oldBP = notificationSlackMapperExt.selectByPrimaryKey(optSlackParams.getSlackId()); + if (ObjectUtils.isEmpty(oldBP) || 1 == oldBP.getFlag()){ + return new SimpleDataResponse(ResponseCode.MSG_ERROR, "Not found"); + } + try { + List selfAndSubCompanyList = commonOpt.getSelfAndSubCompanyId(companyId); + if (!selfAndSubCompanyList.contains(oldBP.getCompanyId())){ + throw new MsgCodeException(msgLanguageChange.getParameterMapByCode(languageType, "noOperationAuth")); + } + + commonVerifyOpt(optSlackParams, companyId, languageType); + + } catch (MsgCodeException e) { + return new SimpleDataResponse(ResponseCode.MSG_ERROR, e.getMessage()); + } + + NotificationSlack notificationSlack = new NotificationSlack(); + BeanUtils.copyProperties(optSlackParams, notificationSlack); + if (StringUtils.isBlank(optSlackParams.getRemark())) { + notificationSlack.setRemark(""); + } + + NotificationSlackExample example = new NotificationSlackExample(); + NotificationSlackExample.Criteria criteria = example.createCriteria(); + criteria.andIdEqualTo(optSlackParams.getSlackId()); + + + notificationSlackMapperExt.updateByExampleSelective(notificationSlack, example); + + return SimpleDataResponse.success(); + } catch (Exception e) { + logger.error("Edit notificationConfig error", e); + TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); + return new SimpleDataResponse(ResponseCode.SERVER_ERROR, ResponseCode.SERVER_ERROR_MSG); + } + } + + + /** + * Batch deletes notificationConfigs based on the provided notificationConfig IDs. + * Performs validation checks on the notificationConfig IDs and authorization. + * @param deleteSlackParams + * @param userId + * @param companyId + * @param languageType + * @return + */ + @Override + @Transactional + public SimpleDataResponse batchDelete(DeleteSlackParams deleteSlackParams, Long userId, + Long companyId, Integer languageType) { + if (StringUtils.isBlank(deleteSlackParams.getSlackIds())) { + return SimpleDataResponse.success(); + } + try { + List ids = Arrays.asList(StringUtils.split(deleteSlackParams.getSlackIds(), ",")).stream() + .map(id -> CommonUtil.String2Long(id.trim())).collect(Collectors.toList()); + + NotificationSlackExample basicNotificationConfigExample = new NotificationSlackExample(); + NotificationSlackExample.Criteria criteria = basicNotificationConfigExample.createCriteria(); + criteria.andIdIn(ids).andCompanyIdIn(commonOpt.getSelfAndSubCompanyId(companyId)); + + NotificationSlack basicNotificationConfig = new NotificationSlack(); + basicNotificationConfig.setFlag(1); + notificationSlackMapperExt.updateByExampleSelective(basicNotificationConfig, basicNotificationConfigExample); + + return SimpleDataResponse.success(); + } catch (Exception e) { + logger.error("Batch delete notificationConfig error", e); + TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); + return new SimpleDataResponse(ResponseCode.SERVER_ERROR, ResponseCode.SERVER_ERROR_MSG); + } + } + + + @Override + public PageInfo getListPage(SlackSearchParams pageSearchParam, Long companyId, + Long userId, Integer languageType, Integer uTCOffset) { + //list防${}注入 + if (StringUtils.isBlank(pageSearchParam.getCompanyIds())) { + pageSearchParam.setCompanyIdList(Arrays.asList(companyId)); + } else { + pageSearchParam.setCompanyIdList(commonOpt.filterCompanyIds(companyId, pageSearchParam.getCompanyIds())); + } + if (StringUtils.isNotBlank(pageSearchParam.getSlackIds())) { + pageSearchParam.setSlackIdList(CommonUtil.commaStr2LongList(pageSearchParam.getSlackIds())); + } + PageHelper.startPage(pageSearchParam.getPageNum() == null ? 1 : pageSearchParam.getPageNum(), pageSearchParam.getPageSize() == null ? 20 : pageSearchParam.getPageSize()); + List resultList = notificationSlackMapperExt.getListPage(pageSearchParam); + + return new PageInfo<>(resultList); + } + + + @Override + @Transactional + public SimpleDataResponse add(OptTeamsParams optTeamsParams, Long userId, Long companyId, Integer languageType) { + try { + optTeamsParams.setTeamsId(null); + try { + optTeamsParams.setCompanyId(companyId); + commonTeamsVerifyOpt(optTeamsParams, companyId, languageType); + } catch (MsgCodeException e) { + return new SimpleDataResponse(ResponseCode.MSG_ERROR, e.getMessage()); + } + + long currentUnix = System.currentTimeMillis(); + NotificationTeams notificationTeams = new NotificationTeams(); + BeanUtils.copyProperties(optTeamsParams, notificationTeams); + notificationTeams.setId(null); + notificationTeams.setCreatedAt(currentUnix); + notificationTeams.setCreatedBy(userId); + notificationTeamsMapperExt.insertSelective(notificationTeams); + + return SimpleDataResponse.success(); + } catch (Exception e) { + logger.error("Error occurred while adding a new notificationConfig", e); + TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); + return new SimpleDataResponse(ResponseCode.SERVER_ERROR, ResponseCode.SERVER_ERROR_MSG); + } + } + + private void commonTeamsVerifyOpt(OptTeamsParams optTeamsParams, Long companyId, Integer languageType) { + checkTeamsParam(optTeamsParams, languageType); + checkTeamsExist(optTeamsParams, languageType); + } + + private void checkTeamsExist(OptTeamsParams optTeamsParams, Integer languageType) { + if (notificationTeamsMapperExt.checkExist(optTeamsParams) > 0) { + throw new MsgCodeException(msgLanguageChange.getParameterMapByCode(languageType, "teamsHasExisted")); + } + } + + private void checkTeamsParam(OptTeamsParams optTeamsParams, Integer languageType) { + if(StringUtils.isBlank(optTeamsParams.getIdentity()) || optTeamsParams.getIdentity().length() > 100){ + throw new MsgCodeException("Parameter error [identity]"); + } + if(StringUtils.isBlank(optTeamsParams.getWebhook()) || optTeamsParams.getWebhook().length() > 1000){ + throw new MsgCodeException("Parameter error [webhook]"); + } + if(StringUtils.isNotBlank(optTeamsParams.getRemark()) && optTeamsParams.getRemark().length() > 500){ + throw new MsgCodeException("Parameter error [remark]"); + } + } + + private void commonVerifyOpt(OptTeamsParams optTeamsParams, Long companyId, Integer languageType) { + checkParam(optTeamsParams, languageType); + checkExist(optTeamsParams, languageType); + } + + private void checkCompany(OptTeamsParams optTeamsParams, Integer languageType, Long companyId) { + if (!commonOpt.isSubCompany(companyId, optTeamsParams.getCompanyId())) { + throw new MsgCodeException(msgLanguageChange.getParameterMapByCode(languageType, "noOperationAuth")); + } + } + + private void checkExist(OptTeamsParams optTeamsParams, Integer languageType) { + if (notificationTeamsMapperExt.checkExist(optTeamsParams) > 0) { + throw new MsgCodeException(msgLanguageChange.getParameterMapByCode(languageType, "teamsHasExisted")); + } + } + + private void checkParam(OptTeamsParams optTeamsParams, Integer languageType) { + if (StringUtils.isBlank(optTeamsParams.getIdentity()) || optTeamsParams.getIdentity().length() > 100) { + throw new MsgCodeException("Parameter error [identity]"); + } + if (StringUtils.isBlank(optTeamsParams.getWebhook()) || optTeamsParams.getWebhook().length() > 1000) { + throw new MsgCodeException("Parameter error [webhook]"); + } + if (StringUtils.isNotBlank(optTeamsParams.getRemark()) && optTeamsParams.getRemark().length() > 500) { + throw new MsgCodeException("Parameter error [remark]"); + } + } + + @Override + @Transactional + public SimpleDataResponse edit(OptTeamsParams optTeamsParams, Long userId, Long companyId, Integer languageType) { + try { + NotificationTeams oldBP = notificationTeamsMapperExt.selectByPrimaryKey(optTeamsParams.getTeamsId()); + if (ObjectUtils.isEmpty(oldBP) || 1 == oldBP.getFlag()) { + return new SimpleDataResponse(ResponseCode.MSG_ERROR, "Not found"); + } + try { + List selfAndSubCompanyList = commonOpt.getSelfAndSubCompanyId(companyId); + if (!selfAndSubCompanyList.contains(oldBP.getCompanyId())) { + throw new MsgCodeException(msgLanguageChange.getParameterMapByCode(languageType, "noOperationAuth")); + } + commonTeamsVerifyOpt(optTeamsParams, companyId, languageType); + } catch (MsgCodeException e) { + return new SimpleDataResponse(ResponseCode.MSG_ERROR, e.getMessage()); + } + + NotificationTeams notificationTeams = new NotificationTeams(); + BeanUtils.copyProperties(optTeamsParams, notificationTeams); + if (StringUtils.isBlank(optTeamsParams.getRemark())) { + notificationTeams.setRemark(""); + } + + NotificationTeamsExample example = new NotificationTeamsExample(); + NotificationTeamsExample.Criteria criteria = example.createCriteria(); + criteria.andIdEqualTo(optTeamsParams.getTeamsId()); + + notificationTeamsMapperExt.updateByExampleSelective(notificationTeams, example); + + return SimpleDataResponse.success(); + } catch (Exception e) { + logger.error("Edit notificationConfig error", e); + TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); + return new SimpleDataResponse(ResponseCode.SERVER_ERROR, ResponseCode.SERVER_ERROR_MSG); + } + } + + @Override + @Transactional + public SimpleDataResponse batchDelete(DeleteTeamsParams deleteTeamsParams, Long userId, Long companyId, Integer languageType) { + if (StringUtils.isBlank(deleteTeamsParams.getTeamsIds())) { + return SimpleDataResponse.success(); + } + try { + List ids = Arrays.stream(StringUtils.split(deleteTeamsParams.getTeamsIds(), ",")) + .map(id -> CommonUtil.String2Long(id.trim())) + .collect(Collectors.toList()); + + NotificationTeamsExample example = new NotificationTeamsExample(); + NotificationTeamsExample.Criteria criteria = example.createCriteria(); + criteria.andIdIn(ids).andCompanyIdIn(commonOpt.getSelfAndSubCompanyId(companyId)); + + NotificationTeams update = new NotificationTeams(); + update.setFlag(1); + notificationTeamsMapperExt.updateByExampleSelective(update, example); + + return SimpleDataResponse.success(); + } catch (Exception e) { + logger.error("Batch delete notificationConfig error", e); + TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); + return new SimpleDataResponse(ResponseCode.SERVER_ERROR, ResponseCode.SERVER_ERROR_MSG); + } + } + + @Override + public PageInfo getListPage(TeamsSearchParams pageSearchParam, Long companyId, + Long userId, Integer languageType, Integer uTCOffset) { + + if (StringUtils.isBlank(pageSearchParam.getCompanyIds())) { + pageSearchParam.setCompanyIdList(List.of(companyId)); + } else { + pageSearchParam.setCompanyIdList(commonOpt.filterCompanyIds(companyId, pageSearchParam.getCompanyIds())); + } + + if (StringUtils.isNotBlank(pageSearchParam.getTeamsIds())) { + pageSearchParam.setTeamsIdList(CommonUtil.commaStr2LongList(pageSearchParam.getTeamsIds())); + } + + PageHelper.startPage(pageSearchParam.getPageNum() == null ? 1 : pageSearchParam.getPageNum(), + pageSearchParam.getPageSize() == null ? 20 : pageSearchParam.getPageSize()); + + List resultList = notificationTeamsMapperExt.getListPage(pageSearchParam); + return new PageInfo<>(resultList); + } + + +} diff --git a/dongjian-dashboard-back-service/src/main/java/com/dongjian/dashboard/back/service/impl/OperationLogServiceImpl.java b/dongjian-dashboard-back-service/src/main/java/com/dongjian/dashboard/back/service/impl/OperationLogServiceImpl.java new file mode 100644 index 0000000..f5cdfa9 --- /dev/null +++ b/dongjian-dashboard-back-service/src/main/java/com/dongjian/dashboard/back/service/impl/OperationLogServiceImpl.java @@ -0,0 +1,73 @@ +package com.dongjian.dashboard.back.service.impl; + +import com.dongjian.dashboard.back.common.exception.MsgCodeException; +import com.dongjian.dashboard.back.common.language.msg.MsgLanguageChange; +import com.dongjian.dashboard.back.common.response.PageInfo; +import com.dongjian.dashboard.back.common.response.ResponseCode; +import com.dongjian.dashboard.back.common.response.SimpleDataResponse; +import com.dongjian.dashboard.back.dao.ex.*; +import com.dongjian.dashboard.back.dto.operationlog.LogSearchParam; +import com.dongjian.dashboard.back.dto.role.DeleteRoleParam; +import com.dongjian.dashboard.back.dto.role.OptRoleParam; +import com.dongjian.dashboard.back.dto.role.PageSearchParam; +import com.dongjian.dashboard.back.model.*; +import com.dongjian.dashboard.back.service.OperationLogService; +import com.dongjian.dashboard.back.service.RoleService; +import com.dongjian.dashboard.back.service.common.CommonOpt; +import com.dongjian.dashboard.back.service.common.MenuTree; +import com.dongjian.dashboard.back.util.CommonUtil; +import com.dongjian.dashboard.back.vo.TreeMenusDTO; +import com.dongjian.dashboard.back.vo.operationlog.OperationLogPageVO; +import com.dongjian.dashboard.back.vo.role.RolePageDTO; +import com.github.pagehelper.PageHelper; +import org.apache.commons.collections.CollectionUtils; +import org.apache.commons.lang3.ObjectUtils; +import org.apache.commons.lang3.StringUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.BeanUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.transaction.interceptor.TransactionAspectSupport; + +import java.util.*; +import java.util.stream.Collectors; + +@Service +public class OperationLogServiceImpl implements OperationLogService { + + private static Logger logger = LoggerFactory.getLogger(OperationLogServiceImpl.class); + + @Autowired + private DashboardOperationLogMapperExt dashboardOperationLogMapperExt; + @Autowired + private MsgLanguageChange msgLanguageChange; + @Autowired + private CommonOpt commonOpt; + + + + @Override + public PageInfo getListPage(LogSearchParam pageSearchParam, Long companyId, Long userId, Integer languageType) { + //list防${}注入 + if (StringUtils.isBlank(pageSearchParam.getCompanyIds())) { + pageSearchParam.setCompanyIdList(commonOpt.getSelfAndSubCompanyId(companyId)); + } else { + pageSearchParam.setCompanyIdList(commonOpt.filterCompanyIds(companyId, pageSearchParam.getCompanyIds())); + } + + + PageHelper.startPage(pageSearchParam.getPageNum() == null ? 1 : pageSearchParam.getPageNum(), pageSearchParam.getPageSize() == null ? 20 : pageSearchParam.getPageSize()); + List resultList = dashboardOperationLogMapperExt.getListPage(pageSearchParam); + + if (CollectionUtils.isNotEmpty(resultList)){ + resultList.forEach(item -> { + item.setOperation(msgLanguageChange.getOperationLogMapByCode(languageType, item.getOperation())); + }); + } + + return new PageInfo<>(resultList); + } + +} diff --git a/dongjian-dashboard-back-service/src/main/java/com/dongjian/dashboard/back/service/impl/OverviewServiceImpl.java b/dongjian-dashboard-back-service/src/main/java/com/dongjian/dashboard/back/service/impl/OverviewServiceImpl.java new file mode 100644 index 0000000..7d5394a --- /dev/null +++ b/dongjian-dashboard-back-service/src/main/java/com/dongjian/dashboard/back/service/impl/OverviewServiceImpl.java @@ -0,0 +1,143 @@ +package com.dongjian.dashboard.back.service.impl; + +import com.dongjian.dashboard.back.common.Constants; +import com.dongjian.dashboard.back.common.language.msg.MsgLanguageChange; +import com.dongjian.dashboard.back.common.response.SimpleDataResponse; +import com.dongjian.dashboard.back.dao.ex.DeviceRawdataRealtimeMapperExt; +import com.dongjian.dashboard.back.service.OverviewService; +import com.dongjian.dashboard.back.service.common.CommonOpt; +import com.dongjian.dashboard.back.util.CommonUtil; +import com.dongjian.dashboard.back.vo.data.OverviewInfo; +import com.dongjian.dashboard.back.vo.data.OverviewVO; +import org.apache.commons.collections.CollectionUtils; +import org.apache.commons.lang3.StringUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.time.Clock; +import java.time.LocalDate; +import java.time.ZoneOffset; +import java.util.*; +import java.util.function.Function; +import java.util.stream.Collectors; + +@Service +public class OverviewServiceImpl implements OverviewService { + + private static final Logger logger = LoggerFactory.getLogger(OverviewServiceImpl.class); + + + + @Autowired + private DeviceRawdataRealtimeMapperExt deviceRawdataRealtimeMapperExt; + @Autowired + private MsgLanguageChange msgLanguageChange; + @Autowired + private CommonOpt commonOpt; + + @Override + public SimpleDataResponse> getOverviewInfo(Long userId, Long companyId, Integer languageType, Integer utcOffset) { + Map buildingMap = new HashMap<>(); + buildingMap.put("companyId", companyId); + buildingMap.put("bindBuildingIdList", commonOpt.getBindBuildingIdList(userId)); + + List buildingInfoList = deviceRawdataRealtimeMapperExt.getBuildingInfo(buildingMap); + + if (CollectionUtils.isNotEmpty(buildingInfoList)){ + Map paramMap = new HashMap<>(); + paramMap.put("companyId", companyId); + paramMap.put("typeIdList", Constants.CATEGORY_DEVICE_TYPE_MAP.get(Constants.CATEGORY_ALARM)); + List alarmInfoList = deviceRawdataRealtimeMapperExt.getOverviewInfo(paramMap); + List overviewVOList = convert(alarmInfoList, utcOffset); + + mergeOverviewList(buildingInfoList, overviewVOList); + } + + return SimpleDataResponse.success(buildingInfoList); + } + + public static void mergeOverviewList(List buildingInfoList, List overviewVOList) { + // 构建 buildingId 到 OverviewVO 的映射表 + Map overviewMap = overviewVOList.stream() + .filter(o -> o.getBuildingId() != null) + .collect(Collectors.toMap(OverviewVO::getBuildingId, Function.identity(), (a, b) -> b)); + + // 合并填充数据 + buildingInfoList.forEach(b -> { + OverviewVO match = overviewMap.get(b.getBuildingId()); + if (match != null) { + b.setAlarmCountAll(match.getAlarmCountAll()); + b.setAlarmCountToday(match.getAlarmCountToday()); + b.setMonitoringPointCategoryAlarmList(match.getMonitoringPointCategoryAlarmList()); + } + }); + } + + public static long getStartOfTodayWithOffset(int utcOffsetMinutes) { + utcOffsetMinutes = -utcOffsetMinutes; + // 通过 offset 构造 ZoneOffset(例如 -480 表示东八区) + ZoneOffset offset = ZoneOffset.ofTotalSeconds(utcOffsetMinutes * 60); + + // 使用该 offset 获取当前“该时区”的今天 + LocalDate localDate = LocalDate.now(Clock.system(ZoneOffset.UTC).withZone(offset)); + + // 该日期的 00:00(使用偏移量构造的 ZoneOffset) + return localDate.atStartOfDay(offset) + .toInstant() + .toEpochMilli(); + } + + public static List convert(List infoList, Integer utcOffset) { + if (infoList == null || infoList.isEmpty()) { + return Collections.emptyList(); + } + + // 获取今天起始时间(00:00) + long startOfToday = getStartOfTodayWithOffset(utcOffset); + + // 按 buildingId 分组 + Map> groupedByBuilding = infoList.stream() + .collect(Collectors.groupingBy(OverviewInfo::getBuildingId)); + + List result = new ArrayList<>(); + + for (Map.Entry> entry : groupedByBuilding.entrySet()) { + Long buildingId = entry.getKey(); + List buildingInfos = entry.getValue(); + + OverviewVO vo = new OverviewVO(); + vo.setBuildingId(buildingId); + vo.setBuildingName(buildingInfos.get(0).getBuildingName()); + + vo.setAlarmCountAll(buildingInfos.size()); + + long todayCount = buildingInfos.stream() + .filter(info -> info.getReceiveTs() != null && info.getReceiveTs() >= startOfToday) + .count(); + vo.setAlarmCountToday((int)todayCount); + + // 分组监测点分类 + List categoryAlarms = buildingInfos.stream() + .collect(Collectors.groupingBy(OverviewInfo::getMonitoringPointCategoryId)) + .entrySet() + .stream() + .map(e -> { + OverviewVO.MonitoringPointCategoryAlarm categoryAlarm = new OverviewVO.MonitoringPointCategoryAlarm(); + categoryAlarm.setMonitoringPointCategoryId(e.getKey()); + categoryAlarm.setMonitoringPointCategoryName(e.getValue().get(0).getMonitoringPointCategoryName()); + categoryAlarm.setAlarmCount(e.getValue().size()); + return categoryAlarm; + }) + .collect(Collectors.toList()); + + vo.setMonitoringPointCategoryAlarmList(categoryAlarms); + result.add(vo); + } + + //按 buildingId 倒序排列 + result.sort(Comparator.comparing(OverviewVO::getBuildingId).reversed()); + return result; + } +} diff --git a/dongjian-dashboard-back-service/src/main/java/com/dongjian/dashboard/back/service/impl/ProjectServiceImpl.java b/dongjian-dashboard-back-service/src/main/java/com/dongjian/dashboard/back/service/impl/ProjectServiceImpl.java new file mode 100644 index 0000000..fae0264 --- /dev/null +++ b/dongjian-dashboard-back-service/src/main/java/com/dongjian/dashboard/back/service/impl/ProjectServiceImpl.java @@ -0,0 +1,233 @@ +package com.dongjian.dashboard.back.service.impl; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +import org.apache.commons.lang3.StringUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.BeanUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.transaction.interceptor.TransactionAspectSupport; +import org.springframework.util.ObjectUtils; + +import com.github.pagehelper.PageHelper; +import com.dongjian.dashboard.back.common.exception.MsgCodeException; +import com.dongjian.dashboard.back.common.language.msg.MsgLanguageChange; +import com.dongjian.dashboard.back.common.response.PageInfo; +import com.dongjian.dashboard.back.common.response.ResponseCode; +import com.dongjian.dashboard.back.common.response.SimpleDataResponse; +import com.dongjian.dashboard.back.dao.ex.BasicProjectMapperExt; +import com.dongjian.dashboard.back.dto.project.DeleteProjectParams; +import com.dongjian.dashboard.back.dto.project.OptProjectParams; +import com.dongjian.dashboard.back.dto.project.ProjectSearchParams; +import com.dongjian.dashboard.back.model.BasicProject; +import com.dongjian.dashboard.back.service.ProjectService; +import com.dongjian.dashboard.back.service.common.CommonOpt; +import com.dongjian.dashboard.back.util.CommonUtil; +import com.dongjian.dashboard.back.vo.project.ProjectPageVO; + +/** + * + * @author jwy-style + * + */ +@Service +public class ProjectServiceImpl implements ProjectService { + + private static Logger logger = LoggerFactory.getLogger(ProjectServiceImpl.class); + + + @Autowired + private CommonOpt commonOpt; + @Autowired + private MsgLanguageChange msgLanguageChange; + @Autowired + private BasicProjectMapperExt basicProjectMapperExt; + + + @Override + @Transactional + public SimpleDataResponse add(OptProjectParams optProjectParams, Long userId, Long companyId, + Integer languageType) { + try { + optProjectParams.setProjectId(null); + /**一些校验操作**/ + try { + //校验企业,防止数据交叉操作其他企业 + if (ObjectUtils.isEmpty(optProjectParams.getCompanyId())) { + optProjectParams.setCompanyId(companyId); + } else { + checkCompany(optProjectParams, languageType, companyId); + } + + commonVerifyOpt(optProjectParams, companyId, languageType); + + } catch (MsgCodeException e) { + return new SimpleDataResponse(ResponseCode.MSG_ERROR, e.getMessage()); + } + + long currentUnix = System.currentTimeMillis(); + BasicProject basicProject = new BasicProject(); + BeanUtils.copyProperties(optProjectParams,basicProject); + basicProject.setId(null); + basicProject.setCreateTime(currentUnix); + basicProject.setCreatorId(userId); + basicProjectMapperExt.selfInsertSelective(basicProject); + + return SimpleDataResponse.success(); + } catch (Exception e) { + logger.error("新增项目出错", e); + TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); + return new SimpleDataResponse(ResponseCode.SERVER_ERROR, ResponseCode.SERVER_ERROR_MSG); + } + } + + private void commonVerifyOpt(OptProjectParams optProjectParams, Long companyId, Integer languageType) { + //校验参数 + checkParam(optProjectParams, languageType); + //项目重复校验 + checkExist(optProjectParams, languageType); + } + + private void checkCompany(OptProjectParams optProjectParams, Integer languageType, Long companyId) { + if (!commonOpt.isSubCompany(companyId, optProjectParams.getCompanyId())) { + throw new MsgCodeException(msgLanguageChange.getParameterMapByCode(languageType, "noOperationAuth")); + } + } + + private void checkExist(OptProjectParams optProjectParams, Integer languageType) { + if (basicProjectMapperExt.checkExist(optProjectParams) > 0) { + throw new MsgCodeException(msgLanguageChange.getParameterMapByCode(languageType, "projectNameHasExisted")); + } + } + + private void checkParam(OptProjectParams optProjectParams, Integer languageType) { + if(StringUtils.isBlank(optProjectParams.getProjectName()) || optProjectParams.getProjectName().length() > 100){ + throw new MsgCodeException("Parameter error [projectName]"); + } + } + + + @Override + @Transactional + public SimpleDataResponse edit(OptProjectParams optProjectParams, Long userId, Long companyId, + Integer languageType) { + try { + //编辑的时候,必须携带企业ID + if (ObjectUtils.isEmpty(optProjectParams.getCompanyId())) { + return new SimpleDataResponse(ResponseCode.MSG_ERROR, "Parameter error [companyId is null]"); + } + Map paramMap = new HashMap<>(); + paramMap.put("projectId", optProjectParams.getProjectId()); + paramMap.put("companyId", optProjectParams.getCompanyId()); + BasicProject oldBP = basicProjectMapperExt.selfSelectByPrimaryKey(paramMap); + //不存在这个项目, 这基本不可能,给个英文提示就行,省得翻译 + if (ObjectUtils.isEmpty(oldBP) || 1 == oldBP.getFlag()){ + return new SimpleDataResponse(ResponseCode.MSG_ERROR, "Not found"); + } + /**一些校验操作**/ + try { + List selfAndSubCompanyList = commonOpt.getSelfAndSubCompanyId(companyId); + //这个项目不属于自己权限企业 + if (!selfAndSubCompanyList.contains(oldBP.getCompanyId())){ + throw new MsgCodeException(msgLanguageChange.getParameterMapByCode(languageType, "noOperationAuth")); + } + + commonVerifyOpt(optProjectParams, companyId, languageType); + + } catch (MsgCodeException e) { + return new SimpleDataResponse(ResponseCode.MSG_ERROR, e.getMessage()); + } + + BasicProject basicProject = new BasicProject(); + BeanUtils.copyProperties(optProjectParams,basicProject); + basicProject.setModifierId(userId); + basicProject.setModifyTime(System.currentTimeMillis()); + basicProject.setId(optProjectParams.getProjectId()); + + basicProjectMapperExt.selfUpdateByPrimaryKeySelective(basicProject); + + return SimpleDataResponse.success(); + } catch (Exception e) { + logger.error("编辑项目出错", e); + TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); + return new SimpleDataResponse(ResponseCode.SERVER_ERROR, ResponseCode.SERVER_ERROR_MSG); + } + } + + + @Override + @Transactional + public SimpleDataResponse batchDelete(DeleteProjectParams deleteProjectParams, Long userId, + Long companyId, Integer languageType) { + if (StringUtils.isBlank(deleteProjectParams.getProjectIds())) { + return new SimpleDataResponse(ResponseCode.MSG_ERROR, "projectIds required"); + } + if (StringUtils.isBlank(deleteProjectParams.getCompanyIds())) { + return new SimpleDataResponse(ResponseCode.MSG_ERROR, "companyIds required"); + } + try { + List delCompanyIList = Arrays.asList(StringUtils.split(deleteProjectParams.getCompanyIds(), ",")).stream() + .map(id -> CommonUtil.String2Long(id.trim())).collect(Collectors.toList()); + List projectIdList = Arrays.asList(StringUtils.split(deleteProjectParams.getProjectIds(), ",")).stream() + .map(id -> CommonUtil.String2Long(id.trim())).collect(Collectors.toList()); + + if (delCompanyIList.size() != projectIdList.size()) { + throw new MsgCodeException("length error"); + } + + List selfAndSubCompanyList = commonOpt.getSelfAndSubCompanyId(companyId); + + for (int i = 0; i < projectIdList.size(); i++) { + if (!selfAndSubCompanyList.contains(delCompanyIList.get(i))) { + throw new MsgCodeException(msgLanguageChange.getParameterMapByCode(languageType, "noOperationAuth")); + } + BasicProject basicProject = new BasicProject(); + basicProject.setModifierId(userId); + basicProject.setModifyTime(System.currentTimeMillis()); + basicProject.setId(projectIdList.get(i)); + basicProject.setCompanyId(delCompanyIList.get(i)); + basicProject.setFlag(1); + basicProjectMapperExt.selfUpdateByPrimaryKeySelective(basicProject); + } + + return SimpleDataResponse.success(); + } catch (MsgCodeException e) { + return new SimpleDataResponse(ResponseCode.MSG_ERROR, e.getMessage()); + } catch (Exception e) { + logger.error("删除项目出错", e); + TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); + return new SimpleDataResponse(ResponseCode.SERVER_ERROR, ResponseCode.SERVER_ERROR_MSG); + } + } + + @Override + public PageInfo getListPage(ProjectSearchParams pageSearchParam, Long companyId, + Long userId, Integer languageType, Integer uTCOffset) { + if (null == pageSearchParam.getCompanyId()) { + pageSearchParam.setCompanyId(companyId); + } else { + List selfAndSubCompanyList = commonOpt.getSelfAndSubCompanyId(companyId); + //这个企业不属于自己权限企业 + if (!selfAndSubCompanyList.contains(pageSearchParam.getCompanyId())){ + return new PageInfo<>(new ArrayList<>()); + } + } + if (StringUtils.isNotBlank(pageSearchParam.getProjectIds())) { + pageSearchParam.setProjectIdList(CommonUtil.commaStr2LongList(pageSearchParam.getProjectIds())); + } + PageHelper.startPage(pageSearchParam.getPageNum() == null ? 1 : pageSearchParam.getPageNum(), pageSearchParam.getPageSize() == null ? 20 : pageSearchParam.getPageSize()); + List resultList = basicProjectMapperExt.getListPage(pageSearchParam); + + return new PageInfo<>(resultList); + } + +} diff --git a/dongjian-dashboard-back-service/src/main/java/com/dongjian/dashboard/back/service/impl/RoleServiceImpl.java b/dongjian-dashboard-back-service/src/main/java/com/dongjian/dashboard/back/service/impl/RoleServiceImpl.java new file mode 100644 index 0000000..737957a --- /dev/null +++ b/dongjian-dashboard-back-service/src/main/java/com/dongjian/dashboard/back/service/impl/RoleServiceImpl.java @@ -0,0 +1,309 @@ +package com.dongjian.dashboard.back.service.impl; + +import com.github.pagehelper.PageHelper; +import com.dongjian.dashboard.back.common.exception.MsgCodeException; +import com.dongjian.dashboard.back.common.language.msg.MsgLanguageChange; +import com.dongjian.dashboard.back.common.response.PageInfo; +import com.dongjian.dashboard.back.common.response.ResponseCode; +import com.dongjian.dashboard.back.common.response.SimpleDataResponse; +import com.dongjian.dashboard.back.dao.ex.BasicRoleMapperExt; +import com.dongjian.dashboard.back.dao.ex.BasicRoleMenuRelationMapperExt; +import com.dongjian.dashboard.back.dao.ex.BasicRoleUserRelationMapperExt; +import com.dongjian.dashboard.back.dao.ex.BasicUserMapperExt; +import com.dongjian.dashboard.back.dto.role.DeleteRoleParam; +import com.dongjian.dashboard.back.dto.role.OptRoleParam; +import com.dongjian.dashboard.back.dto.role.PageSearchParam; +import com.dongjian.dashboard.back.model.*; +import com.dongjian.dashboard.back.service.RoleService; +import com.dongjian.dashboard.back.service.common.CommonOpt; +import com.dongjian.dashboard.back.service.common.MenuTree; +import com.dongjian.dashboard.back.util.CommonUtil; +import com.dongjian.dashboard.back.vo.TreeMenusDTO; +import com.dongjian.dashboard.back.vo.role.RolePageDTO; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +import org.apache.commons.collections.CollectionUtils; +import org.apache.commons.lang3.ObjectUtils; +import org.apache.commons.lang3.StringUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.BeanUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.transaction.interceptor.TransactionAspectSupport; + +@Service +public class RoleServiceImpl implements RoleService { + + private static Logger logger = LoggerFactory.getLogger(RoleServiceImpl.class); + + @Autowired + private BasicRoleMapperExt basicRoleMapperExt; + @Autowired + private BasicRoleMenuRelationMapperExt basicRoleMenuRelationMapperExt; + @Autowired + private BasicRoleUserRelationMapperExt basicRoleUserRelationMapperExt; + @Autowired + private BasicUserMapperExt basicUserMapperExt; + @Autowired + private MsgLanguageChange msgLanguageChange; + + @Autowired + private CommonOpt commonOpt; + + + + @Override + @Transactional + public SimpleDataResponse add(OptRoleParam param, Long companyId, Long userId, Integer languageType) { + try { + param.setCompanyId(companyId); + param.setRoleId(null); + //校验参数 + SimpleDataResponse checkResult = checkParam(param, languageType); + if (200 != checkResult.getCode()) { + return checkResult; + } + //重复校验 + if (checkExist(param) > 0) { + return new SimpleDataResponse(ResponseCode.MSG_ERROR, msgLanguageChange.getParameterMapByCode(languageType, "roleNameExist")); + } + + long currentUnix = System.currentTimeMillis(); + BasicRole basicRole = new BasicRole(); + BeanUtils.copyProperties(param, basicRole); + basicRole.setCreatorId(userId); + basicRole.setCreateTime(currentUnix); + basicRole.setModifierId(userId); + basicRole.setModifyTime(currentUnix); + basicRole.setCompanyId(companyId); + basicRoleMapperExt.insertSelective(basicRole); + + insertRoleMenuRelation(companyId, userId, currentUnix, basicRole.getId(), param.getMenuIds()); + + return SimpleDataResponse.success(); + } catch (Exception e) { + logger.error("添加角色报错", e); + TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); + return new SimpleDataResponse(ResponseCode.SERVER_ERROR, e.getMessage()); + } + } + + + + private void insertRoleMenuRelation(Long companyId, Long userId, long currentUnix, Long roleId, String menuIds) { + if (StringUtils.isNoneBlank(menuIds)) { + //把无效的id去掉 + menuIds = filterMenuIds(companyId, userId, menuIds); + if (StringUtils.isBlank(menuIds)) { + return; + } + //先删除原有的角色ID + Map deleteMap = new HashMap<>(); + deleteMap.put("roleId", roleId); + basicRoleMenuRelationMapperExt.deleteDashboardRelation(deleteMap); + //重新插入关联关系 + List idList = Arrays.asList(menuIds.split(",")).stream().map(s -> Long.parseLong(s.trim())).collect(Collectors.toList()); + Map paramMap = new HashMap(); + paramMap.put("roleId", roleId); + paramMap.put("menuIds", idList); + paramMap.put("creatorId", userId); + paramMap.put("createTime", currentUnix); + basicRoleMenuRelationMapperExt.batchInsert(paramMap); + } + } + + + private String filterMenuIds(Long companyId, Long userId, String menuIds) { + BasicUser basicUser = basicUserMapperExt.selectByPrimaryKey(userId); + List menuList = dbGetOwnMenuIds(companyId, userId, basicUser.getSuperRole(), 0); + if (CollectionUtils.isEmpty(menuList)) { + return null; + } + List allowMenuIdList = menuList.stream().map(t-> Long.valueOf(t.getKey())).collect(Collectors.toList()); + if (StringUtils.isNotBlank(menuIds)) { + List needProcessedIdList = CommonUtil.commaStr2LongList(menuIds); + List finalIdList = needProcessedIdList.stream().filter(allowMenuIdList::contains).collect(Collectors.toList()); + return StringUtils.join(finalIdList, ","); + } + return null; + } + + + + private long checkExist(OptRoleParam param) { + return basicRoleMapperExt.checkExist(param); + } + + + private SimpleDataResponse checkParam(OptRoleParam param, Integer languageType) { + if(StringUtils.isBlank(param.getRoleName()) || param.getRoleName().length() > 100){ + return new SimpleDataResponse(ResponseCode.MSG_ERROR, "Parameter [roleName] error"); + } + if(StringUtils.isBlank(param.getMenuIds())){ + return new SimpleDataResponse(ResponseCode.MSG_ERROR, "menuIds can not be null"); + } + return SimpleDataResponse.success(); + } + + + @Override + @Transactional + public SimpleDataResponse edit(OptRoleParam param, Long companyId, Long userId, Integer languageType) { + try { +// param.setCompanyId(companyId); + //校验参数 + SimpleDataResponse checkResult = checkParam(param, languageType); + if (200 != checkResult.getCode()) { + return checkResult; + } + + BasicRole oldBR = basicRoleMapperExt.selectByPrimaryKey(param.getRoleId()); + //不存在, 这基本不可能,给个英文提示就行,省得翻译 + if (ObjectUtils.isEmpty(oldBR) || 1 == oldBR.getFlag()){ + return new SimpleDataResponse(ResponseCode.MSG_ERROR, "Not found"); + } + /**一些权限校验操作**/ + try { + List selfAndSubCompanyList = commonOpt.getSelfAndSubCompanyId(companyId); + //编辑的角色不属于自己所管的企业 + if (!selfAndSubCompanyList.contains(oldBR.getCompanyId())){ + throw new MsgCodeException(msgLanguageChange.getParameterMapByCode(languageType, "noOperationAuth")); + } + } catch (MsgCodeException e) { + return new SimpleDataResponse(ResponseCode.MSG_ERROR, e.getMessage()); + } + + //重复校验 + if (checkExist(param) > 0) { + return new SimpleDataResponse(ResponseCode.MSG_ERROR, msgLanguageChange.getParameterMapByCode(languageType, "roleNameExist")); + } + + long currentUnix = System.currentTimeMillis(); + BasicRole basicRole = new BasicRole(); + BeanUtils.copyProperties(param, basicRole); + basicRole.setId(param.getRoleId()); + basicRole.setModifierId(userId); + basicRole.setModifyTime(currentUnix); + basicRoleMapperExt.updateByPrimaryKeySelective(basicRole); + + insertRoleMenuRelation(companyId, userId, currentUnix, basicRole.getId(), param.getMenuIds()); + + return SimpleDataResponse.success(); + } catch (Exception e) { + logger.error("编辑角色报错", e); + TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); + return new SimpleDataResponse(ResponseCode.SERVER_ERROR, e.getMessage()); + } + } + + + + @Override + @Transactional + public SimpleDataResponse batchDelete(DeleteRoleParam deleteRoleParam, Long companyId, Long userId, + Integer languageType) { + try { + List idList = Arrays.asList(deleteRoleParam.getRoleIds().split(",")).stream().map(s -> Long.parseLong(s.trim())).collect(Collectors.toList()); + //先判断该角色有没有用户绑定 + BasicRoleUserRelationExample basicRoleUserRelationExample = new BasicRoleUserRelationExample(); + BasicRoleUserRelationExample.Criteria criteria = basicRoleUserRelationExample.createCriteria(); + criteria.andRoleIdIn(idList); + if (basicRoleUserRelationMapperExt.countByExample(basicRoleUserRelationExample) > 0) { + return new SimpleDataResponse(ResponseCode.MSG_ERROR, msgLanguageChange.getParameterMapByCode(languageType, "roleHasBinded")); + } + //基础表删除 + BasicRoleExample basicRoleExample = new BasicRoleExample(); + BasicRoleExample.Criteria basicRoleCriteria = basicRoleExample.createCriteria(); + basicRoleCriteria.andIdIn(idList).andCompanyIdIn(commonOpt.getSelfAndSubCompanyId(companyId)); + + BasicRole basicRole = new BasicRole(); + basicRole.setFlag(1); + + basicRoleMapperExt.updateByExampleSelective(basicRole, basicRoleExample); + + //删除用户-角色关联表 + BasicRoleUserRelationExample deleteRoleUserRelationExample = new BasicRoleUserRelationExample(); + BasicRoleUserRelationExample.Criteria deleteCriteria = deleteRoleUserRelationExample.createCriteria(); + deleteCriteria.andRoleIdIn(idList); + basicRoleUserRelationMapperExt.deleteByExample(deleteRoleUserRelationExample); + + //删除菜单-角色关联表 + BasicRoleMenuRelationExample deleteRoleMenuRelationExample = new BasicRoleMenuRelationExample(); + BasicRoleMenuRelationExample.Criteria deleteMenuCriteria = deleteRoleMenuRelationExample.createCriteria(); + deleteMenuCriteria.andRoleIdIn(idList); + basicRoleMenuRelationMapperExt.deleteByExample(deleteRoleMenuRelationExample); + + return SimpleDataResponse.success(); + } catch (Exception e) { + logger.error("删除角色报错", e); + TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); + return new SimpleDataResponse(ResponseCode.SERVER_ERROR, e.getMessage()); + } + } + + + + @Override + public SimpleDataResponse> getOwnMenuIds(Long companyId, Long userId, Integer languageType) { + BasicUser basicUser = basicUserMapperExt.selectByPrimaryKey(userId); + List menuList = dbGetOwnMenuIds(companyId, userId, basicUser.getSuperRole(), languageType); + if (CollectionUtils.isNotEmpty(menuList)) { + MenuTree menuTree =new MenuTree(menuList); + menuList=menuTree.buildTree("-1"); + return SimpleDataResponse.success(menuList); + } else { + return SimpleDataResponse.success(new ArrayList()); + } + } + + + + private List dbGetOwnMenuIds(Long companyId, Long userId, Integer superRole, Integer languageType) { + Map paramMap = new HashMap(); + paramMap.put("userId", userId); + paramMap.put("superRole", superRole); + paramMap.put("companyId", companyId); + paramMap.put("languageType", languageType); + return basicRoleMapperExt.getOwnMenuIds(paramMap); + } + + + + @Override + public SimpleDataResponse getMenuIdsByRoleId(Long roleId, Long companyId, Long userId, + Integer languageType) { + try { + return SimpleDataResponse.success(basicRoleMenuRelationMapperExt.getMenuIdsByRoleId(roleId)); + } catch (Exception e) { + logger.error("获取角色菜单出错", e); + return new SimpleDataResponse(ResponseCode.SERVER_ERROR, e.getMessage()); + } + } + + + + @Override + public PageInfo getListPage(PageSearchParam pageSearchParam, Long companyId, Long userId, + Integer languageType) { + //list防${}注入 + if (StringUtils.isBlank(pageSearchParam.getCompanyIds())) { + pageSearchParam.setCompanyIdList(commonOpt.getSelfAndSubCompanyId(companyId)); + } else { + pageSearchParam.setCompanyIdList(commonOpt.filterCompanyIds(companyId, pageSearchParam.getCompanyIds())); + } + + + PageHelper.startPage(pageSearchParam.getPageNum() == null ? 1 : pageSearchParam.getPageNum(), pageSearchParam.getPageSize() == null ? 20 : pageSearchParam.getPageSize()); + List resultList = basicRoleMapperExt.getListPage(pageSearchParam); + return new PageInfo<>(resultList); + } + +} diff --git a/dongjian-dashboard-back-service/src/main/java/com/dongjian/dashboard/back/service/impl/S3FileServiceImpl.java b/dongjian-dashboard-back-service/src/main/java/com/dongjian/dashboard/back/service/impl/S3FileServiceImpl.java new file mode 100644 index 0000000..9727c43 --- /dev/null +++ b/dongjian-dashboard-back-service/src/main/java/com/dongjian/dashboard/back/service/impl/S3FileServiceImpl.java @@ -0,0 +1,83 @@ +package com.dongjian.dashboard.back.service.impl; + +import com.dongjian.dashboard.back.common.Constants; +import com.dongjian.dashboard.back.common.response.ResponseCode; +import com.dongjian.dashboard.back.common.response.SimpleDataResponse; +import com.dongjian.dashboard.back.service.S3FileService; +import com.dongjian.dashboard.back.util.DESUtil; +import com.dongjian.dashboard.back.vo.s3.TemporaryCredentials; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.stereotype.Service; +import software.amazon.awssdk.auth.credentials.AwsBasicCredentials; +import software.amazon.awssdk.auth.credentials.AwsCredentials; +import software.amazon.awssdk.auth.credentials.StaticCredentialsProvider; +import software.amazon.awssdk.regions.Region; +import software.amazon.awssdk.services.sts.StsClient; +import software.amazon.awssdk.services.sts.model.AssumeRoleRequest; +import software.amazon.awssdk.services.sts.model.AssumeRoleResponse; +import software.amazon.awssdk.services.sts.model.Credentials; + +@Service +public class S3FileServiceImpl implements S3FileService { + + private static final Logger logger = LoggerFactory.getLogger(S3FileServiceImpl.class); + + + @Value("${amazon.aws.accesskey}") + private String awsAccessKeyId; + + @Value("${amazon.aws.secretkey}") + private String awsAccessSecret; + + @Value("${amazon.aws.actionable.region}") + private String awsActionableRegion; + + @Value("${amazon.aws.actionable.bucket}") + private String awsActionableBucket; + + @Value("${amazon.aws.actionable.directory}") + private String awsActionableDirectory; + + @Value("${amazon.aws.actionable.roleArn}") + private String awsActionableRoleArn; + + + + public SimpleDataResponse getTemporaryCredentials() { + TemporaryCredentials tempCredentials = new TemporaryCredentials(); + try { + AwsCredentials credentials = AwsBasicCredentials.create( + DESUtil.decrypt(awsAccessKeyId, Constants.DES_SALT), + DESUtil.decrypt(awsAccessSecret, Constants.DES_SALT)); + StsClient stsClient = StsClient.builder() + .region(Region.of(awsActionableRegion)) + .credentialsProvider(StaticCredentialsProvider.create(credentials)) + .build(); + + AssumeRoleRequest roleRequest = AssumeRoleRequest.builder() + .roleArn(awsActionableRoleArn) + .roleSessionName("frontend-session") + .durationSeconds(3600)//最大是12小时,最小15分钟,但是这里受【角色-最大会话持续时间】时间限制 + .build(); + + AssumeRoleResponse response = stsClient.assumeRole(roleRequest); + Credentials temp = response.credentials(); + + tempCredentials.setAccessKeyId(temp.accessKeyId()); + tempCredentials.setSecretAccessKey(temp.secretAccessKey()); + tempCredentials.setSessionToken(temp.sessionToken()); + tempCredentials.setRegion(awsActionableRegion); + tempCredentials.setBucketName(awsActionableBucket); + tempCredentials.setBasePrefix(awsActionableDirectory); + + return SimpleDataResponse.success(tempCredentials); + } catch (Exception e){ + logger.error("getTemporaryCredentials error", e); + return SimpleDataResponse.fail(ResponseCode.SERVER_ERROR, ResponseCode.SERVER_ERROR_MSG); + } + + } + +} diff --git a/dongjian-dashboard-back-service/src/main/java/com/dongjian/dashboard/back/service/impl/UserServiceImpl.java b/dongjian-dashboard-back-service/src/main/java/com/dongjian/dashboard/back/service/impl/UserServiceImpl.java new file mode 100644 index 0000000..bff70e6 --- /dev/null +++ b/dongjian-dashboard-back-service/src/main/java/com/dongjian/dashboard/back/service/impl/UserServiceImpl.java @@ -0,0 +1,409 @@ +package com.dongjian.dashboard.back.service.impl; + +import com.github.pagehelper.PageHelper; +import com.dongjian.dashboard.back.common.exception.MsgCodeException; +import com.dongjian.dashboard.back.common.language.msg.MsgLanguageChange; +import com.dongjian.dashboard.back.common.response.PageInfo; +import com.dongjian.dashboard.back.common.response.ResponseCode; +import com.dongjian.dashboard.back.common.response.SimpleDataResponse; +import com.dongjian.dashboard.back.dao.ex.BasicCompanyMapperExt; +import com.dongjian.dashboard.back.dao.ex.BasicRoleUserRelationMapperExt; +import com.dongjian.dashboard.back.dao.ex.BasicUserMapperExt; +import com.dongjian.dashboard.back.dto.user.DeleteUserParam; +import com.dongjian.dashboard.back.dto.user.ModifyPassword; +import com.dongjian.dashboard.back.dto.user.OptUserParam; +import com.dongjian.dashboard.back.dto.user.PageSearchParam; +import com.dongjian.dashboard.back.dto.user.ResetPassword; +import com.dongjian.dashboard.back.dto.user.SwitchMfaBind; +import com.dongjian.dashboard.back.model.BasicCompany; +import com.dongjian.dashboard.back.model.BasicRole; +import com.dongjian.dashboard.back.model.BasicRoleUserRelation; +import com.dongjian.dashboard.back.model.BasicRoleUserRelationExample; +import com.dongjian.dashboard.back.model.BasicUser; +import com.dongjian.dashboard.back.model.BasicUserExample; +import com.dongjian.dashboard.back.service.UserService; +import com.dongjian.dashboard.back.service.common.CommonOpt; +import com.dongjian.dashboard.back.util.CommonUtil; +import com.dongjian.dashboard.back.util.DESUtil; +import com.dongjian.dashboard.back.util.RandomNumberUtil; +import com.dongjian.dashboard.back.util.async.OptAsync; +import com.dongjian.dashboard.back.util.redis.RedisUtil; +import com.dongjian.dashboard.back.vo.user.UserPageDTO; + +import java.text.MessageFormat; +import java.util.Arrays; +import java.util.List; +import java.util.Objects; +import java.util.regex.Pattern; +import java.util.stream.Collectors; + +import org.apache.commons.collections.CollectionUtils; +import org.apache.commons.lang3.ObjectUtils; +import org.apache.commons.lang3.StringUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.BeanUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.transaction.interceptor.TransactionAspectSupport; + +@Service +public class UserServiceImpl implements UserService { + + private static Logger logger = LoggerFactory.getLogger(UserServiceImpl.class); + + //同时含大写字母、小写字母、数字和特殊字符且长度大于8 + private static final String pwdPattern = "^(?=.*\\d)(?=.*[a-zA-Z])(?=.*[~!@#$%^&*])[\\da-zA-Z~!@#$%^&*]{12,}$"; + + + @Value("${web.login.url}") + private String webLoginUrl; + + @Value("${web.admin.login.url}") + private String webAdminLoginUrl; + + @Autowired + private RedisUtil redisUtil; + @Autowired + private OptAsync optAsync; + @Autowired + private CommonOpt commonOpt; + @Autowired + private BasicUserMapperExt basicUserMapperExt; + @Autowired + private BasicRoleUserRelationMapperExt basicRoleUserRelationMapperExt; + @Autowired + private MsgLanguageChange msgLanguageChange; + @Autowired + private BasicCompanyMapperExt basicCompanyMapperExt; + + + @Override + @Transactional + public SimpleDataResponse add(OptUserParam param, Long companyId, Long userId, Integer languageType) { + try { +// if (StringUtils.isBlank(param.getLoginName())) { + param.setLoginName(param.getUsername()); +// } +// if (1 != companyId.intValue()) {//非顶级账号 + param.setCompanyId(companyId); +// } else +// if (null == param.getCompanyId()) {//admin账号必须能选择企业归属 +// return new SimpleDataResponse(ResponseCode.MSG_ERROR, "companyId is required"); +// } + + param.setUserId(null); + //校验参数 + SimpleDataResponse checkResult = checkParam(param, languageType); + if (200 != checkResult.getCode()) { + return checkResult; + } + //重复校验 + if (checkExist(param) > 0) { + return new SimpleDataResponse(ResponseCode.MSG_ERROR, msgLanguageChange.getParameterMapByCode(languageType, "loginNameOrEmailHasExisted")); + } + + long currentUnix = System.currentTimeMillis(); + BasicUser basicUser = new BasicUser(); + BeanUtils.copyProperties(param, basicUser); + basicUser.setCreatorId(userId); + basicUser.setCreateTime(currentUnix); + basicUser.setModifierId(userId); + basicUser.setModifyTime(currentUnix); +// basicUser.setCompanyId(companyId); + basicUser.setSalt(RandomNumberUtil.createRandomLowerLetterAndNumber(10)); + String rawPwd = generateRandomPwd(); + basicUser.setPassword(DESUtil.encrypt(rawPwd, basicUser.getSalt())); + basicUser.setUserType(2); + + basicUserMapperExt.insertSelective(basicUser); + + insertUserRoleRelation(userId, currentUnix, basicUser.getId(), param.getRoleId()); + + BasicCompany basicCompany = basicCompanyMapperExt.selectByPrimaryKey(basicUser.getCompanyId()); + + //邮箱通知密码 + String loginUrl = webLoginUrl; + if(1 == param.getUserType()) { + loginUrl = webAdminLoginUrl; + } + optAsync.doSendWork( + msgLanguageChange.getParameterMapByCode(languageType, "mailAddUserPwdSubject") + "【" + basicCompany.getCompanyName() +"】", + MessageFormat.format(msgLanguageChange.getParameterMapByCode(languageType, "mailAddUserPwdContent"), basicUser.getLoginName(), rawPwd, loginUrl), + basicUser.getEmail(), + null); + + return SimpleDataResponse.success(); + } catch (Exception e) { + logger.error("添加用户报错", e); + TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); + return new SimpleDataResponse(ResponseCode.SERVER_ERROR, e.getMessage()); + } + } + + + private void insertUserRoleRelation(Long creatorId, long currentUnix, Long userId, Long roleId) { + //先删除原有的关联关系 + if (!Objects.isNull(userId)) { + BasicRoleUserRelationExample basicRoleUserRelationExample = new BasicRoleUserRelationExample(); + BasicRoleUserRelationExample.Criteria criteria = basicRoleUserRelationExample.createCriteria(); + criteria.andUserIdEqualTo(userId); + basicRoleUserRelationMapperExt.deleteByExample(basicRoleUserRelationExample); + } + //重新插入关联关系 + if (!Objects.isNull(userId) && !Objects.isNull(roleId)) { + BasicRoleUserRelation basicRoleUserRelation = new BasicRoleUserRelation(); + basicRoleUserRelation.setCreateTime(currentUnix); + basicRoleUserRelation.setCreatorId(creatorId); + basicRoleUserRelation.setRoleId(roleId); + basicRoleUserRelation.setUserId(userId); + basicRoleUserRelationMapperExt.insertSelective(basicRoleUserRelation); + } + } + + + private Long checkExist(OptUserParam param) { + return basicUserMapperExt.checkExist(param); + } + + + private SimpleDataResponse checkParam(OptUserParam param, Integer languageType) { + if(StringUtils.isBlank(param.getEmail()) || param.getEmail().length() > 100){ + return new SimpleDataResponse(ResponseCode.MSG_ERROR, "Parameter [email] error"); + } + if(StringUtils.isBlank(param.getLoginName()) || param.getLoginName().length() > 100){ + return new SimpleDataResponse(ResponseCode.MSG_ERROR, "Parameter [loginName] error"); + } + if(StringUtils.isBlank(param.getUsername()) || param.getUsername().length() > 100){ + return new SimpleDataResponse(ResponseCode.MSG_ERROR, "Parameter [username] error"); + } +// if(StringUtils.isNotBlank(param.getMobileNumber()) && (!param.getMobileNumber().startsWith("+") || param.getMobileNumber().split("-").length != 2)){ +// return new SimpleDataResponse(ResponseCode.MSG_ERROR, "Parameter [mobileNumber] error"); +// } + if(null == param.getUserType() || param.getUserType().intValue() < 1 || param.getUserType().intValue() > 2){ + return new SimpleDataResponse(ResponseCode.MSG_ERROR, "Parameter [userType] error"); + } + return SimpleDataResponse.success(); + } + + + @Override + public SimpleDataResponse edit(OptUserParam param, Long companyId, Long userId, Integer languageType) { + try { +// if (StringUtils.isBlank(param.getLoginName())) { + param.setLoginName(param.getUsername()); +// } +// if (1 != companyId.intValue()) {//非顶级账号 +// param.setCompanyId(companyId); +// } else + if (null == param.getCompanyId()) {//admin账号必须能选择企业归属 + return new SimpleDataResponse(ResponseCode.MSG_ERROR, "companyId is required"); + } + //校验参数 + SimpleDataResponse checkResult = checkParam(param, languageType); + if (200 != checkResult.getCode()) { + return checkResult; + } + + BasicUser oldBU = basicUserMapperExt.selectByPrimaryKey(param.getUserId()); + //不存在, 这基本不可能,给个英文提示就行,省得翻译 + if (ObjectUtils.isEmpty(oldBU) || 1 == oldBU.getFlag()){ + return new SimpleDataResponse(ResponseCode.MSG_ERROR, "Not found"); + } + /**一些权限校验操作**/ + try { + List selfAndSubCompanyList = commonOpt.getSelfAndSubCompanyId(companyId); + //编辑的用户不属于自己所管的企业 + if (!selfAndSubCompanyList.contains(oldBU.getCompanyId())){ + throw new MsgCodeException(msgLanguageChange.getParameterMapByCode(languageType, "noOperationAuth")); + } + } catch (MsgCodeException e) { + return new SimpleDataResponse(ResponseCode.MSG_ERROR, e.getMessage()); + } + + //重复校验 + if (checkExist(param) > 0) { + return new SimpleDataResponse(ResponseCode.MSG_ERROR, msgLanguageChange.getParameterMapByCode(languageType, "loginNameOrEmailHasExisted")); + } + + long currentUnix = System.currentTimeMillis(); + BasicUser basicUser = new BasicUser(); + BeanUtils.copyProperties(param, basicUser); + basicUser.setId(param.getUserId()); + basicUser.setModifierId(userId); + basicUser.setModifyTime(currentUnix); + basicUser.setUserType(2); +// basicUser.setCompanyId(companyId); + if (StringUtils.isBlank(param.getMobileNumber())) { + basicUser.setMobileNumber(""); + } + basicUserMapperExt.updateByPrimaryKeySelective(basicUser); + + insertUserRoleRelation(userId, currentUnix, basicUser.getId(), param.getRoleId()); + + return SimpleDataResponse.success(); + } catch (Exception e) { + logger.error("编辑用户报错", e); + TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); + return new SimpleDataResponse(ResponseCode.SERVER_ERROR, e.getMessage()); + } + } + + + @Override + public SimpleDataResponse batchDelete(DeleteUserParam deleteUserParam, Long companyId, Long userId, + Integer languageType) { + try { + //基础表删除 + List idList = Arrays.asList(deleteUserParam.getUserIds().split(",")).stream().map(s -> Long.parseLong(s.trim())).collect(Collectors.toList()); + + BasicUserExample basicUserExample = new BasicUserExample(); + BasicUserExample.Criteria criteria = basicUserExample.createCriteria(); + criteria.andIdIn(idList).andCompanyIdIn(commonOpt.getSelfAndSubCompanyId(companyId)); + + BasicUser basicUser = new BasicUser(); + basicUser.setFlag(1); + + basicUserMapperExt.updateByExampleSelective(basicUser, basicUserExample); + + //删除用户-角色关联表 +// BasicRoleUserRelationExample deleteRoleUserRelationExample = new BasicRoleUserRelationExample(); +// BasicRoleUserRelationExample.Criteria deleteCriteria = deleteRoleUserRelationExample.createCriteria(); +// deleteCriteria.andUserIdIn(idList); +// basicRoleUserRelationMapperExt.deleteByExample(deleteRoleUserRelationExample); + + return SimpleDataResponse.success(); + } catch (Exception e) { + logger.error("删除用户报错", e); + TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); + return new SimpleDataResponse(ResponseCode.SERVER_ERROR, e.getMessage()); + } + } + + + @Override + public PageInfo getListPage(PageSearchParam pageSearchParam, Long companyId, Long userId, + Integer languageType) { + //list防${}注入 + if (StringUtils.isBlank(pageSearchParam.getCompanyIds())) { + pageSearchParam.setCompanyIdList(commonOpt.getSelfAndSubCompanyId(companyId)); + } else { + pageSearchParam.setCompanyIdList(commonOpt.filterCompanyIds(companyId, pageSearchParam.getCompanyIds())); + } + PageHelper.startPage(pageSearchParam.getPageNum() == null ? 1 : pageSearchParam.getPageNum(), pageSearchParam.getPageSize() == null ? 20 : pageSearchParam.getPageSize()); + List resultList = basicUserMapperExt.getListPage(pageSearchParam); + return new PageInfo<>(resultList); + } + + + @Override + public SimpleDataResponse batchResetPassword(ResetPassword resetPassword, Long companyId, Long userId, + Integer languageType) { + if (StringUtils.isBlank(resetPassword.getUserIds())) { + return SimpleDataResponse.success(); + } + try { + List ids = Arrays.asList(StringUtils.split(resetPassword.getUserIds(), ",")).stream() + .map(id -> CommonUtil.String2Long(id.trim())).collect(Collectors.toList()); + BasicUserExample basicUserExample = new BasicUserExample(); + BasicUserExample.Criteria criteria = basicUserExample.createCriteria(); + criteria.andCompanyIdIn(commonOpt.getSelfAndSubCompanyId(companyId)).andIdIn(ids); + + List userList = basicUserMapperExt.selectByExample(basicUserExample); + if (CollectionUtils.isNotEmpty(userList)) { + long currentUnix = System.currentTimeMillis(); + for (BasicUser basicUser : userList) { + String rawPwd = generateRandomPwd(); + basicUser.setPassword(DESUtil.encrypt(rawPwd, basicUser.getSalt())); +// basicUser.setPasswordModifyTime(currentUnix); + basicUserMapperExt.updateByPrimaryKeySelective(basicUser); + + BasicCompany basicCompany = basicCompanyMapperExt.selectByPrimaryKey(basicUser.getCompanyId()); + + //邮箱通知密码 + String loginUrl = webLoginUrl; + if(1 == basicUser.getUserType()) { + loginUrl = webAdminLoginUrl; + } + optAsync.doSendWork( + msgLanguageChange.getParameterMapByCode(languageType, "mailResetUserPwdSubject") + "【" + basicCompany.getCompanyName() +"】", + MessageFormat.format(msgLanguageChange.getParameterMapByCode(languageType, "mailAddUserPwdContent"), basicUser.getLoginName(), rawPwd, loginUrl), + basicUser.getEmail(), + null); + } + } + + return SimpleDataResponse.success(); + } catch (Exception e) { + logger.error("重置密码出错", e); + return new SimpleDataResponse(ResponseCode.SERVER_ERROR, ResponseCode.SERVER_ERROR_MSG); + } + } + + + private String generateRandomPwd() { + return RandomNumberUtil.createRandomLowerLetterAndNumber(6) + +"!gM@" + + RandomNumberUtil.createRandomLowerLetterAndNumber(6); + } + + + @Override + public SimpleDataResponse modifyPassword(ModifyPassword modifyPassword, Long companyId, Long userId, + Integer languageType) { + try { + if (!Pattern.matches(pwdPattern, modifyPassword.getNewPassword())) { + return new SimpleDataResponse(ResponseCode.MSG_ERROR, msgLanguageChange.getParameterMapByCode(languageType, "pwdFormatError")); + } + BasicUser basicUser = basicUserMapperExt.selectByPrimaryKey(userId); + if (!DESUtil.encrypt(modifyPassword.getOldPassword(), basicUser.getSalt()).equals(basicUser.getPassword())) { + return new SimpleDataResponse(ResponseCode.MSG_ERROR, msgLanguageChange.getParameterMapByCode(languageType, "oldPwdError")); + } + String newPwd = DESUtil.encrypt(modifyPassword.getNewPassword(), basicUser.getSalt()); + if (newPwd.equals(basicUser.getPassword())) { + return new SimpleDataResponse(ResponseCode.MSG_ERROR, msgLanguageChange.getParameterMapByCode(languageType, "newPwdSameOld")); + } + basicUser.setPassword(newPwd); + basicUser.setModifyTime(System.currentTimeMillis()); +// basicUser.setPasswordModifyTime(basicUser.getModifyTime()); + basicUserMapperExt.updateByPrimaryKeySelective(basicUser); + + return SimpleDataResponse.success(); + } catch (Exception e) { + logger.error("modifyPassword出错",e); + return new SimpleDataResponse(ResponseCode.SERVER_ERROR, ResponseCode.SERVER_ERROR_MSG); + } + } + + + @Override + public SimpleDataResponse unbindMfa(SwitchMfaBind switchMfaBind, Long companyId, Long userId, + Integer languageType) { + if (StringUtils.isBlank(switchMfaBind.getUserIds())) { + return SimpleDataResponse.success(); + } + try { + //基础表 + List idList = Arrays.asList(switchMfaBind.getUserIds().split(",")).stream().map(s -> Long.parseLong(s.trim())).collect(Collectors.toList()); + + BasicUserExample basicUserExample = new BasicUserExample(); + BasicUserExample.Criteria criteria = basicUserExample.createCriteria(); + criteria.andIdIn(idList).andCompanyIdIn(commonOpt.getSelfAndSubCompanyId(companyId)); + + BasicUser basicUser = new BasicUser(); + basicUser.setMfaBind(0); + basicUser.setMfaSecret(""); + + basicUserMapperExt.updateByExampleSelective(basicUser, basicUserExample); + + return SimpleDataResponse.success(); + } catch (Exception e) { + logger.error("解绑用户mfa设备报错", e); + TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); + return new SimpleDataResponse(ResponseCode.SERVER_ERROR, e.getMessage()); + } + } + +} diff --git a/dongjian-dashboard-back-service/src/test/java/com/dongjian/dashboard/back/service/impl/JsonsTests.java b/dongjian-dashboard-back-service/src/test/java/com/dongjian/dashboard/back/service/impl/JsonsTests.java new file mode 100644 index 0000000..2f3521c --- /dev/null +++ b/dongjian-dashboard-back-service/src/test/java/com/dongjian/dashboard/back/service/impl/JsonsTests.java @@ -0,0 +1,21 @@ +package com.dongjian.dashboard.back.service.impl; + +import java.util.HashMap; +import java.util.Map; + +import com.alibaba.fastjson.JSON; +import org.junit.Test; + +public class JsonsTests { + + @Test + public void testJson(){ + Map jsonMap=new HashMap<>(); + + jsonMap.put("a", "1"); + jsonMap.put("b", "2"); + String jsonValue="{\"a\":\"1\",\"b\":\"2\"}"; + System.out.println(JSON.toJSONString(jsonMap)); + + } +} diff --git a/dongjian-dashboard-back-util/.gitignore b/dongjian-dashboard-back-util/.gitignore new file mode 100644 index 0000000..aa23915 --- /dev/null +++ b/dongjian-dashboard-back-util/.gitignore @@ -0,0 +1,15 @@ +/target/ +/logs/ +/.idea/ +*.iml +*.bak +*.log +/.settings/ +*.project +*.classpath +*.factorypath +*.springBeans +/.apt_generated/ +/.externalToolBuilders/ +/bin/ +application-*.properties diff --git a/dongjian-dashboard-back-util/pom.xml b/dongjian-dashboard-back-util/pom.xml new file mode 100644 index 0000000..47871f2 --- /dev/null +++ b/dongjian-dashboard-back-util/pom.xml @@ -0,0 +1,87 @@ + + + 4.0.0 + + com.techsor + dongjian-dashboard-back + 0.0.1-SNAPSHOT + + dongjian-dashboard-back-util + dongjian-dashboard-back-util + http://maven.apache.org + + UTF-8 + + + + junit + junit + test + + + + + org.springframework.boot + spring-boot-starter-mobile + 1.5.22.RELEASE + + + + org.springframework.boot + spring-boot-starter-data-redis + + + + org.apache.commons + commons-lang3 + + + org.apache.commons + commons-pool2 + + + commons-collections + commons-collections + 3.2.2 + + + com.alibaba + fastjson + 2.0.7.graal + + + + org.dom4j + dom4j + 2.1.3 + + + + commons-io + commons-io + 2.11.0 + + + + com.google.code.gson + gson + 2.9.0 + + + + javax.mail + mail + 1.5.0-b01 + + + + + software.amazon.awssdk + sts + 2.32.2 + compile + + + + diff --git a/dongjian-dashboard-back-util/src/main/java/com/dongjian/dashboard/back/util/Arith.java b/dongjian-dashboard-back-util/src/main/java/com/dongjian/dashboard/back/util/Arith.java new file mode 100644 index 0000000..2739460 --- /dev/null +++ b/dongjian-dashboard-back-util/src/main/java/com/dongjian/dashboard/back/util/Arith.java @@ -0,0 +1,165 @@ +package com.dongjian.dashboard.back.util; +import java.math.BigDecimal; + +/** + * 进行BigDecimal对象的加减乘除,四舍五入等运算的工具类 + * + * 由于Java的简单类型不能够精确的对浮点数进行运算,这个工具类提供精 + * 确的浮点数运算,包括加减乘除和四舍五入。 + */ +public class Arith { + //默认除法运算精度 + private static final int DEF_DIV_SCALE = 10; + + //这个类不能实例化 + private Arith(){ + } + + /** + * 提供精确的加法运算。 + * @param v1 被加数 + * @param v2 加数 + * @return 两个参数的和 + */ + public static double add(double v1,double v2){ + BigDecimal b1 = new BigDecimal(Double.toString(v1)); + BigDecimal b2 = new BigDecimal(Double.toString(v2)); + return b1.add(b2).doubleValue(); + } + + /** + * 提供精确的减法运算。 + * @param v1 被减数 + * @param v2 减数 + * @return 两个参数的差 + */ + public static double sub(double v1,double v2){ + BigDecimal b1 = new BigDecimal(Double.toString(v1)); + BigDecimal b2 = new BigDecimal(Double.toString(v2)); + return b1.subtract(b2).doubleValue(); + } + + /** + * 提供精确的乘法运算。 + * @param v1 被乘数 + * @param v2 乘数 + * @return 两个参数的积 + */ + public static double mul(double v1,double v2){ + BigDecimal b1 = new BigDecimal(Double.toString(v1)); + BigDecimal b2 = new BigDecimal(Double.toString(v2)); + return b1.multiply(b2).doubleValue(); + } + + /** + * 提供(相对)精确的除法运算,当发生除不尽的情况时,精确到 + * 小数点以后10位,以后的数字四舍五入。 + * @param v1 被除数 + * @param v2 除数 + * @return 两个参数的商 + */ + public static double div(double v1,double v2){ + return div(v1,v2,DEF_DIV_SCALE); + } + + /** + * 提供(相对)精确的除法运算。当发生除不尽的情况时,由scale参数指 + * 定精度,以后的数字四舍五入。 + * @param v1 被除数 + * @param v2 除数 + * @param scale 表示表示需要精确到小数点以后几位。 + * @return 两个参数的商 + */ + public static double div(double v1,double v2,int scale){ + if(scale<0){ + throw new IllegalArgumentException( + "The scale must be a positive integer or zero"); + } + BigDecimal b1 = new BigDecimal(Double.toString(v1)); + BigDecimal b2 = new BigDecimal(Double.toString(v2)); + return b1.divide(b2,scale,BigDecimal.ROUND_HALF_UP).doubleValue(); + } + + /** + * 提供精确的小数位四舍五入处理。 + * @param v 需要四舍五入的数字 + * @param scale 小数点后保留几位 + * @return 四舍五入后的结果 + */ + public static double round(double v,int scale){ + if(scale<0){ + throw new IllegalArgumentException( + "The scale must be a positive integer or zero"); + } + BigDecimal b = new BigDecimal(Double.toString(v)); + BigDecimal one = new BigDecimal("1"); + return b.divide(one,scale,BigDecimal.ROUND_HALF_UP).doubleValue(); + } + + /** + * 提供精确的类型转换(Float) + * @param v 需要被转换的数字 + * @return 返回转换结果 + */ + public static float convertsToFloat(double v){ + BigDecimal b = BigDecimal.valueOf(v); + return b.floatValue(); + } + + /** + * 提供精确的类型转换(Int)不进行四舍五入 + * @param v 需要被转换的数字 + * @return 返回转换结果 + */ + public static int convertsToInt(double v){ + BigDecimal b = BigDecimal.valueOf(v); + return b.intValue(); + } + + /** + * 提供精确的类型转换(Long) + * @param v 需要被转换的数字 + * @return 返回转换结果 + */ + public static long convertsToLong(double v){ + BigDecimal b = BigDecimal.valueOf(v); + return b.longValue(); + } + + /** + * 返回两个数中大的一个值 + * @param v1 需要被对比的第一个数 + * @param v2 需要被对比的第二个数 + * @return 返回两个数中大的一个值 + */ + public static double returnMax(double v1,double v2){ + BigDecimal b1 = BigDecimal.valueOf(v1); + BigDecimal b2 = BigDecimal.valueOf(v2); + return b1.max(b2).doubleValue(); + } + + /** + * 返回两个数中小的一个值 + * @param v1 需要被对比的第一个数 + * @param v2 需要被对比的第二个数 + * @return 返回两个数中小的一个值 + */ + public static double returnMin(double v1,double v2){ + BigDecimal b1 = BigDecimal.valueOf(v1); + BigDecimal b2 = BigDecimal.valueOf(v2); + return b1.min(b2).doubleValue(); + } + + /** + * 精确对比两个数字 + * @param v1 需要被对比的第一个数 + * @param v2 需要被对比的第二个数 + * @return 如果两个数一样则返回0,如果第一个数比第二个数大则返回1,反之返回-1 + */ + public static int compareTo(double v1,double v2){ + BigDecimal b1 = BigDecimal.valueOf(v1); + BigDecimal b2 = BigDecimal.valueOf(v2); + return b1.compareTo(b2); + } + +} \ No newline at end of file diff --git a/dongjian-dashboard-back-util/src/main/java/com/dongjian/dashboard/back/util/CommonUtil.java b/dongjian-dashboard-back-util/src/main/java/com/dongjian/dashboard/back/util/CommonUtil.java new file mode 100644 index 0000000..047c7ec --- /dev/null +++ b/dongjian-dashboard-back-util/src/main/java/com/dongjian/dashboard/back/util/CommonUtil.java @@ -0,0 +1,764 @@ +package com.dongjian.dashboard.back.util; + +import java.lang.reflect.Field; +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.util.*; +import java.util.regex.Matcher; +import java.util.regex.Pattern; +import java.util.stream.Collectors; + +import org.apache.commons.collections.MapUtils; +import org.apache.commons.lang3.StringUtils; +import org.springframework.util.LinkedMultiValueMap; +import org.springframework.util.MultiValueMap; + +import com.alibaba.fastjson.JSONObject; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.ObjectMapper; + + +public class CommonUtil { + + private static final String decimalsRegex = "[.](.*)"; + + private static final String hexStringRegex = "^[A-Fa-f0-9]+$"; + + private static final String betweenQuotesRegex = "\"([^\"]*)\""; + + /** + * String转Int + * + * @param s + * @return + */ + public static int String2Int(String s) { + try { + return Integer.parseInt(s); + } catch (Exception e) { + return 0; + } + } + + /** + * String转Long + * + * @param s + * @return + */ + public static Long String2Long(String s) { + try { + return Long.parseLong(s); + } catch (Exception e) { + return Long.parseLong("0"); + } + } + /** + * String转Double + * + * @param s + * @return + */ + public static Double String2Double(String s) { + try { + return Double.parseDouble(s); + } catch (Exception e) { + return Double.parseDouble("0.00"); + } + } + /** + * String转Float + * + * @param s + * @return + */ + public static Float String2Float(String s) { + try { + return Float.parseFloat(s); + } catch (Exception e) { + return Float.parseFloat("0.00"); + } + } + /** + * 十六进制Object转Long + * + * @param s + * @return + */ + public static Long HexObject2Long(Object s) { + try { + return Long.parseLong(s.toString(),16); + } catch (Exception e) { + return Long.parseLong("0"); + } + } + + /** + * 十六进制Object转Int + * + * @param s + * @return + */ + public static Integer HexObject2Int(Object s) { + try { + return Integer.parseInt(s.toString(),16); + } catch (Exception e) { + return Integer.parseInt("0"); + } + } + + /** + * 十六进制字符串转二进制字符串,高位在左,低位在右 + * @param hexString + * @return + */ + public static String hexString2binary(String hexString) + { + if (hexString == null || hexString.length() % 2 != 0) + return null; + String bString = "", tmp; + for (int i = 0; i < hexString.length(); i++) + { + tmp = "0000"+ Integer.toBinaryString(Integer.parseInt(hexString.substring(i, i + 1), 16)); + bString += tmp.substring(tmp.length() - 4); + } + return bString; + } + + /** + * 十进制转补位的byte字符串 + * @param s 需转换的十进制值 + * @param length 需满足的长度 + * @return + */ + public static String Int2ByteString(int s,int length) { + try { + return String.format("%0"+length+"d", Long.parseLong(Integer.toBinaryString(s))); + } catch (Exception e) { + return String.format("%0"+length+"d", Long.parseLong(Integer.toBinaryString(s))); + } + } + + /** + * 十六进制字符串转ascii码字符串 + * @param hex + * @return + */ + public static String convertHexToString(String hex){ + StringBuilder sb = new StringBuilder(); + StringBuilder temp = new StringBuilder(); + for( int i=0; i 0; i--) { + char c = binary.charAt(i - 1); + int algorism = c - '0'; + result += Math.pow(2, max - i) * algorism; + } + return result; + } + + + /** + * 十进制转十六进制 + * @param decimal + * @return + */ + public static String decimalToHex(int decimal) { + String result = ""; + result = Integer.toHexString(decimal); + if (result.length() % 2 == 1) { + result = "0" + result; + } + result = result.toUpperCase(); + return result; + } + + /** + * 将对象转换为json格式字符串 + * + * @param Object + * @return json string + */ + public static String toJSON(Object obj) { + ObjectMapper om = new ObjectMapper(); + try { + String json = om.writeValueAsString(obj); + return json; + } catch (JsonProcessingException e) { + e.printStackTrace(); + } + return null; + } + + + /** + * 给字符串补0 + * @param str 需要补齐长度的字符串 + * @param strLength 需要补足的长度 + * @param type 1左补0, 2右补0 + * @return + */ + public static String addZeroForString(String str, int strLength, int type) { + int strLen = str.length(); + StringBuffer sb = null; + if(type == 1){ + while (strLen < strLength) { + sb = new StringBuffer(); + sb.append("0").append(str);// 左补0 + //sb.append(str).append("0");//右补0 + str = sb.toString(); + strLen = str.length(); + } + }else{ + while (strLen < strLength) { + sb = new StringBuffer(); +// sb.append("0").append(str);// 左补0 + sb.append(str).append("0");//右补0 + str = sb.toString(); + strLen = str.length(); + } + } + return str; + } + + + /** + * 判断是否为整数 + * @param str + * @return + */ + public static boolean isInteger(String str) { + Pattern pattern = Pattern.compile("^-?[0-9]\\d*$"); + return pattern.matcher(str).matches(); + } + + /** + * 判定是否为非负数(整数、小数) + * @param str + * @return + */ + public static boolean isDecimal(String str) { + int index = str.indexOf("."); + if(index<0){ + return StringUtils.isNumeric(str); + }else{ + String num1 = str.substring(0,index); + String num2 = str.substring(index+1); + return StringUtils.isNumeric(num1) && StringUtils.isNumeric(num2); + } + } + + /** + * 判断是否为非负数 + * @param str + * @return + */ + public static boolean isPositiveOrZero(String str) { + return str.matches("(0|([1-9]\\d*))(\\.\\d+)?"); + } + + + /** + * unix时间变更为datetime类型 + * + * @param s + * @return + */ + public static Date ObjectUnix2DateStr(Object s) { + try { + return new java.util.Date(1000*Long.parseLong(s.toString())); + } catch (Exception e) { + return new Date(); + } + } + + /** + * 获取UUID方法 + * @return + */ + public static String getUUID() { + SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd"); + return sdf.format(new Date()) + UUID.randomUUID().toString().replace("-",""); + } + + /** + * 获取字符串型的当前年.月.日 yyyy_MM_dd 格式 + * @return + */ + public static String TableDateFM2D(){ + SimpleDateFormat sdf = new SimpleDateFormat("yyyy_MM_dd"); + return sdf.format(new Date()); + } + + /** + * 获取字符串型的当前年.月 yyyy_MM 格式 + * @return + */ + public static String TableDateFM2M(){ + SimpleDateFormat sdf = new SimpleDateFormat("yyyy_MM"); + return sdf.format(new Date()); + } + + + /** + * 根据传入的date,返回数据表需要的日期格式 + * @param date + * @param mode 0:yyyy_MM格式, 1:yyyy_MM_dd + * @return + */ + public static String TableDateByDateStr(Object date, int mode){ + String resultDate = ""; + SimpleDateFormat sdfFull = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + SimpleDateFormat sdf = new SimpleDateFormat("yyyy_MM"); + if(mode > 0){ + sdf = new SimpleDateFormat("yyyy_MM_dd"); + } + try { + Date datetime = sdfFull.parse(date.toString()); + resultDate = sdf.format(datetime); + } catch (ParseException e) { + e.printStackTrace(); + } + return resultDate; + } + + + /** + * 根据传入的秒级时间戳,返回数据表需要的日期格式 + * @param date + * @param mode 0:yyyy_MM格式, 1:yyyy_MM_dd + * @return + */ + public static String TableDateByUnix(Object date, int mode){ + SimpleDateFormat sdf = new SimpleDateFormat("yyyy_MM"); + if(mode > 0){ + sdf = new SimpleDateFormat("yyyy_MM_dd"); + } + String tabTime = sdf.format(Long.parseLong(date.toString()+"000")); + return tabTime; + } + + /** + * json排版修改 + * + * @param s + * @return + */ + public static String String2Rep(String s) { + try { + return s.replace(",", ",\n").replace("[", "\n[\n") + .replace("{", "\n{\n").replace("}", "\n}\n") + .replace("]", "\n]\n"); + } catch (Exception e) { + return s; + } + } + + + /**8 + * Convert byte[] to hex string.这里我们可以将byte转换成int,然后利用Integer.toHexString(int)来转换成16进制字符串。 + * @param src byte[] data + * @return hex string + */ + public static String bytesToHexString(byte[] src){ + StringBuilder stringBuilder = new StringBuilder(""); + if (src == null || src.length <= 0) { + return null; + } + for (int i = 0; i < src.length; i++) { + int v = src[i] & 0xFF; + String hv = Integer.toHexString(v); + if (hv.length() < 2) { + stringBuilder.append(0); + } + stringBuilder.append(hv); + } + return stringBuilder.toString(); + } + + public static String StringtoHexString(String s) { + String str = ""; + for (int i = 0; i < s.length(); i++) { + int ch = (int) s.charAt(i); + String s4 = Integer.toHexString(ch & 0xFF); + if (s4.length() == 1) { + s4 = '0' + s4; + } + str = str + s4; + } + return str;// 0x表示十六进制 + } + /** + * Convert hex string to byte[] + * @param hexString the hex string + * @return byte[] + */ + public static byte[] HexString2Bytes(String src) { + int size = src.length(); + byte[] ret = new byte[size / 2]; + byte[] tmp = src.getBytes(); + for (int i = 0; i < size / 2; i++) { + ret[i] = uniteBytes(tmp[i * 2], tmp[i * 2 + 1]); + } + return ret; + } + private static byte uniteBytes(byte src0, byte src1) { + char _b0 = (char) Byte.decode("0x" + new String(new byte[] { src0 })).byteValue(); + _b0 = (char) (_b0 << 4); + char _b1 = (char) Byte.decode("0x" + new String(new byte[] { src1 })).byteValue(); + byte ret = (byte) (_b0 ^ _b1); + return ret; + } + /** + * 获取更改时区后的日期 + * @param date 日期 + * @param oldZone 旧时区对象 + * @param newZone 新时区对象 + * @return 日期 + */ + public static String changeTimeZone(String datetime, TimeZone oldZone, TimeZone newZone) { + String result = ""; + if(datetime != null && datetime.length()>0){ + SimpleDateFormat DateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + Date date = null; + try { + date = DateFormat.parse(datetime); + } catch (Exception e) { + e.printStackTrace(); + } + Date dateTmp = null; + if (date != null) { + int timeOffset = oldZone.getRawOffset() - newZone.getRawOffset(); + dateTmp = new Date(date.getTime() - timeOffset); + result = DateFormat.format(dateTmp); + } + } + return result; + } + /** + * 获取浏览器版本信息 + * @date:2016-9-19 + * @author:jiangwy + * @param agent + * @return + */ + public static String getBrowserName(String agent) { + if(agent.indexOf("msie 7")>0){ + return "ie7"; + }else if(agent.indexOf("msie 8")>0){ + return "ie8"; + }else if(agent.indexOf("msie 9")>0){ + return "ie9"; + }else if(agent.indexOf("msie 10")>0){ + return "ie10"; + }else if(agent.indexOf("msie")>0){ + return "ie"; + }else if(agent.indexOf("opera")>0){ + return "opera"; + }else if(agent.indexOf("firefox")>0){ + return "firefox"; + }else if(agent.indexOf("webkit")>0){ + return "webkit"; + }else if(agent.indexOf("gecko")>0 && agent.indexOf("rv:11")>0){ + return "ie11"; + }else{ + return "Others"; + } + } + + /** + * 百度坐标系计算两经纬度点之间的距离(单位:米) + * @param lng1 经度 + * @param lat1 纬度 + * @param lng2 + * @param lat2 + * @return + */ + public static double getBMapDistance(double lat_a, double lng_a, double lat_b, double lng_b){ + double pk = 180 / Math.PI; + double a1 = lat_a / pk; + double a2 = lng_a / pk; + double b1 = lat_b / pk; + double b2 = lng_b / pk; + double t1 = Math.cos(a1) * Math.cos(a2) * Math.cos(b1) * Math.cos(b2); + double t2 = Math.cos(a1) * Math.sin(a2) * Math.cos(b1) * Math.sin(b2); + double t3 = Math.sin(a1) * Math.sin(b1); + double tt = Math.acos(t1 + t2 + t3); + return 6370996.81 * tt; + } + + /** + * 将用角度表示的角转换为近似相等的用弧度表示的角 Math.toRadians + * @param d + * @return + */ + private static double rad(double d) + { + return d * Math.PI / 180.0; + } + + /** + * gps计算两经纬度点之间的距离(单位:米) + * @param lat1 + * @param lng1 + * @param lat2 + * @param lng2 + * @return + */ + public static double getGPSDistance(double lat1, double lng1, double lat2, double lng2) + { + double radLat1 = rad(lat1); + double radLat2 = rad(lat2); + double a = radLat1 - radLat2; + double b = rad(lng1) - rad(lng2); + double s = 2 * Math.asin(Math.sqrt(Math.pow(Math.sin(a/2),2) + + Math.cos(radLat1)*Math.cos(radLat2)*Math.pow(Math.sin(b/2),2))); + s = s * 6370996.81; + s = Math.round(s * 10000.0) / 10.0; + return s; + } + + /** + * 拼接List里Map的某个特定键对应的所有值 + * @param list + * @param param + * @return + */ + public static String JointListParam(List> list , String Key, String jointParam){ + for(int i = 0; i< list.size();i++){ + if(list.get(i).get(Key) != null && list.get(i).get(Key) != "" ){ + if(jointParam == null || jointParam.length() <= 0){ + jointParam = list.get(i).get(Key).toString(); + }else{ + jointParam = jointParam + "," + list.get(i).get(Key).toString(); + } + } + } + return jointParam; + } + + /** + * 根据前端的年、月、日等参数拼接返回yyyy-mm-dd hh:mm:ss格式数据 + * @param params + * @return + */ + public static Map getStartAndEndTime(Map params,String year, String month, String day, String dayCount) { + Map resultTime = new HashMap(); + String upStime = ""; + String upEtime = ""; + try { + if(params.get(year).toString().length() > 0 && params.get(month).toString().length() > 0 && params.get(day).toString().length() > 0){ + String bMonth = "0"+ params.get(month).toString(); + String bDay = ""; + if(params.get(day).toString().equals("0")){ + bDay = params.get(dayCount).toString(); + upStime = params.get(year).toString() + "-" + bMonth.substring(bMonth.length()-2, bMonth.length()) + "-" + "01" + " 00:00:00"; + upEtime = params.get(year).toString() + "-" + bMonth.substring(bMonth.length()-2, bMonth.length()) + "-" + bDay + " 23:59:59"; + }else{ + bDay = "0"+ params.get(day).toString(); + upStime = params.get(year).toString() + "-" + bMonth.substring(bMonth.length()-2, bMonth.length()) + "-" + + bDay.substring(bDay.length()-2, bDay.length()) + " 00:00:00"; + upEtime = params.get(year).toString() + "-" + bMonth.substring(bMonth.length()-2, bMonth.length()) + "-" + + bDay.substring(bDay.length()-2, bDay.length()) + " 23:59:59"; + } + } + } catch (Exception e) { + e.printStackTrace(); + } + resultTime.put("upStime", upStime); + resultTime.put("upEtime", upEtime); + return resultTime; + } + + /** + * 对象集合赋值 + */ + public static List copyList(List list , Class clas){ + String aStr = JSONObject.toJSONString(list); + return JSONObject.parseArray(aStr, clas); + } + + /** + * 以list1为主体,根据键名groupKey,合并list1和list2 + * @param list1 + * @param list2 + * @param groupKey + * @return + */ + public static void mergeList2ToList1(List> list1, List> list2, String groupKey){ + try { + //将list2集合转换为map + Map map2 = list2.stream().collect( + Collectors.toMap(s->s.get(groupKey).toString(), s -> s)); + //合并数据,这里将list2集合的数据合并到list1集合上 + list1.forEach(n -> { + String keyStr = MapUtils.getString(n, groupKey); + if(StringUtils.isNotBlank(keyStr) && map2.containsKey(keyStr)){ + Map person = (Map) map2.get(keyStr); + if (null != person) { + for (String key : person.keySet()) { + n.put(key, person.get(key)); + } + } + } + }); + } catch (Exception e) { + e.printStackTrace(); + } + } + + /** + * 去除小数 + * @param str + * @return + */ + public static String removeDecimals(String str) { + return str.replaceAll(decimalsRegex,""); + } + + /** + * 合并两个list + * @param list1 + * @param list2 + * @param groupKey + * @return + */ + public static List> mergeList(List> list1, List> list2, String groupKey){ + list1.addAll(list2); + Set set = new HashSet<>(); + return list1.stream() + .collect(Collectors.groupingBy(o->{ + //暂存所有key + set.addAll(o.keySet()); + //按groupKey分组 + return o.get(groupKey); + })).entrySet().stream().map(o->{ + //合并 + Map map = o.getValue().stream().flatMap(m->{ + return m.entrySet().stream(); + }).collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue, (a,b)->b)); + //为没有的key赋值null + set.stream().forEach(k->{ + if(!map.containsKey(k)) map.put(k, ""); + }); + return map; + }).collect(Collectors.toList()); + } + + public static String getBeforeMinutes(int armOnlineMinutes) { + Calendar beforeTime = Calendar.getInstance(); + beforeTime.add(Calendar.MINUTE, -armOnlineMinutes);// 5分钟之前的时间 + Date beforeD = beforeTime.getTime(); + String beforeTimeString = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(beforeD); + return beforeTimeString; + } + + private static boolean isEmojiCharacter(char codePoint) { + return (codePoint == 0x0) || (codePoint == 0x9) || (codePoint == 0xA) + || (codePoint == 0xD) + || ((codePoint >= 0x20) && (codePoint <= 0xD7FF)) + || ((codePoint >= 0xE000) && (codePoint <= 0xFFFD)) + || ((codePoint >= 0x10000) && (codePoint <= 0x10FFFF)); + } + + /** + * 过滤emoji 或者 其他非文字类型的字符 + * + * @param source + * @return + */ + public static String filterEmoji(String source) { + if (StringUtils.isBlank(source)) { + return source; + } + StringBuilder buf = null; + int len = source.length(); + for (int i = 0; i < len; i++) { + char codePoint = source.charAt(i); + if (isEmojiCharacter(codePoint)) { + if (buf == null) { + buf = new StringBuilder(source.length()); + } + buf.append(codePoint); + } + } + if (buf == null) { + return source; + } else { + if (buf.length() == len) { + buf = null; + return source; + } else { + return buf.toString(); + } + } + } + + public static boolean isHexString(String string) { + Pattern pattern = Pattern.compile(hexStringRegex); + return pattern.matcher(string).matches(); + } + + public static Long dateStr2Stamp(SimpleDateFormat sdf, String dataeStr) { + if (StringUtils.isBlank(dataeStr)) { + return null; + } + try { + return sdf.parse(dataeStr).getTime(); + } catch (ParseException e) { + e.printStackTrace(); + return null; + } + } + + public static List commaStr2LongList(String commaStr) { + if (StringUtils.isBlank(commaStr)){ + return new ArrayList<>(); + } + return Arrays.asList(StringUtils.split(commaStr, ",")).stream() + .map(id -> CommonUtil.String2Long(id.trim())).collect(Collectors.toList()); + } + + //截取双引号间的内容 + public static String extractContentBetweenQuotes(String text) { + Pattern pattern = Pattern.compile(betweenQuotesRegex); + Matcher matcher = pattern.matcher(text); + + if (matcher.find()) { + return matcher.group(1); + } + + return null; // 如果找不到匹配项,返回null + } + + public static MultiValueMap convertToMultiValueMap(Object obj) throws IllegalAccessException { + MultiValueMap multiValueMap = new LinkedMultiValueMap<>(); + Field[] fields = obj.getClass().getDeclaredFields(); + for (Field field : fields) { + field.setAccessible(true); + Object value = field.get(obj); + if (value != null) { + multiValueMap.set(field.getName(), value.toString()); + } + } + return multiValueMap; + } + +} diff --git a/dongjian-dashboard-back-util/src/main/java/com/dongjian/dashboard/back/util/DESUtil.java b/dongjian-dashboard-back-util/src/main/java/com/dongjian/dashboard/back/util/DESUtil.java new file mode 100644 index 0000000..17785d8 --- /dev/null +++ b/dongjian-dashboard-back-util/src/main/java/com/dongjian/dashboard/back/util/DESUtil.java @@ -0,0 +1,192 @@ +package com.dongjian.dashboard.back.util; + +import javax.crypto.Cipher; +import javax.crypto.CipherInputStream; +import javax.crypto.CipherOutputStream; +import javax.crypto.SecretKeyFactory; +import javax.crypto.spec.DESKeySpec; +import javax.crypto.spec.IvParameterSpec; + +import java.io.*; +import java.nio.charset.StandardCharsets; +import java.security.Key; +import java.util.Base64; + +/** + * + * @author jwy-style + * + */ +public class DESUtil { + + /** + * 偏移变量,固定占8位字节 + */ + private final static String IV_PARAMETER = "12345678"; + /** + * 密钥算法 + */ + private static final String ALGORITHM = "DES"; + /** + * 加密/解密算法-工作模式-填充模式 + */ + private static final String CIPHER_ALGORITHM = "DES/CBC/PKCS5Padding"; + /** + * 默认编码 + */ + private static final String CHARSET = "utf-8"; + + /** + * 生成key + * + * @param password + * @return + * @throws Exception + */ + private static Key generateKey(String password) throws Exception { + DESKeySpec dks = new DESKeySpec(password.getBytes(CHARSET)); + SecretKeyFactory keyFactory = SecretKeyFactory.getInstance(ALGORITHM); + return keyFactory.generateSecret(dks); + } + + + /** + * DES加密字符串 + * + * @param password 加密密码,长度不能够小于8位 + * @param data 待加密字符串 + * @return 加密后内容 + */ + public static String encrypt(String data, String password) { + if (password== null || password.length() < 8) { + throw new RuntimeException("加密失败,key不能小于8位"); + } + if (data == null) + return null; + try { + Key secretKey = generateKey(password); + Cipher cipher = Cipher.getInstance(CIPHER_ALGORITHM); + IvParameterSpec iv = new IvParameterSpec(IV_PARAMETER.getBytes(CHARSET)); + cipher.init(Cipher.ENCRYPT_MODE, secretKey, iv); + byte[] bytes = cipher.doFinal(data.getBytes(CHARSET)); + + //JDK1.8及以上可直接使用Base64,JDK1.7及以下可以使用BASE64Encoder + //Android平台可以使用android.util.Base64 + return new String(Base64.getEncoder().encode(bytes)); + + } catch (Exception e) { + e.printStackTrace(); + return data; + } + } + + /** + * DES解密字符串 + * + * @param password 解密密码,长度不能够小于8位 + * @param data 待解密字符串 + * @return 解密后内容 + */ + public static String decrypt(String data, String password) { + if (password== null || password.length() < 8) { + throw new RuntimeException("加密失败,key不能小于8位"); + } + if (data == null) + return null; + try { + Key secretKey = generateKey(password); + Cipher cipher = Cipher.getInstance(CIPHER_ALGORITHM); + IvParameterSpec iv = new IvParameterSpec(IV_PARAMETER.getBytes(CHARSET)); + cipher.init(Cipher.DECRYPT_MODE, secretKey, iv); + return new String(cipher.doFinal(Base64.getDecoder().decode(data.getBytes(CHARSET))), CHARSET); + } catch (Exception e) { + e.printStackTrace(); + return data; + } + } + + /** + * DES加密文件 + * + * @param srcFile 待加密的文件 + * @param destFile 加密后存放的文件路径 + * @return 加密后的文件路径 + */ + public static String encryptFile(String password, String srcFile, String destFile) { + + if (password== null || password.length() < 8) { + throw new RuntimeException("加密失败,key不能小于8位"); + } + try { + IvParameterSpec iv = new IvParameterSpec(IV_PARAMETER.getBytes(CHARSET)); + Cipher cipher = Cipher.getInstance(CIPHER_ALGORITHM); + cipher.init(Cipher.ENCRYPT_MODE, generateKey(password), iv); + InputStream is = new FileInputStream(srcFile); + OutputStream out = new FileOutputStream(destFile); + CipherInputStream cis = new CipherInputStream(is, cipher); + byte[] buffer = new byte[1024]; + int r; + while ((r = cis.read(buffer)) > 0) { + out.write(buffer, 0, r); + } + cis.close(); + is.close(); + out.close(); + return destFile; + } catch (Exception ex) { + ex.printStackTrace(); + } + return null; + } + + /** + * DES解密文件 + * + * @param srcFile 已加密的文件 + * @param destFile 解密后存放的文件路径 + * @return 解密后的文件路径 + */ + public static String decryptFile(String password, String srcFile, String destFile) { + if (password== null || password.length() < 8) { + throw new RuntimeException("加密失败,key不能小于8位"); + } + try { + File file = new File(destFile); + if (!file.exists()) { + file.getParentFile().mkdirs(); + file.createNewFile(); + } + IvParameterSpec iv = new IvParameterSpec(IV_PARAMETER.getBytes(CHARSET)); + Cipher cipher = Cipher.getInstance(CIPHER_ALGORITHM); + cipher.init(Cipher.DECRYPT_MODE, generateKey(password), iv); + InputStream is = new FileInputStream(srcFile); + OutputStream out = new FileOutputStream(destFile); + CipherOutputStream cos = new CipherOutputStream(out, cipher); + byte[] buffer = new byte[1024]; + int r; + while ((r = is.read(buffer)) >= 0) { + cos.write(buffer, 0, r); + } + cos.close(); + is.close(); + out.close(); + return destFile; + } catch (Exception ex) { + ex.printStackTrace(); + } + return null; + } + + public static void main(String[] args){ + String salt = "ci3b512jwy199511"; + String encodeString = encrypt("cp_" + System.currentTimeMillis()+ "_1",salt); + System.out.println(encodeString); + System.out.println(decrypt(encodeString, salt)); + + String base64sString = Base64.getEncoder().encodeToString(encodeString.getBytes()); + System.out.println(base64sString); + byte[] decodedBytes = Base64.getDecoder().decode(base64sString); + String rawApikey = DESUtil.decrypt(new String(decodedBytes, StandardCharsets.UTF_8), salt); + System.out.println(rawApikey); + } +} \ No newline at end of file diff --git a/dongjian-dashboard-back-util/src/main/java/com/dongjian/dashboard/back/util/DateUtil.java b/dongjian-dashboard-back-util/src/main/java/com/dongjian/dashboard/back/util/DateUtil.java new file mode 100644 index 0000000..c28c127 --- /dev/null +++ b/dongjian-dashboard-back-util/src/main/java/com/dongjian/dashboard/back/util/DateUtil.java @@ -0,0 +1,88 @@ +package com.dongjian.dashboard.back.util; + +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.time.DayOfWeek; +import java.time.Instant; +import java.time.LocalDate; +import java.time.ZoneId; +import java.time.format.DateTimeFormatter; +import java.time.temporal.IsoFields; +import java.util.*; + +/** + * 时间转换工具类 + */ +public class DateUtil { + + private static final DateTimeFormatter FORMATTER = DateTimeFormatter.ISO_DATE; + + public static void main(String[] args) { + // 指定的日期时间字符串 + String dateString = "2023-12-31 23:59:59"; + // 指定的时区 + String timeZoneId = "Asia/Tokyo"; // 日本时区 + + System.out.println(dateStr2Timestamp(dateString, "yyyy-MM-dd HH:mm:ss", timeZoneId)); + + System.out.println(timestamp2DateStr(1609513500000L, "yyyy-MM-dd HH:mm:ss", timeZoneId)); + } + + public static long dateStr2Timestamp(String dateStr, String dateFormat, String timeZoneId) { + try { + // 创建 SimpleDateFormat 对象来解析日期时间字符串 + SimpleDateFormat sdf = new SimpleDateFormat(dateFormat); + // 设置 SimpleDateFormat 对象的时区 + sdf.setTimeZone(TimeZone.getTimeZone(timeZoneId)); + // 解析日期时间字符串并得到 Date 对象 + Date date = sdf.parse(dateStr); + // 获取时间戳(单位:秒) + return date.getTime(); + } catch (ParseException e) { + System.out.println("日期时间字符串转时间戳失败:" + e.getMessage()); + return 0; + } + } + + public static String timestamp2DateStr(long milliseconds, String dateFormat, String timeZoneId) { + try { + Instant instant = Instant.ofEpochMilli(milliseconds); + ZoneId zoneId = ZoneId.of(timeZoneId); + DateTimeFormatter formatter = DateTimeFormatter.ofPattern(dateFormat); + + String formattedDateTime = formatter.format(instant.atZone(zoneId)); + return formattedDateTime; + } catch (Exception e) { + System.out.println("时间戳转日期时间字符串失败:" + e.getMessage()); + return ""; + } + } + + /** + * 根据指定日期,获取去年同 ISO 周同星期的日期 + * @param date 目标日期 + * @return 去年同周同日 LocalDate + */ + public static LocalDate getLastYearSameIsoWeekDay(LocalDate date) { + if (date == null) throw new IllegalArgumentException("date不能为空"); + + int isoWeekYear = date.get(IsoFields.WEEK_BASED_YEAR); + int isoWeekNumber = date.get(IsoFields.WEEK_OF_WEEK_BASED_YEAR); + DayOfWeek dayOfWeek = date.getDayOfWeek(); + + return LocalDate.now() + .with(IsoFields.WEEK_BASED_YEAR, isoWeekYear - 1) + .with(IsoFields.WEEK_OF_WEEK_BASED_YEAR, isoWeekNumber) + .with(dayOfWeek); + } + + /** + * 根据指定日期,获取去年同 ISO 周同星期的日期字符串 + * @param date 目标日期 + * @return 去年同周同日 yyyy-MM-dd + */ + public static String getLastYearSameIsoWeekDayStr(LocalDate date) { + LocalDate lastYearDate = getLastYearSameIsoWeekDay(date); + return lastYearDate.format(FORMATTER); + } +} diff --git a/dongjian-dashboard-back-util/src/main/java/com/dongjian/dashboard/back/util/FileReplace.java b/dongjian-dashboard-back-util/src/main/java/com/dongjian/dashboard/back/util/FileReplace.java new file mode 100644 index 0000000..d44e6ab --- /dev/null +++ b/dongjian-dashboard-back-util/src/main/java/com/dongjian/dashboard/back/util/FileReplace.java @@ -0,0 +1,70 @@ +package com.dongjian.dashboard.back.util; + +import java.io.BufferedInputStream; +import java.io.FileInputStream; +import java.io.FileNotFoundException; +import java.io.FileReader; +import java.io.FileWriter; +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import com.google.common.base.Charsets; +import com.google.common.io.CharStreams; + +/** + * + * @author jwy + * + */ +public class FileReplace { + + private static Logger logger = LoggerFactory.getLogger(FileReplace.class); + + /*** + * 替换resources文件夹下指定文件中的指定内容 + * + * @param filepath + * 文件路径 + * @param sourceStr + * 文件需要替换的内容 + * @param targetStr + * 替换后的内容 + * @throws IOException + */ + public static void replaceResourceFileStr(String filePath, String outPath, String sourceStr, String targetStr) throws IOException{ + + InputStream in = FileReplace.class.getResourceAsStream(filePath); + if (null == in) { + //升级springboot版本后修改了pom文件,部署到linux时,如果jar包不包含application.properties文件,用上面的方法读取不到,用下面这个防止为空 + filePath = System.getProperty("user.dir") + filePath; + try { + in = new BufferedInputStream(new FileInputStream(filePath)); + } catch (FileNotFoundException e1) { + logger.error("FileReplace加载文件出错:{}", e1.getMessage()); + } + } + String sb = CharStreams.toString(new InputStreamReader( + in, Charsets.UTF_8)); + // 从构建器中生成字符串,并替换搜索文本 + String str = sb.toString().replace(sourceStr, targetStr); + FileWriter fout = new FileWriter(outPath);// 创建文件输出流 + fout.write(str.toCharArray());// 把替换完成的字符串写入文件内 + fout.close();// 关闭输出流 + } + + public static void replaceFileStr(String filePath, String outPath, String sourceStr, String targetStr) throws IOException { + InputStream in = new FileInputStream(filePath); + + String sb = CharStreams.toString(new InputStreamReader( + in, Charsets.UTF_8)); + // 从构建器中生成字符串,并替换搜索文本 + String str = sb.toString().replace(sourceStr, targetStr); + FileWriter fout = new FileWriter(outPath);// 创建文件输出流 + fout.write(str.toCharArray());// 把替换完成的字符串写入文件内 + fout.close();// 关闭输出流 + } +} diff --git a/dongjian-dashboard-back-util/src/main/java/com/dongjian/dashboard/back/util/FileUtil.java b/dongjian-dashboard-back-util/src/main/java/com/dongjian/dashboard/back/util/FileUtil.java new file mode 100644 index 0000000..7ec7380 --- /dev/null +++ b/dongjian-dashboard-back-util/src/main/java/com/dongjian/dashboard/back/util/FileUtil.java @@ -0,0 +1,416 @@ +package com.dongjian.dashboard.back.util; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.web.multipart.MultipartFile; + +import jakarta.servlet.http.HttpServletResponse; +import java.io.*; +import java.net.URLEncoder; +import java.text.DecimalFormat; +import java.util.zip.ZipEntry; +import java.util.zip.ZipOutputStream; + +public class FileUtil { + private static Logger logger = LoggerFactory.getLogger(FileUtil.class); + + /** + * 保存文件 + * @param multipartFile 文件 + * @param filePath 存储路径 + * @param fileName 存储文件名 + * @return 文件url + */ + public static boolean SaveFile(MultipartFile multipartFile,String filePath,String fileName) { + boolean result = false; + if(multipartFile.isEmpty()) + return true; + File file = new File(filePath); + if (!file.exists()) { + file.mkdirs(); + } + try (BufferedOutputStream bos = new BufferedOutputStream(new FileOutputStream(filePath + File.separator + fileName))){ + FileInputStream fileInputStream = (FileInputStream) multipartFile.getInputStream(); + byte[] bs = new byte[1024]; + int len; + while ((len = fileInputStream.read(bs)) != -1) { + bos.write(bs, 0, len); + } + bos.flush(); + result = true; + } catch (IOException e) { + logger.error("SaveFile ERROR",e); + } + return result; + } + + /** + * 下载文件 + * @param response + * @param file + * @param fileName + * @return + */ + public static String downloadFile(HttpServletResponse response,File file,String fileName){ + if (fileName != null) { + //当前是从该工程的WEB-INF//File//下获取文件(该目录可以在下面一行代码配置)然后下载到C:\\users\\downloads即本机的默认下载的目录 + if (file.exists()) { + response.setContentType("application/force-download");// 设置强制下载不打开 + response.addHeader("Access-Control-Expose-Headers","Content-Disposition"); + response.addHeader("Content-Disposition", + "attachment;fileName=" + fileName);// 设置文件名 + byte[] buffer = new byte[1024]; + try (FileInputStream fis = new FileInputStream(file)){ + BufferedInputStream bis = new BufferedInputStream(fis); + OutputStream os = response.getOutputStream(); + int i = bis.read(buffer); + while (i != -1) { + os.write(buffer, 0, i); + i = bis.read(buffer); + } + } catch (Exception e) { + logger.error("-----downloadFile---error:"+e.getMessage(),e); + } + } + } + return null; + } + + public static void downloadExcelFile(HttpServletResponse response,File file,String fileName){ + try { + if (fileName != null) { + logger.debug(file.getAbsolutePath()); + //当前是从该工程的WEB-INF//File//下获取文件(该目录可以在下面一行代码配置)然后下载到C:\\users\\downloads即本机的默认下载的目录 + if (file.exists()) { + response.setContentType("application/octet-stream"); + // 告诉浏览器用什么软件可以打开此文件 + response.addHeader("Access-Control-Expose-Headers","Content-Disposition"); + response.addHeader("Content-Disposition","attachment;fileName=" +URLEncoder.encode(fileName, "UTF-8"));// 设置文件名 + byte[] buffer = new byte[1024]; + try (FileInputStream fis = new FileInputStream(file)){ + BufferedInputStream bis = new BufferedInputStream(fis); + OutputStream os = response.getOutputStream(); + int i = bis.read(buffer); + while (i != -1) { + os.write(buffer, 0, i); + i = bis.read(buffer); + } + } catch (Exception e) { + logger.error("-----downloadFile---error:"+e.getMessage(),e); + } + }else{ + logger.error("-----downloadFile---文件不存在------"+file.getName()); + } + } + } catch (Exception e) { + logger.error("-----downloadFile---error:"+e.getMessage(),e); + } + } + + public static void downloadExcelFile(HttpServletResponse response,InputStream fis,String fileName){ + try { + if (fileName != null) { + response.setHeader("Access-Control-Expose-Headers", "Content-Disposition"); + //通知客服文件的MIME类型 + response.setContentType("application/vnd.ms-excel;charset=UTF-8"); + //获取文件的路径 + response.setCharacterEncoding("UTF-8"); + // 告诉浏览器用什么软件可以打开此文件 + response.addHeader("Access-Control-Expose-Headers","Content-Disposition"); + response.addHeader("Content-Disposition","attachment;fileName=" +URLEncoder.encode(fileName, "UTF-8"));// 设置文件名 + byte[] buffer = new byte[1024]; + try (BufferedInputStream bis = new BufferedInputStream(fis)){ + OutputStream os = response.getOutputStream(); + int i = bis.read(buffer); + while (i != -1) { + os.write(buffer, 0, i); + i = bis.read(buffer); + } + response.setHeader("Content-Length", String.valueOf(fis.available())); + } catch (Exception e) { + logger.error("-----downloadFile---error:"+e.getMessage(),e); + } + } + } catch (Exception e) { + logger.error("-----downloadFile---error:"+e.getMessage(),e); + } + } + + /** + * 将二进制转换成文件保存 + * @param instreams 二进制流 + * @param imgPath 图片的保存路径 + * @param imgName 图片的名称 + * @return + * 1:保存正常 + * 0:保存失败 + */ + public static int saveToImgByInputStream(InputStream instreams,String imgPath,String imgName){ + int stateInt = 1; + if(instreams != null){ + File file=new File(imgPath,imgName);//可以是任何图片格式.jpg,.png等 + try (FileOutputStream fos=new FileOutputStream(file);){ + byte[] b = new byte[1024]; + int nRead = 0; + while ((nRead = instreams.read(b)) != -1) { + fos.write(b, 0, nRead); + } + fos.flush(); + } catch (Exception e) { + stateInt = 0; + logger.error("saveToImgByInputStream ERROR",e); + } + } + return stateInt; + } + + public static String formetFileSize(long fileS) {//转换文件大小 + DecimalFormat df = new DecimalFormat("#.00"); + String fileSizeString = ""; + if (fileS < 1024) { + fileSizeString = df.format((double) fileS) + "B"; + } else if (fileS < 1048576) { + fileSizeString = df.format((double) fileS / 1024) + "K"; + } else if (fileS < 1073741824) { + fileSizeString = df.format((double) fileS / 1048576) + "M"; + } else { + fileSizeString = df.format((double) fileS / 1073741824) + "G"; + } + return fileSizeString; + } + + /** + * 获取文件大小转M + * @param fileS + * @return + */ + public static String changeFileSize(long fileS) {//转换文件大小 + DecimalFormat df = new DecimalFormat("#0.00"); + return df.format((double) fileS / 1048576); + } + + /** + * zip文件压缩 + * @param inputFile 待压缩文件夹/文件名 + * @param outputFile 生成的压缩包名字 + */ + public static void zipCompress(String inputFile, String outputFile) throws Exception { + ZipOutputStream out = null; + BufferedOutputStream bos = null; + try { + File fileParent = new File(outputFile).getParentFile(); + if (!fileParent.exists()) + fileParent.mkdirs();// 能创建多级目录 + //创建zip输出流 + out = new ZipOutputStream(new FileOutputStream(outputFile)); + //创建缓冲输出流 + bos = new BufferedOutputStream(out); + File input = new File(inputFile); + compress(out, bos, input,null); + bos.close(); + out.close(); + } finally { + if(bos != null) bos.close(); + if(out != null) out.close(); + } + + } + + public static void zipMultiFile(String filePath, String zipPath) { + File fileParent = new File(zipPath).getParentFile(); + if (!fileParent.exists()) + fileParent.mkdirs();// 能创建多级目录 + File file = new File(filePath); //获取其file对象 + File[] srcFiles = file.listFiles(); //遍历path下的文件和目录,放在File数组中 + if (null != srcFiles && srcFiles.length > 0) { + zipFiles(srcFiles, new File(zipPath)); + } + } + + public static void zipFiles(File[] srcFiles, File zipFile) { + // 判断压缩后的文件存在不,不存在则创建 + if (!zipFile.exists()) { + try { + zipFile.createNewFile(); + } catch (IOException e) { + logger.info("导出zip, createNewFile出错", e); + } + } +// // 创建 FileOutputStream 对象 +// FileOutputStream fileOutputStream = null; +// // 创建 ZipOutputStream +// ZipOutputStream zipOutputStream = null; + // 创建 FileInputStream 对象 + FileInputStream fileInputStream = null; + try (FileOutputStream fileOutputStream = new FileOutputStream(zipFile); + ZipOutputStream zipOutputStream = new ZipOutputStream(fileOutputStream); + ){ +// // 实例化 FileOutputStream 对象 +// fileOutputStream = new FileOutputStream(zipFile); +// // 实例化 ZipOutputStream 对象 +// zipOutputStream = new ZipOutputStream(fileOutputStream); + // 创建 ZipEntry 对象 + ZipEntry zipEntry = null; + // 遍历源文件数组 + for (int i = 0; i < srcFiles.length; i++) { + // 将源文件数组中的当前文件读入 FileInputStream 流中 + fileInputStream = new FileInputStream(srcFiles[i]); + // 实例化 ZipEntry 对象,源文件数组中的当前文件 + zipEntry = new ZipEntry(srcFiles[i].getName()); + zipOutputStream.putNextEntry(zipEntry); + // 该变量记录每次真正读的字节个数 + int len; + // 定义每次读取的字节数组 + byte[] buffer = new byte[1024]; + while ((len = fileInputStream.read(buffer)) > 0) { + zipOutputStream.write(buffer, 0, len); + } + //数组中每个file使用完后,要关闭对应的FileInputStream流 + fileInputStream.close(); + } + } catch (IOException e) { + logger.info("导出zipFiles出错", e); + } finally { + try { + if(fileInputStream != null) fileInputStream.close(); + } catch (IOException e) { + logger.info("导出zipFiles, finally出错", e); + } + } + } + + /** + * @param name 压缩文件名,可以写为null保持默认 + */ + //递归压缩 + public static void compress(ZipOutputStream out, BufferedOutputStream bos, File input, String name) throws IOException { + FileInputStream fos = null; + BufferedInputStream bis = null; + try { + if (name == null) { + name = input.getName(); + } + //如果路径为目录(文件夹) + if (input.isDirectory()) { + //取出文件夹中的文件(或子文件夹) + File[] flist = input.listFiles(); + if (flist.length == 0)//如果文件夹为空,则只需在目的地zip文件中写入一个目录进入 + { + out.putNextEntry(new ZipEntry(name + File.separator)); + } else//如果文件夹不为空,则递归调用compress,文件夹中的每一个文件(或文件夹)进行压缩 + { + for (int i = 0; i < flist.length; i++) { + compress(out, bos, flist[i], name + File.separator + flist[i].getName()); + } + } + } else//如果不是目录(文件夹),即为文件,则先写入目录进入点,之后将文件写入zip文件中 + { + out.putNextEntry(new ZipEntry(name)); + fos = new FileInputStream(input); + bis = new BufferedInputStream(fos); + int len; + //将源文件写入到zip文件中 + byte[] buf = new byte[1024]; + while ((len = bis.read(buf)) != -1) { + bos.write(buf,0,len); + } + bis.close(); + fos.close(); + } + } finally { + if(bis != null) bis.close(); + if(fos != null) fos.close(); + } + } + + + /** + * 删除文件,可以是文件或文件夹 + * + * @param fileName + * 要删除的文件名 + * @return 删除成功返回true,否则返回false + */ + public static boolean delete(String fileName) { + File file = new File(fileName); + if (!file.exists()) { + System.out.println("删除文件失败:" + fileName + "不存在!"); + return false; + } else { + if (file.isFile()) + return deleteFile(fileName); + else + return deleteDirectory(fileName); + } + } + + /** + * 删除单个文件 + * @param fileName + * 要删除的文件的文件名 + * @return 单个文件删除成功返回true,否则返回false + */ + public static boolean deleteFile(String fileName) { + File file = new File(fileName); + // 如果文件路径所对应的文件存在,并且是一个文件,则直接删除 + if (file.exists() && file.isFile()) { + if (file.delete()) { + logger.info("删除单个文件" + fileName + "成功!"); + return true; + } else { + logger.info("删除单个文件" + fileName + "失败!"); + return false; + } + } else { + logger.info("删除单个文件失败:" + fileName + "不存在!"); + return false; + } + } + + /** + * 删除目录及目录下的文件 + * + * @param dir + * 要删除的目录的文件路径 + * @return 目录删除成功返回true,否则返回false + */ + public static boolean deleteDirectory(String dir) { + // 如果dir不以文件分隔符结尾,自动添加文件分隔符 + if (!dir.endsWith(File.separator)) + dir = dir + File.separator; + File dirFile = new File(dir); + // 如果dir对应的文件不存在,或者不是一个目录,则退出 + if ((!dirFile.exists()) || (!dirFile.isDirectory())) { + logger.info("删除目录失败:" + dir + "不存在!"); + return false; + } + boolean flag = true; + // 删除文件夹中的所有文件包括子目录 + File[] files = dirFile.listFiles(); + for (int i = 0; i < files.length; i++) { + // 删除子文件 + if (files[i].isFile()) { + flag = deleteFile(files[i].getAbsolutePath()); + if (!flag) + break; + } + // 删除子目录 + else if (files[i].isDirectory()) { + flag = deleteDirectory(files[i].getAbsolutePath()); + if (!flag) + break; + } + } + if (!flag) { + logger.info("删除目录失败!"); + return false; + } + // 删除当前目录 + if (dirFile.delete()) { + logger.info("删除目录" + dir + "成功!"); + return true; + } else { + return false; + } + } +} diff --git a/dongjian-dashboard-back-util/src/main/java/com/dongjian/dashboard/back/util/HttpUtil.java b/dongjian-dashboard-back-util/src/main/java/com/dongjian/dashboard/back/util/HttpUtil.java new file mode 100644 index 0000000..0893803 --- /dev/null +++ b/dongjian-dashboard-back-util/src/main/java/com/dongjian/dashboard/back/util/HttpUtil.java @@ -0,0 +1,195 @@ +package com.dongjian.dashboard.back.util; + +import java.io.*; +import java.net.HttpURLConnection; +import java.net.MalformedURLException; +import java.net.URL; +import java.util.*; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import com.alibaba.fastjson.JSONObject; + +public class HttpUtil { + + private static Logger logger = LoggerFactory.getLogger(HttpUtil.class); + + /** + * 向指定URL发送GET方法的请求 + * + * @param httpurl + * 请求参数用?拼接在url后边,请求参数应该是 name1=value1&name2=value2 的形式。 + * @return result 所代表远程资源的响应结果 + */ + public static String doGet(String httpurl, HashMap headerMap) { + System.out.printf("Get request, url:%s, header:%s\n", httpurl, JSONObject.toJSONString(headerMap)); + HttpURLConnection connection = null; + InputStream is = null; + BufferedReader br = null; + String result = null;// 返回结果字符串 + try { + // 创建远程url连接对象 + URL url = new URL(httpurl); + // 通过远程url连接对象打开一个连接,强转成httpURLConnection类 + connection = (HttpURLConnection) url.openConnection(); + //设置header + if (null != headerMap && !headerMap.isEmpty()) { + for (Map.Entry item : headerMap.entrySet()) { + connection.setRequestProperty(item.getKey().toString(),item.getValue().toString());//设置header + } + } + // 设置连接方式:get + connection.setRequestMethod("GET"); + // 设置连接主机服务器的超时时间:15000毫秒 + connection.setConnectTimeout(15000); + // 设置读取远程返回的数据时间:60000毫秒 + connection.setReadTimeout(60000); + // 发送请求 + connection.connect(); + // 通过connection连接,获取输入流 + if (connection.getResponseCode() == HttpURLConnection.HTTP_OK) { + is = connection.getInputStream(); + } else { + is = connection.getErrorStream(); + } + // 封装输入流is,并指定字符集 + br = new BufferedReader(new InputStreamReader(is, "UTF-8")); + // 存放数据 + StringBuffer sbf = new StringBuffer(); + String temp = null; + while ((temp = br.readLine()) != null) { + sbf.append(temp); + sbf.append("\r\n"); + } + result = sbf.toString(); + } catch (MalformedURLException e) { + e.printStackTrace(); + } catch (IOException e) { + e.printStackTrace(); + } catch (Exception e) { + e.printStackTrace(); + } finally { + // 关闭资源 + if (null != br) { + try { + br.close(); + } catch (IOException e) { + e.printStackTrace(); + } + } + + if (null != is) { + try { + is.close(); + } catch (IOException e) { + e.printStackTrace(); + } + } + + connection.disconnect();// 关闭远程连接 + } + + return result; + } + + + /** + * 向指定 URL 发送POST方法的请求 + * + * @param httpUrl + * 发送请求的 URL + * @param param + * 请求参数应该是{"key":"==g43sEvsUcbcunFv3mHkIzlHO4iiUIT R7WwXuSVKTK0yugJnZSlr6qNbxsL8OqCUAFyCDCoRKQ882m6cTTi0q9uCJsq JJvxS+8mZVRP/7lWfEVt8/N9mKplUA68SWJEPSXyz4MDeFam766KEyvqZ99d"}的形式。 + * @return 所代表远程资源的响应结果 + */ + public static String doPost(String httpUrl, String param, HashMap headerMap) { +// logger.info("doPost请求, url:{}, param:{}, headerMap:{}", httpUrl, param, JSONObject.toJSONString(headerMap)); + System.out.printf("Post request, url:%s, param:%s, header:%s\n", httpUrl, param, JSONObject.toJSONString(headerMap)); + HttpURLConnection connection = null; + InputStream is = null; + OutputStream os = null; + BufferedReader br = null; + String result = null; + try { + URL url = new URL(httpUrl); + // 通过远程url连接对象打开连接 + connection = (HttpURLConnection) url.openConnection(); + //设置header + if (null != headerMap && !headerMap.isEmpty()) { + for (Map.Entry item : headerMap.entrySet()) { + connection.setRequestProperty(item.getKey().toString(),item.getValue().toString());//设置header + } + } + // 设置连接请求方式 + connection.setRequestMethod("POST"); + // 设置连接主机服务器超时时间:15000毫秒 + connection.setConnectTimeout(15000); + // 设置读取主机服务器返回数据超时时间:60000毫秒 + connection.setReadTimeout(60000); + + // 默认值为:false,当向远程服务器传送数据/写数据时,需要设置为true + connection.setDoOutput(true); + // 默认值为:true,当前向远程服务读取数据时,设置为true,该参数可有可无 + connection.setDoInput(true); + // 设置传入参数的格式:请求参数应该是 name1=value1&name2=value2 的形式。 + if (null == headerMap || (!headerMap.containsKey("Content-Type") && !headerMap.containsKey("content-type"))) { + connection.setRequestProperty("Content-Type", "application/json"); + } + // 设置鉴权信息:Authorization: Bearer da3efcbf-0845-4fe3-8aba-ee040be542c0 + //connection.setRequestProperty("Authorization", "Bearer da3efcbf-0845-4fe3-8aba-ee040be542c0"); + // 通过连接对象获取一个输出流 + os = connection.getOutputStream(); + // 通过输出流对象将参数写出去/传输出去,它是通过字节数组写出的 + os.write(param.getBytes()); + // 通过连接对象获取一个输入流,向远程读取 + if (connection.getResponseCode() == HttpURLConnection.HTTP_OK) { + is = connection.getInputStream(); + } else { + is = connection.getErrorStream(); + } + // 对输入流对象进行包装:charset根据工作项目组的要求来设置 + br = new BufferedReader(new InputStreamReader(is, "UTF-8")); + + StringBuffer sbf = new StringBuffer(); + String temp = null; + // 循环遍历一行一行读取数据 + while ((temp = br.readLine()) != null) { + sbf.append(temp); + sbf.append("\r\n"); + } + result = sbf.toString(); + } catch (MalformedURLException e) { + e.printStackTrace(); + } catch (IOException e) { + e.printStackTrace(); + } finally { + // 关闭资源 + if (null != br) { + try { + br.close(); + } catch (IOException e) { + e.printStackTrace(); + } + } + if (null != os) { + try { + os.close(); + } catch (IOException e) { + e.printStackTrace(); + } + } + if (null != is) { + try { + is.close(); + } catch (IOException e) { + e.printStackTrace(); + } + } + // 断开与远程地址url的连接 + connection.disconnect(); + } + return result; + } + +} + diff --git a/dongjian-dashboard-back-util/src/main/java/com/dongjian/dashboard/back/util/NetworkUtil.java b/dongjian-dashboard-back-util/src/main/java/com/dongjian/dashboard/back/util/NetworkUtil.java new file mode 100644 index 0000000..defbb4f --- /dev/null +++ b/dongjian-dashboard-back-util/src/main/java/com/dongjian/dashboard/back/util/NetworkUtil.java @@ -0,0 +1,73 @@ +package com.dongjian.dashboard.back.util; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import jakarta.servlet.http.HttpServletRequest; + +import java.io.IOException; + +/** + * 常用获取客户端信息的工具 + */ +public class NetworkUtil { + private static Logger logger = LoggerFactory.getLogger(NetworkUtil.class); + /** + * 获取请求主机IP地址,如果通过代理进来,则透过防火墙获取真实IP地址; + * + * @param request + * @return + * @throws IOException + */ + public final static String getIpAddress(HttpServletRequest request) throws IOException { + // 获取请求主机IP地址,如果通过代理进来,则透过防火墙获取真实IP地址 + + String ip = request.getHeader("X-Forwarded-For"); + if (logger.isInfoEnabled()) { + logger.info("getIpAddress(HttpServletRequest) - X-Forwarded-For - String ip=" + ip); + } + + if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) { + if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) { + ip = request.getHeader("Proxy-Client-IP"); + if (logger.isInfoEnabled()) { + logger.info("getIpAddress(HttpServletRequest) - Proxy-Client-IP - String ip=" + ip); + } + } + if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) { + ip = request.getHeader("WL-Proxy-Client-IP"); + if (logger.isInfoEnabled()) { + logger.info("getIpAddress(HttpServletRequest) - WL-Proxy-Client-IP - String ip=" + ip); + } + } + if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) { + ip = request.getHeader("HTTP_CLIENT_IP"); + if (logger.isInfoEnabled()) { + logger.info("getIpAddress(HttpServletRequest) - HTTP_CLIENT_IP - String ip=" + ip); + } + } + if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) { + ip = request.getHeader("HTTP_X_FORWARDED_FOR"); + if (logger.isInfoEnabled()) { + logger.info("getIpAddress(HttpServletRequest) - HTTP_X_FORWARDED_FOR - String ip=" + ip); + } + } + if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) { + ip = request.getRemoteAddr(); + if (logger.isInfoEnabled()) { + logger.info("getIpAddress(HttpServletRequest) - getRemoteAddr - String ip=" + ip); + } + } + } else if (ip.length() > 15) { + String[] ips = ip.split(","); + for (int index = 0; index < ips.length; index++) { + String strIp = (String) ips[index]; + if (!("unknown".equalsIgnoreCase(strIp))) { + ip = strIp; + break; + } + } + } + return ip; + } +} diff --git a/dongjian-dashboard-back-util/src/main/java/com/dongjian/dashboard/back/util/RandomNumberUtil.java b/dongjian-dashboard-back-util/src/main/java/com/dongjian/dashboard/back/util/RandomNumberUtil.java new file mode 100644 index 0000000..9833bdc --- /dev/null +++ b/dongjian-dashboard-back-util/src/main/java/com/dongjian/dashboard/back/util/RandomNumberUtil.java @@ -0,0 +1,43 @@ +package com.dongjian.dashboard.back.util; + +import java.util.Random; + +/** +* @author Mr.Jiang +* @time 2022年5月5日 下午8:57:20 +*/ +public class RandomNumberUtil { + private RandomNumberUtil() { + } + public static String createRandomNumber(int length) { + StringBuilder strBuffer = new StringBuilder(); + Random rd = new Random(); + for (int i = 0; i < length; i++) { + strBuffer.append(rd.nextInt(10)); + } + return strBuffer.toString(); + } + + + //生成随机数字和字母, + public static String createRandomLowerLetterAndNumber(int length) { + String val = ""; + Random random = new Random(); + //参数length,表示生成几位随机数 + for(int i = 0; i < length; i++) { + String charOrNum = random.nextInt(2) % 2 == 0 ? "char" : "num"; + //输出字母还是数字 + if( "char".equalsIgnoreCase(charOrNum) ) { + //输出是大写字母还是小写字母 +// int temp = random.nextInt(2) % 2 == 0 ? 65 : 97; + //输出小写字母 + int temp = 97; + val += (char)(random.nextInt(26) + temp); + } else if( "num".equalsIgnoreCase(charOrNum) ) { + val += String.valueOf(random.nextInt(10)); + } + } + return val; + } +} + diff --git a/dongjian-dashboard-back-util/src/main/java/com/dongjian/dashboard/back/util/SendMail.java b/dongjian-dashboard-back-util/src/main/java/com/dongjian/dashboard/back/util/SendMail.java new file mode 100644 index 0000000..b9a2a79 --- /dev/null +++ b/dongjian-dashboard-back-util/src/main/java/com/dongjian/dashboard/back/util/SendMail.java @@ -0,0 +1,260 @@ +package com.dongjian.dashboard.back.util; + +import org.apache.commons.lang3.StringUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import javax.mail.*; +import javax.mail.internet.InternetAddress; +import javax.mail.internet.MimeMessage; +import javax.mail.internet.MimeUtility; +import java.io.*; +import java.security.Security; +import java.util.Date; +import java.util.Properties; + + +public class SendMail { + private static Logger logger = LoggerFactory.getLogger(SendMail.class); + /** + * Message对象将存储我们实际发送的电子邮件信息, + * Message对象被作为一个MimeMessage对象来创建并且需要知道应当选择哪一个JavaMail session。 + */ + private MimeMessage message; + + /** + * Session类代表JavaMail中的一个邮件会话。 + * 每一个基于JavaMail的应用程序至少有一个Session(可以有任意多的Session)。 + * + * JavaMail需要Properties来创建一个session对象。 寻找"mail.smtp.host" 属性值就是发送邮件的主机 + * 寻找"mail.smtp.auth" 身份验证,目前免费邮件服务器都需要这一项 + */ + private Session session; + + /*** + * 邮件是既可以被发送也可以被受到。JavaMail使用了两个不同的类来完成这两个功能:Transport 和 Store。 Transport + * 是用来发送信息的,而Store用来收信。对于我们只需要用到Transport对象。 + */ + private Transport transport; + + private String mailHost = ""; + private int mailPort = 25; + private String sender_username = ""; + private String sender_password = ""; + private String email_sendername = ""; + private boolean mailSsl = false; + private boolean password_encrypted = false; + private String mail_from=""; + private Properties properties = new Properties(); + + /* + * 初始化方法 + */ + public SendMail(boolean debug) { + InputStream in = SendMail.class.getResourceAsStream("/config/application.properties"); + if (null == in) { + //升级springboot版本后修改了pom文件,部署到linux时,如果jar包不包含application.properties文件,用上面的方法读取不到,用下面这个防止为空 + String filePath = System.getProperty("user.dir") + "/config/application.properties"; + try { + in = new BufferedInputStream(new FileInputStream(filePath)); + } catch (FileNotFoundException e1) { + logger.error("发送邮件加载application.properties出错:{}", e1.getMessage()); + } + } + String rawPassword = ""; + try { + properties.load(in); + this.mailHost = properties.getProperty("mail.smtp.host"); + this.mailPort = CommonUtil.String2Int(properties.getProperty("mail.smtp.port")); + this.mailSsl = Boolean.valueOf(properties.getProperty("mail.smtp.ssl")) ; + this.sender_username = properties.getProperty("mail.sender.username"); + rawPassword = properties.getProperty("mail.sender.password"); + this.email_sendername = URLCoder.urlDecoder(properties.getProperty("mail.sender.sendername")); + this.password_encrypted = Boolean.valueOf(properties.getProperty("mail.sender.password_encrypted")); + String fromString = properties.getProperty("mail.sender.from"); + this.mail_from = (fromString == null?sender_username:fromString); + } catch (IOException e) { + logger.error("mail参数初始化失败", e); + } + if (this.password_encrypted) { + try { + this.sender_password = DESUtil.decrypt(rawPassword, "ci3b512jwy199511"); + } catch (Exception e) { + e.printStackTrace(); + } + }else { + this.sender_password = rawPassword; + } + session = Session.getInstance(properties); + session.setDebug(debug);// 开启后有调试信息 + message = new MimeMessage(session); + } + /** + * + * @param subject + * @param sendHtml + * @param receiveUser + */ + public void sendMail(String subject, String sendHtml, String receiveUser, String cc){ + if(this.mailSsl) { + sendMailSsl(subject, sendHtml, receiveUser, cc); + }else { + doSendHtmlEmail25(subject, sendHtml, receiveUser, cc); + } + } + + /** + * 发送邮件 + * + * @param subject + * 邮件主题 + * @param sendHtml + * 邮件内容 + * @param receiveUser + * 收件人地址 + * @param cc + */ + public void doSendHtmlEmail25(String subject, String sendHtml, String receiveUser, String cc) { + try { + // 发件人 + // InternetAddress from = new InternetAddress(sender_username); + // 下面这个是设置发送人的Nick name + InternetAddress from = new InternetAddress( + MimeUtility.encodeWord(email_sendername) + " <" + mail_from + ">"); + message.setFrom(from); + + // 收件人 + InternetAddress to = new InternetAddress(receiveUser); + message.setRecipient(Message.RecipientType.TO, to);// 还可以有CC、BCC +// InternetAddress cto = new InternetAddress(mail_from); +// message.setRecipient(Message.RecipientType.CC, cto); + if (StringUtils.isNotBlank(cc)) { + message.setRecipients(Message.RecipientType.CC, InternetAddress.parse(cc)); + } + + // 邮件主题 + message.setSubject(subject); + + String content = sendHtml.toString(); + // 邮件内容,也可以使纯文本"text/plain" + message.setContent(content, "text/html;charset=UTF-8"); + + // 保存邮件 + message.saveChanges(); + + transport = session.getTransport("smtp"); + // smtp验证,就是你用来发邮件的邮箱用户名密码 + transport.connect(mailHost, mailPort,sender_username, sender_password); + // 发送 + transport.sendMessage(message, message.getAllRecipients()); + // System.out.println("send success!"); + } catch (Exception e) { + logger.error("doSendHtmlEmail25出错", e); + } finally { + if (transport != null) { + try { + transport.close(); + } catch (MessagingException e) { + logger.error("doSendHtmlEmail25 transport出错", e); + } + } + } + } + + + public void sendMailSsl(String subject, String sendHtml, String receiveUser, String cc){ + try { +// Security.addProvider(new com.sun.net.ssl.internal.ssl.Provider()); + final String SSL_FACTORY = "javax.net.ssl.SSLSocketFactory"; + final Properties p = System.getProperties() ; + p.setProperty("mail.smtp.host", mailHost); + p.setProperty("mail.smtp.auth", "true"); + p.setProperty("mail.smtp.ssl.protocols", "TLSv1.2"); + p.setProperty("mail.smtp.user", sender_username); + p.setProperty("mail.smtp.pass", sender_password); + + p.setProperty("mail.smtp.socketFactory.class", SSL_FACTORY); + p.setProperty("mail.smtp.socketFactory.fallback", "false"); + //邮箱发送服务器端口,这里设置为465端口 + p.setProperty("mail.smtp.port", mailPort+""); + p.setProperty("mail.smtp.socketFactory.port",mailPort+""); + + // 根据邮件会话属性和密码验证器构造一个发送邮件的session + Session session = Session.getInstance(p, new Authenticator(){ + protected PasswordAuthentication getPasswordAuthentication() { + return new PasswordAuthentication(p.getProperty("mail.smtp.user"),p.getProperty("mail.smtp.pass")); + } + }); + session.setDebug(true); + Message message = new MimeMessage(session); + //消息发送的主题 + message.setSubject(subject); + //接受消息的人 + message.setReplyTo(InternetAddress.parse(mail_from)); + + //消息的发送者 + + InternetAddress from = new InternetAddress( + MimeUtility.encodeWord(email_sendername) + " <" + mail_from + ">"); + message.setFrom(from); + +// message.setFrom(new InternetAddress(p.getProperty("mail.smtp.user"),sender_username)); + // 创建邮件的接收者地址,并设置到邮件消息中 +// String[] split = receiveUser.split(","); +// InternetAddress []tos = new InternetAddress[split.length]; +// for (int i = 0; i < split.length; i++) { +// tos[i]=new InternetAddress(split[i]); +// } + // 设置抄送人 +// if (cc != null && cc.length() > 0) { +// message.setRecipients(Message.RecipientType.CC, InternetAddress.parse(cc)); +// } + //message.setRecipients(Message.RecipientType.TO, tos); + + InternetAddress to = new InternetAddress(receiveUser); + message.setRecipient(Message.RecipientType.TO, to);// 还可以有CC、BCC +// InternetAddress cto = new InternetAddress(mail_from); +// message.setRecipient(Message.RecipientType.CC, cto); + if (StringUtils.isNotBlank(cc)) { + message.setRecipients(Message.RecipientType.CC, InternetAddress.parse(cc)); + } + + + // 消息发送的时间 + message.setSentDate(new Date()); + + String content = sendHtml.toString(); + // 邮件内容,也可以使纯文本"text/plain" + message.setContent(content, "text/html;charset=UTF-8"); + +// Multipart mainPart = new MimeMultipart(); +// // 创建一个包含HTML内容的MimeBodyPart +// BodyPart html = new MimeBodyPart(); +// // 设置HTML内容 +// html.setContent(sendHtml+ email_urlinfo, "text/html; charset=utf-8"); +// mainPart.addBodyPart(html); +// // 将MiniMultipart对象设置为邮件内容 +// message.setContent(mainPart); +// // 设置附件 +//// if (fileList != null && fileList.length > 0) { +//// for (int i = 0; i < fileList.length; i++) { +//// html = new MimeBodyPart(); +//// FileDataSource fds = new FileDataSource(fileList[i]); +//// html.setDataHandler(new DataHandler(fds)); +//// html.setFileName(MimeUtility.encodeText(fds.getName(), "UTF-8", "B")); +//// mainPart.addBodyPart(html); +//// } +//// } +// message.setContent(mainPart); + message.saveChanges(); + Transport.send(message); + } catch (MessagingException e) { + logger.error("sendMail--error:"+e.getMessage(),e); + e.printStackTrace(); + } catch (UnsupportedEncodingException e) { + logger.error("sendMail--error:"+e.getMessage(),e); + e.printStackTrace(); + } + } + +} \ No newline at end of file diff --git a/dongjian-dashboard-back-util/src/main/java/com/dongjian/dashboard/back/util/ServiceUtil.java b/dongjian-dashboard-back-util/src/main/java/com/dongjian/dashboard/back/util/ServiceUtil.java new file mode 100644 index 0000000..1f5139a --- /dev/null +++ b/dongjian-dashboard-back-util/src/main/java/com/dongjian/dashboard/back/util/ServiceUtil.java @@ -0,0 +1,125 @@ +package com.dongjian.dashboard.back.util; + +import java.security.MessageDigest; +import java.security.NoSuchAlgorithmException; +import java.util.*; + +import org.apache.commons.lang3.RandomStringUtils; + +/** + * 在处理业务是对参数进行处理的类 + */ +public class ServiceUtil { + + /** + * 把以‘,’号分隔的区域转换为区域数组 + * 如把"重庆#北京#上海"转换为一个列表,包含三个元素,重庆、北京、上海 + * + * @param areas 形如"重庆#北京#上海"的字符串 + * @return 链表 + */ + public static List getAreas(String areas) { + if (isEmpty(areas)) { + return null; + } + List areasList = null; + String[] areaArray = areas.split(","); + if (areaArray.length > 0) { + areasList = new ArrayList(); + for (String s : areaArray) { + areasList.add(s); + } + } + return areasList; + } + + /** + * 把以‘,’号分隔的区域转换为数据库Province In (?) 中问号中应有的形式 + * + * @param areas + * @return + */ + public static String getAreasAsString(String areas) { + if (isEmpty(areas)) { + return null; + } + + StringBuilder builder = new StringBuilder(256); + String[] areaArray = areas.split(","); + boolean bFirst = true; + for (String s : areaArray) { + if (!bFirst) { + builder.append(","); + } + builder.append("\'"); + builder.append(s); + builder.append("\'"); + bFirst = false; + } + return builder.toString(); + } + + public static boolean isEmpty(String str){ + if (str ==null ||"".equals(str)) + return true; + return false; + } + + /** + * 生成随机字符串 + * @param length 表示生成字符串的长度 + * @return + */ + public static String getRandomString(int length) { + String base = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789~!@$%^*()"; +// Random random = new Random(); +// StringBuffer sb = new StringBuffer(); +// for (int i = 0; i < length; i++) { +// int number = random.nextInt(base.length()); +// sb.append(base.charAt(number)); +// } + return RandomStringUtils.random(length, base); + } + + public static Date getCurrentDay(){ + Calendar day=Calendar.getInstance(); + day.set(Calendar.HOUR_OF_DAY,0); + day.set(Calendar.MINUTE,0); + day.set(Calendar.SECOND,0); + day.set(Calendar.MILLISECOND,0); + return day.getTime(); + } + + + public static String CreateAccessToken(String userId,String timestamp){ + String[] paramArr = new String[]{userId,timestamp}; + Arrays.sort(paramArr); + String content = paramArr[0].concat(paramArr[1]); + String access_token = null; + try { + MessageDigest md = MessageDigest.getInstance("SHA-1"); + byte[] digest = md.digest(content.toString().getBytes()); + access_token = byteToStr(digest); + } catch (NoSuchAlgorithmException e) { + e.printStackTrace(); + } + return access_token; + } + + private static String byteToStr(byte[] byteArray){ + String strDigest=""; + for(int i=0;i>> 4) & 0X0F]; + tempArr[1] = Digit[mByte & 0X0F]; + String s = new String(tempArr); + return s; + } +} diff --git a/dongjian-dashboard-back-util/src/main/java/com/dongjian/dashboard/back/util/TimeIntervalSplitter.java b/dongjian-dashboard-back-util/src/main/java/com/dongjian/dashboard/back/util/TimeIntervalSplitter.java new file mode 100644 index 0000000..23c1c5d --- /dev/null +++ b/dongjian-dashboard-back-util/src/main/java/com/dongjian/dashboard/back/util/TimeIntervalSplitter.java @@ -0,0 +1,36 @@ +package com.dongjian.dashboard.back.util; + +import java.util.ArrayList; +import java.util.List; + +import com.dongjian.dashboard.back.util.aurora.TimeInterval; + +public class TimeIntervalSplitter { + + public static void main(String[] args) { + long startTime = 1609430400000L; // 起始时间戳,2021-01-01 00:00:00 + long endTime = 1609513500000L; // 结束时间戳,2021-01-02 00:00:00 + long intervalInMilliseconds = 3600000; // 固定时间间隔为1小时(3600秒) + + List timeIntervals = splitTimeRange(startTime, endTime, intervalInMilliseconds); + + for (TimeInterval interval : timeIntervals) { + System.out.println("[" + interval.getStartTime() + ", " + interval.getEndTime() + "]"); + } + } + + public static List splitTimeRange(long startTime, long endTime, long intervalInMilliseconds) { + List timeIntervals = new ArrayList<>(); + + long current = startTime; + while (current < endTime) { + long intervalEnd = Math.min(current + intervalInMilliseconds, endTime); + TimeInterval interval = new TimeInterval(current, intervalEnd); + timeIntervals.add(interval); + current += intervalInMilliseconds; + } + + return timeIntervals; + } + +} diff --git a/dongjian-dashboard-back-util/src/main/java/com/dongjian/dashboard/back/util/URLCoder.java b/dongjian-dashboard-back-util/src/main/java/com/dongjian/dashboard/back/util/URLCoder.java new file mode 100644 index 0000000..c1df317 --- /dev/null +++ b/dongjian-dashboard-back-util/src/main/java/com/dongjian/dashboard/back/util/URLCoder.java @@ -0,0 +1,54 @@ +package com.dongjian.dashboard.back.util; +import java.io.UnsupportedEncodingException; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** +* @author Mr.Jiang +* @time 2022年8月3日 下午9:29:28 +*/ +public class URLCoder { + + private static Logger logger = LoggerFactory.getLogger(URLCoder.class); + + public static String urlEncoder(String str) { + logger.info("url待编码:{}", str); + String result = ""; + if (null == str) { + return ""; + } + try { + result = java.net.URLEncoder.encode(str, "UTF-8"); + } catch (UnsupportedEncodingException e) { + e.printStackTrace(); + } + logger.info("url编码结果:{}", result); + return result; + } + + public static String urlDecoder(String str) { + logger.info("url待解码:{}", str); + String result = ""; + if (null == str) { + return ""; + } + try { + result = java.net.URLDecoder.decode(str, "UTF-8"); + } catch (UnsupportedEncodingException e) { + e.printStackTrace(); + } + logger.info("url解码结果:{}", result); + return result; + } + + public static void main(String[] args) { + // TODO Auto-generated method stub + String s = urlEncoder("DriveMate安全運転管理クラウド"); + System.out.println("编码:"+s); + String s1 = urlDecoder(s); + System.out.println("解码:"+s1); + + } + +} diff --git a/dongjian-dashboard-back-util/src/main/java/com/dongjian/dashboard/back/util/ValidatorUtil.java b/dongjian-dashboard-back-util/src/main/java/com/dongjian/dashboard/back/util/ValidatorUtil.java new file mode 100644 index 0000000..ad00810 --- /dev/null +++ b/dongjian-dashboard-back-util/src/main/java/com/dongjian/dashboard/back/util/ValidatorUtil.java @@ -0,0 +1,887 @@ +package com.dongjian.dashboard.back.util; + +import org.apache.commons.lang3.StringUtils; +import org.apache.commons.lang3.time.DateFormatUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.io.UnsupportedEncodingException; +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.util.Date; +import java.util.HashMap; +import java.util.Map; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +/** + * 验证工具类 + */ +public class ValidatorUtil { + private static Logger logger = LoggerFactory.getLogger(ValidatorUtil.class); + + private static final String pwdMatch = "(?!^\\d+$)(?!^[A-Za-z]+$)(?!^[^A-Za-z0-9]+$)(?!^.*[\\u4E00-\\u9FA5].*$)^\\S{8,20}$"; + + private static final String ipAddrMatch = "^((\\d|[1-9]\\d|1\\d\\d|2[0-4]\\d|25[0-5])\\.){3}(\\d|[1-9]\\d|1\\d\\d|2[0-4]\\d|25[0-5])$"; + + + /** + * 验证必填 + * @param value 验证的值 + * @param parameterName 参数名称 + * @param required 是否必填;true:必填;false:不必填 + * @param errorMap 存放错误消息 + * @return true: 验证通过;false:未通过 + */ + public static boolean validParameterRequired(Object value,String parameterName,boolean required,Map errorMap){ + if(errorMap == null){ + errorMap = new HashMap<>(); + } + if(required){ + if(value == null){ + errorMap.put(parameterName,"不能为空"); + return false; + }else if(value instanceof Date){ + + }else{ + String v = String.valueOf(value); + if (value == null || v.length() == 0 || "".equals(v.trim())) { + errorMap.put(parameterName,"不能为空"); + return false; + } + } + } + return true; + } + + /** + * 验证是一个日期 + * @param date 验证的值 + * @param parameterName 参数名称 + * @param required 是否必填;true:必填;false:不必填 + * @param errorMap 存放错误消息 + * @return true: 验证通过;false:未通过 + */ + public static boolean validParameterDateAlert(Object date,String parameterName,boolean required,Map errorMap){ + if(errorMap == null){ + errorMap = new HashMap<>(); + } + if(!validParameterRequired(date, parameterName, required, errorMap)){ + return false; + } + if(!(date instanceof Date) && null != date){ + String v = String.valueOf(date); + //说明已填写:验证是否为日期格式 + if(null != v && v.length()>0){ + if(!isDate(v)){ + errorMap.put(parameterName,"不是一个日期格式;格式:(例如:2017-02-27)"); + return false; + } + } + } + + return true; + } + + /** + * 验证是否在指定日期之前 + * @param targetDate 目标日期 + * @param beforeDate 之前的日期 + * @param parameterName 参数名称 + * @param required 是否必填;true:必填;false:不必填 + * @param errorMap 存放错误消息 + * @return true: 验证通过;false:未通过 + */ + public static boolean validParameterDateBeforeAlert(Object targetDate,Object beforeDate,String parameterName,boolean required,Map errorMap){ + if(errorMap == null){ + errorMap = new HashMap<>(); + } + if(!validParameterDateAlert(beforeDate,parameterName,required,errorMap)){ + return false; + } + + if(!(targetDate instanceof Date)){ + String before = String.valueOf(beforeDate); + //说明已填写:验证是否在指定日期之前 + if(null == before || before.length()<=0 || !isDate(beforeDate)){ + return true; + } + } + + if(!isDateBefore(targetDate, beforeDate)){ + errorMap.put(parameterName,"[ "+dateFormat(beforeDate)+" ] 不是 [ "+dateFormat(targetDate)+" ]之前的一个日期。"); + return false; + } + + return true; + } + + /** + * 验证是否在指定日期之后 + * @param targetDate 目标日期 + * @param afterDate 之后的日期 + * @param parameterName 参数名称 + * @param required 是否必填;true:必填;false:不必填 + * @param errorMap 存放错误消息 + * @return true: 验证通过;false:未通过 + */ + public static boolean validParameterDateAfterAlert(Object targetDate,Object afterDate,String parameterName,boolean required,Map errorMap){ + if(errorMap == null){ + errorMap = new HashMap<>(); + } + if(!validParameterDateAlert(afterDate,parameterName,required,errorMap)){ + return false; + } + if(!(afterDate instanceof Date)){ + String after = String.valueOf(afterDate); + //说明已填写:验证是否在指定日期之后 + if(null == after || after.length()<=0 || !isDate(afterDate)){ + return true; + } + } + if(!isDateAfter(targetDate, afterDate)){ + errorMap.put(parameterName,"[ "+dateFormat(afterDate)+" ]不是[ "+dateFormat(targetDate)+" ]之后的一个日期。"); + return false; + } + return true; + } + + /** + * 验证日期是否在指定的开始日期-结束日期之间(不包含开始日期、结束日期) + * @param beginDate 开始日期 + * @param endDate 结束日期 + * @param date 比较的日期 + * @param parameterName 参数名称 + * @param required 是否必填;true:必填;false:不必填 + * @param errorMap 存放错误消息 + * @return + */ + public static boolean validParameterBetweenDateAlert(Object beginDate,Object endDate,Object date,String parameterName,boolean required,Map errorMap){ + if(errorMap == null){ + errorMap = new HashMap<>(); + } + if(!validParameterDateAlert(date,parameterName,required,errorMap)){ + return false; + } + + if(!(date instanceof Date)){ + String d = String.valueOf(date); + if(null == d || d.length()<=0 || !isDate(date)){ + return true; + } + } + + if(!isDateBetween(beginDate, endDate,date)){ + errorMap.put(parameterName,"[ "+dateFormat(date)+" ]必须在[ "+dateFormat(beginDate)+" ]-[ "+dateFormat(endDate)+" ]之间。"); + return false; + } + return true; + } + + /** + * 日期格式化 yyyy-MM-dd + * @param date 日期 + * @return + */ + private static String dateFormat(Object date){ + if(date instanceof Date){ + return DateFormatUtils.format((Date) date,"yyyy-MM-dd"); + } + return String.valueOf(date); + } + + + /** + * 校验参数方法. + * + * @param target 需要校验的目标字符串 + * @param fieldName 错误信息绑定的属性名 + * @param isrequired 是否必填 + * @param minLength 最小长度 + * @param maxLength 最大长度 + * @param dateType data type + * 1.字符串为数字, + * 2. 字符串为“0”---”9”, ”a”---”z”,”A”---”Z” ; + * 3.字符串为values中的值 + * 4.任意字符串 + * 5.IP + * 6.Email地址 + * 7.电话号码(移动电话:18000000000、固定电话:023-6500000、400电话) + * 8:电话号码不符合要求:移动号码 + * 9:电话号码不符合要求:座机(固定电话) + * 10:电话号码不符合要求:4000000000 + * 11:日期格式:2017-02-27 + * 12: 数字或者小数:1 或者 -1 或者 0.1 或者 -0.1 + * @param errorMap 错误信息Map + * @return true:success;false: failed + * @version + */ + public static boolean validParameterAlert2(Object target, String fieldName, boolean isrequired, + int minLength, int maxLength, int dateType, Map errorMap) { + return (validParameterAlert(target, fieldName, isrequired, minLength, maxLength, dateType, null, errorMap)==0); + } + + + /** + * 校验参数方法. + * + * @param target 需要校验的目标字符串 + * @param fieldName 错误信息绑定的属性名 + * @param isrequired 是否必填 + * @param minLength 最小长度 + * @param maxLength 最大长度 + * @param dataType data type + * 1.字符串为数字, + * 2. 字符串为“0”---”9”, ”a”---”z”,”A”---”Z” ; + * 3.字符串为values中的值 + * 4.任意字符串 + * 5.IP + * 6.Email地址 + * 7.电话号码(移动电话:18000000000、固定电话:023-6500000、400电话) + * 8:电话号码不符合要求:移动号码 + * 9:电话号码不符合要求:座机(固定电话) + * 10:电话号码不符合要求:4000000000 + * 11:日期格式:2017-02-27 + * 12: 数字或者小数:1 或者 -1 或者 0.1 或者 -0.1 + * @param errorMap 错误信息Map + * @return int 0:success, other failure + * @version + */ + public static int validParameterAlert(Object target, String fieldName, boolean isrequired, + int minLength, int maxLength, int dataType, Map errorMap) { + return validParameterAlert(target, fieldName, isrequired, minLength, maxLength, dataType, null, errorMap); + } + + /** + * 校验参数方法. + * + * @param target 需要校验的目标字符串 + * @param fieldName 错误信息绑定的属性名 + * @param required 是否必填 + * @param minLength 最小长度 + * @param maxLength 最大长度 + * @param dataType data type + * 1.字符串为数字, + * 2. 字符串为“0”---”9”, ”a”---”z”,”A”---”Z” ; + * 3.字符串为values中的值 + * 4.任意字符串 + * 5.IP + * 6.Email地址 + * 7.电话号码(移动电话:18000000000、固定电话:023-6500000、400电话) + * 8:电话号码不符合要求:移动号码 + * 9:电话号码不符合要求:座机(固定电话) + * 10:电话号码不符合要求:4000000000 + * 11:日期格式:2017-02-27 + * 12: 数字或者小数:1 或者 -1 或者 0.1 或者 -0.1 + * @param errorMap 错误信息Map + * @return int 0:success, other failure + * @version + */ + public static int validParameterAlert(Object target, String fieldName, boolean required, + int minLength, int maxLength, int dataType, String[] values, Map errorMap) { + int resultCode = 0; + try { + resultCode = ValidatorUtil.validParameter(target, required, minLength, maxLength, dataType, values); + } catch (Exception e) { + throw new RuntimeException(e); + } + /** + * 1:必填但没填写 + * 2:不符合要求的长度范围,限制最小长度 + * 3:包含单双引号 + * 4:非数字 + * 5 不符合handletype为2所要求的值 + * 6不符合handletype为3所要求的值 + * 7:不符合要求的ip地址 + * 8 大于要求的最大长度,不限制最小长度 + * 9 不符合要求的email地址 + */ + switch (resultCode) { + case 0: + return resultCode; + case 1: + errorMap.put(fieldName, "不能为空"); + break; + case 2: + if (minLength != maxLength) { + errorMap.put(fieldName, "不能少于" + minLength + + "且不能超过" + maxLength + "个字符"); + } else { + errorMap.put(fieldName, "应该为" + minLength + "个字符"); + } + break; + case 3: + errorMap.put(fieldName, "不允许带有单引号或双引号"); + break; + case 4: + errorMap.put(fieldName, "必须是数字"); + break; + case 5: + errorMap.put(fieldName, "不能超过" + maxLength + "个字符,并且只能是数字和字母"); + break; + case 6:// no this + if (null != values && values.length > 0) { + String str = ""; + for (String v : values) { + str += str.equals("") ? v : ", " + v; + } + errorMap.put(fieldName, "只能是 [" + str + "] 范围的值"); + } + break; + case 7: + errorMap.put(fieldName, "请填写" + "正确的IP地址"); + break; + case 8: + errorMap.put(fieldName, "不能少于" + maxLength + "个字符"); + break; + case 9: + errorMap.put(fieldName, "请填写正确的电子邮箱地址"); + break; + case 10: + errorMap.put(fieldName, "请填写正确的电话号码;格式:移动号码(例如:18000000000) 或者 座机(固定电话)(例如:023-6666666) 或者 400 电话号码(例如:4000000000)"); + break; + case 11: + errorMap.put(fieldName, "请填写正确的电话号码;格式:移动号码(例如:18000000000)"); + break; + case 12: + errorMap.put(fieldName, "请填写正确的电话号码;格式:座机(固定电话)(例如:023-6666666)"); + break; + case 13: + errorMap.put(fieldName, "请填写正确的电话号码;格式:400 电话号码(例如:4000000000)"); + break; + case 14: + errorMap.put(fieldName, "请填写正确的日期;格式:(例如:2017-02-01)"); + break; + case 15: + errorMap.put(fieldName, "请填写正确的数值;整数或者小数 格式:(1 或者 -1 或者 0.1 或者 -0.1)"); + break; + default:// hand type is not correct + resultCode = 99; + break; + } + return resultCode; + } + + /** + * 预处理参数,默认值、长度等 + * + * @param target 参数 + * @param required 必填 + * @param minLength 是已经填写了值的情况下的参数最小参数,即最少填写1 + * @param maxLength 参数最大长度 + * @param dataType 数据类型 + * 1.字符串为数字, + * 2. 字符串为“0”---”9”, ”a”---”z”,”A”---”Z” ; + * 3.字符串为values中的值 + * 4.任意字符串 + * 5.IP + * 6.Email地址 + * 7.电话号码(移动电话:18000000000、固定电话:023-6500000、400电话) + * 8:电话号码不符合要求:移动号码 + * 9:电话号码不符合要求:座机(固定电话) + * 10:电话号码不符合要求:4000000000 + * 11:日期格式:2017-02-27 + * 12: 数字或者小数:1 或者 -1 或者 0.1 或者 -0.1 + * @param values 参数列表值 + * @return int 0:ok + * 1:必填但没填写 + * 2:不符合要求的长度范围,限制最小长度 + * 3:包含单双引号 + * 4:非数字 + * 5:不符合handletype为2所要求的值 + * 6:不符合handletype为3所要求的值 + * 7:不符合要求的ip地址 + * 8:大于要求的最大长度,不限制最小长度 + * 9:不符合要求的email地址 + * 10: 电话号码不符合要求:移动号码 或者 座机 或者 400 电话号码 + * 11:电话号码不符合要求:移动号码 + * 12:电话号码不符合要求:座机(固定电话) + * 13:电话号码不符合要求:4000000000 + * 14: 验证是日期格式:2017-02-27 + * 15: 数字或者小数:1 或者 -1 或者 0.1 或者 -0.1 + * @throws Exception the exception + */ + public static int validParameter(Object target, boolean required, int minLength, int maxLength, int dataType, String[] values) throws Exception { + int resultCode = 0; + String targetStr = ""; + if(null != target){ + targetStr = String.valueOf(target); + } + // 判断是否必填 + if (required && (null == target || targetStr.length() == 0 || "".equals(targetStr.trim()))) { + return 1; + }else if (null == target || targetStr.length() == 0 || "".equals(targetStr.trim())) { + return 0; + } + + //不是Date(日期)类型 + if(!(target instanceof Date)){ + int len = targetStr.length(); //默认 0 + if (minLength > 0 && (len < minLength || len > maxLength)) { + return 2; + }else if (len > maxLength) { + return 8; + } + // check whether contains ' and " character + if (targetStr.indexOf('\'') >= 0 || targetStr.indexOf('\"') >= 0) { + return 3; + } + } + switch (dataType) { // 1.字符串为数字 ; 2. 字符串为“0”---”9”, ”a”---”z”, + // ”A”---”Z” ;3 .字符串为values中的值 4.任意字符串 + case 1: + if (!isNumeric(targetStr)) { + resultCode = 4; + } + break; + case 2: + if (!isNumOrChar(targetStr)) { + resultCode = 5; + } + break; + case 3: + resultCode = 6; + if (values == null) { + break; + } + for (int i = 0; i < values.length; i++) { + String tmp = values[i]; + if (targetStr.toLowerCase().equals(tmp.toLowerCase())) { // 都转化为小写进行比较 + resultCode = 0; + break; + } + } + break; + case 4: + break; + case 5: + if (!isIp(targetStr)) { + resultCode = 7; + } + break; + case 6: + if (!isEmail(targetStr)) { + resultCode = 9; + } + break; + case 7: + if(!isPhoneNumber(targetStr)){ + resultCode = 10; + } + break; + case 8: //验证移动电话号码 + if(!isMobilePhone(targetStr)){ + resultCode = 11; + } + break; + case 9: //验证固定电话号码 + if(!isTelephone(targetStr)){ + resultCode = 12; + } + break; + case 10: //验证400电话 + if(!is400Phone(targetStr)){ + resultCode = 13; + } + break; + case 11: //验证是日期格式:2017-02-27 + if(!isDate(target)){ + resultCode = 14; + } + break; + case 12: //验证是数字或者小数(包含负数) + if(!isNumberOrDecimal(targetStr)){ + resultCode = 15; + } + break; + default: + resultCode = 99; + break; + } + return resultCode; + } + + + + /** + * 正则表达式验证 + * + * @param deststr 被检查字符串 + * @param regex 正则表达式 + * @return boolean ,true_符合正则表达式 + */ + public static boolean isRegex(String deststr, String regex) { + if (deststr == null || deststr.trim().length() == 0) { + return false; + } + return deststr.matches(regex); + } + + /** + * 数字验证 + * + * @param deststr 被检查字符串 + * @return boolean ,true_数字 + */ + public static boolean isNumeric(String deststr) { + return deststr.matches("\\d+"); + } + + /** + * 判断是数字或者小数(包含负数) + * @param str 检查的字符串 + * @return + */ + public static boolean isNumberOrDecimal(String str){ + return str.matches("(-?\\d+)|(-?\\d+\\.\\d+)"); + } + /** + * 邮箱验证 + * + * @param deststr 被检查字符串 + * @return boolean ,true_邮箱 + */ + public static boolean isEmail(String deststr) { + return deststr.matches("^\\w+([-+.]\\w+)*@\\w+([-.]\\w+)*\\.\\w+([-.]\\w+)*$"); + } + + /** + * 字符串是否由0--9,a--z,A--Z组成 + * + * @param deststr 被检查字符串 + * @return boolean ,true_字符串由0--9,a--z,A--Z组成 + */ + public static boolean isNumOrChar(String deststr) { + return deststr.matches("\\w+"); + } + + + /** + * 得到字符的长度,统一用UTF-8,汉字算三 + * + * @param tmp string + * @return int string length -1_表示返回错误,其他为字段长度 + */ + public static int getCharLength(String tmp) { + int len = 1; + try { + len = tmp.getBytes("UTF-8").length; + } catch (UnsupportedEncodingException e) { + len = -1; + } + return len; + } + + + /** + * IP检验 + * + * @param ip ip address + * @return boolean true:yes false:no + */ + public static boolean isIp(String ip) { + return ip.matches("([1-9]|[1-9]\\d|1\\d{2}|2[0-1]\\d|23[0-2])(\\.(\\d|[1-9]\\d|1\\d{2}|2[0-4]\\d|25[0-5])){3}"); + } + + /** + * 判断字符串是否为合法手机号 11位 13 14 15 18开头 + * + * @param str the str + * @return boolean boolean + */ + public static boolean isMobile(String str){ + if(isEmpty(str)) + return false; + return str.matches("^(13|14|15|18|17)\\d{9}$"); + } + + /** + * 判断是否为数字 + * + * @param str the str + * @return boolean boolean + */ + public static boolean isNumber(String str) { + try{ + Integer.parseInt(str); + return true; + }catch(Exception ex){ + return false; + } + } + + /** + * 判断字符串是否为非空(包含null与"") + * + * @param str the str + * @return boolean boolean + */ + public static boolean isNotEmpty(String str){ + if(str == null || "".equals(str)) + return false; + return true; + } + + /** + * 判断字符串是否为非空(包含null与""," ") + * + * @param str the str + * @return boolean boolean + */ + public static boolean isNotEmptyIgnoreBlank(String str){ + if(str == null || "".equals(str) || "".equals(str.trim())) + return false; + return true; + } + + /** + * 判断字符串是否为空(包含null与"") + * + * @param str the str + * @return boolean boolean + */ + public static boolean isEmpty(String str){ + if(str == null || "".equals(str)) + return true; + return false; + } + + /** + * 判断字符串是否为空(包含null与""," ") + * + * @param str the str + * @return boolean boolean + */ + public static boolean isEmptyIgnoreBlank(String str){ + if(str == null || "".equals(str) || "".equals(str.trim())) + return true; + return false; + } + + /** + * 判断是否为浮点数或者整数 + * + * @param str the str + * @return true Or false + */ + public static boolean isNumerOrFloat(String str){ + Pattern pattern = Pattern.compile("^(-?\\d+)(\\.\\d+)?$"); + Matcher isNum = pattern.matcher(str); + if( !isNum.matches() ){ + return false; + } + return true; + } + + /** + * 验证字符串是否是时间格式. + * + * @param dateStr 时间字符串 + * @param format 时间格式 默认为:yyyy-MM-dd HH:mm:ss + * @return 返回值 true:是时间格式 false:不是时间格式 + */ + public static boolean isValidDate(String dateStr, String format) { + if(dateStr == null || dateStr.trim().length() == 0) { + return false; + } + if(format == null || format.trim().length() == 0) { + format = "yyyy-MM-dd HH:mm:ss"; + } + SimpleDateFormat df = new SimpleDateFormat(format); + try { + df.parse(dateStr); + return true; + } catch (Exception e) { + return false; + } + } + + /** + * 验证电话号码 + * 匹配格式:17,13,15(除154),18 开头的移动号码 + * 匹配格式:座机电话如:023-600000000 + * 匹配格式:400电话;如:4000000000 + * @param phoneNumber + * @return + */ + public static boolean isPhoneNumber(String phoneNumber){ + if(null == phoneNumber){ + return false; + } + String regExp ="^((17[0-9])|(13[0-9])|(15[^4,\\D])|(18[0,5-9]))\\d{8}$|(0[0-9]{2,3}-[0-9]{7,8})$|(4\\d{9})$"; + Pattern p = Pattern.compile(regExp); + return p.matcher(phoneNumber).find(); + } + + + /** + * 验证移动电话 + * 匹配格式:17,13,15(除154),18 开头的移动号码 + * @param mobilePhone 电话号码 + * @return + */ + public static boolean isMobilePhone(String mobilePhone){ + if(null == mobilePhone){ + return false; + } + return mobilePhone.matches("^((17[0-9])|(13[0-9])|(15[^4,\\D])|(18[0,5-9]))\\d{8}$"); + } + + /** + * 验证固定电话号码 + * 匹配格式:座机电话如:023-600000000 + * @param telephone 电话号码 + * @return + */ + public static boolean isTelephone(String telephone){ + if(null == telephone){ + return false; + } + return telephone.matches("^0[0-9]{2,3}-[0-9]{7,8}$"); + } + + + /** + * 400电话号码 + * 匹配格式:400电话;如:4000000000 + * @param phoneNumber + * @return + */ + public static boolean is400Phone(String phoneNumber){ + if(null == phoneNumber){ + return false; + } + String regExp ="^4\\d{9}$"; + Pattern p = Pattern.compile(regExp); + return p.matcher(phoneNumber).find(); + } + + + /** + * 验证是否为日期格式 + * 格式:如:2017-02-27 + * 年:1000-9999 + * 月:01-12 + * 日:01-31 + * @param date 日期的字符串 + * @return true:是;false:否 + */ + public static boolean isDate(Object date){ + if(date == null){ + return false; + } + if(!(date instanceof Date)){ + SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd"); + format.setLenient(false); //这个的功能是不把2017-02-29 转换为2017-03-01(严格模式-平年的2月没有29日) + try { + Date parse = format.parse(String.valueOf(date)); + return true; + } catch (ParseException e) { +// e.printStackTrace(); + return false; + } + } + return true; +// return date.matches("^([^0,\\D])\\d{3}-((0[1-9]{1})|(1[0-2]{1}))-((0[1-9]{1})|([1-2]{1}[0-9]{1})|3[0-1]{1})$"); + } + + + /** + * 判断在某个日期之后 + * @param targetDate 目标日期 2017-02-27 + * @param afterDate 之后的日期 2017-02-28 + * @return true:是;false:否 + */ + public static boolean isDateAfter(Object targetDate,Object afterDate){ + if(isDate(targetDate) && isDate(afterDate)){ + Date target = null; + Date after = null; + SimpleDateFormat simpleDateFormat= new SimpleDateFormat("yyyy-MM-dd"); + try { + if(targetDate instanceof Date){ + target = simpleDateFormat.parse(simpleDateFormat.format((Date) targetDate)); + }else{ + target = simpleDateFormat.parse(String.valueOf(targetDate)); + } + if(afterDate instanceof Date){ + after = simpleDateFormat.parse(simpleDateFormat.format((Date) afterDate)); + }else{ + after = simpleDateFormat.parse(String.valueOf(afterDate)); + } + //after 在某个日期之后 + return after.after(target); + } catch (ParseException e) { + e.printStackTrace(); + } + } + return false; + } + + /** + * 验证在某日期之后 + * @param targetDate 目标日期 2017-02-21 + * @param beforeDate 之前的日期 2017-02-11 + * @return true:是;false:否 + */ + public static boolean isDateBefore(Object targetDate,Object beforeDate){ + if(isDate(targetDate) && isDate(beforeDate)){ + Date target = null; + Date before = null; + SimpleDateFormat simpleDateFormat= new SimpleDateFormat("yyyy-MM-dd"); + try { + if(targetDate instanceof Date){ + target = (Date) targetDate; + }else{ + target = simpleDateFormat.parse(String.valueOf(targetDate)); + } + if(beforeDate instanceof Date){ + before = (Date) beforeDate; + }else{ + before = simpleDateFormat.parse(String.valueOf(beforeDate)); + } + //before 在 目标日期 之前 + return before.before(target); + } catch (ParseException e) { + e.printStackTrace(); + } + } + return false; + } + + /** + * 判断在指定日期之间(不包含开始、结束日期) + * @param beginDate 开始日期 2017-01-01 + * @param endDate 结束日期 2017-03-10 + * @param date 比较日期 2017-02-10 + * @return + */ + public static boolean isDateBetween(Object beginDate,Object endDate,Object date){ + return (isDateAfter(beginDate,date) && isDateBefore(endDate,date)); + } + + + //禁止实例化 + private ValidatorUtil(){} + + /** + * 验证参数 + * @param errorMap + */ +// public static void validateParameter(Map errorMap){ +// if(!errorMap.isEmpty()){ +// throw new ParametersException(errorMap); +// } +// } + + public static boolean validPassWord(String newpwd) { + return newpwd.matches(pwdMatch); + } + + public static boolean validIpAddr(String ip) { + if (StringUtils.isBlank(ip)) { + return false; + } + return ip.matches(ipAddrMatch); + } + +} diff --git a/dongjian-dashboard-back-util/src/main/java/com/dongjian/dashboard/back/util/async/OptAsync.java b/dongjian-dashboard-back-util/src/main/java/com/dongjian/dashboard/back/util/async/OptAsync.java new file mode 100644 index 0000000..55d769e --- /dev/null +++ b/dongjian-dashboard-back-util/src/main/java/com/dongjian/dashboard/back/util/async/OptAsync.java @@ -0,0 +1,35 @@ +package com.dongjian.dashboard.back.util.async; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.scheduling.annotation.Async; +import org.springframework.stereotype.Component; + +import com.dongjian.dashboard.back.util.SendMail; + +/** + * 异步操作 + * @author jwy-style + */ +@Component +public class OptAsync{ + + private Logger logger = LoggerFactory.getLogger(OptAsync.class); + + + + @Async + public void doSendWork(String subject, String sendHtml, String receiveUser, String cc) { + SendMail cn = new SendMail(false); + logger.info("---SendMailAsync---start----"); + logger.info("---SendMailContent-----主题:{}, 收件人:{}, 抄送人:{}, 内容:{}", subject, receiveUser, cc, sendHtml); + try { + cn.sendMail(subject, sendHtml, receiveUser, cc); + } catch (Exception e) { + logger.error("----SendMailAsync--error:"+e.getMessage(),e); + } + + logger.info("---SendMailAsync---end----"); + } + +} diff --git a/dongjian-dashboard-back-util/src/main/java/com/dongjian/dashboard/back/util/aurora/TimeInterval.java b/dongjian-dashboard-back-util/src/main/java/com/dongjian/dashboard/back/util/aurora/TimeInterval.java new file mode 100644 index 0000000..6222984 --- /dev/null +++ b/dongjian-dashboard-back-util/src/main/java/com/dongjian/dashboard/back/util/aurora/TimeInterval.java @@ -0,0 +1,10 @@ +package com.dongjian.dashboard.back.util.aurora; + +import lombok.Data; + +@Data +public class TimeInterval { + + private final long startTime; + private final long endTime; +} diff --git a/dongjian-dashboard-back-util/src/main/java/com/dongjian/dashboard/back/util/redis/RedisClusterConfig.java b/dongjian-dashboard-back-util/src/main/java/com/dongjian/dashboard/back/util/redis/RedisClusterConfig.java new file mode 100644 index 0000000..cb07f6e --- /dev/null +++ b/dongjian-dashboard-back-util/src/main/java/com/dongjian/dashboard/back/util/redis/RedisClusterConfig.java @@ -0,0 +1,106 @@ +package com.dongjian.dashboard.back.util.redis; + +import java.io.Serializable; +import java.time.Duration; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +import org.apache.commons.pool2.impl.GenericObjectPoolConfig; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.data.redis.connection.RedisClusterConfiguration; +import org.springframework.data.redis.connection.RedisConfiguration; +import org.springframework.data.redis.connection.RedisPassword; +import org.springframework.data.redis.connection.lettuce.LettuceClientConfiguration; +import org.springframework.data.redis.connection.lettuce.LettuceConnectionFactory; +import org.springframework.data.redis.connection.lettuce.LettucePoolingClientConfiguration; +import org.springframework.data.redis.core.RedisTemplate; +import org.springframework.data.redis.serializer.GenericJackson2JsonRedisSerializer; +import org.springframework.data.redis.serializer.StringRedisSerializer; + +/** + * Redis 集群模式配置 + * @author jwy-style + * + */ +@Configuration +@ConditionalOnProperty(prefix = "spring.redis",value = "mode", havingValue = "cluster", matchIfMissing = false) +public class RedisClusterConfig { + + private static Logger logger = LoggerFactory.getLogger(RedisClusterConfig.class); + + public RedisClusterConfig() { + logger.info("RedisConfig--Cluster--init"); + } + @Value("${spring.redis.cluster.nodes}") + private String nodes; + @Value("${spring.redis.cluster.max-redirects}") + private Integer maxRedirects; + + @Value("${spring.redis.password}") + private String password; + + @Value("${spring.redis.timeout}") + private long timeout; + + @Value("${spring.redis.lettuce.shutdown-timeout}") + private long shutDownTimeout; + + @Value("${spring.redis.lettuce.pool.max-idle}") + private int maxIdle; + + @Value("${spring.redis.lettuce.pool.min-idle}") + private int minIdle; + + @Value("${spring.redis.lettuce.pool.max-active}") + private int maxActive; + + @Value("${spring.redis.lettuce.pool.max-wait}") + private long maxWait; + + @Bean + public RedisClusterConfiguration redisClusterConfiguration() { + Set hosts = new HashSet<>(); + hosts.addAll(Arrays.asList(nodes.split(","))); + RedisClusterConfiguration redisClusterConfiguration = new RedisClusterConfiguration(hosts); + redisClusterConfiguration.setMaxRedirects(maxRedirects); + redisClusterConfiguration.setPassword(RedisPassword.of(password)); + + return redisClusterConfiguration; + } + + @Bean + public LettuceConnectionFactory lettuceConnectionFactory(RedisConfiguration redisConfiguration) { + GenericObjectPoolConfig genericObjectPoolConfig = new GenericObjectPoolConfig(); + genericObjectPoolConfig.setMaxIdle(maxIdle); + genericObjectPoolConfig.setMinIdle(minIdle); + genericObjectPoolConfig.setMaxTotal(maxActive); + genericObjectPoolConfig.setMaxWaitMillis(maxWait); + genericObjectPoolConfig.setTimeBetweenEvictionRunsMillis(100); + + LettuceClientConfiguration clientConfig = LettucePoolingClientConfiguration.builder() + .commandTimeout(Duration.ofMillis(timeout)) + .shutdownTimeout(Duration.ofMillis(shutDownTimeout)) + .poolConfig(genericObjectPoolConfig) + .build(); + LettuceConnectionFactory factory = new LettuceConnectionFactory(redisConfiguration, clientConfig); + return factory; + } + + @Bean + public RedisTemplate redisTemplate(LettuceConnectionFactory redisConnectionFactory){ + redisConnectionFactory.setShareNativeConnection(false);//交由定义池控制 + RedisTemplate template = new RedisTemplate(); + template.setKeySerializer(new StringRedisSerializer()); + template.setValueSerializer(new GenericJackson2JsonRedisSerializer()); + template.setHashKeySerializer(new StringRedisSerializer());// Hash key序列化 + template.setHashValueSerializer(new GenericJackson2JsonRedisSerializer());// Hash value序列化 + template.setConnectionFactory(redisConnectionFactory); + return template; + } +} diff --git a/dongjian-dashboard-back-util/src/main/java/com/dongjian/dashboard/back/util/redis/RedisSentinelConfig.java b/dongjian-dashboard-back-util/src/main/java/com/dongjian/dashboard/back/util/redis/RedisSentinelConfig.java new file mode 100644 index 0000000..b3945fd --- /dev/null +++ b/dongjian-dashboard-back-util/src/main/java/com/dongjian/dashboard/back/util/redis/RedisSentinelConfig.java @@ -0,0 +1,110 @@ +package com.dongjian.dashboard.back.util.redis; + +import java.io.Serializable; +import java.time.Duration; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +import org.apache.commons.pool2.impl.GenericObjectPoolConfig; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.data.redis.connection.RedisConfiguration; +import org.springframework.data.redis.connection.RedisPassword; +import org.springframework.data.redis.connection.RedisSentinelConfiguration; +import org.springframework.data.redis.connection.lettuce.LettuceClientConfiguration; +import org.springframework.data.redis.connection.lettuce.LettuceConnectionFactory; +import org.springframework.data.redis.connection.lettuce.LettucePoolingClientConfiguration; +import org.springframework.data.redis.core.RedisTemplate; +import org.springframework.data.redis.serializer.GenericJackson2JsonRedisSerializer; +import org.springframework.data.redis.serializer.StringRedisSerializer; + +/** + * Redis缓存配置类 + * @author jwy-style + * + */ +@Configuration +@ConditionalOnProperty(prefix ="spring.redis" ,name = "mode", havingValue = "sentinel" , matchIfMissing = false) +public class RedisSentinelConfig { + + private static Logger logger = LoggerFactory.getLogger(RedisSentinelConfig.class); + + public RedisSentinelConfig() { + logger.info("RedisConfig---Sentinel--init"); + } + @Value("${spring.redis.sentinel.master}") + private String master; + @Value("${spring.redis.sentinel.nodes}") + private String nodes; + + @Value("${spring.redis.database}") + private int database; + + @Value("${spring.redis.password}") + private String password; + + @Value("${spring.redis.timeout}") + private long timeout; + + @Value("${spring.redis.lettuce.shutdown-timeout}") + private long shutDownTimeout; + + @Value("${spring.redis.lettuce.pool.max-idle}") + private int maxIdle; + + @Value("${spring.redis.lettuce.pool.min-idle}") + private int minIdle; + + @Value("${spring.redis.lettuce.pool.max-active}") + private int maxActive; + + @Value("${spring.redis.lettuce.pool.max-wait}") + private long maxWait; + + + @Bean + public RedisSentinelConfiguration redisSentinelConfiguration() { + Set hosts = new HashSet<>(); + hosts.addAll(Arrays.asList(nodes.split(","))); + RedisSentinelConfiguration redisSentinelConfiguration = new RedisSentinelConfiguration(master,hosts); + redisSentinelConfiguration.setPassword(RedisPassword.of(password)); + redisSentinelConfiguration.setDatabase(database); + return redisSentinelConfiguration; + } + + @Bean + public LettuceConnectionFactory lettuceConnectionFactory(RedisConfiguration redisConfiguration) { + GenericObjectPoolConfig genericObjectPoolConfig = new GenericObjectPoolConfig(); + genericObjectPoolConfig.setMaxIdle(maxIdle); + genericObjectPoolConfig.setMinIdle(minIdle); + genericObjectPoolConfig.setMaxTotal(maxActive); + genericObjectPoolConfig.setMaxWaitMillis(maxWait); + genericObjectPoolConfig.setTimeBetweenEvictionRunsMillis(100); + + LettuceClientConfiguration clientConfig = LettucePoolingClientConfiguration.builder() + .commandTimeout(Duration.ofMillis(timeout)) + .shutdownTimeout(Duration.ofMillis(shutDownTimeout)) + .poolConfig(genericObjectPoolConfig) + .build(); + LettuceConnectionFactory factory = new LettuceConnectionFactory(redisConfiguration, clientConfig); + return factory; + } + + + @Bean + public RedisTemplate redisTemplate(LettuceConnectionFactory redisConnectionFactory){ + redisConnectionFactory.setShareNativeConnection(false);//交由自定义池控制 + RedisTemplate template = new RedisTemplate(); + template.setKeySerializer(new StringRedisSerializer()); + template.setValueSerializer(new GenericJackson2JsonRedisSerializer()); + template.setHashKeySerializer(new StringRedisSerializer());// Hash key序列化 + template.setHashValueSerializer(new GenericJackson2JsonRedisSerializer());// Hash value序列化 + template.setConnectionFactory(redisConnectionFactory); + return template; + } +} \ No newline at end of file diff --git a/dongjian-dashboard-back-util/src/main/java/com/dongjian/dashboard/back/util/redis/RedisStandaloneConfig.java b/dongjian-dashboard-back-util/src/main/java/com/dongjian/dashboard/back/util/redis/RedisStandaloneConfig.java new file mode 100644 index 0000000..0e034e1 --- /dev/null +++ b/dongjian-dashboard-back-util/src/main/java/com/dongjian/dashboard/back/util/redis/RedisStandaloneConfig.java @@ -0,0 +1,106 @@ +package com.dongjian.dashboard.back.util.redis; + +import java.io.Serializable; +import java.time.Duration; + +import org.apache.commons.pool2.impl.GenericObjectPoolConfig; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.data.redis.connection.RedisConfiguration; +import org.springframework.data.redis.connection.RedisPassword; +import org.springframework.data.redis.connection.RedisStandaloneConfiguration; +import org.springframework.data.redis.connection.lettuce.LettuceClientConfiguration; +import org.springframework.data.redis.connection.lettuce.LettuceConnectionFactory; +import org.springframework.data.redis.connection.lettuce.LettucePoolingClientConfiguration; +import org.springframework.data.redis.core.RedisTemplate; +import org.springframework.data.redis.serializer.GenericJackson2JsonRedisSerializer; +import org.springframework.data.redis.serializer.StringRedisSerializer; + +/** + * Redis单机模式配置 + * @author jwy-style + * + */ +@Configuration +@ConditionalOnProperty(prefix = "spring.redis",value = "mode", havingValue = "standalone", matchIfMissing = false) +public class RedisStandaloneConfig { + + private static Logger logger = LoggerFactory.getLogger(RedisStandaloneConfig.class); + + public RedisStandaloneConfig() { + logger.info("RedisConfig---standalone--init"); + } + @Value("${spring.redis.host}") + private String host; + + @Value("${spring.redis.port}") + private int port; + + @Value("${spring.redis.database}") + private int database; + + @Value("${spring.redis.password}") + private String password; + + @Value("${spring.redis.timeout}") + private long timeout; + + @Value("${spring.redis.lettuce.shutdown-timeout}") + private long shutDownTimeout; + + @Value("${spring.redis.lettuce.pool.max-idle}") + private int maxIdle; + + @Value("${spring.redis.lettuce.pool.min-idle}") + private int minIdle; + + @Value("${spring.redis.lettuce.pool.max-active}") + private int maxActive; + + @Value("${spring.redis.lettuce.pool.max-wait}") + private long maxWait; + + @Bean + public RedisStandaloneConfiguration redisStandaloneConfiguration() { + RedisStandaloneConfiguration redisStandaloneConfiguration = new RedisStandaloneConfiguration(); + redisStandaloneConfiguration.setDatabase(database); + redisStandaloneConfiguration.setHostName(host); + redisStandaloneConfiguration.setPort(port); + redisStandaloneConfiguration.setPassword(RedisPassword.of(password)); + return redisStandaloneConfiguration; + } + + @Bean + public LettuceConnectionFactory lettuceConnectionFactory(RedisConfiguration redisConfiguration) { + GenericObjectPoolConfig genericObjectPoolConfig = new GenericObjectPoolConfig(); + genericObjectPoolConfig.setMaxIdle(maxIdle); + genericObjectPoolConfig.setMinIdle(minIdle); + genericObjectPoolConfig.setMaxTotal(maxActive); + genericObjectPoolConfig.setMaxWaitMillis(maxWait); + genericObjectPoolConfig.setTimeBetweenEvictionRunsMillis(100); + + LettuceClientConfiguration clientConfig = LettucePoolingClientConfiguration.builder() + .commandTimeout(Duration.ofMillis(timeout)) + .shutdownTimeout(Duration.ofMillis(shutDownTimeout)) + .poolConfig(genericObjectPoolConfig) + .build(); + LettuceConnectionFactory factory = new LettuceConnectionFactory(redisConfiguration, clientConfig); + return factory; + } + + @Bean + public RedisTemplate redisTemplate(LettuceConnectionFactory redisConnectionFactory){ + redisConnectionFactory.setShareNativeConnection(false);//交由定义池控制 + RedisTemplate template = new RedisTemplate(); + template.setKeySerializer(new StringRedisSerializer()); + template.setValueSerializer(new GenericJackson2JsonRedisSerializer()); + template.setHashKeySerializer(new StringRedisSerializer());// Hash key序列化 + template.setHashValueSerializer(new GenericJackson2JsonRedisSerializer());// Hash value序列化 + template.setConnectionFactory(redisConnectionFactory); + return template; + } +} \ No newline at end of file diff --git a/dongjian-dashboard-back-util/src/main/java/com/dongjian/dashboard/back/util/redis/RedisUtil.java b/dongjian-dashboard-back-util/src/main/java/com/dongjian/dashboard/back/util/redis/RedisUtil.java new file mode 100644 index 0000000..2336799 --- /dev/null +++ b/dongjian-dashboard-back-util/src/main/java/com/dongjian/dashboard/back/util/redis/RedisUtil.java @@ -0,0 +1,452 @@ +package com.dongjian.dashboard.back.util.redis; + +import com.fasterxml.jackson.annotation.JsonAutoDetect; +import com.fasterxml.jackson.annotation.PropertyAccessor; +import com.fasterxml.jackson.databind.ObjectMapper; + +import jakarta.annotation.Resource; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.dao.InvalidDataAccessApiUsageException; +import org.springframework.data.redis.core.*; +import org.springframework.data.redis.serializer.Jackson2JsonRedisSerializer; +import org.springframework.stereotype.Component; +import org.springframework.util.StringUtils; + +import java.io.Serializable; +import java.text.MessageFormat; +import java.util.Arrays; +import java.util.Collection; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.concurrent.TimeUnit; + +/** + * Redis工具类 + */ +@Component +public class RedisUtil { + + private RedisTemplate redisTemplate; + @Autowired + public void setRedisTemplate(RedisTemplate redisTemplate){ +// StringRedisSerializer stringRedisSerializer = new StringRedisSerializer(); +// Jackson2JsonRedisSerializer jackson2 = new Jackson2JsonRedisSerializer(Object.class); +// //设置value值以 json 格式保存 +// redisTemplate.setKeySerializer(stringRedisSerializer); +// redisTemplate.setValueSerializer(jackson2); +// redisTemplate.setHashKeySerializer(stringRedisSerializer); +// redisTemplate.setHashValueSerializer(jackson2); + + Jackson2JsonRedisSerializer jackson2JsonRedisSerializer = new Jackson2JsonRedisSerializer(Object.class); + ObjectMapper om = new ObjectMapper(); + om.setVisibility(PropertyAccessor.ALL, JsonAutoDetect.Visibility.ANY); + om.enableDefaultTyping(ObjectMapper.DefaultTyping.NON_FINAL); + jackson2JsonRedisSerializer.setObjectMapper(om); + redisTemplate.setValueSerializer(jackson2JsonRedisSerializer); + redisTemplate.setHashValueSerializer(jackson2JsonRedisSerializer); + this.redisTemplate = redisTemplate; + } + + /** + * 操作 Redis + * @return + */ + public RedisTemplate getRedisTemplate(){ + return redisTemplate; + } + + + @Resource(name = "redisTemplate") + private ValueOperations valueOperations; + + /** + * String(字符串的操作类) + * @return + */ + public ValueOperations getValueOperations(){ + return valueOperations; + } + + + @Resource(name = "redisTemplate") + private HashOperations hashOperations; + + /** + * Hash(哈希表的操作) + * @return + */ + public HashOperations getHashOperations(){ + return hashOperations; + } + + + @Resource(name = "redisTemplate") + private ListOperations listOperations; + + /** + * List(列表的操作) + * @return + */ + public ListOperations getListOperations(){ + return listOperations; + } + + @Resource(name = "redisTemplate") + private SetOperations setOperations; + /** + * Set(集合的操作) + * @return + */ + public SetOperations getSetOperations(){ + return setOperations; + } + + @Resource(name = "redisTemplate") + public ZSetOperations zSetOperations; + /** + * ZSet (有序集合的操作) + * @return + */ + public ZSetOperations getZSetOperations(){ + return zSetOperations; + } + + /** + * 设置 Key 的过期时间(单位:秒){ 命令:EXPIRE [key] [seconds] } + * @param key 键 + * @param expireTime 过期时间(单位:秒) + * @return + */ + public boolean expire(String key,Long expireTime){ + return redisTemplate.expire(key, expireTime, TimeUnit.SECONDS); + } + + + /** + * 设置 Key 的过期时间(单位:秒){ 命令:EXPIRE [key] [seconds] } + * @param key 键 + * @param expireTime 过期时间(单位:秒) + * @return + */ + public boolean updateExprieTime(final String key,Long expireTime){ + return expire(key,expireTime); + } + + + /** + * 获取自增长(每次 +1) + * 将 key 中储存的数字值增一 + * 如果 key 不存在,那么 key 的值会先被初始化为 0 + * @param key 键 + * @return Long + */ + public Long getAutoIncrement(String key){ + return valueOperations.increment(key, 1); + } + + + + /** + * 读取缓存 + * + * @param key + * @return + */ + public Object get(final String key) { + return valueOperations.get(key); + } + + + /** + * String(字符串)的数据类型 + * + * @param key 键 + * @param value 值 + * @return + */ + public boolean set(String key, Object value) { + try { + valueOperations.set(key, value); + return true; + } catch (Exception e) { + e.printStackTrace(); + } + return false; + } + + + /** + * String(字符串)的数据类型 + * 写入缓存(过期时间) + * + * @param key 键 + * @param value 值 + * @param expireTime 过期时间(秒为单位) + * @return + */ + public boolean set(String key, Object value, Long expireTime) { + try { + valueOperations.set(key, value,expireTime,TimeUnit.SECONDS); + return true; + } catch (Exception e) { + e.printStackTrace(); + } + return false; + } + + + + /** + * 操作 Redis Hash(哈希表)的数据类型 + * (有过期时间) + * + * 1.将哈希表 key 中的域 field 的值设为 value 。 + * 2.如果 key 不存在,一个新的哈希表被创建并进行 HSET 操作。 + * 3.如果域 field 已经存在于哈希表中,旧值将被覆盖。 + * @param key 键 + * @param hashKey hash的键 + * @param hashValue hash的值 + * @param expireTime 过期时间(单位:秒) + * @return + */ + public boolean hashPut(String key,String hashKey, Object hashValue,Long expireTime){ + try { + hashOperations.put(key,hashKey,hashValue); + return expire(key,expireTime); + }catch (Exception e){ + e.printStackTrace(); + } + return false; + } + + + + /** + * 操作 Redis Hash(哈希表)的数据类型 + * (有过期时间) + * + * 1.同时将多个 field-value (域-值)对设置到哈希表 key 中。 + * 2.此命令会覆盖哈希表中已存在的域。 + * 3.如果 key 不存在,一个空哈希表被创建并执行 HMSET 操作。 + * @param key 键 + * @param hashKeyValue 键值 + * @param expireTime 过期时间(单位:秒) + * @return + */ + public boolean hashPutAll(String key,Map hashKeyValue,Long expireTime){ + try{ + hashOperations.putAll(key,hashKeyValue); + return expire(key,expireTime); + }catch (Exception e){ + e.printStackTrace(); + } + return false; + } + + public boolean hashPutAll(String key,Map hashKeyValue){ + try{ + hashOperations.putAll(key,hashKeyValue); +// return expire(key,expireTime); + return true; + }catch (Exception e){ + e.printStackTrace(); + } + return false; + } + + + /** + * 获取有序集 key 中,所有成员 + * 其中成员的位置按 score 值递增(从小到大)来排序。 + * @param key 键 + * @return + */ + public Set zsetAllAsc(String key){ + return zSetOperations.range(key,0,-1); + } + + + /** + * 获取有序集 key 中,所有成员(倒序) + * 其中成员的位置按 score 值递减(从大到小)来排列。 + * @param key 键 + * @return + */ + public Set zsetAllDesc(String key){ + return zSetOperations.reverseRange(key,0,-1); + } + + + //============================================================================================= + /** + * 删除一个 Key + * @param key 键 + * @return + */ + public boolean delKey(String key){ + redisTemplate.delete(key); + return true; + } + + /** + * 删除多个 Key + * @param keys 键 的集合 + * @return + */ + public boolean delKeys(Collection keys){ + redisTemplate.delete(keys); + return true; + } + + + /** + * 批量删除key + * + * @param pattern + */ + public void removePattern(final String pattern) { + Set keys = redisTemplate.keys(pattern); + if (keys.size() > 0){ + redisTemplate.delete(keys); + } + } + + + /** + * 批量删除对应的value + * + * @param keys + */ + public void remove(final String... keys) { + for (String key : keys) { + remove(key); + } + } + + /** + * 删除对应的value + * + * @param key + */ + public void remove(final String key) { + if (exists(key)) { + redisTemplate.delete(key); + } + } + + + /** + * 判断 Key 是否存在 { 命令:exists [key] } + * @param key 键 + * @return + */ + public boolean existsKey(String key){ + return redisTemplate.hasKey(key); + } + + + /** + * 判断缓存中是否有对应的value + * + * @param key + * @return + */ + public boolean exists(final String key) { + return redisTemplate.hasKey(key); + } + + /** + * 重命名(将 key 改名为 newkey){ 命令:renamenx [oldKey] [newKey] } + * 若给定的 key 已经存在,则不做任何动作 + * (key 必须存在,返回:false(ERR no such key)) + * 1.newKey 在数据库已经存在,则修改不成功.返回 false + * @param oldKey 旧的键 + * @param newKey 新的键 + * @return + */ + public boolean renamenx(String oldKey, String newKey){ + try{ + return redisTemplate.renameIfAbsent(oldKey,newKey); + }catch (InvalidDataAccessApiUsageException e){ + e.printStackTrace(); + } + return false; + } + + + /** + * 重命名(将 key 改名为 newkey){ 命令:rename [oldKey] [newKey] } + * (key 必须存在,返回:false(ERR no such key)) + * 1.newKey 在数据库中已经存在,则 newKey 将覆盖改存在的 key + * (相当于把数据库newKey对应的key删除,然后在把准备修改的key的名称修改为newKey的名称) + * @param oldKey + * @param newKey + */ + public boolean rename(String oldKey, String newKey){ + try{ + redisTemplate.rename(oldKey,newKey); + return true; + }catch (InvalidDataAccessApiUsageException e){ + e.printStackTrace(); + } + return false; + } + + /** + * 生成Redis的key。 + * 比如: + * generatorRedisKey("abc:{0}:efg:{1}", 123, 345) -> abc:123:efg:345 + * + * @param regex Redis key的分组定义 + * @param values key命名规则的占位符值 + * @return Redis key + */ + public static String generatorKey(String regex, Object ... values) { + String key = regex; + if (StringUtils.isEmpty(key)) { + return ""; + } + return MessageFormat.format(key, Arrays.stream(values).map(value ->String.valueOf(value)).toArray()); + } + + /** + * 将 key 中储存的数字值增一。 + * @param userPwdErrorKey + */ + public Long incr(String key) { + try { + return valueOperations.increment(key); + } catch (Exception e) { + e.printStackTrace(); + } + return -999L; + } + + public List hgetall(String key) { + try { + return redisTemplate.opsForHash().values(key); + }catch (Exception e){ + e.printStackTrace(); + return null; + } + } + + public void HSet (String key, String hashKey, Object value) { + try { + redisTemplate.opsForHash().put(key, hashKey, value); + }catch (Exception e){ + e.printStackTrace(); + } + } + + public Object HGet(String key, String hashKey) { + try { + return redisTemplate.opsForHash().get(key, hashKey); + }catch (Exception e){ + e.printStackTrace(); + return null; + } + } +} diff --git a/dongjian-dashboard-back-util/src/test/java/com/dongjian/dashboard/back/util/AppTest.java b/dongjian-dashboard-back-util/src/test/java/com/dongjian/dashboard/back/util/AppTest.java new file mode 100644 index 0000000..0c19718 --- /dev/null +++ b/dongjian-dashboard-back-util/src/test/java/com/dongjian/dashboard/back/util/AppTest.java @@ -0,0 +1,38 @@ +package com.dongjian.dashboard.back.util; + +import junit.framework.Test; +import junit.framework.TestCase; +import junit.framework.TestSuite; + +/** + * Unit test for simple App. + */ +public class AppTest + extends TestCase +{ + /** + * Create the test case + * + * @param testName name of the test case + */ + public AppTest( String testName ) + { + super( testName ); + } + + /** + * @return the suite of tests being tested + */ + public static Test suite() + { + return new TestSuite( AppTest.class ); + } + + /** + * Rigourous Test :-) + */ + public void testApp() + { + assertTrue( true ); + } +} diff --git a/dongjian-dashboard-back-util/src/test/java/com/dongjian/dashboard/back/util/HistoricalDataDTO.java b/dongjian-dashboard-back-util/src/test/java/com/dongjian/dashboard/back/util/HistoricalDataDTO.java new file mode 100644 index 0000000..cf6dcdc --- /dev/null +++ b/dongjian-dashboard-back-util/src/test/java/com/dongjian/dashboard/back/util/HistoricalDataDTO.java @@ -0,0 +1,23 @@ +package com.dongjian.dashboard.back.util; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** +* @author Mr.Jiang +* @time 2022年7月21日 下午8:50:31 +*/ +@Data +@AllArgsConstructor +@NoArgsConstructor +public class HistoricalDataDTO{ + + @Schema(description = "上报时间",example = "1678923991752") + private Long ts; + + @Schema(description = "企业名称",example = "oviphone") + private String content; + +} diff --git a/dongjian-dashboard-back-util/src/test/java/com/dongjian/dashboard/back/util/NearestHourMinute.java b/dongjian-dashboard-back-util/src/test/java/com/dongjian/dashboard/back/util/NearestHourMinute.java new file mode 100644 index 0000000..5538a75 --- /dev/null +++ b/dongjian-dashboard-back-util/src/test/java/com/dongjian/dashboard/back/util/NearestHourMinute.java @@ -0,0 +1,49 @@ +package com.dongjian.dashboard.back.util; + +import java.time.*; + +public class NearestHourMinute { + public static void main(String[] args) { + // 假设给定的时间戳是当前时间的时间戳,你也可以替换为其他时间戳 + long timestamp = 1712370811936L; + + // 将时间戳转换为LocalDateTime对象 + LocalDateTime dateTime = LocalDateTime.ofInstant( + java.time.Instant.ofEpochMilli(timestamp), + java.time.ZoneId.systemDefault() + ); + + // 获取分钟数 + int second = dateTime.getSecond(); + + // 找出离给定时间戳最近的整点分钟 + LocalDateTime nearestMinute; + if (second < 30) { + nearestMinute = dateTime.withSecond(0).withNano(0); + } else { + nearestMinute = dateTime.withSecond(0).withNano(0).plusMinutes(1); + } + + long secs = nearestMinute.atZone(ZoneId.systemDefault()).toInstant().toEpochMilli(); + + System.out.println("给定时间戳最近的整点分钟是:" + secs); + + System.out.println(getStartOfTodayWithOffset(-480)); + } + + + public static long getStartOfTodayWithOffset(int utcOffsetMinutes) { + utcOffsetMinutes = -utcOffsetMinutes; + // 构造 ZoneOffset(-480 表示东八区) + ZoneOffset offset = ZoneOffset.ofTotalSeconds(utcOffsetMinutes * 60); + + // 当前 UTC 时间点 + Instant now = Instant.now(); + + // 将当前时间转换为 offset 下的本地时间 + LocalDate localDate = now.atOffset(offset).toLocalDate(); + + // 当地时间的 00:00 转为 UTC 时间戳 + return localDate.atStartOfDay().toInstant(offset).toEpochMilli(); + } +} diff --git a/dongjian-dashboard-back-util/src/test/java/com/dongjian/dashboard/back/util/QuartileCalculator.java b/dongjian-dashboard-back-util/src/test/java/com/dongjian/dashboard/back/util/QuartileCalculator.java new file mode 100644 index 0000000..ed7c509 --- /dev/null +++ b/dongjian-dashboard-back-util/src/test/java/com/dongjian/dashboard/back/util/QuartileCalculator.java @@ -0,0 +1,41 @@ +package com.dongjian.dashboard.back.util; + +import java.util.*; + +public class QuartileCalculator { + + public static void main(String[] args) { +// List list = Arrays.asList(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 9.0, 8.0, 10.0, 11.0); + List list = Arrays.asList(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 9.0, 8.0, 10.0); + + // 首先对列表进行排序 + Collections.sort(list); + + System.out.println(list); + + // 计算四分位数 + double q1 = calculateQuartile(list, 0.25); + double q2 = calculateMedian(list); + double q3 = calculateQuartile(list, 0.75); + + System.out.println("Q1: " + q1); + System.out.println("Q2: " + q2); + System.out.println("Q3: " + q3); + } + + private static double calculateMedian(List sortedList) { + int size = sortedList.size(); + if (size % 2 == 0) { + // 偶数个元素,取中间两个数的平均值 + return (sortedList.get(size / 2 - 1) + sortedList.get(size / 2)) / 2.0; + } else { + // 奇数个元素,取中间那个数 + return sortedList.get(size / 2); + } + } + + private static double calculateQuartile(List sortedList, double quartilePosition) { + int index = (int) (quartilePosition * sortedList.size()); + return sortedList.get(index); + } +} \ No newline at end of file diff --git a/dongjian-dashboard-back-util/src/test/java/com/dongjian/dashboard/back/util/Test.java b/dongjian-dashboard-back-util/src/test/java/com/dongjian/dashboard/back/util/Test.java new file mode 100644 index 0000000..429b451 --- /dev/null +++ b/dongjian-dashboard-back-util/src/test/java/com/dongjian/dashboard/back/util/Test.java @@ -0,0 +1,89 @@ +package com.dongjian.dashboard.back.util; + +import static org.mockito.ArgumentMatchers.intThat; + +import java.text.ParseException; +import java.time.LocalDate; +import java.time.LocalDateTime; +import java.time.LocalTime; +import java.time.ZoneId; +import java.util.Calendar; +import java.util.Date; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +/** + * + * @author jwy + * + */ +public class Test { + + private final static long ondDayMillis = 3600 * 24 * 1000; + + private static final String betweenQuotesRegex = "\"([^\"]*)\""; + + public static void main(String[] args) throws ParseException{ + long ZeroTime = getTodayZeroTime(); + System.out.println(ZeroTime); + long startTime = ZeroTime - ondDayMillis; + System.out.println(startTime); + long endTime = ZeroTime - 1; + System.out.println(endTime); + + int days = 2; + System.out.println("前"+ days +"天的0点的毫秒级时间戳: " + getMinusZeroTimestamp(days)); + + int mins = 9; + minusInterval(mins); + + System.out.println(CommonUtil.extractContentBetweenQuotes("aurora_cluster_endpoint = \"company-13-aurora-cluster.cluster-cde6q2assvmn.ap-northeast-1.rds.amazonaws.com\"")); + + } + + public static String extractContentBetweenQuotes(String text) { + Pattern pattern = Pattern.compile(betweenQuotesRegex); + Matcher matcher = pattern.matcher(text); + + if (matcher.find()) { + return matcher.group(1); + } + + return null; // 如果找不到匹配项,返回null + } + + private static void minusInterval(int mins) { + LocalDateTime now = LocalDateTime.now(); + int currentSecond = now.getSecond(); + System.out.println("当前秒:" + currentSecond); + System.out.println("当前分钟:" + now.withSecond(0).withNano(0). + atZone(ZoneId.systemDefault()).toInstant().toEpochMilli()); + + // 减去指定的分钟数并将秒数和纳秒数设为0 + LocalDateTime previousMinute = now.minusMinutes(mins).withSecond(0).withNano(0); + + // 获取前n分钟整分钟的毫秒级时间戳 + System.out.println("前"+ mins +"分钟:" + previousMinute.atZone(ZoneId.systemDefault()).toInstant().toEpochMilli()); + } + + private static long getTodayZeroTime() { + Calendar calendar = Calendar.getInstance(); + calendar.set(Calendar.HOUR_OF_DAY, 0); + calendar.set(Calendar.MINUTE, 0); + calendar.set(Calendar.SECOND, 0); + calendar.set(Calendar.MILLISECOND, 0); + return calendar.getTime().getTime(); + } + + public static Long getMinusZeroTimestamp(int days) { +// String timeZone = "Asia/Tokyo"; + // 获取今天的日期 + LocalDate today = LocalDate.now(); + // 减去n天 + LocalDate nDaysAgo = today.minusDays(days); + // 将日期转换为午夜12点的时间 + LocalDateTime midnight = nDaysAgo.atStartOfDay(); + // 将LocalDateTime转换为Instant + return midnight.atZone(ZoneId.systemDefault()).toInstant().toEpochMilli(); + } +} diff --git a/dongjian-dashboard-back-util/src/test/java/com/dongjian/dashboard/back/util/ValueSorter.java b/dongjian-dashboard-back-util/src/test/java/com/dongjian/dashboard/back/util/ValueSorter.java new file mode 100644 index 0000000..277e552 --- /dev/null +++ b/dongjian-dashboard-back-util/src/test/java/com/dongjian/dashboard/back/util/ValueSorter.java @@ -0,0 +1,111 @@ +package com.dongjian.dashboard.back.util; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.Comparator; +import java.util.List; + +import com.alibaba.fastjson.JSON; + +public class ValueSorter { + + public final static String respDateTimeFormat = "yyyy-MM-dd HH:mm:00"; + public final static String timeZoneId = "Asia/Tokyo"; + + static class ElementData { + + public double getValue() { + return value; + } + + public void setValue(double value) { + this.value = value; + } + + public long getMilliTimestamp() { + return milliTimestamp; + } + + public void setMilliTimestamp(long milliTimestamp) { + this.milliTimestamp = milliTimestamp; + } + + double value; + long milliTimestamp; + + public ElementData() { + } + + public ElementData(double value, long milliTimestamp) { + this.value = value; + this.milliTimestamp = milliTimestamp; + + } + } + + public static void main(String[] args) { + // 假设有一个List对象存储了数据集 + List dataList = new ArrayList<>(); + dataList.add(new ElementData(15.8, 1710570103940L)); + dataList.add(new ElementData(17.2, 1710571113941L)); + dataList.add(new ElementData(24.5, 1710572123942L)); + dataList.add(new ElementData(26.7, 1710573133943L)); + dataList.add(new ElementData(18.9, 1710574143944L)); + dataList.add(new ElementData(12.5, 1710575153945L)); + dataList.add(new ElementData(14.3, 1710576163946L)); + dataList.add(new ElementData(20.1, 1710577173947L)); + dataList.add(new ElementData(21.6, 1710578183948L)); + dataList.add(new ElementData(23.0, 1710579193949L)); + dataList.add(new ElementData(25.0, 1710579999949L)); + + // 打印排序后的结果 + for (ElementData dataPoint : dataList) { + System.out.println("Value: " + dataPoint.value + ", milliTimestamp: " + dataPoint.milliTimestamp); + } + + System.out.println("——————————————————————"); + + // 按照value字段排序 + Collections.sort(dataList, Comparator.comparingDouble(dataPoint -> dataPoint.value)); + + // 打印排序后的结果 + for (ElementData dataPoint : dataList) { + System.out.println("Value: " + dataPoint.value + ", milliTimestamp: " + dataPoint.milliTimestamp); + } + + ElementData aaData = calculateQuartile(dataList, 0.25); + System.out.println(JSON.toJSONString(aaData)); + System.out.println(JSON.toJSONString(DateUtil.timestamp2DateStr(aaData.getMilliTimestamp(), respDateTimeFormat, timeZoneId))); + + ElementData aaData2 = calculateMedian(dataList); + System.out.println(JSON.toJSONString(aaData2)); + System.out.println(JSON.toJSONString(DateUtil.timestamp2DateStr(aaData2.getMilliTimestamp(), respDateTimeFormat, timeZoneId))); + + ElementData aaData3 = calculateQuartile(dataList, 0.75); + System.out.println(JSON.toJSONString(aaData3)); + System.out.println(JSON.toJSONString(DateUtil.timestamp2DateStr(aaData3.getMilliTimestamp(), respDateTimeFormat, timeZoneId))); + } + + private static ElementData calculateMedian(List sortedList) { + int size = sortedList.size(); + if (size % 2 == 0) { + // 偶数个元素,取中间两个数的平均值 + ElementData data1 = sortedList.get(size / 2 - 1); + ElementData data2 = sortedList.get(size / 2); + ElementData resData = new ElementData(); + resData.setValue((data1.getValue()+data2.getValue())/2.0); + resData.setMilliTimestamp((data1.getMilliTimestamp()+data2.getMilliTimestamp())/2); + + return resData; + } else { + // 奇数个元素,取中间那个数 + return sortedList.get(size/2); + } + } + + private static ElementData calculateQuartile(List sortedList, double quartilePosition) { + int index = (int) (quartilePosition * sortedList.size()); + return sortedList.get(index); + } +} + diff --git a/pom.xml b/pom.xml new file mode 100644 index 0000000..0e9c101 --- /dev/null +++ b/pom.xml @@ -0,0 +1,455 @@ + + + 4.0.0 + + + org.springframework.boot + spring-boot-starter-parent + 3.2.12 + + + + com.techsor + dongjian-dashboard-back + 0.0.1-SNAPSHOT + dongjian-dashboard-back + pom + + + dongjian-dashboard-back-util + dongjian-dashboard-back-common + dongjian-dashboard-back-model + dongjian-dashboard-back-dao + dongjian-dashboard-back-service + dongjian-dashboard-back-controller + + + data center business + + + com.dongjian.dashboard.back.DongjianDashboardBackApplication + 17 + + + + + org.springframework.boot + spring-boot-starter + + + org.springframework.boot + spring-boot-starter-web + + + org.springframework.boot + spring-boot-starter-logging + + + org.apache.tomcat.embed + tomcat-embed-core + + + + + + org.apache.tomcat.embed + tomcat-embed-core + 10.1.42 + + + org.springframework.boot + spring-boot-starter-test + test + + + org.projectlombok + lombok + + + + + org.springdoc + springdoc-openapi-starter-webmvc-ui + 2.5.0 + + + + + + + + + com.fasterxml.jackson.core + jackson-core + 2.19.0 + + + com.fasterxml.jackson.core + jackson-databind + 2.19.0 + + + com.fasterxml.jackson.core + jackson-annotations + 2.19.0 + + + + org.mybatis.spring.boot + mybatis-spring-boot-starter + 3.0.4 + + + + com.mysql + mysql-connector-j + 9.3.0 + + + + com.alibaba + druid + 1.1.3 + + + + com.google.guava + guava + 33.4.5-jre + + + + + org.yaml + snakeyaml + 2.4 + + + + + ch.qos.logback + logback-classic + 1.5.18 + compile + + + ch.qos.logback + logback-core + 1.5.18 + compile + + + + org.apache.commons + commons-compress + 1.27.1 + + + + commons-io + commons-io + 2.18.0 + + + + org.apache.commons + commons-text + 1.13.0 + + + + com.github.pagehelper + pagehelper-spring-boot-starter + 1.4.7 + + + + + io.lettuce + lettuce-core + 6.7.1.RELEASE + + + + + org.apache.logging.log4j + log4j-core + 2.25.1 + + + org.apache.logging.log4j + log4j-api + 2.25.1 + + + + + com.alibaba + easyexcel + 4.0.3 + + + + + + + org.apache.maven.plugins + maven-jar-plugin + + + **/application.properties + + + + lib/ + true + ${main.basedir} + + + + + + + + org.apache.maven.plugins + maven-dependency-plugin + + + copy-dependencies + package + + copy-dependencies + + + + ${project.build.directory}/lib + false + false + runtime + + + + + + + org.apache.maven.plugins + maven-resources-plugin + + UTF-8 + true + + xlsx + xls + zip + + + + + + copy-resources + package + + copy-resources + + + + + src/main/resources + + + ${project.build.directory}/ + + + + + + + + + src/main/resources + + **/*.* + + true + + + + + + + + development + + true + + + 30003 + + true + + + rm-bp11k2zm2fr7864428o.mysql.rds.aliyuncs.com:3306 + Asia/Shanghai + zhc + Youqu48bnb1 + + DEBUG + E:/logDemo + CONSOLELOG + 30 + + r-uf63x4g5p6ir5xao87pd.redis.rds.aliyuncs.com + B2BGn4gK4htgkEwP + + http://49.234.37.33:92/#/user/login + http://49.234.37.33:92/#/user/login + + DEBUG + + http://127.0.0.1:20016/api + + -XX:+UnlockExperimentalVMOptions -XX:+UseG1GC -XX:MaxGCPauseMillis=200 -XX:G1NewSizePercent=20 -XX:G1MaxNewSizePercent=60 -XX:InitialHeapSize=2g -Xmx3000m -XX:MetaspaceSize=128m -XX:+PrintGCDetails -XX:+PrintGCDatestamps -Xloggc:/home/dongjian-dashboard-back/gc.log + + s7tH+iaTl9fpsvI9B1+AyZKsYWkWSIYG + A0g07JCxcd+IsHig0fcNLIJs1s2kpLDZypIH1SDaxDs4RTpWg6EAGQ22Dh9lqNR3 + tokyobuild-stg-databucket-923770123186 + datacenter-storeage/ + arn:aws:iam::923770123186:role/tokyo-build-access-ec2-role + + stg + + + + + org.apache.maven.plugins + maven-surefire-plugin + + false + + + + + + + + + test + + false + + + 30003 + + true + + + rm-bp11k2zm2fr7864428o.mysql.rds.aliyuncs.com:3306 + Asia/Shanghai + zhc + Youqu48bnb1 + + DEBUG + E:/logDemo + CONSOLELOG + 30 + + r-uf63x4g5p6ir5xao87pd.redis.rds.aliyuncs.com + B2BGn4gK4htgkEwP + + http://49.234.37.33:92/#/user/login + http://49.234.37.33:92/#/user/login + + http://127.0.0.1:20016/api + + INFO + + -XX:+UnlockExperimentalVMOptions -XX:+UseG1GC -XX:MaxGCPauseMillis=200 -XX:G1NewSizePercent=20 -XX:G1MaxNewSizePercent=60 -XX:InitialHeapSize=2g -Xmx3000m -XX:MetaspaceSize=128m -XX:+PrintGCDetails -XX:+PrintGCDatestamps -Xloggc:/home/dongjian-dashboard-back/gc.log + + s7tH+iaTl9fpsvI9B1+AyZKsYWkWSIYG + A0g07JCxcd+IsHig0fcNLIJs1s2kpLDZypIH1SDaxDs4RTpWg6EAGQ22Dh9lqNR3 + tokyobuild-stg-databucket-923770123186 + datacenter-storeage/ + arn:aws:iam::923770123186:role/tokyo-build-access-ec2-role + + stg + + + + + org.apache.maven.plugins + maven-surefire-plugin + + false + + + + + + + + + + production + + false + + + 30003 + + true + + + rm-bp11k2zm2fr7864428o.mysql.rds.aliyuncs.com:3306 + Asia/Shanghai + zhc + Youqu48bnb1 + + DEBUG + E:/logDemo + CONSOLELOG + 30 + + r-uf63x4g5p6ir5xao87pd.redis.rds.aliyuncs.com + B2BGn4gK4htgkEwP + + http://49.234.37.33:92/#/user/login + http://49.234.37.33:92/#/user/login + + http://127.0.0.1:20016/api + + INFO + + -XX:+UnlockExperimentalVMOptions -XX:+UseG1GC -XX:MaxGCPauseMillis=200 -XX:G1NewSizePercent=20 -XX:G1MaxNewSizePercent=60 -XX:InitialHeapSize=2g -Xmx3000m -XX:MetaspaceSize=128m -XX:+PrintGCDetails -XX:+PrintGCDatestamps -Xloggc:/home/dongjian-dashboard-back/gc.log + + s7tH+iaTl9fpsvI9B1+AyZKsYWkWSIYG + A0g07JCxcd+IsHig0fcNLIJs1s2kpLDZypIH1SDaxDs4RTpWg6EAGQ22Dh9lqNR3 + tokyobuild-stg-databucket-923770123186 + datacenter-storeage/ + arn:aws:iam::923770123186:role/tokyo-build-access-ec2-role + + stg + + + + + org.apache.maven.plugins + maven-surefire-plugin + + true + + + + + + + \ No newline at end of file diff --git a/readme.md b/readme.md new file mode 100644 index 0000000..1aba0e8 --- /dev/null +++ b/readme.md @@ -0,0 +1,39 @@ +当前版本:v0.2.1 + + +# 目录结构如下 + +│ +├─dongjian-dashboard-back-common +│ +├─dongjian-dashboard-back-controller +│ +│─dongjian-dashboard-back-dao +│ ├─java +│ │ ├─auto----Mybatis-Generator自动生成的持久层接口 +│ │ └─ex------自定义接口, 继承上面对应的auto +│ ├─resources +│ │ ├─mappers +│ │ │ ├─auto----Mybatis-Generator自动生成的映射sql文件, 对应上面的auto接口 +│ │ │ └─ex------自定义sql, 对应上面的ex接口 +│ │ └─mybatis-generator +│ │ └─generatorConfig.xml-----配置数据库表,配置完后双击data-center-business-dao下的runGenerator.bat, Mybatis-Generator自动构建实体类、持久层接口等 +│ └─runGenerator.bat +│ +├─dongjian-dashboard-back-model +│ ├─dto +│ ├─entity +│ ├─model--------Mybatis-Generator自动生成的实体类 +│ └─vo +│ +├─dongjian-dashboard-back-service +│ +├─dongjian-dashboard-back-util 工具类 +│ +└─document---------一些说明文档、脚本、部署sql等等 + + +# swagger接口地址 ++ http://127.0.0.1:20008/swagger-ui.html + +### 开发时,可注释掉controller类上的@AccessRequired注解,不用进行鉴权,省得每次都要登录获取token \ No newline at end of file