package com.ssm.manage.service.impl;

import com.ssm.manage.dao.WorkShopDao;
import com.ssm.manage.entity.WorkShop;
import com.ssm.manage.service.WorkShopService;
import dto.WorkShopDto;
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;

/**
 * (WorkShop)表服务实现类
 *
 * @author makejava
 * @since 2023-12-16 11:07:01
 */
@Service("workShopService")
public class WorkShopServiceImpl extends BaseServiceImpl<WorkShop> implements WorkShopService {
    @Autowired
    private WorkShopDao workShopDao;

    @Override
    public BaseDao<WorkShop> getDao() {
        return workShopDao;
    }

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