Пример #1
0
        private DataTable GetDataTable()
        {
            string selectStr = "select * from T_MassMsg  order by rowid   limit 0,50";
            string dbPath    = $@"{AntSdkService.SqliteLocalDbPath}{AntSdkService.AntSdkCurrentUserInfo.userId}\{
                AntSdkService.AntSdkCurrentUserInfo.userId}.db";

            return(AntSdkSqliteHelper.ExecuteDataTable(selectStr, dbPath));
        }
Пример #2
0
        /// <summary>
        /// 批量查询
        /// </summary>
        /// <returns></returns>
        private DataTable GetDataTable()
        {
            string selectStr = "select  * from C_GROUP ";
            string dbPath    =
                $@"{AntSdkService.SqliteLocalDbPath}{AntSdkService.AntSdkLoginOutput.userId}\{
                    AntSdkService.AntSdkLoginOutput.userId}.db";

            return(AntSdkSqliteHelper.ExecuteDataTable(selectStr, dbPath));
        }
Пример #3
0
        /// <summary>
        /// 获取撤销相关数据
        /// </summary>
        /// <param name="messageid"></param>
        /// <returns></returns>
        public DataTable getRecallData(string messageid)
        {
            string selectStr = "select sendtime,cast(sendsucessorfail as varchar) as sendsucessorfail, messageid from t_chat_message where messageid='" + messageid + "'";
            string dbPath    = $@"{AntSdkService.SqliteLocalDbPath}{AntSdkService.AntSdkLoginOutput.userId}\{AntSdkService.AntSdkLoginOutput.userId}.db";

            if (File.Exists(dbPath))
            {
                return(AntSdkSqliteHelper.ExecuteDataTable(selectStr, dbPath));
            }
            else
            {
                return(null);
            }
        }
Пример #4
0
        /// <summary>
        /// 根据messageId获取消息
        /// </summary>
        /// <param name="sessionId"></param>
        /// <param name="messageId"></param>
        /// <returns></returns>
        public DataTable GetChatMessageByMsessageID(string sessionId, string messageId)
        {
            string selectStr = "select  * from t_chat_message where sessionid='" + sessionId + "' and MESSAGEID='" + messageId + "'";
            string dbPath    = $@"{AntSdkService.SqliteLocalDbPath}{AntSdkService.AntSdkCurrentUserInfo.userId}\{AntSdkService.AntSdkCurrentUserInfo.userId}.db";

            if (File.Exists(dbPath))
            {
                return(AntSdkSqliteHelper.ExecuteDataTable(selectStr, dbPath));
            }
            else
            {
                return(null);
            }
        }
Пример #5
0
        /// <summary>
        /// 群聊滚动大于1次查询
        /// </summary>
        /// <param name="session_id"></param>
        /// <param name="companyCode"></param>
        /// <param name="userId"></param>
        /// <param name="startChatIndex"></param>
        /// <param name="pageCount"></param>
        /// <returns></returns>
        public DataTable getDataByMoreThanScroll(string session_id, string companyCode, string userId, string startChatIndex, int pageCount)
        {
            string selectStr = "select * from t_chat_message_group where sessionid='" + session_id + "' and cast(chatindex as int) <" + startChatIndex + " order by cast(chatindex as int) desc  limit '" + 0 + "',10";
            string dbPath    = $@"{AntSdkService.SqliteLocalDbPath}{userId}\{userId}.db";

            if (File.Exists(dbPath))
            {
                return(AntSdkSqliteHelper.ExecuteDataTable(selectStr, dbPath));
            }
            else
            {
                return(null);
            }
        }
Пример #6
0
        /// <summary>
        /// 查询记录
        /// </summary>
        /// <param name="session_id"></param>
        /// <param name="userId"></param>
        /// <param name="targetid"></param>
        /// <param name="companyCode"></param>
        /// <param name="index"></param>
        /// <param name="pageSize"></param>
        /// <returns></returns>
        public DataTable GetDataTable(string session_id, string userId, string targetid, string companyCode, int index, int pageSize)
        {
            string selectStr = "select * from (select  * from t_chat_message_group where sessionid='" + session_id + "' order by cast(chatindex as int) desc limit " + index + "," + pageSize + ") order by cast(chatindex as int); ";
            string dbPath    = $@"{AntSdkService.SqliteLocalDbPath}{userId}\{userId}.db";

            if (File.Exists(dbPath))
            {
                return(AntSdkSqliteHelper.ExecuteDataTable(selectStr, dbPath));
            }
            else
            {
                return(null);
            }
        }
Пример #7
0
        public DataTable GetHistoryNext(string session_id, string end_index, int pageSize)
        {
            string selectStr = "select * from (select  * from t_chat_message_group where sessionid='" + session_id + "' and chatindex> '" + end_index + "' order by chatindex asc limit 0," + pageSize + ") order by sendtime asc;";
            string dbPath    = $@"{AntSdkService.SqliteLocalDbPath}{AntSdkService.AntSdkCurrentUserInfo.userId}\{
                AntSdkService.AntSdkCurrentUserInfo.userId}.db";

            if (File.Exists(dbPath))
            {
                return(AntSdkSqliteHelper.ExecuteDataTable(selectStr, dbPath));
            }
            else
            {
                return(null);
            }
        }
Пример #8
0
        /// <summary>
        /// 查询当天前N条聊天记录
        /// </summary>
        /// <param name="session_id">会话ID</param>
        /// <param name="startTimestamp">开始时间戳</param>
        /// <param name="endTimestamp">结束时间戳</param>
        /// <param name="pageSize">页大小</param>
        /// <returns></returns>
        public DataTable GetCurrentDayHistoryMsg(string session_id, string startTimestamp, string endTimestamp, int pageSize)
        {
            string selectStr = "select * from (select  * from t_chat_message_group where sessionid='" + session_id + "' and sendtime between '" + startTimestamp + "' and '" + endTimestamp + "' order by sendtime asc limit 0," + pageSize + ") order by sendtime; ";
            string dbPath    = $@"{AntSdkService.SqliteLocalDbPath}{AntSdkService.AntSdkCurrentUserInfo.userId}\{
                AntSdkService.AntSdkCurrentUserInfo.userId}.db";

            if (File.Exists(dbPath))
            {
                return(AntSdkSqliteHelper.ExecuteDataTable(selectStr, dbPath));
            }
            else
            {
                return(null);
            }
        }