From bc5b95df5fa3da5f6107cd1508039d7e31bf4ad3 Mon Sep 17 00:00:00 2001 From: joylink_zhangsai <1021828630@qq.com> Date: Tue, 20 Jul 2021 13:52:05 +0800 Subject: [PATCH 1/6] =?UTF-8?q?=E4=BF=AE=E6=94=B9=EF=BC=9A=E8=BF=9B?= =?UTF-8?q?=E8=B7=AF=E5=BB=B6=E7=BB=AD=E4=BF=9D=E6=8A=A4=E5=9C=A8CTC?= =?UTF-8?q?=E6=A8=A1=E5=BC=8F=E4=B8=8B=E6=98=AF=E5=90=A6=E9=9C=80=E8=A6=81?= =?UTF-8?q?=E5=8A=9E=E7=90=86=E4=BD=9C=E4=B8=BA=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/draft/DraftMapRouteController.java | 5 +++++ .../draftData/DraftMapCiDataGeneratorImpl.java | 1 + .../rtss/services/draftData/DraftMapRouteService.java | 2 ++ .../services/draftData/DraftMapRouteServiceImpl.java | 10 ++++++++++ .../rtss/simulation/cbtc/CI/service/RouteService.java | 3 +-- .../rtss/simulation/cbtc/build/InterlockBuilder2.java | 2 ++ .../cbtc/data/SimulationDataRepository.java | 3 +-- .../joylink/rtss/simulation/cbtc/data/map/Route.java | 3 +++ .../cbtc/data/support/MovementAuthority.java | 11 +++++++++-- .../java/club/joylink/rtss/vo/map/MapRouteNewVO.java | 3 +++ 10 files changed, 37 insertions(+), 6 deletions(-) diff --git a/src/main/java/club/joylink/rtss/controller/draft/DraftMapRouteController.java b/src/main/java/club/joylink/rtss/controller/draft/DraftMapRouteController.java index fb8bbd134..b330bd3de 100644 --- a/src/main/java/club/joylink/rtss/controller/draft/DraftMapRouteController.java +++ b/src/main/java/club/joylink/rtss/controller/draft/DraftMapRouteController.java @@ -47,4 +47,9 @@ public class DraftMapRouteController { public void deleteStandHoldList(@PathVariable Long id) { this.draftMapRouteService.deleteStandHoldList(id); } + + @PutMapping("/handle/setOverlapInCtc/false") + public void setSetOverlapInCtcFalse(@PathVariable Long id) { + this.draftMapRouteService.setSetOverlapInCtcFalse(id); + } } diff --git a/src/main/java/club/joylink/rtss/services/draftData/DraftMapCiDataGeneratorImpl.java b/src/main/java/club/joylink/rtss/services/draftData/DraftMapCiDataGeneratorImpl.java index fa074111b..daaed50eb 100644 --- a/src/main/java/club/joylink/rtss/services/draftData/DraftMapCiDataGeneratorImpl.java +++ b/src/main/java/club/joylink/rtss/services/draftData/DraftMapCiDataGeneratorImpl.java @@ -1180,6 +1180,7 @@ public class DraftMapCiDataGeneratorImpl implements DraftMapCiDataGenerator { tbRoute.setDestination(route.getDestination()); tbRoute.setSectionList(route.getSectionList()); tbRoute.setSwitchList(route.getSwitchList()); + tbRoute.setSetOverlapInCtc(route.isSetOverlapInCtc()); tbRoute.setOverlap(route.getOverlap()); tbRoute.setOpenGreen(route.isOpenGreen()); // 根据信号机和区段是否同向,设置进路联锁自排和是否车队模式 diff --git a/src/main/java/club/joylink/rtss/services/draftData/DraftMapRouteService.java b/src/main/java/club/joylink/rtss/services/draftData/DraftMapRouteService.java index abbf03dc2..4bbcee0e8 100644 --- a/src/main/java/club/joylink/rtss/services/draftData/DraftMapRouteService.java +++ b/src/main/java/club/joylink/rtss/services/draftData/DraftMapRouteService.java @@ -18,4 +18,6 @@ public interface DraftMapRouteService { void deleteRoute(Long id, String code); void deleteStandHoldList(Long mapId); + + void setSetOverlapInCtcFalse(Long mapId); } diff --git a/src/main/java/club/joylink/rtss/services/draftData/DraftMapRouteServiceImpl.java b/src/main/java/club/joylink/rtss/services/draftData/DraftMapRouteServiceImpl.java index a33148909..40313ae2c 100644 --- a/src/main/java/club/joylink/rtss/services/draftData/DraftMapRouteServiceImpl.java +++ b/src/main/java/club/joylink/rtss/services/draftData/DraftMapRouteServiceImpl.java @@ -119,6 +119,7 @@ public class DraftMapRouteServiceImpl implements DraftMapRouteService { update.setArc(routeNewVO.isArc()); update.setArs(routeNewVO.isArs()); update.setName(routeNewVO.getName()); + update.setSetOverlapInCtc(routeNewVO.isSetOverlapInCtc()); update.setOverlapCode(routeNewVO.getOverlapCode()); DraftMapRoute db = update.convert2Draft(); this.draftMapRouteDAO.updateByPrimaryKeyWithBLOBs(db); @@ -161,4 +162,13 @@ public class DraftMapRouteServiceImpl implements DraftMapRouteService { update(mapId, route.getCode(), route); }); } + + @Override + public void setSetOverlapInCtcFalse(Long mapId) { + List mapRouteNewVOS = queryAllRoutes(mapId); + mapRouteNewVOS.forEach(route -> { + route.setSetOverlapInCtc(false); + update(mapId, route.getCode(), route); + }); + } } diff --git a/src/main/java/club/joylink/rtss/simulation/cbtc/CI/service/RouteService.java b/src/main/java/club/joylink/rtss/simulation/cbtc/CI/service/RouteService.java index 1c6159768..d7b1f0c7a 100644 --- a/src/main/java/club/joylink/rtss/simulation/cbtc/CI/service/RouteService.java +++ b/src/main/java/club/joylink/rtss/simulation/cbtc/CI/service/RouteService.java @@ -328,8 +328,7 @@ public class RouteService { RouteOverlap overlap = route.getOverlap(); if (Objects.isNull(overlap)) return false; if (Objects.nonNull(overlap)) { - if (route.isCbtcMode() && config.isCtcOverlapOnlyTurnBackStationLock() && - !overlap.isTurnBackStationHasSwitch()) { + if (route.isCbtcMode() && !route.isSetOverlapInCtc()) { // CTC模式不办理判断 return false; } diff --git a/src/main/java/club/joylink/rtss/simulation/cbtc/build/InterlockBuilder2.java b/src/main/java/club/joylink/rtss/simulation/cbtc/build/InterlockBuilder2.java index 89328dcde..cc9560eee 100644 --- a/src/main/java/club/joylink/rtss/simulation/cbtc/build/InterlockBuilder2.java +++ b/src/main/java/club/joylink/rtss/simulation/cbtc/build/InterlockBuilder2.java @@ -238,6 +238,8 @@ public class InterlockBuilder2 { } } } + // CTC模式下延续保护是否需要办理 + route.setSetOverlapInCtc(mapRouteVO.isSetOverlapInCtc()); // 进路延续保护 if (StringUtils.hasText(mapRouteVO.getOverlapCode())) { RouteOverlap routeOverlap = (RouteOverlap) elementMap.get(mapRouteVO.getOverlapCode()); diff --git a/src/main/java/club/joylink/rtss/simulation/cbtc/data/SimulationDataRepository.java b/src/main/java/club/joylink/rtss/simulation/cbtc/data/SimulationDataRepository.java index 4da3f31a9..b55ac79c3 100644 --- a/src/main/java/club/joylink/rtss/simulation/cbtc/data/SimulationDataRepository.java +++ b/src/main/java/club/joylink/rtss/simulation/cbtc/data/SimulationDataRepository.java @@ -1102,8 +1102,7 @@ public class SimulationDataRepository { if (Objects.isNull(overlap)) { return false; } - if (route.isCbtcMode() && config.isCtcOverlapOnlyTurnBackStationLock() && - !overlap.isTurnBackStationHasSwitch()) { + if (route.isCbtcMode() && !route.isSetOverlapInCtc()) { // CTC模式不办理判断 return false; } diff --git a/src/main/java/club/joylink/rtss/simulation/cbtc/data/map/Route.java b/src/main/java/club/joylink/rtss/simulation/cbtc/data/map/Route.java index 9dbfc0d9f..c81281af5 100644 --- a/src/main/java/club/joylink/rtss/simulation/cbtc/data/map/Route.java +++ b/src/main/java/club/joylink/rtss/simulation/cbtc/data/map/Route.java @@ -78,6 +78,9 @@ public class Route extends MapNamedElement { /** 站台扣车 */ private List standHoldList; + /** CTC模式下需要办理延续保护 */ + private boolean setOverlapInCtc = true; + /** 进路延续保护 */ private RouteOverlap overlap; diff --git a/src/main/java/club/joylink/rtss/simulation/cbtc/data/support/MovementAuthority.java b/src/main/java/club/joylink/rtss/simulation/cbtc/data/support/MovementAuthority.java index bb59057f9..23cd5391b 100644 --- a/src/main/java/club/joylink/rtss/simulation/cbtc/data/support/MovementAuthority.java +++ b/src/main/java/club/joylink/rtss/simulation/cbtc/data/support/MovementAuthority.java @@ -12,6 +12,9 @@ import club.joylink.rtss.simulation.cbtc.onboard.ATO.SpeedCurve; import lombok.Getter; import lombok.Setter; +import javax.script.ScriptEngine; +import javax.script.ScriptEngineManager; +import javax.script.ScriptException; import java.util.Objects; /** @@ -114,8 +117,12 @@ public class MovementAuthority { if (!section.isPhysical()) section = section.getParent(); 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; // boolean trainRight = train.isRight(); diff --git a/src/main/java/club/joylink/rtss/vo/map/MapRouteNewVO.java b/src/main/java/club/joylink/rtss/vo/map/MapRouteNewVO.java index a2a1a3574..bebdc98d8 100644 --- a/src/main/java/club/joylink/rtss/vo/map/MapRouteNewVO.java +++ b/src/main/java/club/joylink/rtss/vo/map/MapRouteNewVO.java @@ -148,6 +148,9 @@ public class MapRouteNewVO { */ private List flsList; + /** ctc级别下需要办理延续保护 */ + private boolean setOverlapInCtc = true; + /** * 延续保护code */ From ec0b05323c30672d3bede67ed6f90aeb33dc9bc8 Mon Sep 17 00:00:00 2001 From: joylink_zhangsai <1021828630@qq.com> Date: Tue, 20 Jul 2021 15:14:41 +0800 Subject: [PATCH 2/6] =?UTF-8?q?=E4=BF=AE=E6=94=B9=EF=BC=9A=E8=BF=9B?= =?UTF-8?q?=E8=B7=AF=E5=8C=BA=E6=AE=B5=E6=95=85=E9=9A=9C=E5=8D=A0=E7=94=A8?= =?UTF-8?q?=E6=97=B6=E6=97=A0=E6=B3=95=E5=8A=9E=E7=90=86=20=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=EF=BC=9A=E5=88=A0=E9=99=A4=E6=89=A3=E8=BD=A6=E6=89=B9?= =?UTF-8?q?=E9=87=8F=E6=93=8D=E4=BD=9Cbug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../rtss/services/draftData/DraftMapRouteServiceImpl.java | 1 + .../rtss/simulation/cbtc/CI/service/RouteService.java | 6 ++++++ .../club/joylink/rtss/simulation/cbtc/data/map/Route.java | 2 ++ src/main/resources/application.yml | 6 +++--- 4 files changed, 12 insertions(+), 3 deletions(-) diff --git a/src/main/java/club/joylink/rtss/services/draftData/DraftMapRouteServiceImpl.java b/src/main/java/club/joylink/rtss/services/draftData/DraftMapRouteServiceImpl.java index 40313ae2c..dfd4957b3 100644 --- a/src/main/java/club/joylink/rtss/services/draftData/DraftMapRouteServiceImpl.java +++ b/src/main/java/club/joylink/rtss/services/draftData/DraftMapRouteServiceImpl.java @@ -121,6 +121,7 @@ public class DraftMapRouteServiceImpl implements DraftMapRouteService { update.setName(routeNewVO.getName()); update.setSetOverlapInCtc(routeNewVO.isSetOverlapInCtc()); update.setOverlapCode(routeNewVO.getOverlapCode()); + update.setHoldStandList(routeNewVO.getHoldStandList()); DraftMapRoute db = update.convert2Draft(); this.draftMapRouteDAO.updateByPrimaryKeyWithBLOBs(db); } diff --git a/src/main/java/club/joylink/rtss/simulation/cbtc/CI/service/RouteService.java b/src/main/java/club/joylink/rtss/simulation/cbtc/CI/service/RouteService.java index d7b1f0c7a..b5ef4417f 100644 --- a/src/main/java/club/joylink/rtss/simulation/cbtc/CI/service/RouteService.java +++ b/src/main/java/club/joylink/rtss/simulation/cbtc/CI/service/RouteService.java @@ -58,6 +58,12 @@ public class RouteService { if (!route.isCbtcMode() || route.isGround() || route.isAtp()) { failMessage = this.ciLevelCheck(route); } + // 进路区段是否故障占用 + for (Section section : route.getSectionList()) { + if (Section.AxleFault.FAULT.equals(section.getFault())) { + return new Route.CheckFailMessage(Route.CheckFailReason.SectionFaultOccupied, section); + } + } return failMessage; } diff --git a/src/main/java/club/joylink/rtss/simulation/cbtc/data/map/Route.java b/src/main/java/club/joylink/rtss/simulation/cbtc/data/map/Route.java index c81281af5..81d8b330c 100644 --- a/src/main/java/club/joylink/rtss/simulation/cbtc/data/map/Route.java +++ b/src/main/java/club/joylink/rtss/simulation/cbtc/data/map/Route.java @@ -611,6 +611,8 @@ public class Route extends MapNamedElement { SectionLockOppositeDirection, /** 区段不空闲 */ SectionNotFree, + /** 区段故障占用 */ + SectionFaultOccupied, /** 站台紧急停车按钮按下 */ ESPEffective, /** 延续保护道岔/区段占用 */ diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml index 7e3779f25..64cc37b5d 100644 --- a/src/main/resources/application.yml +++ b/src/main/resources/application.yml @@ -86,7 +86,7 @@ springfox: --- spring: - profiles: dev + profiles: test datasource: url: jdbc:mysql://localhost:3306/joylink?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=Asia/Shanghai username: root @@ -108,9 +108,9 @@ common: --- spring: - profiles: test + profiles: dev datasource: - url: jdbc:mysql://172.16.0.128:3306/joylink?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=Asia/Shanghai + url: jdbc:mysql://114.116.21.254:3306/joylink?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=Asia/Shanghai username: root password: Joylink@0503 From 6afa297947bc4ab0826013fe5e4d60bf716f64cc Mon Sep 17 00:00:00 2001 From: joylink_zhangsai <1021828630@qq.com> Date: Tue, 20 Jul 2021 15:24:31 +0800 Subject: [PATCH 3/6] =?UTF-8?q?=E4=BF=AE=E6=94=B9=EF=BC=9A=E5=9B=9E?= =?UTF-8?q?=E6=BB=9A=E9=85=8D=E7=BD=AE=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/resources/application.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml index 64cc37b5d..7e3779f25 100644 --- a/src/main/resources/application.yml +++ b/src/main/resources/application.yml @@ -86,7 +86,7 @@ springfox: --- spring: - profiles: test + profiles: dev datasource: url: jdbc:mysql://localhost:3306/joylink?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=Asia/Shanghai username: root @@ -108,9 +108,9 @@ common: --- spring: - profiles: dev + profiles: test datasource: - url: jdbc:mysql://114.116.21.254:3306/joylink?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=Asia/Shanghai + url: jdbc:mysql://172.16.0.128:3306/joylink?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=Asia/Shanghai username: root password: Joylink@0503 From bef8add983cf60942f571576d106aefab32a8f40 Mon Sep 17 00:00:00 2001 From: joylink_zhangsai <1021828630@qq.com> Date: Tue, 20 Jul 2021 16:02:27 +0800 Subject: [PATCH 4/6] =?UTF-8?q?=E4=BF=AE=E6=94=B9=EF=BC=9A=E9=81=93?= =?UTF-8?q?=E5=B2=94=E5=8C=BA=E6=AE=B5=E6=95=85=E9=9A=9C=E5=8D=A0=E7=94=A8?= =?UTF-8?q?=E6=97=B6=E8=BF=9B=E8=B7=AF=E4=BB=8D=E8=83=BD=E5=8A=9E=E7=90=86?= =?UTF-8?q?=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../rtss/simulation/cbtc/CI/service/RouteService.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/main/java/club/joylink/rtss/simulation/cbtc/CI/service/RouteService.java b/src/main/java/club/joylink/rtss/simulation/cbtc/CI/service/RouteService.java index b5ef4417f..e8ee65f76 100644 --- a/src/main/java/club/joylink/rtss/simulation/cbtc/CI/service/RouteService.java +++ b/src/main/java/club/joylink/rtss/simulation/cbtc/CI/service/RouteService.java @@ -60,6 +60,11 @@ public class RouteService { } // 进路区段是否故障占用 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); } From 46b9a062997fb39541bcf27c04eb5ed080cf8e17 Mon Sep 17 00:00:00 2001 From: walker-sheng Date: Tue, 20 Jul 2021 16:43:41 +0800 Subject: [PATCH 5/6] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E7=94=B5=E8=B7=AF?= =?UTF-8?q?=E8=8D=89=E7=A8=BF=E7=9B=B8=E5=85=B3=E6=95=B0=E6=8D=AE=E7=AE=A1?= =?UTF-8?q?=E7=90=86=E6=8E=A5=E5=8F=A3=20=E4=BF=AE=E6=94=B9=E5=8C=BA?= =?UTF-8?q?=E6=AE=B5=E8=BF=9B=E8=B7=AF=E8=A7=A3=E9=94=81=E6=96=B9=E6=B3=95?= =?UTF-8?q?=E5=8F=82=E6=95=B0=E5=92=8C=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sql/20201123.sql | 17 - sql/20201201.sql | 3 - sql/20201203.sql | 7 - sql/20201204.sql | 72 --- sql/20201208.sql | 2 - sql/20201216-dukang.sql | 11 - sql/20201229-zhangsai.sql | 9 - sql/20210108-dukang.sql | 102 ---- sql/20210112-dukang.sql | 567 ------------------ sql/20210113-shengxuqiang.sql | 4 - sql/20210128-zhangsai.sql | 3 - sql/20210303-zhangsai.sql | 9 - sql/20210312-zhangsai.sql | 43 -- sql/20210315-sheng-project-server.sql | 12 - sql/20210322-zhangsai.sql | 15 - sql/20210324-zhangsai.sql | 59 -- sql/20210326-zhangsai.sql | 26 - sql/20210401-zhangsai.sql | 2 - sql/20210413-dukang.sql | 11 - sql/20210416-sheng.sql | 18 - sql/20210422-zhangsai.sql | 6 - sql/20210430-zhangsai.sql | 27 - sql/20210720-sheng.sql | 14 + .../circuitry/CircuitryDraftController.java | 86 +++ .../joylink/rtss/dao/CircuitryDraftDAO.java | 40 ++ .../joylink/rtss/entity/CircuitryDraft.java | 30 + .../rtss/entity/CircuitryDraftExample.java | 473 +++++++++++++++ .../circuitry/CircuitryDraftService.java | 22 + .../circuitry/CircuitryDraftServiceImpl.java | 86 +++ .../services/model2d/Model2dServiceImpl.java | 2 +- .../cbtc/CI/service/RouteService.java | 28 +- .../simulation/cbtc/data/map/Section.java | 16 +- .../cbtc/tool/DeviceStatusModifyTool.java | 6 +- .../rtss/vo/circuitry/CircuitryQueryVO.java | 12 + .../rtss/vo/circuitry/CircuitryVO.java | 61 ++ .../mybatis/mapper/CircuitryDraftDAO.xml | 261 ++++++++ 36 files changed, 1111 insertions(+), 1051 deletions(-) delete mode 100644 sql/20201123.sql delete mode 100644 sql/20201201.sql delete mode 100644 sql/20201203.sql delete mode 100644 sql/20201204.sql delete mode 100644 sql/20201208.sql delete mode 100644 sql/20201216-dukang.sql delete mode 100644 sql/20201229-zhangsai.sql delete mode 100644 sql/20210108-dukang.sql delete mode 100644 sql/20210112-dukang.sql delete mode 100644 sql/20210113-shengxuqiang.sql delete mode 100644 sql/20210128-zhangsai.sql delete mode 100644 sql/20210303-zhangsai.sql delete mode 100644 sql/20210312-zhangsai.sql delete mode 100644 sql/20210315-sheng-project-server.sql delete mode 100644 sql/20210322-zhangsai.sql delete mode 100644 sql/20210324-zhangsai.sql delete mode 100644 sql/20210326-zhangsai.sql delete mode 100644 sql/20210401-zhangsai.sql delete mode 100644 sql/20210413-dukang.sql delete mode 100644 sql/20210416-sheng.sql delete mode 100644 sql/20210422-zhangsai.sql delete mode 100644 sql/20210430-zhangsai.sql create mode 100644 sql/20210720-sheng.sql create mode 100644 src/main/java/club/joylink/rtss/controller/circuitry/CircuitryDraftController.java create mode 100644 src/main/java/club/joylink/rtss/dao/CircuitryDraftDAO.java create mode 100644 src/main/java/club/joylink/rtss/entity/CircuitryDraft.java create mode 100644 src/main/java/club/joylink/rtss/entity/CircuitryDraftExample.java create mode 100644 src/main/java/club/joylink/rtss/services/circuitry/CircuitryDraftService.java create mode 100644 src/main/java/club/joylink/rtss/services/circuitry/CircuitryDraftServiceImpl.java create mode 100644 src/main/java/club/joylink/rtss/vo/circuitry/CircuitryQueryVO.java create mode 100644 src/main/java/club/joylink/rtss/vo/circuitry/CircuitryVO.java create mode 100644 src/main/resources/mybatis/mapper/CircuitryDraftDAO.xml diff --git a/sql/20201123.sql b/sql/20201123.sql deleted file mode 100644 index 69bf368f1..000000000 --- a/sql/20201123.sql +++ /dev/null @@ -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 '该地图正在使用的地图数据的版本'; - - - - diff --git a/sql/20201201.sql b/sql/20201201.sql deleted file mode 100644 index 75f040182..000000000 --- a/sql/20201201.sql +++ /dev/null @@ -1,3 +0,0 @@ -alter table company - add managers varchar(32) null comment '公司管理者'; - diff --git a/sql/20201203.sql b/sql/20201203.sql deleted file mode 100644 index 891170a97..000000000 --- a/sql/20201203.sql +++ /dev/null @@ -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; - diff --git a/sql/20201204.sql b/sql/20201204.sql deleted file mode 100644 index 5628bd80a..000000000 --- a/sql/20201204.sql +++ /dev/null @@ -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 -; - - diff --git a/sql/20201208.sql b/sql/20201208.sql deleted file mode 100644 index 7afd45450..000000000 --- a/sql/20201208.sql +++ /dev/null @@ -1,2 +0,0 @@ -alter table user_simulation_stats modify role varchar(64) null comment '用户角色'; - diff --git a/sql/20201216-dukang.sql b/sql/20201216-dukang.sql deleted file mode 100644 index bfef2a69a..000000000 --- a/sql/20201216-dukang.sql +++ /dev/null @@ -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`; diff --git a/sql/20201229-zhangsai.sql b/sql/20201229-zhangsai.sql deleted file mode 100644 index e3c8c5f89..000000000 --- a/sql/20201229-zhangsai.sql +++ /dev/null @@ -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; - diff --git a/sql/20210108-dukang.sql b/sql/20210108-dukang.sql deleted file mode 100644 index 6c6bfd83c..000000000 --- a/sql/20210108-dukang.sql +++ /dev/null @@ -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`; - - - - - - - diff --git a/sql/20210112-dukang.sql b/sql/20210112-dukang.sql deleted file mode 100644 index af9efca74..000000000 --- a/sql/20210112-dukang.sql +++ /dev/null @@ -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); diff --git a/sql/20210113-shengxuqiang.sql b/sql/20210113-shengxuqiang.sql deleted file mode 100644 index 762782bd0..000000000 --- a/sql/20210113-shengxuqiang.sql +++ /dev/null @@ -1,4 +0,0 @@ -ALTER TABLE `draft_map_route_flank_protection` -DROP COLUMN `station_code`, -DROP COLUMN `number`; - diff --git a/sql/20210128-zhangsai.sql b/sql/20210128-zhangsai.sql deleted file mode 100644 index 4bc96647d..000000000 --- a/sql/20210128-zhangsai.sql +++ /dev/null @@ -1,3 +0,0 @@ -alter table sale_order - add transaction_id varchar(32) null comment '支付平台订单号'; - diff --git a/sql/20210303-zhangsai.sql b/sql/20210303-zhangsai.sql deleted file mode 100644 index af7422c41..000000000 --- a/sql/20210303-zhangsai.sql +++ /dev/null @@ -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 '创建者'; diff --git a/sql/20210312-zhangsai.sql b/sql/20210312-zhangsai.sql deleted file mode 100644 index 389eab16a..000000000 --- a/sql/20210312-zhangsai.sql +++ /dev/null @@ -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='组织评分规则'; - - - diff --git a/sql/20210315-sheng-project-server.sql b/sql/20210315-sheng-project-server.sql deleted file mode 100644 index 776d20a26..000000000 --- a/sql/20210315-sheng-project-server.sql +++ /dev/null @@ -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='项目服务器域名表'; \ No newline at end of file diff --git a/sql/20210322-zhangsai.sql b/sql/20210322-zhangsai.sql deleted file mode 100644 index 9fd19e1db..000000000 --- a/sql/20210322-zhangsai.sql +++ /dev/null @@ -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 '状态'; diff --git a/sql/20210324-zhangsai.sql b/sql/20210324-zhangsai.sql deleted file mode 100644 index 9e4cd0fe6..000000000 --- a/sql/20210324-zhangsai.sql +++ /dev/null @@ -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'; - - - - - - - - - - - diff --git a/sql/20210326-zhangsai.sql b/sql/20210326-zhangsai.sql deleted file mode 100644 index cff57bbca..000000000 --- a/sql/20210326-zhangsai.sql +++ /dev/null @@ -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`); - - - - - diff --git a/sql/20210401-zhangsai.sql b/sql/20210401-zhangsai.sql deleted file mode 100644 index 239f8015d..000000000 --- a/sql/20210401-zhangsai.sql +++ /dev/null @@ -1,2 +0,0 @@ -alter table sys_user - add org_id bigint null comment '所属组织id' after account; diff --git a/sql/20210413-dukang.sql b/sql/20210413-dukang.sql deleted file mode 100644 index cbfc8a387..000000000 --- a/sql/20210413-dukang.sql +++ /dev/null @@ -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 -; diff --git a/sql/20210416-sheng.sql b/sql/20210416-sheng.sql deleted file mode 100644 index b770cf398..000000000 --- a/sql/20210416-sheng.sql +++ /dev/null @@ -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`; - diff --git a/sql/20210422-zhangsai.sql b/sql/20210422-zhangsai.sql deleted file mode 100644 index b0f13b522..000000000 --- a/sql/20210422-zhangsai.sql +++ /dev/null @@ -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`; - diff --git a/sql/20210430-zhangsai.sql b/sql/20210430-zhangsai.sql deleted file mode 100644 index 95d87dde4..000000000 --- a/sql/20210430-zhangsai.sql +++ /dev/null @@ -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; - - diff --git a/sql/20210720-sheng.sql b/sql/20210720-sheng.sql new file mode 100644 index 000000000..9455a10a1 --- /dev/null +++ b/sql/20210720-sheng.sql @@ -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; diff --git a/src/main/java/club/joylink/rtss/controller/circuitry/CircuitryDraftController.java b/src/main/java/club/joylink/rtss/controller/circuitry/CircuitryDraftController.java new file mode 100644 index 000000000..06977eef6 --- /dev/null +++ b/src/main/java/club/joylink/rtss/controller/circuitry/CircuitryDraftController.java @@ -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 queryOfUser(CircuitryQueryVO queryVO, @RequestAttribute AccountVO user) { + return this.circuitryDraftService.queryListOfUser(queryVO, user); + } + + /** + * 分页查询用户电路数据 + * @param queryVO + * @param user + * @return + */ + @GetMapping("/page/users") + public PageVO 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); + } + +} diff --git a/src/main/java/club/joylink/rtss/dao/CircuitryDraftDAO.java b/src/main/java/club/joylink/rtss/dao/CircuitryDraftDAO.java new file mode 100644 index 000000000..1d4b62c66 --- /dev/null +++ b/src/main/java/club/joylink/rtss/dao/CircuitryDraftDAO.java @@ -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 selectByExampleWithBLOBs(CircuitryDraftExample example); + + List 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); +} \ No newline at end of file diff --git a/src/main/java/club/joylink/rtss/entity/CircuitryDraft.java b/src/main/java/club/joylink/rtss/entity/CircuitryDraft.java new file mode 100644 index 000000000..0e56b35d8 --- /dev/null +++ b/src/main/java/club/joylink/rtss/entity/CircuitryDraft.java @@ -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; +} \ No newline at end of file diff --git a/src/main/java/club/joylink/rtss/entity/CircuitryDraftExample.java b/src/main/java/club/joylink/rtss/entity/CircuitryDraftExample.java new file mode 100644 index 000000000..dd1e6b80f --- /dev/null +++ b/src/main/java/club/joylink/rtss/entity/CircuitryDraftExample.java @@ -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 oredCriteria; + + private Integer limit; + + private Long offset; + + public CircuitryDraftExample() { + oredCriteria = new ArrayList(); + } + + 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 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 criteria; + + protected GeneratedCriteria() { + super(); + criteria = new ArrayList(); + } + + public boolean isValid() { + return criteria.size() > 0; + } + + public List getAllCriteria() { + return criteria; + } + + public List getCriteria() { + return criteria; + } + + protected void addCriterion(String condition) { + if (condition == null) { + throw new RuntimeException("Value for condition cannot be null"); + } + criteria.add(new Criterion(condition)); + } + + protected void addCriterion(String condition, Object value, String property) { + if (value == null) { + throw new RuntimeException("Value for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value)); + } + + protected void addCriterion(String condition, Object value1, Object value2, String property) { + if (value1 == null || value2 == null) { + throw new RuntimeException("Between values for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value1, value2)); + } + + public Criteria andIdIsNull() { + addCriterion("id is null"); + return (Criteria) this; + } + + public Criteria andIdIsNotNull() { + addCriterion("id is not null"); + return (Criteria) this; + } + + public Criteria andIdEqualTo(Long value) { + addCriterion("id =", value, "id"); + return (Criteria) this; + } + + public Criteria andIdNotEqualTo(Long value) { + addCriterion("id <>", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThan(Long value) { + addCriterion("id >", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThanOrEqualTo(Long value) { + addCriterion("id >=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThan(Long value) { + addCriterion("id <", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThanOrEqualTo(Long value) { + addCriterion("id <=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdIn(List values) { + addCriterion("id in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdNotIn(List values) { + addCriterion("id not in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdBetween(Long value1, Long value2) { + addCriterion("id between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andIdNotBetween(Long value1, Long value2) { + addCriterion("id not between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andNameIsNull() { + addCriterion("`name` is null"); + return (Criteria) this; + } + + public Criteria andNameIsNotNull() { + addCriterion("`name` is not null"); + return (Criteria) this; + } + + public Criteria andNameEqualTo(String value) { + addCriterion("`name` =", value, "name"); + return (Criteria) this; + } + + public Criteria andNameNotEqualTo(String value) { + addCriterion("`name` <>", value, "name"); + return (Criteria) this; + } + + public Criteria andNameGreaterThan(String value) { + addCriterion("`name` >", value, "name"); + return (Criteria) this; + } + + public Criteria andNameGreaterThanOrEqualTo(String value) { + addCriterion("`name` >=", value, "name"); + return (Criteria) this; + } + + public Criteria andNameLessThan(String value) { + addCriterion("`name` <", value, "name"); + return (Criteria) this; + } + + public Criteria andNameLessThanOrEqualTo(String value) { + addCriterion("`name` <=", value, "name"); + return (Criteria) this; + } + + public Criteria andNameLike(String value) { + addCriterion("`name` like", value, "name"); + return (Criteria) this; + } + + public Criteria andNameNotLike(String value) { + addCriterion("`name` not like", value, "name"); + return (Criteria) this; + } + + public Criteria andNameIn(List values) { + addCriterion("`name` in", values, "name"); + return (Criteria) this; + } + + public Criteria andNameNotIn(List values) { + addCriterion("`name` not in", values, "name"); + return (Criteria) this; + } + + public Criteria andNameBetween(String value1, String value2) { + addCriterion("`name` between", value1, value2, "name"); + return (Criteria) this; + } + + public Criteria andNameNotBetween(String value1, String value2) { + addCriterion("`name` not between", value1, value2, "name"); + return (Criteria) this; + } + + public Criteria 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 values) { + addCriterion("create_user_id in", values, "createUserId"); + return (Criteria) this; + } + + public Criteria andCreateUserIdNotIn(List 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 values) { + addCriterion("create_time in", values, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeNotIn(List values) { + addCriterion("create_time not in", values, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeBetween(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); + } + } +} \ No newline at end of file diff --git a/src/main/java/club/joylink/rtss/services/circuitry/CircuitryDraftService.java b/src/main/java/club/joylink/rtss/services/circuitry/CircuitryDraftService.java new file mode 100644 index 000000000..d6cc0cdf2 --- /dev/null +++ b/src/main/java/club/joylink/rtss/services/circuitry/CircuitryDraftService.java @@ -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 queryListOfUser(CircuitryQueryVO queryVO, AccountVO user); + + PageVO pagingQueryOfUser(CircuitryQueryVO queryVO, AccountVO user); + + CircuitryVO getVOById(Long id); +} diff --git a/src/main/java/club/joylink/rtss/services/circuitry/CircuitryDraftServiceImpl.java b/src/main/java/club/joylink/rtss/services/circuitry/CircuitryDraftServiceImpl.java new file mode 100644 index 000000000..384c14c93 --- /dev/null +++ b/src/main/java/club/joylink/rtss/services/circuitry/CircuitryDraftServiceImpl.java @@ -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 queryListOfUser(CircuitryQueryVO queryVO, AccountVO user) { + CircuitryDraftExample example = new CircuitryDraftExample(); + example.createCriteria() + .andCreateUserIdEqualTo(user.getId()); + List list = this.circuitryDraftDAO.selectByExample(example); + return CircuitryVO.convertDraft2VOList(list); + } + + @Override + public PageVO pagingQueryOfUser(CircuitryQueryVO queryVO, AccountVO user) { + CircuitryDraftExample example = new CircuitryDraftExample(); + example.createCriteria() + .andCreateUserIdEqualTo(user.getId()); + PageHelper.startPage(queryVO.getPageNum(), queryVO.getPageSize()); + Page page = (Page) 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; + } +} diff --git a/src/main/java/club/joylink/rtss/services/model2d/Model2dServiceImpl.java b/src/main/java/club/joylink/rtss/services/model2d/Model2dServiceImpl.java index 0ccdb1571..aef15c6b8 100644 --- a/src/main/java/club/joylink/rtss/services/model2d/Model2dServiceImpl.java +++ b/src/main/java/club/joylink/rtss/services/model2d/Model2dServiceImpl.java @@ -46,7 +46,7 @@ public class Model2dServiceImpl implements Model2dService { criteria.andNameLike(String.format("%%%s%%", queryVO.getName())); } PageHelper.startPage(queryVO.getPageNum(), queryVO.getPageSize()); - Page page = (Page) this.model2dDAO.selectByExample(example); + Page page = (Page) this.model2dDAO.selectByExampleWithBLOBs(example); return PageVO.convert(page, Model2dVO.convert2VOList(page.getResult())); } diff --git a/src/main/java/club/joylink/rtss/simulation/cbtc/CI/service/RouteService.java b/src/main/java/club/joylink/rtss/simulation/cbtc/CI/service/RouteService.java index 531a1bbf1..96074cd63 100644 --- a/src/main/java/club/joylink/rtss/simulation/cbtc/CI/service/RouteService.java +++ b/src/main/java/club/joylink/rtss/simulation/cbtc/CI/service/RouteService.java @@ -308,7 +308,7 @@ public class RouteService { log.info(String.format("进路[%s]排列检查失败,无法排列:%s", route.debugStr(), check.debugStr())); return check; } - if (route.isLock()) { + if (route.isLock() && !route.isFleetMode()) { log.info(String.format("进路[%s]已经锁闭", route.debugStr())); return null; } @@ -372,7 +372,7 @@ public class RouteService { } if (simulation.getSystemTime().isAfter(route.getSettingStartTime().plusSeconds(SimulationConstants.ROUTE_SETTING_TIMEOUT))) { route.settingFailed(); - simulation.getRepository().removeSettingRoute(route); +// simulation.getRepository().removeSettingRoute(route); route.setLock(false); log.info(String.format("进路[%s]办理失败,取消办理2", route.debugStr())); return; @@ -391,10 +391,10 @@ public class RouteService { relSwitch.getA().routeLocking(route, right); if (relSwitch.isNormalPosition()) { // 定位 relSwitch.getB().routeLocking(route, right); - relSwitch.getC().routeUnlocking(right); + relSwitch.getC().routeUnlocking(route); } else if (relSwitch.isReversePosition()) { // 反位 relSwitch.getC().routeLocking(route, right); - relSwitch.getB().routeUnlocking(right); + relSwitch.getB().routeUnlocking(route); } else { // 失表 relSwitch.getB().routeLocking(route, right); relSwitch.getC().routeLocking(route, right); @@ -665,9 +665,9 @@ public class RouteService { // 道岔锁闭 Switch relSwitch = section.getRelSwitch(); if (relSwitch.isNormalPosition()) { - relSwitch.getC().routeUnlocking(right); + relSwitch.getC().routeUnlocking(route); } else if (relSwitch.isReversePosition()) { - relSwitch.getB().routeUnlocking(right); + relSwitch.getB().routeUnlocking(route); } } // log.debug(section.debugStr() + "在进路办理过程中锁闭"); @@ -779,11 +779,11 @@ public class RouteService { sectionList.forEach(section -> { if (section.isSwitchTrack()) { Switch relSwitch = section.getRelSwitch(); - relSwitch.getA().routeUnlocking(right); - relSwitch.getB().routeUnlocking(right); - relSwitch.getC().routeUnlocking(right); + relSwitch.getA().routeUnlocking(route); + relSwitch.getB().routeUnlocking(route); + relSwitch.getC().routeUnlocking(route); } else { - section.routeUnlocking(right); + section.routeUnlocking(route); } log.debug(section.debugStr() + "因取消进路解锁"); }); @@ -1188,7 +1188,7 @@ public class RouteService { } for (Section logic : logicList) { if (!logic.isOccupied()) { - logic.routeUnlocking(right); + logic.routeUnlocking(route); } else { break; } @@ -1198,9 +1198,9 @@ public class RouteService { break; } else { if (section.isSwitchTrack()) { // 如果是道岔区段,解锁道岔 - section.routeUnlocking(right); + section.routeUnlocking(route); if (section.getParent() != null && section.getParent().isCross()) { - section.getParent().routeUnlocking(right); + section.getParent().routeUnlocking(route); } relSwitch.routeUnlock(); // 侧防解锁 @@ -1218,7 +1218,7 @@ public class RouteService { } } } else { - section.routeUnlocking(right); + section.routeUnlocking(route); } log.debug(section.debugStr() + "因正常解锁解锁"); } diff --git a/src/main/java/club/joylink/rtss/simulation/cbtc/data/map/Section.java b/src/main/java/club/joylink/rtss/simulation/cbtc/data/map/Section.java index e05b37046..84734a08e 100644 --- a/src/main/java/club/joylink/rtss/simulation/cbtc/data/map/Section.java +++ b/src/main/java/club/joylink/rtss/simulation/cbtc/data/map/Section.java @@ -600,28 +600,28 @@ public class Section extends MayOutOfOrderDevice { /** * 进路解锁(连同逻辑区段) * - * @param right + * @param route */ - public void routeUnlocking(boolean right) { - if (this.isRouteLockOn(right)) { + public void routeUnlocking(Route route) { + if (this.isRouteLockBy(route)) { //岔心解锁 if (this.parent != null && this.parent.isCross()) { this.parent.setRouteLock(false); this.parent.setRoute(null); -// this.parent.setOverlapLock(false); - this.parent.setLockRight(false); } //自身解锁 this.routeLock = false; this.route = null; -// this.overlapLock = false; - this.lockRight = false; if (!CollectionUtils.isEmpty(this.logicList)) { - this.logicList.forEach(logic -> logic.routeUnlocking(right)); + this.logicList.forEach(logic -> logic.routeUnlocking(route)); } } } + private boolean isRouteLockBy(Route route) { + return this.routeLock && route.equals(this.route); + } + public void forceUnlocking() { this.routeLock = false; this.route = null; diff --git a/src/main/java/club/joylink/rtss/simulation/cbtc/tool/DeviceStatusModifyTool.java b/src/main/java/club/joylink/rtss/simulation/cbtc/tool/DeviceStatusModifyTool.java index 4a23b4119..d2987b49b 100644 --- a/src/main/java/club/joylink/rtss/simulation/cbtc/tool/DeviceStatusModifyTool.java +++ b/src/main/java/club/joylink/rtss/simulation/cbtc/tool/DeviceStatusModifyTool.java @@ -222,7 +222,7 @@ public class DeviceStatusModifyTool { // 直接解锁区段 if (section.isSwitchTrack() && !section.getParent().isOccupied()) { // 如果是道岔区段,解锁道岔 Switch relSwitch = section.getRelSwitch(); - section.routeUnlocking(right); + section.routeUnlocking(route); relSwitch.routeUnlock(); Switch linkedSwitch = relSwitch.queryLinkedSwitch(); if (Objects.nonNull(linkedSwitch) && !linkedSwitch.isSectionRouteLock()) { @@ -238,12 +238,12 @@ public class DeviceStatusModifyTool { } } } else { - section.routeUnlocking(right); + section.routeUnlocking(route); } } } public void loadManualTrainOfGroup(Simulation simulation, String groupNumber, Section section , boolean right){ - atsTrainLoadService.loadSpareTrain(simulation, groupNumber, section.getCode(),right); + atsTrainLoadService.loadSpareTrain(simulation, groupNumber, section.getCode(),right); } } diff --git a/src/main/java/club/joylink/rtss/vo/circuitry/CircuitryQueryVO.java b/src/main/java/club/joylink/rtss/vo/circuitry/CircuitryQueryVO.java new file mode 100644 index 000000000..d554f8009 --- /dev/null +++ b/src/main/java/club/joylink/rtss/vo/circuitry/CircuitryQueryVO.java @@ -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 { +} diff --git a/src/main/java/club/joylink/rtss/vo/circuitry/CircuitryVO.java b/src/main/java/club/joylink/rtss/vo/circuitry/CircuitryVO.java new file mode 100644 index 000000000..75982c82f --- /dev/null +++ b/src/main/java/club/joylink/rtss/vo/circuitry/CircuitryVO.java @@ -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 convertDraft2VOList(List list) { + List 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; + } +} diff --git a/src/main/resources/mybatis/mapper/CircuitryDraftDAO.xml b/src/main/resources/mybatis/mapper/CircuitryDraftDAO.xml new file mode 100644 index 000000000..62c712006 --- /dev/null +++ b/src/main/resources/mybatis/mapper/CircuitryDraftDAO.xml @@ -0,0 +1,261 @@ + + + + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + id, `name`, create_user_id, create_time + + + draw_data + + + + + + delete from circuitry_draft + where id = #{id,jdbcType=BIGINT} + + + delete from circuitry_draft + + + + + + 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 into circuitry_draft + + + `name`, + + + create_user_id, + + + create_time, + + + draw_data, + + + + + #{name,jdbcType=VARCHAR}, + + + #{createUserId,jdbcType=BIGINT}, + + + #{createTime,jdbcType=TIMESTAMP}, + + + #{drawData,jdbcType=LONGVARCHAR}, + + + + + + update circuitry_draft + + + 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}, + + + + + + + + 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} + + + + + + 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} + + + + + + update circuitry_draft + + + `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 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 circuitry_draft + set `name` = #{name,jdbcType=VARCHAR}, + create_user_id = #{createUserId,jdbcType=BIGINT}, + create_time = #{createTime,jdbcType=TIMESTAMP} + where id = #{id,jdbcType=BIGINT} + + \ No newline at end of file From b37cc7d6317b1ce018abbf51f6428e4cf0f5d8e0 Mon Sep 17 00:00:00 2001 From: joylink_zhangsai <1021828630@qq.com> Date: Tue, 20 Jul 2021 17:30:48 +0800 Subject: [PATCH 6/6] =?UTF-8?q?=E4=BF=AE=E6=94=B9=EF=BC=9A=E9=9D=9E?= =?UTF-8?q?=E9=80=9A=E4=BF=A1=E8=BD=A6=E5=81=9C=E7=AB=99=E7=AB=99=E5=8F=B0?= =?UTF-8?q?=E8=AE=BE=E7=BD=AE=E6=89=A3=E8=BD=A6=E4=B8=8D=E5=86=8D=E5=85=B3?= =?UTF-8?q?=E9=97=AD=E4=BF=A1=E5=8F=B7=E6=9C=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../joylink/rtss/simulation/cbtc/CI/service/StandService.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/club/joylink/rtss/simulation/cbtc/CI/service/StandService.java b/src/main/java/club/joylink/rtss/simulation/cbtc/CI/service/StandService.java index 96bb844cb..62ad32c0b 100644 --- a/src/main/java/club/joylink/rtss/simulation/cbtc/CI/service/StandService.java +++ b/src/main/java/club/joylink/rtss/simulation/cbtc/CI/service/StandService.java @@ -83,7 +83,7 @@ public class StandService { Signal signal = stand.getSection().getSignalOf(stand.isRight()); if (Objects.nonNull(signal)) { MapConfig config = simulation.getRepository().getConfig(); - if (config.isStandHoldCloseLogicLight() || !signal.isLogicLight()) { + if (config.isStandHoldCloseLogicLight()/* || !signal.isLogicLight()*/) { this.signalService.close(simulation, signal); } }