package com.ssm.manage.service.impl;

import com.ssm.manage.dao.StaffLevelsDao;
import com.ssm.manage.dto.StaffLevelsDto;
import com.ssm.manage.entity.StaffLevels;
import com.ssm.manage.service.StaffLevelsService;
import org.springframework.stereotype.Service;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
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 com.ssm.core.impl.BaseDaoImpl;

import java.io.Serializable;
import java.util.List;

import tk.mybatis.mapper.entity.Example;

/**
 * (StaffLevels)表服务实现类
 *
 * @author makejava
 * @since 2024-01-12 09:47:47
 */
@Service("staffLevelsService")
public class StaffLevelsServiceImpl extends BaseServiceImpl<StaffLevels> implements StaffLevelsService {
    @Autowired
    private StaffLevelsDao staffLevelsDao;

    @Override
    public BaseDao<StaffLevels> getDao() {
        return staffLevelsDao;
    }

    @Override
    public PageInfo<StaffLevels> selectPage(StaffLevelsDto dto) {
        Example example = new Example(StaffLevels.class);
        Example.Criteria criteria = example.createCriteria();
        criteria.andEqualTo(StaffLevelsDto.Fields.staffId,dto.getStaffId());
//        PageHelper.startPage(dto.getPageNum(), dto.getPageSize());
        List<StaffLevels> list = this.staffLevelsDao.selectByExample(example);
        PageInfo<StaffLevels> pageInfo = new PageInfo<>(list);
        return pageInfo;
    }
}
