package com.hfkj.service.order.impl;

import com.hfkj.dao.BsOrderOutsideMapper;
import com.hfkj.entity.BsOrderGoods;
import com.hfkj.entity.BsOrderOutside;
import com.hfkj.service.order.BsOrderOutsideService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.Date;
import java.util.List;
import java.util.Map;

@Service("bsOrderOutsideService")
public class BsOrderOutsideServiceImpl implements BsOrderOutsideService {
    @Resource
    private BsOrderOutsideMapper bsOrderOutsideMapper;

    @Override
    public void create(BsOrderOutside orderOutside) {
        bsOrderOutsideMapper.insert(orderOutside);
    }

    @Override
    public void update(BsOrderOutside orderOutside) {
        bsOrderOutsideMapper.updateByPrimaryKey(orderOutside);
    }

    @Override
    public void delete(Long id, Boolean fullDelete) {
        if (fullDelete) {
            bsOrderOutsideMapper.deleteByPrimaryKey(id);
        } else {
            BsOrderOutside orderOutside = queryDetail(id);
            orderOutside.setStatus(0);
            orderOutside.setUpdateTime(new Date());
            update(orderOutside);
        }
    }

    @Override
    public BsOrderOutside queryDetail(Long id) {
        return bsOrderOutsideMapper.selectByPrimaryKey(id);
    }

    @Override
    public BsOrderOutside queryDetailByMap(Map<String, Object> map) {
        return null;
    }

    @Override
    public List<BsOrderOutside> getList(Map<String, Object> map) {
        return null;
    }
}
