Browse Source

Merge branch 'dev_data_stats' of http://git.elinkit.com.cn:7070/r/epmet-cloud into dev_data_stats

 Conflicts:
	epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsDemoServiceImpl.java
	epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimAgencyServiceImpl.java
dev_shibei_match
wxz 5 years ago
parent
commit
02b4733554
  1. 5
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/ArticleGridPublishedSummaryDTO.java
  2. 6
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/constant/ProjectConstant.java
  3. 25
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/DimAgencyDao.java
  4. 10
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactArticlePublishedAgencyDailyDao.java
  5. 4
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/voice/ArticleDao.java
  6. 1
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsDemoServiceImpl.java
  7. 84
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsPublicityServiceImpl.java
  8. 10
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/DimAgencyService.java
  9. 13
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactArticlePublishedAgencyDailyService.java
  10. 13
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimAgencyServiceImpl.java
  11. 15
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactArticlePublishedAgencyDailyServiceImpl.java
  12. 16
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/voice/ArticleService.java
  13. 20
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/voice/impl/ArticleServiceImpl.java
  14. 12
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/DimAgencyDao.xml
  15. 3
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactArticlePublishedAgencyDailyDao.xml
  16. 8
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/voice/ArticleDao.xml

5
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/ArticleGridPublishedSummaryDTO.java

@ -23,7 +23,10 @@ public class ArticleGridPublishedSummaryDTO implements Serializable {
* 客户id
*/
private String customerId;
/**
* 上级机关id顶级为"0"
*/
private String pid;
/**
* 机关id
*/

6
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/constant/ProjectConstant.java

@ -33,14 +33,14 @@ public interface ProjectConstant {
/**
* 发布单位类型 机关:agency
*/
String PUBLISH_TYPE_AGENCY = "agency";
String PUBLISHER_TYPE_AGENCY = "agency";
/**
* 发布单位类型 部门department
*/
String PUBLISH_TYPE_DEPT = "department";
String PUBLISHER_TYPE_DEPT = "department";
/**
* 发布单位类型 网格grid
*/
String PUBLISH_TYPE_GRID = "grid";
String PUBLISHER_TYPE_GRID = "grid";
}

25
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/DimAgencyDao.java

@ -47,29 +47,36 @@ public interface DimAgencyDao extends BaseDao<DimAgencyEntity> {
List<DimAgencyDTO> selectDimAgencyList(DimAgencyDTO dto);
/**
* @Description 获取所有机关
* @param
* @return List<AgencySubTreeDto>
* @return List<AgencySubTreeDto>
* @Description 获取所有机关
* @author wangc
* @date 2020.06.18 09:26
**/
**/
List<AgencySubTreeDto> selectAllAgency();
/**
* @Description 根据PID获取下级机关
* @param pid
* @return List<AgencySubTreeDto>
* @return List<AgencySubTreeDto>
* @Description 根据PID获取下级机关
* @author wangc
* @date 2020.06.18 09:26
**/
List<AgencySubTreeDto> selectSubAgencyByPid(@Param("pid")String pid);
**/
List<AgencySubTreeDto> selectSubAgencyByPid(@Param("pid") String pid);
/**
* @Description 获取顶层级机关机关
* @param
* @return List<AgencySubTreeDto>
* @return List<AgencySubTreeDto>
* @Description 获取顶层级机关机关
* @author wangc
* @date 2020.06.18 09:26
**/
List<AgencySubTreeDto> selectTopAgency();
/**
* desc:根据客户id 获取机关列表
* @param customerId
* @return
*/
List<DimAgencyEntity> getAgencyListByCustomerId(@Param("customerId") String customerId);
}

10
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactArticlePublishedAgencyDailyDao.java

@ -20,6 +20,7 @@ package com.epmet.dao.stats;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.entity.stats.FactArticlePublishedAgencyDailyEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
/**
* 文章发布数量机关日统计表
@ -29,5 +30,12 @@ import org.apache.ibatis.annotations.Mapper;
*/
@Mapper
public interface FactArticlePublishedAgencyDailyDao extends BaseDao<FactArticlePublishedAgencyDailyEntity> {
/**
* desc:删除数据
*
* @param customerId
* @param dateId
* @return
*/
int deleteByDateId(@Param("customerId") String customerId, @Param("dateId") String dateId);
}

4
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/voice/ArticleDao.java

@ -40,8 +40,8 @@ public interface ArticleDao extends BaseDao<ArticleEntity> {
*
* @param customerId
* @param publishDate
* @param publishType
* @param publisherType
* @return
*/
List<ArticleGridPublishedSummaryDTO> getAllPublishedCount(@Param("customerId") String customerId, @Param("publishDate") Date publishDate, @Param("publishType") String publishType);
List<ArticleGridPublishedSummaryDTO> getAllPublishedCount(@Param("customerId") String customerId, @Param("publishDate") Date publishDate, @Param("publisherType") String publisherType);
}

1
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsDemoServiceImpl.java

@ -3,6 +3,7 @@ package com.epmet.service.impl;
import com.epmet.dto.AgencySubTreeDto;
import com.epmet.entity.issue.IssueEntity;
import com.epmet.entity.org.CustomerAgencyEntity;
import com.epmet.service.Issue.DemoIssueService;
import com.epmet.service.StatsDemoService;
import com.epmet.service.org.DemoGovOrgService;
import com.epmet.service.stats.DemoDataStatsService;

84
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsPublicityServiceImpl.java

@ -1,12 +1,10 @@
package com.epmet.service.impl;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.DateUtils;
import com.epmet.dto.stats.ArticleGridPublishedSummaryDTO;
import com.epmet.entity.stats.DimDepartmentEntity;
import com.epmet.entity.stats.DimGridEntity;
import com.epmet.entity.stats.FactArticlePublishedDepartmentDailyEntity;
import com.epmet.entity.stats.FactArticlePublishedGridDailyEntity;
import com.epmet.entity.stats.*;
import com.epmet.service.StatsPublicityService;
import com.epmet.service.stats.*;
import com.epmet.service.voice.ArticlePublishRangeService;
@ -60,14 +58,21 @@ public class StatsPublicityServiceImpl implements StatsPublicityService {
private FactArticlePublishedGridDailyService factArticlePublishedGridDailyService;
@Autowired
private FactArticlePublishedDepartmentDailyService factArticlePublishedDepartmentDailyService;
@Autowired
private FactArticlePublishedAgencyDailyService factArticlePublishedAgencyDailyService;
@Autowired
private ExecutorService executorService;
@Override
public Boolean publicitySummary(Date statsDate) {
//如果不传时间 则统计数据为今天之前的数据和,否则统计的是截止到传入的日期数据的和
if (statsDate == null) {
statsDate = DateUtils.addDateDays(new Date(), -1);
//当天的凌晨时间 即为今天之前的数据
statsDate = DateUtils.integrate(new Date(),DateUtils.DATE_PATTERN);
}else{
statsDate = DateUtils.integrate(DateUtils.addDateDays(statsDate,1),DateUtils.DATE_PATTERN);
}
DimIdGenerator.DimIdBean dimIdBean = DimIdGenerator.getDimIdBean(statsDate);
int pageNo = 1;
@ -101,7 +106,7 @@ public class StatsPublicityServiceImpl implements StatsPublicityService {
//转换为 需要插入的Entity
Map<String, FactArticlePublishedDepartmentDailyEntity> departmentDailyEntityMap = convertDepartmentDailyEntity(departmentDTOList, dimIdBean);
//获取当天的业务数据
List<ArticleGridPublishedSummaryDTO> publishedArticleCount = articleService.getAllPublishedCount(customerId,DateUtils.integrate(statsDate,DateUtils.DATE_PATTERN));
List<ArticleGridPublishedSummaryDTO> publishedArticleCount = articleService.getAllDepartmentPublishedCount(customerId,DateUtils.integrate(statsDate,DateUtils.DATE_PATTERN));
if (!CollectionUtils.isEmpty(publishedArticleCount)) {
for (ArticleGridPublishedSummaryDTO summaryDTO : publishedArticleCount) {
@ -162,12 +167,12 @@ public class StatsPublicityServiceImpl implements StatsPublicityService {
//转换为 需要插入的Entity
Map<String, FactArticlePublishedGridDailyEntity> gridDailyEntityMap = convertGridDailyEntity(gridDTOList, dimIdBean);
//获取当天的业务数据
List<ArticleGridPublishedSummaryDTO> publishedArticleCount = articlePublishRangeService.getAllPublishedCount(customerId, statsDate);
List<ArticleGridPublishedSummaryDTO> publishedArticleCount = articleService.getAllGridPublishedCount(customerId, statsDate);
if (!CollectionUtils.isEmpty(publishedArticleCount)) {
for (ArticleGridPublishedSummaryDTO summaryDTO : publishedArticleCount) {
FactArticlePublishedGridDailyEntity gridDailyEntities = gridDailyEntityMap.get(summaryDTO.getGridId());
if (gridDailyEntities == null) {
log.error("publicitySummary bizData gridId:{} not exist in dimGrid", summaryDTO.getGridId());
log.error("publicitySummary getAllGridPublishedCount gridId:{} not exist in dimGrid", summaryDTO.getGridId());
continue;
}
gridDailyEntities.setArticleTotalCount(summaryDTO.getArticleTotalCount());
@ -180,20 +185,20 @@ public class StatsPublicityServiceImpl implements StatsPublicityService {
}
private void statsPublishedAgencyDaily(Date statsDate, DimIdGenerator.DimIdBean dimIdBean, String customerId, Map<String, ArticleGridPublishedSummaryDTO> agencySummaryMap) {
//获取所有客户
List<DimDepartmentEntity> departmentDTOList = null;//dimAgencyService.getAgencyListByCustomerId(customerId);
if (CollectionUtils.isEmpty(departmentDTOList)) {
//获取所有机关
List<DimAgencyEntity> agencyDTOList = dimAgencyService.getAgencyListByCustomerId(customerId);
if (CollectionUtils.isEmpty(agencyDTOList)) {
log.warn("publicitySummary getAgencyListByCustomerId return empty,customerId:{}", customerId);
return;
}
//转换为 需要插入的Entity
Map<String, FactArticlePublishedDepartmentDailyEntity> departmentDailyEntityMap = convertDepartmentDailyEntity(departmentDTOList, dimIdBean);
Map<String, FactArticlePublishedAgencyDailyEntity> agencyDailyEntityMap = convertAgencyDailyEntity(agencyDTOList, dimIdBean);
//获取当天的业务数据
List<ArticleGridPublishedSummaryDTO> publishedArticleCount = articleService.getAllPublishedCount(customerId,DateUtils.integrate(statsDate,DateUtils.DATE_PATTERN));
List<ArticleGridPublishedSummaryDTO> publishedArticleCount = articleService.getAllAgencyPublishedCount(customerId,statsDate);
if (!CollectionUtils.isEmpty(publishedArticleCount)) {
for (ArticleGridPublishedSummaryDTO summaryDTO : publishedArticleCount) {
FactArticlePublishedDepartmentDailyEntity gridDailyEntities = departmentDailyEntityMap.get(summaryDTO.getPublisherId());
FactArticlePublishedAgencyDailyEntity gridDailyEntities = agencyDailyEntityMap.get(summaryDTO.getPublisherId());
if (gridDailyEntities == null) {
log.error("publicitySummary bizData departmentId:{} not exist in dimDepartment", summaryDTO.getGridId());
continue;
@ -204,7 +209,35 @@ public class StatsPublicityServiceImpl implements StatsPublicityService {
buildAgencySummaryData(agencySummaryMap, summaryDTO);
}
}
boolean b = factArticlePublishedDepartmentDailyService.deleteAndInsertBatch(customerId, dimIdBean.getDateId(), departmentDailyEntityMap.values());
//数据向上级机关添加
if (!CollectionUtils.isEmpty(agencySummaryMap)){
for (Map.Entry<String, ArticleGridPublishedSummaryDTO> entry : agencySummaryMap.entrySet()) {
String agencyId = entry.getKey();
ArticleGridPublishedSummaryDTO summary = entry.getValue();
FactArticlePublishedAgencyDailyEntity dailyEntity = agencyDailyEntityMap.get(agencyId);
if (dailyEntity == null) {
log.error("publicitySummary bizData agencyId:{} not exist in dimAgency", agencyId);
continue;
}
setData2ParentAgency(agencyDailyEntityMap,summary, dailyEntity);
}
}
boolean b = factArticlePublishedAgencyDailyService.deleteAndInsertBatch(customerId, dimIdBean.getDateId(), agencyDailyEntityMap.values());
}
private void setData2ParentAgency(Map<String, FactArticlePublishedAgencyDailyEntity> agencyDailyEntityMap, ArticleGridPublishedSummaryDTO agencySummary, FactArticlePublishedAgencyDailyEntity summary) {
String pid = summary.getPid();
FactArticlePublishedAgencyDailyEntity parentAgency = agencyDailyEntityMap.get(pid);
if (parentAgency == null){
return;
}
parentAgency.setArticleTotalCount(parentAgency.getArticleTotalCount()+agencySummary.getArticleTotalCount());
parentAgency.setArticlePublishedCount(parentAgency.getArticlePublishedCount()+agencySummary.getArticlePublishedCount());
pid = parentAgency.getPid();
if (!NumConstant.ZERO_STR.equals(pid)){
setData2ParentAgency(agencyDailyEntityMap, agencySummary,parentAgency);
}
}
/**
@ -248,4 +281,25 @@ public class StatsPublicityServiceImpl implements StatsPublicityService {
});
return result;
}
/**
* desc:将机关卫队对象构建为 agencyDaily 对象
*
* @param dimDepartmentEntities
* @param dimIdBean
* @return
*/
private Map<String, FactArticlePublishedAgencyDailyEntity> convertAgencyDailyEntity(List<DimAgencyEntity> dimDepartmentEntities, DimIdGenerator.DimIdBean dimIdBean) {
Map<String, FactArticlePublishedAgencyDailyEntity> result = new HashMap<>();
dimDepartmentEntities.forEach(dimGridEntity -> {
FactArticlePublishedAgencyDailyEntity entity = ConvertUtils.sourceToTarget(dimIdBean, FactArticlePublishedAgencyDailyEntity.class);
entity.setCustomerId(dimGridEntity.getCustomerId());
entity.setPid(dimGridEntity.getPid());
entity.setAgencyId(dimGridEntity.getId());
entity.setArticleTotalCount(0);
entity.setArticlePublishedCount(0);
result.put(dimGridEntity.getId(), entity);
});
return result;
}
}

10
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/DimAgencyService.java

@ -122,4 +122,14 @@ public interface DimAgencyService extends BaseService<DimAgencyEntity> {
* @date 2020.06.18 09:45
**/
List<AgencySubTreeDto> getTopAgency();
/**
* desc: 根据客户Id 获取机关列表数据
*
* @param customerId
* @return:
* @date: 2020/6/18 17:54
* @author: jianjun liu
*/
List<DimAgencyEntity> getAgencyListByCustomerId(String customerId);
}

13
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactArticlePublishedAgencyDailyService.java

@ -20,6 +20,8 @@ package com.epmet.service.stats;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.entity.stats.FactArticlePublishedAgencyDailyEntity;
import java.util.Collection;
/**
* 文章发布数量机关日统计表
*
@ -28,5 +30,16 @@ import com.epmet.entity.stats.FactArticlePublishedAgencyDailyEntity;
*/
public interface FactArticlePublishedAgencyDailyService extends BaseService<FactArticlePublishedAgencyDailyEntity> {
/**
* desc: 删除并插入数据
*
* @param customerId
* @param dateId
* @param values
* @return:
* @date: 2020/6/18 18:59
* @author: jianjun liu
*/
boolean deleteAndInsertBatch(String customerId, String dateId, Collection<FactArticlePublishedAgencyDailyEntity> values);
}

13
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimAgencyServiceImpl.java

@ -20,6 +20,8 @@ package com.epmet.service.stats.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.exception.EpmetErrorCode;
import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.constant.FieldConstant;
@ -113,9 +115,10 @@ public class DimAgencyServiceImpl extends BaseServiceImpl<DimAgencyDao, DimAgenc
return baseDao.selectDimAgencyList(dto);
}
@Transactional(rollbackFor = Exception.class)
@Transactional
@Override
public void addAgencyDims(List<CustomerAgencyEntity> agencies) {
Date now = new Date();
for (CustomerAgencyEntity agency : agencies) {
DimAgencyEntity dimAgencyEntity = new DimAgencyEntity();
dimAgencyEntity.setAgencyName(agency.getOrganizationName());
@ -156,4 +159,12 @@ public class DimAgencyServiceImpl extends BaseServiceImpl<DimAgencyDao, DimAgenc
return baseDao.selectTopAgency();
}
@Override
public List<DimAgencyEntity> getAgencyListByCustomerId(String customerId) {
if (StringUtils.isBlank(customerId)){
throw new RenException(EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getCode(),EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getMsg());
}
return baseDao.getAgencyListByCustomerId(customerId);
}
}

15
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactArticlePublishedAgencyDailyServiceImpl.java

@ -21,7 +21,11 @@ import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.dao.stats.FactArticlePublishedAgencyDailyDao;
import com.epmet.entity.stats.FactArticlePublishedAgencyDailyEntity;
import com.epmet.service.stats.FactArticlePublishedAgencyDailyService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.Collection;
/**
* 文章发布数量机关日统计表
@ -29,10 +33,17 @@ import org.springframework.stereotype.Service;
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-06-18
*/
@Slf4j
@Service
public class FactArticlePublishedAgencyDailyServiceImpl extends BaseServiceImpl<FactArticlePublishedAgencyDailyDao, FactArticlePublishedAgencyDailyEntity> implements FactArticlePublishedAgencyDailyService {
@Override
@Transactional(rollbackFor = Exception.class)
public boolean deleteAndInsertBatch(String customerId, String dateId, Collection<FactArticlePublishedAgencyDailyEntity> values) {
int i = baseDao.deleteByDateId(customerId, dateId);
log.debug("deleteAndInsertBatch delete customerId:{},rows:{}", customerId,i);
this.insertBatch(values, 100);
return true;
}
}

16
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/voice/ArticleService.java

@ -40,5 +40,19 @@ public interface ArticleService extends BaseService<ArticleEntity> {
* @param publishDate
* @return
*/
List<ArticleGridPublishedSummaryDTO> getAllPublishedCount(String customerId, Date publishDate);
List<ArticleGridPublishedSummaryDTO> getAllDepartmentPublishedCount(String customerId, Date publishDate);
/**
* desc:根据客户id发布时间 获取文章总数
* @param customerId
* @param publishDate
* @return
*/
List<ArticleGridPublishedSummaryDTO> getAllAgencyPublishedCount(String customerId, Date publishDate);
/**
* desc:根据客户id发布时间 获取文章总数
* @param customerId
* @param publishDate
* @return
*/
List<ArticleGridPublishedSummaryDTO> getAllGridPublishedCount(String customerId, Date publishDate);
}

20
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/voice/impl/ArticleServiceImpl.java

@ -44,10 +44,26 @@ import java.util.List;
public class ArticleServiceImpl extends BaseServiceImpl<ArticleDao, ArticleEntity> implements ArticleService {
@Override
public List<ArticleGridPublishedSummaryDTO> getAllPublishedCount(String customerId, Date publishDate) {
public List<ArticleGridPublishedSummaryDTO> getAllDepartmentPublishedCount(String customerId, Date publishDate) {
if (StringUtils.isBlank(customerId) || publishDate == null){
throw new RenException(EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getCode(),EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getMsg());
}
return baseDao.getAllPublishedCount(customerId,publishDate, ProjectConstant.PUBLISH_TYPE_DEPT);
return baseDao.getAllPublishedCount(customerId,publishDate, ProjectConstant.PUBLISHER_TYPE_DEPT);
}
@Override
public List<ArticleGridPublishedSummaryDTO> getAllAgencyPublishedCount(String customerId, Date publishDate) {
if (StringUtils.isBlank(customerId) || publishDate == null){
throw new RenException(EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getCode(),EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getMsg());
}
return baseDao.getAllPublishedCount(customerId,publishDate, ProjectConstant.PUBLISHER_TYPE_AGENCY);
}
@Override
public List<ArticleGridPublishedSummaryDTO> getAllGridPublishedCount(String customerId, Date publishDate) {
if (StringUtils.isBlank(customerId) || publishDate == null){
throw new RenException(EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getCode(),EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getMsg());
}
return baseDao.getAllPublishedCount(customerId,publishDate, ProjectConstant.PUBLISHER_TYPE_GRID);
}
}

12
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/DimAgencyDao.xml

@ -103,5 +103,17 @@
agency.CUSTOMER_ID,
agency.PID
</select>
<select id="getAgencyListByCustomerId" resultType="com.epmet.entity.stats.DimAgencyEntity">
SELECT
ID,
CUSTOMER_ID,
PID,
LEVEL
FROM
dim_agency
WHERE
DEL_FLAG = '0'
AND CUSTOMER_ID = #{customerId,jdbcType=VARCHAR}
</select>
</mapper>

3
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactArticlePublishedAgencyDailyDao.xml

@ -22,6 +22,9 @@
<result property="updatedBy" column="UPDATED_BY"/>
<result property="updatedTime" column="UPDATED_TIME"/>
</resultMap>
<delete id="deleteByDateId">
DELETE FROM fact_article_published_agency_daily WHERE CUSTOMER_ID = #{customerId,jdbcType=VARCHAR} AND DATE_ID = #{dateId,jdbcType=VARCHAR}
</delete>
</mapper>

8
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/voice/ArticleDao.xml

@ -34,14 +34,14 @@
ORG_ID AS agencyId,
PUBLISHER_ID,
count(ID) articleTotalCount,
sum( CASE PUBLISH_STATUS WHEN 'published' THEN 1 ELSE 0 END ) articlePublishedCount
sum( CASE STATUS_FLAG WHEN 'published' THEN 1 ELSE 0 END ) articlePublishedCount
FROM
article_publish_range
article
WHERE
DEL_FLAG = 0
AND CUSTOMER_ID = #{customerId,jdbcType=VARCHAR}
AND PUBLISH_TYPE = #{publishType,jdbcType=VARCHAR}
AND PUBLISH_DATE <![CDATA[ <#{publishType,jdbcType=TIMESTAMP}]]>
AND PUBLISHER_TYPE = #{publisherType,jdbcType=VARCHAR}
AND PUBLISH_DATE <![CDATA[ <#{publishDate,jdbcType=TIMESTAMP}]]>
GROUP BY
CUSTOMER_ID,
PUBLISHER_ID

Loading…
Cancel
Save