package com.dayou.service.impl;

import com.dayou.entity.ItemBrokerageSequenceDetail;
import com.dayou.mapper.ItemBrokerageSequenceDetailMapper;
import com.dayou.service.IItemBrokerageSequenceDetailService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.dayou.vo.BrokerageSequenceDetailVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.dayou.utils.ExcelUtil;
import org.apache.poi.ss.usermodel.Cell;
import org.apache.poi.ss.usermodel.CellStyle;
import org.apache.poi.ss.usermodel.Row;
import org.apache.poi.ss.usermodel.Sheet;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import org.springframework.web.multipart.MultipartFile;
import java.util.List;
import java.util.ArrayList;
import org.springframework.transaction.annotation.Transactional;
import com.dayou.enums.BatchTaskTypeEnum;

/**
 * <p>
 * 提成流水明细表 服务实现类
 * </p>
 *
 * @author wucl
 * @since 2023-03-03
 */
@Service
public class ItemBrokerageSequenceDetailServiceImpl extends ServiceImpl<ItemBrokerageSequenceDetailMapper, ItemBrokerageSequenceDetail> implements IItemBrokerageSequenceDetailService {


    @Autowired
    private ItemBrokerageSequenceDetailMapper sequenceDetailMapper;
    @Override
    @SuppressWarnings("unchecked")
    public Page<BrokerageSequenceDetailVO> selectPage(Page page, BrokerageSequenceDetailVO brokerageSequenceDetailVO){
        Page<BrokerageSequenceDetailVO> xPage = sequenceDetailMapper.xPage(page,brokerageSequenceDetailVO);
        return xPage;
    }


    @Override
    public ItemBrokerageSequenceDetail detail(Long id){
        return this.getById(id);
    }

    @Override
    public Boolean add(ItemBrokerageSequenceDetail itemBrokerageSequenceDetail){
        return  this.save(itemBrokerageSequenceDetail);
    }

    @Override
    public Boolean update(ItemBrokerageSequenceDetail itemBrokerageSequenceDetail){
        return  this.updateById(itemBrokerageSequenceDetail);
    }

    @Override
    public Boolean delete(Long id){
        //逻辑删除
        return this.removeById(id);
    }

    @Override
    public List<BrokerageSequenceDetailVO> xList(BrokerageSequenceDetailVO brokerageSequenceDetailVO) {
        return sequenceDetailMapper.xList(brokerageSequenceDetailVO);
    }
}
