@@ -70,7 +70,7 @@ public class ChatGroupDao extends AbstractCommunicationDao {
...
@@ -70,7 +70,7 @@ public class ChatGroupDao extends AbstractCommunicationDao {
sql.append(" FROM m_chat_group mygroup ");
sql.append(" FROM m_chat_group mygroup ");
sql.append(" LEFT JOIN m_chat_group parentgroup on mygroup.parent_group_id = parentgroup.group_id ");
sql.append(" LEFT JOIN m_chat_group parentgroup on mygroup.parent_group_id = parentgroup.group_id ");
sql.append(" LEFT JOIN m_chat_group grandparentgroup on parentgroup.parent_group_id = grandparentgroup.group_id ");
sql.append(" LEFT JOIN m_chat_group grandparentgroup on parentgroup.parent_group_id = grandparentgroup.group_id ");
sql.append(" WHERE mygroup.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)");
sql.append(" WHERE mygroup.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)");
returnrawQueryGetStringList(sql.toString(),null);
returnrawQueryGetStringList(sql.toString(),null);
}
}
...
@@ -83,7 +83,7 @@ public class ChatGroupDao extends AbstractCommunicationDao {
...
@@ -83,7 +83,7 @@ public class ChatGroupDao extends AbstractCommunicationDao {
sql.append(" END AS group_path, usergroup.group_id ");
sql.append(" END AS group_path, usergroup.group_id ");
sql.append(" FROM m_chat_group usergroup ");
sql.append(" FROM m_chat_group usergroup ");
sql.append(" LEFT JOIN m_chat_group parentgroup on usergroup.parent_group_id = parentgroup.group_id ");
sql.append(" LEFT JOIN m_chat_group parentgroup on usergroup.parent_group_id = parentgroup.group_id ");
sql.append(" LEFT JOIN m_chat_group grandparentgroup on parentgroup.parent_group_id = grandparentgroup.group_id ");
sql.append(" LEFT JOIN m_chat_group grandparentgroup ON parentgroup.parent_group_id = grandparentgroup.group_id ");
sql.append(" WHERE usergroup.group_id IN ");
sql.append(" WHERE usergroup.group_id IN ");
sql.append(" (SELECT group_id ");
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 ");
sql.append(" FROM m_shop_member sm INNER JOIN r_shop_member_group rsmg on sm.shop_member_id = rsmg.shop_member_id ");
...
@@ -156,11 +156,11 @@ public class ChatGroupDao extends AbstractCommunicationDao {
...
@@ -156,11 +156,11 @@ public class ChatGroupDao extends AbstractCommunicationDao {
}
}
publicChatGroupDtogetGroup(intgroupId){
publicChatGroupDtogetGroup(intgroupId){
returnrawQueryGetDto("select * from m_chat_group where group_id = "+groupId,null,ChatGroupDto.class);
returnrawQueryGetDto("SELECT * from m_chat_group WHERE group_id = "+groupId,null,ChatGroupDto.class);
}
}
publicList<ChatGroupDto>getFavoriteGroup(){
publicList<ChatGroupDto>getFavoriteGroup(){
returnrawQueryGetDtoList("select * from m_chat_group where favorite_register_date IS NOT NULL ORDER BY favorite_register_date ",null,ChatGroupDto.class);
returnrawQueryGetDtoList("SELECT * from m_chat_group WHERE favorite_register_date IS NOT NULL ORDER BY favorite_register_date ",null,ChatGroupDto.class);
list=rawQueryGetDtoList("select * from m_chat_group mg where (mg.parent_group_id = ?) ORDER BY group_name",newString[]{""+parentId},ChatGroupDto.class);
list=rawQueryGetDtoList("SELECT * FROM m_chat_group mg WHERE (mg.parent_group_id = ?) ORDER BY group_name",newString[]{""+parentId},ChatGroupDto.class);
returnlist;
returnlist;
}
}
publicChatGroupDtogetRootGroup(){
publicChatGroupDtogetRootGroup(){
returnrawQueryGetDto("select * from m_chat_group mg where (mg.parent_group_id = 0)",null,ChatGroupDto.class);
returnrawQueryGetDto("SELECT * FROM m_chat_group mg WHERE (mg.parent_group_id = 0)",null,ChatGroupDto.class);
returnrawQueryGetDto("select parent.* from m_chat_group parent inner join m_chat_group child on child.parent_group_id = parent.group_id where child.group_id = ?",newString[]{""+childGroupId},ChatGroupDto.class);
returnrawQueryGetDto("SELECT parent.* from m_chat_group parent INNER JOIN m_chat_group child on child.parent_group_id = parent.group_id WHERE child.group_id = ?",newString[]{""+childGroupId},ChatGroupDto.class);
}
}
publicbooleanisExistParent(intbaseId){
publicbooleanisExistParent(intbaseId){
returnrawQueryGetInt("select * from m_chat_group where parent_group_id = "+baseId,null)>0;
returnrawQueryGetInt("SELECT * FROM m_chat_group WHERE parent_group_id = "+baseId,null)>0;
}
}
publicList<ChatGroupDto>getMyGroups(){
publicList<ChatGroupDto>getMyGroups(){
returnrawQueryGetDtoList("select * from m_chat_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,ChatGroupDto.class);
returnrawQueryGetDtoList("SELECT * FROM m_chat_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,ChatGroupDto.class);
returnrawQueryGetDto("select * from m_shop_member where shop_member_id=?",newString[]{""+shopMemberId},ShopMemberDto.class);
returnrawQueryGetDto("SELECT * FROM m_shop_member WHERE shop_member_id=?",newString[]{""+shopMemberId},ShopMemberDto.class);
}
}
publicvoidinsertShopMember(ShopMemberDtodto){
publicvoidinsertShopMember(ShopMemberDtodto){
try{
try{
beginTransaction();
beginTransaction();
insert("insert or replace into m_shop_member (shop_member_id, shop_member_name, login_id, profile_url, self_flg, favorite_register_date) values (?,?,?,?,?,(select favorite_register_date from m_shop_member where shop_member_id = ?))",dto.getInsertValues());
insert("INSERT OR REPLACE INTO m_shop_member (shop_member_id, shop_member_name, login_id, profile_url, self_flg, favorite_register_date) VALUES (?,?,?,?,?,(SELECT favorite_register_date FROM m_shop_member WHERE shop_member_id = ?))",dto.getInsertValues());
@@ -257,7 +253,7 @@ public class ShopMemberDao extends AbstractCommunicationDao {
...
@@ -257,7 +253,7 @@ public class ShopMemberDao extends AbstractCommunicationDao {
sql.append(" m_shop_member AS sm ");
sql.append(" m_shop_member AS sm ");
sql.append(" INNER JOIN r_shop_member_group AS rsmg ");
sql.append(" INNER JOIN r_shop_member_group AS rsmg ");
sql.append(" ON sm.shop_member_id = rsmg.shop_member_id ");
sql.append(" ON sm.shop_member_id = rsmg.shop_member_id ");
sql.append("WHERE rsmg.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) ");
sql.append("WHERE rsmg.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) ");
@@ -286,7 +282,7 @@ public class ShopMemberDao extends AbstractCommunicationDao {
...
@@ -286,7 +282,7 @@ public class ShopMemberDao extends AbstractCommunicationDao {
sql.append(" m_shop_member AS sm ");
sql.append(" m_shop_member AS sm ");
sql.append(" INNER JOIN r_shop_member_group AS rsmg ");
sql.append(" INNER JOIN r_shop_member_group AS rsmg ");
sql.append(" ON sm.shop_member_id = rsmg.shop_member_id ");
sql.append(" ON sm.shop_member_id = rsmg.shop_member_id ");
sql.append(" WHERE rsmg.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)");
sql.append(" WHERE rsmg.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)");
sql.append(" AND sm.self_flg != 1");
sql.append(" AND sm.self_flg != 1");
sql.append(" AND sm.shop_member_id NOT IN (SELECT shop_member_id FROM r_chat_room_shop_member WHERE chat_room_id = ?)");
sql.append(" AND sm.shop_member_id NOT IN (SELECT shop_member_id FROM r_chat_room_shop_member WHERE chat_room_id = ?)");
update("update m_shop_member set favorite_register_date=? where shop_member_id=?",newObject[]{favoriteUserDto.favoriteRegisterDate,favoriteUserDto.shopMemberId});
update("UPDATE m_shop_member SET favorite_register_date=? WHERE shop_member_id=?",newObject[]{favoriteUserDto.favoriteRegisterDate,favoriteUserDto.shopMemberId});