- 博客(30)
- 问答 (1)
- 收藏
- 关注
原创 mybatis plus 生成代码 保存方法主键报错 nested exception is org.apache.ibatis.reflection.ReflectionException: Cou
报错:nestedexceptionisorg.apache.ibatis.reflection.ReflectionException:Couldnotsetproperty'id'of'classcom.zfl.entity.PayChannel'withvalue'1211943844533362690'Cause:java.lang.IllegalArg...
2019-12-31 17:46:01 945
原创 spring boot mybatis sql文件 放在src下 而不是resources下
mybatis sql文件 应该是和java文件放在一起,它并不是配置文件,也不应该放在resources文件夹下但是如果放在src下,打包是并不会打包进src下还需要这样配置在pom.xml文件中<build> <resources> <!-- <resource> &...
2019-12-30 18:14:27 1169 1
原创 spring boot Failed to configure a DataSource: 'url' attribute is not specified and no embedded datas
***************************APPLICATION FAILED TO START***************************Description:Failed to configure a DataSource: 'url' attribute is not specified and no embedded datasource could b...
2019-12-30 17:39:21 159
原创 报错 The last packet successfully received from the server was 510,815 milliseconds ago. The last pac
报错:The last packet successfully received from the server was 510,815 milliseconds ago. The last packet sent successfully to the server was 0 milliseconds ago.原因大概是mysql在一定时间内,关闭了一些链接,但是java数据库链...
2019-12-30 11:44:45 2210
原创 spring MVC 日期格式转换,日期格式字符串转为Date类型
新建转换类CustomDate.java内容package com.ssm.util.spring;import java.text.ParseException;import java.text.SimpleDateFormat;import java.util.Date;import org.springframework.core.convert.converter...
2019-12-27 11:59:22 250
原创 spring MVC 使用Quartz
引入jar包<!--定时任务--> <!-- https://mvnrepository.com/artifact/org.quartz-scheduler/quartz --> <dependency> <groupId>org.quartz-scheduler</groupId&...
2019-12-27 11:52:05 268
原创 nginx 配置pc端和移动端自动跳转
全部配置文件#user nobody;worker_processes 1;#error_log logs/error.log;#error_log logs/error.log notice;#error_log logs/error.log info;#pid logs/nginx.pid;events { worker_conn...
2019-12-27 11:33:15 792
原创 java 8 流 的方式 对任意字段去重
public static <T> Predicate<T> distinctByKey(Function<? super T, ?> keyExtractor) { Map<Object, Boolean> seen = new ConcurrentHashMap<>(); return t ->...
2019-12-25 14:31:13 186
原创 windows 带密码启动redis 和 带密码链接redis 脚本
start.batredis-server.exe redis.confredis-cli.batredis-cli.exe -h 127.0.0.1 -p 6379 -a jcd
2019-12-24 16:01:48 883
原创 maven spring MVC 工程 打印http请求参数 返回值 和 请求执行的sql
新建文件HttpAspect.javapackage com.ssm.aop;import com.alibaba.fastjson.JSONObject;import com.ssm.pojo.AdminTimeConsume;import com.ssm.service.AdminTimeConsumeService;import org.apache.commons....
2019-12-24 14:37:03 259
原创 spring boot 项目 打印http请求 参数 和 返回 json字符串 并且打印请求执行的sql
打印请求参数HttpAspect.javapackage com.school.oauth.aop;import com.alibaba.fastjson.JSONObject;import org.apache.commons.lang.ArrayUtils;import org.apache.commons.lang.RandomStringUtils;import o...
2019-12-24 14:31:47 1125
原创 java 日期处理jar包
<dependency> <groupId>joda-time</groupId> <artifactId>joda-time</artifactId> <version>2.9.4</version></dependency>
2019-12-23 16:36:41 1406
原创 java 8 根据map 字段值 去重
List<Map<String, Object>> msgId = list1.stream().filter(distinctByKey(deviceRecord -> deviceRecord.get("msgId"))).collect(Collectors.toList()); public static <T> Pred...
2019-12-21 14:59:35 1328
原创 mybatis 批量插入 返回主键
报错:org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.executor.ExecutorException: Error getting generated key or setting result to parameter object. Cause: org.apache.i...
2019-12-21 10:41:02 185
原创 mybatis 批量更新
但Mybatis映射文件中的sql语句默认是不支持以" ; " 结尾的,也就是不支持多条sql语句的执行。所以需要在连接mysql的url上加 &allowMultiQueries=true 这个才可以执行。<update id="batchUpdate" parameterType="list"> <foreach collection="list" i...
2019-12-20 16:53:28 61
原创 java 8 流 将 实体类id与实体类对应
组成List<Map<String,Object>>Map<String,BwXyCuifeiYcf> cf=null; if(queryAll!=null && !queryAll.isEmpty()){ cf=queryAll.stream().collect( Collectors.toMap( (B...
2019-12-20 14:50:43 529
原创 mysql 分组显示行号
SELECT a.*, @group_row := CASEWHEN @toUser = a.toUser THEN @group_row + 1ELSE 1END AS groupRow, @toUser := a.toUser AS toUserFROM ( SELECT t.*, CASE WHEN t.message_create_user_id = '1...
2019-12-19 11:44:53 522
原创 新clone 的工程总是不能提交 git
原因是因为 使用git clone git://xxxxxxxxxx/school_oauth.git 克隆的工程,是没有提交权限的,要使用git clone ssh://admin@xxxxxxxxxx:29418/school_oauth.git 这样的才可以使用第一个才能提交,直接修改.git/config中的url为第一个就可以...
2019-12-18 16:19:01 498
原创 解决 spring boot 在使用 pagehelper-spring-boot-starter 后 无法使用 自定义拦截器的问题
spring boot 已经使用了自动分页插件pagehelper-spring-boot-starter ,但是在自定义mybatis 拦截器的时候,并不能生效,原因就是,pagehelper 拦截器,进行拦截处理后,没有调用之后的拦截器,直接返回了自己的执行结果,导致之后的拦截器没有调用.下面贴出我的代码,可以执行拦截器添加文件:MyBatisConfig.java ...
2019-12-18 15:21:13 3769 2
原创 liunx 运行环境搭建 常用脚本
启动tomcat,使tomcat后台运行runTomcat.shnohup ./catalina.sh run -> logs/run.log &tail -f logs/run.log启动jar包,使在后台运行start.shnohup java -jar oauth-0.0.1-SNAPSHOT.jar > log/run.log &ec...
2019-12-13 14:21:19 107
原创 liunx 常用命令
查看端口进程netstat -anp|grep 9217杀掉进程kill -9 26127mysql启动mysqlservice mysqld start停止mysqlservice mysqld stop重启mysqlservice mysqld restart查看实时运行日志tail -f catalina.out赋予文件可...
2019-12-13 14:07:05 77
原创 SELECT list is not in GROUP BY clause and contains nonaggregated column 'school.sc.class_name' which
SELECT list is not in GROUP BY clause and contains nonaggregated column 'school.sc.class_name' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=onl...
2019-12-13 13:58:44 110
原创 window 安装 mysql8.0.12
https://www.jb51.net/article/146115.htmhttps://www.cnblogs.com/laumians-notes/p/9069498.htmlliunx 安装mysqlhttps://blog.csdn.net/lch520baby/article/details/89081306
2019-12-11 11:19:37 105
原创 java 过滤 html 标签
package q;import java.util.regex.Matcher;import java.util.regex.Pattern; public class htmlTest { private static final String regEx_script = "<script[^>]*?>[\\s\\S]*?<\\/script&g...
2019-12-11 09:54:39 128
原创 java 将 \u003c \u003e \u003d 转为 <> = 或者其他html符号
原字符串{"target_type":"single","msg_type":"text","target_name":"测试家长","target_id":"18539282209","from_id":"13820165774","from_name":"大大","from_type":"user","from_platform":"web","msg_body":{"text":"\u00...
2019-12-10 16:22:59 15161
原创 Expression #2 of SELECT list is not in GROUP BY clause and contains nonaggregated column ‘sss.month_
Expression #2 of SELECT list is not in GROUP BY clause and containsnonaggregated column ‘sss.month_id’ which is not functionallydependent on columns in GROUP BY clause; this is incompatible withsql...
2019-12-09 16:43:15 145
原创 liunx mysql 设置 数据库为 utf8mb4
配置完my.cnf后# For advice on how to change settings please see# http://dev.mysql.com/doc/refman/5.7/en/server-configuration-defaults.html# *** DO NOT EDIT THIS FILE. It's a template which will be co...
2019-12-09 09:58:41 464
原创 Starting MySQL.The server quit without updating PID file (/[FAILED]l/mysql/mysql-5.7.28/data/mysqld.
2个小时......原因是没有权限,必须把data文件夹,赋权给mysql组.chown -R mysql:mysql /usr/local/mysql/mysql-5.7.28/dataStarting MySQL.. [ OK ]终于起来了...
2019-12-07 21:49:35 3394
原创 MySQL插入emoji表情错误的3种解决方案,Incorrect string value: '\xF0\x9F\x98\x84'
Incorrect string value: '\xF0\x9F\x91\x84\u...' for column 'message_content' at row 175修改mysql的配置文件,windows下的为安装目录的my.ini(linux下的为/etc/my.cnf),修改的内容都一样[client]default-character-set = utf8mb4...
2019-12-07 18:39:15 215
TA创建的收藏夹 TA关注的收藏夹
TA关注的人