19 changed files with 501 additions and 61 deletions
@ -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); |
||||
|
} |
||||
|
} |
||||
@ -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(); |
||||
|
} |
||||
@ -1,9 +1,14 @@ |
|||||
package com.hxgk.zxxy.mapper; |
package com.hxgk.zxxy.mapper; |
||||
|
|
||||
import com.hxgk.zxxy.model.entity.ManCont; |
import com.hxgk.zxxy.model.entity.ManCont; |
||||
|
import com.hxgk.zxxy.model.entity.OrgAndManTree; |
||||
import org.apache.ibatis.annotations.Param; |
import org.apache.ibatis.annotations.Param; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
public interface UserMapper { |
public interface UserMapper { |
||||
|
|
||||
ManCont getManContByKey(@Param("key") String key); |
ManCont getManContByKey(@Param("key") String key); |
||||
|
|
||||
|
List<OrgAndManTree> getManContListByAdminOrg(@Param("adminOrg")String adminOrg); |
||||
} |
} |
||||
|
|||||
@ -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; |
||||
|
} |
||||
|
} |
||||
@ -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; |
||||
|
} |
||||
|
} |
||||
@ -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(); |
||||
|
} |
||||
@ -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(); |
||||
|
} |
||||
|
} |
||||
@ -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 |
||||
@ -1,5 +1,5 @@ |
|||||
spring: |
spring: |
||||
profiles: |
profiles: |
||||
active: dev |
active: prodout |
||||
server: |
server: |
||||
port: 8111 |
port: 8111 |
||||
@ -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> |
||||
Loading…
Reference in new issue