Commit ec599564 by “Kongxiangkun”

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

parent 4b4f0357
...@@ -28,14 +28,14 @@ public interface EventTrackMapper extends BaseMapper<EventTrack> { ...@@ -28,14 +28,14 @@ public interface EventTrackMapper extends BaseMapper<EventTrack> {
DayNumVo getTgNumByType(@Param("date") String date,@Param("dateString") String dateString,@Param("siteId") Long siteId); 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, 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, 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); @Param("isPre") Boolean isPre);
List<EventTrackTypeNumVo> queryTgNumByDept(@Param("deptName") String deptName,@Param("typeId")Long typeId,@Param("siteId") Long siteId); 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); 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 ...@@ -439,7 +439,7 @@ public class EventTrackServiceImpl extends ServiceImpl<EventTrackMapper, EventTr
if(types.size() == 1){ if(types.size() == 1){
eventTrackTypeNumVoList = this.baseMapper.queryNumByTypeInformation(null,date,dateString,types,subIdList,context.getSiteId(), isPre); eventTrackTypeNumVoList = this.baseMapper.queryNumByTypeInformation(null,date,dateString,types,subIdList,context.getSiteId(), isPre);
} else { } 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)); logger.info("埋点统计行为统计查询结果:{}", JSONUtil.toJsonStr(eventTrackTypeNumVoList));
if(CollectionUtil.isNotEmpty(subNameList)){ if(CollectionUtil.isNotEmpty(subNameList)){
...@@ -508,7 +508,7 @@ public class EventTrackServiceImpl extends ServiceImpl<EventTrackMapper, EventTr ...@@ -508,7 +508,7 @@ public class EventTrackServiceImpl extends ServiceImpl<EventTrackMapper, EventTr
if(CollUtil.isNotEmpty(eventTrackDeptNumVoList)){ if(CollUtil.isNotEmpty(eventTrackDeptNumVoList)){
String finalDate = date; String finalDate = date;
eventTrackDeptNumVoList.stream().forEach(eventTrackDeptNumVo -> { 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)){ if(CollectionUtil.isNotEmpty(eventTrackTypeNumVoList)){
List<EventTrackTypeNumVo> voList = Lists.newArrayList(); List<EventTrackTypeNumVo> voList = Lists.newArrayList();
eventTrackTypeNumVoList.stream().forEach(numVo->{ eventTrackTypeNumVoList.stream().forEach(numVo->{
......
...@@ -60,37 +60,25 @@ ...@@ -60,37 +60,25 @@
<if test="deptId!=null"> <if test="deptId!=null">
and e.dept_id = #{deptId} and e.dept_id = #{deptId}
</if> </if>
<if test="remark2!=null">
and e.remark2 = #{remark2}
</if>
group by e.type,e.sub_type group by e.type,e.sub_type
order by e.type order by e.type
</select> </select>
<select id="queryDeptByType" resultType="com.yizhi.site.application.vo.site.EventTrackDeptNumVo"> <select id="queryDeptByType" resultType="com.yizhi.site.application.vo.site.EventTrackTypeNumVo">
select 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 where e.deleted =0
and e.dept_id in (SELECT id FROM cloud_system.authz_user_group where site_id = #{siteId}) and e.dept_id in (SELECT id FROM cloud_system.authz_user_group where site_id = #{siteId})
<if test="date==4"> AND (e.type IN (3,14) or ( e.type in (13) and e.remark2 = 1))
and WEEK(e.create_time) = WEEK(now()) and DATE_FORMAT(e.create_time, '%Y') = DATE_FORMAT(now(), '%Y') <if test="deptId!=null">
</if> and e.dept_id = #{deptId}
<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>
</if> </if>
group by e.dept_name group by e.type,e.sub_type
order by e.type
</select> </select>
<select id="getNumByType" resultType="com.yizhi.site.application.vo.site.DayNumVo"> <select id="getNumByType" resultType="com.yizhi.site.application.vo.site.DayNumVo">
select ifnull(sum(num),0) as num,ifnull(sum(preNum),0) as preNum select ifnull(sum(num),0) as num,ifnull(sum(preNum),0) as preNum
from( from(
...@@ -365,10 +353,10 @@ ...@@ -365,10 +353,10 @@
</select> </select>
<select id="queryTrainningNumBydeptId" resultType="com.yizhi.site.application.vo.site.EventTrackTypeNumVo"> <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 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 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 GROUP BY agm.group_id
</select> </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