20220307
- list取参数计算总数
//计算TotalRevenue //resultData.setTotalRevenue(resultData.getClientCommissions().stream().map(ClientCommission::getTotalRevenue).reduce(BigDecimal.ZERO, BigDecimal::add));
2.localdate时间计算
((detail.getPaymentStartDate() == null ? LocalDate.now() : detail.getPaymentStartDate()).until(LocalDate.now(), ChronoUnit.DAYS) > 365)
3.mybatis
匹配筛选条件
mapper: IPage commissionResultMapper(Page<?> page, @Param(“params”) DefaultReportParams params ,@Param(“result”) List result);
1)单个对象字段包含多个值集合
AND clientName IN
#{item}
2)多个对象集合匹配筛选条件
AND
( client = #{item.client} AND clientArea = #{item.clientArea} AND clientName = SUBSTRING_INDEX(#{item.clientName} ,’(’, 1 ))
字段截取
1.日期
LEFT ( STR_TO_DATE( monthOfYear, ‘%Y%m’ ), 7 ) AS commissionEndDate 结果:202203》》》》2022-03
2.字符
clientName = SUBSTRING_INDEX(#{item.clientName} ,’(’, 1 ) 截取从左往右第一个( 前的字符