添加支持mysql数据库
This commit is contained in:
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -24,6 +24,7 @@ import io.datafx.controller.flow.container.ContainerAnimations;
|
||||
import io.datafx.controller.flow.context.ActionHandler;
|
||||
import io.datafx.controller.flow.context.FlowActionHandler;
|
||||
import io.datafx.controller.util.VetoException;
|
||||
import io.datafx.core.concurrent.ProcessChain;
|
||||
import io.datafx.eventsystem.Event;
|
||||
import io.datafx.eventsystem.EventProducer;
|
||||
import io.datafx.eventsystem.EventTrigger;
|
||||
@@ -374,17 +375,20 @@ public class MainController {
|
||||
|
||||
@ActionMethod("showSkinPane")
|
||||
private void showSkinPane() throws VetoException, FlowException {
|
||||
String style1 = AppStartup.class.getResource("/css/app-light.css").toExternalForm();
|
||||
String style2 = AppStartup.class.getResource("/css/app-dark.css").toExternalForm();
|
||||
if (styleBut.isSelected()) {
|
||||
styleBut.setText("明亮");
|
||||
styleBut.getScene().getStylesheets().removeAll(style1);
|
||||
styleBut.getScene().getStylesheets().addAll(style2);
|
||||
} else {
|
||||
styleBut.setText("黑暗");
|
||||
styleBut.getScene().getStylesheets().removeAll(style2);
|
||||
styleBut.getScene().getStylesheets().addAll(style1);
|
||||
}
|
||||
ProcessChain.create().addRunnableInPlatformThread(() -> {
|
||||
String style1 = AppStartup.class.getResource("/css/app-light.css").toExternalForm();
|
||||
String style2 = AppStartup.class.getResource("/css/app-dark.css").toExternalForm();
|
||||
if (styleBut.isSelected()) {
|
||||
styleBut.setText("明亮");
|
||||
styleBut.getScene().getStylesheets().removeAll(style1);
|
||||
styleBut.getScene().getStylesheets().addAll(style2);
|
||||
} else {
|
||||
styleBut.setText("黑暗");
|
||||
styleBut.getScene().getStylesheets().removeAll(style2);
|
||||
styleBut.getScene().getStylesheets().addAll(style1);
|
||||
}
|
||||
}).run();
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ sample-client.ribbon.ConnectTimeout = 60000
|
||||
sample-client.ribbon.ReadTimeout = 60000
|
||||
|
||||
#初始服务器列表,可以在运行时通过Archaius动态属性进行更改
|
||||
sample-client.ribbon.listOfServers =10.211.55.3:8080,10.211.55.3:9080
|
||||
sample-client.ribbon.listOfServers =localhost:8080,localhost:9080
|
||||
|
||||
|
||||
#启用主要连接
|
||||
|
||||
@@ -30,6 +30,7 @@ dependencies {
|
||||
compile 'joda-time:joda-time:2.10.1'
|
||||
implementation 'org.mybatis.spring.boot:mybatis-spring-boot-starter:2.1.3'
|
||||
implementation 'com.github.pagehelper:pagehelper-spring-boot-starter:1.2.5'
|
||||
implementation 'mysql:mysql-connector-java:8.0.20'
|
||||
compileOnly 'org.projectlombok:lombok'
|
||||
annotationProcessor 'org.projectlombok:lombok'
|
||||
testImplementation('org.springframework.boot:spring-boot-starter-test') {
|
||||
@@ -39,7 +40,6 @@ dependencies {
|
||||
implementation 'org.apache.commons:commons-lang3:3.4'
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
test {
|
||||
|
||||
486
server/sql/mysql/mysql_db_init.sql
Normal file
486
server/sql/mysql/mysql_db_init.sql
Normal file
File diff suppressed because one or more lines are too long
49
server/src/main/resources/application-dm.yml
Normal file
49
server/src/main/resources/application-dm.yml
Normal file
@@ -0,0 +1,49 @@
|
||||
server:
|
||||
port: 8080
|
||||
spring:
|
||||
datasource:
|
||||
# 使用druid数据源
|
||||
type: com.alibaba.druid.pool.DruidDataSource
|
||||
druid:
|
||||
#url: jdbc:dm://10.105.73.121:12345/EMSHIS
|
||||
url: jdbc:dm://192.168.1.210:12345/EMSHIS
|
||||
username: IPSM_DBA
|
||||
password: IPSM_DBA
|
||||
driver-class-name: dm.jdbc.driver.DmDriver
|
||||
# 连接池的配置信息
|
||||
# 初始化大小,最小,最大
|
||||
initial-size: 5
|
||||
min-idle: 5
|
||||
maxActive: 20
|
||||
# 配置获取连接等待超时的时间
|
||||
maxWait: 60000
|
||||
# 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒
|
||||
timeBetweenEvictionRunsMillis: 60000
|
||||
# 配置一个连接在池中最小生存的时间,单位是毫秒
|
||||
minEvictableIdleTimeMillis: 300000
|
||||
validationQuery: SELECT 1
|
||||
testWhileIdle: true
|
||||
testOnBorrow: false
|
||||
testOnReturn: false
|
||||
# 打开PSCache,并且指定每个连接上PSCache的大小
|
||||
poolPreparedStatements: true
|
||||
maxPoolPreparedStatementPerConnectionSize: 20
|
||||
# 配置监控统计拦截的filters,去掉后监控界面sql无法统计,'wall'用于防火墙
|
||||
filters: stat
|
||||
# 通过connectProperties属性来打开mergeSql功能;慢SQL记录
|
||||
connectionProperties: druid.stat.mergeSql\=true;druid.stat.slowSqlMillis\=5000
|
||||
|
||||
mybatis:
|
||||
basepackage: com.wlkj.ipsm.realtime.mapper
|
||||
xmlLocation: classpath:mapper/**/*.xml
|
||||
mapper-locations: "classpath*:mapper/*.xml"
|
||||
|
||||
#分页控件配置
|
||||
pagehelper:
|
||||
helper-dialect: dm
|
||||
reasonable: true
|
||||
support-methods-arguments: true
|
||||
params: countSql
|
||||
|
||||
|
||||
|
||||
50
server/src/main/resources/application-mysql.yml
Normal file
50
server/src/main/resources/application-mysql.yml
Normal file
@@ -0,0 +1,50 @@
|
||||
server:
|
||||
port: 8080
|
||||
spring:
|
||||
datasource:
|
||||
# 使用druid数据源
|
||||
type: com.alibaba.druid.pool.DruidDataSource
|
||||
druid:
|
||||
#url: jdbc:dm://10.105.73.121:12345/EMSHIS
|
||||
# url: jdbc:dm://192.168.1.210:12345/EMSHIS
|
||||
url: jdbc:mysql://${MYSQL_HOST:10.211.55.9}:${MYSQL_PORT:3306}/ipsm_dba?useUnicode=true&characterEncoding=UTF8
|
||||
username: root
|
||||
password: Root@123456
|
||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||
# 连接池的配置信息
|
||||
# 初始化大小,最小,最大
|
||||
initial-size: 5
|
||||
min-idle: 5
|
||||
maxActive: 20
|
||||
# 配置获取连接等待超时的时间
|
||||
maxWait: 60000
|
||||
# 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒
|
||||
timeBetweenEvictionRunsMillis: 60000
|
||||
# 配置一个连接在池中最小生存的时间,单位是毫秒
|
||||
minEvictableIdleTimeMillis: 300000
|
||||
validationQuery: SELECT "x"
|
||||
testWhileIdle: true
|
||||
testOnBorrow: false
|
||||
testOnReturn: false
|
||||
# 打开PSCache,并且指定每个连接上PSCache的大小
|
||||
poolPreparedStatements: true
|
||||
maxPoolPreparedStatementPerConnectionSize: 20
|
||||
# 配置监控统计拦截的filters,去掉后监控界面sql无法统计,'wall'用于防火墙
|
||||
filters: stat
|
||||
# 通过connectProperties属性来打开mergeSql功能;慢SQL记录
|
||||
connectionProperties: druid.stat.mergeSql\=true;druid.stat.slowSqlMillis\=5000
|
||||
|
||||
mybatis:
|
||||
basepackage: com.wlkj.ipsm.realtime.mapper
|
||||
xmlLocation: classpath:mapper/**/*.xml
|
||||
mapper-locations: "classpath*:mapper/*.xml"
|
||||
|
||||
#分页控件配置
|
||||
pagehelper:
|
||||
helper-dialect: mysql
|
||||
reasonable: true
|
||||
support-methods-arguments: true
|
||||
params: countSql
|
||||
|
||||
|
||||
|
||||
@@ -1,50 +1,6 @@
|
||||
server:
|
||||
port: 8080
|
||||
spring:
|
||||
datasource:
|
||||
# 使用druid数据源
|
||||
type: com.alibaba.druid.pool.DruidDataSource
|
||||
druid:
|
||||
#url: jdbc:dm://10.105.73.121:12345/EMSHIS
|
||||
url: jdbc:dm://192.168.1.210:12345/EMSHIS
|
||||
username: IPSM_DBA
|
||||
password: IPSM_DBA
|
||||
driver-class-name: dm.jdbc.driver.DmDriver
|
||||
# 连接池的配置信息
|
||||
# 初始化大小,最小,最大
|
||||
initial-size: 5
|
||||
min-idle: 5
|
||||
maxActive: 20
|
||||
# 配置获取连接等待超时的时间
|
||||
maxWait: 60000
|
||||
# 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒
|
||||
timeBetweenEvictionRunsMillis: 60000
|
||||
# 配置一个连接在池中最小生存的时间,单位是毫秒
|
||||
minEvictableIdleTimeMillis: 300000
|
||||
validationQuery: SELECT 1
|
||||
testWhileIdle: true
|
||||
testOnBorrow: false
|
||||
testOnReturn: false
|
||||
# 打开PSCache,并且指定每个连接上PSCache的大小
|
||||
poolPreparedStatements: true
|
||||
maxPoolPreparedStatementPerConnectionSize: 20
|
||||
# 配置监控统计拦截的filters,去掉后监控界面sql无法统计,'wall'用于防火墙
|
||||
filters: stat
|
||||
# 通过connectProperties属性来打开mergeSql功能;慢SQL记录
|
||||
connectionProperties: druid.stat.mergeSql\=true;druid.stat.slowSqlMillis\=5000
|
||||
|
||||
mybatis:
|
||||
basepackage: com.wlkj.ipsm.realtime.mapper
|
||||
xmlLocation: classpath:mapper/**/*.xml
|
||||
mapper-locations: "classpath*:mapper/*.xml"
|
||||
|
||||
#分页控件配置
|
||||
pagehelper:
|
||||
helper-dialect: dm
|
||||
reasonable: true
|
||||
support-methods-arguments: true
|
||||
params: countSql
|
||||
|
||||
profiles:
|
||||
active: mysql
|
||||
#日志输出
|
||||
logging:
|
||||
level:
|
||||
@@ -57,5 +13,4 @@ jwt:
|
||||
|
||||
auth:
|
||||
user:
|
||||
token-header: Authorization
|
||||
|
||||
token-header: Authorization
|
||||
@@ -2,34 +2,34 @@
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.epri.fx.server.mapper.RsaKeyMapper">
|
||||
<resultMap id="BaseResultMap" type="com.epri.fx.server.entity.RsaKey">
|
||||
<id column="KEY" jdbcType="VARCHAR" property="key" />
|
||||
<result column="VALUE" jdbcType="VARCHAR" property="value" />
|
||||
<id column="RSA_KEY" jdbcType="VARCHAR" property="key" />
|
||||
<result column="KEY_VALUE" jdbcType="VARCHAR" property="value" />
|
||||
</resultMap>
|
||||
<sql id="Base_Column_List">
|
||||
KEY, VALUE
|
||||
RSA_KEY, KEY_VALUE
|
||||
</sql>
|
||||
<select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
|
||||
select
|
||||
<include refid="Base_Column_List" />
|
||||
from rsa_key
|
||||
where KEY = #{key,jdbcType=VARCHAR}
|
||||
from base_rsa_key
|
||||
where RSA_KEY = #{key,jdbcType=VARCHAR}
|
||||
</select>
|
||||
<delete id="deleteByPrimaryKey" parameterType="java.lang.String">
|
||||
delete from rsa_key
|
||||
where KEY = #{key,jdbcType=VARCHAR}
|
||||
delete from base_rsa_key
|
||||
where RSA_KEY = #{key,jdbcType=VARCHAR}
|
||||
</delete>
|
||||
<insert id="insert" parameterType="com.epri.fx.server.entity.RsaKey">
|
||||
insert into rsa_key (KEY, VALUE)
|
||||
insert into base_rsa_key (RSA_KEY, KEY_VALUE)
|
||||
values (#{key,jdbcType=VARCHAR}, #{value,jdbcType=VARCHAR})
|
||||
</insert>
|
||||
<insert id="insertSelective" parameterType="com.epri.fx.server.entity.RsaKey">
|
||||
insert into rsa_key
|
||||
insert into base_rsa_key
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="key != null">
|
||||
KEY,
|
||||
RSA_KEY,
|
||||
</if>
|
||||
<if test="value != null">
|
||||
VALUE,
|
||||
KEY_VALUE,
|
||||
</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
@@ -42,17 +42,17 @@
|
||||
</trim>
|
||||
</insert>
|
||||
<update id="updateByPrimaryKeySelective" parameterType="com.epri.fx.server.entity.RsaKey">
|
||||
update rsa_key
|
||||
update base_rsa_key
|
||||
<set>
|
||||
<if test="value != null">
|
||||
VALUE = #{value,jdbcType=VARCHAR},
|
||||
KEY_VALUE = #{value,jdbcType=VARCHAR},
|
||||
</if>
|
||||
</set>
|
||||
where KEY = #{key,jdbcType=VARCHAR}
|
||||
where RSA_KEY = #{key,jdbcType=VARCHAR}
|
||||
</update>
|
||||
<update id="updateByPrimaryKey" parameterType="com.epri.fx.server.entity.RsaKey">
|
||||
update rsa_key
|
||||
update base_rsa_key
|
||||
set VALUE = #{value,jdbcType=VARCHAR}
|
||||
where KEY = #{key,jdbcType=VARCHAR}
|
||||
where RSA_KEY = #{key,jdbcType=VARCHAR}
|
||||
</update>
|
||||
</mapper>
|
||||
@@ -389,6 +389,7 @@
|
||||
</if>
|
||||
</where>
|
||||
|
||||
|
||||
</select>
|
||||
<select id="selectMemberByGroupId" parameterType="java.lang.Integer" resultMap="BaseResultMap">
|
||||
select u.* from base_user u left join base_group_member gm on gm.user_id = u.id where gm.group_id = #{groupId,jdbcType=INTEGER}
|
||||
|
||||
Reference in New Issue
Block a user