活跃用户统计修改;资源库首页来源统计(统计上架数据)
This commit is contained in:
parent
d5d4fa4805
commit
879133b8c7
|
@ -0,0 +1,36 @@
|
|||
package com.microservices.dms.behaviorImage.domain;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
public class ActivityUserTotal {
|
||||
//活跃用户
|
||||
private Long totalUser;
|
||||
//活跃用户专家数
|
||||
private Long totalExpert;
|
||||
//活跃用户实名认证
|
||||
private Long authTotal;
|
||||
|
||||
public Long getTotalUser() {
|
||||
return totalUser;
|
||||
}
|
||||
|
||||
public void setTotalUser(Long totalUser) {
|
||||
this.totalUser = totalUser;
|
||||
}
|
||||
|
||||
public Long getTotalExpert() {
|
||||
return totalExpert;
|
||||
}
|
||||
|
||||
public void setTotalExpert(Long totalExpert) {
|
||||
this.totalExpert = totalExpert;
|
||||
}
|
||||
|
||||
public Long getAuthTotal() {
|
||||
return authTotal;
|
||||
}
|
||||
|
||||
public void setAuthTotal(Long authTotal) {
|
||||
this.authTotal = authTotal;
|
||||
}
|
||||
}
|
|
@ -2,10 +2,7 @@ package com.microservices.dms.behaviorImage.mapper;
|
|||
|
||||
import com.microservices.common.datasource.annotation.Slave;
|
||||
import com.microservices.dms.achievementLibrary.domain.KeyValueVo;
|
||||
import com.microservices.dms.behaviorImage.domain.AchievementBehaviorSumVo;
|
||||
import com.microservices.dms.behaviorImage.domain.ActivityUserLibrary;
|
||||
import com.microservices.dms.behaviorImage.domain.BehaviorImageWeight;
|
||||
import com.microservices.dms.behaviorImage.domain.UserTypeTotalVo;
|
||||
import com.microservices.dms.behaviorImage.domain.*;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
|
@ -98,7 +95,7 @@ public interface BehaviorImageMapper {
|
|||
|
||||
List<UserTypeTotalVo> getUserTypeStatistic(@Param("userId")Long userId);
|
||||
|
||||
List<KeyValueVo> getActivityStatistic();
|
||||
ActivityUserTotal getActivityStatistic();
|
||||
|
||||
List<ActivityUserLibrary> selectActivityUserLibraryListAll(ActivityUserLibrary activityUserLibrary);
|
||||
|
||||
|
|
|
@ -75,7 +75,7 @@ public interface IBehaviorImageService {
|
|||
|
||||
UserExpertTotalVo getUserExpertStatistic(Long userId);
|
||||
|
||||
List<KeyValueVo> getActivityStatistic();
|
||||
ActivityUserTotal getActivityStatistic();
|
||||
|
||||
UserTypeTotalVo getUserBehaviorSum(Long userId);
|
||||
}
|
||||
|
|
|
@ -309,7 +309,7 @@ public class BehaviorImageServiceImpl implements IBehaviorImageService {
|
|||
}
|
||||
|
||||
@Override
|
||||
public List<KeyValueVo> getActivityStatistic() {
|
||||
public ActivityUserTotal getActivityStatistic() {
|
||||
return behaviorImageMapper.getActivityStatistic();
|
||||
}
|
||||
|
||||
|
|
|
@ -230,6 +230,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<select id="getTjBySources" resultType="com.microservices.dms.achievementLibrary.domain.KeyValueVo">
|
||||
select sum(1) as "value",source as "key"
|
||||
from achievements
|
||||
where status='1'
|
||||
group by source
|
||||
</select>
|
||||
|
||||
|
|
|
@ -140,7 +140,7 @@
|
|||
</select>
|
||||
|
||||
<select id="selectActivityUserLibraryListAll" resultType="com.microservices.dms.behaviorImage.domain.ActivityUserLibrary">
|
||||
select res.userId,res.loginName,res.userName,res.isExpert,res.isAuth,res.relatedCompetition,res.p1+res.p2+res.p3 as "relatedProject" from (
|
||||
select res.userId,res.loginName,res.userName,res.isExpert,res.isAuth,res.relatedCompetition,res.relatedTask,res.p1+res.p2+res.p3 as "relatedProject" from (
|
||||
select u.id as "userId",u.login as "loginName",u.nickname as "userName",u.is_expert as "isExpert",u.authentication as "isAuth",
|
||||
(select count(1) as "value" from tasks where is_delete='0' and status between 3 and 8 and user_id =u.id) as "relatedTask",
|
||||
(select count(1) from competition_infos ci inner join competition_users cu on ci.id = cu.competition_info_id where cu.user_id =u.id) as "relatedCompetition",
|
||||
|
@ -306,14 +306,24 @@
|
|||
)t group by t.resultType
|
||||
</select>
|
||||
|
||||
<select id="getActivityStatistic" resultType="com.microservices.dms.achievementLibrary.domain.KeyValueVo">
|
||||
select 'totalUser' as `key`, count(1) as " value" from users
|
||||
union all
|
||||
select'authTotal' as `key`,sum(u.authentication) as "value" from users u
|
||||
union all
|
||||
select 'totalexpert' as `key`, count(1) as " value"from users u
|
||||
inner join experts e on u.id = e.user_id
|
||||
where e.is_delete='0' and e.status = 1
|
||||
<select id="getActivityStatistic" resultType="com.microservices.dms.behaviorImage.domain.ActivityUserTotal">
|
||||
select count(1) as "totalUser",sum(r.isExpert) as "totalExpert",sum(r.enterprise_certification+r.authentication) as "authTotal" from (
|
||||
select res.userId,res.loginName,res.userName,res.isExpert,res.authentication,res.enterprise_certification,res.relatedCompetition,res.relatedTask,res.p1+res.p2+res.p3 as "relatedProject" from (
|
||||
select u.id as "userId",u.login as "loginName",u.nickname as "userName",u.is_expert as "isExpert",u.authentication,u.enterprise_certification,
|
||||
(select count(1) as "value" from tasks where is_delete='0' and status between 3 and 8 and user_id =u.id) as "relatedTask",
|
||||
(select count(1) from competition_infos ci inner join competition_users cu on ci.id = cu.competition_info_id where cu.user_id =u.id) as "relatedCompetition",
|
||||
(SELECT count(1) as "pCount" FROM `projects` WHERE id != 0 AND user_id =u.id) as p1,
|
||||
( SELECT count(1) as "pCount"
|
||||
FROM `projects` INNER JOIN `members` ON `members`.`project_id` = `projects`.`id`
|
||||
WHERE `projects`.`id` != 0 AND `projects`.`user_id` !=u.id AND `members`.`user_id` =u.id) as p2,
|
||||
(SELECT count(1) as "pCount"
|
||||
FROM `projects`
|
||||
INNER JOIN `team_projects` ON `team_projects`.`project_id` = `projects`.`id`
|
||||
INNER JOIN `teams` ON `teams`.`id` = `team_projects`.`team_id`
|
||||
INNER JOIN `team_users` ON `team_users`.`team_id` = `teams`.`id`
|
||||
WHERE `projects`.`id` != 0 AND `team_users`.`user_id` =u.id) as p3
|
||||
from users u) res
|
||||
where res.relatedCompetition >0 or res.relatedTask >0 or res.p1+res.p2+res.p3>0 )r
|
||||
</select>
|
||||
|
||||
<select id="getUserBehaviorSum" resultType="com.microservices.dms.behaviorImage.domain.UserTypeTotalVo">
|
||||
|
|
Loading…
Reference in New Issue