package com.yxproject.start.service.impl;

import com.yxproject.start.entity.CountyListEntity;
import com.yxproject.start.mapper.CountyListMapper;
import com.yxproject.start.service.CountyListService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.List;
import java.util.Map;

/**
 * Created by liuxinben on 2018/11/6.13:42
 */

@Service
public class CountyListServiceImpl implements CountyListService {
    @Autowired
    public CountyListMapper countyListMapper;


    @Override
    public int reviseBoundCount(String county_List_Id, String out_Storage_Count, String in_Storage_Count) {
        int i= 0;
        if(out_Storage_Count.equals(0)&&!in_Storage_Count.equals(0)){
            i=countyListMapper.updateBoundCount(county_List_Id, out_Storage_Count, in_Storage_Count);
        }
        if(!out_Storage_Count.equals(0)&&in_Storage_Count.equals(0)){
            i=countyListMapper.updateBoundCount(county_List_Id, out_Storage_Count, in_Storage_Count);
        }
        if(!out_Storage_Count.equals(0)&&!in_Storage_Count.equals(0)){
            i=countyListMapper.updateBoundCount(county_List_Id, out_Storage_Count, in_Storage_Count);
        }
        return i;
    }

    @Override
    public List<CountyListEntity> getConnectList(String startDate,String endDate) {
        return countyListMapper.getConnectList(startDate,endDate);
    }
    @Override
    public List<CountyListEntity> findStorageCountByTaskListId(String taskListId){
        return countyListMapper.findStorageCountByTaskListId(taskListId);
    }


}