package com.cyl.zhanggui.service.impl;

import com.baomidou.dynamic.datasource.annotation.DS;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.cyl.zhanggui.domain.SysUserLinkPtlAgreement;
import com.cyl.zhanggui.mapper.SysUserLinkPtlAgreementMapper;
import com.cyl.zhanggui.service.SysUserLinkPtlAgreementService;
import com.github.pagehelper.PageHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Service;
import java.util.List;

/**
 *  @version
 *  @author: hxl
 *  @Date: 2024/7/22 10:35
 *  @Description: 测试动态数据源
 */
@Service
@DS("zhanggui")
public class SysUserLinkPtlAgreementServiceImpl extends ServiceImpl<SysUserLinkPtlAgreementMapper, SysUserLinkPtlAgreement> implements SysUserLinkPtlAgreementService {


    @Autowired
    private SysUserLinkPtlAgreementMapper sysUserLinkPtlAgreementMapper;


    @Override
    public List<SysUserLinkPtlAgreement> selectList(SysUserLinkPtlAgreement query, Pageable page) {
        if (page != null) {
            PageHelper.startPage(page.getPageNumber() + 1, page.getPageSize());
        }
        QueryWrapper<SysUserLinkPtlAgreement> qw = new QueryWrapper<>();
        return sysUserLinkPtlAgreementMapper.selectList(qw);
    }
}
