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

k.e.book.ddh.service.CcUserMoneyLogService 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.CcUserMoneyLogDO;
import k.e.book.ddh.entity.CcUserMoneyLogQueryDTO;
import k.e.book.ddh.mapper.CcUserMoneyLogMapper;
import org.springframework.stereotype.Service;

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

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

        if(dto.getId() != null){
            qr.eq(CcUserMoneyLogDO::getId, dto.getId());
        }
        if(dto.getUserId() != null){
            qr.eq(CcUserMoneyLogDO::getUserId, dto.getUserId());
        }
        if(dto.getMoney() != null){
            qr.eq(CcUserMoneyLogDO::getMoney, dto.getMoney());
        }
        if(dto.getBefore() != null){
            qr.eq(CcUserMoneyLogDO::getBefore, dto.getBefore());
        }
        if(dto.getAfter() != null){
            qr.eq(CcUserMoneyLogDO::getAfter, dto.getAfter());
        }
        if(dto.getMemo() != null){
            qr.eq(CcUserMoneyLogDO::getMemo, dto.getMemo());
        }
        if(dto.getCreatetime() != null){
            qr.eq(CcUserMoneyLogDO::getCreatetime, dto.getCreatetime());
        }

        qr.orderByDesc(CcUserMoneyLogDO::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