随笔分类 - java
摘要:// - new Integer()构造方法, 不使用缓存池Integer a1 = new Integer(127);Integer b1 = new Integer(127);System.out.println(a1 == b1); // false// - Integer.valueOf()
阅读全文
摘要:1、添加pom依赖 <dependency> <groupId>com.jcraft</groupId> <artifactId>jsch</artifactId> <version>0.1.55</version></dependency> 2、示例代码 public static void ma
阅读全文
摘要:public R<Boolean> exportCsv(HttpServletResponse response, @RequestBody DrQueryDto queryDto) throws Exception { //解决excel打开csv文件中文乱码 //byte[] utf8bom={
阅读全文
摘要:原因:@Transactional是Spring框架提供的注解,用于注解类或方法,表示此类或方法需要在一个事务内执行。 1、一个事务中对同一张表进行了多次操作 2、在一个事务中对同一张表进行了读操作(select语句)和写操作(insert、update、delete语句)当出现这种情况时,可能会导
阅读全文
摘要:import org.apache.poi.xssf.usermodel.XSSFWorkbook;import javax.servlet.ServletOutputStream;import javax.servlet.http.HttpServletResponse;import java.i
阅读全文
摘要:LambdaUpdateWrapper<User> lambdaUpdateWrapper = new LambdaUpdateWrapper<>(); lambdaUpdateWrapper.set(User::getName, "newName").set(User::getAge, 20).e
阅读全文
摘要:import java.text.ParseException;import java.text.SimpleDateFormat;import java.util.*;public class WeekdaysUtils { public static List<String> list = ne
阅读全文
摘要:List<Vo> list = dao.selectList();if(CollectionUtils.isNotEmpty(list)) { Optional<Vo> max = list.stream().filter(obj->ObjectUtils.isNotEmpty(obj) && Ob
阅读全文
摘要:@Component@EnableScheduling // 1.开启定时任务@EnableAsync // 2.开启多线程public class MultithreadScheduleTask { @Async @Scheduled(fixedRate= 3000) //3秒执行一次 publi
阅读全文
摘要:在Terminal终端中输入 git config user.name git config --global user.name "xl"
阅读全文
摘要:// 获得总共有多少行int rowNum = 0;//存在样式的空行。会被统计进来。所以主要的问题是要判断是否是空行。for (int num = 1; num <= sheet.getLastRowNum(); num++) {//跳过第一行,看个人需求 HSSFRow row = sheet.
阅读全文
摘要://递归插入public void add(List<Object> all, long start, long limit){ //截取 List<Object> collect = all.stream().skip(start).limit(limit).collect(Collectors.
阅读全文
摘要:1、前置条件(合并前的单元格边框必须存在) 2、设置合并单元格样式 XSSFSheet sheet;CellRangeAddress cellRangeAddress = new CellRangeAddress(startRow, overRow, startCol, overCol);sheet
阅读全文
摘要:public static XSSFColor fine = new XSSFColor(new Color(146, 208, 80)); XSSFCellStyle cloneStyle = ht.getWorkbook().createCellStyle();cloneStyle = (XSS
阅读全文
摘要:1、添加pom依赖 <dependency> <groupId>com.github.rholder</groupId> <artifactId>guava-retrying</artifactId> <version>2.0.0</version></dependency> 2、Guava Ret
阅读全文
摘要:1、实体类中添加version字段及相关注解 @Version@TableField(fill = FieldFill.INSERT)//第一次添加数据时使其有个默认值1private Integer version; 2、添加配置类 import com.baomidou.mybatisplus.
阅读全文
摘要:1、从数据结构获取 > get 2、从数据库获取 > find、query 3、通过计算获取 > calculate、cal 4、从配置文件获取 > load、parse、build 5、从网络获取 > fetch 搜索 复制
阅读全文
摘要:if (a.compareTo(b) == -1) { System.out.println("a小于b");}if (a.compareTo(b) == 0) { System.out.println("a等于b");}if (a.compareTo(b) == 1) { System.out.p
阅读全文
摘要:@SqlParser(filter = true) 在mybatis-plus最新版本3.4中标记为过时 替换注解为 @InterceptorIgnore 使用方式:@InterceptorIgnore(tenantLine = "true") 基于注解的mapper查询中使用 搜索 复制
阅读全文
摘要:import com.baomidou.mybatisplus.annotation.EnumValue;import com.fasterxml.jackson.annotation.JsonCreator;import com.fasterxml.jackson.annotation.JsonV
阅读全文

浙公网安备 33010602011771号