|
|
@@ -56,7 +56,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
</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
|
|
|
+ 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,call_back_url,fs_scene_type from cc_inbound_llm_account
|
|
|
</sql>
|
|
|
|
|
|
<select id="selectInboundLlmList" parameterType="com.fs.company.vo.easycall.EasyCallInboundLlmVO" resultMap="InboundLlmResult">
|
|
|
@@ -71,6 +71,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<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>
|
|
|
+ <if test="visibleIds != null ">
|
|
|
+ <if test="visibleIds.size() > 0">
|
|
|
+ and id in
|
|
|
+ <foreach item="item" collection="visibleIds" index="index" separator="," open="(" close=")">
|
|
|
+ #{item}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ </if>
|
|
|
</where>
|
|
|
order by id desc
|
|
|
</select>
|
|
|
@@ -85,7 +93,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
where callee = #{callee}
|
|
|
</select>
|
|
|
|
|
|
- <insert id="insertInboundLlm" parameterType="com.fs.company.vo.easycall.EasyCallInboundLlmVO">
|
|
|
+ <insert id="insertInboundLlm" parameterType="com.fs.company.vo.easycall.EasyCallInboundLlmVO" useGeneratedKeys="true" keyProperty="id" keyColumn="id">
|
|
|
insert into cc_inbound_llm_account
|
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
<if test="id != null">id,</if>
|
|
|
@@ -100,6 +108,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<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>
|
|
|
+ <if test="companyId != null">fs_company_id,</if>
|
|
|
+ <if test="callBackUrl != null">call_back_url,</if>
|
|
|
+ <if test="fsSceneType != null">fs_scene_type,</if>
|
|
|
</trim>
|
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
<if test="id != null">#{id},</if>
|
|
|
@@ -114,6 +125,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="aiTransferData != null and aiTransferData != ''">#{aiTransferData},</if>
|
|
|
<if test="ivrId != null">#{ivrId},</if>
|
|
|
<if test="satisfSurveyIvrId != null">#{satisfSurveyIvrId},</if>
|
|
|
+ <if test="companyId != null">#{companyId},</if>
|
|
|
+ <if test="callBackUrl != null">#{callBackUrl},</if>
|
|
|
+ <if test="fsSceneType != null">#{fsSceneType},</if>
|
|
|
</trim>
|
|
|
</insert>
|
|
|
|
|
|
@@ -131,6 +145,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<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>
|
|
|
+ <if test="callBackUrl != null">call_back_url = #{callBackUrl},</if>
|
|
|
+ <if test="fsSceneType != null">fs_scene_type = #{fsSceneType},</if>
|
|
|
</set>
|
|
|
where id = #{id}
|
|
|
</update>
|
|
|
@@ -149,6 +165,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<select id="selectLlmAccountList" resultMap="LlmAccountResult">
|
|
|
select id, name, account_json, account_entity, provider_class_name
|
|
|
from cc_llm_agent_account
|
|
|
+ <where>
|
|
|
+ <if test="modelsId != null and modelsId.size() > 0"> and id in
|
|
|
+ <foreach item="modelId" collection="modelsId" open="(" separator="," close=")">
|
|
|
+ #{modelId}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
order by id desc
|
|
|
</select>
|
|
|
|
|
|
@@ -211,4 +234,90 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
order by id
|
|
|
</select>
|
|
|
|
|
|
+ <resultMap type="com.fs.company.domain.EasyCallInboundCdrVO" id="EasyCallInboundCdrResult">
|
|
|
+ <result property="id" column="id" />
|
|
|
+ <result property="caller" column="caller" />
|
|
|
+ <result property="callee" column="callee" />
|
|
|
+ <result property="inboundTime" column="inbound_time" />
|
|
|
+ <result property="groupId" column="group_id" />
|
|
|
+ <result property="answeredTime" column="answered_time" />
|
|
|
+ <result property="extnum" column="extnum" />
|
|
|
+ <result property="opnum" column="opnum" />
|
|
|
+ <result property="hangupTime" column="hangup_time" />
|
|
|
+ <result property="answeredTimeLen" column="answered_time_len" />
|
|
|
+ <result property="timeLen" column="time_len" />
|
|
|
+ <result property="uuid" column="uuid" />
|
|
|
+ <result property="wavFile" column="wav_file" />
|
|
|
+ <result property="chatContent" column="chat_content" />
|
|
|
+ <result property="asrSeconds" column="asr_seconds" />
|
|
|
+ <result property="ttsTimes" column="tts_times" />
|
|
|
+ <result property="ttsFlowTokens" column="tts_flow_tokens" />
|
|
|
+ <result property="inputTokens" column="input_tokens" />
|
|
|
+ <result property="outputTokens" column="output_tokens" />
|
|
|
+ <result property="totalCost" column="total_cost" />
|
|
|
+ <result property="billingStatus" column="billing_status" />
|
|
|
+ <result property="ivrDtmfDigits" column="ivr_dtmf_digits" />
|
|
|
+ <result property="hangupCause" column="hangup_cause" />
|
|
|
+ <result property="manualAnsweredTime" column="manual_answered_time" />
|
|
|
+ <result property="manualAnsweredTimeLen" column="manual_answered_time_len" />
|
|
|
+ <result property="groupName" column="group_name" />
|
|
|
+ </resultMap>
|
|
|
+
|
|
|
+ <select id="selectInboundCdrList" parameterType="com.fs.company.domain.EasyCallInboundCdrVO" resultMap="EasyCallInboundCdrResult">
|
|
|
+ select c.id, c.caller, c.callee, c.inbound_time, c.group_id, c.answered_time, c.extnum, c.opnum,
|
|
|
+ c.hangup_time, c.answered_time_len, c.time_len, c.uuid, c.wav_file, c.chat_content,
|
|
|
+ c.asr_seconds, c.tts_times, c.tts_flow_tokens, c.input_tokens, c.output_tokens,
|
|
|
+ c.total_cost, c.billing_status, c.ivr_dtmf_digits, c.hangup_cause,
|
|
|
+ c.manual_answered_time, c.manual_answered_time_len,
|
|
|
+ g.biz_group_name as group_name
|
|
|
+ from cc_inbound_cdr c
|
|
|
+ LEFT JOIN cc_biz_group g ON c.group_id = g.group_id
|
|
|
+ <where>
|
|
|
+ c.hangup_time > 0
|
|
|
+ <if test="uuid != null and uuid != ''"> and c.uuid = #{uuid}</if>
|
|
|
+ <if test="caller != null and caller != ''"> and c.caller = #{caller}</if>
|
|
|
+ <if test="callee != null and callee != ''"> and c.callee = #{callee}</if>
|
|
|
+ <if test="extnum != null and extnum != ''"> and c.extnum = #{extnum}</if>
|
|
|
+ <if test="opnum != null and opnum != ''"> and c.opnum = #{opnum}</if>
|
|
|
+ <if test="groupId != null and groupId != ''"> and c.group_id = #{groupId}</if>
|
|
|
+ <if test="billingStatus != null"> and c.billing_status = #{billingStatus}</if>
|
|
|
+ <!-- 呼入时间范围 -->
|
|
|
+ <if test="params != null and params.inboundTimeStart != null">
|
|
|
+ and c.inbound_time >= #{params.inboundTimeStart}
|
|
|
+ </if>
|
|
|
+ <if test="params != null and params.inboundTimeEnd != null">
|
|
|
+ and c.inbound_time <= #{params.inboundTimeEnd}
|
|
|
+ </if>
|
|
|
+ <!-- 接听时间范围 -->
|
|
|
+ <if test="params != null and params.answeredTimeStart != null">
|
|
|
+ and c.answered_time >= #{params.answeredTimeStart}
|
|
|
+ </if>
|
|
|
+ <if test="params != null and params.answeredTimeEnd != null">
|
|
|
+ and c.answered_time <= #{params.answeredTimeEnd}
|
|
|
+ </if>
|
|
|
+ <!-- 挂机时间范围 -->
|
|
|
+ <if test="params != null and params.hangupTimeStart != null">
|
|
|
+ and c.hangup_time >= #{params.hangupTimeStart}
|
|
|
+ </if>
|
|
|
+ <if test="params != null and params.hangupTimeEnd != null">
|
|
|
+ and c.hangup_time <= #{params.hangupTimeEnd}
|
|
|
+ </if>
|
|
|
+ <!-- 通话时长范围 -->
|
|
|
+ <if test="params != null and params.timeLenStart != null">
|
|
|
+ and c.time_len >= #{params.timeLenStart}
|
|
|
+ </if>
|
|
|
+ <if test="params != null and params.timeLenEnd != null">
|
|
|
+ and c.time_len <= #{params.timeLenEnd}
|
|
|
+ </if>
|
|
|
+ <!-- 多租户隔离:可见被叫号码过滤 -->
|
|
|
+ <if test="visibleCallees != null and visibleCallees.size() > 0">
|
|
|
+ and c.callee in
|
|
|
+ <foreach item="calleeItem" collection="visibleCallees" open="(" separator="," close=")">
|
|
|
+ #{calleeItem}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ order by c.hangup_time desc
|
|
|
+ </select>
|
|
|
+
|
|
|
</mapper>
|