Commit 2d76a7f8 by 梅存智

更新

parent 4e140d36
...@@ -47,4 +47,6 @@ public interface EventTrackMapper extends BaseMapper<EventTrack> { ...@@ -47,4 +47,6 @@ public interface EventTrackMapper extends BaseMapper<EventTrack> {
Integer getResearchJoinTotal(@Param("year")String year,@Param("siteId") Long siteId); Integer getResearchJoinTotal(@Param("year")String year,@Param("siteId") Long siteId);
Integer getCommentNum(@Param("businessId")Long businessId,@Param("siteId") Long siteId); Integer getCommentNum(@Param("businessId")Long businessId,@Param("siteId") Long siteId);
DayNumVo getMailTgNumByType(@Param("date") String date,@Param("dateString") String dateString,@Param("siteId") Long siteId);
} }
...@@ -165,7 +165,8 @@ public class EventTrackServiceImpl extends ServiceImpl<EventTrackMapper, EventTr ...@@ -165,7 +165,8 @@ public class EventTrackServiceImpl extends ServiceImpl<EventTrackMapper, EventTr
} }
String dateString =getDateString(date); String dateString =getDateString(date);
if(Objects.equals(types.get(0),5)){ if(Objects.equals(types.get(0),5)){
return this.baseMapper.getTgNumByType(date,dateString,context.getSiteId()); //return this.baseMapper.getTgNumByType(date,dateString,context.getSiteId()); //20250810按新需求注释,现统计党委和纪检信箱
return this.baseMapper.getMailTgNumByType(date,dateString,context.getSiteId());
} }
if(Objects.equals(types.get(0),8)){ if(Objects.equals(types.get(0),8)){
String year = DateUtil.toShortYear(new Date()); String year = DateUtil.toShortYear(new Date());
......
...@@ -19,21 +19,23 @@ ...@@ -19,21 +19,23 @@
<select id="queryNumByType" resultType="com.yizhi.site.application.vo.site.EventTrackTypeNumVo"> <select id="queryNumByType" resultType="com.yizhi.site.application.vo.site.EventTrackTypeNumVo">
select select
e.type,e.sub_type as subType,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
<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>
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 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"> <if test="types!=null and types.size()>0">
AND e.type IN AND e.type IN
<foreach collection="types" item="item" open="(" separator="," close=")"> <foreach collection="types" item="item" open="(" separator="," close=")">
...@@ -263,4 +265,41 @@ ...@@ -263,4 +265,41 @@
and site_id = #{siteId} and site_id = #{siteId}
) a ) a
</select> </select>
<select id="getMailTgNumByType" resultType="com.yizhi.site.application.vo.site.DayNumVo">
select ifnull(sum(num),0) as num,ifnull(sum(preNum),0) as preNum
from(
select
case when
<if test="date==4">
WEEK(e.create_time) = WEEK(now()) and DATE_FORMAT(e.create_time, '%Y') = DATE_FORMAT(now(), '%Y')
</if>
<if test="date==3">
DATE_FORMAT(e.create_time, '%Y-%m-%d') = #{dateString}
</if>
<if test="date==2">
DATE_FORMAT(e.create_time, '%Y-%m') = #{dateString}
</if>
<if test="date==1">
DATE_FORMAT(e.create_time, '%Y') = #{dateString}
</if>
then 1 else 0 end as num,
case when
<if test="date==4">
WEEK(e.create_time) = WEEK(DATE_SUB(DATE_FORMAT(now(), '%Y-%m-%d'), INTERVAL 7 DAY)) and DATE_FORMAT(e.create_time, '%Y') = #{dateString}
</if>
<if test="date==3">
DATE_SUB(DATE_FORMAT(e.create_time, '%Y-%m-%d'), INTERVAL -1 DAY) = #{dateString}
</if>
<if test="date==2">
DATE_FORMAT(DATE_SUB(DATE_FORMAT(e.create_time, '%Y-%m-%d'), INTERVAL 1 MONTH),'%Y-%m') = #{dateString}
</if>
<if test="date==1">
DATE_FORMAT(DATE_SUB(DATE_FORMAT(e.create_time, '%Y-%m-%d'), INTERVAL 1 YEAR),'%Y') = #{dateString}
</if>
then 1 else
0 end as preNum from system_mailbox e
where e.site_id = #{siteId} and e.state=4 and e.deleted=0
) a
</select>
</mapper> </mapper>
\ No newline at end of file
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