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

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.Sfc;
import com.foreverwin.mesnac.meapi.mapper.SfcMapper;
import com.foreverwin.mesnac.meapi.service.SfcService;
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-06-02
 */
@Service
@Transactional(rollbackFor = Exception.class)
public class SfcServiceImpl extends ServiceImpl<SfcMapper, Sfc> implements SfcService {


    @Autowired
    private SfcMapper sfcMapper;

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

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

    @Override
    public List<Sfc> getSfcListByShopOrderBo(String shopOrderBo) {
        QueryWrapper<Sfc> queryWrapper = new QueryWrapper<>();
        Sfc sfc = new Sfc();
        sfc.setShopOrderBo(shopOrderBo);
        queryWrapper.setEntity(sfc);
        return super.list(queryWrapper);
    }

    @Override
    public List<Sfc> getSfcListByResrceBO(String resrceBO) {
        List<Sfc> sfc=sfcMapper.getSfcListByResrceBO(resrceBO);
        return sfc;
    }


}