dev
masong 2 years ago
parent 1c13c68e58
commit c398709a49
  1. 20
      cjy-project/src/main/resources/mapper/marketingdata/MarketingWechatMicroblogInfoMapper.xml

@ -214,16 +214,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
order by t1.statistics_time asc
</select>
<select id="operationStatisticsByCode" resultType="com.cjy.marketingdata.domain.vo.OperationStatisticsVO">
SELECT SUM(IFNULL(t1.fans_number,0)) as fansNumber,IFNULL(SUM(t1.content_published_number),1) as contentPublishedNumber,
ROUND(SUM(IFNULL(t1.read_number,0))/IFNULL(SUM(t1.content_published_number),1),0) as avgReadNumber,
ROUND(SUM(IFNULL(t1.transpond_number,0))/IFNULL(SUM(t1.content_published_number),1),0) as avgTranspondNumber
SELECT IFNULL(t1.fans_number,0) as fansNumber,IFNULL(t1.content_published_number,1) as contentPublishedNumber,
ROUND(IFNULL(t1.read_number,0)/IFNULL(t1.content_published_number,1),0) as avgReadNumber,
ROUND(IFNULL(t1.transpond_number,0)/IFNULL(t1.content_published_number,1),0) as avgTranspondNumber
FROM md_marketing_wechat_microblog_info t1
LEFT JOIN md_marketing_media_config t2 ON t1.media_id =t2.id
WHERE t1.statistics_time >= DATE_ADD(CURRENT_DATE,INTERVAL -#{days} DAY)
<if test="type != null and type != ''"> AND t1.type = #{type} </if>
<if test="resourceCode != null and resourceCode != ''"> and t2.resource_code = #{resourceCode} </if>
AND t1.organ_code = #{organCode}
GROUP BY t1.statistics_time
<if test="type != null and type != ''"> AND t1.type = #{type} </if>
<if test="resourceCode != null and resourceCode != ''"> and t2.resource_code = #{resourceCode} </if>
AND t1.organ_code = #{organCode}
order by statistics_time desc limit 1
</select>
<select id="readStatisticsByCode" resultType="com.cjy.marketingdata.domain.MarketingWechatMicroblogInfo">
SELECT DATE_FORMAT(t1.statistics_time,'%Y-%m-%d') as time,
@ -264,9 +264,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
order by t1.statistics_time asc
</select>
<select id="selectWXOrDYFans" resultType="java.util.Map">
select statistics_time,ifnull(sum(fans_number),0) as fansNum ,ifnull(sum(new_attention_number),0) as addFansNum,ifnull(sum(cancel_attention_number),0) as cancelFansNum,ifnull(sum(transpond_number),0) as shareNum, ifnull(sum(likes_number),0) as likesNum,ifnull(sum(evaluation_number),0) as evaluationNum
from md_marketing_wechat_microblog_info where type = #{type}
group by statistics_time order by statistics_time desc limit 1
select statistics_time,ifnull(fans_number,0) as fansNum ,ifnull(new_attention_number,0) as addFansNum,ifnull(cancel_attention_number,0) as cancelFansNum,ifnull(transpond_number,0) as shareNum, ifnull(likes_number,0) as likesNum,ifnull(evaluation_number,0) as evaluationNum
from md_marketing_wechat_microblog_info where type = #{type} order by statistics_time desc limit 1
</select>
<select id="selectWXOrDYFans7Day" resultType="java.util.Map">
select DATE_FORMAT(statistics_time, '%Y-%m-%d') as time ,ifnull(sum(fans_number),0) as fansNum from md_marketing_wechat_microblog_info where type = #{type}

Loading…
Cancel
Save