增加企微跑批记录用于重跑去重

This commit is contained in:
zren25
2025-03-25 18:39:12 +08:00
parent 6298a269da
commit dce6c5b7c1
7 changed files with 125 additions and 12 deletions

View File

@@ -14,6 +14,13 @@
WHERE tovm.is_deleted = 0
AND tovm.msg_time between #{statTime} and #{endTime}
AND tovm.chat_type = 0
<if test="retry==true">
and not exists(
select 1 from tt_vdqw_record t
where t.from_accept_user_id = CONCAT(LEAST(tovm.from_user_id, tovm.accept_user_id),'_',GREATEST(tovm.from_user_id, tovm.accept_user_id))
AND t.msg_time between #{statTime} and #{endTime}
)
</if>
GROUP BY
LEAST(tovm.from_user_id, tovm.accept_user_id),
GREATEST(tovm.from_user_id, tovm.accept_user_id)
@@ -26,12 +33,20 @@
tovm.from_user_id as fromUserId,
tovm.accept_user_id as acceptUserId,
tovm.msg_time as msgTime,
tovm.chat_type as chatType
tovm.chat_type as chatType,
CONCAT(LEAST(tovm.from_user_id, tovm.accept_user_id),'_',GREATEST(tovm.from_user_id, tovm.accept_user_id)) as fromAcceptUserId
FROM
`tm_ods_vdqw_messagearchiving` tovm
WHERE tovm.is_deleted = 0
AND tovm.msg_time between #{statTime} and #{endTime}
AND tovm.chat_type = 0
<if test="retry==true">
and not exists(
select 1 from tt_vdqw_record t
where t.from_accept_user_id = CONCAT(LEAST(tovm.from_user_id, tovm.accept_user_id),'_',GREATEST(tovm.from_user_id, tovm.accept_user_id))
AND t.msg_time between #{statTime} and #{endTime}
)
</if>
GROUP BY
LEAST(tovm.from_user_id, tovm.accept_user_id),
GREATEST(tovm.from_user_id, tovm.accept_user_id)