From 5f6fd6241884f899110c488b9ca4a597dc08a1ab Mon Sep 17 00:00:00 2001 From: Jimmy Liow Date: Tue, 2 Apr 2024 16:51:06 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=9F=A5=E6=89=BE=E4=B8=BA?= =?UTF-8?q?=E5=88=86=E9=85=8D=E4=BC=9A=E8=AF=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- doc/运维语句.sql | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/doc/运维语句.sql b/doc/运维语句.sql index f70cffe..8eb8642 100644 --- a/doc/运维语句.sql +++ b/doc/运维语句.sql @@ -1,28 +1,30 @@ +// 查找所有开启会话的顾问,并用逗号分隔 +SELECT group_concat(opi_sn separator ',') as 'sn_list' FROM ( SELECT - opi_sn, count(*) -FROM - `whatsapp_session` + opi_sn,COUNT(*) +FROM whatsapp_session where opi_sn is not null and opi_sn not in (29,383,404,227) GROUP by opi_sn +) session_count SELECT - OPI_SN, - OPI_Code, - OPI_Name, - OPI_DEI_SN, - OPI_Role, - OPI_FirstName, - OPI_RealName + OPI_SN, OPI_Code,OPI_Name,OPI_DEI_SN,OPI_FirstName,OPI_RealName FROM dbo.OperatorInfo where - --DeleteFlag = 0 and - OPI_SN in (162,31,32,33,34,599,600,353,352,350,351,35,606,495,293,525,114,587,585,519,522,476,354,451,216,143) - + DeleteFlag = 0 and + OPI_SN in (162,31,32,33,34,599,600,353,352,350,351,35,606,495,293,525,114,587,585,519,522,476,354,451,216,143,586,539,370,512) + SELECT opi.OPI_Code, opi.OPI_Name, tpa.* FROM dbo.ThirdPlatformAccount_Bind tpa left join OperatorInfo opi on opi.opi_sn = tpa.TPA_OPI_SN where opi.DeleteFlag = 0 + +// 查找未分配顾问的会话 + +SELECT * +FROM whatsapp_session +WHERE opi_sn IS null \ No newline at end of file