package com.fs.company.service.impl;

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

import com.alibaba.fastjson.JSONObject;
import com.fs.common.annotation.DataScope;
import com.fs.company.param.CompanyStatisticsParam;
import com.fs.company.param.CompanyVoiceLogsListQueryParam;
import com.fs.company.param.CompanyVoiceLogsParam;
import com.fs.company.vo.CompanyVoiceLogsExportVO;
import com.fs.company.vo.CompanyVoiceLogsListVO;
import com.fs.company.vo.CompanyVoiceLogsStatisticsVO;
import com.fs.company.vo.CompanyVoiceLogsVO;
import lombok.Data;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.fs.company.mapper.CompanyVoiceLogsMapper;
import com.fs.company.domain.CompanyVoiceLogs;
import com.fs.company.service.ICompanyVoiceLogsService;

/**
 * 通话记录Service业务层处理
 *
 * @author fs
 * @date 2021-10-04
 */
@Service
public class CompanyVoiceLogsServiceImpl implements ICompanyVoiceLogsService
{
    @Autowired
    private CompanyVoiceLogsMapper companyVoiceLogsMapper;

    /**
     * 查询通话记录
     *
     * @param voiceId 通话记录ID
     * @return 通话记录
     */
    @Override
    public CompanyVoiceLogs selectCompanyVoiceLogsById(Long voiceId)
    {
        return companyVoiceLogsMapper.selectCompanyVoiceLogsById(voiceId);
    }

    /**
     * 查询通话记录列表
     *
     * @param companyVoiceLogs 通话记录
     * @return 通话记录
     */
    @Override
    public List<CompanyVoiceLogs> selectCompanyVoiceLogsList(CompanyVoiceLogs companyVoiceLogs)
    {
        return companyVoiceLogsMapper.selectCompanyVoiceLogsList(companyVoiceLogs);
    }

    /**
     * 新增通话记录
     *
     * @param companyVoiceLogs 通话记录
     * @return 结果
     */
    @Override
    public int insertCompanyVoiceLogs(CompanyVoiceLogs companyVoiceLogs)
    {
        return companyVoiceLogsMapper.insertCompanyVoiceLogs(companyVoiceLogs);
    }

    /**
     * 修改通话记录
     *
     * @param companyVoiceLogs 通话记录
     * @return 结果
     */
    @Override
    public int updateCompanyVoiceLogs(CompanyVoiceLogs companyVoiceLogs)
    {
        return companyVoiceLogsMapper.updateCompanyVoiceLogs(companyVoiceLogs);
    }

    /**
     * 批量删除通话记录
     *
     * @param voiceIds 需要删除的通话记录ID
     * @return 结果
     */
    @Override
    public int deleteCompanyVoiceLogsByIds(Long[] voiceIds)
    {
        return companyVoiceLogsMapper.deleteCompanyVoiceLogsByIds(voiceIds);
    }

    /**
     * 删除通话记录信息
     *
     * @param voiceId 通话记录ID
     * @return 结果
     */
    @Override
    public int deleteCompanyVoiceLogsById(Long voiceId)
    {
        return companyVoiceLogsMapper.deleteCompanyVoiceLogsById(voiceId);
    }

    @Override
    @DataScope(deptAlias = "u",userAlias = "u")
    public List<CompanyVoiceLogsVO> selectCompanyVoiceLogsVOList(CompanyVoiceLogsParam param) {
        return companyVoiceLogsMapper.selectCompanyVoiceLogsVOList(param);
    }

    @Override
    public List<CompanyVoiceLogsExportVO> selectCompanyVoiceLogsExportVOList(CompanyVoiceLogsParam param) {
        return companyVoiceLogsMapper.selectCompanyVoiceLogsExportVOList(param);
    }

    @Override
    public CompanyVoiceLogs selectCompanyVoiceLogsBySessionId(String sessionId) {
        return companyVoiceLogsMapper.selectCompanyVoiceLogsBySessionId(sessionId);
    }

    @Override
    public Integer selectCompanyVoiceLogsCount() {
        return companyVoiceLogsMapper.selectCompanyVoiceLogsCount();
    }

    @Override
    public Integer selectCompanyVoiceLogsCountByCallerMobile(String callerMobile,Integer type) {
        return companyVoiceLogsMapper.selectCompanyVoiceLogsCountByCallerMobile(callerMobile,type);
    }

    @Override
    public Integer selectCompanyVoiceLogsCountByCalleeMobile(String calleeNbr,Integer type) {
        return companyVoiceLogsMapper.selectCompanyVoiceLogsCountByCalleeMobile(calleeNbr,type);
    }

    @Override
    public List<CompanyVoiceLogsStatisticsVO> selectVoiceLogsStatisticsList(CompanyStatisticsParam param) {
        return companyVoiceLogsMapper.selectVoiceLogsStatisticsList(param);
    }

    @Override
    public List<JSONObject> selectVoiceLogsTotalCount(Map<String, Object> toMap) {
        return companyVoiceLogsMapper.selectVoiceLogsTotalCount(toMap);
    }

    @Override
    public List<CompanyVoiceLogsListVO> selectCompanyVoiceLogsListQuery(CompanyVoiceLogsListQueryParam param) {
        return companyVoiceLogsMapper.selectCompanyVoiceLogsListQuery(param);
    }
}
