07 2024 档案
摘要:代码中如下 if (StrUtil.isEmpty(orderQueryReq.getSort()) || !"desc".equals(orderQueryReq.getSort())){ orderQueryReq.setSort("asc"); } // xml里面写的如下: SELECT a
阅读全文
摘要:LambdaQueryWrapper<SpotCheck> queryWrapper = new LambdaQueryWrapper<>(); queryWrapper.in(SpotCheck::getCheckCode,checkCodes); List<SpotCheck> spotChec
阅读全文
摘要:@Getter public enum DeviceCategoryEnum { METER_DEVICE("10","计量设备"), PRODUCT_DEVICE("20","生产设备"), CHECK_DEVICE("30","检测设备"), OTHER("40","其他"); private
阅读全文
摘要:List<String> collect = Arrays.asList("aaa","ddd","dd");String join = String.join(",", collect);System.out.println("join = " + join);
阅读全文
摘要:最近工作中老是遇到,有个模糊查询要查询子表数据的,但只展示主表数据,今天在此记录下 List<String> productCodes = new ArrayList<>(); // 先去查询子表数据 if (StrUtil.isNotEmpty(pageProductQueryReq.getFor
阅读全文
摘要:实际使用中,经常遇到一个for循环里面,会有去查询数据库,为了防止这个动作,可以提前将要查询的数据查询出来,然后通过stream中的map.get(key)的方式去匹配对应 代码如下,可做参考: // 第一种是map<String,Object>List<WorkstationGroup> work
阅读全文
摘要:List<DeviceSpotCheck> deviceSpotCheckList = listMap.get(deviceCode); List<String> collect = deviceSpotCheckList.stream().map(DeviceSpotCheck::getCheck
阅读全文
摘要:LambdaQueryWrapper<MaintenancePlan> wrapper = new LambdaQueryWrapper<>(); if (StrUtil.isNotEmpty(queryReq.getSearchCodeAndName())){ wrapper.and(e -> e
阅读全文