Commit dacf27c7 by Lee Munkyeong

DM,GROUP検索

parent ec57a518
......@@ -62,7 +62,7 @@ public class ChatRoomDao extends AbstractDao {
return dto;
}
public List<ChatRoomDto> getAllChatRoom() {
public List<ChatRoomDto> getAllChatRoom(Integer roomType) {
StringBuffer sql = new StringBuffer();
sql.append(" SELECT ");
sql.append(" cr.chat_room_id ");
......@@ -79,9 +79,10 @@ public class ChatRoomDao extends AbstractDao {
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(" ON cr.chat_room_id = cm.chat_room_id ");
sql.append(" WHERE cr.type =? ");
sql.append(" GROUP BY cr.chat_room_id ");
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;
}
......
......@@ -69,8 +69,8 @@ public class CommunicationLogic extends AbstractLogic {
/*package*/ CommunicationLogic() {
}
public String getChatRoomList() {
List<ChatRoomDto> chatRoomList = chatRoomDao.getAllChatRoom();
public String getChatRoomList(Integer roomType) {
List<ChatRoomDto> chatRoomList = chatRoomDao.getAllChatRoom(roomType);
JSONArray resultJsonArray = new JSONArray();
for (ChatRoomDto chatRoomDto : chatRoomList) {
......
......@@ -684,8 +684,9 @@ public class ChatWebviewActivity extends ParentWebViewActivity {
}
@JavascriptInterface
public String getRoomList() {
String chatRoomListStr = communicationLogic.getChatRoomList();
public String getRoomList(String roomType) {
String chatRoomListStr = communicationLogic.getChatRoomList(Integer.parseInt(roomType));
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