|
@@ -17,8 +17,20 @@
|
|
|
create_time,
|
|
|
update_time,
|
|
|
id,
|
|
|
- <if test="entNo!=null and entNo!='' ">
|
|
|
- ent_id,
|
|
|
+ <if test="orgId!=null and orgId!='' ">
|
|
|
+ org_id,
|
|
|
+ </if>
|
|
|
+ <if test="stationId!=null and stationId!='' ">
|
|
|
+ station_id,
|
|
|
+ </if>
|
|
|
+ <if test="olderId!=null and olderId!='' ">
|
|
|
+ older_id,
|
|
|
+ </if>
|
|
|
+ <if test="contactId!=null and contactId!='' ">
|
|
|
+ contact_id,
|
|
|
+ </if>
|
|
|
+ <if test="phone!=null and phone!='' ">
|
|
|
+ phone,
|
|
|
</if>
|
|
|
<if test="tenantId!=null and tenantId!='' ">
|
|
|
tenant_id,
|
|
@@ -29,41 +41,48 @@
|
|
|
<if test="agentNumber!=null and agentNumber!='' ">
|
|
|
agent_number,
|
|
|
</if>
|
|
|
- <if test="sessionId!=null and sessionId!='' ">
|
|
|
- session_id,
|
|
|
+ <if test="apiMethod!=null and apiMethod!='' ">
|
|
|
+ api_method,
|
|
|
</if>
|
|
|
<if test="result!=null and result!='' ">
|
|
|
result,
|
|
|
</if>
|
|
|
- <if test="apiMethod!=null and apiMethod!='' ">
|
|
|
- api_method,
|
|
|
- </if>
|
|
|
- <if test="calledNumber!=null and calledNumber!='' ">
|
|
|
- called_number,
|
|
|
+ <if test="sessionId!=null and sessionId!='' ">
|
|
|
+ session_id,
|
|
|
</if>
|
|
|
+
|
|
|
<if test="receiveTime!=null and receiveTime!='' ">
|
|
|
receive_time,
|
|
|
</if>
|
|
|
+ <if test="outDisplayNo!=null ">
|
|
|
+ out_display_no,
|
|
|
+ </if>
|
|
|
<if test="eventStatus!=null">
|
|
|
event_status,
|
|
|
</if>
|
|
|
<if test="computeTraffic!=null ">
|
|
|
compute_traffic,
|
|
|
</if>
|
|
|
- <if test="disNumber!=null ">
|
|
|
- out_display_no,
|
|
|
- </if>
|
|
|
- <if test="olderId!=null ">
|
|
|
- older_id,
|
|
|
- </if>
|
|
|
</trim>
|
|
|
VALUES
|
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
now(),
|
|
|
now(),
|
|
|
uuid(),
|
|
|
- <if test="entNo!=null and entNo!='' ">
|
|
|
- (select id from cc_enterprise where enterprise_no=#{entNo}),
|
|
|
+ <if test="orgId!=null and orgId!='' ">
|
|
|
+ #{orgId},
|
|
|
+ </if>
|
|
|
+ <if test="stationId!=null and stationId!='' ">
|
|
|
+ #{stationId},
|
|
|
+ </if>
|
|
|
+ <if test="olderId!=null and olderId!='' ">
|
|
|
+ #{olderId},
|
|
|
+ </if>
|
|
|
+ <if test="contactId!=null and contactId!='' ">
|
|
|
+ #{contactId},
|
|
|
+ </if>
|
|
|
+ <if test="phone!=null and phone!='' ">
|
|
|
+ #{phone},
|
|
|
</if>
|
|
|
<if test="tenantId!=null and tenantId!='' ">
|
|
|
#{tenantId},
|
|
@@ -74,33 +93,27 @@
|
|
|
<if test="agentNumber!=null and agentNumber!='' ">
|
|
|
#{agentNumber},
|
|
|
</if>
|
|
|
- <if test="sessionId!=null and sessionId!='' ">
|
|
|
- #{sessionId},
|
|
|
+ <if test="apiMethod!=null and apiMethod!='' ">
|
|
|
+ #{apiMethod},
|
|
|
</if>
|
|
|
<if test="result!=null and result!='' ">
|
|
|
#{result},
|
|
|
</if>
|
|
|
- <if test="apiMethod!=null and apiMethod!='' ">
|
|
|
- #{apiMethod},
|
|
|
- </if>
|
|
|
- <if test="calledNumber!=null and calledNumber!='' ">
|
|
|
- #{calledNumber},
|
|
|
+ <if test="sessionId!=null and sessionId!='' ">
|
|
|
+ #{sessionId},
|
|
|
</if>
|
|
|
<if test="receiveTime!=null and receiveTime!='' ">
|
|
|
#{receiveTime},
|
|
|
</if>
|
|
|
+ <if test="outDisplayNo!=null ">
|
|
|
+ #{outDisplayNo},
|
|
|
+ </if>
|
|
|
<if test="eventStatus!=null">
|
|
|
#{eventStatus},
|
|
|
</if>
|
|
|
<if test="computeTraffic!=null ">
|
|
|
#{computeTraffic},
|
|
|
</if>
|
|
|
- <if test="disNumber!=null ">
|
|
|
- #{disNumber},
|
|
|
- </if>
|
|
|
- <if test="olderId!=null ">
|
|
|
- #{olderId},
|
|
|
- </if>
|
|
|
</trim>
|
|
|
</insert>
|
|
|
|
|
@@ -108,21 +121,24 @@
|
|
|
<select id="getAllBillInfo" resultType="com.care.outcall.entity.KoalaLogDomain">
|
|
|
SELECT
|
|
|
create_time as createTime,
|
|
|
+ update_time as updateTime,
|
|
|
id,
|
|
|
- ent_id as entId,
|
|
|
+ org_id as orgId,
|
|
|
+ station_id as stationId,
|
|
|
+ older_id as olderId,
|
|
|
+ contact_id as contactId,
|
|
|
+ phone as phone,
|
|
|
tenant_id as tenantId,
|
|
|
agent_id as agentId,
|
|
|
agent_number as agentNumber,
|
|
|
- session_id as sessionId,
|
|
|
- result,
|
|
|
api_method as apiMethod,
|
|
|
- called_number as calledNumber,
|
|
|
+ result,
|
|
|
+ session_id as sessionId,
|
|
|
receive_time as receiveTime,
|
|
|
+ out_display_no as outDisplayNo,
|
|
|
event_status as eventStatus,
|
|
|
- compute_traffic as computeTraffic,
|
|
|
- out_display_no as disNumber,
|
|
|
- older_id as olderId
|
|
|
- FROM cc_koala_log WHERE compute_traffic=0 and older_id <> '-1'
|
|
|
+ compute_traffic as computeTraffic
|
|
|
+ FROM cc_koala_log WHERE compute_traffic=0
|
|
|
</select>
|
|
|
|
|
|
<select id="checkSession" parameterType="java.lang.String" resultType="java.lang.Integer">
|
|
@@ -135,8 +151,8 @@
|
|
|
INSERT INTO cc_traffic_billed
|
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
id,
|
|
|
- <if test="clientFlowNo!=null and clientFlowNo!='' ">
|
|
|
- client_flow_no,
|
|
|
+ <if test="phone!=null and phone!='' ">
|
|
|
+ phone,
|
|
|
</if>
|
|
|
<if test="outCallStatus!=null and outCallStatus!='' ">
|
|
|
out_call_status,
|
|
@@ -148,8 +164,8 @@
|
|
|
call_result_status,
|
|
|
</if>
|
|
|
|
|
|
- <if test="batchId!=null and batchId!='' ">
|
|
|
- batch_id,
|
|
|
+ <if test="olderId!=null and olderId!='' ">
|
|
|
+ older_id,
|
|
|
</if>
|
|
|
|
|
|
<if test="sessionId!=null and sessionId!='' ">
|
|
@@ -185,18 +201,23 @@
|
|
|
<if test="audioUrl!=null and audioUrl!=''">
|
|
|
audio_url,
|
|
|
</if>
|
|
|
- <if test="enterpriseNo!=null and enterpriseNo!=''">
|
|
|
- enterprise_id,
|
|
|
+ <if test="orgId!=null and orgId!=''">
|
|
|
+ org_id,
|
|
|
+ </if>
|
|
|
+ <if test="stationId!=null and stationId!=''">
|
|
|
+ station_id,
|
|
|
+ </if>
|
|
|
+ <if test="contactId!=null and contactId!=''">
|
|
|
+ contact_id,
|
|
|
</if>
|
|
|
-
|
|
|
create_time,
|
|
|
update_time
|
|
|
</trim>
|
|
|
VALUES
|
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
uuid(),
|
|
|
- <if test="clientFlowNo!=null and clientFlowNo!='' ">
|
|
|
- #{clientFlowNo},
|
|
|
+ <if test="phone!=null and phone!='' ">
|
|
|
+ #{phone},
|
|
|
</if>
|
|
|
<if test="outCallStatus!=null and outCallStatus!='' ">
|
|
|
#{outCallStatus},
|
|
@@ -208,8 +229,8 @@
|
|
|
#{callResultStatus},
|
|
|
</if>
|
|
|
|
|
|
- <if test="batchId!=null and batchId!='' ">
|
|
|
- #{batchId},
|
|
|
+ <if test="olderId!=null and olderId!='' ">
|
|
|
+ #{olderId},
|
|
|
</if>
|
|
|
|
|
|
<if test="sessionId!=null and sessionId!='' ">
|
|
@@ -245,10 +266,15 @@
|
|
|
<if test="audioUrl!=null and audioUrl!=''">
|
|
|
#{audioUrl},
|
|
|
</if>
|
|
|
- <if test="enterpriseNo!=null">
|
|
|
- (select ttt1.id from cc_enterprise ttt1 where ttt1.enterprise_no=#{enterpriseNo}),
|
|
|
+ <if test="orgId!=null">
|
|
|
+ #{orgId},
|
|
|
+ </if>
|
|
|
+ <if test="stationId!=null">
|
|
|
+ #{stationId},
|
|
|
+ </if>
|
|
|
+ <if test="contactId!=null">
|
|
|
+ #{contactId},
|
|
|
</if>
|
|
|
-
|
|
|
now(),
|
|
|
now()
|
|
|
</trim>
|
|
@@ -258,8 +284,8 @@
|
|
|
UPDATE cc_traffic_billed
|
|
|
<set>
|
|
|
update_time=now(),
|
|
|
- <if test="clientFlowNo!=null and clientFlowNo!='' ">
|
|
|
- client_flow_no=#{clientFlowNo},
|
|
|
+ <if test="phone!=null and phone!='' ">
|
|
|
+ phone=#{phone},
|
|
|
</if>
|
|
|
<if test="outCallStatus!=null and outCallStatus!='' ">
|
|
|
out_call_status=#{outCallStatus},
|
|
@@ -300,10 +326,18 @@
|
|
|
<if test="teleAgentId!=null and teleAgentId!='' ">
|
|
|
tele_agent_id=#{teleAgentId},
|
|
|
</if>
|
|
|
- <if test="batchId!=null and batchId!='' ">
|
|
|
- batch_id=#{batchId},
|
|
|
+ <if test="olderId!=null and olderId!='' ">
|
|
|
+ older_id=#{olderId},
|
|
|
+ </if>
|
|
|
+ <if test="orgId!=null and orgId!='' ">
|
|
|
+ org_id=#{orgId},
|
|
|
+ </if>
|
|
|
+ <if test="stationId!=null and stationId!='' ">
|
|
|
+ station_id=#{stationId},
|
|
|
+ </if>
|
|
|
+ <if test="contactId!=null and contactId!='' ">
|
|
|
+ contact_id=#{contactId},
|
|
|
</if>
|
|
|
-
|
|
|
</set>
|
|
|
WHERE session_id=#{sessionId}
|
|
|
</update>
|
|
@@ -334,14 +368,12 @@
|
|
|
<select id="getOlderInfoBySessionId" resultType="com.care.outcall.entity.KoalaOlderDto">
|
|
|
select
|
|
|
distinct ckl.session_id as sessionId,
|
|
|
- ce.org_code as enterpriseNo,
|
|
|
+ ckl.org_id as orgId,
|
|
|
ckl.older_id as olderId,
|
|
|
- ckl.called_number as dyFlowNo,
|
|
|
- date_format(cocfn.create_time, '%Y%m%d%H%i%s') createTime
|
|
|
+ ckl.contact_id as contactId,
|
|
|
+ ckl.phone as phone,
|
|
|
+ date_format(ckl.create_time, '%Y%m%d%H%i%s') createTime
|
|
|
from cc_koala_log ckl
|
|
|
- left join care_organization ce on ce.id=ckl.ent_id
|
|
|
- left join care_older coct on coct.id=ckl.older_id
|
|
|
- left join care_older_contact cocfn on ckl.called_number=cocfn.phone and coct.id = cocfn.older_id
|
|
|
where ckl.session_id=#{sessionId}
|
|
|
</select>
|
|
|
</mapper>
|