package com.ssm.manage.service.impl;

import com.ssm.manage.dao.RlRoleDao;
import com.ssm.manage.dto.RlRoleDto;
import com.ssm.manage.entity.RlRole;
import com.ssm.manage.service.RlRoleService;
import org.springframework.stereotype.Service;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.ssm.core.service.impl.BaseServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import com.ssm.manage.dao.BaseDao;

import java.util.List;

import tk.mybatis.mapper.entity.Example;

/**
 * 角色(RlRole)表服务实现类
 *
 * @author makejava
 * @since 2023-12-13 15:14:17
 */
@Service("rlRoleService")
public class RlRoleServiceImpl extends BaseServiceImpl<RlRole> implements RlRoleService {
    @Autowired
    private RlRoleDao rlRoleDao;

    @Override
    public BaseDao<RlRole> getDao() {
        return rlRoleDao;
    }

    @Override
    public PageInfo<RlRole> selectPage(RlRoleDto dto) {
        Example example = new Example(RlRole.class);
        Example.Criteria criteria = example.createCriteria();
        PageHelper.startPage(dto.getPageNum(), dto.getPageSize());
        List<RlRole> list = this.rlRoleDao.selectByExample(example);
        PageInfo<RlRole> pageInfo = new PageInfo<>(list);
        return pageInfo;
    }
}
