摘要: BigDecimal decimal = new BigDecimal("3.116"); //四舍五入(>=5进位) BigDecimal decimal1 = decimal.setScale(2, BigDecimal.ROUND_HALF_UP); //四舍五入(>5进位) BigDecim 阅读全文
posted @ 2024-06-28 17:47 一隅桥畔 阅读(1) 评论(0) 推荐(0) 编辑
摘要: List<Integer> list = new ArrayList<>(); list.add(1); list.add(2); list.add(3); //是否至少一个元素满足 boolean match = list.stream().anyMatch(i -> i > 2 && i < 6 阅读全文
posted @ 2024-06-28 16:41 一隅桥畔 阅读(1) 评论(0) 推荐(0) 编辑
摘要: List<String> list = new ArrayList<>(); List<BigDecimal> newList = list.stream().map(BigDecimal::new).collect(Collectors.toList()); 阅读全文
posted @ 2024-06-28 16:12 一隅桥畔 阅读(1) 评论(0) 推荐(0) 编辑
摘要: //数组去重 //优化遍历数组法 function uniqueArr(array) { var r = []; for (var i = 0, l = array.length; i < l; i++) { for (var j = i + 1; j < l; j++) if (array[i]. 阅读全文
posted @ 2024-04-26 15:44 一隅桥畔 阅读(11) 评论(0) 推荐(0) 编辑
摘要: Map<String, List<OperationNodeVo>> listMap = nodeVoList.stream().collect(Collectors.groupingBy(OperationNodeVo::getNodeCode)); 阅读全文
posted @ 2024-04-26 15:03 一隅桥畔 阅读(37) 评论(0) 推荐(0) 编辑
摘要: List<Map<String, Object>> list = new ArrayList<>(); Map<String, Object> map1 = new HashMap<>(); map1.put("name", "苹果"); map1.put("code", "apple"); lis 阅读全文
posted @ 2024-04-15 14:29 一隅桥畔 阅读(49) 评论(0) 推荐(0) 编辑
摘要: -- extract只能从date类型中提取年、月、日 -- 年 select extract(year from sysdate) from dual; -- 月 select extract(month from sysdate) from dual; -- 日 select extract(d 阅读全文
posted @ 2024-04-15 14:19 一隅桥畔 阅读(152) 评论(0) 推荐(0) 编辑
摘要: -- mysql生成uuid select uuid(); -- 替换- select replace(uuid(),'-',''); 阅读全文
posted @ 2024-04-01 17:19 一隅桥畔 阅读(15) 评论(0) 推荐(0) 编辑
摘要: -- sql server生成uuid select newid(); -- 替换- select replace(newid(),'-',''); 阅读全文
posted @ 2024-04-01 17:17 一隅桥畔 阅读(52) 评论(0) 推荐(0) 编辑
摘要: -- oracle生成uuid select sys_guid() from dual; -- 解决乱码 select rawtohex(sys_guid()) from dual; 阅读全文
posted @ 2024-04-01 17:16 一隅桥畔 阅读(69) 评论(0) 推荐(0) 编辑