All Downloads are FREE. Search and download functionalities are using the official Maven repository.

k.e.book.ddh.service.CcAreaService Maven / Gradle / Ivy


package k.e.book.ddh.service;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import k.e.book.ddh.entity.CcAreaDO;
import k.e.book.ddh.entity.CcAreaQueryDTO;
import k.e.book.ddh.mapper.CcAreaMapper;
import org.springframework.stereotype.Service;

/**
 * @author kk
 * @date 2023-05-21 11:04
 */
@Service
public class CcAreaService extends ServiceImpl {

    public IPage selectProductPage(CcAreaQueryDTO dto) {
        LambdaQueryWrapper qr = new LambdaQueryWrapper<>();

        if(dto.getId() != null){
            qr.eq(CcAreaDO::getId, dto.getId());
        }
        if(dto.getPid() != null){
            qr.eq(CcAreaDO::getPid, dto.getPid());
        }
        if(dto.getShortname() != null){
            qr.eq(CcAreaDO::getShortname, dto.getShortname());
        }
        if(dto.getName() != null){
            qr.eq(CcAreaDO::getName, dto.getName());
        }
        if(dto.getMergename() != null){
            qr.eq(CcAreaDO::getMergename, dto.getMergename());
        }
        if(dto.getLevel() != null){
            qr.eq(CcAreaDO::getLevel, dto.getLevel());
        }
        if(dto.getPinyin() != null){
            qr.eq(CcAreaDO::getPinyin, dto.getPinyin());
        }
        if(dto.getCode() != null){
            qr.eq(CcAreaDO::getCode, dto.getCode());
        }
        if(dto.getZip() != null){
            qr.eq(CcAreaDO::getZip, dto.getZip());
        }
        if(dto.getFirst() != null){
            qr.eq(CcAreaDO::getFirst, dto.getFirst());
        }
        if(dto.getLng() != null){
            qr.eq(CcAreaDO::getLng, dto.getLng());
        }
        if(dto.getLat() != null){
            qr.eq(CcAreaDO::getLat, dto.getLat());
        }

        qr.orderByDesc(CcAreaDO::getId);
        IPage page = new Page<>();
        page.setCurrent(dto.getPage());
        page.setSize(dto.getLimit());
        return baseMapper.selectPage(page, qr);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy