select b.expertTotal as"专家总数", d.expertAuth as"已实名专家总数"from (
(selectcount(1) as"expertTotal"from experts where is_delete ='0'and status =1) b,
(selectcount(1) as"expertAuth"from experts e
innerjoin users u on e.user_id = u.id
where e.is_delete ='0'and e.status =1and u.authentication =true) d
);
专家职称等级分布
统计专家不同职称等级分类占比;
select title_rank as"职级", count(1) as"数量"from experts
where is_delete ='0'and status =1groupby title_rank;
专家专业类别
统计专家不同专业类别的数量及占比;
select expert_type as"专业类别",count(1) as"数量"from experts
where is_delete ='0'and status =1groupby expert_type;
专家单位类别分布
统计专家不同单位类别的数量及占比;
select workplace_type as"单位类别",count(1) as"数量"from experts
where is_delete ='0'and status =1groupby workplace_type;
专家学历分布
统计专家不同学历的数量及占比;
select highest_degree as"学历",count(1) as"数量"from experts
where is_delete ='0'and status =1groupby highest_degree;
专家评审作品数
select tmp.expert_name as"专家姓名",
tmp.taskAuditCount as"创客任务评审数",
tmp.competitionAuditCount as"竞赛评审数",
(tmp.taskAuditCount + tmp.competitionAuditCount) as"创客+竞赛评审总数"from (select e.expert_name,
(selectCOUNT(distinct container_id) from task_expert where expert_id = e.id and container_type =1and status in (1,2)) as taskAuditCount,
(selectCOUNT(distinct container_id) from task_expert where expert_id = e.id and container_type =2and status in (1,2)) as competitionAuditCount
from experts e
leftjoin users u on e.user_id = u.id
where e.is_delete ='0'and e.status =1) tmp
orderby (tmp.taskAuditCount + tmp.competitionAuditCount) desclimit0,12;
年度专家数据统计
select DATE_FORMAT(created_on, '%Y') as'name', count(*) as'value'from experts
where is_delete ='0'and status =1groupby DATE_FORMAT(created_on, '%Y')
orderby DATE_FORMAT(created_on, '%Y');
热门专家领域
select a.domain_value as"name", count(a.domain_value) as"value"from (select review_area_one as domain_value
from experts
where is_delete ='0'and status =1and review_area_one isnotnulland review_area_one !=''unionallselect review_area_two as domain_value
from experts
where is_delete ='0'and status =1and review_area_two isnotnulland review_area_two !=''unionallselect review_area_three as domain_value
from experts
where is_delete ='0'and status =1and review_area_three isnotnulland review_area_three !='') a
groupby a.domain_value
orderbycount(a.domain_value) desclimit0,9;