1. 办公基价作价
This commit is contained in:
parent
645c661478
commit
517f42edf5
@ -354,8 +354,8 @@ export default {
|
||||
return "";
|
||||
},
|
||||
/** 查询办公基价列表 */
|
||||
getList(formName) {
|
||||
this.$refs[formName].validate(valid => {
|
||||
getList() {
|
||||
this.$refs['queryForm'].validate(valid => {
|
||||
if (valid) {
|
||||
this.loading = true;
|
||||
list(this.queryParams).then(response => {
|
||||
@ -381,7 +381,7 @@ export default {
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.pageIndex = 1;
|
||||
this.getList("queryForm");
|
||||
this.getList();
|
||||
},
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
|
@ -64,6 +64,15 @@
|
||||
v-hasPermi="['system:user:import']"
|
||||
>导入</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="success"
|
||||
icon="el-icon-druid"
|
||||
size="mini"
|
||||
@click="handleImport"
|
||||
v-hasPermi="['system:user:import']"
|
||||
>基价变化一览</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="dataList">
|
||||
|
@ -26,7 +26,7 @@
|
||||
<mybatis.spring.boot.starter.version>1.3.2</mybatis.spring.boot.starter.version>
|
||||
<pagehelper.spring.boot.starter.version>1.2.5</pagehelper.spring.boot.starter.version>
|
||||
<fastjson.version>1.2.68</fastjson.version>
|
||||
<druid.version>1.1.14</druid.version>
|
||||
<!-- <druid.version>1.1.14</druid.version>-->
|
||||
<commons.io.version>2.5</commons.io.version>
|
||||
<commons.fileupload.version>1.3.3</commons.fileupload.version>
|
||||
<bitwalker.version>1.19</bitwalker.version>
|
||||
@ -99,6 +99,7 @@
|
||||
<groupId>com.microsoft.sqlserver</groupId>
|
||||
<artifactId>mssql-jdbc</artifactId>
|
||||
<scope>runtime</scope>
|
||||
<version>7.4.0.jre8</version>
|
||||
</dependency>
|
||||
|
||||
<!-- SpringBoot集成mybatis框架 -->
|
||||
@ -116,11 +117,11 @@
|
||||
</dependency>
|
||||
|
||||
<!--阿里数据库连接池 -->
|
||||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>druid-spring-boot-starter</artifactId>
|
||||
<version>${druid.version}</version>
|
||||
</dependency>
|
||||
<!-- <dependency>-->
|
||||
<!-- <groupId>com.alibaba</groupId>-->
|
||||
<!-- <artifactId>druid-spring-boot-starter</artifactId>-->
|
||||
<!-- <version>${druid.version}</version>-->
|
||||
<!-- </dependency>-->
|
||||
|
||||
<!--常用工具类 -->
|
||||
<dependency>
|
||||
|
@ -1,6 +1,6 @@
|
||||
package com.ruoyi;
|
||||
|
||||
import com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceAutoConfigure;
|
||||
//import com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceAutoConfigure;
|
||||
import com.github.pagehelper.autoconfigure.PageHelperAutoConfiguration;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
@ -11,7 +11,8 @@ import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
@SpringBootApplication(exclude = {DataSourceAutoConfiguration.class, DruidDataSourceAutoConfigure.class,
|
||||
@SpringBootApplication(exclude = {DataSourceAutoConfiguration.class,
|
||||
// DruidDataSourceAutoConfigure.class,
|
||||
PageHelperAutoConfiguration.class})
|
||||
public class RuoYiApplication {
|
||||
public static void main(String[] args) {
|
||||
|
@ -1,125 +1,125 @@
|
||||
package com.ruoyi.framework.config;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import javax.servlet.Filter;
|
||||
import javax.servlet.FilterChain;
|
||||
import javax.servlet.ServletException;
|
||||
import javax.servlet.ServletRequest;
|
||||
import javax.servlet.ServletResponse;
|
||||
import javax.sql.DataSource;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
import org.springframework.boot.web.servlet.FilterRegistrationBean;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.context.annotation.Primary;
|
||||
import com.alibaba.druid.pool.DruidDataSource;
|
||||
import com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceBuilder;
|
||||
import com.alibaba.druid.spring.boot.autoconfigure.properties.DruidStatProperties;
|
||||
import com.alibaba.druid.util.Utils;
|
||||
import com.ruoyi.common.utils.spring.SpringUtils;
|
||||
import com.ruoyi.framework.aspectj.lang.enums.DataSourceType;
|
||||
import com.ruoyi.framework.datasource.DynamicDataSource;
|
||||
|
||||
/**
|
||||
* druid 配置多数据源
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
@Configuration
|
||||
public class DruidConfig
|
||||
{
|
||||
// @Bean
|
||||
// @ConfigurationProperties("spring.datasource.druid.master")
|
||||
// public DataSource masterDataSource(DruidProperties druidProperties)
|
||||
// {
|
||||
// DruidDataSource dataSource = DruidDataSourceBuilder.create().build();
|
||||
// return druidProperties.dataSource(dataSource);
|
||||
// }
|
||||
//package com.ruoyi.framework.config;
|
||||
//
|
||||
// @Bean
|
||||
// @ConfigurationProperties("spring.datasource.druid.slave")
|
||||
// @ConditionalOnProperty(prefix = "spring.datasource.druid.slave", name = "enabled", havingValue = "true")
|
||||
// public DataSource slaveDataSource(DruidProperties druidProperties)
|
||||
// {
|
||||
// DruidDataSource dataSource = DruidDataSourceBuilder.create().build();
|
||||
// return druidProperties.dataSource(dataSource);
|
||||
// }
|
||||
//import java.io.IOException;
|
||||
//import java.util.HashMap;
|
||||
//import java.util.Map;
|
||||
//import javax.servlet.Filter;
|
||||
//import javax.servlet.FilterChain;
|
||||
//import javax.servlet.ServletException;
|
||||
//import javax.servlet.ServletRequest;
|
||||
//import javax.servlet.ServletResponse;
|
||||
//import javax.sql.DataSource;
|
||||
//import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
||||
//import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
//import org.springframework.boot.web.servlet.FilterRegistrationBean;
|
||||
//import org.springframework.context.annotation.Bean;
|
||||
//import org.springframework.context.annotation.Configuration;
|
||||
//import org.springframework.context.annotation.Primary;
|
||||
//import com.alibaba.druid.pool.DruidDataSource;
|
||||
//import com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceBuilder;
|
||||
//import com.alibaba.druid.spring.boot.autoconfigure.properties.DruidStatProperties;
|
||||
//import com.alibaba.druid.util.Utils;
|
||||
//import com.ruoyi.common.utils.spring.SpringUtils;
|
||||
//import com.ruoyi.framework.aspectj.lang.enums.DataSourceType;
|
||||
//import com.ruoyi.framework.datasource.DynamicDataSource;
|
||||
//
|
||||
// @Bean(name = "dynamicDataSource")
|
||||
// @Primary
|
||||
// public DynamicDataSource dataSource(DataSource masterDataSource)
|
||||
// {
|
||||
// Map<Object, Object> targetDataSources = new HashMap<>();
|
||||
// targetDataSources.put(DataSourceType.MASTER.name(), masterDataSource);
|
||||
// setDataSource(targetDataSources, DataSourceType.SLAVE.name(), "slaveDataSource");
|
||||
// return new DynamicDataSource(masterDataSource, targetDataSources);
|
||||
// }
|
||||
///**
|
||||
// * druid 配置多数据源
|
||||
// *
|
||||
// * @author ruoyi
|
||||
// */
|
||||
//@Configuration
|
||||
//public class DruidConfig
|
||||
//{
|
||||
//// @Bean
|
||||
//// @ConfigurationProperties("spring.datasource.druid.master")
|
||||
//// public DataSource masterDataSource(DruidProperties druidProperties)
|
||||
//// {
|
||||
//// DruidDataSource dataSource = DruidDataSourceBuilder.create().build();
|
||||
//// return druidProperties.dataSource(dataSource);
|
||||
//// }
|
||||
////
|
||||
//// @Bean
|
||||
//// @ConfigurationProperties("spring.datasource.druid.slave")
|
||||
//// @ConditionalOnProperty(prefix = "spring.datasource.druid.slave", name = "enabled", havingValue = "true")
|
||||
//// public DataSource slaveDataSource(DruidProperties druidProperties)
|
||||
//// {
|
||||
//// DruidDataSource dataSource = DruidDataSourceBuilder.create().build();
|
||||
//// return druidProperties.dataSource(dataSource);
|
||||
//// }
|
||||
////
|
||||
//// @Bean(name = "dynamicDataSource")
|
||||
//// @Primary
|
||||
//// public DynamicDataSource dataSource(DataSource masterDataSource)
|
||||
//// {
|
||||
//// Map<Object, Object> targetDataSources = new HashMap<>();
|
||||
//// targetDataSources.put(DataSourceType.MASTER.name(), masterDataSource);
|
||||
//// setDataSource(targetDataSources, DataSourceType.SLAVE.name(), "slaveDataSource");
|
||||
//// return new DynamicDataSource(masterDataSource, targetDataSources);
|
||||
//// }
|
||||
////
|
||||
//// /**
|
||||
//// * 设置数据源
|
||||
//// *
|
||||
//// * @param targetDataSources 备选数据源集合
|
||||
//// * @param sourceName 数据源名称
|
||||
//// * @param beanName bean名称
|
||||
//// */
|
||||
//// public void setDataSource(Map<Object, Object> targetDataSources, String sourceName, String beanName)
|
||||
//// {
|
||||
//// try
|
||||
//// {
|
||||
//// DataSource dataSource = SpringUtils.getBean(beanName);
|
||||
//// targetDataSources.put(sourceName, dataSource);
|
||||
//// }
|
||||
//// catch (Exception e)
|
||||
//// {
|
||||
//// }
|
||||
//// }
|
||||
//
|
||||
// /**
|
||||
// * 设置数据源
|
||||
// *
|
||||
// * @param targetDataSources 备选数据源集合
|
||||
// * @param sourceName 数据源名称
|
||||
// * @param beanName bean名称
|
||||
// * 去除监控页面底部的广告
|
||||
// */
|
||||
// public void setDataSource(Map<Object, Object> targetDataSources, String sourceName, String beanName)
|
||||
// @SuppressWarnings({ "rawtypes", "unchecked" })
|
||||
// @Bean
|
||||
// @ConditionalOnProperty(name = "spring.datasource.druid.statViewServlet.enabled", havingValue = "true")
|
||||
// public FilterRegistrationBean removeDruidFilterRegistrationBean(DruidStatProperties properties)
|
||||
// {
|
||||
// try
|
||||
// // 获取web监控页面的参数
|
||||
// DruidStatProperties.StatViewServlet config = properties.getStatViewServlet();
|
||||
// // 提取common.js的配置路径
|
||||
// String pattern = config.getUrlPattern() != null ? config.getUrlPattern() : "/druid/*";
|
||||
// String commonJsPattern = pattern.replaceAll("\\*", "js/common.js");
|
||||
// final String filePath = "support/http/resources/js/common.js";
|
||||
// // 创建filter进行过滤
|
||||
// Filter filter = new Filter()
|
||||
// {
|
||||
// DataSource dataSource = SpringUtils.getBean(beanName);
|
||||
// targetDataSources.put(sourceName, dataSource);
|
||||
// }
|
||||
// catch (Exception e)
|
||||
// {
|
||||
// }
|
||||
// @Override
|
||||
// public void init(javax.servlet.FilterConfig filterConfig) throws ServletException
|
||||
// {
|
||||
// }
|
||||
// @Override
|
||||
// public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain)
|
||||
// throws IOException, ServletException
|
||||
// {
|
||||
// chain.doFilter(request, response);
|
||||
// // 重置缓冲区,响应头不会被重置
|
||||
// response.resetBuffer();
|
||||
// // 获取common.js
|
||||
// String text = Utils.readFromResource(filePath);
|
||||
// // 正则替换banner, 除去底部的广告信息
|
||||
// text = text.replaceAll("<a.*?banner\"></a><br/>", "");
|
||||
// text = text.replaceAll("powered.*?shrek.wang</a>", "");
|
||||
// response.getWriter().write(text);
|
||||
// }
|
||||
// @Override
|
||||
// public void destroy()
|
||||
// {
|
||||
// }
|
||||
// };
|
||||
// FilterRegistrationBean registrationBean = new FilterRegistrationBean();
|
||||
// registrationBean.setFilter(filter);
|
||||
// registrationBean.addUrlPatterns(commonJsPattern);
|
||||
// return registrationBean;
|
||||
// }
|
||||
|
||||
/**
|
||||
* 去除监控页面底部的广告
|
||||
*/
|
||||
@SuppressWarnings({ "rawtypes", "unchecked" })
|
||||
@Bean
|
||||
@ConditionalOnProperty(name = "spring.datasource.druid.statViewServlet.enabled", havingValue = "true")
|
||||
public FilterRegistrationBean removeDruidFilterRegistrationBean(DruidStatProperties properties)
|
||||
{
|
||||
// 获取web监控页面的参数
|
||||
DruidStatProperties.StatViewServlet config = properties.getStatViewServlet();
|
||||
// 提取common.js的配置路径
|
||||
String pattern = config.getUrlPattern() != null ? config.getUrlPattern() : "/druid/*";
|
||||
String commonJsPattern = pattern.replaceAll("\\*", "js/common.js");
|
||||
final String filePath = "support/http/resources/js/common.js";
|
||||
// 创建filter进行过滤
|
||||
Filter filter = new Filter()
|
||||
{
|
||||
@Override
|
||||
public void init(javax.servlet.FilterConfig filterConfig) throws ServletException
|
||||
{
|
||||
}
|
||||
@Override
|
||||
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain)
|
||||
throws IOException, ServletException
|
||||
{
|
||||
chain.doFilter(request, response);
|
||||
// 重置缓冲区,响应头不会被重置
|
||||
response.resetBuffer();
|
||||
// 获取common.js
|
||||
String text = Utils.readFromResource(filePath);
|
||||
// 正则替换banner, 除去底部的广告信息
|
||||
text = text.replaceAll("<a.*?banner\"></a><br/>", "");
|
||||
text = text.replaceAll("powered.*?shrek.wang</a>", "");
|
||||
response.getWriter().write(text);
|
||||
}
|
||||
@Override
|
||||
public void destroy()
|
||||
{
|
||||
}
|
||||
};
|
||||
FilterRegistrationBean registrationBean = new FilterRegistrationBean();
|
||||
registrationBean.setFilter(filter);
|
||||
registrationBean.addUrlPatterns(commonJsPattern);
|
||||
return registrationBean;
|
||||
}
|
||||
}
|
||||
//}
|
||||
|
@ -0,0 +1,131 @@
|
||||
package com.ruoyi.framework.config;
|
||||
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import javax.servlet.Filter;
|
||||
import javax.servlet.FilterChain;
|
||||
import javax.servlet.ServletException;
|
||||
import javax.servlet.ServletRequest;
|
||||
import javax.servlet.ServletResponse;
|
||||
import javax.sql.DataSource;
|
||||
|
||||
import com.zaxxer.hikari.HikariConfig;
|
||||
import com.zaxxer.hikari.HikariDataSource;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
import org.springframework.boot.web.servlet.FilterRegistrationBean;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.context.annotation.Primary;
|
||||
//import com.alibaba.druid.pool.DruidDataSource;
|
||||
//import com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceBuilder;
|
||||
//import com.alibaba.druid.spring.boot.autoconfigure.properties.DruidStatProperties;
|
||||
//import com.alibaba.druid.util.Utils;
|
||||
import com.ruoyi.common.utils.spring.SpringUtils;
|
||||
import com.ruoyi.framework.aspectj.lang.enums.DataSourceType;
|
||||
import com.ruoyi.framework.datasource.DynamicDataSource;
|
||||
|
||||
/**
|
||||
* druid 配置多数据源
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
@Configuration
|
||||
public class HikariCPConfig {
|
||||
// @Bean
|
||||
// @ConfigurationProperties("spring.datasource.druid.master")
|
||||
// public DataSource masterDataSource(HikariConfig hikariConfig) {
|
||||
// HikariDataSource hikariDataSource = new HikariDataSource(hikariConfig);
|
||||
//
|
||||
// return hikariDataSource;
|
||||
//
|
||||
//// DruidDataSource dataSource = DruidDataSourceBuilder.create().build();
|
||||
//// return druidProperties.dataSource(dataSource);
|
||||
// }
|
||||
//
|
||||
// @Bean
|
||||
// @ConfigurationProperties("spring.datasource.druid.slave")
|
||||
// @ConditionalOnProperty(prefix = "spring.datasource.druid.slave", name = "enabled", havingValue = "true")
|
||||
// public DataSource slaveDataSource(DruidProperties druidProperties)
|
||||
// {
|
||||
// DruidDataSource dataSource = DruidDataSourceBuilder.create().build();
|
||||
// return druidProperties.dataSource(dataSource);
|
||||
// }
|
||||
//
|
||||
// @Bean(name = "dynamicDataSource")
|
||||
// @Primary
|
||||
// public DynamicDataSource dataSource(DataSource masterDataSource)
|
||||
// {
|
||||
// Map<Object, Object> targetDataSources = new HashMap<>();
|
||||
// targetDataSources.put(DataSourceType.MASTER.name(), masterDataSource);
|
||||
// setDataSource(targetDataSources, DataSourceType.SLAVE.name(), "slaveDataSource");
|
||||
// return new DynamicDataSource(masterDataSource, targetDataSources);
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 设置数据源
|
||||
// *
|
||||
// * @param targetDataSources 备选数据源集合
|
||||
// * @param sourceName 数据源名称
|
||||
// * @param beanName bean名称
|
||||
// */
|
||||
// public void setDataSource(Map<Object, Object> targetDataSources, String sourceName, String beanName)
|
||||
// {
|
||||
// try
|
||||
// {
|
||||
// DataSource dataSource = SpringUtils.getBean(beanName);
|
||||
// targetDataSources.put(sourceName, dataSource);
|
||||
// }
|
||||
// catch (Exception e)
|
||||
// {
|
||||
// }
|
||||
// }
|
||||
|
||||
/**
|
||||
* 去除监控页面底部的广告
|
||||
*/
|
||||
// @SuppressWarnings({ "rawtypes", "unchecked" })
|
||||
// @Bean
|
||||
// @ConditionalOnProperty(name = "spring.datasource.druid.statViewServlet.enabled", havingValue = "true")
|
||||
// public FilterRegistrationBean removeDruidFilterRegistrationBean(DruidStatProperties properties)
|
||||
// {
|
||||
// // 获取web监控页面的参数
|
||||
// DruidStatProperties.StatViewServlet config = properties.getStatViewServlet();
|
||||
// // 提取common.js的配置路径
|
||||
// String pattern = config.getUrlPattern() != null ? config.getUrlPattern() : "/druid/*";
|
||||
// String commonJsPattern = pattern.replaceAll("\\*", "js/common.js");
|
||||
// final String filePath = "support/http/resources/js/common.js";
|
||||
// // 创建filter进行过滤
|
||||
// Filter filter = new Filter()
|
||||
// {
|
||||
// @Override
|
||||
// public void init(javax.servlet.FilterConfig filterConfig) throws ServletException
|
||||
// {
|
||||
// }
|
||||
// @Override
|
||||
// public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain)
|
||||
// throws IOException, ServletException
|
||||
// {
|
||||
// chain.doFilter(request, response);
|
||||
// // 重置缓冲区,响应头不会被重置
|
||||
// response.resetBuffer();
|
||||
// // 获取common.js
|
||||
// String text = Utils.readFromResource(filePath);
|
||||
// // 正则替换banner, 除去底部的广告信息
|
||||
// text = text.replaceAll("<a.*?banner\"></a><br/>", "");
|
||||
// text = text.replaceAll("powered.*?shrek.wang</a>", "");
|
||||
// response.getWriter().write(text);
|
||||
// }
|
||||
// @Override
|
||||
// public void destroy()
|
||||
// {
|
||||
// }
|
||||
// };
|
||||
// FilterRegistrationBean registrationBean = new FilterRegistrationBean();
|
||||
// registrationBean.setFilter(filter);
|
||||
// registrationBean.addUrlPatterns(commonJsPattern);
|
||||
// return registrationBean;
|
||||
// }
|
||||
}
|
@ -5,7 +5,6 @@ import java.util.*;
|
||||
|
||||
import com.ruoyi.common.exception.CustomException;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import com.ruoyi.common.utils.file.FileUtils;
|
||||
import com.ruoyi.framework.config.UVConfig;
|
||||
import com.ruoyi.project.common.UVResponse;
|
||||
import com.ruoyi.project.common.VueSelectModel;
|
||||
@ -17,10 +16,7 @@ import com.ruoyi.project.system.service.impl.SysUserServiceImpl;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.jdbc.core.JdbcTemplate;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.web.client.RestTemplate;
|
||||
|
||||
/**
|
||||
|
@ -1,72 +1,108 @@
|
||||
# 数据源配置
|
||||
spring:
|
||||
datasource:
|
||||
druid:
|
||||
statViewServlet:
|
||||
enabled: true
|
||||
# 设置白名单,不填则允许所有访问
|
||||
allow:
|
||||
url-pattern: /druid/*
|
||||
# 控制台管理用户名和密码
|
||||
login-username:
|
||||
login-password:
|
||||
dynamic:
|
||||
druid:
|
||||
# 初始连接数
|
||||
initialSize: 5
|
||||
# 最小连接池数量
|
||||
minIdle: 10
|
||||
# 最大连接池数量
|
||||
maxActive: 20
|
||||
# 配置获取连接等待超时的时间
|
||||
maxWait: 60000
|
||||
# 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒
|
||||
timeBetweenEvictionRunsMillis: 60000
|
||||
# 配置一个连接在池中最小生存的时间,单位是毫秒
|
||||
minEvictableIdleTimeMillis: 300000
|
||||
# 配置一个连接在池中最大生存的时间,单位是毫秒
|
||||
maxEvictableIdleTimeMillis: 900000
|
||||
# 配置检测连接是否有效
|
||||
validationQuery: SELECT 1
|
||||
testWhileIdle: true
|
||||
testOnBorrow: false
|
||||
testOnReturn: false
|
||||
webStatFilter:
|
||||
enabled: true
|
||||
filters: stat,wall
|
||||
wall:
|
||||
multiStatementAllow: true
|
||||
stat:
|
||||
log-slow-sql: true
|
||||
slow-sql-millis: 1000
|
||||
merge-sql: true
|
||||
primary: master
|
||||
datasource:
|
||||
# 主库数据源
|
||||
master:
|
||||
driver-class-name: com.mysql.jdbc.Driver
|
||||
url: jdbc:mysql://172.16.30.243:6060/ruoyi?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
|
||||
username: root
|
||||
password: LOLm2dI2UQF#RxOf
|
||||
# 从库数据源
|
||||
# slave:
|
||||
# # 从数据源开关/默认关闭
|
||||
# enabled: false
|
||||
# url:
|
||||
# username:
|
||||
# password:
|
||||
teemlink:
|
||||
driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver
|
||||
url: jdbc:sqlserver://172.16.30.233:1433;DatabaseName=obpm_LianCheng_Data
|
||||
username: sa
|
||||
password: Lcdatacenter_888
|
||||
compute:
|
||||
driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver
|
||||
url: jdbc:sqlserver://172.16.30.233:1433;DatabaseName=uv_compute
|
||||
username: sa
|
||||
password: Lcdatacenter_888
|
||||
clean:
|
||||
driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver
|
||||
url: jdbc:sqlserver://172.16.30.233:1433;DatabaseName=uv_clean
|
||||
username: sa
|
||||
password: Lcdatacenter_888
|
||||
datasource:
|
||||
dynamic:
|
||||
primary: master
|
||||
hikari:
|
||||
connection-timeout: 30000
|
||||
validation-timeout: 30000
|
||||
idle-timeout: 30000
|
||||
max-lifetime: 30000
|
||||
max-pool-size: 30
|
||||
min-idle: 10
|
||||
initialization-fail-timeout: 30000
|
||||
connection-init-sql: select 1
|
||||
connection-test-query: select 1
|
||||
is-auto-commit: true
|
||||
is-read-only: false
|
||||
datasource:
|
||||
master:
|
||||
driver-class-name: com.mysql.jdbc.Driver
|
||||
url: jdbc:mysql://172.16.30.243:6060/ruoyi?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
|
||||
username: root
|
||||
password: LOLm2dI2UQF#RxOf
|
||||
teemlink:
|
||||
driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver
|
||||
url: jdbc:sqlserver://172.16.30.233:1433;DatabaseName=obpm_LianCheng_Data
|
||||
username: sa
|
||||
password: Lcdatacenter_888
|
||||
compute:
|
||||
driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver
|
||||
url: jdbc:sqlserver://172.16.30.233:1433;DatabaseName=uv_compute
|
||||
username: sa
|
||||
password: Lcdatacenter_888
|
||||
clean:
|
||||
driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver
|
||||
url: jdbc:sqlserver://172.16.30.233:1433;DatabaseName=uv_clean
|
||||
username: sa
|
||||
password: Lcdatacenter_888
|
||||
|
||||
# druid:
|
||||
# statViewServlet:
|
||||
# enabled: true
|
||||
# # 设置白名单,不填则允许所有访问
|
||||
# allow:
|
||||
# url-pattern: /druid/*
|
||||
# # 控制台管理用户名和密码
|
||||
# login-username:
|
||||
# login-password:
|
||||
# dynamic:
|
||||
# druid:
|
||||
# # 初始连接数
|
||||
# initialSize: 5
|
||||
# # 最小连接池数量
|
||||
# minIdle: 10
|
||||
# # 最大连接池数量
|
||||
# maxActive: 20
|
||||
# # 配置获取连接等待超时的时间
|
||||
# maxWait: 60000
|
||||
# # 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒
|
||||
# timeBetweenEvictionRunsMillis: 60000
|
||||
# # 配置一个连接在池中最小生存的时间,单位是毫秒
|
||||
# minEvictableIdleTimeMillis: 300000
|
||||
# # 配置一个连接在池中最大生存的时间,单位是毫秒
|
||||
# maxEvictableIdleTimeMillis: 900000
|
||||
# # 配置检测连接是否有效
|
||||
# validationQuery: SELECT 1
|
||||
# testWhileIdle: true
|
||||
# testOnBorrow: false
|
||||
# testOnReturn: false
|
||||
## webStatFilter:
|
||||
## enabled: true
|
||||
## filters: stat,wall
|
||||
## wall:
|
||||
## multiStatementAllow: true
|
||||
# stat:
|
||||
# log-slow-sql: true
|
||||
# slow-sql-millis: 1000
|
||||
# merge-sql: true
|
||||
# primary: master
|
||||
# datasource:
|
||||
# # 主库数据源
|
||||
# master:
|
||||
# driver-class-name: com.mysql.jdbc.Driver
|
||||
# url: jdbc:mysql://172.16.30.243:6060/ruoyi?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
|
||||
# username: root
|
||||
# password: LOLm2dI2UQF#RxOf
|
||||
# # 从库数据源
|
||||
## slave:
|
||||
## # 从数据源开关/默认关闭
|
||||
## enabled: false
|
||||
## url:
|
||||
## username:
|
||||
## password:
|
||||
# teemlink:
|
||||
# driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver
|
||||
# url: jdbc:sqlserver://172.16.30.233:1433;DatabaseName=obpm_LianCheng_Data
|
||||
# username: sa
|
||||
# password: Lcdatacenter_888
|
||||
# compute:
|
||||
# driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver
|
||||
# url: jdbc:sqlserver://172.16.30.233:1433;DatabaseName=uv_compute
|
||||
# username: sa
|
||||
# password: Lcdatacenter_888
|
||||
# clean:
|
||||
# driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver
|
||||
# url: jdbc:sqlserver://172.16.30.233:1433;DatabaseName=uv_clean
|
||||
# username: sa
|
||||
# password: Lcdatacenter_888
|
@ -54,36 +54,30 @@
|
||||
,a.Status
|
||||
,a.BuildingStd
|
||||
,a.AdjEvd
|
||||
,b.AreaCoff
|
||||
,b.YearCoff
|
||||
,b.BuildingCoff
|
||||
,b.ProjectName
|
||||
,b.ProjectAddr
|
||||
,b.BuildingAddr
|
||||
,b.County
|
||||
,b.Loop
|
||||
,b.Block
|
||||
,b.Street
|
||||
,b.Year
|
||||
,b.AvgArea
|
||||
,b.TotalFloorSum
|
||||
,b.UpperFloorSum
|
||||
,b.OfficeClass
|
||||
,b.Grade
|
||||
,c.MainPrice AS mainPrice_1
|
||||
,c.MainPriceRent as mainPriceRent_1
|
||||
,a.AreaCoff
|
||||
,a.YearCoff
|
||||
,a.BuildingCoff
|
||||
,a.ProjectName
|
||||
,a.ProjectAddr
|
||||
,a.BuildingAddr
|
||||
,a.County
|
||||
,a.Loop
|
||||
,a.Block
|
||||
,a.Street
|
||||
,a.Year
|
||||
,a.AvgArea
|
||||
,a.TotalFloorSum
|
||||
,a.UpperFloorSum
|
||||
,a.OfficeClass
|
||||
,a.Grade
|
||||
,a.mainPrice_1
|
||||
,a.mainPriceRent_1
|
||||
, ${yearMonth} as yearMonth
|
||||
FROM ODS_OFFICE_BUILDING_PRICE_INFO_${yearMonth} a
|
||||
left join DIM_OFFICE_PROJECT_BUILDING_201909 b on a.BuildingID_P=b.BuildingID_P
|
||||
left join ODS_OFFICE_BUILDING_PRICE_INFO_${lastYearMonth} c on a.BuildingID_P = c.BuildingID_P
|
||||
WHERE b.EffDate <![CDATA[ <= ]]> getdate() AND b.ExpirDate <![CDATA[ > ]]> getdate() AND c.Status=1
|
||||
</sql>
|
||||
|
||||
<select id="getCount" parameterType="com.ruoyi.project.data.price.domain.UltimateOfficeBasePrice" resultType="int">
|
||||
select count(1) FROM ODS_OFFICE_BUILDING_PRICE_INFO_${yearMonth} a
|
||||
left join DIM_OFFICE_PROJECT_BUILDING_201909 b on a.BuildingID_P=b.BuildingID_P
|
||||
left join ODS_OFFICE_BUILDING_PRICE_INFO_${lastYearMonth} c on a.BuildingID_P = c.BuildingID_P
|
||||
WHERE b.EffDate <![CDATA[ <= ]]> getdate() AND b.ExpirDate <![CDATA[ > ]]> getdate() AND c.Status=1
|
||||
<if test="communityId != null">
|
||||
AND a.PROJECTID_P = #{communityId}
|
||||
</if>
|
||||
@ -107,7 +101,7 @@
|
||||
<if test="status != null">
|
||||
AND a.STATUS = #{status}
|
||||
</if>
|
||||
order by a.ModifyDate DESC,a.BUILDINGID_P ASC OFFSET #{pageIndex} rows fetch next #{pageSize} rows only;
|
||||
order by a.id desc OFFSET #{pageIndex} rows fetch next #{pageSize} rows only;
|
||||
</select>
|
||||
|
||||
<select id="getById" resultMap="OfficeBasePriceUltimateResult">
|
||||
|
57
ruoyi/src/test/java/com/uvaluation/longtime/SqlTests.java
Normal file
57
ruoyi/src/test/java/com/uvaluation/longtime/SqlTests.java
Normal file
@ -0,0 +1,57 @@
|
||||
package com.uvaluation.longtime;
|
||||
|
||||
import com.baomidou.dynamic.datasource.annotation.DS;
|
||||
import com.ruoyi.RuoYiApplication;
|
||||
import com.ruoyi.project.data.price.domain.UltimateOfficeBasePrice;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.test.context.SpringBootTest;
|
||||
import org.springframework.jdbc.core.JdbcTemplate;
|
||||
import org.springframework.jdbc.core.RowMapper;
|
||||
import org.springframework.test.context.junit4.SpringRunner;
|
||||
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
import java.util.List;
|
||||
|
||||
@RunWith(SpringRunner.class)
|
||||
@SpringBootTest(classes = RuoYiApplication.class)
|
||||
@DS("master")
|
||||
public class SqlTests {
|
||||
@Autowired
|
||||
private JdbcTemplate jdbcTemplate;
|
||||
|
||||
@Test
|
||||
@DS("compute")
|
||||
public void testSpendTime() {
|
||||
|
||||
Integer coutn = jdbcTemplate.queryForObject("select count(1) from ODS_OFFICE_BUILDING_PRICE_INFO_202006 ",
|
||||
Integer.class);
|
||||
|
||||
List<UltimateOfficeBasePrice> list = jdbcTemplate.query("SELECT a.ID ,a.BuildingID_P ,a.ProjectID_P ,a" +
|
||||
".MainPrice ,a.MainPriceRent ,a" +
|
||||
".MainPricePst " +
|
||||
",a.MainPriceRentPst ,a.MainPriceType ,a.MainPriceRentType ,a.ModifyDate ,a.Status ,a.BuildingStd ,a" +
|
||||
".AdjEvd ,b.AreaCoff ,b.YearCoff ,b.BuildingCoff ,b.ProjectName ,b.ProjectAddr ,b.BuildingAddr ,b" +
|
||||
".County ,b.Loop ,b.Block ,b.Street ,b.Year ,b.AvgArea ,b.TotalFloorSum ,b.UpperFloorSum ,b" +
|
||||
".OfficeClass ,b.Grade ,c.MainPrice AS mainPrice_1 ,c.MainPriceRent as mainPriceRent_1 , 202006 as " +
|
||||
"yearMonth FROM ODS_OFFICE_BUILDING_PRICE_INFO_202006 a left join DIM_OFFICE_PROJECT_BUILDING_201909 " +
|
||||
"b on a.BuildingID_P=b.BuildingID_P left join ODS_OFFICE_BUILDING_PRICE_INFO_202005 c on a" +
|
||||
".BuildingID_P = c.BuildingID_P WHERE b.valid=1 AND c.Status=1 order by a.id desc OFFSET 18570 rows " +
|
||||
" fetch next 10 rows only;", new TestTempMapper());
|
||||
Assert.assertEquals(list.size(), 2);
|
||||
}
|
||||
|
||||
class TestTempMapper implements RowMapper<UltimateOfficeBasePrice> {
|
||||
|
||||
@Override
|
||||
public UltimateOfficeBasePrice mapRow(ResultSet resultSet, int rowNum) throws SQLException {
|
||||
UltimateOfficeBasePrice result = new UltimateOfficeBasePrice();
|
||||
result.setId(resultSet.getString("id"));
|
||||
result.setBuildingId(resultSet.getString("BuildingID_P"));
|
||||
return result;
|
||||
}
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user