package com.njcn.product.advance.responsility.service.impl;

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.product.advance.responsility.mapper.RespUserDataIntegrityMapper;
import com.njcn.product.advance.responsility.pojo.param.UserDataIntegrityParam;
import com.njcn.product.advance.responsility.pojo.po.RespUserDataIntegrity;
import com.njcn.product.advance.responsility.service.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").like("pqs_resp_user_data_integrity.user_name",userDataIntegrityParam.getSearchValue());
        return this.baseMapper.page(new Page<>(PageFactory.getPageNum(userDataIntegrityParam), PageFactory.getPageSize(userDataIntegrityParam)), lambdaQueryWrapper);
    }
}
