家族成员列表接口完善
This commit is contained in:
parent
e9df22f1a1
commit
22b417206e
@ -10,6 +10,7 @@ import com.red.circle.other.app.dto.clientobject.family.FamilyLeaderboardCO;
|
||||
import com.red.circle.other.app.dto.clientobject.family.FamilyLevelParentCacheCO;
|
||||
import com.red.circle.other.app.dto.clientobject.family.FamilyMemberCO;
|
||||
import com.red.circle.other.app.dto.clientobject.family.FamilyMsgListCO;
|
||||
import com.red.circle.other.app.dto.clientobject.family.MyFamilyApplyCO;
|
||||
import com.red.circle.other.app.dto.clientobject.family.FamilyRewardCO;
|
||||
import com.red.circle.other.app.dto.clientobject.family.FamilyUserInfoCO;
|
||||
import com.red.circle.other.app.dto.clientobject.room.RoomVoiceProfileCO;
|
||||
@ -26,6 +27,7 @@ import com.red.circle.other.app.dto.cmd.family.FamilyMemberListCmd;
|
||||
import com.red.circle.other.app.dto.cmd.family.FamilyMemberListQueryCmd;
|
||||
import com.red.circle.other.app.dto.cmd.family.FamilyMessageHandleCmd;
|
||||
import com.red.circle.other.app.dto.cmd.family.FamilyMessageListCmd;
|
||||
import com.red.circle.other.app.dto.cmd.family.MyFamilyApplyListCmd;
|
||||
import com.red.circle.other.app.dto.cmd.family.FamilyOnlineRoomQueryCmd;
|
||||
import com.red.circle.other.app.dto.cmd.family.FamilyRemoveUserCmd;
|
||||
import com.red.circle.other.app.dto.cmd.family.FamilyUserInfoQueryCmd;
|
||||
@ -108,6 +110,14 @@ public class FamilyRestController extends BaseController {
|
||||
return familyService.listMessage(cmd);
|
||||
}
|
||||
|
||||
/**
|
||||
* 我的家族申请列表.
|
||||
*/
|
||||
@GetMapping("/my-apply-list")
|
||||
public List<MyFamilyApplyCO> myApplyList(MyFamilyApplyListCmd cmd) {
|
||||
return familyService.myApplyList(cmd);
|
||||
}
|
||||
|
||||
/**
|
||||
* 家族族长信息(与家族成员信息 数据结构一致).
|
||||
*
|
||||
@ -123,11 +133,6 @@ public class FamilyRestController extends BaseController {
|
||||
|
||||
/**
|
||||
* 家族成员信息.(旧:list_member)
|
||||
*
|
||||
* @eo.name 家族成员信息.
|
||||
* @eo.url /list/member
|
||||
* @eo.method get
|
||||
* @eo.request-type formdata
|
||||
*/
|
||||
@GetMapping("/list/member")
|
||||
public List<FamilyMemberCO> listMember(FamilyMemberListQueryCmd cmd) {
|
||||
|
||||
@ -10,12 +10,14 @@ import com.red.circle.other.infra.database.rds.dto.family.FamilyMemberExpDTO;
|
||||
import com.red.circle.other.infra.database.rds.service.family.FamilyMemberWeekExpService;
|
||||
import com.red.circle.other.infra.enums.family.FamilyRoleEnum;
|
||||
import com.red.circle.other.inner.asserts.FamilyErrorCode;
|
||||
import com.red.circle.other.inner.model.dto.user.OwnSpecialIdDTO;
|
||||
import com.red.circle.other.inner.model.dto.user.UserProfileDTO;
|
||||
import com.red.circle.tool.core.collection.CollectionUtils;
|
||||
import com.red.circle.tool.core.num.NumUtils;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.util.Optional;
|
||||
import java.util.function.Function;
|
||||
import java.util.stream.Collectors;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
@ -65,10 +67,9 @@ public class FamilyGetMembersExe {
|
||||
.setMemberId(member.getId())
|
||||
.setMemberUserId(member.getMemberUserId())
|
||||
.setMemberAvatar(user.getUserAvatar())
|
||||
.setAccount(user.getAccount())
|
||||
.setSpecialAccount(Optional.ofNullable(user.getOwnSpecialId()).map(OwnSpecialIdDTO::getAccount).orElse(null))
|
||||
.setMemberNickname(user.getUserNickname())
|
||||
.setMemberAge(user.getAge())
|
||||
.setMemberSex(Objects.equals(user.getUserSex(), 1))
|
||||
.setMemberExp(NumUtils.formatBigDecimal(member.getExp()))
|
||||
.setMemberRole(member.getMemberRole())
|
||||
;
|
||||
|
||||
|
||||
@ -10,12 +10,14 @@ import com.red.circle.other.infra.database.rds.dto.family.FamilyMemberExpDTO;
|
||||
import com.red.circle.other.infra.database.rds.service.family.FamilyMemberWeekExpService;
|
||||
import com.red.circle.other.infra.enums.family.FamilyRoleEnum;
|
||||
import com.red.circle.other.inner.asserts.FamilyErrorCode;
|
||||
import com.red.circle.other.inner.model.dto.user.OwnSpecialIdDTO;
|
||||
import com.red.circle.other.inner.model.dto.user.UserProfileDTO;
|
||||
import com.red.circle.tool.core.collection.CollectionUtils;
|
||||
import com.red.circle.tool.core.num.NumUtils;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.util.Optional;
|
||||
import java.util.stream.Collectors;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Component;
|
||||
@ -64,10 +66,9 @@ public class FamilyMemberListExe {
|
||||
.setMemberId(member.getId())
|
||||
.setMemberUserId(member.getMemberUserId())
|
||||
.setMemberAvatar(user.getUserAvatar())
|
||||
.setAccount(user.getAccount())
|
||||
.setSpecialAccount(Optional.ofNullable(user.getOwnSpecialId()).map(OwnSpecialIdDTO::getAccount).orElse(null))
|
||||
.setMemberNickname(user.getUserNickname())
|
||||
.setMemberAge(user.getAge())
|
||||
.setMemberSex(Objects.equals(user.getUserSex(), 1))
|
||||
.setMemberExp(NumUtils.formatBigDecimal(member.getExp()))
|
||||
.setMemberRole(member.getMemberRole())
|
||||
;
|
||||
|
||||
@ -82,7 +83,7 @@ public class FamilyMemberListExe {
|
||||
private List<FamilyMemberExpDTO> pageList(FamilyMemberListQueryCmd cmd) {
|
||||
return familyMemberWeekExpService
|
||||
.pageByFamilyId(cmd.getFamilyId(),
|
||||
List.of(FamilyRoleEnum.MANAGE, FamilyRoleEnum.MEMBER), cmd.getPageNo(),
|
||||
List.of(FamilyRoleEnum.MANAGE, FamilyRoleEnum.MEMBER, FamilyRoleEnum.ADMIN), cmd.getPageNo(),
|
||||
cmd.getPageSize());
|
||||
}
|
||||
|
||||
|
||||
@ -0,0 +1,70 @@
|
||||
package com.red.circle.other.app.command.family;
|
||||
|
||||
import com.google.common.collect.Lists;
|
||||
import com.red.circle.framework.mybatis.constant.PageConstant;
|
||||
import com.red.circle.other.app.dto.clientobject.family.MyFamilyApplyCO;
|
||||
import com.red.circle.other.app.dto.cmd.family.MyFamilyApplyListCmd;
|
||||
import com.red.circle.other.infra.common.family.FamilyCommon;
|
||||
import com.red.circle.other.infra.database.rds.entity.family.FamilyBaseInfo;
|
||||
import com.red.circle.other.infra.database.rds.entity.family.FamilyMessage;
|
||||
import com.red.circle.other.infra.database.rds.service.family.FamilyBaseInfoService;
|
||||
import com.red.circle.other.infra.database.rds.service.family.FamilyMessageService;
|
||||
import com.red.circle.other.inner.enums.FamilyMessageStatusEnum;
|
||||
import com.red.circle.other.inner.model.dto.famliy.FamilyDetailsDTO;
|
||||
import com.red.circle.tool.core.collection.CollectionUtils;
|
||||
import com.red.circle.tool.core.date.TimestampUtils;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.util.Set;
|
||||
import java.util.stream.Collectors;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
/**
|
||||
* 我的家族申请列表.
|
||||
*/
|
||||
@Component
|
||||
@RequiredArgsConstructor
|
||||
public class MyFamilyApplyListExe {
|
||||
|
||||
private final FamilyMessageService familyMessageService;
|
||||
private final FamilyBaseInfoService familyInfoService;
|
||||
private final FamilyCommon familyCommon;
|
||||
|
||||
public List<MyFamilyApplyCO> execute(MyFamilyApplyListCmd cmd) {
|
||||
|
||||
List<FamilyMessage> msgList = familyMessageService.query()
|
||||
.eq(FamilyMessage::getSenderUser, cmd.getReqUserId())
|
||||
.lt(Objects.nonNull(cmd.getLastId()), FamilyMessage::getId, cmd.getLastId())
|
||||
.orderByDesc(FamilyMessage::getId)
|
||||
.last(PageConstant.DEFAULT_LIMIT)
|
||||
.list();
|
||||
|
||||
if (CollectionUtils.isEmpty(msgList)) {
|
||||
return Lists.newArrayList();
|
||||
}
|
||||
|
||||
Set<Long> familyIds = msgList.stream()
|
||||
.map(FamilyMessage::getFamilyId)
|
||||
.collect(Collectors.toSet());
|
||||
|
||||
Map<Long, FamilyBaseInfo> familyMap = familyInfoService.query()
|
||||
.in(FamilyBaseInfo::getId, familyIds)
|
||||
.list()
|
||||
.stream()
|
||||
.collect(Collectors.toMap(FamilyBaseInfo::getId, f -> f));
|
||||
|
||||
return msgList.stream().map(msg -> {
|
||||
FamilyDetailsDTO familyDetails = familyCommon.getFamilyDetails(msg.getSysOrigin(), msg.getFamilyId());
|
||||
return new MyFamilyApplyCO()
|
||||
.setMsgId(msg.getId())
|
||||
.setFamilyId(msg.getFamilyId())
|
||||
.setFamilyName(familyDetails != null ? familyDetails.getFamilyName() : "")
|
||||
.setFamilyAvatar(familyDetails != null ? familyDetails.getFamilyAvatar() : "")
|
||||
.setMaxMember(familyDetails != null ? familyDetails.getMaxMember() : 0)
|
||||
.setStatus(msg.getStatus())
|
||||
.setCreateTime(msg.getCreateTime());
|
||||
}).toList();
|
||||
}
|
||||
}
|
||||
@ -25,12 +25,14 @@ import com.red.circle.other.app.command.family.FamilyRewardExe;
|
||||
import com.red.circle.other.app.command.family.FamilyUserExitExe;
|
||||
import com.red.circle.other.app.command.family.FamilyUserInfoExe;
|
||||
import com.red.circle.other.app.command.family.ReceiveFamilyAwardExe;
|
||||
import com.red.circle.other.app.command.family.MyFamilyApplyListExe;
|
||||
import com.red.circle.other.app.dto.clientobject.family.FamilyBaseInfoCO;
|
||||
import com.red.circle.other.app.dto.clientobject.family.FamilyCreateRulesCO;
|
||||
import com.red.circle.other.app.dto.clientobject.family.FamilyLeaderboardCO;
|
||||
import com.red.circle.other.app.dto.clientobject.family.FamilyLevelParentCacheCO;
|
||||
import com.red.circle.other.app.dto.clientobject.family.FamilyMemberCO;
|
||||
import com.red.circle.other.app.dto.clientobject.family.FamilyMsgListCO;
|
||||
import com.red.circle.other.app.dto.clientobject.family.MyFamilyApplyCO;
|
||||
import com.red.circle.other.app.dto.clientobject.family.FamilyRewardCO;
|
||||
import com.red.circle.other.app.dto.clientobject.family.FamilyUserInfoCO;
|
||||
import com.red.circle.other.app.dto.clientobject.room.RoomVoiceProfileCO;
|
||||
@ -47,6 +49,7 @@ import com.red.circle.other.app.dto.cmd.family.FamilyMemberListCmd;
|
||||
import com.red.circle.other.app.dto.cmd.family.FamilyMemberListQueryCmd;
|
||||
import com.red.circle.other.app.dto.cmd.family.FamilyMessageHandleCmd;
|
||||
import com.red.circle.other.app.dto.cmd.family.FamilyMessageListCmd;
|
||||
import com.red.circle.other.app.dto.cmd.family.MyFamilyApplyListCmd;
|
||||
import com.red.circle.other.app.dto.cmd.family.FamilyOnlineRoomQueryCmd;
|
||||
import com.red.circle.other.app.dto.cmd.family.FamilyRemoveUserCmd;
|
||||
import com.red.circle.other.app.dto.cmd.family.FamilyUserInfoQueryCmd;
|
||||
@ -95,6 +98,7 @@ public class FamilyServiceImpl implements FamilyService {
|
||||
private final FamilyDismissGroupChatExe familyDismissGroupChatExe;
|
||||
private final FamilyMemberIdGetUserIdExe familyMemberIdGetUserIdExe;
|
||||
private final FamilyPurchasingGroupChatExe familyPurchasingGroupChatExe;
|
||||
private final MyFamilyApplyListExe myFamilyApplyListExe;
|
||||
private final DistributedLockUtil distributedLockUtil;
|
||||
|
||||
@Override
|
||||
@ -227,4 +231,9 @@ public class FamilyServiceImpl implements FamilyService {
|
||||
return familyGetMembersExe.execute(cmd);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<MyFamilyApplyCO> myApplyList(MyFamilyApplyListCmd cmd) {
|
||||
return myFamilyApplyListExe.execute(cmd);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -42,6 +42,10 @@ public class FamilyMemberCO extends ClientObject {
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long memberUserId;
|
||||
|
||||
private String account;
|
||||
|
||||
private String specialAccount;
|
||||
|
||||
/**
|
||||
* 成员头像
|
||||
*/
|
||||
|
||||
@ -0,0 +1,49 @@
|
||||
package com.red.circle.other.app.dto.clientobject.family;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.sql.Timestamp;
|
||||
|
||||
/**
|
||||
* 我的家族申请信息.
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class MyFamilyApplyCO {
|
||||
|
||||
/**
|
||||
* 消息ID.
|
||||
*/
|
||||
private Long msgId;
|
||||
|
||||
/**
|
||||
* 家族ID.
|
||||
*/
|
||||
private Long familyId;
|
||||
|
||||
/**
|
||||
* 家族名称.
|
||||
*/
|
||||
private String familyName;
|
||||
|
||||
/**
|
||||
* 家族头像.
|
||||
*/
|
||||
private String familyAvatar;
|
||||
|
||||
/**
|
||||
* 最大人数
|
||||
*/
|
||||
private Integer maxMember;
|
||||
|
||||
/**
|
||||
* 状态(0.待审核 1.已通过 2.已驳回 -1.已取消).
|
||||
*/
|
||||
private Integer status;
|
||||
|
||||
/**
|
||||
* 创建时间.
|
||||
*/
|
||||
private Timestamp createTime;
|
||||
}
|
||||
@ -0,0 +1,15 @@
|
||||
package com.red.circle.other.app.dto.cmd.family;
|
||||
|
||||
import com.red.circle.common.business.dto.cmd.AppExtCommand;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* 我的家族申请列表查询.
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class MyFamilyApplyListCmd extends AppExtCommand {
|
||||
|
||||
private Long lastId;
|
||||
}
|
||||
@ -2,32 +2,10 @@ package com.red.circle.other.app.service.family;
|
||||
|
||||
|
||||
import com.red.circle.common.business.dto.cmd.AppExtCommand;
|
||||
import com.red.circle.other.app.dto.clientobject.family.FamilyBaseInfoCO;
|
||||
import com.red.circle.other.app.dto.clientobject.family.FamilyCreateRulesCO;
|
||||
import com.red.circle.other.app.dto.clientobject.family.FamilyLeaderboardCO;
|
||||
import com.red.circle.other.app.dto.clientobject.family.FamilyLevelParentCacheCO;
|
||||
import com.red.circle.other.app.dto.clientobject.family.FamilyMemberCO;
|
||||
import com.red.circle.other.app.dto.clientobject.family.FamilyMsgListCO;
|
||||
import com.red.circle.other.app.dto.clientobject.family.FamilyRewardCO;
|
||||
import com.red.circle.other.app.dto.clientobject.family.FamilyUserInfoCO;
|
||||
import com.red.circle.other.app.dto.clientobject.family.*;
|
||||
import com.red.circle.other.app.dto.clientobject.room.RoomVoiceProfileCO;
|
||||
import com.red.circle.other.app.dto.cmd.family.ApplyJoinFamilyCmd;
|
||||
import com.red.circle.other.app.dto.cmd.family.FamilyAdminQueryCmd;
|
||||
import com.red.circle.other.app.dto.cmd.family.FamilyBaseInfoQueryCmd;
|
||||
import com.red.circle.other.app.dto.cmd.family.FamilyCreateCmd;
|
||||
import com.red.circle.other.app.dto.cmd.family.FamilyDailyTaskCmd;
|
||||
import com.red.circle.other.app.dto.cmd.family.FamilyGrantUserRoleCmd;
|
||||
import com.red.circle.other.app.dto.cmd.family.FamilyGroupChatPayCheckCmd;
|
||||
import com.red.circle.other.app.dto.cmd.family.FamilyGroupChatQueryCmd;
|
||||
import com.red.circle.other.app.dto.cmd.family.FamilyInfoEditCmd;
|
||||
import com.red.circle.other.app.dto.cmd.family.FamilyMemberListCmd;
|
||||
import com.red.circle.other.app.dto.cmd.family.FamilyMemberListQueryCmd;
|
||||
import com.red.circle.other.app.dto.cmd.family.FamilyMessageHandleCmd;
|
||||
import com.red.circle.other.app.dto.cmd.family.FamilyMessageListCmd;
|
||||
import com.red.circle.other.app.dto.cmd.family.FamilyOnlineRoomQueryCmd;
|
||||
import com.red.circle.other.app.dto.cmd.family.FamilyRemoveUserCmd;
|
||||
import com.red.circle.other.app.dto.cmd.family.FamilyUserInfoQueryCmd;
|
||||
import com.red.circle.other.app.dto.cmd.family.ReceiveFamilyAwardCmd;
|
||||
import com.red.circle.other.app.dto.cmd.family.*;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
@ -156,4 +134,9 @@ public interface FamilyService {
|
||||
* 家族成员信息-不分页.
|
||||
*/
|
||||
List<FamilyMemberCO> getMembers(FamilyMemberListCmd cmd);
|
||||
|
||||
/**
|
||||
* 我的家族申请列表.
|
||||
*/
|
||||
List<MyFamilyApplyCO> myApplyList(MyFamilyApplyListCmd cmd);
|
||||
}
|
||||
|
||||
@ -401,7 +401,7 @@ public class FamilyCommon {
|
||||
* @param levelConfig 等级信息
|
||||
* @param familyCO 容器
|
||||
*/
|
||||
private void handleFamilyLevel(FamilyLevelConfig levelConfig, FamilyDetailsDTO familyCO) {
|
||||
private void fillFamilyDetails(FamilyLevelConfig levelConfig, FamilyDetailsDTO familyCO) {
|
||||
|
||||
/*PropsSourceRecord avatarFrame = getPropsSourceById(levelConfig.getAvatarFrameId());
|
||||
BadgePictureConfig badge = getByBadgeId(levelConfig.getSysOrigin(),
|
||||
@ -490,7 +490,7 @@ public class FamilyCommon {
|
||||
FamilyDetailsDTO levelCacheCO = new FamilyDetailsDTO()
|
||||
.setFamilyId(familyId);
|
||||
|
||||
handleFamilyLevel(levelConfig, levelCacheCO);
|
||||
fillFamilyDetails(levelConfig, levelCacheCO);
|
||||
|
||||
familyLevelCacheService.setFamilyLevelData(key, levelCacheCO);
|
||||
}
|
||||
@ -503,23 +503,23 @@ public class FamilyCommon {
|
||||
* @return 等级信息
|
||||
*/
|
||||
public FamilyDetailsDTO getFamilyDetails(String sysOrigin, Long familyId) {
|
||||
FamilyDetailsDTO thisLevelCO = familyLevelCacheService
|
||||
FamilyDetailsDTO familyDetailsDTO = familyLevelCacheService
|
||||
.getFamilyLevelData(sysOrigin + familyId, FamilyDetailsDTO.class);
|
||||
|
||||
if (Objects.isNull(thisLevelCO)) {
|
||||
if (Objects.isNull(familyDetailsDTO)) {
|
||||
|
||||
FamilyBaseInfo familyBaseInfo = getFamilyBaseInfo(familyId);
|
||||
ResponseAssert.notNull(FamilyErrorCode.NOT_EXIST_FAMILY_INFO_DATA, familyBaseInfo);
|
||||
|
||||
thisLevelCO = new FamilyDetailsDTO()
|
||||
familyDetailsDTO = new FamilyDetailsDTO()
|
||||
.setFamilyId(familyId)
|
||||
.setFamilyName(familyBaseInfo.getFamilyName())
|
||||
.setFamilyAccount(familyBaseInfo.getFamilyAccount())
|
||||
.setFamilyAvatar(familyBaseInfo.getFamilyAvatar())
|
||||
.setFamilyNotice(familyBaseInfo.getFamilyNotice());
|
||||
handleFamilyLevel(getFamilyLevelConfig(familyBaseInfo.getFamilyLevelId()), thisLevelCO);
|
||||
fillFamilyDetails(getFamilyLevelConfig(familyBaseInfo.getFamilyLevelId()), familyDetailsDTO);
|
||||
}
|
||||
return thisLevelCO;
|
||||
return familyDetailsDTO;
|
||||
}
|
||||
|
||||
private FamilyLevelConfig getFamilyLevelConfig(Long familyLevelId) {
|
||||
|
||||
@ -18,9 +18,7 @@ import org.apache.ibatis.annotations.Param;
|
||||
*/
|
||||
public interface FamilyMemberWeekExpDAO extends BaseDAO<FamilyMemberWeekExp> {
|
||||
|
||||
List<FamilyMemberExpDTO> pageByFamilyId(@Param("familyId") Long familyId,
|
||||
@Param("roles") List<FamilyRoleEnum> roles,
|
||||
@Param("start") Integer start, @Param("end") Integer end);
|
||||
List<FamilyMemberExpDTO> pageByFamilyId(@Param("familyId") Long familyId, @Param("start") Integer start, @Param("end") Integer end);
|
||||
|
||||
List<FamilyMemberExpDTO> listByFamilyId(@Param("familyId") Long familyId,
|
||||
@Param("roles") List<FamilyRoleEnum> roles);
|
||||
|
||||
@ -117,7 +117,7 @@ public class FamilyMemberWeekExpServiceImpl extends
|
||||
return CollectionUtils.newArrayList();
|
||||
}
|
||||
pageSize = Objects.isNull(pageSize) ? PageConstant.DEFAULT_LIMIT_SIZE : pageSize;
|
||||
return familyMemberWeekExpDAO.pageByFamilyId(familyId, roles, pageNo * pageSize, pageSize);
|
||||
return familyMemberWeekExpDAO.pageByFamilyId(familyId, pageNo * pageSize, pageSize);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -5,21 +5,20 @@
|
||||
namespace="com.red.circle.other.infra.database.rds.dao.family.FamilyMemberWeekExpDAO">
|
||||
<select id="pageByFamilyId"
|
||||
resultType="com.red.circle.other.infra.database.rds.dto.family.FamilyMemberExpDTO">
|
||||
SELECT fm.id AS id,
|
||||
fm.sys_origin AS sysOrigin,
|
||||
fm.family_id AS family_id,
|
||||
fm.member_user_id AS memberUserId,
|
||||
fm.member_role AS memberRole,
|
||||
fmwe.exp AS exp
|
||||
SELECT
|
||||
fm.id AS id,
|
||||
fm.sys_origin AS sysOrigin,
|
||||
fm.family_id AS family_id,
|
||||
fm.member_user_id AS memberUserId,
|
||||
fm.member_role AS memberRole
|
||||
FROM `family_member` fm
|
||||
LEFT JOIN family_member_week_exp fmwe ON fm.`member_user_id`= fmwe.`family_member_id`
|
||||
AND fm.`family_id`= fmwe.`family_id`
|
||||
WHERE fm.`family_id` = #{familyId}
|
||||
AND fm.member_role IN
|
||||
<foreach collection="roles" item="item" open="(" separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
ORDER BY fmwe.exp DESC
|
||||
ORDER BY
|
||||
CASE fm.member_role
|
||||
WHEN 'ADMIN' THEN 1
|
||||
WHEN 'MANAGE' THEN 2
|
||||
WHEN 'MEMBER' THEN 3
|
||||
END
|
||||
LIMIT #{start}, #{end}
|
||||
</select>
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user