- 博客(15)
- 收藏
- 关注
原创 springboot多数据源配置
最近需要配置springcloud多数据源, 既有mysql又有sqlserver,详细配置如下1、配置bootstrap.ymlspring: datasource: ds1: driver-class-name: com.mysql.cj.jdbc.Driver jdbc-url: jdbc:mysql://mysql地址:3306/数据库名?useUnicode=true&characterEncoding=UTF-8&serverTimezone
2021-04-28 16:37:16 356
原创 项目加@Scheduled(cron = “0 0/10 * * * ?“)注解不管用
项目启动类需要加@EnableScheduling注解@EnableSchedulingpublic class ZdZhksDsrwApplication { public static void main(String[] args) { SpringApplication.run(ZdZhksDsrwApplication.class, args); }}
2021-04-27 15:56:17 1166
原创 navicate连接sqlserver 未发现数据源名称并且未指定默认驱动程序
找到navicate安装地址, 找到sqlncli.msi, 点击安装, 继续下一步安装完毕后, 选中native client驱动程序, 即可连接成功
2021-04-26 11:40:00 487
原创 easyui datagrid 行内编辑删除not defined
需要的页面上有新增、编辑、删除按钮,但如果编辑和删除按钮放在formatter中这样写handerFormatter(){ return "<a href='javascript:test();'>编辑</a>"}test(){ alert(1)}test()方法根本获取不到,一直报错not defined,想了很长时间,总结出以下方法:给 编辑、删除这两个按钮设置唯一id值,通过$(document)直接设置click方法,如下:function handle.
2020-12-29 11:39:24 325
原创 vue打印print
注意, iframe打开后须close //判断iframe是否存在,不存在则创建iframe let iframe=document.getElementById("iframe"); if(!iframe){ iframe = document.createElement('IFRAME'); let doc = null; iframe.setAttribute("id", "iframe"); iframe.setAttribute('st
2020-12-04 15:02:13 283 1
原创 vue中使用pdf.js
vue项目中需要展示pdf.js,记录一波,so easy。首先去pdfjs官网上下载pdf.js,下载完毕后将一部分页面放入static文件夹中,如下图所示:若出现报错提示:file origin does not match viewer’s则注释web/viewer.js中如下代码,不进行跨域即可if (origin !== viewerOrigin && protocol !== 'blob:') { throw new Error('file origin doe
2020-12-03 14:42:59 1048
原创 sql查询近7天/30天内的数据,分类汇总合
1、获取近七天的数据SELECT click_date AS date, IFNULL( people.total, 0 ) AS total FROM ( SELECT click_date FROM ( SELECT curdate( ) AS click_date UNION ALL SELECT date_sub( curdate( ), INTERVAL 1 DAY ) AS click_date UNION ALL SELECT date_s
2020-11-17 10:52:51 3052 1
原创 mysql数据库新增库且只分配一个用户
创建用户:用户名:sys_admin密码:123456读写权限:@’%’create user 'sys_admin'@'%' identified by '123456';给表分配权限表名:demo_table用户名:sys_admin密码:123456grant all privileges on demo_table.* to 'sys_admin'@'%' identified by '123456';...
2020-11-09 11:19:13 90
原创 Java根据两数据获取持续时间
public String getContinueTime(String startTime,String endTime){ try { SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); Date intoTime = format.parse(startTime); Date outTime = format.parse(en
2020-11-07 16:35:39 238
原创 数据量很大查询花费时间长但某页面需要及时更新实现思路
最近遇到项目需实时监测硬件数据, 硬件数据需每两分钟获取一次, 一天数据达到上百万, 前台展示页面需要每两分钟获取一次并刷新后台没两分钟查询数据库,将两分钟之内数据放在redis中, 前端每两分钟setTimeOut去redis中获取一次数据...
2020-11-06 17:33:40 159
原创 Java获取五分钟之前时间
Calendar beforeTime = Calendar.getInstance();beforeTime.add(Calendar.MINUTE, -5);Date beforeDate = beforeTime.getTime();
2020-11-06 17:28:36 3348
转载 SpringAOP拦截Controller,Service实现日志管理(自定义注解的方式)
SpringAOP拦截Controller,Service实现日志管理(自定义注解的方式)资源路径: https://blog.csdn.net/clypm/article/details/51506922
2018-10-22 14:10:27 112
转载 Bootstrap table 点击行改变背景色,点击列选中或者取消选中checkbox,根据某个属性隐藏显示某个字段
//点击选中行,改变选中行的背景颜色 (table).on(‘click-row.bs.table’, function (e, row, element){ $(‘.success’).removeClass(‘success’);//去除之前选中的行的,选中样式 $(element).addClass(‘su...
2018-08-08 10:25:05 3614
原创 layer alert时 点击其他地方会关闭
实现是否启用的弹框, 实现了点击其他地方弹框不关闭function editSuccess(){ layer.confirm('修改成功', { btn : [ '确定'],title: '操作提示',icon: 0 }, function(index) { layer.close(index); });}...
2018-08-02 11:42:02 4813
原创 getSession().createSQLQuery
若想返回一个对象, 此时, 必须将所有的字段全部查出来, ListlistBookCase =getSession().createSQLQuery(sqlBuffer.toString()).addEntity(BookCase.class).list();2.若想返回一个值, 此时 sqlBuffer = new StringBuffer(); sqlBu...
2018-08-01 15:38:04 3621
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人