Merge remote-tracking branch 'origin/test' into ats-restruct

This commit is contained in:
joylink_zhangsai 2021-07-27 14:06:20 +08:00
commit 148baa1b4f
45 changed files with 1139 additions and 1034 deletions

View File

@ -1,17 +0,0 @@
alter table map_data
add version varchar(8) default 0.1 not null comment '版本号';
drop table map_version;
alter table map_data
add time timestamp default now() not null comment '发布时间';
alter table map_data
add user_id bigint null comment '发布者的id';
alter table map_info
add version varchar(8) default 0.1 not null comment '该地图正在使用的地图数据的版本';

View File

@ -1,3 +0,0 @@
alter table company
add managers varchar(32) null comment '公司管理者';

View File

@ -1,7 +0,0 @@
ALTER TABLE `training`
ADD INDEX `map_id` (`map_id`);
alter table company drop column managers;
alter table sys_user drop foreign key FK_sys_user_company;

View File

@ -1,72 +0,0 @@
CREATE TABLE `run_plan_routing` (
`id` BIGINT(20) NOT NULL AUTO_INCREMENT,
`map_id` BIGINT(20) NOT NULL COMMENT '地图ID',
`user_id` BIGINT(20) NOT NULL,
`name` VARCHAR(64) NOT NULL COMMENT '名称' COLLATE 'utf8_general_ci',
`code` VARCHAR(32) NOT NULL COMMENT '编号' COLLATE 'utf8_general_ci',
`type` VARCHAR(32) NOT NULL COMMENT '交路类型',
`start_station_code` VARCHAR(32) NOT NULL COMMENT '起始车站' COLLATE 'utf8_general_ci',
`start_section_code` VARCHAR(32) NOT NULL COMMENT '起始站台' COLLATE 'utf8_general_ci',
`end_station_code` VARCHAR(32) NOT NULL COMMENT '终点车站' COLLATE 'utf8_general_ci',
`end_section_code` VARCHAR(32) NOT NULL COMMENT '终点站台' COLLATE 'utf8_general_ci',
`right` TINYINT(1) NULL DEFAULT '0' COMMENT '左右行方向',
`destination_code` VARCHAR(45) NULL DEFAULT NULL COMMENT '目的地码' COLLATE 'utf8_general_ci',
`remarks` VARCHAR(512) NULL DEFAULT NULL COMMENT '描述' COLLATE 'utf8_general_ci',
`section_data` LONGTEXT NOT NULL COMMENT '区段数据' COLLATE 'utf8_general_ci',
PRIMARY KEY (`id`),
INDEX `map_id_user_id` (`map_id`, `user_id`)
)
COMMENT='运行图用户交路'
COLLATE='utf8_general_ci'
ENGINE=InnoDB
;
CREATE TABLE `run_plan_runlevel` (
`id` BIGINT(20) NOT NULL AUTO_INCREMENT,
`map_id` BIGINT(20) NOT NULL COMMENT '地图id',
`user_id` BIGINT(20) NOT NULL COMMENT '用户id',
`start_station_code` VARCHAR(32) NOT NULL COMMENT '起始车站' COLLATE 'utf8_general_ci',
`start_section_code` VARCHAR(32) NOT NULL COMMENT '起始站台' COLLATE 'utf8_general_ci',
`end_station_code` VARCHAR(32) NOT NULL COMMENT '终点车站' COLLATE 'utf8_general_ci',
`end_section_code` VARCHAR(32) NOT NULL COMMENT '终点站台' COLLATE 'utf8_general_ci',
`right` TINYINT(1) NOT NULL COMMENT '方向',
`distance` FLOAT NOT NULL COMMENT '距离(米)',
`level1` INT(11) NOT NULL COMMENT '等级一s',
`level2` INT(11) NOT NULL COMMENT '等级二s',
`level3` INT(11) NOT NULL COMMENT '等级三s',
`level4` INT(11) NOT NULL COMMENT '等级四s',
`level5` INT(11) NOT NULL COMMENT '等级五s',
PRIMARY KEY (`id`),
INDEX `map_id_user_id` (`map_id`, `user_id`)
)
COMMENT='运行图用户站间运行等级'
COLLATE='utf8_general_ci'
ENGINE=InnoDB
;
CREATE TABLE `run_plan_parktime` (
`id` BIGINT(20) NOT NULL AUTO_INCREMENT,
`map_id` BIGINT(20) NOT NULL COMMENT '所属地图id',
`user_id` BIGINT(20) NOT NULL COMMENT '用户id',
`station_code` VARCHAR(32) NOT NULL COMMENT '车站code' COLLATE 'utf8_general_ci',
`section_code` VARCHAR(32) NOT NULL COMMENT '区段code' COLLATE 'utf8_general_ci',
`parking_time` INT(11) NOT NULL DEFAULT '30' COMMENT '停站时间s',
PRIMARY KEY (`id`),
INDEX `map_id_user_id` (`map_id`, `user_id`)
)
COMMENT='运行图用户车站停站时间'
COLLATE='utf8_general_ci'
ENGINE=InnoDB
;
CREATE TABLE `run_plan_user_config` (
`id` BIGINT(20) NOT NULL AUTO_INCREMENT,
`map_id` BIGINT(20) NOT NULL COMMENT '所属地图id',
`user_id` BIGINT(20) NOT NULL COMMENT '用户id',
`config` LONGTEXT NOT NULL COMMENT '折返车站code' COLLATE 'utf8_general_ci',
PRIMARY KEY (`id`),
INDEX `map_id_user_id` (`map_id`, `user_id`)
)
COMMENT='运行图用户配置数据'
COLLATE='utf8_general_ci'
ENGINE=InnoDB
;

View File

@ -1,2 +0,0 @@
alter table user_simulation_stats modify role varchar(64) null comment '用户角色';

View File

@ -1,11 +0,0 @@
ALTER TABLE `map_passenger_flow`
ADD COLUMN `name` VARCHAR(50) NOT NULL DEFAULT '默认' COMMENT '客流数据描述名称' AFTER `map_id`,
ADD COLUMN `initial` TINYINT(1) NOT NULL DEFAULT 1 COMMENT '初始默认数据' AFTER `trip_pf`;
ALTER TABLE `draft_ibp`
ALTER `station_code` DROP DEFAULT;
ALTER TABLE `draft_ibp`
CHANGE COLUMN `station_code` `station_code` VARCHAR(32) NULL COMMENT '车站编号' COLLATE 'utf8_general_ci' AFTER `map_id`;
ALTER TABLE `ibp`
ALTER `station_code` DROP DEFAULT;
ALTER TABLE `ibp`
CHANGE COLUMN `station_code` `station_code` VARCHAR(32) NULL COMMENT '车站编号' COLLATE 'utf8_general_ci' AFTER `map_id`;

View File

@ -1,9 +0,0 @@
alter table iscs drop key line_code_station_code_total_system_system_interface;
alter table iscs drop column line_code;
alter table iscs drop column station_code;
alter table iscs
add map_id bigint not null after id;

View File

@ -1,102 +0,0 @@
ALTER TABLE `sys_user`
DROP COLUMN `company_id`;
CREATE TABLE `company_department` (
`id` INT(11) NOT NULL AUTO_INCREMENT,
`name` VARCHAR(32) NOT NULL COMMENT '部门名称' COLLATE 'utf8_general_ci',
`company_id` INT(11) NOT NULL COMMENT '单位id',
`parent_id` INT(11) NULL DEFAULT NULL COMMENT '父级id',
PRIMARY KEY (`id`),
INDEX `FK_company_department_company` (`company_id`),
INDEX `FK_company_department_company_department` (`parent_id`),
CONSTRAINT `FK_company_department_company` FOREIGN KEY (`company_id`) REFERENCES `company` (`id`) ON DELETE CASCADE,
CONSTRAINT `FK_company_department_company_department` FOREIGN KEY (`parent_id`) REFERENCES `company_department` (`id`) ON DELETE SET NULL
)
COMMENT='单位部门信息'
COLLATE='utf8_general_ci'
ENGINE=InnoDB
;
CREATE TABLE `company_position` (
`id` INT(11) NOT NULL AUTO_INCREMENT,
`name` VARCHAR(32) NOT NULL COMMENT '职位名称' COLLATE 'utf8_general_ci',
`company_id` INT(11) NOT NULL COMMENT '单位id',
PRIMARY KEY (`id`),
INDEX `FK_company_position_company` (`company_id`),
CONSTRAINT `FK_company_position_company` FOREIGN KEY (`company_id`) REFERENCES `company` (`id`) ON DELETE CASCADE
)
COMMENT='单位职位信息'
COLLATE='utf8_general_ci'
ENGINE=InnoDB
;
CREATE TABLE `company_user` (
`company_id` INT(11) NOT NULL COMMENT '公司id',
`user_id` BIGINT(20) NOT NULL COMMENT '用户id',
`admin` TINYINT(1) NOT NULL DEFAULT '0' COMMENT '公司管理员',
UNIQUE INDEX `user_id` (`user_id`),
INDEX `FK_company_user_company` (`company_id`),
CONSTRAINT `FK_company_user_company` FOREIGN KEY (`company_id`) REFERENCES `company` (`id`) ON DELETE CASCADE,
CONSTRAINT `FK_company_user_sys_user` FOREIGN KEY (`user_id`) REFERENCES `sys_user` (`id`) ON DELETE CASCADE
)
COMMENT='单位用户关系'
COLLATE='utf8_general_ci'
ENGINE=InnoDB
;
CREATE TABLE `department_user` (
`id` BIGINT(20) NOT NULL AUTO_INCREMENT,
`user_id` BIGINT(20) NOT NULL COMMENT '用户id',
`department_id` INT(11) NOT NULL COMMENT '部门id',
`position_id` INT(11) NULL DEFAULT NULL COMMENT '职位id',
`manager` TINYINT(1) NOT NULL DEFAULT '0' COMMENT '部门管理员',
`create_time` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`update_time` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
PRIMARY KEY (`id`),
INDEX `FK_department_user_company_position` (`position_id`),
INDEX `FK_department_user_sys_user` (`user_id`),
INDEX `FK_department_user_company_department` (`department_id`),
CONSTRAINT `FK_department_user_company_department` FOREIGN KEY (`department_id`) REFERENCES `company_department` (`id`) ON DELETE CASCADE,
CONSTRAINT `FK_department_user_company_position` FOREIGN KEY (`position_id`) REFERENCES `company_position` (`id`) ON DELETE SET NULL,
CONSTRAINT `FK_department_user_sys_user` FOREIGN KEY (`user_id`) REFERENCES `sys_user` (`id`) ON DELETE CASCADE
)
COMMENT='用户、部门关联表'
COLLATE='utf8_general_ci'
ENGINE=InnoDB
;
CREATE TABLE `department_lesson` (
`lesson_id` BIGINT(20) NOT NULL COMMENT '课程id',
`department_id` INT(11) NOT NULL COMMENT '班级id',
INDEX `lesson_id` (`lesson_id`),
INDEX `department_lesson_ibfk_1` (`department_id`),
CONSTRAINT `department_lesson_ibfk_1` FOREIGN KEY (`department_id`) REFERENCES `company_department` (`id`) ON UPDATE RESTRICT ON DELETE CASCADE,
CONSTRAINT `department_lesson_ibfk_2` FOREIGN KEY (`lesson_id`) REFERENCES `ls_lesson` (`id`) ON UPDATE RESTRICT ON DELETE CASCADE
)
COMMENT='班级课程表'
COLLATE='utf8_general_ci'
ENGINE=InnoDB
;
CREATE TABLE `department_exam` (
`exam_id` BIGINT(20) NOT NULL,
`department_id` INT(11) NOT NULL,
INDEX `exam_id` (`exam_id`),
INDEX `department_exam_ibfk_2` (`department_id`),
CONSTRAINT `department_exam_ibfk_1` FOREIGN KEY (`exam_id`) REFERENCES `exam_definition` (`id`) ON UPDATE RESTRICT ON DELETE CASCADE,
CONSTRAINT `department_exam_ibfk_2` FOREIGN KEY (`department_id`) REFERENCES `company_department` (`id`) ON UPDATE RESTRICT ON DELETE CASCADE
)
COMMENT='学生的试卷和班级关系'
COLLATE='utf8_general_ci'
ENGINE=InnoDB
;
DROP TABLE `user_company_rel`;
ALTER TABLE `company`
ADD COLUMN `project_code` VARCHAR(64) NULL DEFAULT NULL COMMENT '关联项目' AFTER `phone`;

View File

@ -1,567 +0,0 @@
-- 创建贵装备单位
INSERT INTO `joylink`.`company` (`id`,`name`, `address`, `create_time`, `project_code`) VALUES ('6','贵州装备', '贵州', '2021-01-11 17:08:06', 'GZB');
-- 创建贵装备班级
INSERT INTO `company_department` (`id`, `name`, `company_id`) VALUES (14, '19城轨2班', 6);
INSERT INTO `company_department` (`id`, `name`, `company_id`) VALUES (9, '城轨1班', 6);
INSERT INTO `company_department` (`id`, `name`, `company_id`) VALUES (16, '19城轨机电2班', 6);
INSERT INTO `company_department` (`id`, `name`, `company_id`) VALUES (17, '19城轨机电1班', 6);
INSERT INTO `company_department` (`id`, `name`, `company_id`) VALUES (12, '18城市轨道交通机电技术2班', 6);
INSERT INTO `company_department` (`id`, `name`, `company_id`) VALUES (11, '18城市轨道交通机电技术1班', 6);
INSERT INTO `company_department` (`id`, `name`, `company_id`) VALUES (13, '18城市轨道交通机电技术3班', 6);
-- 创建单位成员
INSERT INTO `company_user` (`company_id`, `user_id`, `admin`) VALUES (6, 620, 1);
INSERT INTO `company_user` (`company_id`, `user_id`, `admin`) VALUES (6, 628, 1);
INSERT INTO `company_user` (`company_id`, `user_id`, `admin`) VALUES (6, 630, 1);
INSERT INTO `company_user` (`company_id`, `user_id`) VALUES (6, 842);
INSERT INTO `company_user` (`company_id`, `user_id`) VALUES (6, 843);
INSERT INTO `company_user` (`company_id`, `user_id`) VALUES (6, 844);
INSERT INTO `company_user` (`company_id`, `user_id`) VALUES (6, 884);
INSERT INTO `company_user` (`company_id`, `user_id`) VALUES (6, 885);
INSERT INTO `company_user` (`company_id`, `user_id`) VALUES (6, 886);
INSERT INTO `company_user` (`company_id`, `user_id`) VALUES (6, 887);
INSERT INTO `company_user` (`company_id`, `user_id`) VALUES (6, 888);
INSERT INTO `company_user` (`company_id`, `user_id`) VALUES (6, 889);
INSERT INTO `company_user` (`company_id`, `user_id`) VALUES (6, 890);
INSERT INTO `company_user` (`company_id`, `user_id`) VALUES (6, 891);
INSERT INTO `company_user` (`company_id`, `user_id`) VALUES (6, 892);
INSERT INTO `company_user` (`company_id`, `user_id`) VALUES (6, 893);
INSERT INTO `company_user` (`company_id`, `user_id`) VALUES (6, 894);
INSERT INTO `company_user` (`company_id`, `user_id`) VALUES (6, 895);
INSERT INTO `company_user` (`company_id`, `user_id`) VALUES (6, 896);
INSERT INTO `company_user` (`company_id`, `user_id`) VALUES (6, 897);
INSERT INTO `company_user` (`company_id`, `user_id`) VALUES (6, 898);
INSERT INTO `company_user` (`company_id`, `user_id`) VALUES (6, 899);
INSERT INTO `company_user` (`company_id`, `user_id`) VALUES (6, 900);
INSERT INTO `company_user` (`company_id`, `user_id`) VALUES (6, 901);
INSERT INTO `company_user` (`company_id`, `user_id`) VALUES (6, 902);
INSERT INTO `company_user` (`company_id`, `user_id`) VALUES (6, 903);
INSERT INTO `company_user` (`company_id`, `user_id`) VALUES (6, 904);
INSERT INTO `company_user` (`company_id`, `user_id`) VALUES (6, 905);
INSERT INTO `company_user` (`company_id`, `user_id`) VALUES (6, 906);
INSERT INTO `company_user` (`company_id`, `user_id`) VALUES (6, 907);
INSERT INTO `company_user` (`company_id`, `user_id`) VALUES (6, 908);
INSERT INTO `company_user` (`company_id`, `user_id`) VALUES (6, 909);
INSERT INTO `company_user` (`company_id`, `user_id`) VALUES (6, 910);
INSERT INTO `company_user` (`company_id`, `user_id`) VALUES (6, 911);
INSERT INTO `company_user` (`company_id`, `user_id`) VALUES (6, 912);
INSERT INTO `company_user` (`company_id`, `user_id`) VALUES (6, 913);
INSERT INTO `company_user` (`company_id`, `user_id`) VALUES (6, 914);
INSERT INTO `company_user` (`company_id`, `user_id`) VALUES (6, 915);
INSERT INTO `company_user` (`company_id`, `user_id`) VALUES (6, 916);
INSERT INTO `company_user` (`company_id`, `user_id`) VALUES (6, 917);
INSERT INTO `company_user` (`company_id`, `user_id`) VALUES (6, 918);
INSERT INTO `company_user` (`company_id`, `user_id`) VALUES (6, 919);
INSERT INTO `company_user` (`company_id`, `user_id`) VALUES (6, 920);
INSERT INTO `company_user` (`company_id`, `user_id`) VALUES (6, 921);
INSERT INTO `company_user` (`company_id`, `user_id`) VALUES (6, 922);
INSERT INTO `company_user` (`company_id`, `user_id`) VALUES (6, 923);
INSERT INTO `company_user` (`company_id`, `user_id`) VALUES (6, 924);
INSERT INTO `company_user` (`company_id`, `user_id`) VALUES (6, 925);
INSERT INTO `company_user` (`company_id`, `user_id`) VALUES (6, 926);
INSERT INTO `company_user` (`company_id`, `user_id`) VALUES (6, 927);
INSERT INTO `company_user` (`company_id`, `user_id`) VALUES (6, 928);
INSERT INTO `company_user` (`company_id`, `user_id`) VALUES (6, 929);
INSERT INTO `company_user` (`company_id`, `user_id`) VALUES (6, 930);
INSERT INTO `company_user` (`company_id`, `user_id`) VALUES (6, 931);
INSERT INTO `company_user` (`company_id`, `user_id`) VALUES (6, 932);
INSERT INTO `company_user` (`company_id`, `user_id`) VALUES (6, 933);
INSERT INTO `company_user` (`company_id`, `user_id`) VALUES (6, 934);
INSERT INTO `company_user` (`company_id`, `user_id`) VALUES (6, 935);
INSERT INTO `company_user` (`company_id`, `user_id`) VALUES (6, 936);
INSERT INTO `company_user` (`company_id`, `user_id`) VALUES (6, 937);
INSERT INTO `company_user` (`company_id`, `user_id`) VALUES (6, 938);
INSERT INTO `company_user` (`company_id`, `user_id`) VALUES (6, 939);
INSERT INTO `company_user` (`company_id`, `user_id`) VALUES (6, 940);
INSERT INTO `company_user` (`company_id`, `user_id`) VALUES (6, 941);
INSERT INTO `company_user` (`company_id`, `user_id`) VALUES (6, 942);
INSERT INTO `company_user` (`company_id`, `user_id`) VALUES (6, 943);
INSERT INTO `company_user` (`company_id`, `user_id`) VALUES (6, 944);
INSERT INTO `company_user` (`company_id`, `user_id`) VALUES (6, 945);
INSERT INTO `company_user` (`company_id`, `user_id`) VALUES (6, 946);
INSERT INTO `company_user` (`company_id`, `user_id`) VALUES (6, 947);
INSERT INTO `company_user` (`company_id`, `user_id`) VALUES (6, 948);
INSERT INTO `company_user` (`company_id`, `user_id`) VALUES (6, 949);
INSERT INTO `company_user` (`company_id`, `user_id`) VALUES (6, 950);
INSERT INTO `company_user` (`company_id`, `user_id`) VALUES (6, 951);
INSERT INTO `company_user` (`company_id`, `user_id`) VALUES (6, 952);
INSERT INTO `company_user` (`company_id`, `user_id`) VALUES (6, 953);
INSERT INTO `company_user` (`company_id`, `user_id`) VALUES (6, 954);
INSERT INTO `company_user` (`company_id`, `user_id`) VALUES (6, 955);
INSERT INTO `company_user` (`company_id`, `user_id`) VALUES (6, 956);
INSERT INTO `company_user` (`company_id`, `user_id`) VALUES (6, 957);
INSERT INTO `company_user` (`company_id`, `user_id`) VALUES (6, 958);
INSERT INTO `company_user` (`company_id`, `user_id`) VALUES (6, 959);
INSERT INTO `company_user` (`company_id`, `user_id`) VALUES (6, 960);
INSERT INTO `company_user` (`company_id`, `user_id`) VALUES (6, 961);
INSERT INTO `company_user` (`company_id`, `user_id`) VALUES (6, 962);
INSERT INTO `company_user` (`company_id`, `user_id`) VALUES (6, 963);
INSERT INTO `company_user` (`company_id`, `user_id`) VALUES (6, 964);
INSERT INTO `company_user` (`company_id`, `user_id`) VALUES (6, 965);
INSERT INTO `company_user` (`company_id`, `user_id`) VALUES (6, 966);
INSERT INTO `company_user` (`company_id`, `user_id`) VALUES (6, 967);
INSERT INTO `company_user` (`company_id`, `user_id`) VALUES (6, 968);
INSERT INTO `company_user` (`company_id`, `user_id`) VALUES (6, 969);
INSERT INTO `company_user` (`company_id`, `user_id`) VALUES (6, 970);
INSERT INTO `company_user` (`company_id`, `user_id`) VALUES (6, 971);
INSERT INTO `company_user` (`company_id`, `user_id`) VALUES (6, 972);
INSERT INTO `company_user` (`company_id`, `user_id`) VALUES (6, 973);
INSERT INTO `company_user` (`company_id`, `user_id`) VALUES (6, 974);
INSERT INTO `company_user` (`company_id`, `user_id`) VALUES (6, 975);
INSERT INTO `company_user` (`company_id`, `user_id`) VALUES (6, 976);
INSERT INTO `company_user` (`company_id`, `user_id`) VALUES (6, 977);
INSERT INTO `company_user` (`company_id`, `user_id`) VALUES (6, 978);
INSERT INTO `company_user` (`company_id`, `user_id`) VALUES (6, 979);
INSERT INTO `company_user` (`company_id`, `user_id`) VALUES (6, 980);
INSERT INTO `company_user` (`company_id`, `user_id`) VALUES (6, 981);
INSERT INTO `company_user` (`company_id`, `user_id`) VALUES (6, 982);
INSERT INTO `company_user` (`company_id`, `user_id`) VALUES (6, 983);
INSERT INTO `company_user` (`company_id`, `user_id`) VALUES (6, 984);
INSERT INTO `company_user` (`company_id`, `user_id`) VALUES (6, 985);
INSERT INTO `company_user` (`company_id`, `user_id`) VALUES (6, 986);
INSERT INTO `company_user` (`company_id`, `user_id`) VALUES (6, 987);
INSERT INTO `company_user` (`company_id`, `user_id`) VALUES (6, 988);
INSERT INTO `company_user` (`company_id`, `user_id`) VALUES (6, 989);
INSERT INTO `company_user` (`company_id`, `user_id`) VALUES (6, 990);
INSERT INTO `company_user` (`company_id`, `user_id`) VALUES (6, 991);
INSERT INTO `company_user` (`company_id`, `user_id`) VALUES (6, 992);
INSERT INTO `company_user` (`company_id`, `user_id`) VALUES (6, 993);
INSERT INTO `company_user` (`company_id`, `user_id`) VALUES (6, 994);
INSERT INTO `company_user` (`company_id`, `user_id`) VALUES (6, 995);
INSERT INTO `company_user` (`company_id`, `user_id`) VALUES (6, 996);
INSERT INTO `company_user` (`company_id`, `user_id`) VALUES (6, 997);
INSERT INTO `company_user` (`company_id`, `user_id`) VALUES (6, 998);
INSERT INTO `company_user` (`company_id`, `user_id`) VALUES (6, 999);
INSERT INTO `company_user` (`company_id`, `user_id`) VALUES (6, 1000);
INSERT INTO `company_user` (`company_id`, `user_id`) VALUES (6, 1001);
INSERT INTO `company_user` (`company_id`, `user_id`) VALUES (6, 1002);
INSERT INTO `company_user` (`company_id`, `user_id`) VALUES (6, 1003);
INSERT INTO `company_user` (`company_id`, `user_id`) VALUES (6, 1004);
INSERT INTO `company_user` (`company_id`, `user_id`) VALUES (6, 1005);
INSERT INTO `company_user` (`company_id`, `user_id`) VALUES (6, 1006);
INSERT INTO `company_user` (`company_id`, `user_id`) VALUES (6, 1007);
INSERT INTO `company_user` (`company_id`, `user_id`) VALUES (6, 1008);
INSERT INTO `company_user` (`company_id`, `user_id`) VALUES (6, 1009);
INSERT INTO `company_user` (`company_id`, `user_id`) VALUES (6, 1010);
INSERT INTO `company_user` (`company_id`, `user_id`) VALUES (6, 1011);
INSERT INTO `company_user` (`company_id`, `user_id`) VALUES (6, 1012);
INSERT INTO `company_user` (`company_id`, `user_id`) VALUES (6, 1013);
INSERT INTO `company_user` (`company_id`, `user_id`) VALUES (6, 1014);
INSERT INTO `company_user` (`company_id`, `user_id`) VALUES (6, 1015);
INSERT INTO `company_user` (`company_id`, `user_id`) VALUES (6, 1016);
INSERT INTO `company_user` (`company_id`, `user_id`) VALUES (6, 1017);
INSERT INTO `company_user` (`company_id`, `user_id`) VALUES (6, 2654);
INSERT INTO `company_user` (`company_id`, `user_id`) VALUES (6, 2655);
INSERT INTO `company_user` (`company_id`, `user_id`) VALUES (6, 2656);
INSERT INTO `company_user` (`company_id`, `user_id`) VALUES (6, 2658);
INSERT INTO `company_user` (`company_id`, `user_id`) VALUES (6, 2659);
INSERT INTO `company_user` (`company_id`, `user_id`) VALUES (6, 2697);
INSERT INTO `company_user` (`company_id`, `user_id`) VALUES (6, 2698);
INSERT INTO `company_user` (`company_id`, `user_id`) VALUES (6, 2699);
INSERT INTO `company_user` (`company_id`, `user_id`) VALUES (6, 2700);
INSERT INTO `company_user` (`company_id`, `user_id`) VALUES (6, 2701);
INSERT INTO `company_user` (`company_id`, `user_id`) VALUES (6, 2702);
INSERT INTO `company_user` (`company_id`, `user_id`) VALUES (6, 2703);
INSERT INTO `company_user` (`company_id`, `user_id`) VALUES (6, 2704);
INSERT INTO `company_user` (`company_id`, `user_id`) VALUES (6, 2705);
INSERT INTO `company_user` (`company_id`, `user_id`) VALUES (6, 2706);
INSERT INTO `company_user` (`company_id`, `user_id`) VALUES (6, 2707);
INSERT INTO `company_user` (`company_id`, `user_id`) VALUES (6, 2708);
INSERT INTO `company_user` (`company_id`, `user_id`) VALUES (6, 2709);
INSERT INTO `company_user` (`company_id`, `user_id`) VALUES (6, 2710);
INSERT INTO `company_user` (`company_id`, `user_id`) VALUES (6, 2711);
INSERT INTO `company_user` (`company_id`, `user_id`) VALUES (6, 2712);
INSERT INTO `company_user` (`company_id`, `user_id`) VALUES (6, 2713);
INSERT INTO `company_user` (`company_id`, `user_id`) VALUES (6, 2714);
INSERT INTO `company_user` (`company_id`, `user_id`) VALUES (6, 2715);
INSERT INTO `company_user` (`company_id`, `user_id`) VALUES (6, 2716);
INSERT INTO `company_user` (`company_id`, `user_id`) VALUES (6, 2717);
INSERT INTO `company_user` (`company_id`, `user_id`) VALUES (6, 2718);
INSERT INTO `company_user` (`company_id`, `user_id`) VALUES (6, 2719);
INSERT INTO `company_user` (`company_id`, `user_id`) VALUES (6, 2720);
INSERT INTO `company_user` (`company_id`, `user_id`) VALUES (6, 2721);
INSERT INTO `company_user` (`company_id`, `user_id`) VALUES (6, 2722);
INSERT INTO `company_user` (`company_id`, `user_id`) VALUES (6, 2723);
INSERT INTO `company_user` (`company_id`, `user_id`) VALUES (6, 2724);
INSERT INTO `company_user` (`company_id`, `user_id`) VALUES (6, 2725);
INSERT INTO `company_user` (`company_id`, `user_id`) VALUES (6, 2726);
INSERT INTO `company_user` (`company_id`, `user_id`) VALUES (6, 2727);
INSERT INTO `company_user` (`company_id`, `user_id`) VALUES (6, 2728);
INSERT INTO `company_user` (`company_id`, `user_id`) VALUES (6, 2729);
INSERT INTO `company_user` (`company_id`, `user_id`) VALUES (6, 2730);
INSERT INTO `company_user` (`company_id`, `user_id`) VALUES (6, 2731);
INSERT INTO `company_user` (`company_id`, `user_id`) VALUES (6, 2732);
INSERT INTO `company_user` (`company_id`, `user_id`) VALUES (6, 2733);
INSERT INTO `company_user` (`company_id`, `user_id`) VALUES (6, 2734);
INSERT INTO `company_user` (`company_id`, `user_id`) VALUES (6, 2735);
INSERT INTO `company_user` (`company_id`, `user_id`) VALUES (6, 2736);
INSERT INTO `company_user` (`company_id`, `user_id`) VALUES (6, 2737);
INSERT INTO `company_user` (`company_id`, `user_id`) VALUES (6, 2738);
INSERT INTO `company_user` (`company_id`, `user_id`) VALUES (6, 2739);
INSERT INTO `company_user` (`company_id`, `user_id`) VALUES (6, 2740);
INSERT INTO `company_user` (`company_id`, `user_id`) VALUES (6, 2741);
INSERT INTO `company_user` (`company_id`, `user_id`) VALUES (6, 2742);
INSERT INTO `company_user` (`company_id`, `user_id`) VALUES (6, 2743);
INSERT INTO `company_user` (`company_id`, `user_id`) VALUES (6, 2744);
INSERT INTO `company_user` (`company_id`, `user_id`) VALUES (6, 2745);
INSERT INTO `company_user` (`company_id`, `user_id`) VALUES (6, 2746);
INSERT INTO `company_user` (`company_id`, `user_id`) VALUES (6, 2747);
INSERT INTO `company_user` (`company_id`, `user_id`) VALUES (6, 2748);
INSERT INTO `company_user` (`company_id`, `user_id`) VALUES (6, 3026);
INSERT INTO `company_user` (`company_id`, `user_id`) VALUES (6, 3027);
INSERT INTO `company_user` (`company_id`, `user_id`) VALUES (6, 3028);
INSERT INTO `company_user` (`company_id`, `user_id`) VALUES (6, 3029);
INSERT INTO `company_user` (`company_id`, `user_id`) VALUES (6, 3030);
INSERT INTO `company_user` (`company_id`, `user_id`) VALUES (6, 3031);
INSERT INTO `company_user` (`company_id`, `user_id`) VALUES (6, 3032);
INSERT INTO `company_user` (`company_id`, `user_id`) VALUES (6, 3033);
INSERT INTO `company_user` (`company_id`, `user_id`) VALUES (6, 3034);
INSERT INTO `company_user` (`company_id`, `user_id`) VALUES (6, 3035);
INSERT INTO `company_user` (`company_id`, `user_id`) VALUES (6, 3036);
INSERT INTO `company_user` (`company_id`, `user_id`) VALUES (6, 3037);
INSERT INTO `company_user` (`company_id`, `user_id`) VALUES (6, 3038);
INSERT INTO `company_user` (`company_id`, `user_id`) VALUES (6, 3039);
INSERT INTO `company_user` (`company_id`, `user_id`) VALUES (6, 3040);
INSERT INTO `company_user` (`company_id`, `user_id`) VALUES (6, 3041);
INSERT INTO `company_user` (`company_id`, `user_id`) VALUES (6, 3042);
INSERT INTO `company_user` (`company_id`, `user_id`) VALUES (6, 3043);
INSERT INTO `company_user` (`company_id`, `user_id`) VALUES (6, 3044);
INSERT INTO `company_user` (`company_id`, `user_id`) VALUES (6, 3045);
INSERT INTO `company_user` (`company_id`, `user_id`) VALUES (6, 3046);
INSERT INTO `company_user` (`company_id`, `user_id`) VALUES (6, 3047);
INSERT INTO `company_user` (`company_id`, `user_id`) VALUES (6, 3048);
INSERT INTO `company_user` (`company_id`, `user_id`) VALUES (6, 3049);
INSERT INTO `company_user` (`company_id`, `user_id`) VALUES (6, 3050);
INSERT INTO `company_user` (`company_id`, `user_id`) VALUES (6, 3051);
INSERT INTO `company_user` (`company_id`, `user_id`) VALUES (6, 3052);
INSERT INTO `company_user` (`company_id`, `user_id`) VALUES (6, 3053);
INSERT INTO `company_user` (`company_id`, `user_id`) VALUES (6, 3054);
INSERT INTO `company_user` (`company_id`, `user_id`) VALUES (6, 3055);
INSERT INTO `company_user` (`company_id`, `user_id`) VALUES (6, 3056);
INSERT INTO `company_user` (`company_id`, `user_id`) VALUES (6, 3057);
INSERT INTO `company_user` (`company_id`, `user_id`) VALUES (6, 3058);
INSERT INTO `company_user` (`company_id`, `user_id`) VALUES (6, 3059);
INSERT INTO `company_user` (`company_id`, `user_id`) VALUES (6, 3060);
INSERT INTO `company_user` (`company_id`, `user_id`) VALUES (6, 3061);
INSERT INTO `company_user` (`company_id`, `user_id`) VALUES (6, 3062);
INSERT INTO `company_user` (`company_id`, `user_id`) VALUES (6, 3063);
INSERT INTO `company_user` (`company_id`, `user_id`) VALUES (6, 3064);
INSERT INTO `company_user` (`company_id`, `user_id`) VALUES (6, 3065);
INSERT INTO `company_user` (`company_id`, `user_id`) VALUES (6, 3066);
INSERT INTO `company_user` (`company_id`, `user_id`) VALUES (6, 3067);
INSERT INTO `company_user` (`company_id`, `user_id`) VALUES (6, 3068);
INSERT INTO `company_user` (`company_id`, `user_id`) VALUES (6, 3069);
INSERT INTO `company_user` (`company_id`, `user_id`) VALUES (6, 3070);
INSERT INTO `company_user` (`company_id`, `user_id`) VALUES (6, 3071);
INSERT INTO `company_user` (`company_id`, `user_id`) VALUES (6, 3072);
INSERT INTO `company_user` (`company_id`, `user_id`) VALUES (6, 3073);
INSERT INTO `company_user` (`company_id`, `user_id`) VALUES (6, 3074);
INSERT INTO `company_user` (`company_id`, `user_id`) VALUES (6, 3075);
-- 创建部门成员关系
INSERT INTO `department_user` (`department_id`, `user_id`, `manager`) VALUES (9, 620, 1);
INSERT INTO `department_user` (`department_id`, `user_id`, `manager`) VALUES (14, 620, 1);
INSERT INTO `department_user` (`department_id`, `user_id`, `manager`) VALUES (16, 620, 1);
INSERT INTO `department_user` (`department_id`, `user_id`, `manager`) VALUES (17, 628, 1);
INSERT INTO `department_user` (`department_id`, `user_id`, `manager`) VALUES (11, 630, 1);
INSERT INTO `department_user` (`department_id`, `user_id`, `manager`) VALUES (12, 630, 1);
INSERT INTO `department_user` (`department_id`, `user_id`, `manager`) VALUES (13, 630, 1);
INSERT INTO `department_user` (`department_id`, `user_id`) VALUES (9, 842);
INSERT INTO `department_user` (`department_id`, `user_id`) VALUES (9, 843);
INSERT INTO `department_user` (`department_id`, `user_id`) VALUES (9, 844);
INSERT INTO `department_user` (`department_id`, `user_id`) VALUES (11, 884);
INSERT INTO `department_user` (`department_id`, `user_id`) VALUES (11, 885);
INSERT INTO `department_user` (`department_id`, `user_id`) VALUES (11, 886);
INSERT INTO `department_user` (`department_id`, `user_id`) VALUES (11, 887);
INSERT INTO `department_user` (`department_id`, `user_id`) VALUES (11, 888);
INSERT INTO `department_user` (`department_id`, `user_id`) VALUES (11, 889);
INSERT INTO `department_user` (`department_id`, `user_id`) VALUES (11, 890);
INSERT INTO `department_user` (`department_id`, `user_id`) VALUES (11, 891);
INSERT INTO `department_user` (`department_id`, `user_id`) VALUES (11, 892);
INSERT INTO `department_user` (`department_id`, `user_id`) VALUES (11, 893);
INSERT INTO `department_user` (`department_id`, `user_id`) VALUES (11, 894);
INSERT INTO `department_user` (`department_id`, `user_id`) VALUES (11, 895);
INSERT INTO `department_user` (`department_id`, `user_id`) VALUES (11, 896);
INSERT INTO `department_user` (`department_id`, `user_id`) VALUES (11, 897);
INSERT INTO `department_user` (`department_id`, `user_id`) VALUES (11, 898);
INSERT INTO `department_user` (`department_id`, `user_id`) VALUES (11, 899);
INSERT INTO `department_user` (`department_id`, `user_id`) VALUES (11, 900);
INSERT INTO `department_user` (`department_id`, `user_id`) VALUES (11, 901);
INSERT INTO `department_user` (`department_id`, `user_id`) VALUES (11, 902);
INSERT INTO `department_user` (`department_id`, `user_id`) VALUES (11, 903);
INSERT INTO `department_user` (`department_id`, `user_id`) VALUES (11, 904);
INSERT INTO `department_user` (`department_id`, `user_id`) VALUES (11, 905);
INSERT INTO `department_user` (`department_id`, `user_id`) VALUES (11, 906);
INSERT INTO `department_user` (`department_id`, `user_id`) VALUES (11, 907);
INSERT INTO `department_user` (`department_id`, `user_id`) VALUES (11, 908);
INSERT INTO `department_user` (`department_id`, `user_id`) VALUES (11, 909);
INSERT INTO `department_user` (`department_id`, `user_id`) VALUES (11, 910);
INSERT INTO `department_user` (`department_id`, `user_id`) VALUES (11, 911);
INSERT INTO `department_user` (`department_id`, `user_id`) VALUES (11, 912);
INSERT INTO `department_user` (`department_id`, `user_id`) VALUES (11, 913);
INSERT INTO `department_user` (`department_id`, `user_id`) VALUES (11, 914);
INSERT INTO `department_user` (`department_id`, `user_id`) VALUES (11, 915);
INSERT INTO `department_user` (`department_id`, `user_id`) VALUES (11, 916);
INSERT INTO `department_user` (`department_id`, `user_id`) VALUES (11, 917);
INSERT INTO `department_user` (`department_id`, `user_id`) VALUES (11, 918);
INSERT INTO `department_user` (`department_id`, `user_id`) VALUES (11, 919);
INSERT INTO `department_user` (`department_id`, `user_id`) VALUES (11, 920);
INSERT INTO `department_user` (`department_id`, `user_id`) VALUES (11, 921);
INSERT INTO `department_user` (`department_id`, `user_id`) VALUES (11, 922);
INSERT INTO `department_user` (`department_id`, `user_id`) VALUES (11, 923);
INSERT INTO `department_user` (`department_id`, `user_id`) VALUES (11, 924);
INSERT INTO `department_user` (`department_id`, `user_id`) VALUES (11, 925);
INSERT INTO `department_user` (`department_id`, `user_id`) VALUES (11, 926);
INSERT INTO `department_user` (`department_id`, `user_id`) VALUES (11, 927);
INSERT INTO `department_user` (`department_id`, `user_id`) VALUES (12, 928);
INSERT INTO `department_user` (`department_id`, `user_id`) VALUES (12, 929);
INSERT INTO `department_user` (`department_id`, `user_id`) VALUES (12, 930);
INSERT INTO `department_user` (`department_id`, `user_id`) VALUES (12, 931);
INSERT INTO `department_user` (`department_id`, `user_id`) VALUES (12, 932);
INSERT INTO `department_user` (`department_id`, `user_id`) VALUES (12, 933);
INSERT INTO `department_user` (`department_id`, `user_id`) VALUES (12, 934);
INSERT INTO `department_user` (`department_id`, `user_id`) VALUES (12, 935);
INSERT INTO `department_user` (`department_id`, `user_id`) VALUES (12, 936);
INSERT INTO `department_user` (`department_id`, `user_id`) VALUES (12, 937);
INSERT INTO `department_user` (`department_id`, `user_id`) VALUES (12, 938);
INSERT INTO `department_user` (`department_id`, `user_id`) VALUES (12, 939);
INSERT INTO `department_user` (`department_id`, `user_id`) VALUES (12, 940);
INSERT INTO `department_user` (`department_id`, `user_id`) VALUES (12, 941);
INSERT INTO `department_user` (`department_id`, `user_id`) VALUES (12, 942);
INSERT INTO `department_user` (`department_id`, `user_id`) VALUES (12, 943);
INSERT INTO `department_user` (`department_id`, `user_id`) VALUES (12, 944);
INSERT INTO `department_user` (`department_id`, `user_id`) VALUES (12, 945);
INSERT INTO `department_user` (`department_id`, `user_id`) VALUES (12, 946);
INSERT INTO `department_user` (`department_id`, `user_id`) VALUES (12, 947);
INSERT INTO `department_user` (`department_id`, `user_id`) VALUES (12, 948);
INSERT INTO `department_user` (`department_id`, `user_id`) VALUES (12, 949);
INSERT INTO `department_user` (`department_id`, `user_id`) VALUES (12, 950);
INSERT INTO `department_user` (`department_id`, `user_id`) VALUES (12, 951);
INSERT INTO `department_user` (`department_id`, `user_id`) VALUES (12, 952);
INSERT INTO `department_user` (`department_id`, `user_id`) VALUES (12, 953);
INSERT INTO `department_user` (`department_id`, `user_id`) VALUES (12, 954);
INSERT INTO `department_user` (`department_id`, `user_id`) VALUES (12, 955);
INSERT INTO `department_user` (`department_id`, `user_id`) VALUES (12, 956);
INSERT INTO `department_user` (`department_id`, `user_id`) VALUES (12, 957);
INSERT INTO `department_user` (`department_id`, `user_id`) VALUES (12, 958);
INSERT INTO `department_user` (`department_id`, `user_id`) VALUES (12, 959);
INSERT INTO `department_user` (`department_id`, `user_id`) VALUES (12, 960);
INSERT INTO `department_user` (`department_id`, `user_id`) VALUES (12, 961);
INSERT INTO `department_user` (`department_id`, `user_id`) VALUES (12, 962);
INSERT INTO `department_user` (`department_id`, `user_id`) VALUES (12, 963);
INSERT INTO `department_user` (`department_id`, `user_id`) VALUES (12, 964);
INSERT INTO `department_user` (`department_id`, `user_id`) VALUES (12, 965);
INSERT INTO `department_user` (`department_id`, `user_id`) VALUES (12, 966);
INSERT INTO `department_user` (`department_id`, `user_id`) VALUES (12, 967);
INSERT INTO `department_user` (`department_id`, `user_id`) VALUES (12, 968);
INSERT INTO `department_user` (`department_id`, `user_id`) VALUES (12, 969);
INSERT INTO `department_user` (`department_id`, `user_id`) VALUES (13, 970);
INSERT INTO `department_user` (`department_id`, `user_id`) VALUES (13, 971);
INSERT INTO `department_user` (`department_id`, `user_id`) VALUES (13, 972);
INSERT INTO `department_user` (`department_id`, `user_id`) VALUES (13, 973);
INSERT INTO `department_user` (`department_id`, `user_id`) VALUES (13, 974);
INSERT INTO `department_user` (`department_id`, `user_id`) VALUES (13, 975);
INSERT INTO `department_user` (`department_id`, `user_id`) VALUES (13, 976);
INSERT INTO `department_user` (`department_id`, `user_id`) VALUES (13, 977);
INSERT INTO `department_user` (`department_id`, `user_id`) VALUES (13, 978);
INSERT INTO `department_user` (`department_id`, `user_id`) VALUES (13, 979);
INSERT INTO `department_user` (`department_id`, `user_id`) VALUES (13, 980);
INSERT INTO `department_user` (`department_id`, `user_id`) VALUES (13, 981);
INSERT INTO `department_user` (`department_id`, `user_id`) VALUES (13, 982);
INSERT INTO `department_user` (`department_id`, `user_id`) VALUES (13, 983);
INSERT INTO `department_user` (`department_id`, `user_id`) VALUES (13, 984);
INSERT INTO `department_user` (`department_id`, `user_id`) VALUES (13, 985);
INSERT INTO `department_user` (`department_id`, `user_id`) VALUES (13, 986);
INSERT INTO `department_user` (`department_id`, `user_id`) VALUES (13, 987);
INSERT INTO `department_user` (`department_id`, `user_id`) VALUES (13, 988);
INSERT INTO `department_user` (`department_id`, `user_id`) VALUES (13, 989);
INSERT INTO `department_user` (`department_id`, `user_id`) VALUES (13, 990);
INSERT INTO `department_user` (`department_id`, `user_id`) VALUES (13, 991);
INSERT INTO `department_user` (`department_id`, `user_id`) VALUES (13, 992);
INSERT INTO `department_user` (`department_id`, `user_id`) VALUES (13, 993);
INSERT INTO `department_user` (`department_id`, `user_id`) VALUES (13, 994);
INSERT INTO `department_user` (`department_id`, `user_id`) VALUES (13, 995);
INSERT INTO `department_user` (`department_id`, `user_id`) VALUES (13, 996);
INSERT INTO `department_user` (`department_id`, `user_id`) VALUES (13, 997);
INSERT INTO `department_user` (`department_id`, `user_id`) VALUES (13, 998);
INSERT INTO `department_user` (`department_id`, `user_id`) VALUES (13, 999);
INSERT INTO `department_user` (`department_id`, `user_id`) VALUES (13, 1000);
INSERT INTO `department_user` (`department_id`, `user_id`) VALUES (13, 1001);
INSERT INTO `department_user` (`department_id`, `user_id`) VALUES (13, 1002);
INSERT INTO `department_user` (`department_id`, `user_id`) VALUES (13, 1003);
INSERT INTO `department_user` (`department_id`, `user_id`) VALUES (13, 1004);
INSERT INTO `department_user` (`department_id`, `user_id`) VALUES (13, 1005);
INSERT INTO `department_user` (`department_id`, `user_id`) VALUES (13, 1006);
INSERT INTO `department_user` (`department_id`, `user_id`) VALUES (13, 1007);
INSERT INTO `department_user` (`department_id`, `user_id`) VALUES (13, 1008);
INSERT INTO `department_user` (`department_id`, `user_id`) VALUES (13, 1009);
INSERT INTO `department_user` (`department_id`, `user_id`) VALUES (13, 1010);
INSERT INTO `department_user` (`department_id`, `user_id`) VALUES (13, 1011);
INSERT INTO `department_user` (`department_id`, `user_id`) VALUES (13, 1012);
INSERT INTO `department_user` (`department_id`, `user_id`) VALUES (13, 1013);
INSERT INTO `department_user` (`department_id`, `user_id`) VALUES (13, 1014);
INSERT INTO `department_user` (`department_id`, `user_id`) VALUES (13, 1015);
INSERT INTO `department_user` (`department_id`, `user_id`) VALUES (13, 1016);
INSERT INTO `department_user` (`department_id`, `user_id`) VALUES (13, 1017);
INSERT INTO `department_user` (`department_id`, `user_id`) VALUES (14, 2654);
INSERT INTO `department_user` (`department_id`, `user_id`) VALUES (14, 2655);
INSERT INTO `department_user` (`department_id`, `user_id`) VALUES (14, 2656);
INSERT INTO `department_user` (`department_id`, `user_id`) VALUES (14, 2658);
INSERT INTO `department_user` (`department_id`, `user_id`) VALUES (14, 2659);
INSERT INTO `department_user` (`department_id`, `user_id`) VALUES (16, 2697);
INSERT INTO `department_user` (`department_id`, `user_id`) VALUES (16, 2698);
INSERT INTO `department_user` (`department_id`, `user_id`) VALUES (16, 2699);
INSERT INTO `department_user` (`department_id`, `user_id`) VALUES (16, 2700);
INSERT INTO `department_user` (`department_id`, `user_id`) VALUES (16, 2701);
INSERT INTO `department_user` (`department_id`, `user_id`) VALUES (16, 2702);
INSERT INTO `department_user` (`department_id`, `user_id`) VALUES (16, 2703);
INSERT INTO `department_user` (`department_id`, `user_id`) VALUES (16, 2704);
INSERT INTO `department_user` (`department_id`, `user_id`) VALUES (16, 2705);
INSERT INTO `department_user` (`department_id`, `user_id`) VALUES (16, 2706);
INSERT INTO `department_user` (`department_id`, `user_id`) VALUES (16, 2707);
INSERT INTO `department_user` (`department_id`, `user_id`) VALUES (16, 2708);
INSERT INTO `department_user` (`department_id`, `user_id`) VALUES (16, 2709);
INSERT INTO `department_user` (`department_id`, `user_id`) VALUES (16, 2710);
INSERT INTO `department_user` (`department_id`, `user_id`) VALUES (16, 2711);
INSERT INTO `department_user` (`department_id`, `user_id`) VALUES (16, 2712);
INSERT INTO `department_user` (`department_id`, `user_id`) VALUES (16, 2713);
INSERT INTO `department_user` (`department_id`, `user_id`) VALUES (16, 2714);
INSERT INTO `department_user` (`department_id`, `user_id`) VALUES (16, 2715);
INSERT INTO `department_user` (`department_id`, `user_id`) VALUES (16, 2716);
INSERT INTO `department_user` (`department_id`, `user_id`) VALUES (16, 2717);
INSERT INTO `department_user` (`department_id`, `user_id`) VALUES (16, 2718);
INSERT INTO `department_user` (`department_id`, `user_id`) VALUES (16, 2719);
INSERT INTO `department_user` (`department_id`, `user_id`) VALUES (16, 2720);
INSERT INTO `department_user` (`department_id`, `user_id`) VALUES (16, 2721);
INSERT INTO `department_user` (`department_id`, `user_id`) VALUES (16, 2722);
INSERT INTO `department_user` (`department_id`, `user_id`) VALUES (16, 2723);
INSERT INTO `department_user` (`department_id`, `user_id`) VALUES (16, 2724);
INSERT INTO `department_user` (`department_id`, `user_id`) VALUES (16, 2725);
INSERT INTO `department_user` (`department_id`, `user_id`) VALUES (16, 2726);
INSERT INTO `department_user` (`department_id`, `user_id`) VALUES (16, 2727);
INSERT INTO `department_user` (`department_id`, `user_id`) VALUES (16, 2728);
INSERT INTO `department_user` (`department_id`, `user_id`) VALUES (16, 2729);
INSERT INTO `department_user` (`department_id`, `user_id`) VALUES (16, 2730);
INSERT INTO `department_user` (`department_id`, `user_id`) VALUES (16, 2731);
INSERT INTO `department_user` (`department_id`, `user_id`) VALUES (16, 2732);
INSERT INTO `department_user` (`department_id`, `user_id`) VALUES (16, 2733);
INSERT INTO `department_user` (`department_id`, `user_id`) VALUES (16, 2734);
INSERT INTO `department_user` (`department_id`, `user_id`) VALUES (16, 2735);
INSERT INTO `department_user` (`department_id`, `user_id`) VALUES (16, 2736);
INSERT INTO `department_user` (`department_id`, `user_id`) VALUES (16, 2737);
INSERT INTO `department_user` (`department_id`, `user_id`) VALUES (16, 2738);
INSERT INTO `department_user` (`department_id`, `user_id`) VALUES (16, 2739);
INSERT INTO `department_user` (`department_id`, `user_id`) VALUES (16, 2740);
INSERT INTO `department_user` (`department_id`, `user_id`) VALUES (16, 2741);
INSERT INTO `department_user` (`department_id`, `user_id`) VALUES (16, 2742);
INSERT INTO `department_user` (`department_id`, `user_id`) VALUES (16, 2743);
INSERT INTO `department_user` (`department_id`, `user_id`) VALUES (16, 2744);
INSERT INTO `department_user` (`department_id`, `user_id`) VALUES (16, 2745);
INSERT INTO `department_user` (`department_id`, `user_id`) VALUES (16, 2746);
INSERT INTO `department_user` (`department_id`, `user_id`) VALUES (16, 2747);
INSERT INTO `department_user` (`department_id`, `user_id`) VALUES (16, 2748);
INSERT INTO `department_user` (`department_id`, `user_id`) VALUES (17, 3026);
INSERT INTO `department_user` (`department_id`, `user_id`) VALUES (17, 3027);
INSERT INTO `department_user` (`department_id`, `user_id`) VALUES (17, 3028);
INSERT INTO `department_user` (`department_id`, `user_id`) VALUES (17, 3029);
INSERT INTO `department_user` (`department_id`, `user_id`) VALUES (17, 3030);
INSERT INTO `department_user` (`department_id`, `user_id`) VALUES (17, 3031);
INSERT INTO `department_user` (`department_id`, `user_id`) VALUES (17, 3032);
INSERT INTO `department_user` (`department_id`, `user_id`) VALUES (17, 3033);
INSERT INTO `department_user` (`department_id`, `user_id`) VALUES (17, 3034);
INSERT INTO `department_user` (`department_id`, `user_id`) VALUES (17, 3035);
INSERT INTO `department_user` (`department_id`, `user_id`) VALUES (17, 3036);
INSERT INTO `department_user` (`department_id`, `user_id`) VALUES (17, 3037);
INSERT INTO `department_user` (`department_id`, `user_id`) VALUES (17, 3038);
INSERT INTO `department_user` (`department_id`, `user_id`) VALUES (17, 3039);
INSERT INTO `department_user` (`department_id`, `user_id`) VALUES (17, 3040);
INSERT INTO `department_user` (`department_id`, `user_id`) VALUES (17, 3041);
INSERT INTO `department_user` (`department_id`, `user_id`) VALUES (17, 3042);
INSERT INTO `department_user` (`department_id`, `user_id`) VALUES (17, 3043);
INSERT INTO `department_user` (`department_id`, `user_id`) VALUES (17, 3044);
INSERT INTO `department_user` (`department_id`, `user_id`) VALUES (17, 3045);
INSERT INTO `department_user` (`department_id`, `user_id`) VALUES (17, 3046);
INSERT INTO `department_user` (`department_id`, `user_id`) VALUES (17, 3047);
INSERT INTO `department_user` (`department_id`, `user_id`) VALUES (17, 3048);
INSERT INTO `department_user` (`department_id`, `user_id`) VALUES (17, 3049);
INSERT INTO `department_user` (`department_id`, `user_id`) VALUES (17, 3050);
INSERT INTO `department_user` (`department_id`, `user_id`) VALUES (17, 3051);
INSERT INTO `department_user` (`department_id`, `user_id`) VALUES (17, 3052);
INSERT INTO `department_user` (`department_id`, `user_id`) VALUES (17, 3053);
INSERT INTO `department_user` (`department_id`, `user_id`) VALUES (17, 3054);
INSERT INTO `department_user` (`department_id`, `user_id`) VALUES (17, 3055);
INSERT INTO `department_user` (`department_id`, `user_id`) VALUES (17, 3056);
INSERT INTO `department_user` (`department_id`, `user_id`) VALUES (17, 3057);
INSERT INTO `department_user` (`department_id`, `user_id`) VALUES (17, 3058);
INSERT INTO `department_user` (`department_id`, `user_id`) VALUES (17, 3059);
INSERT INTO `department_user` (`department_id`, `user_id`) VALUES (17, 3060);
INSERT INTO `department_user` (`department_id`, `user_id`) VALUES (17, 3061);
INSERT INTO `department_user` (`department_id`, `user_id`) VALUES (17, 3062);
INSERT INTO `department_user` (`department_id`, `user_id`) VALUES (17, 3063);
INSERT INTO `department_user` (`department_id`, `user_id`) VALUES (17, 3064);
INSERT INTO `department_user` (`department_id`, `user_id`) VALUES (17, 3065);
INSERT INTO `department_user` (`department_id`, `user_id`) VALUES (17, 3066);
INSERT INTO `department_user` (`department_id`, `user_id`) VALUES (17, 3067);
INSERT INTO `department_user` (`department_id`, `user_id`) VALUES (17, 3068);
INSERT INTO `department_user` (`department_id`, `user_id`) VALUES (17, 3069);
INSERT INTO `department_user` (`department_id`, `user_id`) VALUES (17, 3070);
INSERT INTO `department_user` (`department_id`, `user_id`) VALUES (17, 3071);
INSERT INTO `department_user` (`department_id`, `user_id`) VALUES (17, 3072);
INSERT INTO `department_user` (`department_id`, `user_id`) VALUES (17, 3073);
INSERT INTO `department_user` (`department_id`, `user_id`) VALUES (17, 3074);
INSERT INTO `department_user` (`department_id`, `user_id`) VALUES (17, 3075);
-- 部门课程关系
INSERT INTO `department_lesson` (`lesson_id`, `department_id`) VALUES (47, 11);
INSERT INTO `department_lesson` (`lesson_id`, `department_id`) VALUES (48, 11);
INSERT INTO `department_lesson` (`lesson_id`, `department_id`) VALUES (47, 12);
INSERT INTO `department_lesson` (`lesson_id`, `department_id`) VALUES (48, 12);
INSERT INTO `department_lesson` (`lesson_id`, `department_id`) VALUES (47, 13);
INSERT INTO `department_lesson` (`lesson_id`, `department_id`) VALUES (48, 13);
INSERT INTO `department_lesson` (`lesson_id`, `department_id`) VALUES (107, 14);
INSERT INTO `department_lesson` (`lesson_id`, `department_id`) VALUES (109, 14);
INSERT INTO `department_lesson` (`lesson_id`, `department_id`) VALUES (110, 14);
INSERT INTO `department_lesson` (`lesson_id`, `department_id`) VALUES (111, 14);
INSERT INTO `department_lesson` (`lesson_id`, `department_id`) VALUES (117, 14);
INSERT INTO `department_lesson` (`lesson_id`, `department_id`) VALUES (115, 16);
INSERT INTO `department_lesson` (`lesson_id`, `department_id`) VALUES (116, 16);
INSERT INTO `department_lesson` (`lesson_id`, `department_id`) VALUES (118, 16);
INSERT INTO `department_lesson` (`lesson_id`, `department_id`) VALUES (123, 16);
INSERT INTO `department_lesson` (`lesson_id`, `department_id`) VALUES (126, 16);
INSERT INTO `department_lesson` (`lesson_id`, `department_id`) VALUES (127, 16);
INSERT INTO `department_lesson` (`lesson_id`, `department_id`) VALUES (119, 17);
INSERT INTO `department_lesson` (`lesson_id`, `department_id`) VALUES (122, 17);
INSERT INTO `department_lesson` (`lesson_id`, `department_id`) VALUES (128, 17);
INSERT INTO `department_lesson` (`lesson_id`, `department_id`) VALUES (129, 17);
INSERT INTO `department_lesson` (`lesson_id`, `department_id`) VALUES (130, 17);
INSERT INTO `department_lesson` (`lesson_id`, `department_id`) VALUES (131, 17);
INSERT INTO `department_lesson` (`lesson_id`, `department_id`) VALUES (132, 17);
INSERT INTO `department_lesson` (`lesson_id`, `department_id`) VALUES (133, 17);
INSERT INTO `department_lesson` (`lesson_id`, `department_id`) VALUES (134, 17);
INSERT INTO `department_lesson` (`lesson_id`, `department_id`) VALUES (135, 17);
INSERT INTO `department_lesson` (`lesson_id`, `department_id`) VALUES (136, 17);
INSERT INTO `department_lesson` (`lesson_id`, `department_id`) VALUES (137, 17);
INSERT INTO `department_lesson` (`lesson_id`, `department_id`) VALUES (138, 17);
INSERT INTO `department_lesson` (`lesson_id`, `department_id`) VALUES (139, 17);
INSERT INTO `department_lesson` (`lesson_id`, `department_id`) VALUES (140, 17);
INSERT INTO `department_lesson` (`lesson_id`, `department_id`) VALUES (141, 17);
INSERT INTO `department_lesson` (`lesson_id`, `department_id`) VALUES (143, 17);
INSERT INTO `department_lesson` (`lesson_id`, `department_id`) VALUES (144, 17);
INSERT INTO `department_lesson` (`lesson_id`, `department_id`) VALUES (145, 17);
-- 部门考试关系
INSERT INTO `department_exam` (`exam_id`, `department_id`) VALUES (172, 16);
INSERT INTO `department_exam` (`exam_id`, `department_id`) VALUES (173, 16);
INSERT INTO `department_exam` (`exam_id`, `department_id`) VALUES (174, 16);
INSERT INTO `department_exam` (`exam_id`, `department_id`) VALUES (177, 16);
INSERT INTO `department_exam` (`exam_id`, `department_id`) VALUES (178, 16);
INSERT INTO `department_exam` (`exam_id`, `department_id`) VALUES (179, 17);
INSERT INTO `department_exam` (`exam_id`, `department_id`) VALUES (180, 17);
INSERT INTO `department_exam` (`exam_id`, `department_id`) VALUES (181, 17);
INSERT INTO `department_exam` (`exam_id`, `department_id`) VALUES (182, 17);
INSERT INTO `department_exam` (`exam_id`, `department_id`) VALUES (183, 17);
INSERT INTO `department_exam` (`exam_id`, `department_id`) VALUES (186, 17);
INSERT INTO `department_exam` (`exam_id`, `department_id`) VALUES (187, 17);

View File

@ -1,4 +0,0 @@
ALTER TABLE `draft_map_route_flank_protection`
DROP COLUMN `station_code`,
DROP COLUMN `number`;

View File

@ -1,3 +0,0 @@
alter table sale_order
add transaction_id varchar(32) null comment '支付平台订单号';

View File

@ -1,9 +0,0 @@
alter table learn_comment
add user_name varchar(32) null comment '给成都工业临时加的';
alter table learn_message
add user_name varchar(32) null comment '给成都工业临时加的';
alter table learn_message modify creator_id bigint null comment '留言者';
alter table learn_comment modify creator_id bigint null comment '创建者';

View File

@ -1,43 +0,0 @@
-- auto-generated definition
create table cgy_record
(
id int not null
primary key,
browse_count int null comment '浏览次数',
download_count int null comment '百度网盘链接打开次数'
)
comment '成都工业项目使用记录';
-- 课程表删city_code
alter table ls_lesson drop column city_code;
-- 组织表添加字段
alter table org
add creator_id bigint not null comment '创建者';
alter table org
add create_time datetime default current_timestamp not null comment '创建时间';
alter table org
add update_id bigint null comment '更新者';
alter table org
add update_time datetime null comment '更新时间';
-- 添加组织评价规则表
CREATE TABLE `org_scoring_rule` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`org_id` int(11) NOT NULL COMMENT '组织班级id',
`school_year` varchar(16) NOT NULL COMMENT '学年',
`term` int(1) NOT NULL COMMENT '学期',
`usual_scoring_rule` text COMMENT '平时分评分规则',
`final_scoring_rule` text COMMENT '期末分评分规则',
`creator_id` bigint(20) NOT NULL COMMENT '创建人id',
`create_time` datetime NOT NULL COMMENT '创建时间',
`update_id` bigint(20) DEFAULT NULL COMMENT '更新者id',
`update_time` datetime DEFAULT NULL COMMENT '更新时间',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8 COMMENT='组织评分规则';

View File

@ -1,12 +0,0 @@
DROP TABLE IF EXISTS `project_server`;
CREATE TABLE `project_server` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`project` varchar(32) NOT NULL COMMENT '项目编码',
`domain_name` varchar(255) NOT NULL COMMENT '域名',
`create_user_id` bigint(20) NOT NULL,
`create_time` datetime NOT NULL ON UPDATE CURRENT_TIMESTAMP,
`update_user_id` bigint(20) DEFAULT NULL,
`update_time` datetime DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`id`),
UNIQUE KEY `project_server_project_1` (`project`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8 COMMENT='项目服务器域名表';

View File

@ -1,15 +0,0 @@
-- 评价规则表添加字段
alter table org_scoring_rule
add `name` varchar(64) not null comment '名称' after id;
-- 创建表
create table org_scoring_rule_rel
(
org_id int not null,
rule_id bigint not null
)
comment '班级与评价规则关联表';
-- 组织表添加字段
alter table org
add status varchar(1) not null comment '状态';

View File

@ -1,59 +0,0 @@
alter table org_lesson
add creator_id bigint not null comment '创建人id',
add create_time datetime default current_timestamp not null comment '创建时间';
-- 删除外键
alter table org drop foreign key FK_company_department_company_department1;
alter table org_lesson drop foreign key org_lesson_ibfk_1;
alter table org_lesson drop foreign key org_lesson_ibfk_2;
alter table org_user drop foreign key FK_department_user_company_department1;
alter table org_user drop foreign key FK_department_user_sys_use1r;
alter table org_exam drop foreign key org_exam_ibfk_1;
alter table org_exam drop foreign key org_exam_ibfk_2;
-- 修改id数据类型
alter table org modify id bigint auto_increment;
alter table org modify parent_id bigint null comment '父级id';
alter table org modify root_id bigint null comment '单位id';
alter table race_question_progress modify company_id bigint null;
alter table race_result modify company_id bigint null comment '公司id';
alter table race_question modify company_id bigint null comment '公司题库';
alter table race_questions_rules modify company_id bigint null;
alter table org_scoring_rule_rel modify org_id bigint not null;
alter table org_lesson modify org_id bigint not null comment '班级id';
alter table org_scoring_rule modify org_id bigint not null comment '该规则属于哪个顶级组织';
alter table org_user modify org_id bigint not null comment '部门id';
-- 添加字段
alter table org_scoring_rule_rel
add rule_org_id bigint not null comment '规则关联的顶级组织id',
add rule_school_year varchar(16) not null comment '规则所属学年',
add rule_term int(1) not null comment '规则所属学期',
add rule_creator_id bigint not null comment '创建者id';

View File

@ -1,26 +0,0 @@
alter table exam_definition modify lesson_id bigint null comment '所属课程ID',
add map_id bigint not null comment '地图id' after id;
-- 更新exam_definition的map_id字段
UPDATE exam_definition SET map_id =( SELECT map_id FROM ls_lesson WHERE exam_definition.lesson_id = ls_lesson.id);
-- 更新exam_definition的type字段
UPDATE exam_definition SET type =( SELECT prd_type FROM ls_lesson WHERE exam_definition.lesson_id = ls_lesson.id);
alter table org_exam
modify org_id bigint not null,
add creator_id bigint not null,
add create_time datetime not null;
ALTER TABLE `org_exam`
ADD COLUMN `id` bigint(20) NOT NULL AUTO_INCREMENT FIRST ,
ADD PRIMARY KEY (`id`);
-- org_lesson表添加主键
ALTER TABLE `org_lesson`
ADD COLUMN `id` bigint(20) NOT NULL AUTO_INCREMENT FIRST ,
ADD PRIMARY KEY (`id`);

View File

@ -1,2 +0,0 @@
alter table sys_user
add org_id bigint null comment '所属组织id' after account;

View File

@ -1,11 +0,0 @@
CREATE TABLE `map_group` (
`id` BIGINT(20) NOT NULL AUTO_INCREMENT,
`group_name` VARCHAR(64) NOT NULL,
`group_type` VARCHAR(32) NOT NULL,
`map_ids` VARCHAR(6400) NOT NULL DEFAULT '[]',
PRIMARY KEY (`id`)
)
COMMENT='地图分组'
ENGINE=InnoDB
AUTO_INCREMENT=3
;

View File

@ -1,18 +0,0 @@
ALTER TABLE `draft_map_route`
MODIFY COLUMN `end_signal_code` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NULL COMMENT '终端信号机 编号' AFTER `start_signal_code`;
ALTER TABLE `draft_map`
ADD COLUMN `init_pos_config` text NULL COMMENT '初始位置配置' AFTER `logic_data`,
ADD COLUMN `check_config` text NULL COMMENT '数据检查配置' AFTER `init_pos_config`,
ADD COLUMN `ci_generate_config` text NULL COMMENT '联锁数据生成配置' AFTER `check_config`,
ADD COLUMN `big_screen_config` text NULL COMMENT '大屏配置' AFTER `ci_generate_config`;
ALTER TABLE `map_data`
ADD COLUMN `init_pos_config` text NULL COMMENT '初始位置配置' AFTER `logic_data`,
ADD COLUMN `check_config` text NULL COMMENT '数据检查配置' AFTER `init_pos_config`,
ADD COLUMN `ci_generate_config` text NULL COMMENT '联锁数据生成配置' AFTER `check_config`,
ADD COLUMN `big_screen_config` text NULL COMMENT '大屏配置' AFTER `ci_generate_config`;
ALTER TABLE `draft_map_route`
MODIFY COLUMN `station_code` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NULL COMMENT '所属车站 编号' AFTER `code`,
MODIFY COLUMN `start_signal_code` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NULL COMMENT '始端信号机 编号' AFTER `station_code`;

View File

@ -1,6 +0,0 @@
ALTER TABLE `map_system`
ADD COLUMN `new_api` tinyint(1) NOT NULL DEFAULT 0 AFTER `status`;
ALTER TABLE `map_system`
DROP COLUMN `prd_id`;

View File

@ -1,27 +0,0 @@
CREATE TABLE `competition_error_set` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`user_id` bigint(20) DEFAULT NULL,
`competition_id` bigint(20) DEFAULT NULL,
`command_evaluation_rule_id` bigint(20) DEFAULT NULL,
`action_id` varchar(10) DEFAULT NULL,
`right` varchar(255) DEFAULT NULL COMMENT '正确(标准)的语句',
`wrong` varchar(255) DEFAULT NULL,
`key_words` varchar(255) DEFAULT NULL COMMENT '错误的关键词',
`trip_number` varchar(255) DEFAULT NULL COMMENT '错误的车次号',
`file_path` varchar(255) DEFAULT NULL COMMENT '语音文件路径',
`time` datetime DEFAULT NULL COMMENT '创建时间',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8;
CREATE TABLE `competition_voice_record` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`user_id` bigint(20) DEFAULT NULL,
`competition_id` bigint(20) DEFAULT NULL,
`command_evaluation_rule_id` bigint(20) DEFAULT NULL COMMENT '指令评价规则id',
`action_id` varchar(10) DEFAULT NULL,
`file_path` varchar(255) DEFAULT NULL,
`time` datetime DEFAULT NULL COMMENT '创建或更新的时间',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8;

14
sql/20210720-sheng.sql Normal file
View File

@ -0,0 +1,14 @@
SET FOREIGN_KEY_CHECKS=0;
-- ----------------------------
-- Table structure for circuitry_draft
-- ----------------------------
DROP TABLE IF EXISTS `circuitry_draft`;
CREATE TABLE `circuitry_draft` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`name` varchar(32) NOT NULL COMMENT '名称',
`draw_data` mediumtext COMMENT '绘图数据',
`create_user_id` bigint(20) NOT NULL,
`create_time` datetime NOT NULL ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8;

View File

@ -0,0 +1,86 @@
package club.joylink.rtss.controller.circuitry;
import club.joylink.rtss.services.circuitry.CircuitryDraftService;
import club.joylink.rtss.vo.AccountVO;
import club.joylink.rtss.vo.circuitry.CircuitryQueryVO;
import club.joylink.rtss.vo.circuitry.CircuitryVO;
import club.joylink.rtss.vo.client.PageVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
* 电路草稿
*/
@RestController
@RequestMapping("/api/circuitryDraft")
public class CircuitryDraftController {
@Autowired
private CircuitryDraftService circuitryDraftService;
/**
* 查询用户所有电路数据
* @param queryVO
* @param user
* @return
*/
@GetMapping("/list/users")
public List<CircuitryVO> queryOfUser(CircuitryQueryVO queryVO, @RequestAttribute AccountVO user) {
return this.circuitryDraftService.queryListOfUser(queryVO, user);
}
/**
* 分页查询用户电路数据
* @param queryVO
* @param user
* @return
*/
@GetMapping("/page/users")
public PageVO<CircuitryVO> pagingQueryOfUser(CircuitryQueryVO queryVO, @RequestAttribute AccountVO user) {
return this.circuitryDraftService.pagingQueryOfUser(queryVO, user);
}
/**
* 根据id获取数据
* @param id
* @return
*/
@GetMapping("/{id}")
public CircuitryVO getById(@PathVariable Long id) {
return this.circuitryDraftService.getVOById(id);
}
/**
* 创建草稿
* @param circuitryVO
* @param user
* @return
*/
@PostMapping("")
public String create(@RequestBody CircuitryVO circuitryVO,
@RequestAttribute AccountVO user) {
return this.circuitryDraftService.create(circuitryVO, user);
}
/**
* 更新草稿数据
* @param id
* @param circuitryVO
*/
@PutMapping("/{id}/data")
public void updateDrawData(@PathVariable Long id, @RequestBody CircuitryVO circuitryVO) {
this.circuitryDraftService.updateDrawData(id, circuitryVO);
}
/**
* 删除草稿
* @param id
*/
@DeleteMapping("/{id}")
public void delete(@PathVariable Long id) {
this.circuitryDraftService.delete(id);
}
}

View File

@ -47,4 +47,9 @@ public class DraftMapRouteController {
public void deleteStandHoldList(@PathVariable Long id) { public void deleteStandHoldList(@PathVariable Long id) {
this.draftMapRouteService.deleteStandHoldList(id); this.draftMapRouteService.deleteStandHoldList(id);
} }
@PutMapping("/handle/setOverlapInCtc/false")
public void setSetOverlapInCtcFalse(@PathVariable Long id) {
this.draftMapRouteService.setSetOverlapInCtcFalse(id);
}
} }

View File

@ -0,0 +1,40 @@
package club.joylink.rtss.dao;
import club.joylink.rtss.entity.CircuitryDraft;
import club.joylink.rtss.entity.CircuitryDraftExample;
import java.util.List;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
@Mapper
@Repository
public interface CircuitryDraftDAO {
long countByExample(CircuitryDraftExample example);
int deleteByExample(CircuitryDraftExample example);
int deleteByPrimaryKey(Long id);
int insert(CircuitryDraft record);
int insertSelective(CircuitryDraft record);
List<CircuitryDraft> selectByExampleWithBLOBs(CircuitryDraftExample example);
List<CircuitryDraft> selectByExample(CircuitryDraftExample example);
CircuitryDraft selectByPrimaryKey(Long id);
int updateByExampleSelective(@Param("record") CircuitryDraft record, @Param("example") CircuitryDraftExample example);
int updateByExampleWithBLOBs(@Param("record") CircuitryDraft record, @Param("example") CircuitryDraftExample example);
int updateByExample(@Param("record") CircuitryDraft record, @Param("example") CircuitryDraftExample example);
int updateByPrimaryKeySelective(CircuitryDraft record);
int updateByPrimaryKeyWithBLOBs(CircuitryDraft record);
int updateByPrimaryKey(CircuitryDraft record);
}

View File

@ -0,0 +1,30 @@
package club.joylink.rtss.entity;
import java.io.Serializable;
import java.time.LocalDateTime;
import lombok.Data;
/**
* @author
*
*/
@Data
public class CircuitryDraft implements Serializable {
private Long id;
/**
* 名称
*/
private String name;
private Long createUserId;
private LocalDateTime createTime;
/**
* 绘图数据
*/
private String drawData;
private static final long serialVersionUID = 1L;
}

View File

@ -0,0 +1,473 @@
package club.joylink.rtss.entity;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.List;
public class CircuitryDraftExample {
protected String orderByClause;
protected boolean distinct;
protected List<Criteria> oredCriteria;
private Integer limit;
private Long offset;
public CircuitryDraftExample() {
oredCriteria = new ArrayList<Criteria>();
}
public void setOrderByClause(String orderByClause) {
this.orderByClause = orderByClause;
}
public String getOrderByClause() {
return orderByClause;
}
public void setDistinct(boolean distinct) {
this.distinct = distinct;
}
public boolean isDistinct() {
return distinct;
}
public List<Criteria> getOredCriteria() {
return oredCriteria;
}
public void or(Criteria criteria) {
oredCriteria.add(criteria);
}
public Criteria or() {
Criteria criteria = createCriteriaInternal();
oredCriteria.add(criteria);
return criteria;
}
public Criteria createCriteria() {
Criteria criteria = createCriteriaInternal();
if (oredCriteria.size() == 0) {
oredCriteria.add(criteria);
}
return criteria;
}
protected Criteria createCriteriaInternal() {
Criteria criteria = new Criteria();
return criteria;
}
public void clear() {
oredCriteria.clear();
orderByClause = null;
distinct = false;
}
public void setLimit(Integer limit) {
this.limit = limit;
}
public Integer getLimit() {
return limit;
}
public void setOffset(Long offset) {
this.offset = offset;
}
public Long getOffset() {
return offset;
}
protected abstract static class GeneratedCriteria {
protected List<Criterion> criteria;
protected GeneratedCriteria() {
super();
criteria = new ArrayList<Criterion>();
}
public boolean isValid() {
return criteria.size() > 0;
}
public List<Criterion> getAllCriteria() {
return criteria;
}
public List<Criterion> 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<Long> values) {
addCriterion("id in", values, "id");
return (Criteria) this;
}
public Criteria andIdNotIn(List<Long> 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 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<String> values) {
addCriterion("`name` in", values, "name");
return (Criteria) this;
}
public Criteria andNameNotIn(List<String> 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 andCreateUserIdIsNull() {
addCriterion("create_user_id is null");
return (Criteria) this;
}
public Criteria andCreateUserIdIsNotNull() {
addCriterion("create_user_id is not null");
return (Criteria) this;
}
public Criteria andCreateUserIdEqualTo(Long value) {
addCriterion("create_user_id =", value, "createUserId");
return (Criteria) this;
}
public Criteria andCreateUserIdNotEqualTo(Long value) {
addCriterion("create_user_id <>", value, "createUserId");
return (Criteria) this;
}
public Criteria andCreateUserIdGreaterThan(Long value) {
addCriterion("create_user_id >", value, "createUserId");
return (Criteria) this;
}
public Criteria andCreateUserIdGreaterThanOrEqualTo(Long value) {
addCriterion("create_user_id >=", value, "createUserId");
return (Criteria) this;
}
public Criteria andCreateUserIdLessThan(Long value) {
addCriterion("create_user_id <", value, "createUserId");
return (Criteria) this;
}
public Criteria andCreateUserIdLessThanOrEqualTo(Long value) {
addCriterion("create_user_id <=", value, "createUserId");
return (Criteria) this;
}
public Criteria andCreateUserIdIn(List<Long> values) {
addCriterion("create_user_id in", values, "createUserId");
return (Criteria) this;
}
public Criteria andCreateUserIdNotIn(List<Long> values) {
addCriterion("create_user_id not in", values, "createUserId");
return (Criteria) this;
}
public Criteria andCreateUserIdBetween(Long value1, Long value2) {
addCriterion("create_user_id between", value1, value2, "createUserId");
return (Criteria) this;
}
public Criteria andCreateUserIdNotBetween(Long value1, Long value2) {
addCriterion("create_user_id not between", value1, value2, "createUserId");
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(LocalDateTime value) {
addCriterion("create_time =", value, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeNotEqualTo(LocalDateTime value) {
addCriterion("create_time <>", value, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeGreaterThan(LocalDateTime value) {
addCriterion("create_time >", value, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeGreaterThanOrEqualTo(LocalDateTime value) {
addCriterion("create_time >=", value, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeLessThan(LocalDateTime value) {
addCriterion("create_time <", value, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeLessThanOrEqualTo(LocalDateTime value) {
addCriterion("create_time <=", value, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeIn(List<LocalDateTime> values) {
addCriterion("create_time in", values, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeNotIn(List<LocalDateTime> values) {
addCriterion("create_time not in", values, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeBetween(LocalDateTime value1, LocalDateTime value2) {
addCriterion("create_time between", value1, value2, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeNotBetween(LocalDateTime value1, LocalDateTime value2) {
addCriterion("create_time not between", value1, value2, "createTime");
return (Criteria) this;
}
}
/**
*/
public static class Criteria extends GeneratedCriteria {
protected Criteria() {
super();
}
}
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);
}
}
}

View File

@ -0,0 +1,22 @@
package club.joylink.rtss.services.circuitry;
import club.joylink.rtss.vo.AccountVO;
import club.joylink.rtss.vo.circuitry.CircuitryQueryVO;
import club.joylink.rtss.vo.circuitry.CircuitryVO;
import club.joylink.rtss.vo.client.PageVO;
import java.util.List;
public interface CircuitryDraftService {
String create(CircuitryVO circuitryVO, AccountVO user);
void updateDrawData(Long id, CircuitryVO circuitryVO);
void delete(Long id);
List<CircuitryVO> queryListOfUser(CircuitryQueryVO queryVO, AccountVO user);
PageVO<CircuitryVO> pagingQueryOfUser(CircuitryQueryVO queryVO, AccountVO user);
CircuitryVO getVOById(Long id);
}

View File

@ -0,0 +1,86 @@
package club.joylink.rtss.services.circuitry;
import club.joylink.rtss.dao.CircuitryDraftDAO;
import club.joylink.rtss.entity.CircuitryDraft;
import club.joylink.rtss.entity.CircuitryDraftExample;
import club.joylink.rtss.exception.BusinessExceptionAssertEnum;
import club.joylink.rtss.vo.AccountVO;
import club.joylink.rtss.vo.circuitry.CircuitryQueryVO;
import club.joylink.rtss.vo.circuitry.CircuitryVO;
import club.joylink.rtss.vo.client.PageVO;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.time.LocalDateTime;
import java.util.List;
@Service
public class CircuitryDraftServiceImpl implements CircuitryDraftService {
@Autowired
private CircuitryDraftDAO circuitryDraftDAO;
@Override
public String create(CircuitryVO circuitryVO, AccountVO user) {
BusinessExceptionAssertEnum.NAME_REPEAT.assertNotTrue(this.isNameExistOfUser(circuitryVO.getName(), user.getId()));
CircuitryDraft db = circuitryVO.toDraft();
db.setCreateUserId(user.getId());
db.setCreateTime(LocalDateTime.now());
this.circuitryDraftDAO.insert(db);
return db.getId().toString();
}
@Override
public void updateDrawData(Long id, CircuitryVO circuitryVO) {
CircuitryDraft update = this.circuitryDraftDAO.selectByPrimaryKey(id);
if (update != null) {
update.setDrawData(circuitryVO.getDrawData());
this.circuitryDraftDAO.updateByPrimaryKeySelective(update);
}
}
@Override
public void delete(Long id) {
BusinessExceptionAssertEnum.ARGUMENT_ILLEGAL.assertNotNull(id);
this.circuitryDraftDAO.deleteByPrimaryKey(id);
}
@Override
public List<CircuitryVO> queryListOfUser(CircuitryQueryVO queryVO, AccountVO user) {
CircuitryDraftExample example = new CircuitryDraftExample();
example.createCriteria()
.andCreateUserIdEqualTo(user.getId());
List<CircuitryDraft> list = this.circuitryDraftDAO.selectByExample(example);
return CircuitryVO.convertDraft2VOList(list);
}
@Override
public PageVO<CircuitryVO> pagingQueryOfUser(CircuitryQueryVO queryVO, AccountVO user) {
CircuitryDraftExample example = new CircuitryDraftExample();
example.createCriteria()
.andCreateUserIdEqualTo(user.getId());
PageHelper.startPage(queryVO.getPageNum(), queryVO.getPageSize());
Page<CircuitryDraft> page = (Page<CircuitryDraft>) this.circuitryDraftDAO.selectByExample(example);
return PageVO.convert(page, CircuitryVO.convertDraft2VOList(page.getResult()));
}
@Override
public CircuitryVO getVOById(Long id) {
CircuitryDraft db = this.circuitryDraftDAO.selectByPrimaryKey(id);
BusinessExceptionAssertEnum.DATA_NOT_EXIST.assertNotNull(db,
String.format("不存在id为[%s]的电路草稿", id));
return new CircuitryVO(db);
}
private boolean isNameExistOfUser(String name, Long userId) {
BusinessExceptionAssertEnum.ARGUMENT_ILLEGAL.assertHasText(name);
BusinessExceptionAssertEnum.ARGUMENT_ILLEGAL.assertNotNull(userId);
CircuitryDraftExample example = new CircuitryDraftExample();
example.createCriteria()
.andNameEqualTo(name)
.andCreateUserIdEqualTo(userId);
return this.circuitryDraftDAO.countByExample(example) > 0;
}
}

View File

@ -1180,6 +1180,7 @@ public class DraftMapCiDataGeneratorImpl implements DraftMapCiDataGenerator {
tbRoute.setDestination(route.getDestination()); tbRoute.setDestination(route.getDestination());
tbRoute.setSectionList(route.getSectionList()); tbRoute.setSectionList(route.getSectionList());
tbRoute.setSwitchList(route.getSwitchList()); tbRoute.setSwitchList(route.getSwitchList());
tbRoute.setSetOverlapInCtc(route.isSetOverlapInCtc());
tbRoute.setOverlap(route.getOverlap()); tbRoute.setOverlap(route.getOverlap());
tbRoute.setOpenGreen(route.isOpenGreen()); tbRoute.setOpenGreen(route.isOpenGreen());
// 根据信号机和区段是否同向设置进路联锁自排和是否车队模式 // 根据信号机和区段是否同向设置进路联锁自排和是否车队模式

View File

@ -18,4 +18,6 @@ public interface DraftMapRouteService {
void deleteRoute(Long id, String code); void deleteRoute(Long id, String code);
void deleteStandHoldList(Long mapId); void deleteStandHoldList(Long mapId);
void setSetOverlapInCtcFalse(Long mapId);
} }

View File

@ -119,7 +119,9 @@ public class DraftMapRouteServiceImpl implements DraftMapRouteService {
update.setArc(routeNewVO.isArc()); update.setArc(routeNewVO.isArc());
update.setArs(routeNewVO.isArs()); update.setArs(routeNewVO.isArs());
update.setName(routeNewVO.getName()); update.setName(routeNewVO.getName());
update.setSetOverlapInCtc(routeNewVO.isSetOverlapInCtc());
update.setOverlapCode(routeNewVO.getOverlapCode()); update.setOverlapCode(routeNewVO.getOverlapCode());
update.setHoldStandList(routeNewVO.getHoldStandList());
DraftMapRoute db = update.convert2Draft(); DraftMapRoute db = update.convert2Draft();
this.draftMapRouteDAO.updateByPrimaryKeyWithBLOBs(db); this.draftMapRouteDAO.updateByPrimaryKeyWithBLOBs(db);
} }
@ -161,4 +163,13 @@ public class DraftMapRouteServiceImpl implements DraftMapRouteService {
update(mapId, route.getCode(), route); update(mapId, route.getCode(), route);
}); });
} }
@Override
public void setSetOverlapInCtcFalse(Long mapId) {
List<MapRouteNewVO> mapRouteNewVOS = queryAllRoutes(mapId);
mapRouteNewVOS.forEach(route -> {
route.setSetOverlapInCtc(false);
update(mapId, route.getCode(), route);
});
}
} }

View File

@ -46,7 +46,7 @@ public class Model2dServiceImpl implements Model2dService {
criteria.andNameLike(String.format("%%%s%%", queryVO.getName())); criteria.andNameLike(String.format("%%%s%%", queryVO.getName()));
} }
PageHelper.startPage(queryVO.getPageNum(), queryVO.getPageSize()); PageHelper.startPage(queryVO.getPageNum(), queryVO.getPageSize());
Page<Model2d> page = (Page<Model2d>) this.model2dDAO.selectByExample(example); Page<Model2d> page = (Page<Model2d>) this.model2dDAO.selectByExampleWithBLOBs(example);
return PageVO.convert(page, Model2dVO.convert2VOList(page.getResult())); return PageVO.convert(page, Model2dVO.convert2VOList(page.getResult()));
} }

View File

@ -58,6 +58,17 @@ public class RouteService {
if (!route.isCbtcMode() || route.isGround() || route.isAtp()) { if (!route.isCbtcMode() || route.isGround() || route.isAtp()) {
failMessage = this.ciLevelCheck(route); failMessage = this.ciLevelCheck(route);
} }
// 进路区段是否故障占用
for (Section section : route.getSectionList()) {
for (int i = 0; i < 3; i++) {
if (section.getParent() == null || section.isAxleCounter())
break;
section = section.getParent();
}
if (Section.AxleFault.FAULT.equals(section.getFault())) {
return new Route.CheckFailMessage(Route.CheckFailReason.SectionFaultOccupied, section);
}
}
return failMessage; return failMessage;
} }
@ -328,8 +339,7 @@ public class RouteService {
RouteOverlap overlap = route.getOverlap(); RouteOverlap overlap = route.getOverlap();
if (Objects.isNull(overlap)) return false; if (Objects.isNull(overlap)) return false;
if (Objects.nonNull(overlap)) { if (Objects.nonNull(overlap)) {
if (route.isCbtcMode() && config.isCtcOverlapOnlyTurnBackStationLock() && if (route.isCbtcMode() && !route.isSetOverlapInCtc()) {
!overlap.isTurnBackStationHasSwitch()) {
// CTC模式不办理判断 // CTC模式不办理判断
return false; return false;
} }

View File

@ -83,7 +83,7 @@ public class StandService {
Signal signal = stand.getSection().getSignalOf(stand.isRight()); Signal signal = stand.getSection().getSignalOf(stand.isRight());
if (Objects.nonNull(signal)) { if (Objects.nonNull(signal)) {
MapConfig config = simulation.getRepository().getConfig(); MapConfig config = simulation.getRepository().getConfig();
if (config.isStandHoldCloseLogicLight() || !signal.isLogicLight()) { if (config.isStandHoldCloseLogicLight()/* || !signal.isLogicLight()*/) {
this.signalService.close(simulation, signal); this.signalService.close(simulation, signal);
} }
} }

View File

@ -238,6 +238,8 @@ public class InterlockBuilder2 {
} }
} }
} }
// CTC模式下延续保护是否需要办理
route.setSetOverlapInCtc(mapRouteVO.isSetOverlapInCtc());
// 进路延续保护 // 进路延续保护
if (StringUtils.hasText(mapRouteVO.getOverlapCode())) { if (StringUtils.hasText(mapRouteVO.getOverlapCode())) {
RouteOverlap routeOverlap = (RouteOverlap) elementMap.get(mapRouteVO.getOverlapCode()); RouteOverlap routeOverlap = (RouteOverlap) elementMap.get(mapRouteVO.getOverlapCode());

View File

@ -1160,8 +1160,7 @@ public class SimulationDataRepository {
if (Objects.isNull(overlap)) { if (Objects.isNull(overlap)) {
return false; return false;
} }
if (route.isCbtcMode() && config.isCtcOverlapOnlyTurnBackStationLock() && if (route.isCbtcMode() && !route.isSetOverlapInCtc()) {
!overlap.isTurnBackStationHasSwitch()) {
// CTC模式不办理判断 // CTC模式不办理判断
return false; return false;
} }

View File

@ -79,6 +79,9 @@ public class Route extends MapNamedElement {
/** 站台扣车 */ /** 站台扣车 */
private List<Stand> standHoldList; private List<Stand> standHoldList;
/** CTC模式下需要办理延续保护 */
private boolean setOverlapInCtc = true;
/** 进路延续保护 */ /** 进路延续保护 */
private RouteOverlap overlap; private RouteOverlap overlap;
@ -634,6 +637,8 @@ public class Route extends MapNamedElement {
SectionLockOppositeDirection, SectionLockOppositeDirection,
/** 区段不空闲 */ /** 区段不空闲 */
SectionNotFree, SectionNotFree,
/** 区段故障占用 */
SectionFaultOccupied,
/** 站台紧急停车按钮按下 */ /** 站台紧急停车按钮按下 */
ESPEffective, ESPEffective,
/** 延续保护道岔/区段占用 */ /** 延续保护道岔/区段占用 */

View File

@ -11,6 +11,9 @@ import club.joylink.rtss.simulation.cbtc.onboard.ATO.SpeedCurve;
import lombok.Getter; import lombok.Getter;
import lombok.Setter; import lombok.Setter;
import javax.script.ScriptEngine;
import javax.script.ScriptEngineManager;
import javax.script.ScriptException;
import java.util.Objects; import java.util.Objects;
/** /**
@ -113,8 +116,12 @@ public class MovementAuthority {
if (!section.isPhysical()) if (!section.isPhysical())
section = section.getParent(); section = section.getParent();
SectionPosition sectionPosition = new SectionPosition(section, offset); SectionPosition sectionPosition = new SectionPosition(section, offset);
return CalculateService.calculateNextPositionByStartAndLen(sectionPosition, !right, 2 * SimulationConstants.TRAIN_SAFE_DISTANCE); if (section.isStandTrack() && section.getStandList().get(0).isTrainParking()) {
return CalculateService.calculateNextPositionByStartAndLen(sectionPosition, !right, 10);
} else {
return CalculateService.calculateNextPositionByStartAndLen(sectionPosition,
!right, 2 * SimulationConstants.TRAIN_SAFE_DISTANCE);
}
// VirtualRealityTrain train = (VirtualRealityTrain) this.device; // VirtualRealityTrain train = (VirtualRealityTrain) this.device;
// boolean trainRight = train.isRight(); // boolean trainRight = train.isRight();

View File

@ -0,0 +1,12 @@
package club.joylink.rtss.vo.circuitry;
import club.joylink.rtss.vo.client.PageQueryVO;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
@Getter
@Setter
@NoArgsConstructor
public class CircuitryQueryVO extends PageQueryVO {
}

View File

@ -0,0 +1,61 @@
package club.joylink.rtss.vo.circuitry;
import club.joylink.rtss.entity.CircuitryDraft;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import javax.validation.constraints.NotBlank;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.List;
@Getter
@Setter
@NoArgsConstructor
public class CircuitryVO {
@JsonSerialize(using = ToStringSerializer.class)
private Long id;
/**
* 名称
*/
@NotBlank(message = "名称不能为空")
private String name;
@JsonSerialize(using = ToStringSerializer.class)
private Long createUserId;
private LocalDateTime createTime;
/**
* 绘图数据
*/
private String drawData;
public CircuitryVO(CircuitryDraft db) {
this.id = db.getId();
this.name = db.getName();
this.drawData = db.getDrawData();
this.createUserId = db.getCreateUserId();
this.createTime = db.getCreateTime();
}
public static List<CircuitryVO> convertDraft2VOList(List<CircuitryDraft> list) {
List<CircuitryVO> voList = new ArrayList<>();
for (CircuitryDraft draft : list) {
voList.add(new CircuitryVO(draft));
}
return voList;
}
public CircuitryDraft toDraft() {
CircuitryDraft db = new CircuitryDraft();
db.setId(this.id);
db.setName(this.name);
db.setDrawData(this.drawData);
return db;
}
}

View File

@ -148,6 +148,9 @@ public class MapRouteNewVO {
*/ */
private List<String> flsList; private List<String> flsList;
/** ctc级别下需要办理延续保护 */
private boolean setOverlapInCtc = true;
/** /**
* 延续保护code * 延续保护code
*/ */

View File

@ -0,0 +1,261 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="club.joylink.rtss.dao.CircuitryDraftDAO">
<resultMap id="BaseResultMap" type="club.joylink.rtss.entity.CircuitryDraft">
<id column="id" jdbcType="BIGINT" property="id" />
<result column="name" jdbcType="VARCHAR" property="name" />
<result column="create_user_id" jdbcType="BIGINT" property="createUserId" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
</resultMap>
<resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="club.joylink.rtss.entity.CircuitryDraft">
<result column="draw_data" jdbcType="LONGVARCHAR" property="drawData" />
</resultMap>
<sql id="Example_Where_Clause">
<where>
<foreach collection="oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Update_By_Example_Where_Clause">
<where>
<foreach collection="example.oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Base_Column_List">
id, `name`, create_user_id, create_time
</sql>
<sql id="Blob_Column_List">
draw_data
</sql>
<select id="selectByExampleWithBLOBs" parameterType="club.joylink.rtss.entity.CircuitryDraftExample" resultMap="ResultMapWithBLOBs">
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
,
<include refid="Blob_Column_List" />
from circuitry_draft
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null">
order by ${orderByClause}
</if>
<if test="limit != null">
<if test="offset != null">
limit ${offset}, ${limit}
</if>
<if test="offset == null">
limit ${limit}
</if>
</if>
</select>
<select id="selectByExample" parameterType="club.joylink.rtss.entity.CircuitryDraftExample" resultMap="BaseResultMap">
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
from circuitry_draft
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null">
order by ${orderByClause}
</if>
<if test="limit != null">
<if test="offset != null">
limit ${offset}, ${limit}
</if>
<if test="offset == null">
limit ${limit}
</if>
</if>
</select>
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="ResultMapWithBLOBs">
select
<include refid="Base_Column_List" />
,
<include refid="Blob_Column_List" />
from circuitry_draft
where id = #{id,jdbcType=BIGINT}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
delete from circuitry_draft
where id = #{id,jdbcType=BIGINT}
</delete>
<delete id="deleteByExample" parameterType="club.joylink.rtss.entity.CircuitryDraftExample">
delete from circuitry_draft
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" keyColumn="id" keyProperty="id" parameterType="club.joylink.rtss.entity.CircuitryDraft" useGeneratedKeys="true">
insert into circuitry_draft (`name`, create_user_id, create_time,
draw_data)
values (#{name,jdbcType=VARCHAR}, #{createUserId,jdbcType=BIGINT}, #{createTime,jdbcType=TIMESTAMP},
#{drawData,jdbcType=LONGVARCHAR})
</insert>
<insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="club.joylink.rtss.entity.CircuitryDraft" useGeneratedKeys="true">
insert into circuitry_draft
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="name != null">
`name`,
</if>
<if test="createUserId != null">
create_user_id,
</if>
<if test="createTime != null">
create_time,
</if>
<if test="drawData != null">
draw_data,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="name != null">
#{name,jdbcType=VARCHAR},
</if>
<if test="createUserId != null">
#{createUserId,jdbcType=BIGINT},
</if>
<if test="createTime != null">
#{createTime,jdbcType=TIMESTAMP},
</if>
<if test="drawData != null">
#{drawData,jdbcType=LONGVARCHAR},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="club.joylink.rtss.entity.CircuitryDraftExample" resultType="java.lang.Long">
select count(*) from circuitry_draft
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
update circuitry_draft
<set>
<if test="record.id != null">
id = #{record.id,jdbcType=BIGINT},
</if>
<if test="record.name != null">
`name` = #{record.name,jdbcType=VARCHAR},
</if>
<if test="record.createUserId != null">
create_user_id = #{record.createUserId,jdbcType=BIGINT},
</if>
<if test="record.createTime != null">
create_time = #{record.createTime,jdbcType=TIMESTAMP},
</if>
<if test="record.drawData != null">
draw_data = #{record.drawData,jdbcType=LONGVARCHAR},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExampleWithBLOBs" parameterType="map">
update circuitry_draft
set id = #{record.id,jdbcType=BIGINT},
`name` = #{record.name,jdbcType=VARCHAR},
create_user_id = #{record.createUserId,jdbcType=BIGINT},
create_time = #{record.createTime,jdbcType=TIMESTAMP},
draw_data = #{record.drawData,jdbcType=LONGVARCHAR}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map">
update circuitry_draft
set id = #{record.id,jdbcType=BIGINT},
`name` = #{record.name,jdbcType=VARCHAR},
create_user_id = #{record.createUserId,jdbcType=BIGINT},
create_time = #{record.createTime,jdbcType=TIMESTAMP}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="club.joylink.rtss.entity.CircuitryDraft">
update circuitry_draft
<set>
<if test="name != null">
`name` = #{name,jdbcType=VARCHAR},
</if>
<if test="createUserId != null">
create_user_id = #{createUserId,jdbcType=BIGINT},
</if>
<if test="createTime != null">
create_time = #{createTime,jdbcType=TIMESTAMP},
</if>
<if test="drawData != null">
draw_data = #{drawData,jdbcType=LONGVARCHAR},
</if>
</set>
where id = #{id,jdbcType=BIGINT}
</update>
<update id="updateByPrimaryKeyWithBLOBs" parameterType="club.joylink.rtss.entity.CircuitryDraft">
update circuitry_draft
set `name` = #{name,jdbcType=VARCHAR},
create_user_id = #{createUserId,jdbcType=BIGINT},
create_time = #{createTime,jdbcType=TIMESTAMP},
draw_data = #{drawData,jdbcType=LONGVARCHAR}
where id = #{id,jdbcType=BIGINT}
</update>
<update id="updateByPrimaryKey" parameterType="club.joylink.rtss.entity.CircuitryDraft">
update circuitry_draft
set `name` = #{name,jdbcType=VARCHAR},
create_user_id = #{createUserId,jdbcType=BIGINT},
create_time = #{createTime,jdbcType=TIMESTAMP}
where id = #{id,jdbcType=BIGINT}
</update>
</mapper>