package cn.superdesk.uniorder.service.operationCenter.impl;

import cn.superdesk.uniorder.dao.entity.operationCenter.UnifiedCenterCustomer;
import cn.superdesk.uniorder.dao.mapper.operationCenter.UnifiedCenterCustomerMapper;
import cn.superdesk.uniorder.dto.param.operationCenter.customer.OperationCenterCustomerParam;
import cn.superdesk.uniorder.dto.vo.operationCenter.base.OperationCenterVo;
import cn.superdesk.uniorder.dto.vo.operationCenter.customer.OpCenterCustomerOperatorOrgVo;
import cn.superdesk.uniorder.dto.vo.operationCenter.customer.OperationCenterCustomerVo;
import cn.superdesk.uniorder.dto.vo.operationCenter.customer.OperationCenterPaymentCustomerVo;
import cn.superdesk.uniorder.service.operationCenter.OperationCenterCustomerService;
import com.github.pagehelper.PageInfo;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

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

/**
 * @Author : zx
 * @Create : 2023/4/11 09:38
 * Description :
 */
@Slf4j
@Service
@RequiredArgsConstructor
public class OperationCenterCustomerServiceImpl implements OperationCenterCustomerService {
    private final UnifiedCenterCustomerMapper unifiedCenterCustomerMapper;
    @Override
    public int insertSelective(UnifiedCenterCustomer unifiedCenterCustomer) {
        return unifiedCenterCustomerMapper.insertSelective(unifiedCenterCustomer);
    }

    @Override
    public int updateByPrimaryKeySelective(UnifiedCenterCustomer unifiedCenterCustomer) {
        return unifiedCenterCustomerMapper.updateByPrimaryKeySelective(unifiedCenterCustomer);
    }

    @Override
    public void deleteObj(Long id) {
        unifiedCenterCustomerMapper.deleteByPrimaryKey(id);
    }

    @Override
    public UnifiedCenterCustomer findById(Long id) {
        return unifiedCenterCustomerMapper.selectByPrimaryKey(id);
    }

    @Override
    public List<UnifiedCenterCustomer> findAll(Map<String, Object> queryMap) {
        return null;
    }

    @Override
    public PageInfo<UnifiedCenterCustomer> findByPaging(Map<String, Object> params, Integer pageNo, Integer pageSize) {
        return null;
    }

    @Override
    public List<OperationCenterCustomerVo> getOperationCenterCustomerList(OperationCenterCustomerParam param) {
        return unifiedCenterCustomerMapper.getOperationCenterCustomerList(param);
    }

    @Override
    public UnifiedCenterCustomer selectCustomerByCustomerName(String customerName, Long customerId) {
        return unifiedCenterCustomerMapper.selectCustomerByCustomerName(customerName,customerId);
    }

    @Override
    public List<OperationCenterVo> selectAllCustomerIdAndName() {
        return unifiedCenterCustomerMapper.selectAllCustomerIdAndName();
    }

    @Override
    public List<OperationCenterPaymentCustomerVo> findAllCustomer(OperationCenterCustomerParam param) {
        return unifiedCenterCustomerMapper.findAllCustomer(param);
    }

    /**
     * 通过条件查询 客户-运营商-项目---关联关系
     * @param conditions
     * @return
     */
    @Override
    public List<OpCenterCustomerOperatorOrgVo> getLinkOperatorAndOrg(Map<String, Object> conditions) {
        return unifiedCenterCustomerMapper.getLinkOperatorAndOrg(conditions);
    }
}
