package com.njcn.advance.service.responsibility.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.njcn.advance.mapper.responsibility.RespUserDataIntegrityMapper;
import com.njcn.advance.pojo.param.UserDataIntegrityParam;
import com.njcn.advance.pojo.po.responsibility.RespUserDataIntegrity;
import com.njcn.advance.service.responsibility.IRespUserDataIntegrityService;
import com.njcn.web.factory.PageFactory;
import org.springframework.stereotype.Service;


/**
 * <p>
 * 服务实现类
 * </p>
 *
 * @author hongawen
 * @since 2023-07-13
 */
@Service
public class RespUserDataIntegrityServiceImpl extends ServiceImpl<RespUserDataIntegrityMapper, RespUserDataIntegrity> implements IRespUserDataIntegrityService {

    @Override
    public Page<RespUserDataIntegrity> userDataIntegrityList(UserDataIntegrityParam userDataIntegrityParam) {
        QueryWrapper<RespUserDataIntegrity> lambdaQueryWrapper = new QueryWrapper<>();
        lambdaQueryWrapper.eq("pqs_resp_user_data_integrity.user_data_id", userDataIntegrityParam.getUserDataId())
                .orderByDesc("pqs_resp_user_data_integrity.create_time");
        return this.baseMapper.page(new Page<>(PageFactory.getPageNum(userDataIntegrityParam), PageFactory.getPageSize(userDataIntegrityParam)), lambdaQueryWrapper);
    }
}
