update("delete from t_chat_room where chat_room_id NOT IN ("+StringUtil.join(" , ",roomIdList)+")",null);
update("delete from t_chat_room where chat_room_id NOT IN ("+StringUtil.join(" , ",roomIdList)+")",null);
...
@@ -192,6 +193,10 @@ public class ChatRoomDao extends AbstractDao {
...
@@ -192,6 +193,10 @@ public class ChatRoomDao extends AbstractDao {
}
}
}
}
publicvoiddeleteChatRoomUsers(IntegerchatRoomId){
update("delete from r_chat_room_shop_member where chat_room_id = ?",newInteger[]{chatRoomId});
}
publicbooleanupdateChatRoom(ChatRoomDtodto){
publicbooleanupdateChatRoom(ChatRoomDtodto){
longcount=update("update t_chat_room set chat_room_name=?, type=?, unread_count=?, user_count=?, favorite_register_date=? where chat_room_id=?",dto.getUpdateValues());
longcount=update("update t_chat_room set chat_room_name=?, type=?, unread_count=?, user_count=?, favorite_register_date=? where chat_room_id=?",dto.getUpdateValues());
returnrawQueryGetDtoList("select * from m_group where group_relation_id in (select group_relation_id from r_content_group where content_id = "+contentId+") order by group_id",null,GroupDto.class);
returnrawQueryGetDtoList("select * from m_group where group_relation_id in (select group_relation_id from r_content_group where content_id = "+contentId+") order by group_id",null,GroupDto.class);
}
publicList<String>getMyGroupPathList(){
StringBuffersql=newStringBuffer();
sql.append(" SELECT ");
sql.append(" CASE WHEN (grandparentgroup.group_name IS NOT NULL) THEN grandparentgroup.group_name || ' / ' || parentgroup.group_name || ' / ' || mygroup.group_name ");
sql.append(" WHEN (parentgroup.group_name IS NOT NULL) THEN parentgroup.group_name || ' / ' || mygroup.group_name ");
sql.append(" ELSE mygroup.group_name ");
sql.append(" END AS group_path_list ");
sql.append(" FROM m_group mygroup ");
sql.append(" LEFT JOIN m_group parentgroup on mygroup.parent_group_id = parentgroup.group_id ");
sql.append(" LEFT JOIN m_group grandparentgroup on parentgroup.parent_group_id = grandparentgroup.group_id ");
sql.append(" CASE WHEN (grandparentgroup.group_name IS NOT NULL) THEN grandparentgroup.group_name || ' / ' || parentgroup.group_name || ' / ' || usergroup.group_name ");
sql.append(" WHEN (parentgroup.group_name IS NOT NULL) THEN parentgroup.group_name || ' / ' || usergroup.group_name ");
sql.append(" ELSE usergroup.group_name ");
sql.append(" END AS group_path, usergroup.group_id ");
sql.append(" FROM m_group usergroup ");
sql.append(" LEFT JOIN m_group parentgroup on usergroup.parent_group_id = parentgroup.group_id ");
sql.append(" LEFT JOIN m_group grandparentgroup on parentgroup.parent_group_id = grandparentgroup.group_id ");
sql.append(" WHERE usergroup.group_id IN ");
sql.append(" (SELECT group_id ");
sql.append(" FROM m_shop_member sm INNER JOIN r_shop_member_group rsmg on sm.shop_member_id = rsmg.shop_member_id ");
list=rawQueryGetDtoList("select * from m_group mg where (mg.group_id = ?) UNION select * from m_group mg where (mg.parent_group_id = ?)",newString[]{""+baseId,""+parentId},GroupDto.class);
list=rawQueryGetDtoList("select * from m_group mg where (mg.group_id = ?) UNION select * from m_group mg where (mg.parent_group_id = ?)",newString[]{""+baseId,""+parentId},GroupDto.class);
returnlist;
returnlist;
}
}
publicList<GroupDto>getGroupTree(IntegergroupId){
List<GroupDto>list;
StringBuffersql=newStringBuffer();
sql.append(" WITH group_loop AS ");
sql.append(" ( ");
sql.append(" SELECT 1 rownum,group_id,group_name,parent_group_id,user_group_flg from m_group where group_id = ? ");
returnrawQueryGetDto("select parent.* from m_group parent inner join m_group child on child.parent_group_id = parent.group_id where child.group_id = ?",newString[]{""+childGroupId},GroupDto.class);
}
publicbooleanisExistParent(intbaseId){
publicbooleanisExistParent(intbaseId){
returnrawQueryGetInt("select * from m_group where parent_group_id = "+baseId,null)>0;
returnrawQueryGetInt("select * from m_group where parent_group_id = "+baseId,null)>0;
}
}
publicList<GroupDto>getUserGroups(){
publicList<GroupDto>getUserGroups(){
returnrawQueryGetDtoList("select * from m_group where user_group_flg = 1 ORDER BY group_name",null,GroupDto.class);
returnrawQueryGetDtoList("select * from m_group where user_group_flg = 1",null,GroupDto.class);
}
publicList<GroupDto>getMyGroups(){
returnrawQueryGetDtoList("select * from m_group where group_id IN (select group_id from m_shop_member sm inner join r_shop_member_group rmg on sm.shop_member_id = rmg.shop_member_id where sm.self_flg = 1) ORDER BY group_name ASC",null,GroupDto.class);