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

import com.foreverwin.mesnac.common.dto.SfcDispatchDto;
import com.foreverwin.mesnac.dispatch.model.ShopOrderRelease;
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.dispatch.model.CallItem;
import com.foreverwin.mesnac.dispatch.mapper.CallItemMapper;
import com.foreverwin.mesnac.dispatch.service.CallItemService;
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-24
 */
@Service
@Transactional(rollbackFor = Exception.class)
public class CallItemServiceImpl extends ServiceImpl<CallItemMapper, CallItem> implements CallItemService {


    @Autowired
    private CallItemMapper callItemMapper;

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

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

    @Override
    public void saveCallItem(String site, String user, List<SfcDispatchDto> sfcDispatchList) {
        if (sfcDispatchList == null || sfcDispatchList.size() <= 0) {
            return;
        }


    }


}