add workflow 天润Smart-ccc会话数据,dev

This commit is contained in:
root 2025-02-14 12:03:35 +08:00
parent 461890681f
commit b4375c5627
2 changed files with 11 additions and 11 deletions

View File

@ -21,7 +21,7 @@ CREATE TABLE IF NOT EXISTS p20_pdm.t01_ccc_chat_message_detail (
, Etl_Tx_Dt timestamp(0) , Etl_Tx_Dt timestamp(0)
, Src_Sysname varchar(50) , Src_Sysname varchar(50)
, Src_Table varchar(50) , Src_Table varchar(50)
,primary key( message_unique_id ) ,primary key( message_unique_id,create_time )
); );
COMMENT ON COLUMN p20_pdm.t01_ccc_chat_message_detail.message_unique_id IS ' 消息编号'; COMMENT ON COLUMN p20_pdm.t01_ccc_chat_message_detail.message_unique_id IS ' 消息编号';

View File

@ -4,11 +4,11 @@
/*Brilliance stems from wisdoms. */ /*Brilliance stems from wisdoms. */
/*************Head Section**************************************************************************/ /*************Head Section**************************************************************************/
/*Script Use: Periodically load data to :t01_ccc_chat_message_detail(smartccc会话消息详情) */ /*Script Use: Periodically load data to :t01_ccc_chat_message_detail(smartccc会话消息详情) */
/*Create Date:2025-02-10 12:21:15 */ /*Create Date:2025-02-14 12:02:48 */
/*SDM Developed By: dev */ /*SDM Developed By: dev */
/*SDM Developed Date: 2024-07-19 */ /*SDM Developed Date: 2024-07-19 */
/*SDM Checked By: dev */ /*SDM Checked By: dev */
/*SDM Checked Date: 2025-02-10 */ /*SDM Checked Date: 2025-02-14 */
/*Script Developed By: dev */ /*Script Developed By: dev */
/*Script Checked By: dev */ /*Script Checked By: dev */
/*Source table 1: p10_sa.s98_s_tr_chat_messages_new */ /*Source table 1: p10_sa.s98_s_tr_chat_messages_new */
@ -103,8 +103,8 @@ FROM p10_sa.s98_s_tr_chat_messages_new p0
,file_url /*文件访问路径*/ ,file_url /*文件访问路径*/
,send_status /*消息发送状态*/ ,send_status /*消息发送状态*/
,sensitive_word /*敏感词*/ ,sensitive_word /*敏感词*/
,create_time /*消息创建时间戳*/
,message_unique_id /* 消息编号*/ ,message_unique_id /* 消息编号*/
,create_time /*消息创建时间戳*/
,Etl_Batch_No /*作业批次号*/ ,Etl_Batch_No /*作业批次号*/
,Etl_First_Dt /*最初入库时间*/ ,Etl_First_Dt /*最初入库时间*/
,Etl_Job /*作业名称*/ ,Etl_Job /*作业名称*/
@ -126,8 +126,8 @@ FROM p10_sa.s98_s_tr_chat_messages_new p0
,P1.file_url /*文件访问路径*/ ,P1.file_url /*文件访问路径*/
,P1.send_status /*消息发送状态*/ ,P1.send_status /*消息发送状态*/
,P1.sensitive_word /*敏感词*/ ,P1.sensitive_word /*敏感词*/
,P1.create_time /*消息创建时间戳*/
,P1.message_unique_id /* 消息编号*/ ,P1.message_unique_id /* 消息编号*/
,P1.create_time /*消息创建时间戳*/
,P1.Etl_Batch_No /*作业批次号*/ ,P1.Etl_Batch_No /*作业批次号*/
,P1.Etl_First_Dt /*最初入库时间*/ ,P1.Etl_First_Dt /*最初入库时间*/
,P1.Etl_Job /*作业名称*/ ,P1.Etl_Job /*作业名称*/
@ -149,8 +149,8 @@ ON P1.chat_unique_id = P2.chat_unique_id
AND P1.file_url = P2.file_url AND P1.file_url = P2.file_url
AND P1.send_status = P2.send_status AND P1.send_status = P2.send_status
AND P1.sensitive_word = P2.sensitive_word AND P1.sensitive_word = P2.sensitive_word
AND P1.create_time = P2.create_time
AND P1.message_unique_id = P2.message_unique_id AND P1.message_unique_id = P2.message_unique_id
AND P1.create_time = P2.create_time
WHERE P2.chat_unique_id IS NULL WHERE P2.chat_unique_id IS NULL
OR P2.sender_id IS NULL OR P2.sender_id IS NULL
@ -163,8 +163,8 @@ WHERE P2.chat_unique_id IS NULL
OR P2.file_url IS NULL OR P2.file_url IS NULL
OR P2.send_status IS NULL OR P2.send_status IS NULL
OR P2.sensitive_word IS NULL OR P2.sensitive_word IS NULL
OR P2.create_time IS NULL
OR P2.message_unique_id IS NULL OR P2.message_unique_id IS NULL
OR P2.create_time IS NULL
; ;
/*将新增数据插入到目标表 */ /*将新增数据插入到目标表 */
@ -180,8 +180,8 @@ WHERE P2.chat_unique_id IS NULL
,file_url /*文件访问路径*/ ,file_url /*文件访问路径*/
,send_status /*消息发送状态*/ ,send_status /*消息发送状态*/
,sensitive_word /*敏感词*/ ,sensitive_word /*敏感词*/
,create_time /*消息创建时间戳*/
,message_unique_id /* 消息编号*/ ,message_unique_id /* 消息编号*/
,create_time /*消息创建时间戳*/
,Etl_Batch_No /*作业批次号*/ ,Etl_Batch_No /*作业批次号*/
,Etl_First_Dt /*最初入库时间*/ ,Etl_First_Dt /*最初入库时间*/
,Etl_Job /*作业名称*/ ,Etl_Job /*作业名称*/
@ -203,8 +203,8 @@ SELECT
,P1.file_url /*文件访问路径*/ ,P1.file_url /*文件访问路径*/
,P1.send_status /*消息发送状态*/ ,P1.send_status /*消息发送状态*/
,P1.sensitive_word /*敏感词*/ ,P1.sensitive_word /*敏感词*/
,P1.create_time /*消息创建时间戳*/
,P1.message_unique_id /* 消息编号*/ ,P1.message_unique_id /* 消息编号*/
,P1.create_time /*消息创建时间戳*/
,P1.Etl_Batch_No /*作业批次号*/ ,P1.Etl_Batch_No /*作业批次号*/
,P1.Etl_First_Dt /*最初入库时间*/ ,P1.Etl_First_Dt /*最初入库时间*/
,P1.Etl_Job /*作业名称*/ ,P1.Etl_Job /*作业名称*/
@ -214,9 +214,10 @@ SELECT
,P1.Src_Table /*来源表*/ ,P1.Src_Table /*来源表*/
FROM t01_ccc_chat_message_detail_agi_INS P1 FROM t01_ccc_chat_message_detail_agi_INS P1
ON CONFLICT ( message_unique_id) ON CONFLICT ( message_unique_id,create_time)
DO UPDATE SET DO UPDATE SET
message_unique_id=excluded.message_unique_id message_unique_id=excluded.message_unique_id
,create_time=excluded.create_time
,chat_unique_id=excluded.chat_unique_id ,chat_unique_id=excluded.chat_unique_id
,sender_id=excluded.sender_id ,sender_id=excluded.sender_id
,sender_name=excluded.sender_name ,sender_name=excluded.sender_name
@ -228,7 +229,6 @@ DO UPDATE SET
,file_url=excluded.file_url ,file_url=excluded.file_url
,send_status=excluded.send_status ,send_status=excluded.send_status
,sensitive_word=excluded.sensitive_word ,sensitive_word=excluded.sensitive_word
,create_time=excluded.create_time
,Etl_Batch_No=excluded.Etl_Batch_No ,Etl_Batch_No=excluded.Etl_Batch_No
,Etl_First_Dt=excluded.Etl_First_Dt ,Etl_First_Dt=excluded.Etl_First_Dt
,Etl_Job=excluded.Etl_Job ,Etl_Job=excluded.Etl_Job