Browse Source

基础上报部分接口模板

master
sunyuchao 4 years ago
parent
commit
784c5b6e10
  1. 55
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/BaseReportDao.java
  2. 40
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/BaseReportServiceImpl.java
  3. 24
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/BaseReportDao.xml

55
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/BaseReportDao.java

@ -1,7 +1,6 @@
package com.epmet.dao.stats;
import com.epmet.dto.basereport.form.AgencyRegUserFormDTO;
import com.epmet.dto.basereport.form.GridRegUserFormDTO;
import com.epmet.dto.basereport.form.*;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@ -15,30 +14,74 @@ import java.util.List;
public interface BaseReportDao {
/**
* @Param formDTO
* @Description 根据dateId删除客户网格注册用户数据
* @author sun
*/
int delGridRegUser(@Param("customerId") String customerId, @Param("dateId") String dateId);
/**
* @Param formDTO
* @Description 批量新增客户网格注册用户数据
* @author sun
*/
void insertBatchGridRegUser(@Param("list") List<GridRegUserFormDTO.DataList> dataList);
/**
* @Param formDTO
* @Description 根据dateId删除客户组织注册用户数据
* @author sun
*/
int delAgencyRegUser(@Param("customerId") String customerId, @Param("dateId") String dateId);
/**
* @Param formDTO
* @Description 批量新增客户组织注册用户数据
* @author sun
*/
void insertBatchAgencyRegUser(@Param("list") List<AgencyRegUserFormDTO.DataList> dataList);
/**
* @Description 根据dateId删除客户网格群组总数数据
* @author sun
*/
int delGridGroupTotal(@Param("customerId") String customerId, @Param("dateId") String dateId);
/**
* @Description 批量新增客户网格群组总数数据
* @author sun
*/
void insertBatchGridGroupTotal(@Param("list") List<GridGroupTotalFormDTO.DataList> dataList);
/**
* @Description 根据dateId删除客户组织群组总数数据
* @author sun
*/
int delAgencyGroupTotal(@Param("customerId") String customerId, @Param("dateId") String dateId);
/**
* @Description 批量新增客户组织群组总数数据
* @author sun
*/
void insertBatchAgencyGroupTotal(@Param("list") List<AgencyGroupTotalFormDTO.DataList> dataList);
/**
* @Description 根据dateId删除客户网格热议话题数据
* @author sun
*/
int delGridHotTopic(@Param("customerId") String customerId, @Param("dateId") String dateId);
/**
* @Description 批量新增客户网格热议话题数据
* @author sun
*/
void insertBatchGridHotTopic(@Param("list") List<GridHotTopicFormDTO.DataList> dataList);
/**
* @Description 根据dateId删除客户组织热议话题数据
* @author sun
*/
int delAgencyHotTopic(@Param("customerId") String customerId, @Param("dateId") String dateId);
/**
* @Description 批量新增客户组织热议话题数据
* @author sun
*/
void insertBatchAgencyHotTopic(@Param("list") List<AgencyHotTopicFormDTO.DataList> dataList);
}

40
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/BaseReportServiceImpl.java

@ -66,7 +66,15 @@ public class BaseReportServiceImpl implements BaseReportService {
@Override
@Transactional(rollbackFor = Exception.class)
public void gridGroupTotal(GridGroupTotalFormDTO formDTO) {
if (formDTO.getIsFirst()) {
int deleteNum;
do {
deleteNum = baseReportDao.delGridGroupTotal(formDTO.getDataList().get(0).getCustomerId(), formDTO.getDataList().get(0).getDateId());
} while (deleteNum > NumConstant.ZERO);
}
if (!CollectionUtils.isEmpty(formDTO.getDataList())) {
baseReportDao.insertBatchGridGroupTotal(formDTO.getDataList());
}
}
/**
@ -77,7 +85,15 @@ public class BaseReportServiceImpl implements BaseReportService {
@Override
@Transactional(rollbackFor = Exception.class)
public void agencyGroupTotal(AgencyGroupTotalFormDTO formDTO) {
if (formDTO.getIsFirst()) {
int deleteNum;
do {
deleteNum = baseReportDao.delAgencyGroupTotal(formDTO.getDataList().get(0).getCustomerId(), formDTO.getDataList().get(0).getDateId());
} while (deleteNum > NumConstant.ZERO);
}
if (!CollectionUtils.isEmpty(formDTO.getDataList())) {
baseReportDao.insertBatchAgencyGroupTotal(formDTO.getDataList());
}
}
/**
@ -88,7 +104,15 @@ public class BaseReportServiceImpl implements BaseReportService {
@Override
@Transactional(rollbackFor = Exception.class)
public void gridHotTopic(GridHotTopicFormDTO formDTO) {
if (formDTO.getIsFirst()) {
int deleteNum;
do {
deleteNum = baseReportDao.delGridHotTopic(formDTO.getDataList().get(0).getCustomerId(), formDTO.getDataList().get(0).getDateId());
} while (deleteNum > NumConstant.ZERO);
}
if (!CollectionUtils.isEmpty(formDTO.getDataList())) {
baseReportDao.insertBatchGridHotTopic(formDTO.getDataList());
}
}
/**
@ -99,7 +123,15 @@ public class BaseReportServiceImpl implements BaseReportService {
@Override
@Transactional(rollbackFor = Exception.class)
public void agencyHotTopic(AgencyHotTopicFormDTO formDTO) {
if (formDTO.getIsFirst()) {
int deleteNum;
do {
deleteNum = baseReportDao.delAgencyHotTopic(formDTO.getDataList().get(0).getCustomerId(), formDTO.getDataList().get(0).getDateId());
} while (deleteNum > NumConstant.ZERO);
}
if (!CollectionUtils.isEmpty(formDTO.getDataList())) {
baseReportDao.insertBatchAgencyHotTopic(formDTO.getDataList());
}
}
/**

24
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/BaseReportDao.xml

@ -132,5 +132,29 @@
</foreach>
</insert>
<delete id="delGridGroupTotal">
</delete>
<insert id="insertBatchGridGroupTotal">
</insert>
<delete id="delAgencyGroupTotal">
</delete>
<insert id="insertBatchAgencyGroupTotal">
</insert>
<delete id="delGridHotTopic">
</delete>
<insert id="insertBatchGridHotTopic">
</insert>
<delete id="delAgencyHotTopic">
</delete>
<insert id="insertBatchAgencyHotTopic">
</insert>
</mapper>

Loading…
Cancel
Save