package com.foreverwin.mesnac.meapi.service.impl;

import com.foreverwin.mesnac.meapi.dto.WorkCenterLinkDTO;
import com.foreverwin.modular.core.util.FrontPage;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.foreverwin.mesnac.meapi.model.WorkCenterMember;
import com.foreverwin.mesnac.meapi.mapper.WorkCenterMemberMapper;
import com.foreverwin.mesnac.meapi.service.WorkCenterMemberService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;
/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author Leon.L
 * @since 2021-05-26
 */
@Service
@Transactional(rollbackFor = Exception.class)
public class WorkCenterMemberServiceImpl extends ServiceImpl<WorkCenterMemberMapper, WorkCenterMember> implements WorkCenterMemberService {


    @Autowired
    private WorkCenterMemberMapper workCenterMemberMapper;

    @Override
    public IPage<WorkCenterMember> selectPage(FrontPage<WorkCenterMember> frontPage, WorkCenterMember workCenterMember) {
        QueryWrapper<WorkCenterMember> queryWrapper = new QueryWrapper<>();
        queryWrapper.setEntity(workCenterMember);
        return super.page(frontPage.getPagePlus(), queryWrapper);
    }

    @Override
    public List<WorkCenterMember> selectList(WorkCenterMember workCenterMember) {
        QueryWrapper<WorkCenterMember> queryWrapper = new QueryWrapper<>();
        queryWrapper.setEntity(workCenterMember);
        return super.list(queryWrapper);
    }

    @Override
    public List<WorkCenterMember> selectList(QueryWrapper queryWrapper) {
        return super.list(queryWrapper);
    }

    @Override
    public Integer selectMaxSeq(String workCenterBo) {
        return workCenterMemberMapper.selectMaxSeq(workCenterBo);
    }

    @Override
    public List<WorkCenterLinkDTO> listWorkCenterLink(String site) {
        return workCenterMemberMapper.listWorkCenterLink(site);
    }
}