package com.chinaitop.depot.intelligent.fumigation.service.impl;

import com.chinaitop.depot.intelligent.fumigation.mapper.TFumigationProcessMapper;
import com.chinaitop.depot.intelligent.fumigation.model.TFumigationProcess;
import com.chinaitop.depot.intelligent.fumigation.model.TFumigationProcessExample;
import com.chinaitop.depot.intelligent.fumigation.service.FumigationProcessService;
import org.springframework.stereotype.Service;

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

/**
 * @author lvzhikai
 * @description: 熏蒸作业
 * @create 2019-1-15 11:00
 */
@Service
public class FumigationProcessServiceImpl implements FumigationProcessService {

    @Resource
    private TFumigationProcessMapper tFumigationProcessMapper;

    @Override
    public List<Map<String,Object>> getFumigationProcessList(Map<String, Object> map) {
        return tFumigationProcessMapper.getPesticideProcessList(map);
    }

    @Override
    public void add(TFumigationProcess tFumigationProcess) {
        tFumigationProcessMapper.insert(tFumigationProcess);
    }

    @Override
    public void update(TFumigationProcess tFumigationProcess) {
        tFumigationProcessMapper.updateByPrimaryKey(tFumigationProcess);
    }

    @Override
    public TFumigationProcess findById(String processId) {
        return tFumigationProcessMapper.selectByPrimaryKey(processId);
    }

    @Override
    public void updateByExample(TFumigationProcess tFumigationProcess, TFumigationProcessExample example) {
        tFumigationProcessMapper.updateByExampleSelective(tFumigationProcess, example);
    }

    @Override
    public List<TFumigationProcess> getDataByFumId(TFumigationProcessExample example) {
        return tFumigationProcessMapper.selectByExample(example);
    }
}
