huangwenjie преди 4 години
родител
ревизия
d08faabf43
променени са 2 файла, в които са добавени 3 реда и са изтрити 3 реда
  1. 1 1
      src/server/models/sessions/sessions.js
  2. 2 2
      src/server/repository/oracle/session.repo.js

+ 1 - 1
src/server/models/sessions/sessions.js

@ -1368,7 +1368,7 @@ class Sessions extends RedisModel {
        let patientEndCount = 0;
        if(type){
            // SessionRepo.findAllBySessionType(userId, type,function (err, res) {
            SessionRepo.findUnEndAll(userId, function (err, res) {
            SessionRepo.findUnEndAll(userId,type,function (err, res) {
                if (err) {
                    if(handler)
                    {

+ 2 - 2
src/server/repository/oracle/session.repo.js

@ -82,11 +82,11 @@ class SessionRepo {
     * @param userId
     * @param handler
     */
    static findUnEndAll(userId, handler) {
    static findUnEndAll(userId, type,handler) {
        let sql = "SELECT SESSION_ID FROM " + DB_TABLES.Participants + " W WHERE W.PARTICIPANT_ID = :PARTICIPANT_ID AND PARTICIPANT_ROLE =0  GROUP BY W.SESSION_ID";
        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 S.\"ID\" AS \"id\",S.\"NAME\" AS \"name\",S.\"TYPE\" AS \"type\",S.\"BUSINESS_TYPE\" AS \"business_type\",S.\"STATUS\" AS \"status\",S.\"CREATE_DATE\" AS \"create_date\",S.\"LAST_SENDER_ID\" AS \"last_sender_id\",S.\"LAST_SENDER_NAME\" AS \"last_sender_name\",S.\"LAST_CONTENT_TYPE\" AS \"last_content_type\",S.\"LAST_CONTENT\" AS \"last_content\",S.\"LAST_MESSAGE_TIME\" AS \"last_message_time\",S.\"BAK_ID\" AS \"bak_id\" FROM "
            + DB_TABLES.Sessions + " S WHERE S.ID IN(" + sql + ") AND S.ID NOT IN ("+sys_session+") AND S.STATUS = 0";
            + DB_TABLES.Sessions + " S WHERE S.ID IN(" + sql + ") AND S.TYPE IN(" + type + ")AND S.ID NOT IN ("+sys_session+") AND S.STATUS = 0";
        oracledbUtil.query({
            "sql": sessionSQL,