摘要:
-- oracle分组排序取出每组顺序第一条 select * from ( select row_number() over(partition by user_code order by create_time desc) rn, t.* from your_table t ) where rn 阅读全文
摘要:
package com.lbdz.common.utils; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.regex.Mat 阅读全文
摘要:
-- oracle 列转行逗号分隔 select year, listagg(sales_amount, ',') within group (order by sales_amount) as sales_amounts from sales_data group by year 阅读全文
摘要:
-- 列转行拼接 select stuff((select ','+字段名 from 表名 for xml path('')),1,1,'') -- 示例 select stuff((select ','+user_name from t_user for xml path('')),1,1,'') 阅读全文
摘要:
//字符串集合 BigDecimal sum = strList.stream().map(BigDecimal::new).reduce(BigDecimal.ZERO, BigDecimal::add); //对象集合 BigDecimal sumValue = list.stream().ma 阅读全文
摘要:
struts2上传文件时,超过了默认文件大小 查看struts.properties配置文件(默认2M) 修改文件大小(例如100M)struts.multipart.maxSize=104857600 阅读全文
摘要:
List<Integer> list = new ArrayList<>(); int size = list.size(); int batchSize = 10; for (int i = 0; i < size; i += batchSize) { int fromIndex = i; int 阅读全文
摘要:
String str = "(20/84)*100"; ScriptEngine se = new ScriptEngineManager().getEngineByName("JavaScript"); try { Object eval = se.eval(str); System.out.pr 阅读全文
摘要:
BigDecimal decimal = new BigDecimal("3.116"); //四舍五入(>=5进位) BigDecimal decimal1 = decimal.setScale(2, BigDecimal.ROUND_HALF_UP); //四舍五入(>5进位) BigDecim 阅读全文
摘要:
List<Integer> list = new ArrayList<>(); list.add(1); list.add(2); list.add(3); //是否至少一个元素满足 boolean match = list.stream().anyMatch(i -> i > 2 && i < 6 阅读全文