管理员系统 优化 按用户名或用户邮箱 查询用户design频率
This commit is contained in:
@@ -52,7 +52,7 @@ public class ConvenientInquiryController {
|
||||
@ApiOperation("获取指定时间区间内所有用户design的使用情况")
|
||||
@GetMapping("/getDesignStatistic")
|
||||
public Response<List<UserDesignStatisticDTO>> getDesignStatistic(@RequestParam String startTime, @RequestParam String endTime,
|
||||
@RequestParam(required = false) String userName, @RequestParam(required = false) String email) {
|
||||
@RequestParam(required = false) List<Long> ids, @RequestParam(required = false) String email) {
|
||||
Long accountId = UserContext.getUserHolder().getId();
|
||||
if (accountId.equals(31L) || accountId.equals(87L) || accountId.equals(83L) || accountId.equals(6L) || accountId.equals(4L) || accountId.equals(73L)) {
|
||||
if (StringUtil.isNullOrEmpty(startTime)) startTime = "2024-02-01 00:00:00";
|
||||
@@ -61,7 +61,10 @@ public class ConvenientInquiryController {
|
||||
Date date = new Date();
|
||||
endTime = simpleDateFormat.format(date);
|
||||
}
|
||||
List<UserDesignStatisticDTO> designStatistic = designMapper.getDesignStatistic(startTime, endTime, userName, email);
|
||||
if (!StringUtil.isNullOrEmpty(email)){
|
||||
email = email.trim();
|
||||
}
|
||||
List<UserDesignStatisticDTO> designStatistic = designMapper.getDesignStatistic(startTime, endTime, ids, email);
|
||||
return Response.success(designStatistic);
|
||||
} else {
|
||||
return Response.fail("Sorry, you don't have permission");
|
||||
|
||||
@@ -18,5 +18,5 @@ public interface DesignMapper extends CommonMapper<Design> {
|
||||
//返回插入数据后生成的主键
|
||||
Long insertDesign(Design design);
|
||||
|
||||
List<UserDesignStatisticDTO> getDesignStatistic(String startTime, String endTime, String userName, String email);
|
||||
List<UserDesignStatisticDTO> getDesignStatistic(String startTime, String endTime, List<Long> ids, String email);
|
||||
}
|
||||
|
||||
@@ -39,11 +39,14 @@
|
||||
</where>
|
||||
and b.create_date not like '%:01'
|
||||
and b.create_date not like '%:02'
|
||||
<if test="userName != null and userName != '' ">
|
||||
and a.user_name = #{userName}
|
||||
<if test="ids != null and ids.size() > 0">
|
||||
and a.id in
|
||||
<foreach item="id" collection="ids" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="email != null and email != '' ">
|
||||
and a.user_email = #{email}
|
||||
and a.user_email like CONCAT('%', #{email}, '%')
|
||||
</if>
|
||||
GROUP BY b.account_id
|
||||
ORDER BY b.account_id asc) d
|
||||
|
||||
Reference in New Issue
Block a user