Commit dacf27c7 by Lee Munkyeong

DM,GROUP検索

parent ec57a518
...@@ -62,7 +62,7 @@ public class ChatRoomDao extends AbstractDao { ...@@ -62,7 +62,7 @@ public class ChatRoomDao extends AbstractDao {
return dto; return dto;
} }
public List<ChatRoomDto> getAllChatRoom() { public List<ChatRoomDto> getAllChatRoom(Integer roomType) {
StringBuffer sql = new StringBuffer(); StringBuffer sql = new StringBuffer();
sql.append(" SELECT "); sql.append(" SELECT ");
sql.append(" cr.chat_room_id "); sql.append(" cr.chat_room_id ");
...@@ -79,9 +79,10 @@ public class ChatRoomDao extends AbstractDao { ...@@ -79,9 +79,10 @@ public class ChatRoomDao extends AbstractDao {
sql.append(" LEFT JOIN "); sql.append(" LEFT JOIN ");
sql.append(" ( SELECT max(insert_date) insert_date, message, message_type, chat_room_id FROM t_chat_message GROUP BY chat_room_id ) AS cm "); sql.append(" ( SELECT max(insert_date) insert_date, message, message_type, chat_room_id FROM t_chat_message GROUP BY chat_room_id ) AS cm ");
sql.append(" ON cr.chat_room_id = cm.chat_room_id "); sql.append(" ON cr.chat_room_id = cm.chat_room_id ");
sql.append(" WHERE cr.type =? ");
sql.append(" GROUP BY cr.chat_room_id "); sql.append(" GROUP BY cr.chat_room_id ");
sql.append(" ORDER BY unread_count, cm.insert_date DESC "); sql.append(" ORDER BY unread_count, cm.insert_date DESC ");
List<ChatRoomDto> list = rawQueryGetDtoList(sql.toString(), null, ChatRoomDto.class); List<ChatRoomDto> list = rawQueryGetDtoList(sql.toString(), new String[]{""+ roomType}, ChatRoomDto.class);
return list; return list;
} }
......
...@@ -69,8 +69,8 @@ public class CommunicationLogic extends AbstractLogic { ...@@ -69,8 +69,8 @@ public class CommunicationLogic extends AbstractLogic {
/*package*/ CommunicationLogic() { /*package*/ CommunicationLogic() {
} }
public String getChatRoomList() { public String getChatRoomList(Integer roomType) {
List<ChatRoomDto> chatRoomList = chatRoomDao.getAllChatRoom(); List<ChatRoomDto> chatRoomList = chatRoomDao.getAllChatRoom(roomType);
JSONArray resultJsonArray = new JSONArray(); JSONArray resultJsonArray = new JSONArray();
for (ChatRoomDto chatRoomDto : chatRoomList) { for (ChatRoomDto chatRoomDto : chatRoomList) {
......
...@@ -684,8 +684,9 @@ public class ChatWebviewActivity extends ParentWebViewActivity { ...@@ -684,8 +684,9 @@ public class ChatWebviewActivity extends ParentWebViewActivity {
} }
@JavascriptInterface @JavascriptInterface
public String getRoomList() { public String getRoomList(String roomType) {
String chatRoomListStr = communicationLogic.getChatRoomList();
String chatRoomListStr = communicationLogic.getChatRoomList(Integer.parseInt(roomType));
return chatRoomListStr; return chatRoomListStr;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment