实时报表统计接口实现
This commit is contained in:
31
src/main/java/com/nis/domain/restful/NtcAttrTypeReport.java
Normal file
31
src/main/java/com/nis/domain/restful/NtcAttrTypeReport.java
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
package com.nis.domain.restful;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||||
|
import com.wordnik.swagger.annotations.ApiModelProperty;
|
||||||
|
|
||||||
|
public class NtcAttrTypeReport extends NtcReportEntity<NtcAttrTypeReport>{
|
||||||
|
|
||||||
|
private static final long serialVersionUID = -5609071907676757108L;
|
||||||
|
|
||||||
|
@ApiModelProperty(value="性质", required=true)
|
||||||
|
protected Integer attrType ;
|
||||||
|
|
||||||
|
protected String searchAttrType;
|
||||||
|
|
||||||
|
public Integer getAttrType() {
|
||||||
|
return attrType;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAttrType(Integer attrType) {
|
||||||
|
this.attrType = attrType;
|
||||||
|
}
|
||||||
|
@JsonIgnore
|
||||||
|
public String getSearchAttrType() {
|
||||||
|
return searchAttrType;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSearchAttrType(String searchAttrType) {
|
||||||
|
this.searchAttrType = searchAttrType;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,25 @@
|
|||||||
|
package com.nis.domain.restful;
|
||||||
|
|
||||||
|
import com.wordnik.swagger.annotations.ApiModelProperty;
|
||||||
|
|
||||||
|
|
||||||
|
public class NtcDestipCountryReport extends NtcReportEntity<NtcDestipCountryReport>{
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 7911364106357601141L;
|
||||||
|
@ApiModelProperty(value="所属国家", required=true)
|
||||||
|
protected String destCountry;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param destCountry the destCountry to set
|
||||||
|
*/
|
||||||
|
public void setDestCountry(String destCountry) {
|
||||||
|
this.destCountry = destCountry;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return the destCountry
|
||||||
|
*/
|
||||||
|
public String getDestCountry() {
|
||||||
|
return destCountry;
|
||||||
|
}
|
||||||
|
}
|
||||||
43
src/main/java/com/nis/domain/restful/NtcEntranceReport.java
Normal file
43
src/main/java/com/nis/domain/restful/NtcEntranceReport.java
Normal file
@@ -0,0 +1,43 @@
|
|||||||
|
package com.nis.domain.restful;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||||
|
import com.wordnik.swagger.annotations.ApiModelProperty;
|
||||||
|
|
||||||
|
public class NtcEntranceReport extends NtcReportEntity<NtcEntranceReport> {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = -3973713578165502900L;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "局点(出入口)", required = true)
|
||||||
|
protected Integer entranceId;
|
||||||
|
|
||||||
|
protected String searchEntrance;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return the entranceId
|
||||||
|
*/
|
||||||
|
public Integer getEntranceId() {
|
||||||
|
return entranceId;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param entranceId the entranceId to set
|
||||||
|
*/
|
||||||
|
public void setEntranceId(Integer entranceId) {
|
||||||
|
this.entranceId = entranceId;
|
||||||
|
}
|
||||||
|
|
||||||
|
@JsonIgnore
|
||||||
|
/**
|
||||||
|
* @return the searchEntrance
|
||||||
|
*/
|
||||||
|
public String getSearchEntrance() {
|
||||||
|
return searchEntrance;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param searchEntrance the searchEntrance to set
|
||||||
|
*/
|
||||||
|
public void setSearchEntrance(String searchEntrance) {
|
||||||
|
this.searchEntrance = searchEntrance;
|
||||||
|
}
|
||||||
|
}
|
||||||
42
src/main/java/com/nis/domain/restful/NtcLwhhReport.java
Normal file
42
src/main/java/com/nis/domain/restful/NtcLwhhReport.java
Normal file
@@ -0,0 +1,42 @@
|
|||||||
|
package com.nis.domain.restful;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||||
|
import com.wordnik.swagger.annotations.ApiModelProperty;
|
||||||
|
|
||||||
|
public class NtcLwhhReport extends NtcReportEntity<NtcLwhhReport>{
|
||||||
|
|
||||||
|
private static final long serialVersionUID = -5980925900825684234L;
|
||||||
|
|
||||||
|
@ApiModelProperty(value="性质", required=true)
|
||||||
|
protected Integer lwhh ;
|
||||||
|
|
||||||
|
protected String searchLwhh;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param lwhh the lwhh to set
|
||||||
|
*/
|
||||||
|
public void setLwhh(Integer lwhh) {
|
||||||
|
this.lwhh = lwhh;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* @return the lwhh
|
||||||
|
*/
|
||||||
|
public Integer getLwhh() {
|
||||||
|
return lwhh;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* @return the searchLwhh
|
||||||
|
*/
|
||||||
|
@JsonIgnore
|
||||||
|
public String getSearchLwhh() {
|
||||||
|
return searchLwhh;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param searchLwhh the searchLwhh to set
|
||||||
|
*/
|
||||||
|
public void setSearchLwhh(String searchLwhh) {
|
||||||
|
this.searchLwhh = searchLwhh;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
package com.nis.domain.restful;
|
||||||
|
|
||||||
|
|
||||||
|
public class NtcServiceReport extends NtcReportEntity<NtcServiceReport>{
|
||||||
|
|
||||||
|
private static final long serialVersionUID = -1343092528265818679L;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,41 @@
|
|||||||
|
package com.nis.domain.restful;
|
||||||
|
|
||||||
|
import com.wordnik.swagger.annotations.ApiModelProperty;
|
||||||
|
|
||||||
|
|
||||||
|
public class NtcSrcipDomesticReport extends NtcReportEntity<NtcSrcipDomesticReport>{
|
||||||
|
|
||||||
|
private static final long serialVersionUID = -2146157609572355782L;
|
||||||
|
@ApiModelProperty(value="所属省", required=true)
|
||||||
|
protected String srcProvince;
|
||||||
|
@ApiModelProperty(value="所属市", required=true)
|
||||||
|
protected String srcCity;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param srcProvince the srcProvince to set
|
||||||
|
*/
|
||||||
|
public void setSrcProvince(String srcProvince) {
|
||||||
|
this.srcProvince = srcProvince;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return the srcProvince
|
||||||
|
*/
|
||||||
|
public String getSrcProvince() {
|
||||||
|
return srcProvince;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param srcCity the srcCity to set
|
||||||
|
*/
|
||||||
|
public void setSrcCity(String srcCity) {
|
||||||
|
this.srcCity = srcCity;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return the srcCity
|
||||||
|
*/
|
||||||
|
public String getSrcCity() {
|
||||||
|
return srcCity;
|
||||||
|
}
|
||||||
|
}
|
||||||
33
src/main/java/com/nis/domain/restful/NtcTagReport.java
Normal file
33
src/main/java/com/nis/domain/restful/NtcTagReport.java
Normal file
@@ -0,0 +1,33 @@
|
|||||||
|
package com.nis.domain.restful;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||||
|
import com.wordnik.swagger.annotations.ApiModelProperty;
|
||||||
|
|
||||||
|
public class NtcTagReport extends NtcReportEntity<NtcTagReport>{
|
||||||
|
|
||||||
|
|
||||||
|
private static final long serialVersionUID = -3973713578165502900L;
|
||||||
|
|
||||||
|
@ApiModelProperty(value="标签", required=true)
|
||||||
|
protected Integer tag;
|
||||||
|
|
||||||
|
protected String searchTag;
|
||||||
|
|
||||||
|
public Integer getTag() {
|
||||||
|
return tag;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTag(Integer tag) {
|
||||||
|
this.tag = tag;
|
||||||
|
}
|
||||||
|
|
||||||
|
@JsonIgnore
|
||||||
|
public String getSearchTag() {
|
||||||
|
return searchTag;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSearchTag(String searchTag) {
|
||||||
|
this.searchTag = searchTag;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -20,20 +20,27 @@ import com.nis.domain.LogEntity;
|
|||||||
import com.nis.domain.Page;
|
import com.nis.domain.Page;
|
||||||
import com.nis.domain.restful.DkBehaviorLog;
|
import com.nis.domain.restful.DkBehaviorLog;
|
||||||
import com.nis.domain.restful.NtcAppLog;
|
import com.nis.domain.restful.NtcAppLog;
|
||||||
|
import com.nis.domain.restful.NtcAttrTypeReport;
|
||||||
import com.nis.domain.restful.NtcDdosLog;
|
import com.nis.domain.restful.NtcDdosLog;
|
||||||
|
import com.nis.domain.restful.NtcDestipCountryReport;
|
||||||
import com.nis.domain.restful.NtcDnsLog;
|
import com.nis.domain.restful.NtcDnsLog;
|
||||||
|
import com.nis.domain.restful.NtcEntranceReport;
|
||||||
import com.nis.domain.restful.NtcFtpLog;
|
import com.nis.domain.restful.NtcFtpLog;
|
||||||
import com.nis.domain.restful.NtcHttpLog;
|
import com.nis.domain.restful.NtcHttpLog;
|
||||||
import com.nis.domain.restful.NtcIpLog;
|
import com.nis.domain.restful.NtcIpLog;
|
||||||
import com.nis.domain.restful.NtcIpsecLog;
|
import com.nis.domain.restful.NtcIpsecLog;
|
||||||
import com.nis.domain.restful.NtcL2tpLog;
|
import com.nis.domain.restful.NtcL2tpLog;
|
||||||
|
import com.nis.domain.restful.NtcLwhhReport;
|
||||||
import com.nis.domain.restful.NtcMailLog;
|
import com.nis.domain.restful.NtcMailLog;
|
||||||
import com.nis.domain.restful.NtcOpenvpnLog;
|
import com.nis.domain.restful.NtcOpenvpnLog;
|
||||||
import com.nis.domain.restful.NtcPptpLog;
|
import com.nis.domain.restful.NtcPptpLog;
|
||||||
import com.nis.domain.restful.NtcPzReport;
|
import com.nis.domain.restful.NtcPzReport;
|
||||||
import com.nis.domain.restful.NtcReportEntity;
|
import com.nis.domain.restful.NtcReportEntity;
|
||||||
|
import com.nis.domain.restful.NtcServiceReport;
|
||||||
|
import com.nis.domain.restful.NtcSrcipDomesticReport;
|
||||||
import com.nis.domain.restful.NtcSshLog;
|
import com.nis.domain.restful.NtcSshLog;
|
||||||
import com.nis.domain.restful.NtcSslLog;
|
import com.nis.domain.restful.NtcSslLog;
|
||||||
|
import com.nis.domain.restful.NtcTagReport;
|
||||||
import com.nis.restful.RestServiceException;
|
import com.nis.restful.RestServiceException;
|
||||||
import com.nis.util.Configurations;
|
import com.nis.util.Configurations;
|
||||||
import com.nis.util.Constants;
|
import com.nis.util.Constants;
|
||||||
@@ -918,7 +925,7 @@ public class LogController extends BaseRestController {
|
|||||||
try {
|
try {
|
||||||
resetReportTime(ntcPzReport);
|
resetReportTime(ntcPzReport);
|
||||||
//验证实时报表
|
//验证实时报表
|
||||||
ntcReportService.queryReportConditionCheck(saveLogThread, start, ntcPzReport, NtcDdosLog.class, page);
|
ntcReportService.queryReportConditionCheck(saveLogThread, start, ntcPzReport, NtcPzReport.class, page);
|
||||||
//验证serachCfgId
|
//验证serachCfgId
|
||||||
ntcReportService.checkNumericCondition(saveLogThread,start,ntcPzReport.getSearchCfgId(),"searchCfgId");
|
ntcReportService.checkNumericCondition(saveLogThread,start,ntcPzReport.getSearchCfgId(),"searchCfgId");
|
||||||
String orderBy = "";
|
String orderBy = "";
|
||||||
@@ -944,7 +951,261 @@ public class LogController extends BaseRestController {
|
|||||||
ntcPzReportPage, 0);
|
ntcPzReportPage, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@RequestMapping(value = "/ntcServiceReport", method = RequestMethod.GET)
|
||||||
|
@ApiOperation(value = "业务类型统计查询服务", httpMethod = "GET", notes = "业务类型统计查询服务,基于业务类型(service)维度聚合")
|
||||||
|
public Map<String, ?> ntcServiceReport(Page page, NtcServiceReport ntcServiceReport, Model model, HttpServletRequest request,
|
||||||
|
HttpServletResponse response) {
|
||||||
|
long start = System.currentTimeMillis();
|
||||||
|
SaveRequestLogThread saveLogThread = super.saveRequestLog(servicesRequestLogService, Constants.OPACTION_GET,
|
||||||
|
request, null);
|
||||||
|
|
||||||
|
Page<?> reportPage = null;
|
||||||
|
try {
|
||||||
|
resetReportTime(ntcServiceReport);
|
||||||
|
ntcReportService.queryReportConditionCheck(saveLogThread, start, ntcServiceReport, NtcServiceReport.class, page);
|
||||||
|
String orderBy = "";
|
||||||
|
if (null != page.getOrderBy() && !page.getOrderBy().equals("")) {
|
||||||
|
orderBy = Page.getOrderBySql(NtcServiceReport.class.getSimpleName(), page.getOrderBy());
|
||||||
|
} else {
|
||||||
|
orderBy = "report_time";
|
||||||
|
}
|
||||||
|
page.setOrderBy(orderBy);
|
||||||
|
reportPage = ntcReportService.findNtcServiceReport(new Page<NtcServiceReport>(request, response, NtcServiceReport.class),
|
||||||
|
ntcServiceReport);
|
||||||
|
} catch (Exception e) {
|
||||||
|
saveLogThread.setExceptionInfo(e.getMessage() + " " + e.getCause());
|
||||||
|
e.printStackTrace();
|
||||||
|
logger.error(e.getMessage());
|
||||||
|
if (!(e instanceof RestServiceException)) {
|
||||||
|
e = new RestServiceException(saveLogThread, System.currentTimeMillis() - start, "业务类型统计查询失败");
|
||||||
|
}
|
||||||
|
throw ((RestServiceException) e);
|
||||||
|
}
|
||||||
|
|
||||||
|
return serviceLogResponse(saveLogThread, System.currentTimeMillis() - start, request, "业务类型统计查询成功",
|
||||||
|
reportPage, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@RequestMapping(value = "/ntcTagReport", method = RequestMethod.GET)
|
||||||
|
@ApiOperation(value = "标签统计查询服务", httpMethod = "GET", notes = "标签统计查询服务,基于标签与业务类型(service)维度聚合")
|
||||||
|
public Map<String, ?> ntcTagReport(Page page, NtcTagReport ntcTagReport, Model model, HttpServletRequest request,
|
||||||
|
HttpServletResponse response) {
|
||||||
|
long start = System.currentTimeMillis();
|
||||||
|
SaveRequestLogThread saveLogThread = super.saveRequestLog(servicesRequestLogService, Constants.OPACTION_GET,
|
||||||
|
request, null);
|
||||||
|
|
||||||
|
Page<?> reportPage = null;
|
||||||
|
try {
|
||||||
|
resetReportTime(ntcTagReport);
|
||||||
|
ntcReportService.queryReportConditionCheck(saveLogThread, start, ntcTagReport, NtcTagReport.class, page);
|
||||||
|
//验证serachTag
|
||||||
|
ntcReportService.checkNumericCondition(saveLogThread,start,ntcTagReport.getSearchTag(),"searchTag");
|
||||||
|
String orderBy = "";
|
||||||
|
if (null != page.getOrderBy() && !page.getOrderBy().equals("")) {
|
||||||
|
orderBy = Page.getOrderBySql(NtcTagReport.class.getSimpleName(), page.getOrderBy());
|
||||||
|
} else {
|
||||||
|
orderBy = "report_time";
|
||||||
|
}
|
||||||
|
page.setOrderBy(orderBy);
|
||||||
|
reportPage = ntcReportService.findNtcTagReport(new Page<NtcTagReport>(request, response, NtcTagReport.class),
|
||||||
|
ntcTagReport);
|
||||||
|
} catch (Exception e) {
|
||||||
|
saveLogThread.setExceptionInfo(e.getMessage() + " " + e.getCause());
|
||||||
|
e.printStackTrace();
|
||||||
|
logger.error(e.getMessage());
|
||||||
|
if (!(e instanceof RestServiceException)) {
|
||||||
|
e = new RestServiceException(saveLogThread, System.currentTimeMillis() - start, "标签统计查询失败");
|
||||||
|
}
|
||||||
|
throw ((RestServiceException) e);
|
||||||
|
}
|
||||||
|
|
||||||
|
return serviceLogResponse(saveLogThread, System.currentTimeMillis() - start, request, "标签统计查询成功",
|
||||||
|
reportPage, 0);
|
||||||
|
}
|
||||||
|
@RequestMapping(value = "/ntcAttrTypeReport", method = RequestMethod.GET)
|
||||||
|
@ApiOperation(value = "性质统计查询服务", httpMethod = "GET", notes = "性质统计查询服务,基于性质与业务类型(service)维度聚合")
|
||||||
|
public Map<String, ?> ntcAttrTypeReport(Page page, NtcAttrTypeReport ntcAttrTypeReport, Model model, HttpServletRequest request,
|
||||||
|
HttpServletResponse response) {
|
||||||
|
long start = System.currentTimeMillis();
|
||||||
|
SaveRequestLogThread saveLogThread = super.saveRequestLog(servicesRequestLogService, Constants.OPACTION_GET,
|
||||||
|
request, null);
|
||||||
|
|
||||||
|
Page<?> reportPage = null;
|
||||||
|
try {
|
||||||
|
resetReportTime(ntcAttrTypeReport);
|
||||||
|
ntcReportService.queryReportConditionCheck(saveLogThread, start, ntcAttrTypeReport, NtcAttrTypeReport.class, page);
|
||||||
|
//验证searchAttrType
|
||||||
|
ntcReportService.checkNumericCondition(saveLogThread,start,ntcAttrTypeReport.getSearchAttrType(),"searchAttrType");
|
||||||
|
String orderBy = "";
|
||||||
|
if (null != page.getOrderBy() && !page.getOrderBy().equals("")) {
|
||||||
|
orderBy = Page.getOrderBySql(NtcAttrTypeReport.class.getSimpleName(), page.getOrderBy());
|
||||||
|
} else {
|
||||||
|
orderBy = "report_time";
|
||||||
|
}
|
||||||
|
page.setOrderBy(orderBy);
|
||||||
|
reportPage = ntcReportService.findNtcAttrTypeReport(new Page<NtcAttrTypeReport>(request, response, NtcAttrTypeReport.class),
|
||||||
|
ntcAttrTypeReport);
|
||||||
|
} catch (Exception e) {
|
||||||
|
saveLogThread.setExceptionInfo(e.getMessage() + " " + e.getCause());
|
||||||
|
e.printStackTrace();
|
||||||
|
logger.error(e.getMessage());
|
||||||
|
if (!(e instanceof RestServiceException)) {
|
||||||
|
e = new RestServiceException(saveLogThread, System.currentTimeMillis() - start, "性质统计查询失败");
|
||||||
|
}
|
||||||
|
throw ((RestServiceException) e);
|
||||||
|
}
|
||||||
|
|
||||||
|
return serviceLogResponse(saveLogThread, System.currentTimeMillis() - start, request, "性质统计查询成功",
|
||||||
|
reportPage, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
@RequestMapping(value = "/ntcLwhhReport", method = RequestMethod.GET)
|
||||||
|
@ApiOperation(value = "来文函号统计查询服务", httpMethod = "GET", notes = "来文函号统计查询服务,基于来文函号与业务类型(service)维度聚合")
|
||||||
|
public Map<String, ?> ntcLwhhReport(Page page, NtcLwhhReport ntcLwhhReport, Model model, HttpServletRequest request,
|
||||||
|
HttpServletResponse response) {
|
||||||
|
long start = System.currentTimeMillis();
|
||||||
|
SaveRequestLogThread saveLogThread = super.saveRequestLog(servicesRequestLogService, Constants.OPACTION_GET,
|
||||||
|
request, null);
|
||||||
|
|
||||||
|
Page<?> reportPage = null;
|
||||||
|
try {
|
||||||
|
resetReportTime(ntcLwhhReport);
|
||||||
|
//验证实时报表
|
||||||
|
ntcReportService.queryReportConditionCheck(saveLogThread, start, ntcLwhhReport, NtcLwhhReport.class, page);
|
||||||
|
//验证serachCfgId
|
||||||
|
ntcReportService.checkNumericCondition(saveLogThread,start,ntcLwhhReport.getSearchLwhh(),"searchLwhh");
|
||||||
|
String orderBy = "";
|
||||||
|
if (null != page.getOrderBy() && !page.getOrderBy().equals("")) {
|
||||||
|
orderBy = Page.getOrderBySql(NtcLwhhReport.class.getSimpleName(), page.getOrderBy());
|
||||||
|
} else {
|
||||||
|
orderBy = "report_time";
|
||||||
|
}
|
||||||
|
page.setOrderBy(orderBy);
|
||||||
|
reportPage = ntcReportService.findNtcLwhhReport(new Page<NtcLwhhReport>(request, response, NtcLwhhReport.class),
|
||||||
|
ntcLwhhReport);
|
||||||
|
} catch (Exception e) {
|
||||||
|
saveLogThread.setExceptionInfo(e.getMessage() + " " + e.getCause());
|
||||||
|
e.printStackTrace();
|
||||||
|
logger.error(e.getMessage());
|
||||||
|
if (!(e instanceof RestServiceException)) {
|
||||||
|
e = new RestServiceException(saveLogThread, System.currentTimeMillis() - start, "来文函号统计查询失败");
|
||||||
|
}
|
||||||
|
throw ((RestServiceException) e);
|
||||||
|
}
|
||||||
|
|
||||||
|
return serviceLogResponse(saveLogThread, System.currentTimeMillis() - start, request, "来文函号统计查询成功",
|
||||||
|
reportPage, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
@RequestMapping(value = "/ntcSrcipDomesticReport", method = RequestMethod.GET)
|
||||||
|
@ApiOperation(value = "境内源IP统计查询服务", httpMethod = "GET", notes = "境内源IP统计查询服务,基于源IP所属省、市与业务类型(service)维度聚合")
|
||||||
|
public Map<String, ?> ntcSrcipDomesticReport(Page page, NtcSrcipDomesticReport ntcSrcipDomesticReport, Model model, HttpServletRequest request,
|
||||||
|
HttpServletResponse response) {
|
||||||
|
long start = System.currentTimeMillis();
|
||||||
|
SaveRequestLogThread saveLogThread = super.saveRequestLog(servicesRequestLogService, Constants.OPACTION_GET,
|
||||||
|
request, null);
|
||||||
|
|
||||||
|
Page<?> reportPage = null;
|
||||||
|
try {
|
||||||
|
resetReportTime(ntcSrcipDomesticReport);
|
||||||
|
//验证实时报表
|
||||||
|
ntcReportService.queryReportConditionCheck(saveLogThread, start, ntcSrcipDomesticReport, NtcSrcipDomesticReport.class, page);
|
||||||
|
String orderBy = "";
|
||||||
|
if (null != page.getOrderBy() && !page.getOrderBy().equals("")) {
|
||||||
|
orderBy = Page.getOrderBySql(NtcSrcipDomesticReport.class.getSimpleName(), page.getOrderBy());
|
||||||
|
} else {
|
||||||
|
orderBy = "report_time";
|
||||||
|
}
|
||||||
|
page.setOrderBy(orderBy);
|
||||||
|
reportPage = ntcReportService.findNtcSrcipDomesticReport(new Page<NtcSrcipDomesticReport>(request, response, NtcSrcipDomesticReport.class),
|
||||||
|
ntcSrcipDomesticReport);
|
||||||
|
} catch (Exception e) {
|
||||||
|
saveLogThread.setExceptionInfo(e.getMessage() + " " + e.getCause());
|
||||||
|
e.printStackTrace();
|
||||||
|
logger.error(e.getMessage());
|
||||||
|
if (!(e instanceof RestServiceException)) {
|
||||||
|
e = new RestServiceException(saveLogThread, System.currentTimeMillis() - start, "境内源IP统计查询失败");
|
||||||
|
}
|
||||||
|
throw ((RestServiceException) e);
|
||||||
|
}
|
||||||
|
|
||||||
|
return serviceLogResponse(saveLogThread, System.currentTimeMillis() - start, request, "境内源IP统计查询成功",
|
||||||
|
reportPage, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
@RequestMapping(value = "/ntcDestipCountryReport", method = RequestMethod.GET)
|
||||||
|
@ApiOperation(value = "各国家目的IP统计查询服务", httpMethod = "GET", notes = "各国家目的IP统计查询服务,基于目的IP所属国家与业务类型(service)维度聚合")
|
||||||
|
public Map<String, ?> ntcDestipCountryReport(Page page, NtcDestipCountryReport ntcDestipCountryReport, Model model, HttpServletRequest request,
|
||||||
|
HttpServletResponse response) {
|
||||||
|
long start = System.currentTimeMillis();
|
||||||
|
SaveRequestLogThread saveLogThread = super.saveRequestLog(servicesRequestLogService, Constants.OPACTION_GET,
|
||||||
|
request, null);
|
||||||
|
|
||||||
|
Page<?> reportPage = null;
|
||||||
|
try {
|
||||||
|
resetReportTime(ntcDestipCountryReport);
|
||||||
|
//验证实时报表
|
||||||
|
ntcReportService.queryReportConditionCheck(saveLogThread, start, ntcDestipCountryReport, NtcDestipCountryReport.class, page);
|
||||||
|
String orderBy = "";
|
||||||
|
if (null != page.getOrderBy() && !page.getOrderBy().equals("")) {
|
||||||
|
orderBy = Page.getOrderBySql(NtcDestipCountryReport.class.getSimpleName(), page.getOrderBy());
|
||||||
|
} else {
|
||||||
|
orderBy = "report_time";
|
||||||
|
}
|
||||||
|
page.setOrderBy(orderBy);
|
||||||
|
reportPage = ntcReportService.findNtcDestipCountryReport(new Page<NtcDestipCountryReport>(request, response, NtcDestipCountryReport.class),
|
||||||
|
ntcDestipCountryReport);
|
||||||
|
} catch (Exception e) {
|
||||||
|
saveLogThread.setExceptionInfo(e.getMessage() + " " + e.getCause());
|
||||||
|
e.printStackTrace();
|
||||||
|
logger.error(e.getMessage());
|
||||||
|
if (!(e instanceof RestServiceException)) {
|
||||||
|
e = new RestServiceException(saveLogThread, System.currentTimeMillis() - start, "各国家目的IP统计查询失败");
|
||||||
|
}
|
||||||
|
throw ((RestServiceException) e);
|
||||||
|
}
|
||||||
|
|
||||||
|
return serviceLogResponse(saveLogThread, System.currentTimeMillis() - start, request, "各国家目的IP统计查询成功",
|
||||||
|
reportPage, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
@RequestMapping(value = "/ntcEntranceReport", method = RequestMethod.GET)
|
||||||
|
@ApiOperation(value = "运营商局点统计查询服务", httpMethod = "GET", notes = "运营商局点统计查询服务,基于出入口与业务类型(service)维度聚合")
|
||||||
|
public Map<String, ?> ntcEntranceReport(Page page, NtcEntranceReport ntcEntranceReport, Model model, HttpServletRequest request,
|
||||||
|
HttpServletResponse response) {
|
||||||
|
long start = System.currentTimeMillis();
|
||||||
|
SaveRequestLogThread saveLogThread = super.saveRequestLog(servicesRequestLogService, Constants.OPACTION_GET,
|
||||||
|
request, null);
|
||||||
|
|
||||||
|
Page<?> reportPage = null;
|
||||||
|
try {
|
||||||
|
resetReportTime(ntcEntranceReport);
|
||||||
|
ntcReportService.queryReportConditionCheck(saveLogThread, start, ntcEntranceReport, NtcEntranceReport.class, page);
|
||||||
|
//验证searchEntrance
|
||||||
|
ntcReportService.checkNumericCondition(saveLogThread,start,ntcEntranceReport.getSearchEntrance(),"searchEntrance");
|
||||||
|
String orderBy = "";
|
||||||
|
if (null != page.getOrderBy() && !page.getOrderBy().equals("")) {
|
||||||
|
orderBy = Page.getOrderBySql(NtcEntranceReport.class.getSimpleName(), page.getOrderBy());
|
||||||
|
} else {
|
||||||
|
orderBy = "report_time";
|
||||||
|
}
|
||||||
|
page.setOrderBy(orderBy);
|
||||||
|
reportPage = ntcReportService.findNtcEntranceReport(new Page<NtcEntranceReport>(request, response, NtcEntranceReport.class),
|
||||||
|
ntcEntranceReport);
|
||||||
|
} catch (Exception e) {
|
||||||
|
saveLogThread.setExceptionInfo(e.getMessage() + " " + e.getCause());
|
||||||
|
e.printStackTrace();
|
||||||
|
logger.error(e.getMessage());
|
||||||
|
if (!(e instanceof RestServiceException)) {
|
||||||
|
e = new RestServiceException(saveLogThread, System.currentTimeMillis() - start, "运营商局点统计查询失败");
|
||||||
|
}
|
||||||
|
throw ((RestServiceException) e);
|
||||||
|
}
|
||||||
|
|
||||||
|
return serviceLogResponse(saveLogThread, System.currentTimeMillis() - start, request, "运营商局点统计查询成功",
|
||||||
|
reportPage, 0);
|
||||||
|
}
|
||||||
/**
|
/**
|
||||||
* @Description:
|
* @Description:
|
||||||
* @author (zdx)
|
* @author (zdx)
|
||||||
|
|||||||
@@ -2,8 +2,14 @@ package com.nis.web.dao;
|
|||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import com.nis.domain.DfReportEntity;
|
import com.nis.domain.restful.NtcAttrTypeReport;
|
||||||
|
import com.nis.domain.restful.NtcDestipCountryReport;
|
||||||
|
import com.nis.domain.restful.NtcEntranceReport;
|
||||||
|
import com.nis.domain.restful.NtcLwhhReport;
|
||||||
import com.nis.domain.restful.NtcPzReport;
|
import com.nis.domain.restful.NtcPzReport;
|
||||||
|
import com.nis.domain.restful.NtcServiceReport;
|
||||||
|
import com.nis.domain.restful.NtcSrcipDomesticReport;
|
||||||
|
import com.nis.domain.restful.NtcTagReport;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
@@ -16,5 +22,11 @@ import com.nis.domain.restful.NtcPzReport;
|
|||||||
@MyBatisDao
|
@MyBatisDao
|
||||||
public interface NtcReportDao extends CrudDao {
|
public interface NtcReportDao extends CrudDao {
|
||||||
List<NtcPzReport> findNtcPzReport(NtcPzReport pz);
|
List<NtcPzReport> findNtcPzReport(NtcPzReport pz);
|
||||||
|
List<NtcServiceReport> findNtcServiceReport(NtcServiceReport pz);
|
||||||
|
List<NtcTagReport> findNtcTagReport(NtcTagReport pz);
|
||||||
|
List<NtcAttrTypeReport> findNtcAttrTypeReport(NtcAttrTypeReport pz);
|
||||||
|
List<NtcLwhhReport> findNtcLwhhReport(NtcLwhhReport pz);
|
||||||
|
List<NtcSrcipDomesticReport> findNtcSrcipDomesticReport(NtcSrcipDomesticReport pz);
|
||||||
|
List<NtcDestipCountryReport> findNtcDestipCountryReport(NtcDestipCountryReport pz);
|
||||||
|
List<NtcEntranceReport> findNtcEntranceReport(NtcEntranceReport pz);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,6 +7,49 @@
|
|||||||
<result column="SUM" jdbcType="BIGINT" property="sum" />
|
<result column="SUM" jdbcType="BIGINT" property="sum" />
|
||||||
<result column="REPORT_TIME" jdbcType="TIMESTAMP" property="reportTime" />
|
<result column="REPORT_TIME" jdbcType="TIMESTAMP" property="reportTime" />
|
||||||
</resultMap>
|
</resultMap>
|
||||||
|
<resultMap id="NtcServiceReportMap" type="com.nis.domain.restful.NtcServiceReport">
|
||||||
|
<result column="SERVICE" jdbcType="INTEGER" property="service" />
|
||||||
|
<result column="SUM" jdbcType="BIGINT" property="sum" />
|
||||||
|
<result column="REPORT_TIME" jdbcType="TIMESTAMP" property="reportTime" />
|
||||||
|
</resultMap>
|
||||||
|
<resultMap id="NtcTagReportMap" type="com.nis.domain.restful.NtcTagReport">
|
||||||
|
<result column="TAG" jdbcType="INTEGER" property="tag" />
|
||||||
|
<result column="SERVICE" jdbcType="INTEGER" property="service" />
|
||||||
|
<result column="SUM" jdbcType="BIGINT" property="sum" />
|
||||||
|
<result column="REPORT_TIME" jdbcType="TIMESTAMP" property="reportTime" />
|
||||||
|
</resultMap>
|
||||||
|
<resultMap id="NtcAttrTypeReportMap" type="com.nis.domain.restful.NtcAttrTypeReport">
|
||||||
|
<result column="ATTR_TYPE" jdbcType="INTEGER" property="attrType" />
|
||||||
|
<result column="SERVICE" jdbcType="INTEGER" property="service" />
|
||||||
|
<result column="SUM" jdbcType="BIGINT" property="sum" />
|
||||||
|
<result column="REPORT_TIME" jdbcType="TIMESTAMP" property="reportTime" />
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
<resultMap id="NtcLwhhReportMap" type="com.nis.domain.restful.NtcLwhhReport">
|
||||||
|
<result column="LWHH" jdbcType="INTEGER" property="lwhh" />
|
||||||
|
<result column="SERVICE" jdbcType="INTEGER" property="service" />
|
||||||
|
<result column="SUM" jdbcType="BIGINT" property="sum" />
|
||||||
|
<result column="REPORT_TIME" jdbcType="TIMESTAMP" property="reportTime" />
|
||||||
|
</resultMap>
|
||||||
|
<resultMap id="NtcSrcipDomesticReportMap" type="com.nis.domain.restful.NtcSrcipDomesticReport">
|
||||||
|
<result column="SERVICE" jdbcType="INTEGER" property="service" />
|
||||||
|
<result column="SRC_PROVINCE" jdbcType="VARCHAR" property="srcProvince" />
|
||||||
|
<result column="SRC_CITY" jdbcType="VARCHAR" property="srcCity" />
|
||||||
|
<result column="SUM" jdbcType="BIGINT" property="sum" />
|
||||||
|
<result column="REPORT_TIME" jdbcType="TIMESTAMP" property="reportTime" />
|
||||||
|
</resultMap>
|
||||||
|
<resultMap id="NtcDestipCountryReportMap" type="com.nis.domain.restful.NtcDestipCountryReport">
|
||||||
|
<result column="SERVICE" jdbcType="INTEGER" property="service" />
|
||||||
|
<result column="DEST_COUNTRY" jdbcType="VARCHAR" property="destCountry" />
|
||||||
|
<result column="SUM" jdbcType="BIGINT" property="sum" />
|
||||||
|
<result column="REPORT_TIME" jdbcType="TIMESTAMP" property="reportTime" />
|
||||||
|
</resultMap>
|
||||||
|
<resultMap id="NtcEntranceReportMap" type="com.nis.domain.restful.NtcEntranceReport">
|
||||||
|
<result column="SERVICE" jdbcType="INTEGER" property="service" />
|
||||||
|
<result column="ENTRANCE_ID" jdbcType="INTEGER" property="entranceId" />
|
||||||
|
<result column="SUM" jdbcType="BIGINT" property="sum" />
|
||||||
|
<result column="REPORT_TIME" jdbcType="TIMESTAMP" property="reportTime" />
|
||||||
|
</resultMap>
|
||||||
<sql id="commonPorperty">
|
<sql id="commonPorperty">
|
||||||
SERVICE,SUM,REPORT_TIME
|
SERVICE,SUM,REPORT_TIME
|
||||||
</sql>
|
</sql>
|
||||||
@@ -27,10 +70,10 @@
|
|||||||
FROM NTC_PZ_REPORT
|
FROM NTC_PZ_REPORT
|
||||||
<where>
|
<where>
|
||||||
<if test="searchCfgId != null and searchCfgId !=''">
|
<if test="searchCfgId != null and searchCfgId !=''">
|
||||||
<![CDATA[AND CFG_ID in (#{searchCfgId})]]>
|
<![CDATA[AND CFG_ID in (${searchCfgId})]]>
|
||||||
</if>
|
</if>
|
||||||
<if test="searchService != null and searchService !=''">
|
<if test="searchService != null and searchService !=''">
|
||||||
<![CDATA[AND SERVICE in #{searchService}]]>
|
<![CDATA[AND SERVICE in (${searchService})]]>
|
||||||
</if>
|
</if>
|
||||||
<if test="searchReportStartTime != null and searchReportStartTime !=''">
|
<if test="searchReportStartTime != null and searchReportStartTime !=''">
|
||||||
<![CDATA[AND REPORT_TIME >= STR_TO_DATE(#{searchReportStartTime},'%Y-%m-%d %H:%i:%s')]]>
|
<![CDATA[AND REPORT_TIME >= STR_TO_DATE(#{searchReportStartTime},'%Y-%m-%d %H:%i:%s')]]>
|
||||||
@@ -55,6 +98,280 @@
|
|||||||
</when>
|
</when>
|
||||||
</choose>
|
</choose>
|
||||||
</select>
|
</select>
|
||||||
|
<select id="findNtcServiceReport" parameterType="com.nis.domain.restful.NtcServiceReport"
|
||||||
|
resultMap="NtcServiceReportMap">
|
||||||
|
SELECT
|
||||||
|
<choose>
|
||||||
|
<when test="page !=null and page.fields != null and page.fields != ''">
|
||||||
|
${page.fields}
|
||||||
|
</when>
|
||||||
|
<otherwise>
|
||||||
|
<include refid="commonPorperty" />
|
||||||
|
</otherwise>
|
||||||
|
</choose>
|
||||||
|
FROM (SELECT SERVICE, SUM(SUM) SUM ,REPORT_TIME
|
||||||
|
FROM NTC_SERVICE_REPORT
|
||||||
|
<where>
|
||||||
|
<if test="searchService != null and searchService !=''">
|
||||||
|
<![CDATA[AND SERVICE in (${searchService})]]>
|
||||||
|
</if>
|
||||||
|
<if test="searchReportStartTime != null and searchReportStartTime !=''">
|
||||||
|
<![CDATA[AND REPORT_TIME >= STR_TO_DATE(#{searchReportStartTime},'%Y-%m-%d %H:%i:%s')]]>
|
||||||
|
</if>
|
||||||
|
<if test="searchReportEndTime != null and searchReportEndTime !=''">
|
||||||
|
<![CDATA[AND REPORT_TIME < STR_TO_DATE(#{searchReportEndTime},'%Y-%m-%d %H:%i:%s')]]>
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
|
||||||
|
<if test="searchBusinessType != null and searchBusinessType ==1">
|
||||||
|
GROUP BY SERVICE,REPORT_TIME
|
||||||
|
)
|
||||||
|
</if>
|
||||||
|
NTC_SERVICE_REPORT
|
||||||
|
<choose>
|
||||||
|
<when test="page !=null and page.orderBy != null and page.orderBy != ''">
|
||||||
|
ORDER BY ${page.orderBy}
|
||||||
|
</when>
|
||||||
|
</choose>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="findNtcTagReport" parameterType="com.nis.domain.restful.NtcTagReport"
|
||||||
|
resultMap="NtcTagReportMap">
|
||||||
|
SELECT
|
||||||
|
<choose>
|
||||||
|
<when test="page !=null and page.fields != null and page.fields != ''">
|
||||||
|
${page.fields}
|
||||||
|
</when>
|
||||||
|
<otherwise>
|
||||||
|
TAG,
|
||||||
|
<include refid="commonPorperty" />
|
||||||
|
</otherwise>
|
||||||
|
</choose>
|
||||||
|
FROM (SELECT SERVICE,TAG,SUM(SUM) SUM ,REPORT_TIME
|
||||||
|
FROM NTC_TAG_REPORT
|
||||||
|
<where>
|
||||||
|
<if test="searchTag != null and searchTag !=''">
|
||||||
|
<![CDATA[AND TAG in (${searchTag})]]>
|
||||||
|
</if>
|
||||||
|
<if test="searchService != null and searchService !=''">
|
||||||
|
<![CDATA[AND SERVICE in (${searchService})]]>
|
||||||
|
</if>
|
||||||
|
<if test="searchReportStartTime != null and searchReportStartTime !=''">
|
||||||
|
<![CDATA[AND REPORT_TIME >= STR_TO_DATE(#{searchReportStartTime},'%Y-%m-%d %H:%i:%s')]]>
|
||||||
|
</if>
|
||||||
|
<if test="searchReportEndTime != null and searchReportEndTime !=''">
|
||||||
|
<![CDATA[AND REPORT_TIME < STR_TO_DATE(#{searchReportEndTime},'%Y-%m-%d %H:%i:%s')]]>
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
|
||||||
|
<if test="searchBusinessType != null and searchBusinessType ==1">
|
||||||
|
GROUP BY SERVICE,TAG,REPORT_TIME
|
||||||
|
)
|
||||||
|
</if>
|
||||||
|
NTC_TAG_REPORT
|
||||||
|
<choose>
|
||||||
|
<when test="page !=null and page.orderBy != null and page.orderBy != ''">
|
||||||
|
ORDER BY ${page.orderBy}
|
||||||
|
</when>
|
||||||
|
</choose>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="findNtcAttrTypeReport" parameterType="com.nis.domain.restful.NtcAttrTypeReport"
|
||||||
|
resultMap="NtcAttrTypeReportMap">
|
||||||
|
SELECT
|
||||||
|
<choose>
|
||||||
|
<when test="page !=null and page.fields != null and page.fields != ''">
|
||||||
|
${page.fields}
|
||||||
|
</when>
|
||||||
|
<otherwise>
|
||||||
|
ATTR_TYPE,
|
||||||
|
<include refid="commonPorperty" />
|
||||||
|
</otherwise>
|
||||||
|
</choose>
|
||||||
|
FROM (SELECT SERVICE,ATTR_TYPE, SUM(SUM) SUM ,REPORT_TIME
|
||||||
|
FROM NTC_ATTR_TYPE_REPORT
|
||||||
|
<where>
|
||||||
|
<if test="searchAttrType != null and searchAttrType !=''">
|
||||||
|
<![CDATA[AND ATTR_TYPE in (${searchAttrType})]]>
|
||||||
|
</if>
|
||||||
|
<if test="searchService != null and searchService !=''">
|
||||||
|
<![CDATA[AND SERVICE in (${searchService})]]>
|
||||||
|
</if>
|
||||||
|
<if test="searchReportStartTime != null and searchReportStartTime !=''">
|
||||||
|
<![CDATA[AND REPORT_TIME >= STR_TO_DATE(#{searchReportStartTime},'%Y-%m-%d %H:%i:%s')]]>
|
||||||
|
</if>
|
||||||
|
<if test="searchReportEndTime != null and searchReportEndTime !=''">
|
||||||
|
<![CDATA[AND REPORT_TIME < STR_TO_DATE(#{searchReportEndTime},'%Y-%m-%d %H:%i:%s')]]>
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
|
||||||
|
<if test="searchBusinessType != null and searchBusinessType ==1">
|
||||||
|
GROUP BY SERVICE,ATTR_TYPE,REPORT_TIME
|
||||||
|
)
|
||||||
|
</if>
|
||||||
|
NTC_ATTR_TYPE_REPORT
|
||||||
|
<choose>
|
||||||
|
<when test="page !=null and page.orderBy != null and page.orderBy != ''">
|
||||||
|
ORDER BY ${page.orderBy}
|
||||||
|
</when>
|
||||||
|
</choose>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="findNtcLwhhReport" parameterType="com.nis.domain.restful.NtcLwhhReport"
|
||||||
|
resultMap="NtcLwhhReportMap">
|
||||||
|
SELECT
|
||||||
|
<choose>
|
||||||
|
<when test="page !=null and page.fields != null and page.fields != ''">
|
||||||
|
${page.fields}
|
||||||
|
</when>
|
||||||
|
<otherwise>
|
||||||
|
LWHH,
|
||||||
|
<include refid="commonPorperty" />
|
||||||
|
</otherwise>
|
||||||
|
</choose>
|
||||||
|
FROM (SELECT SERVICE,LWHH, SUM(SUM) SUM ,REPORT_TIME
|
||||||
|
FROM NTC_LWHH_REPORT
|
||||||
|
<where>
|
||||||
|
<if test="searchLwhh != null and searchLwhh !=''">
|
||||||
|
<![CDATA[AND LWHH in (${searchLwhh})]]>
|
||||||
|
</if>
|
||||||
|
<if test="searchService != null and searchService !=''">
|
||||||
|
<![CDATA[AND SERVICE in (${searchService})]]>
|
||||||
|
</if>
|
||||||
|
<if test="searchReportStartTime != null and searchReportStartTime !=''">
|
||||||
|
<![CDATA[AND REPORT_TIME >= STR_TO_DATE(#{searchReportStartTime},'%Y-%m-%d %H:%i:%s')]]>
|
||||||
|
</if>
|
||||||
|
<if test="searchReportEndTime != null and searchReportEndTime !=''">
|
||||||
|
<![CDATA[AND REPORT_TIME < STR_TO_DATE(#{searchReportEndTime},'%Y-%m-%d %H:%i:%s')]]>
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
|
||||||
|
<if test="searchBusinessType != null and searchBusinessType ==1">
|
||||||
|
GROUP BY SERVICE,LWHH,REPORT_TIME
|
||||||
|
)
|
||||||
|
</if>
|
||||||
|
NTC_LWHH_REPORT
|
||||||
|
<choose>
|
||||||
|
<when test="page !=null and page.orderBy != null and page.orderBy != ''">
|
||||||
|
ORDER BY ${page.orderBy}
|
||||||
|
</when>
|
||||||
|
</choose>
|
||||||
|
</select>
|
||||||
|
<select id="findNtcSrcipDomesticReport" parameterType="com.nis.domain.restful.NtcSrcipDomesticReport"
|
||||||
|
resultMap="NtcSrcipDomesticReportMap">
|
||||||
|
SELECT
|
||||||
|
<choose>
|
||||||
|
<when test="page !=null and page.fields != null and page.fields != ''">
|
||||||
|
${page.fields}
|
||||||
|
</when>
|
||||||
|
<otherwise>
|
||||||
|
SRC_PROVINCE,SRC_CITY,
|
||||||
|
<include refid="commonPorperty" />
|
||||||
|
</otherwise>
|
||||||
|
</choose>
|
||||||
|
FROM (SELECT SERVICE,SRC_PROVINCE,SRC_CITY, SUM(SUM) SUM ,REPORT_TIME
|
||||||
|
FROM NTC_SRCIP_DOMESTIC_REPORT
|
||||||
|
<where>
|
||||||
|
<if test="searchService != null and searchService !=''">
|
||||||
|
<![CDATA[AND SERVICE in (${searchService})]]>
|
||||||
|
</if>
|
||||||
|
<if test="searchReportStartTime != null and searchReportStartTime !=''">
|
||||||
|
<![CDATA[AND REPORT_TIME >= STR_TO_DATE(#{searchReportStartTime},'%Y-%m-%d %H:%i:%s')]]>
|
||||||
|
</if>
|
||||||
|
<if test="searchReportEndTime != null and searchReportEndTime !=''">
|
||||||
|
<![CDATA[AND REPORT_TIME < STR_TO_DATE(#{searchReportEndTime},'%Y-%m-%d %H:%i:%s')]]>
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
|
||||||
|
<if test="searchBusinessType != null and searchBusinessType ==1">
|
||||||
|
GROUP BY SERVICE,SRC_PROVINCE,SRC_CITY,REPORT_TIME
|
||||||
|
)
|
||||||
|
</if>
|
||||||
|
NTC_SRCIP_DOMESTIC_REPORT
|
||||||
|
<choose>
|
||||||
|
<when test="page !=null and page.orderBy != null and page.orderBy != ''">
|
||||||
|
ORDER BY ${page.orderBy}
|
||||||
|
</when>
|
||||||
|
</choose>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="findNtcDestipCountryReport" parameterType="com.nis.domain.restful.NtcDestipCountryReport"
|
||||||
|
resultMap="NtcDestipCountryReportMap">
|
||||||
|
SELECT
|
||||||
|
<choose>
|
||||||
|
<when test="page !=null and page.fields != null and page.fields != ''">
|
||||||
|
${page.fields}
|
||||||
|
</when>
|
||||||
|
<otherwise>
|
||||||
|
DEST_COUNTRY,
|
||||||
|
<include refid="commonPorperty" />
|
||||||
|
</otherwise>
|
||||||
|
</choose>
|
||||||
|
FROM (SELECT SERVICE,DEST_COUNTRY, SUM(SUM) SUM ,REPORT_TIME
|
||||||
|
FROM NTC_DESTIP_COUNTRY_REPORT
|
||||||
|
<where>
|
||||||
|
<if test="searchService != null and searchService !=''">
|
||||||
|
<![CDATA[AND SERVICE in (${searchService})]]>
|
||||||
|
</if>
|
||||||
|
<if test="searchReportStartTime != null and searchReportStartTime !=''">
|
||||||
|
<![CDATA[AND REPORT_TIME >= STR_TO_DATE(#{searchReportStartTime},'%Y-%m-%d %H:%i:%s')]]>
|
||||||
|
</if>
|
||||||
|
<if test="searchReportEndTime != null and searchReportEndTime !=''">
|
||||||
|
<![CDATA[AND REPORT_TIME < STR_TO_DATE(#{searchReportEndTime},'%Y-%m-%d %H:%i:%s')]]>
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
|
||||||
|
<if test="searchBusinessType != null and searchBusinessType ==1">
|
||||||
|
GROUP BY SERVICE,DEST_COUNTRY,REPORT_TIME
|
||||||
|
)
|
||||||
|
</if>
|
||||||
|
NTC_DESTIP_COUNTRY_REPORT
|
||||||
|
<choose>
|
||||||
|
<when test="page !=null and page.orderBy != null and page.orderBy != ''">
|
||||||
|
ORDER BY ${page.orderBy}
|
||||||
|
</when>
|
||||||
|
</choose>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="findNtcEntranceReport" parameterType="com.nis.domain.restful.NtcEntranceReport"
|
||||||
|
resultMap="NtcEntranceReportMap">
|
||||||
|
SELECT
|
||||||
|
<choose>
|
||||||
|
<when test="page !=null and page.fields != null and page.fields != ''">
|
||||||
|
${page.fields}
|
||||||
|
</when>
|
||||||
|
<otherwise>
|
||||||
|
ENTRANCE_ID,
|
||||||
|
<include refid="commonPorperty" />
|
||||||
|
</otherwise>
|
||||||
|
</choose>
|
||||||
|
FROM (SELECT SERVICE,ENTRANCE_ID, SUM(SUM) SUM ,REPORT_TIME
|
||||||
|
FROM NTC_ENTRANCE_REPORT
|
||||||
|
<where>
|
||||||
|
|
||||||
|
<if test="searchEntrance != null and searchEntrance !=''">
|
||||||
|
<![CDATA[AND ENTRANCE_ID in (${searchEntrance})]]>
|
||||||
|
</if>
|
||||||
|
<if test="searchService != null and searchService !=''">
|
||||||
|
<![CDATA[AND SERVICE in (${searchService})]]>
|
||||||
|
</if>
|
||||||
|
<if test="searchReportStartTime != null and searchReportStartTime !=''">
|
||||||
|
<![CDATA[AND REPORT_TIME >= STR_TO_DATE(#{searchReportStartTime},'%Y-%m-%d %H:%i:%s')]]>
|
||||||
|
</if>
|
||||||
|
<if test="searchReportEndTime != null and searchReportEndTime !=''">
|
||||||
|
<![CDATA[AND REPORT_TIME < STR_TO_DATE(#{searchReportEndTime},'%Y-%m-%d %H:%i:%s')]]>
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
|
||||||
|
<if test="searchBusinessType != null and searchBusinessType ==1">
|
||||||
|
GROUP BY SERVICE,ENTRANCE_ID,REPORT_TIME
|
||||||
|
)
|
||||||
|
</if>
|
||||||
|
NTC_ENTRANCE_REPORT
|
||||||
|
<choose>
|
||||||
|
<when test="page !=null and page.orderBy != null and page.orderBy != ''">
|
||||||
|
ORDER BY ${page.orderBy}
|
||||||
|
</when>
|
||||||
|
</choose>
|
||||||
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
@@ -9,7 +9,14 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import com.nis.domain.Page;
|
import com.nis.domain.Page;
|
||||||
|
import com.nis.domain.restful.NtcAttrTypeReport;
|
||||||
|
import com.nis.domain.restful.NtcDestipCountryReport;
|
||||||
|
import com.nis.domain.restful.NtcEntranceReport;
|
||||||
|
import com.nis.domain.restful.NtcLwhhReport;
|
||||||
import com.nis.domain.restful.NtcPzReport;
|
import com.nis.domain.restful.NtcPzReport;
|
||||||
|
import com.nis.domain.restful.NtcServiceReport;
|
||||||
|
import com.nis.domain.restful.NtcSrcipDomesticReport;
|
||||||
|
import com.nis.domain.restful.NtcTagReport;
|
||||||
import com.nis.web.dao.NtcReportDao;
|
import com.nis.web.dao.NtcReportDao;
|
||||||
import com.nis.web.service.BaseLogService;
|
import com.nis.web.service.BaseLogService;
|
||||||
|
|
||||||
@@ -49,5 +56,40 @@ public class NtcReportService extends BaseLogService {
|
|||||||
return null;
|
return null;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Page<NtcServiceReport> findNtcServiceReport(Page<NtcServiceReport> page, NtcServiceReport entity)
|
||||||
|
throws Exception {
|
||||||
|
page.setList(dao.findNtcServiceReport(entity));
|
||||||
|
return page;
|
||||||
|
}
|
||||||
|
public Page<NtcTagReport> findNtcTagReport(Page<NtcTagReport> page, NtcTagReport entity)
|
||||||
|
throws Exception {
|
||||||
|
page.setList(dao.findNtcTagReport(entity));
|
||||||
|
return page;
|
||||||
|
}
|
||||||
|
public Page<NtcAttrTypeReport> findNtcAttrTypeReport(Page<NtcAttrTypeReport> page, NtcAttrTypeReport entity)
|
||||||
|
throws Exception {
|
||||||
|
page.setList(dao.findNtcAttrTypeReport(entity));
|
||||||
|
return page;
|
||||||
|
}
|
||||||
|
public Page<NtcLwhhReport> findNtcLwhhReport(Page<NtcLwhhReport> page, NtcLwhhReport entity)
|
||||||
|
throws Exception {
|
||||||
|
page.setList(dao.findNtcLwhhReport(entity));
|
||||||
|
return page;
|
||||||
|
}
|
||||||
|
public Page<NtcSrcipDomesticReport> findNtcSrcipDomesticReport(Page<NtcSrcipDomesticReport> page, NtcSrcipDomesticReport entity)
|
||||||
|
throws Exception {
|
||||||
|
page.setList(dao.findNtcSrcipDomesticReport(entity));
|
||||||
|
return page;
|
||||||
|
}
|
||||||
|
public Page<NtcDestipCountryReport> findNtcDestipCountryReport(Page<NtcDestipCountryReport> page, NtcDestipCountryReport entity)
|
||||||
|
throws Exception {
|
||||||
|
page.setList(dao.findNtcDestipCountryReport(entity));
|
||||||
|
return page;
|
||||||
|
}
|
||||||
|
public Page<NtcEntranceReport> findNtcEntranceReport(Page<NtcEntranceReport> page, NtcEntranceReport entity)
|
||||||
|
throws Exception {
|
||||||
|
page.setList(dao.findNtcEntranceReport(entity));
|
||||||
|
return page;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user