Commit 170f7ee6 by Java-金吉宝

重复记录

parent 781dcd7e
......@@ -120,7 +120,6 @@
<!-- 获取通话记录列表 -->
<select id="getCallRecordList" resultType="com.ejweb.modules.call.entity.CallRecordListEntity">
SELECT
CONCAT(r.create_name,p.username,(UNIX_TIMESTAMP(r.end_time)-r.duration)) as b,
r.id,
r.create_by,
r.create_name,
......@@ -148,10 +147,40 @@
WHERE r.start_time BETWEEN #{startTime} AND #{endTime}
AND (p.user_id=#{userId} OR r.create_by=#{userId})
AND r.end_status !='INIT'
group by b
ORDER BY r.start_time DESC
</select>
<!-- 查重 -->
<select id="get" resultType="com.ejweb.modules.call.entity.CallRecordListEntity">
SELECT
r.id,
r.create_by,
r.create_name,
r.create_phone,
r.call_type,
r.end_status,
r.user_count,
r.start_time,
r.end_time,
p.user_id AS userId,
p.username,
p.phone,
p.title,
p.flow,
u.photo AS userPhoto,
uu.photo AS createByPhoto,
r.download_url
FROM foc_sound_phones p
LEFT JOIN sys_user u
ON p.user_id = u.id
LEFT JOIN foc_sound_records r
ON p.record_id=r.id
LEFT JOIN sys_user uu
ON r.create_by = uu.id
WHERE r.end_status !='INIT'
and r.create_name = #{createName}
and p.username = #{username}
and r.start_time = #{endTime}
</select>
<!-- 通过通话的电话号查询用户信息 -->
<select id="findUserByCallPhone" resultType="com.ejweb.modules.call.entity.CallPhoneInfoListEntity">
......@@ -369,7 +398,6 @@
SELECT *
FROM (
SELECT
CONCAT(r.create_name,p.username,(UNIX_TIMESTAMP(r.end_time)-r.duration)) as b,
r.create_by,
r.create_name,
r.create_phone,
......@@ -392,11 +420,9 @@
AND r.end_status !='INIT'
AND r.create_by=#{userId}
AND r.call_type='GROUP'
group by b
ORDER BY r.start_time DESC
UNION
SELECT
CONCAT(r.create_name,p.username,(UNIX_TIMESTAMP(r.end_time)-r.duration)) as b,
r.create_by,
r.create_name,
r.create_phone,
......@@ -424,7 +450,7 @@
AND p.phone_type != 'HWNUBMER'
AND r.end_status !='INIT'
AND r.call_type='USER'
group by b
ORDER BY r.start_time DESC
) t
ORDER BY t.start_time DESC
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment