TASK:优化查询子账号design试用频次,根据管理员身份限定查询范围
This commit is contained in:
@@ -32,8 +32,10 @@ public interface AccountMapper extends CommonMapper<Account> {
|
||||
|
||||
void toVisitor(Long id);
|
||||
|
||||
List<AccountCreditsUsageDTO> selectCreditUsage(boolean groupByEvent, String changeEvent, String role, String userEmail, Long id, String startTime, String endTime, Integer size, Integer offset);
|
||||
List<AccountCreditsUsageDTO> selectCreditUsage(boolean groupByEvent, String changeEvent, String role,
|
||||
String userEmail, Long id, String startTime, String endTime,
|
||||
Integer size, Integer offset, String organizationName);
|
||||
|
||||
int countCreditUsage(boolean groupByEvent, String changeEvent, String role, String userEmail, Long id, String startTime, String endTime);
|
||||
int countCreditUsage(boolean groupByEvent, String changeEvent, String role, String userEmail, Long id, String startTime, String endTime, String organizationName);
|
||||
|
||||
}
|
||||
|
||||
@@ -883,11 +883,11 @@ public class ConvenientInquiryServiceImpl extends ServiceImpl<QuestionnaireMappe
|
||||
int offset = (queryDTO.getPage() - 1) * size;
|
||||
List<AccountCreditsUsageDTO> creditsUsageDTOS = accountMapper.selectCreditUsage(
|
||||
groupByEvent, queryDTO.getChangeEvent(), role, queryDTO.getUserEmail(), queryDTO.getId(),
|
||||
queryDTO.getStartTime(), queryDTO.getEndTime(), size, offset);
|
||||
queryDTO.getStartTime(), queryDTO.getEndTime(), size, offset, account.getOrganizationName());
|
||||
if (!creditsUsageDTOS.isEmpty()){
|
||||
int total = accountMapper.countCreditUsage(
|
||||
groupByEvent, queryDTO.getChangeEvent(), role, queryDTO.getUserEmail(), queryDTO.getId(),
|
||||
queryDTO.getStartTime(), queryDTO.getEndTime());
|
||||
queryDTO.getStartTime(), queryDTO.getEndTime(), account.getOrganizationName());
|
||||
// 总页数
|
||||
double totalPage = Math.ceil((double) total / size);
|
||||
// 组装返回参数
|
||||
|
||||
@@ -84,6 +84,9 @@
|
||||
a.system_user IN (0, 1, 2, 3, 4)
|
||||
</when>
|
||||
</choose>
|
||||
<if test="organizationName != null and organizationName != ''">
|
||||
AND a.organization_name = #{organizationName}
|
||||
</if>
|
||||
<if test="id != null">
|
||||
AND a.id = #{id}
|
||||
</if>
|
||||
@@ -126,6 +129,9 @@
|
||||
a.system_user IN (0, 1, 2, 3, 4)
|
||||
</when>
|
||||
</choose>
|
||||
<if test="organizationName != null and organizationName != ''">
|
||||
AND a.organization_name = #{organizationName}
|
||||
</if>
|
||||
<if test="userEmail != null and userEmail != ''">
|
||||
AND a.user_email = #{userEmail}
|
||||
</if>
|
||||
|
||||
Reference in New Issue
Block a user