rain
2024-06-04 bb3652e04f5a66172d0a6cd6ec2535b82e7ca2ed
src/main/java/com/dji/sample/patches/service/impl/GetPatchesServiceImpl.java
@@ -1,7 +1,6 @@
package com.dji.sample.patches.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.dji.sample.common.model.Pagination;
import com.dji.sample.common.model.PaginationData;
@@ -11,10 +10,10 @@
import com.dji.sample.patches.model.Param.PatchesParam;
import com.dji.sample.patches.model.entity.LotInfo;
import com.dji.sample.patches.service.GetPatchesService;
import com.dji.sample.wayline.model.entity.WaylineFileEntity;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;
@@ -33,13 +32,30 @@
     */
    @Override
    public PaginationData<LotInfo> limitGet(PatchesParam param) {
        Page<LotInfo> page = mapper.selectPage(new Page<LotInfo>(param.getPage(), param.getPageSize()),
                new LambdaQueryWrapper<LotInfo>()
                        .eq(LotInfo::getWorkspaceId, param.getWorkspaceId()));
        List<LotInfo> records = page.getRecords()
                .stream()
                .collect(Collectors.toList());
        return new PaginationData<LotInfo>(records, new Pagination(page));
        if (param.getIsPlan() != null) {
            Page<LotInfo> page = mapper.selectPage(new Page<LotInfo>(param.getPage(), param.getPageSize()),
                    new LambdaQueryWrapper<LotInfo>()
                            .eq(LotInfo::getWorkspaceId, param.getWorkspaceId())
                            .like(LotInfo::getDkbh, param.getDkbh())
                            .like(LotInfo::getXzqdm, param.getXzqdm())
                            .like(LotInfo::getBsm,param.getBsm())
                            .eq(LotInfo::getIsPlan, param.getIsPlan()));
            List<LotInfo> records = page.getRecords()
                    .stream()
                    .collect(Collectors.toList());
            return new PaginationData<LotInfo>(records, new Pagination(page));
        } else {
            Page<LotInfo> page = mapper.selectPage(new Page<LotInfo>(param.getPage(), param.getPageSize()),
                    new LambdaQueryWrapper<LotInfo>()
                            .eq(LotInfo::getWorkspaceId, param.getWorkspaceId())
                            .like(LotInfo::getDkbh, param.getDkbh())
                            .like(LotInfo::getBsm,param.getBsm())
                            .like(LotInfo::getXzqdm, param.getXzqdm()));
            List<LotInfo> records = page.getRecords()
                    .stream()
                    .collect(Collectors.toList());
            return new PaginationData<LotInfo>(records, new Pagination(page));
        }
    }
    @Override