zhitong.yu
2024-05-11 b72f8f8d58417eb6fb29672d8ac17cfafa46775c
src/main/java/com/hxzk/service/impl/TbAcHistroyPowerServiceImpl.java
@@ -34,11 +34,16 @@
    @Override
    public PageInfo<TbAcHistoryPower> findSearch(Integer page, Integer limit, TbAcHistoryPower acHistoryPower) {
        QueryWrapper queryWrapper = new QueryWrapper<>();
        queryWrapper.orderByDesc("addtime");
        queryWrapper.like("anchorId",acHistoryPower.getAnchorId());
        PageHelper.startPage(page,limit);
        List<TbAcHistoryPower> cardList = baseMapper.selectList(queryWrapper);
        List<TbAcHistoryPower> cardList = null;
        if (acHistoryPower.getAddtime() == null){
            LocalDate currentDate = LocalDate.now();
            DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyyMMdd");
            String formattedDate = currentDate.format(formatter);
            acHistoryPower.setAddtime(formattedDate);
            cardList = acHistroyPowerDao.findSearch(acHistoryPower);
        }else{
            cardList = acHistroyPowerDao.findSearch(acHistoryPower);
        }
        PageInfo<TbAcHistoryPower> info = new PageInfo<>(cardList);
        return info;
    }