package com.chushang.system.service.impl;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.chushang.common.mybatis.page.CommonParam;
import com.chushang.common.mybatis.utils.PageResult;
import com.chushang.common.mybatis.utils.WrapperUtils;
import com.chushang.system.entity.po.SysLoginInfo;
import com.chushang.system.entity.query.SysLoginInfoQuery;
import com.chushang.system.mapper.SysLoginInfoMapper;
import com.chushang.system.service.SysLoginInfoService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import java.util.List;

@Slf4j
@Service
public class SysLoginInfoServiceImpl extends ServiceImpl<SysLoginInfoMapper, SysLoginInfo> implements SysLoginInfoService {


    @Override
    public PageResult pageList(SysLoginInfoQuery query) {
        WrapperUtils.buildSql(query);
        CommonParam commonParam = CommonParam.buildPageRequest();
        Page<SysLoginInfo> page = new Page<>(commonParam.getPage(), commonParam.getLimit());
        List<SysLoginInfo> terminalVOS = baseMapper.pageList(query, page);
        return new PageResult(terminalVOS, page);
    }
}
