Commit cad9dee4 authored by jiawei's avatar jiawei

/tBoardStatistic/getInteractionFrequencyPageList 获取互动频次统计信息

修改以上接口  加上区域条件
parent 1988c6e7
...@@ -69,5 +69,8 @@ public interface TBoardStatisticMapper extends BaseMapper<TBoardStatistic> { ...@@ -69,5 +69,8 @@ public interface TBoardStatisticMapper extends BaseMapper<TBoardStatistic> {
List<Map> getInteractionFrequency(Page page, @Param("frequencyDate") String frequencyDate, @Param("orgCode") String orgCode); List<Map> getInteractionFrequency(Page page, @Param("frequencyDate") String frequencyDate, @Param("orgCode") String orgCode);
List<Map> getInteractionFrequency1(@Param("page") Page page, @Param("frequencyDate") String frequencyDate, @Param("orgCode") String orgCode, @Param("areaIds") List<String> areaIds);
List<TBoardPlayTrend> getBoardPageList(Page<TBoardPlayTrend> page, TBoardPlayTrend trend); List<TBoardPlayTrend> getBoardPageList(Page<TBoardPlayTrend> page, TBoardPlayTrend trend);
} }
...@@ -4,7 +4,6 @@ import cn.chnmuseum.party.model.*; ...@@ -4,7 +4,6 @@ import cn.chnmuseum.party.model.*;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import org.bytedeco.opencv.presets.opencv_core;
import java.util.List; import java.util.List;
...@@ -72,6 +71,17 @@ public interface TBoardStatisticService extends IService<TBoardStatistic> { ...@@ -72,6 +71,17 @@ public interface TBoardStatisticService extends IService<TBoardStatistic> {
*/ */
Page getInteractionFrequency(Page page, String frequencyDate,String orgCode); Page getInteractionFrequency(Page page, String frequencyDate,String orgCode);
/**
* 复制的方法,用于加上区域
*
* @param page
* @param frequencyDate
* @param orgCode
* @param areaIds
* @return
*/
Page getInteractionFrequency(Page page, String frequencyDate, String orgCode, List<String> areaIds);
List getBoardProvincePlayTotalList(String organId,String orgCode); List getBoardProvincePlayTotalList(String organId,String orgCode);
Page<TBoardPlayTrend> getBoardPageList(Page<TBoardPlayTrend> page, TBoardPlayTrend trend); Page<TBoardPlayTrend> getBoardPageList(Page<TBoardPlayTrend> page, TBoardPlayTrend trend);
......
...@@ -139,6 +139,13 @@ public class TBoardStatisticServiceImpl extends ServiceImpl<TBoardStatisticMappe ...@@ -139,6 +139,13 @@ public class TBoardStatisticServiceImpl extends ServiceImpl<TBoardStatisticMappe
return page; return page;
} }
@Override
public Page getInteractionFrequency(Page page, String frequencyDate, String orgCode, List<String> areaIds) {
page.setRecords(boardStatisticMapper.getInteractionFrequency1(page, frequencyDate, orgCode,areaIds));
return page;
}
@Override @Override
public List getBoardProvincePlayTotalList(String organId, String orgCode) { public List getBoardProvincePlayTotalList(String organId, String orgCode) {
// 获取省份信息 // 获取省份信息
......
...@@ -310,7 +310,7 @@ public class TBoardStatisticController extends BaseController { ...@@ -310,7 +310,7 @@ public class TBoardStatisticController extends BaseController {
@PostMapping("/getInteractionFrequencyPageList") @PostMapping("/getInteractionFrequencyPageList")
// @RequiresAuthentication //@RequiresPermissions("t:board:statistic:districtPage") // @RequiresAuthentication //@RequiresPermissions("t:board:statistic:districtPage")
@ApiOperation(value = "获取互动频次统计信息", notes = "获取互动频次统计信息") @ApiOperation(value = "获取互动频次统计信息", notes = "获取互动频次统计信息")
public Map<String, Object> getInteractionFrequencyPageList(String frequencyDate) { public Map<String, Object> getInteractionFrequencyPageList(String frequencyDate,String areaCode) {
String orgCode = null; String orgCode = null;
try { try {
TUser user = getcurUser(); TUser user = getcurUser();
...@@ -323,8 +323,10 @@ public class TBoardStatisticController extends BaseController { ...@@ -323,8 +323,10 @@ public class TBoardStatisticController extends BaseController {
if (StringUtils.isEmpty(frequencyDate)) { if (StringUtils.isEmpty(frequencyDate)) {
frequencyDate = DateUtil.getCurrentDate("yyyyMM"); frequencyDate = DateUtil.getCurrentDate("yyyyMM");
} }
//加上区域条件
List<String> areaIds = findAllAreaIdByParentCode(areaCode);
Page page = this.tBoardStatisticService.getInteractionFrequency(getPage(), frequencyDate, orgCode); Page page = this.tBoardStatisticService.getInteractionFrequency(getPage(), frequencyDate, orgCode,areaIds);
// //
Map map = new HashMap(); Map map = new HashMap();
List organList = new ArrayList<>(); List organList = new ArrayList<>();
......
...@@ -311,4 +311,65 @@ ...@@ -311,4 +311,65 @@
</select> </select>
<select id="getInteractionFrequency1" resultType="java.util.Map">
<if test="frequencyDate != null and frequencyDate.length() == 4">
SELECT o.name organName,count(i.organ_id) frequencyCnt
from t_interaction i
left join t_organ o on i.organ_id = o.id
<where>
DATE_FORMAT(i.create_time,'%Y') = ${frequencyDate}
<if test="orgCode != null">
and o.code LIKE concat(#{orgCode}, '%')
</if>
<if test="areaIds !=null and areaIds.size() > 0">
AND o.area_id IN
<foreach collection="areaIds" separator="," open="(" close=")" item="item">
#{item}
</foreach>
</if>
</where>
group by i.organ_id
order by count(i.organ_id) desc
</if>
<if test="frequencyDate != null and frequencyDate.length() == 6">
SELECT o.name organName,count(i.organ_id) frequencyCnt
from t_interaction i
left join t_organ o on i.organ_id = o.id
<where>
DATE_FORMAT(i.create_time,'%Y%m') = ${frequencyDate}
<if test="orgCode != null">
and o.code LIKE concat(#{orgCode}, '%')
</if>
<if test="areaIds !=null and areaIds.size() > 0">
AND o.area_id IN
<foreach collection="areaIds" separator="," open="(" close=")" item="item">
#{item}
</foreach>
</if>
</where>
group by i.organ_id
order by count(i.organ_id) desc
</if>
<if test="frequencyDate != null and frequencyDate.length() == 8">
SELECT o.name organName,count(i.organ_id) frequencyCnt
from t_interaction i
left join t_organ o on i.organ_id = o.id
<where>
DATE_FORMAT(i.create_time,'%Y%m%d') = ${frequencyDate}
<if test="orgCode != null">
and o.code LIKE concat(#{orgCode}, '%')
</if>
<if test="areaIds !=null and areaIds.size() > 0">
AND o.area_id IN
<foreach collection="areaIds" separator="," open="(" close=")" item="item">
#{item}
</foreach>
</if>
</where>
group by i.organ_id
order by count(i.organ_id) desc
</if>
</select>
</mapper> </mapper>
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