Browse Source

上线外网版本

dev
liwenxuan 2 years ago
parent
commit
086c77eb79
  1. 88
      pom.xml
  2. 39
      src/main/java/com/hxgk/zxxy/controller/LowCodeTransferController.java
  3. 8
      src/main/java/com/hxgk/zxxy/mapper/LowCodeTransferMapper.java
  4. 5
      src/main/java/com/hxgk/zxxy/mapper/UserMapper.java
  5. 34
      src/main/java/com/hxgk/zxxy/model/entity/Car.java
  6. 50
      src/main/java/com/hxgk/zxxy/model/entity/OrgAndManTree.java
  7. 11
      src/main/java/com/hxgk/zxxy/model/entity/OrgContType.java
  8. 3
      src/main/java/com/hxgk/zxxy/service/HrService.java
  9. 9
      src/main/java/com/hxgk/zxxy/service/LowCodeTransferService.java
  10. 4
      src/main/java/com/hxgk/zxxy/service/UserService.java
  11. 125
      src/main/java/com/hxgk/zxxy/service/impl/HrServiceImpl.java
  12. 22
      src/main/java/com/hxgk/zxxy/service/impl/LowCodeTransferServiceImpl.java
  13. 15
      src/main/java/com/hxgk/zxxy/service/impl/UserServiceImpl.java
  14. 9
      src/main/resources/application-dev.yml
  15. 2
      src/main/resources/application-prod.yml
  16. 116
      src/main/resources/application-prodout.yml
  17. 2
      src/main/resources/application.yml
  18. 14
      src/main/resources/mapper/LowCodeTransferMapper.xml
  19. 6
      src/main/resources/mapper/UserMapper.xml

88
pom.xml

@ -1,12 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.7.13</version>
<relativePath/> <!-- lookup parent from repository -->
<relativePath/>
<!-- lookup parent from repository -->
</parent>
<groupId>com.hxgk</groupId>
<artifactId>zxxy</artifactId>
@ -16,31 +16,23 @@
<properties>
<java.version>1.8</java.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<exclusions>
<!--上线配置-->
<!--<exclusion>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
</exclusion>-->
<!-- 上线配置 -->
<!-- <exclusion>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
</exclusion> -->
<exclusion>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-logging</artifactId>
</exclusion>
</exclusions>
</dependency>
<!-- 引入log4j2依赖 -->
<!-- 引入log4j2依赖 -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-log4j2</artifactId>
@ -55,22 +47,18 @@
<artifactId>druid-spring-boot-starter</artifactId>
<version>1.2.9</version>
</dependency>
<!--上线配置-->
<!--<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
<scope>provided</scope>
</dependency>-->
<!-- 上线配置 -->
<!-- <dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
<scope>provided</scope>
</dependency> -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-redis</artifactId>
</dependency>
@ -85,20 +73,16 @@
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.mybatis.spring.boot</groupId>
<artifactId>mybatis-spring-boot-starter</artifactId>
<version>2.1.3</version>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>8.0.24</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
@ -113,23 +97,26 @@
<artifactId>pagehelper-spring-boot-starter</artifactId>
<version>1.4.6</version>
</dependency>
<!-- https://mvnrepository.com/artifact/com.alibaba.fastjson2/fastjson2 -->
<dependency>
<groupId>com.alibaba.fastjson2</groupId>
<artifactId>fastjson2</artifactId>
<version>2.0.46</version>
</dependency>
</dependencies>
<build>
<finalName>zxxy</finalName>
<plugins>
<!--<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
&lt;!&ndash;热部署配置&ndash;&gt;
<configuration>
<fork>true</fork>
</configuration>
</plugin>-->
<!-- <plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
&lt;!&ndash;热部署配置&ndash;&gt;
<configuration>
<fork>true</fork>
</configuration>
</plugin> -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
@ -138,9 +125,9 @@
<fork>true</fork>
<source>1.8</source>
<target>1.8</target>
<!--上线配置-->
<!-- 上线配置 -->
<encoding>UTF-8</encoding>
<!--<encoding>GBK</encoding>-->
<!-- <encoding>GBK</encoding> -->
</configuration>
</plugin>
<plugin>
@ -159,7 +146,7 @@
</execution>
</executions>
</plugin>
<!-- war 插件 -->
<!-- war 插件 -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
@ -167,9 +154,6 @@
<warName>zxxy</warName>
</configuration>
</plugin>
</plugins>
<resources>
<resource>
@ -185,9 +169,7 @@
</includes>
</resource>
</resources>
</build>
<!--上线配置-->
<!-- 上线配置 -->
<packaging>war</packaging>
</project>
</project>

39
src/main/java/com/hxgk/zxxy/controller/LowCodeTransferController.java

@ -0,0 +1,39 @@
package com.hxgk.zxxy.controller;
import com.hxgk.zxxy.model.entity.Car;
import com.hxgk.zxxy.model.entity.OrgAndManTree;
import com.hxgk.zxxy.model.entity.UserDetail;
import com.hxgk.zxxy.service.HrService;
import com.hxgk.zxxy.service.LowCodeTransferService;
import com.hxgk.zxxy.service.UserService;
import com.hxgk.zxxy.utils.JsonData;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import java.util.ArrayList;
import java.util.Map;
@RestController
@RequestMapping("lowCode")
public class LowCodeTransferController {
@Autowired
private LowCodeTransferService lowCodeTransferService;
@Autowired
private HrService hrService;
@RequestMapping(value = "transfer/getCarList")
public JsonData getUserDetailFromRedis(@RequestParam(value = "transferMark", required = false) String transferMark){
ArrayList<Car> carList = lowCodeTransferService.getCarList();
return JsonData.buildSuccess(carList);
}
@RequestMapping(value = "transfer/getOrgAndManTree")
public JsonData getOrgAndManTree(@RequestParam(value = "transferMark", required = false) String transferMark){
OrgAndManTree orgAndManTree = hrService.getOrgAndManTree();
return JsonData.buildSuccess(orgAndManTree);
}
}

8
src/main/java/com/hxgk/zxxy/mapper/LowCodeTransferMapper.java

@ -0,0 +1,8 @@
package com.hxgk.zxxy.mapper;
import com.hxgk.zxxy.model.entity.Car;
import java.util.ArrayList;
public interface LowCodeTransferMapper {
ArrayList<Car> getCarList();
}

5
src/main/java/com/hxgk/zxxy/mapper/UserMapper.java

@ -1,9 +1,14 @@
package com.hxgk.zxxy.mapper;
import com.hxgk.zxxy.model.entity.ManCont;
import com.hxgk.zxxy.model.entity.OrgAndManTree;
import org.apache.ibatis.annotations.Param;
import java.util.List;
public interface UserMapper {
ManCont getManContByKey(@Param("key") String key);
List<OrgAndManTree> getManContListByAdminOrg(@Param("adminOrg")String adminOrg);
}

34
src/main/java/com/hxgk/zxxy/model/entity/Car.java

@ -0,0 +1,34 @@
package com.hxgk.zxxy.model.entity;
import org.springframework.stereotype.Repository;
@Repository
public class Car {
private Integer id;
private String carName;
private Boolean isNewEnergy;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getCarName() {
return carName;
}
public void setCarName(String carName) {
this.carName = carName;
}
public Boolean getNewEnergy() {
return isNewEnergy;
}
public void setNewEnergy(Boolean newEnergy) {
isNewEnergy = newEnergy;
}
}

50
src/main/java/com/hxgk/zxxy/model/entity/OrgAndManTree.java

@ -0,0 +1,50 @@
package com.hxgk.zxxy.model.entity;
import org.springframework.stereotype.Repository;
import java.lang.reflect.Array;
import java.util.List;
@Repository
public class OrgAndManTree {
private String id;
private String label;
private String parentId;
private List<OrgAndManTree> children;
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getLabel() {
return label;
}
public void setLabel(String label) {
this.label = label;
}
public List<OrgAndManTree> getChildren() {
return children;
}
public void setChildren(List<OrgAndManTree> children) {
this.children = children;
}
public String getParentId() {
return parentId;
}
public void setParentId(String parentId) {
this.parentId = parentId;
}
}

11
src/main/java/com/hxgk/zxxy/model/entity/OrgContType.java

@ -2,6 +2,8 @@ package com.hxgk.zxxy.model.entity;
import org.springframework.stereotype.Repository;
import java.util.List;
@Repository
public class OrgContType {
private Long id;
@ -11,7 +13,16 @@ public class OrgContType {
private String typename;
private Integer level;
private Byte state;
private List<OrgAndManTree> persons;
public List<OrgAndManTree> getPersons() {
return persons;
}
public void setPersons(List<OrgAndManTree> persons) {
this.persons = persons;
}
public Long getId() {
return id;

3
src/main/java/com/hxgk/zxxy/service/HrService.java

@ -1,5 +1,6 @@
package com.hxgk.zxxy.service;
import com.hxgk.zxxy.model.entity.OrgAndManTree;
import org.springframework.stereotype.Service;
import java.util.List;
@ -11,5 +12,5 @@ public interface HrService {
List<Long> queryGWsId(Long adminorg) throws Exception;
OrgAndManTree getOrgAndManTree();
}

9
src/main/java/com/hxgk/zxxy/service/LowCodeTransferService.java

@ -0,0 +1,9 @@
package com.hxgk.zxxy.service;
import com.hxgk.zxxy.model.entity.Car;
import java.util.ArrayList;
public interface LowCodeTransferService {
ArrayList<Car> getCarList();
}

4
src/main/java/com/hxgk/zxxy/service/UserService.java

@ -1,8 +1,10 @@
package com.hxgk.zxxy.service;
import com.hxgk.zxxy.model.entity.ManCont;
import com.hxgk.zxxy.model.entity.OrgAndManTree;
import com.hxgk.zxxy.model.entity.UserDetail;
import java.util.List;
import java.util.Map;
public interface UserService {
@ -13,4 +15,6 @@ public interface UserService {
UserDetail getUserDetailFromRedis (Map<String, String> userInfo);
ManCont getManContByKey(String key);
List<OrgAndManTree> getManContListByAdminOrg(String adminOrg);
}

125
src/main/java/com/hxgk/zxxy/service/impl/HrServiceImpl.java

@ -1,14 +1,23 @@
package com.hxgk.zxxy.service.impl;
import com.alibaba.fastjson2.JSON;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.hxgk.zxxy.mapper.OrgContTypeMapper;
import com.hxgk.zxxy.model.entity.OrgAndManTree;
import com.hxgk.zxxy.model.entity.OrgContType;
import com.hxgk.zxxy.service.HrService;
import com.hxgk.zxxy.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.concurrent.TimeUnit;
import java.util.stream.Collectors;
/**
* 分厂条件,level=1,2时,要用in,他要看下属的所有分厂,要查出下属所有分厂的id,3时为adminorg,456时要向上查他隶属的分厂
@ -20,9 +29,12 @@ import java.util.List;
@DS("hrnew")
public class HrServiceImpl implements HrService {
@Autowired
UserService userService;
@Autowired
OrgContTypeMapper orgContTypeMapper;
@Autowired
private StringRedisTemplate redisTemplate;
//根据id查分厂
@ -30,7 +42,14 @@ public class HrServiceImpl implements HrService {
//备煤,机焦表里是车间,level5,但是要当成部门,level4,我查时,向上向下查询时,如果adminorg in[282,115],则说明他是机焦或者备煤,他level看作4
@Override
public List<Long> queryGBfId(Long adminorg) {
//adminorg = 313L;
if(null!=adminorg){
System.out.println("AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAqueryGBfId:"+adminorg);
}else{
System.out.println("AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAqueryGBfId:adminorg_is_null");
}
//adminorg = 313L;//恒信集团
//adminorg = 102L;//高科企管部
//adminorg = 309L;//高科
OrgContType orgContType = queryOrgContTypeByAdminorg(adminorg);
Integer level = orgContType.getLevel();
List<Long> gBfIdList = new ArrayList<Long>();
@ -61,7 +80,9 @@ public class HrServiceImpl implements HrService {
//如果当前org的superior(父级)为115或282(备煤或机焦),则当前org即可能是level6,也可能是level5,如果是level6,则加入list,如果是level5则继续查询
@Override
public List<Long> queryGWsId(Long adminorg) {
//adminorg = 313L;
//adminorg = 313L;//恒信集团
//adminorg = 102L;//高科企管部
//adminorg = 309L;//高科
List<Long> gGWsIdList = new ArrayList<Long>();
OrgContType orgContType = queryOrgContTypeByAdminorg(adminorg);
Integer level = orgContType.getLevel();
@ -77,6 +98,98 @@ public class HrServiceImpl implements HrService {
return gGWsIdList;
}
//低代码穿梭框组织人员树
@Override
public OrgAndManTree getOrgAndManTree() {
//先从redis里查一下看看有没有有则直接返回
if(redisTemplate.hasKey("orgTree_309_102")){
String orgTreeStr = redisTemplate.opsForValue().get("orgTree_309_102").toString();
OrgAndManTree o = JSON.parseObject(orgTreeStr, OrgAndManTree.class);
return o;
}else{
ArrayList<OrgContType> allWsList = new ArrayList();
ArrayList<OrgAndManTree> orgAndManTreeList = new ArrayList();
Long adminorg = 309L;//高科企管部
//Long adminorg = 312L;//高科
OrgContType orgContType = queryOrgContTypeByAdminorg(adminorg);
findAllUnder(orgContType,allWsList);
OrgAndManTree orgAndManTree = new OrgAndManTree();
String pid = "";
//构造OrgAndManTreeList
ArrayList<Long> Id_allWsList = new ArrayList<>();
for (OrgContType org : allWsList) {
Id_allWsList.add(org.getId());
OrgAndManTree orgAndManTree1 = new OrgAndManTree();
orgAndManTree1.setId(org.getId().toString());
orgAndManTree1.setParentId(org.getSuperior().toString());
orgAndManTree1.setLabel(org.getName());
if(org.getPersons()!=null&&org.getPersons().size()>0){
orgAndManTree1.setChildren(org.getPersons());
}
orgAndManTreeList.add(orgAndManTree1);
}
for (OrgContType org : allWsList) {
if(!Id_allWsList.contains(org.getSuperior())){
pid = org.getSuperior().toString();
}
}
//org的superior不在Id_allWsList中或org的superior==0,===>根节点.确定根节点的level.
if(pid!=null&&pid!=""){
recursionListToTree(orgAndManTreeList,pid);
}
for (OrgAndManTree dept : orgAndManTreeList) {
if(dept.getId().equals("102")){//309高科 102企管
orgAndManTree = dept;
}
}
String orgAndManTree_Json= JSON.toJSONString(orgAndManTree);
redisTemplate.opsForValue().set("orgTree_309_102", orgAndManTree_Json, 1, TimeUnit.DAYS);
return orgAndManTree;
}
}
/**
* 递归方法把传过来的list转为tree
*
*/
public List<OrgAndManTree> recursionListToTree(List<OrgAndManTree> list, String pId) {
List<OrgAndManTree> nodes = new ArrayList<>();
for (OrgAndManTree node : list) {
// 找出父节点
if (pId.equals(node.getParentId())) {
// 调用递归方法填充子节点列表
nodes.add(this.findChildren(node, list));
}
}
return nodes;
}
/**
* 递归方法
*
* @param tree 父节点对象
* @param treeList 所有的List
* @return
*/
public OrgAndManTree findChildren(OrgAndManTree tree, List<OrgAndManTree> treeList) {
for (OrgAndManTree node : treeList) {
if (tree.getId().equals(node.getParentId())) {
if (CollectionUtils.isEmpty(tree.getChildren())) {
tree.setChildren(new ArrayList<>());
}
// 递归 调用自身
tree.getChildren().add(this.findChildren(node, treeList));
}
}
return tree;
}
/**
@ -141,6 +254,12 @@ public class HrServiceImpl implements HrService {
allWsList.add(list.get(i));
findAllUnder(list.get(i), allWsList);
}
}else{//说明当前org是最子级组织
//查询该org下的所有人员
if(org.getId()!=null){
org.setPersons(userService.getManContListByAdminOrg(org.getId().toString()));
}
}
}

22
src/main/java/com/hxgk/zxxy/service/impl/LowCodeTransferServiceImpl.java

@ -0,0 +1,22 @@
package com.hxgk.zxxy.service.impl;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.hxgk.zxxy.mapper.LowCodeTransferMapper;
import com.hxgk.zxxy.model.entity.Car;
import com.hxgk.zxxy.service.LowCodeTransferService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
@Service
public class LowCodeTransferServiceImpl implements LowCodeTransferService {
@Autowired
private Car car;
@Autowired
LowCodeTransferMapper lowCodeTransferMapper;
@Override
@DS("lowcodetest")
public ArrayList<Car> getCarList() {
return lowCodeTransferMapper.getCarList();
}
}

15
src/main/java/com/hxgk/zxxy/service/impl/UserServiceImpl.java

@ -3,6 +3,7 @@ package com.hxgk.zxxy.service.impl;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.hxgk.zxxy.mapper.UserMapper;
import com.hxgk.zxxy.model.entity.ManCont;
import com.hxgk.zxxy.model.entity.OrgAndManTree;
import com.hxgk.zxxy.model.entity.UserDetail;
import com.hxgk.zxxy.service.UserService;
import org.apache.commons.lang3.StringUtils;
@ -11,6 +12,7 @@ import org.springframework.data.redis.core.HashOperations;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.stereotype.Service;
import java.util.List;
import java.util.Map;
@Service
@ -19,7 +21,7 @@ public class UserServiceImpl implements UserService {
private UserDetail userDetail1;
@Autowired
private StringRedisTemplate redisTemplate;
@Autowired
private UserMapper userMapper;
/**
@ -90,6 +92,17 @@ public class UserServiceImpl implements UserService {
return userMapper.getManContByKey(key);
}
@DS("hrnew")
@Override
public List<OrgAndManTree> getManContListByAdminOrg(String adminOrg) {
List<OrgAndManTree> manConts = userMapper.getManContListByAdminOrg(adminOrg);
/*for (int i = 0; i < manConts.size(); i++) {
if(!manConts.get(i).getNumber().chars().anyMatch(Character::isLetter)){
manConts.get(i).setId(Long.parseLong(manConts.get(i).getNumber()));
}
}*/
return manConts;
}
}

9
src/main/resources/application-dev.yml

@ -70,6 +70,11 @@ spring:
#url: jdbc:mysql://127.0.0.1:3306/wrong_question_bank?allowPublicKeyRetrieval=true&uuseUnicode=true&characterEncoding=utf8&useSSL=false&serverTimezone=Asia/Shanghai&tinyInt1isBit=false
url: jdbc:mysql://172.20.2.87:3306/wrong_question_bank?allowPublicKeyRetrieval=true&uuseUnicode=true&characterEncoding=utf8&useSSL=false&serverTimezone=Asia/Shanghai&tinyInt1isBit=false
username: wrong_question_bank
lowcodetest:
driver-class-name: com.mysql.cj.jdbc.Driver
password: root
url: jdbc:mysql://127.0.0.1:3306/lowcode_test?allowPublicKeyRetrieval=true&uuseUnicode=true&characterEncoding=utf8&useSSL=false&serverTimezone=Asia/Shanghai&tinyInt1isBit=false
username: root
#数据源基础配置
druid:
# 通过connectProperties属性来打开mergeSql功能;慢SQL记录
@ -99,7 +104,8 @@ spring:
strict: false
redis:
database: 5
host: 127.0.0.1
#host: 127.0.0.1
host: 172.20.5.57
lettuce:
pool:
max-active: 10
@ -107,4 +113,5 @@ spring:
max-wait: -1ms
min-idle: 0
port: 6379
password: Redis+brngJ3U19@8_Z2^7a
timeout: 10000

2
src/main/resources/application-prod.yml

@ -25,7 +25,7 @@ spring:
hrnew:
driver-class-name: com.mysql.cj.jdbc.Driver
password: AnknKiXiXaxNrw78
url: jdbc:mysql://127.0.0.1:3306/hengxingaoke_tes?allowPublicKeyRetrieval=true&uuseUnicode=true&characterEncoding=utf8&useSSL=false&serverTimezone=Asia/Shanghai&tinyInt1isBit=false
url: jdbc:mysql://127.0.0.1:3306/hr_new?allowPublicKeyRetrieval=true&uuseUnicode=true&characterEncoding=utf8&useSSL=false&serverTimezone=Asia/Shanghai&tinyInt1isBit=false
#url: jdbc:mysql://172.20.2.87:3306/hr_new?allowPublicKeyRetrieval=true&uuseUnicode=true&characterEncoding=utf8&useSSL=false&serverTimezone=Asia/Shanghai&tinyInt1isBit=false
username: hr_new
leaguetabledata:

116
src/main/resources/application-prodout.yml

@ -0,0 +1,116 @@
mybatis:
configuration:
#开启控制台打印sql
#log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
# mybatis 下划线转驼峰配置,两者都可以
map-underscore-to-camel-case: true
#配置扫描
mapper-locations: classpath:mapper/*.xml
#配置xml的结果别名
type-aliases-package: com.hxgk.zxxy.model.entity
spring:
autoconfigure:
#去除durid配置
exclude: com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceAutoConfigure
#MySQL druid多数据源配置(纯粹多库)
datasource:
dynamic:
datasource:
hengxingaoketes:
driver-class-name: com.mysql.cj.jdbc.Driver
password: JsTt6iTpkZ85wDnF
url: jdbc:mysql://127.0.0.1:3306/hengxingaoke_tes?allowPublicKeyRetrieval=true&uuseUnicode=true&characterEncoding=utf8&useSSL=false&serverTimezone=Asia/Shanghai&tinyInt1isBit=false
#url: jdbc:mysql://127.0.0.1:3306/hengxingaoke_tes?allowPublicKeyRetrieval=true&uuseUnicode=true&characterEncoding=utf8&useSSL=false&serverTimezone=Asia/Shanghai&tinyInt1isBit=false
#url: jdbc:mysql://172.20.2.87:3306/hengxingaoke_tes?allowPublicKeyRetrieval=true&uuseUnicode=true&characterEncoding=utf8&useSSL=false&serverTimezone=Asia/Shanghai&tinyInt1isBit=false
username: hengxingaoke_tes
#hrnew:
#driver-class-name: com.mysql.cj.jdbc.Driver
#password: AnknKiXiXaxNrw78
#url: jdbc:mysql://120.224.6.6:6666/hr_new?allowPublicKeyRetrieval=true&uuseUnicode=true&characterEncoding=utf8&useSSL=false&serverTimezone=Asia/Shanghai&tinyInt1isBit=false
#username: hr_new
hrnew:
driver-class-name: com.mysql.cj.jdbc.Driver
password: kPMP6NafMsdccxDX
#url: jdbc:mysql://127.0.0.1:3306/hengxingaoke_tes?allowPublicKeyRetrieval=true&uuseUnicode=true&characterEncoding=utf8&useSSL=false&serverTimezone=Asia/Shanghai&tinyInt1isBit=false
url: jdbc:mysql://127.0.0.1:3306/hr_new?allowPublicKeyRetrieval=true&uuseUnicode=true&characterEncoding=utf8&useSSL=false&serverTimezone=Asia/Shanghai&tinyInt1isBit=false
username: hr_new
leaguetabledata:
driver-class-name: com.mysql.cj.jdbc.Driver
password: e0eb142add
url: jdbc:mysql://120.224.6.6:16666/league_table_data?allowPublicKeyRetrieval=true&uuseUnicode=true&characterEncoding=utf8&useSSL=false&serverTimezone=Asia/Shanghai&tinyInt1isBit=false
#url: jdbc:mysql://172.20.2.87:3306/league_table_data?allowPublicKeyRetrieval=true&uuseUnicode=true&characterEncoding=utf8&useSSL=false&serverTimezone=Asia/Shanghai&tinyInt1isBit=false
username: league_table_data
learnmessage:
driver-class-name: com.mysql.cj.jdbc.Driver
password: 3bdd844687
#url: jdbc:mysql://127.0.0.1:3306/learn_message?allowPublicKeyRetrieval=true&uuseUnicode=true&characterEncoding=utf8&useSSL=false&serverTimezone=Asia/Shanghai&tinyInt1isBit=false
url: jdbc:mysql://120.224.6.6:16666/learn_message?allowPublicKeyRetrieval=true&uuseUnicode=true&characterEncoding=utf8&useSSL=false&serverTimezone=Asia/Shanghai&tinyInt1isBit=false
username: learn_message
quesandanswers:
driver-class-name: com.mysql.cj.jdbc.Driver
password: c8caf5d256
url: jdbc:mysql://120.224.6.6:16666/ques_and_answers?allowPublicKeyRetrieval=true&uuseUnicode=true&characterEncoding=utf8&useSSL=false&serverTimezone=Asia/Shanghai&tinyInt1isBit=false
#url: jdbc:mysql://172.20.2.87:3306/ques_and_answers?allowPublicKeyRetrieval=true&uuseUnicode=true&characterEncoding=utf8&useSSL=false&serverTimezone=Asia/Shanghai&tinyInt1isBit=false
username: ques_and_answers
readdocument:
driver-class-name: com.mysql.cj.jdbc.Driver
password: CY2yanCmAP8p8bxj
url: jdbc:mysql://127.0.0.1:3306/readdocument?allowPublicKeyRetrieval=true&uuseUnicode=true&characterEncoding=utf8&useSSL=false&serverTimezone=Asia/Shanghai&tinyInt1isBit=false
#url: jdbc:mysql://172.20.2.87:3306/readdocument?allowPublicKeyRetrieval=true&uuseUnicode=true&characterEncoding=utf8&useSSL=false&serverTimezone=Asia/Shanghai&tinyInt1isBit=false
username: readdocument
selftestdatabase:
driver-class-name: com.mysql.cj.jdbc.Driver
password: 6755319456
url: jdbc:mysql://120.224.6.6:16666/selftestdatabase?allowPublicKeyRetrieval=true&uuseUnicode=true&characterEncoding=utf8&useSSL=false&serverTimezone=Asia/Shanghai&tinyInt1isBit=false
#url: jdbc:mysql://172.20.2.87:3306/selftestdatabase?allowPublicKeyRetrieval=true&uuseUnicode=true&characterEncoding=utf8&useSSL=false&serverTimezone=Asia/Shanghai&tinyInt1isBit=false
username: selftestdatabase
statisticsing:
driver-class-name: com.mysql.cj.jdbc.Driver
password: 19c66cdb65
url: jdbc:mysql://120.224.6.6:16666/statisticsing?allowPublicKeyRetrieval=true&uuseUnicode=true&characterEncoding=utf8&useSSL=false&serverTimezone=Asia/Shanghai&tinyInt1isBit=false
#url: jdbc:mysql://172.20.2.87:3306/statisticsing?allowPublicKeyRetrieval=true&uuseUnicode=true&characterEncoding=utf8&useSSL=false&serverTimezone=Asia/Shanghai&tinyInt1isBit=false
username: statisticsing
wrongquestionbank:
driver-class-name: com.mysql.cj.jdbc.Driver
password: 7f7ac6c8f5
url: jdbc:mysql://120.224.6.6:16666/wrong_question_bank?allowPublicKeyRetrieval=true&uuseUnicode=true&characterEncoding=utf8&useSSL=false&serverTimezone=Asia/Shanghai&tinyInt1isBit=false
#url: jdbc:mysql://172.20.2.87:3306/wrong_question_bank?allowPublicKeyRetrieval=true&uuseUnicode=true&characterEncoding=utf8&useSSL=false&serverTimezone=Asia/Shanghai&tinyInt1isBit=false
username: wrong_question_bank
#数据源基础配置
druid:
# 通过connectProperties属性来打开mergeSql功能;慢SQL记录
connectionProperties: druid.stat.mergeSql=true;druid.stat.slowSqlMillis=5000
# 配置监控统计拦截的filters,去掉后监控界面sql无法统计,'wall'用于防火墙
filters: stat,wall
initial-size: 5
max-active: 20
#指定每个连接上PSCache的大小
max-pool-prepared-statement-per-connection-size: 20
# 配置获取连接等待超时的时间
max-wait: 6000
# 配置一个连接在池中最小生存的时间,单位是毫秒
min-evictable-idle-time-millis: 300000
min-idle: 5
# 打开PSCache
pool-prepared-statements: true
test-on-borrow: false
test-on-return: false
test-while-idle: true
# 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒
time-between-eviction-runs-millis: 60000
validation-query: 'SELECT 1 FROM DUAL '
#指定默认数据源(必须配置)
primary: hengxingaoketes
#设置严格模式,默认false不启动. 启动后在未匹配到指定数据源时候回抛出异常,不启动会使用默认数据源.
strict: false
redis:
database: 5
host: 127.0.0.1
lettuce:
pool:
max-active: 10
max-idle: 10
max-wait: -1ms
min-idle: 0
port: 6379
timeout: 10000

2
src/main/resources/application.yml

@ -1,5 +1,5 @@
spring:
profiles:
active: dev
active: prodout
server:
port: 8111

14
src/main/resources/mapper/LowCodeTransferMapper.xml

@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.hxgk.zxxy.mapper.LowCodeTransferMapper">
<select id="getCarList" resultType="Car">
select * from car
</select>
</mapper>

6
src/main/resources/mapper/UserMapper.xml

@ -9,4 +9,10 @@
</select>
<select id="getManContListByAdminOrg" resultType="OrgAndManTree">
select number as id,admin_org as parentId,name as label from man_cont where admin_org=#{adminOrg}
</select>
</mapper>
Loading…
Cancel
Save