| | |
| | | if(userId==1) |
| | | |
| | | lqw.orderByDesc(ArchiveRecords::getCreateTime); |
| | | // else |
| | | // lqw.eq(userId!=null, ArchiveRecords::getUserId, userId); |
| | | System.out.println("ssssssssssssddd0000000000000000"); |
| | | return lqw; |
| | | |
| | |
| | | Page<ArchiveRecords> page = new Page<>(pageNum, pageSize); |
| | | |
| | | // 使用自定义的分页查询方法,先连接再分页 |
| | | Page<ArchiveRecords> pageResult = this.baseMapper.selectJoinUserPage(page, userid, lqw); |
| | | |
| | | Page<ArchiveRecords> pageResult = new Page<>(); |
| | | if(userid==1) |
| | | pageResult = this.baseMapper.selectJoinUserPage(page, userid, lqw); |
| | | else |
| | | pageResult = this.baseMapper.selectJoinCommonUserPage(page, userid, lqw); |
| | | |
| | | //selectJoinUserPage(page, lqw); |
| | | |
| | |
| | | // log.info("从数据库中查到的为:{}", beanRecords); |
| | | // return markOwnData(familyId, fatherFaId, motherFaId, beanRecords); |
| | | |
| | | |
| | | List<ArchiveRecords> beanUserRecords = new ArrayList<>(); |
| | | beanRecords.forEach(record ->{ |
| | | if(record.isArchiveRecordsId()!=null&&record.getUserId()==userid) |
| | | { |
| | | record.setOwnData(true); |
| | | beanUserRecords.add(record); |
| | | } |
| | | else |
| | | record.setOwnData(false); |
| | |
| | | //不是管理员进行排序 |
| | | // if(userid != 1) |
| | | // Collections.sort(beanRecords, Comparator.comparing(ArchiveRecords::isOwnData)); |
| | | HashMap<String, Object> data = MapUtils.getResult(pageResult, beanRecords); |
| | | HashMap<String, Object> data = new HashMap<>(); |
| | | if(userid==1) |
| | | data = MapUtils.getResult(pageResult, beanRecords); |
| | | else |
| | | data = MapUtils.getResult(pageResult, beanUserRecords); |
| | | // System.out.println(data.get("data")); |
| | | // System.out.println(data.get("pageNum")); |
| | | // System.out.println(data.get("total")); |
| | |
| | | LambdaQueryWrapper<ArchiveRecords> lqw = new LambdaQueryWrapper<>(); |
| | | lqw.eq(!StringUtils.isEmpty(archiveRecords.getRecordId()), ArchiveRecords::getRecordId,archiveRecords.getRecordId()); |
| | | List<ArchiveRecords> list = list(lqw); |
| | | if (list.size() > 0) { |
| | | if (!list.isEmpty()) { |
| | | // throw new RuntimeException("请勿新增重复数据"); |
| | | //如果有重复数据,则根据recordId进行数据修改 |
| | | // if() |