package com.fs.qw.service.impl;

import com.fs.qw.domain.QwExternalContactCrm;
import com.fs.qw.mapper.QwExternalContactCrmMapper;
import com.fs.qw.param.QwCrmCourseStudyDetailParams;
import com.fs.qw.param.QwCrmCourseStudyParams;
import com.fs.qw.service.IQwExternalContactCrmService;
import com.fs.qw.vo.QwCrmCourseStudyVO;
import com.fs.qw.vo.QwExternalContactCrmVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 企微客户-绑CRMService业务层处理
 * 
 * @author fs
 * @date 2024-08-09
 */
@Service
public class QwExternalContactCrmServiceImpl implements IQwExternalContactCrmService 
{
    @Autowired
    private QwExternalContactCrmMapper qwExternalContactCrmMapper;

    /**
     * 查询企微客户-绑CRM
     * 
     * @param id 企微客户-绑CRM主键
     * @return 企微客户-绑CRM
     */
    @Override
    public QwExternalContactCrm selectQwExternalContactCrmById(Long id)
    {
        return qwExternalContactCrmMapper.selectQwExternalContactCrmById(id);
    }

    /**
     * 查询企微客户-绑CRM列表
     * 
     * @param qwExternalContactCrm 企微客户-绑CRM
     * @return 企微客户-绑CRM
     */
    @Override
    public List<QwExternalContactCrmVO> selectQwExternalContactCrmListVO(QwExternalContactCrm qwExternalContactCrm)
    {
        return qwExternalContactCrmMapper.selectQwExternalContactCrmListVO(qwExternalContactCrm);
    }

    /**
     * 新增企微客户-绑CRM
     * 
     * @param qwExternalContactCrm 企微客户-绑CRM
     * @return 结果
     */
    @Override
    public int insertQwExternalContactCrm(QwExternalContactCrm qwExternalContactCrm)
    {
        return qwExternalContactCrmMapper.insertQwExternalContactCrm(qwExternalContactCrm);
    }

    /**
     * 修改企微客户-绑CRM
     * 
     * @param qwExternalContactCrm 企微客户-绑CRM
     * @return 结果
     */
    @Override
    public int updateQwExternalContactCrm(QwExternalContactCrm qwExternalContactCrm)
    {
        return qwExternalContactCrmMapper.updateQwExternalContactCrm(qwExternalContactCrm);
    }

    /**
    * 新增或修改企微客户-绑CRM
    */
    @Override
    public int insertOrUpdateQwExternalContactCrm(QwExternalContactCrm qwExternalContactCrm) {
        return qwExternalContactCrmMapper.insertOrUpdateQwExternalContactCrm(qwExternalContactCrm);
    }

    /**
     * 批量删除企微客户-绑CRM
     * 
     * @param ids 需要删除的企微客户-绑CRM主键
     * @return 结果
     */
    @Override
    public int deleteQwExternalContactCrmByIds(Long[] ids)
    {
        return qwExternalContactCrmMapper.deleteQwExternalContactCrmByIds(ids);
    }

    /**
     * 删除企微客户-绑CRM信息
     * 
     * @param id 企微客户-绑CRM主键
     * @return 结果
     */
    @Override
    public int deleteQwExternalContactCrmById(Long id)
    {
        return qwExternalContactCrmMapper.deleteQwExternalContactCrmById(id);
    }

    /**
     * 课程旅程 获取绑定了CRM（CRM绑定了小程序）的企业微信客户的课程列表
     */
    @Override
    public List<QwCrmCourseStudyVO> getQwCrmCourseStudyList(QwCrmCourseStudyParams qwFsUserParam) {
        return qwExternalContactCrmMapper.getQwCrmCourseStudyList(qwFsUserParam);

    }

    @Override
    public List<QwCrmCourseStudyVO> getQwCrmCourseStudyDetail(QwCrmCourseStudyDetailParams studyDetailParams) {
        return qwExternalContactCrmMapper.getQwCrmCourseStudyDetail(studyDetailParams);
    }
}
