自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(26)
  • 资源 (11)
  • 收藏
  • 关注

原创 slf4j打印异常日志

程序中通过slf4j的logger.error(e.getMessage())打印日异常日志不够 详细。需要修改为logger.error("异常:",e)可以详细打印异常堆栈详细信息;

2023-06-05 17:29:33 340

原创 Postgre使用物化视图

1.postgre使用物化视图,实质是将查询结果存储起来,这样对于普通的视图来说,查询速度会更快;REFRESH MATERIALIZED VIEW CONCURRENTLY 视图名称。CREATE UNIQUE INDEX 索引名称 ON 视图名称(唯一键列名);CREATE MATERIALIZED VIEW '视图名称' as。REFRESH MATERIALIZED VIEW 视图名称。2.支持全量刷新(阻塞查询)和增量刷新(不阻塞查询)SELECT * FROM 视图名称。

2023-06-05 17:26:01 621

原创 记一次springboot jdbcTemplate获取数据库连接未关闭的问题

springboot jdbctemplate 连接池 关闭连接

2022-04-20 11:42:15 3315

原创 springboot jpa 多数据源配置

springboot 多数据源切换。

2022-02-07 14:55:19 6463 3

原创 sql优化记录

sql优化

2022-01-29 14:35:53 961

原创 mongo 聚合使用记录

var result=db.day_air.aggregate([ {$match:{"$and":[{"data_time":{"$gte":ISODate('2021-02-01 00:00:00')}},{"data_time":{"$lte":ISODate('2021-03-31 23:59:59')}}]}}, //前置过滤器 {$unwind:"$values"}, //拆分子集数据 {$match:{"values.pollutant_code":...

2021-04-16 17:01:05 176

原创 mongoTemplate聚合aggregate操作

废话不多说,直接上代码 public int syncTotal(Date startTime, Date endTime) { int result = 0; Criteria criteria = new Criteria().andOperator(Criteria.where("data_time").gte(startTime), Criteria.where("data_time").lte(endTime)); //创建aggreation

2021-04-02 11:30:21 4985 1

原创 mongodb的group和aggregate问题记录

1.group只支持单机分组,不支持多分片集群分组,这是个大坑2.aggregate支持多分片集群,新版本建议使用aggregate3.数据模板{ "_id": "2204000000429520201204000000000", "mp_id": "22040000004295", "create_time": ISODate("2020-12-04T16:10:03.627Z"), "data_day": NumberInt("20201204"),

2021-04-02 11:07:17 1075

原创 SqlServer链接PostgreSql数据库

SQLSERVER配置POSTGRESQL链接服务器说明POSTGRESQL ODBC下载地址https://www.postgresql.org/ftp/odbc/versions/msi/ 在SQLSERVER服务器上安装POSTGRESQL ODBC驱动,解压psqlodbc_11_01_0000.zip,点击psqlodbc-setup.exe安装驱动ODBC 查看驱动是否安装成功,打开控制面板->管理工具->数据源(ODBC),如下: 点击添加,选择POSTGRESQL驱..

2021-04-02 10:22:34 3150 2

原创 mongotemplate查询过滤返回字段以及子集字段

private List<DayAir> findMongoPage(int page, Date lastUpdateTime, Date endTime, Date dataTime) { int skip = (page - 1) * syncConfig.getMongoBatchSize(); Query query = new Query(new Criteria().andOperator(Criteria.where("updateTim...

2021-03-19 15:51:50 2245

原创 java callable实现多线程的简单例子

public static void main(String[] args) throws ExecutionException, InterruptedException { int corePoolSize = 5; //初始线程数 int maximumPoolSize = 5; //最大线程数 long keepAliveTime = 60; //空闲多久会被释放,搭配TimeUnit使用 //建立线程池 Thr..

2021-03-12 15:29:41 937 2

原创 mongodb批量更新内嵌文档,子集字段

db.hour_air.updateMany({ "mp_id": "402885537457e3c201745836c31100d5", $and: [{ "data_time": { $gte: ISODate('2020-02-01') } }, { "data_time": { $lte: ISODate('2021-02-28') } }]}, { .

2021-03-03 15:19:59 1121 1

原创 mongoTemplate批量更新保存子文档集合

项目中遇到批量保存或者更新文档,使用mongotemplate的upsert来处理,发现会直接覆盖之前的子集,而不是按照自己的规则去追加,或者更新子集最后想到一个思路,记录一下List<DayAir> dayAirList = mergeList(currentTime, syncMinutes);if (!dayAirList.isEmpty()) { //按照唯一键查询出对应文档 dayAirList.forEach(air -> { ...

2021-01-27 15:42:13 3029

原创 springboot 读写properties文件

springboot 读写properties文件public static void writeProperties(String key, String value) { try { String path = getRootPath() + "/sync_mongo_40/"; File pathFile = new File(path); if (!pathFile.exists()) { pathFile.mkd.

2021-01-27 15:34:05 2190

原创 springboot2读取yml中属性到List<自定义对象>中

1.yml配置2.实体对象,get,set自己写3.读取对应list和其他属性说明:使用ConfigurationProperties读写,prefix设置dbconfig的根节点。sync_minutes和dblist需和yml文件中名称相同,List类型配置文件中必须对应list[0]、list[1]等等自定义实体属性也需与yml一致,component注入spring管理bean4.使用@AutowiredSyncDBConfig syncDBConfi.

2021-01-07 09:53:13 1389

原创 springboot2.4.1中hibernate格式化sql无效

format_sql如果直接放到jpa.hibernate下是无效的,必须放在properteis.hibernate下才行。

2021-01-07 09:42:26 402

原创 SLF4J的StaticLoggerBinder和logback的StaticLoggerBinder冲突

问题 :SLF4J: Class path contains multiple SLF4J bindings.SLF4J: Found binding in [jar:file:/D:/maven/repository/ch/qos/logback/logback-classic/1.2.3/logback-classic-1.2.3.jar!/org/slf4j/impl/StaticLoggerBinder.class]SLF4J: Found binding in [jar:file:/D:/

2021-01-07 09:37:15 6143

原创 springboot2 slf4j+logback 生成日志

1.springboot2自带logging日志实现,不需要引入依赖2.在resources中新建文件logback-spring.xml,此名称springboot会自动识别加载3.xml内容如下<?xml version="1.0" encoding="UTF-8"?><configuration> <property name="logger.path" value="sync_mongo_logs_40"/> <!-.

2021-01-07 09:23:58 1796

原创 Springcloud Eureka 服务启动页面不出来显示XML得解决方法

因为spring-boot-starter-freemarker 下得freemarkjar有问题,导致界面出不来去本地maven仓库,删掉此jar包,再进行update maven就可以了。

2018-03-29 12:01:58 2844

原创 Mybatis 中返回Map,映射其中列为枚举类型的写法

&lt;resultMap type="java.util.Map" id="TransactionRecordBaseResultMap"&gt; &lt;result column="TRADE_NO" property="tradeNo" /&gt; &lt;result column="PAY_TYPE" property="payType&qu

2018-03-23 15:26:21 3772

原创 mybatis mapper互相引用resultMap启动出错

mybatis mapper互相引用resultMap启动出错,问题:Caused by: java.lang.IllegalArgumentException: Result Maps collection does not contain value for kulink.cvscloud.core.mapper.OrderSundryMapper.BaseResultMapat o...

2018-03-22 11:05:48 2751 1

原创 The content of element type "resultMap" must match "(constructor?,id*,result*,association*,collect

mybatis 错误The content of element type "resultMap" must match  "(constructor?,id*,result*,association*,collection*,discriminator?)".造成的原因是&lt;resultMap&gt;标签中需要按照&lt;id&gt;&lt;result&gt;&lt;association...

2018-03-22 10:12:55 20042 3

原创 mybatis plus分页不出来pages和total的解决记录

按着官方的分页例子写完以后,发现pages和total都为0,仔细观察了好多遍还是没解决。最好找到一段配置添加后,正常了。package kulink.cvscloud.core.config;import org.springframework.context.annotation.Bean;import org.springframework.context.annotation.Con...

2018-03-19 09:29:47 25690 8

原创 关于phprpc for java搭建android服务端

服务端采用s2sh框架在src下新建app-phprpc.xml内容如下 http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:jaxws="http://cxf.apache.org/jaxws" xsi:sche

2013-05-14 15:07:41 2963

原创 ASP.NET类似panel,groupbox效果

http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">http://www.w3.org/1999/xhtml">                                登录                            Text="用户名:">

2013-05-14 14:58:09 817

原创 window下svn的安装和配置

<br />svn是一款流行的版本控制器,试用配置简单方便,首先下载Subversion和TortoiseSVN,然后双击安装,两个都完成安装后需要重新启动计算机,重新启动以后--程序--TortoiseSVN--settings--设置中文简体--应用<br />然后运行--cmd--<br />sc create svnservice binpath= "/"D:/Program Files/javaweb/svn/server/bin/svnserve.exe/" --service --root "

2011-05-27 11:49:00 608

navicat12注册机

navicat12 注册机,激活,亲测可用,使用前先关闭杀毒软件

2018-04-09

tomcat 7安装版

tomcat 7,安装版

2014-09-18

json及依赖jar

json及其依赖jar,java开发必用!

2013-05-13

sql 万能客户端

sql 万能客户端,包括mysql,sqlserver,postgresql等

2013-05-13

屏幕取色器

好用的屏幕取色工具,绝对安全,体积小,操作简单!

2013-05-13

FushionChartsV3统计图

FushionChartsV3,FushionCharts破解版,免费

2012-10-25

DB2数据库连接JAR包

DB2数据库连接jar包

2012-10-25

JDK1.6中文版

JDK1.6中文版,没啥说的,你懂的,你懂的,你懂的

2012-10-25

sql脚本转换器

各种脚本转换,各种脚本转换,各种脚本转换,各种脚本转换

2011-11-14

svn版本控制器完全包

svn版本控制器,包括svn客户端和服务器

2011-05-27

网站建站免费模版-8套

网站模版,企业,个人,短信,后台!内容丰富,免费好用!

2011-05-25

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除