摘要: 使用Condition实现简单的阻塞队列 阻塞队列是一种特殊的先进先出队列,它有以下几个特点 1.入队和出队线程安全 2.当队列满时,入队线程会被阻塞;当队列为空时,出队线程会被阻塞。 import java.util.LinkedList; import java.util.concurrent. 阅读全文
posted @ 2021-08-14 19:05 山丘i 阅读(514) 评论(0) 推荐(0) 编辑
摘要: 查看配置 show variables like '%increment%'; 如果: auto_increment_increment=2 执行: set @@global.auto_increment_increment = 1; set @@auto_increment_increment = 阅读全文
posted @ 2021-08-14 16:32 山丘i 阅读(615) 评论(0) 推荐(0) 编辑
摘要: 上传到指定的路径,并以当前的日期分类 public String add(MultipartFile file) throws Exception { String path = null;// 文件路径 if (file != null) {// 判断上传的文件是否为空 String type = 阅读全文
posted @ 2021-08-14 16:30 山丘i 阅读(510) 评论(0) 推荐(0) 编辑
摘要: 添加依赖 <!--阿里云存储--> <dependency> <groupId>com.aliyun.oss</groupId> <artifactId>aliyun-sdk-oss</artifactId> <version>3.10.2</version> </dependency> <!-- 阅读全文
posted @ 2021-08-14 16:28 山丘i 阅读(619) 评论(0) 推荐(1) 编辑
摘要: 今天遇到了条件中使用时间参数,数据库是Oracle的,查阅MyBatis Plus QueryWrapper 默认提供的几个方式都不行, 这种时间查询 // 预警时间 if (warning.getWarningTimeParams() != null && warning.getWarningTi 阅读全文
posted @ 2021-08-14 16:27 山丘i 阅读(1373) 评论(0) 推荐(0) 编辑
摘要: 主要还是时间精度问题 阅读全文
posted @ 2021-08-14 16:24 山丘i 阅读(225) 评论(0) 推荐(0) 编辑
摘要: 首先在启动类似添加注解 @EnableTransactionManagement 然后在service的实现方法上添加注解 @Transactional(rollbackFor = CustomException.class) 这里使用自定义异常进行处理,抛自定义异常进行数据的回滚 package 阅读全文
posted @ 2021-08-14 16:20 山丘i 阅读(462) 评论(0) 推荐(0) 编辑
摘要: Mybaits-plus 中,两张表组合查询,xml方式 在FlowMapper接口中自定义接口 public interface FlowMapper extends BaseMapper<Flow> { List<Flow> pageList(FlowDTO dto); } 手动添加FlowMa 阅读全文
posted @ 2021-08-14 16:15 山丘i 阅读(55) 评论(0) 推荐(0) 编辑
摘要: 查询状态 0 的有数据但是不显示 需要在数据库默认设置的字段长度设置为1 阅读全文
posted @ 2021-08-14 16:11 山丘i 阅读(76) 评论(0) 推荐(0) 编辑
摘要: 使用oracle数据库时,mybatis-plus设置自增,添加数据的时候失败 @TableId(value = "ID", type = IdType.AUTO) private Integer id; ; ORA-01400: 无法将 NULL 插入 ("JIANG"."T_PRODUCT"." 阅读全文
posted @ 2021-08-14 16:08 山丘i 阅读(286) 评论(0) 推荐(0) 编辑
摘要: 主要根据概率返回每次抽到的奖品, 以下是抽奖工具类 package com.ruoyi.project.dy.utils; import java.util.ArrayList; import java.util.List; import java.util.Random; /** * @descr 阅读全文
posted @ 2021-08-14 16:03 山丘i 阅读(823) 评论(0) 推荐(0) 编辑