package com.yijia.customer.service.impl;

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

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.yijia.customer.mapper.CustomerGradeSettingMapper;
import com.yijia.customer.domain.CustomerGradeSetting;
import com.yijia.customer.service.ICustomerGradeSettingService;

/**
 * 客户优惠等级设置Service业务层处理
 *
 * @author yijia
 * @date 2020-12-21
 */
@Service
public class CustomerGradeSettingServiceImpl implements ICustomerGradeSettingService
{
    @Autowired
    private CustomerGradeSettingMapper customerGradeSettingMapper;

    /*
     * 查询成长规则列表
     * @return
     */
    @Override
    public List<Map<String, Object>> getGrouthRuleList() {
        return customerGradeSettingMapper.getGrouthRuleList();
    }

    /*
     * 跟新成长规则
     * @return
     */
    @Override
    public int insertGrouthRule(Map map) {
        return customerGradeSettingMapper.insertGrouthRule(map);
    }

    /*
     * 更新成长规则
     * @return
     */
    @Override
    public int updateGrouthRule(Map map) {
        return customerGradeSettingMapper.updateGrouthRule(map);
    }

    /*
     * 根据ID删除成长规则
     * @return
     */
    @Override
    public int deleteGrouthRuleById(String id) {
        return customerGradeSettingMapper.deleteGrouthRuleById(id);
    }

    /*
     * 批量删除成长规则
     * @return
     */
    @Override
    public int deleteGrouthRuleByIds(Long[] ids) {
        return customerGradeSettingMapper.deleteGrouthRuleByIds(ids);
    }

    /**
     * 查询客户优惠等级设置
     *
     * @param id 客户优惠等级设置ID
     * @return 客户优惠等级设置
     */
    @Override
    public CustomerGradeSetting selectCustomerGradeSettingById(Long id)
    {
        return customerGradeSettingMapper.selectCustomerGradeSettingById(id);
    }

    /**
     * 查询客户优惠等级设置列表
     *
     * @param customerGradeSetting 客户优惠等级设置
     * @return 客户优惠等级设置
     */
    @Override
    public List<CustomerGradeSetting> selectCustomerGradeSettingList(CustomerGradeSetting customerGradeSetting)
    {
        return customerGradeSettingMapper.selectCustomerGradeSettingList(customerGradeSetting);
    }

    /**
     * 新增客户优惠等级设置
     *
     * @param customerGradeSetting 客户优惠等级设置
     * @return 结果
     */
    @Override
    public int insertCustomerGradeSetting(CustomerGradeSetting customerGradeSetting)
    {
        return customerGradeSettingMapper.insertCustomerGradeSetting(customerGradeSetting);
    }

    /**
     * 修改客户优惠等级设置
     *
     * @param customerGradeSetting 客户优惠等级设置
     * @return 结果
     */
    @Override
    public int updateCustomerGradeSetting(CustomerGradeSetting customerGradeSetting)
    {
        return customerGradeSettingMapper.updateCustomerGradeSetting(customerGradeSetting);
    }

    /**
     * 批量删除客户优惠等级设置
     *
     * @param ids 需要删除的客户优惠等级设置ID
     * @return 结果
     */
    @Override
    public int deleteCustomerGradeSettingByIds(Long[] ids)
    {
        return customerGradeSettingMapper.deleteCustomerGradeSettingByIds(ids);
    }

    /**
     * 删除客户优惠等级设置信息
     *
     * @param id 客户优惠等级设置ID
     * @return 结果
     */
    @Override
    public int deleteCustomerGradeSettingById(Long id)
    {
        return customerGradeSettingMapper.deleteCustomerGradeSettingById(id);
    }
}
