|
|
@@ -0,0 +1,214 @@
|
|
|
+<?xml version="1.0" encoding="UTF-8" ?>
|
|
|
+<!DOCTYPE mapper
|
|
|
+PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
+"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
|
+<mapper namespace="com.fs.company.mapper.EasyCallInboundLlmMapper">
|
|
|
+
|
|
|
+ <resultMap id="InboundLlmResult" type="com.fs.company.vo.easycall.EasyCallInboundLlmVO">
|
|
|
+ <id property="id" column="id"/>
|
|
|
+ <result property="llmAccountId" column="llm_account_id"/>
|
|
|
+ <result property="inboundAlias" column="inbound_alias"/>
|
|
|
+ <result property="callee" column="callee"/>
|
|
|
+ <result property="voiceCode" column="voice_code"/>
|
|
|
+ <result property="voiceSource" column="voice_source"/>
|
|
|
+ <result property="serviceType" column="service_type"/>
|
|
|
+ <result property="asrProvider" column="asr_provider"/>
|
|
|
+ <result property="aiTransferType" column="ai_transfer_type"/>
|
|
|
+ <result property="aiTransferData" column="ai_transfer_data"/>
|
|
|
+ <result property="ivrId" column="ivr_id"/>
|
|
|
+ <result property="satisfSurveyIvrId" column="satisf_survey_ivr_id"/>
|
|
|
+ </resultMap>
|
|
|
+
|
|
|
+ <resultMap id="LlmAccountResult" type="com.fs.company.vo.easycall.EasyCallLlmAccountVO">
|
|
|
+ <id property="id" column="id"/>
|
|
|
+ <result property="name" column="name"/>
|
|
|
+ <result property="accountJson" column="account_json"/>
|
|
|
+ <result property="accountEntity" column="account_entity"/>
|
|
|
+ <result property="providerClassName" column="provider_class_name"/>
|
|
|
+ </resultMap>
|
|
|
+
|
|
|
+ <resultMap id="VoiceCodeResult" type="com.fs.company.vo.easycall.EasyCallVoiceCodeVO">
|
|
|
+ <result property="voiceCode" column="voice_code"/>
|
|
|
+ <result property="voiceName" column="voice_name"/>
|
|
|
+ <result property="voiceSource" column="voice_source"/>
|
|
|
+ </resultMap>
|
|
|
+
|
|
|
+ <resultMap id="BizGroupResult" type="com.fs.company.vo.easycall.EasyCallBizGroupVO">
|
|
|
+ <result property="groupId" column="group_id"/>
|
|
|
+ <result property="bizGroupName" column="biz_group_name"/>
|
|
|
+ </resultMap>
|
|
|
+
|
|
|
+ <resultMap id="GatewayResult" type="com.fs.company.vo.easycall.EasyCallGatewayVO">
|
|
|
+ <result property="id" column="id"/>
|
|
|
+ <result property="gwName" column="gw_name"/>
|
|
|
+ <result property="profileName" column="profile_name"/>
|
|
|
+ <result property="caller" column="caller"/>
|
|
|
+ <result property="calleePrefix" column="callee_prefix"/>
|
|
|
+ <result property="gwAddr" column="gw_addr"/>
|
|
|
+ <result property="codec" column="codec"/>
|
|
|
+ <result property="gwDesc" column="gw_desc"/>
|
|
|
+ <result property="purpose" column="purpose"/>
|
|
|
+ </resultMap>
|
|
|
+
|
|
|
+ <resultMap id="IvrResult" type="com.fs.company.vo.easycall.EasyCallIvrVO">
|
|
|
+ <result property="id" column="id"/>
|
|
|
+ <result property="ivrNodeName" column="node_name"/>
|
|
|
+ </resultMap>
|
|
|
+
|
|
|
+ <sql id="selectInboundLlmVo">
|
|
|
+ select id, llm_account_id, callee, voice_code, voice_source, service_type, asr_provider, ai_transfer_type, ai_transfer_data, ivr_id, satisf_survey_ivr_id, inbound_alias from cc_inbound_llm_account
|
|
|
+ </sql>
|
|
|
+
|
|
|
+ <select id="selectInboundLlmList" parameterType="com.fs.company.vo.easycall.EasyCallInboundLlmVO" resultMap="InboundLlmResult">
|
|
|
+ <include refid="selectInboundLlmVo"/>
|
|
|
+ <where>
|
|
|
+ <if test="llmAccountId != null">and llm_account_id = #{llmAccountId}</if>
|
|
|
+ <if test="callee != null and callee != ''">and callee = #{callee}</if>
|
|
|
+ <if test="inboundAlias != null and inboundAlias != ''">and inbound_alias = #{inboundAlias}</if>
|
|
|
+ <if test="voiceCode != null and voiceCode != ''">and voice_code = #{voiceCode}</if>
|
|
|
+ <if test="voiceSource != null and voiceSource != ''">and voice_source = #{voiceSource}</if>
|
|
|
+ <if test="serviceType != null and serviceType != ''">and service_type = #{serviceType}</if>
|
|
|
+ <if test="asrProvider != null and asrProvider != ''">and asr_provider = #{asrProvider}</if>
|
|
|
+ <if test="aiTransferType != null and aiTransferType != ''">and ai_transfer_type = #{aiTransferType}</if>
|
|
|
+ <if test="aiTransferData != null and aiTransferData != ''">and ai_transfer_data = #{aiTransferData}</if>
|
|
|
+ </where>
|
|
|
+ order by id desc
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="selectInboundLlmById" parameterType="Integer" resultMap="InboundLlmResult">
|
|
|
+ <include refid="selectInboundLlmVo"/>
|
|
|
+ where id = #{id}
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="selectInboundLlmByCallee" parameterType="String" resultMap="InboundLlmResult">
|
|
|
+ <include refid="selectInboundLlmVo"/>
|
|
|
+ where callee = #{callee}
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <insert id="insertInboundLlm" parameterType="com.fs.company.vo.easycall.EasyCallInboundLlmVO">
|
|
|
+ insert into cc_inbound_llm_account
|
|
|
+ <trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="id != null">id,</if>
|
|
|
+ <if test="llmAccountId != null">llm_account_id,</if>
|
|
|
+ <if test="callee != null and callee != ''">callee,</if>
|
|
|
+ <if test="inboundAlias != null and inboundAlias != ''">inbound_alias,</if>
|
|
|
+ <if test="voiceCode != null and voiceCode != ''">voice_code,</if>
|
|
|
+ <if test="voiceSource != null and voiceSource != ''">voice_source,</if>
|
|
|
+ <if test="serviceType != null and serviceType != ''">service_type,</if>
|
|
|
+ <if test="asrProvider != null and asrProvider != ''">asr_provider,</if>
|
|
|
+ <if test="aiTransferType != null and aiTransferType != ''">ai_transfer_type,</if>
|
|
|
+ <if test="aiTransferData != null and aiTransferData != ''">ai_transfer_data,</if>
|
|
|
+ <if test="ivrId != null">ivr_id,</if>
|
|
|
+ <if test="satisfSurveyIvrId != null">satisf_survey_ivr_id,</if>
|
|
|
+ </trim>
|
|
|
+ <trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="id != null">#{id},</if>
|
|
|
+ <if test="llmAccountId != null">#{llmAccountId},</if>
|
|
|
+ <if test="callee != null and callee != ''">#{callee},</if>
|
|
|
+ <if test="inboundAlias != null and inboundAlias != ''">#{inboundAlias},</if>
|
|
|
+ <if test="voiceCode != null and voiceCode != ''">#{voiceCode},</if>
|
|
|
+ <if test="voiceSource != null and voiceSource != ''">#{voiceSource},</if>
|
|
|
+ <if test="serviceType != null and serviceType != ''">#{serviceType},</if>
|
|
|
+ <if test="asrProvider != null and asrProvider != ''">#{asrProvider},</if>
|
|
|
+ <if test="aiTransferType != null and aiTransferType != ''">#{aiTransferType},</if>
|
|
|
+ <if test="aiTransferData != null and aiTransferData != ''">#{aiTransferData},</if>
|
|
|
+ <if test="ivrId != null">#{ivrId},</if>
|
|
|
+ <if test="satisfSurveyIvrId != null">#{satisfSurveyIvrId},</if>
|
|
|
+ </trim>
|
|
|
+ </insert>
|
|
|
+
|
|
|
+ <update id="updateInboundLlm" parameterType="com.fs.company.vo.easycall.EasyCallInboundLlmVO">
|
|
|
+ update cc_inbound_llm_account
|
|
|
+ <set>
|
|
|
+ <if test="llmAccountId != null">llm_account_id = #{llmAccountId},</if>
|
|
|
+ <if test="callee != null and callee != ''">callee = #{callee},</if>
|
|
|
+ <if test="inboundAlias != null and inboundAlias != ''">inbound_alias = #{inboundAlias},</if>
|
|
|
+ <if test="voiceCode != null and voiceCode != ''">voice_code = #{voiceCode},</if>
|
|
|
+ <if test="voiceSource != null and voiceSource != ''">voice_source = #{voiceSource},</if>
|
|
|
+ <if test="serviceType != null and serviceType != ''">service_type = #{serviceType},</if>
|
|
|
+ <if test="asrProvider != null and asrProvider != ''">asr_provider = #{asrProvider},</if>
|
|
|
+ <if test="aiTransferType != null and aiTransferType != ''">ai_transfer_type = #{aiTransferType},</if>
|
|
|
+ <if test="aiTransferData != null and aiTransferData != ''">ai_transfer_data = #{aiTransferData},</if>
|
|
|
+ <if test="ivrId != null">ivr_id = #{ivrId},</if>
|
|
|
+ <if test="satisfSurveyIvrId != null">satisf_survey_ivr_id = #{satisfSurveyIvrId},</if>
|
|
|
+ </set>
|
|
|
+ where id = #{id}
|
|
|
+ </update>
|
|
|
+
|
|
|
+ <delete id="deleteInboundLlmById" parameterType="Integer">
|
|
|
+ delete from cc_inbound_llm_account where id = #{id}
|
|
|
+ </delete>
|
|
|
+
|
|
|
+ <delete id="deleteInboundLlmByIds" parameterType="String">
|
|
|
+ delete from cc_inbound_llm_account where id in
|
|
|
+ <foreach item="id" collection="array" open="(" separator="," close=")">
|
|
|
+ #{id}
|
|
|
+ </foreach>
|
|
|
+ </delete>
|
|
|
+
|
|
|
+ <select id="selectLlmAccountList" resultMap="LlmAccountResult">
|
|
|
+ select id, name, account_json, account_entity, provider_class_name
|
|
|
+ from cc_llm_agent_account
|
|
|
+ order by id desc
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="selectLlmAccountById" parameterType="Integer" resultMap="LlmAccountResult">
|
|
|
+ select id, name, account_json, account_entity, provider_class_name
|
|
|
+ from cc_llm_agent_account
|
|
|
+ where id = #{id}
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="selectVoiceCodeByCode" parameterType="String" resultMap="VoiceCodeResult">
|
|
|
+ select voice_code, voice_name, voice_source
|
|
|
+ from cc_tts_aliyun
|
|
|
+ where voice_code = #{voiceCode}
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <!-- 查询ASR提供商列表 -->
|
|
|
+ <select id="selectAsrProviderList" resultType="java.util.Map">
|
|
|
+ select distinct provider as 'key', provider as 'value'
|
|
|
+ from cc_tts_aliyun
|
|
|
+ where provider is not null and provider != ''
|
|
|
+ order by provider
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <!-- 查询TTS音色来源列表 -->
|
|
|
+ <select id="selectVoiceSourceList" resultType="java.util.Map">
|
|
|
+ select distinct voice_source as 'key', voice_source as 'value'
|
|
|
+ from cc_tts_aliyun
|
|
|
+ where voice_source is not null and voice_source != ''
|
|
|
+ order by voice_source
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <!-- 根据音色来源查询音色列表 -->
|
|
|
+ <select id="selectVoiceListBySource" parameterType="String" resultMap="VoiceCodeResult">
|
|
|
+ select voice_code, voice_name, voice_source
|
|
|
+ from cc_tts_aliyun
|
|
|
+ where voice_source = #{voiceSource}
|
|
|
+ and voice_enabled = 1
|
|
|
+ order by priority, id
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <!-- 查询业务组列表 -->
|
|
|
+ <select id="selectBizGroupList" resultMap="BizGroupResult">
|
|
|
+ select group_id, biz_group_name
|
|
|
+ from cc_biz_group
|
|
|
+ order by sort_no, group_id
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <!-- 查询出局网关列表 -->
|
|
|
+ <select id="selectOutboundGatewayList" resultMap="GatewayResult">
|
|
|
+ select id, gw_name, profile_name, caller, callee_prefix, gw_addr, codec, gw_desc, purpose
|
|
|
+ from cc_gateways
|
|
|
+ where purpose in (2, 3)
|
|
|
+ order by id
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <!-- 查询IVR列表 -->
|
|
|
+ <select id="selectIvrList" resultMap="IvrResult">
|
|
|
+ select id, node_name
|
|
|
+ from cc_ivr
|
|
|
+ order by id
|
|
|
+ </select>
|
|
|
+
|
|
|
+</mapper>
|