|
@ -42,6 +42,7 @@ class SessionRepo {
|
|
|
let sys_session = "select session_id from " + DB_TABLES.Participants + " w where w.participant_id = 'system' and participant_role =0 group by w.session_id";
|
|
|
let sessionSQL = "select id, name, type, create_date,business_type, last_sender_id, last_sender_name, last_content_type, last_content, last_message_time,status from "
|
|
|
+ DB_TABLES.Sessions + " s where s.id in(" + sql + ") and s.id not in ("+sys_session+")";
|
|
|
log.info("sql"+sessionSQL);
|
|
|
ImDb.execQuery({
|
|
|
"sql": sessionSQL,
|
|
|
"args": [userId],
|
|
@ -249,7 +250,7 @@ class SessionRepo {
|
|
|
//中山医院无法查询到所有会话记录,暂时取消participant_role的判断条件 20190619
|
|
|
sql = "select session_id from " + DB_TABLES.Participants + " w where w.participant_id = ? group by w.session_id";
|
|
|
sessionSQL = "select * from "
|
|
|
+ DB_TABLES.Sessions + " s where s.id in(" + sql + ") and s.business_type = ? and s.type!=0 order by s.create_date desc limit "+page+","+pagesize;
|
|
|
+ DB_TABLES.Sessions + " s where s.id in(" + sql + ") and s.business_type = ? and s.type!=0 order by s.last_message_time desc limit "+page+","+pagesize;
|
|
|
ImDb.execQuery({
|
|
|
"sql": sessionSQL,
|
|
|
"args": [userId, businessType],
|
|
@ -264,7 +265,7 @@ class SessionRepo {
|
|
|
//中山医院无法查询到所有会话记录,暂时取消participant_role的判断条件 20190619
|
|
|
sql = "select session_id from " + DB_TABLES.Participants + " w where w.participant_id = ? group by w.session_id";
|
|
|
sessionSQL = "select * from "
|
|
|
+ DB_TABLES.Sessions + " s where s.id in(" + sql + ") and s.type!=0 order by s.create_date desc limit "+page+","+pagesize;
|
|
|
+ DB_TABLES.Sessions + " s where s.id in(" + sql + ") and s.type!=0 order by s.last_message_time desc limit "+page+","+pagesize;
|
|
|
ImDb.execQuery({
|
|
|
"sql": sessionSQL,
|
|
|
"args": [userId],
|