Commit ec599564 by “Kongxiangkun”

投票增加分页,工作台面板优化

parent 4b4f0357
......@@ -28,14 +28,14 @@ public interface EventTrackMapper extends BaseMapper<EventTrack> {
DayNumVo getTgNumByType(@Param("date") String date,@Param("dateString") String dateString,@Param("siteId") Long siteId);
List<EventTrackTypeNumVo> queryNumByType(@Param("deptId") Long deptId,@Param("date") String date,@Param("dateString") String dateString,@Param("types")List<Integer> types,@Param("subNameList")List<String> subNameList,@Param("siteId") Long siteId,
@Param("isPre") Boolean isPre, @Param("remark2") String remark2);
@Param("isPre") Boolean isPre);
List<EventTrackTypeNumVo> queryNumByTypeInformation(@Param("deptId") Long deptId,@Param("date") String date,@Param("dateString") String dateString,@Param("types")List<Integer> types,@Param("subNameList")List<Long> subNameList,@Param("siteId") Long siteId,
@Param("isPre") Boolean isPre);
List<EventTrackTypeNumVo> queryTgNumByDept(@Param("deptName") String deptName,@Param("typeId")Long typeId,@Param("siteId") Long siteId);
List<EventTrackDeptNumVo> queryDeptByType(@Param("date") String date,@Param("dateString") String dateString, @Param("types")List<Integer> types,@Param("siteId") Long siteId);
List<EventTrackTypeNumVo> queryDeptByType(@Param("deptId") Long deptId, @Param("dateString") String dateString, @Param("types")List<Integer> types,@Param("siteId") Long siteId);
Integer getNum(@Param("type")Integer type, @Param("businessId")Long businessId,@Param("siteId") Long siteId);
......
......@@ -439,7 +439,7 @@ public class EventTrackServiceImpl extends ServiceImpl<EventTrackMapper, EventTr
if(types.size() == 1){
eventTrackTypeNumVoList = this.baseMapper.queryNumByTypeInformation(null,date,dateString,types,subIdList,context.getSiteId(), isPre);
} else {
eventTrackTypeNumVoList = this.baseMapper.queryNumByType(null,date,dateString,types,subNameList,context.getSiteId(), isPre, null);
eventTrackTypeNumVoList = this.baseMapper.queryNumByType(null,date,dateString,types,subNameList,context.getSiteId(), isPre);
}
logger.info("埋点统计行为统计查询结果:{}", JSONUtil.toJsonStr(eventTrackTypeNumVoList));
if(CollectionUtil.isNotEmpty(subNameList)){
......@@ -508,7 +508,7 @@ public class EventTrackServiceImpl extends ServiceImpl<EventTrackMapper, EventTr
if(CollUtil.isNotEmpty(eventTrackDeptNumVoList)){
String finalDate = date;
eventTrackDeptNumVoList.stream().forEach(eventTrackDeptNumVo -> {
List<EventTrackTypeNumVo> eventTrackTypeNumVoList = this.baseMapper.queryNumByType(eventTrackDeptNumVo.getDeptId(),finalDate, dateString,types,null,context.getSiteId(), false, "1");
List<EventTrackTypeNumVo> eventTrackTypeNumVoList = this.baseMapper.queryDeptByType(eventTrackDeptNumVo.getDeptId(), dateString,types,context.getSiteId());
if(CollectionUtil.isNotEmpty(eventTrackTypeNumVoList)){
List<EventTrackTypeNumVo> voList = Lists.newArrayList();
eventTrackTypeNumVoList.stream().forEach(numVo->{
......
......@@ -60,37 +60,25 @@
<if test="deptId!=null">
and e.dept_id = #{deptId}
</if>
<if test="remark2!=null">
and e.remark2 = #{remark2}
</if>
group by e.type,e.sub_type
order by e.type
</select>
<select id="queryDeptByType" resultType="com.yizhi.site.application.vo.site.EventTrackDeptNumVo">
<select id="queryDeptByType" resultType="com.yizhi.site.application.vo.site.EventTrackTypeNumVo">
select
e.dept_id as deptId,e.dept_name as deptName,count(1) as num from event_track e
e.type,e.sub_type as subType,count(t.id) as num
from event_track e
LEFT JOIN event_track t ON e.id=t.id
and DATE_FORMAT(e.create_time, '%Y') = #{dateString}
where e.deleted =0
and e.dept_id in (SELECT id FROM cloud_system.authz_user_group where site_id = #{siteId})
<if test="date==4">
and WEEK(e.create_time) = WEEK(now()) and DATE_FORMAT(e.create_time, '%Y') = DATE_FORMAT(now(), '%Y')
</if>
<if test="date==3">
and DATE_FORMAT(e.create_time, '%Y-%m-%d') = #{dateString}
</if>
<if test="date==2">
and DATE_FORMAT(e.create_time, '%Y-%m') = #{dateString}
</if>
<if test="date==1">
and DATE_FORMAT(e.create_time, '%Y') = #{dateString}
</if>
<if test="types!=null and types.size()>0">
AND e.type IN
<foreach collection="types" item="item" open="(" separator="," close=")">
#{item}
</foreach>
AND (e.type IN (3,14) or ( e.type in (13) and e.remark2 = 1))
<if test="deptId!=null">
and e.dept_id = #{deptId}
</if>
group by e.dept_name
group by e.type,e.sub_type
order by e.type
</select>
<select id="getNumByType" resultType="com.yizhi.site.application.vo.site.DayNumVo">
select ifnull(sum(num),0) as num,ifnull(sum(preNum),0) as preNum
from(
......@@ -365,10 +353,10 @@
</select>
<select id="queryTrainningNumBydeptId" resultType="com.yizhi.site.application.vo.site.EventTrackTypeNumVo">
SELECT agm.group_id AS subType,count(DISTINCT tvr.create_by_id) AS num
SELECT agm.group_id AS subType,count(*) AS num
FROM cloud_trainning_project.training_project tvr
INNER JOIN cloud_system.authz_group_member agm ON agm.member_id=tvr.org_id AND agm.deleted = 0
WHERE tvr.status=1 AND tvr.deleted=0
WHERE tvr.deleted=0
GROUP BY agm.group_id
</select>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment