package com.dgtly.system.service.impl;

import java.util.List;
import com.dgtly.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.dgtly.system.mapper.OrderTucEarlyWarningMapper;
import com.dgtly.system.domain.OrderTucEarlyWarning;
import com.dgtly.system.service.IOrderTucEarlyWarningService;
import com.dgtly.common.core.text.Convert;

/**
 * 预警业绩进度指标Service业务层处理
 * 
 * @author njs
 * @date 2024-02-04
 */
@Service
public class OrderTucEarlyWarningServiceImpl implements IOrderTucEarlyWarningService 
{
    @Autowired
    private OrderTucEarlyWarningMapper orderTucEarlyWarningMapper;

    /**
     * 查询预警业绩进度指标
     * 
     * @param earlyId 预警业绩进度指标ID
     * @return 预警业绩进度指标
     */
    @Override
    public OrderTucEarlyWarning selectOrderTucEarlyWarningById(Long earlyId)
    {
        return orderTucEarlyWarningMapper.selectOrderTucEarlyWarningById(earlyId);
    }

    /**
     * 查询预警业绩进度指标列表
     * 
     * @param orderTucEarlyWarning 预警业绩进度指标
     * @return 预警业绩进度指标
     */
    @Override
    public List<OrderTucEarlyWarning> selectOrderTucEarlyWarningList(OrderTucEarlyWarning orderTucEarlyWarning)
    {
        return orderTucEarlyWarningMapper.selectOrderTucEarlyWarningList(orderTucEarlyWarning);
    }

    /**
     * 新增预警业绩进度指标
     * 
     * @param orderTucEarlyWarning 预警业绩进度指标
     * @return 结果
     */
    @Override
    public int insertOrderTucEarlyWarning(OrderTucEarlyWarning orderTucEarlyWarning)
    {
        orderTucEarlyWarning.setCreateTime(DateUtils.getNowDate());
        return orderTucEarlyWarningMapper.insertOrderTucEarlyWarning(orderTucEarlyWarning);
    }

    /**
     * 修改预警业绩进度指标
     * 
     * @param orderTucEarlyWarning 预警业绩进度指标
     * @return 结果
     */
    @Override
    public int updateOrderTucEarlyWarning(OrderTucEarlyWarning orderTucEarlyWarning)
    {
        orderTucEarlyWarning.setUpdateTime(DateUtils.getNowDate());
        return orderTucEarlyWarningMapper.updateOrderTucEarlyWarning(orderTucEarlyWarning);
    }

    /**
     * 删除预警业绩进度指标对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteOrderTucEarlyWarningByIds(String ids)
    {
        return orderTucEarlyWarningMapper.deleteOrderTucEarlyWarningByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除预警业绩进度指标信息
     * 
     * @param earlyId 预警业绩进度指标ID
     * @return 结果
     */
    @Override
    public int deleteOrderTucEarlyWarningById(Long earlyId)
    {
        return orderTucEarlyWarningMapper.deleteOrderTucEarlyWarningById(earlyId);
    }

    /**
     * @param orgCode
     * @description: 根据组织编码查业绩指标
     * @param: [orgCode]
     * @return: com.dgtly.system.domain.OrderTucEarlyWarning
     * @author: njs
     * @date: 2024/2/4 9:50
     */
    @Override
    public OrderTucEarlyWarning selectOrderTucEarlyWarning(String orgCode) {
        return orderTucEarlyWarningMapper.selectOrderTucEarlyWarning(orgCode);
    }
}
