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