package com.dgtly.system.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.dgtly.system.mapper.CustomersExtMapper;
import com.dgtly.system.domain.CustomersExt;
import com.dgtly.system.service.ICustomersExtService;
import com.dgtly.common.core.text.Convert;

/**
 * 经销商扩展Service业务层处理
 * 
 * @author dgtly
 * @date 2020-10-12
 */
@Service
public class CustomersExtServiceImpl implements ICustomersExtService 
{
    @Autowired
    private CustomersExtMapper customersExtMapper;

    /**
     * 查询经销商扩展
     * 
     * @param chainsCode 经销商扩展ID
     * @return 经销商扩展
     */
    @Override
    public CustomersExt selectCustomersExtById(String chainsCode)
    {
        return customersExtMapper.selectCustomersExtById(chainsCode);
    }

    /**
     * 查询经销商扩展列表
     * 
     * @param customersExt 经销商扩展
     * @return 经销商扩展
     */
    @Override
    public List<CustomersExt> selectCustomersExtList(CustomersExt customersExt)
    {
        return customersExtMapper.selectCustomersExtList(customersExt);
    }

    /**
     * 新增经销商扩展
     * 
     * @param customersExt 经销商扩展
     * @return 结果
     */
    @Override
    public int insertCustomersExt(CustomersExt customersExt)
    {
        return customersExtMapper.insertCustomersExt(customersExt);
    }

    /**
     * 修改经销商扩展
     * 
     * @param customersExt 经销商扩展
     * @return 结果
     */
    @Override
    public int updateCustomersExt(CustomersExt customersExt)
    {
        return customersExtMapper.updateCustomersExt(customersExt);
    }

    @Override
    public int updateCustomersIsAuthentication(String isAuthentication, String accountId) {
        return customersExtMapper.updateCustomersIsAuthentication(isAuthentication,accountId);
    }

    /**
     * 删除经销商扩展对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteCustomersExtByIds(String ids)
    {
        return customersExtMapper.deleteCustomersExtByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除经销商扩展信息
     * 
     * @param chainsCode 经销商扩展ID
     * @return 结果
     */
    @Override
    public int deleteCustomersExtById(String chainsCode)
    {
        return customersExtMapper.deleteCustomersExtById(chainsCode);
    }

    @Override
    public String selectOrgIdByOrderId(String orderId) {
        return customersExtMapper.selectOrgIdByOrderId(orderId);
    }

    @Override
    public String selectChainsCodeByOrderId(String customerCode) {
        return customersExtMapper.selectChainsCodeByOrderId(customerCode);
    }
}
