Commit e2241381 authored by 廖旭伟's avatar 廖旭伟

天府通办数据汇聚接口修改

parent d242eb2e
...@@ -3,6 +3,7 @@ package com.mortals.xhx.daemon.task; ...@@ -3,6 +3,7 @@ package com.mortals.xhx.daemon.task;
import com.mortals.framework.exception.AppException; import com.mortals.framework.exception.AppException;
import com.mortals.framework.service.ITask; import com.mortals.framework.service.ITask;
import com.mortals.framework.service.ITaskExcuteService; import com.mortals.framework.service.ITaskExcuteService;
import com.mortals.framework.util.DateUtils;
import com.mortals.xhx.feign.site.ISiteFeign; import com.mortals.xhx.feign.site.ISiteFeign;
import com.mortals.xhx.module.converge.service.ConvergeAppsService; import com.mortals.xhx.module.converge.service.ConvergeAppsService;
import com.mortals.xhx.module.converge.service.ConvergeDeviceService; import com.mortals.xhx.module.converge.service.ConvergeDeviceService;
...@@ -41,7 +42,8 @@ public class ProvinceConvergeTaskImpl implements ITaskExcuteService { ...@@ -41,7 +42,8 @@ public class ProvinceConvergeTaskImpl implements ITaskExcuteService {
log.error("汇聚设备数据出错",e); log.error("汇聚设备数据出错",e);
} }
try { try {
convergeAppsService.doConvergeApps(); String dateTime = DateUtils.getCurrStrDate();
convergeAppsService.doConvergeApps(dateTime);
}catch (Exception e){ }catch (Exception e){
log.error("汇聚应用数据出错",e); log.error("汇聚应用数据出错",e);
......
...@@ -19,11 +19,11 @@ public interface ConvergeAppsAccessDao extends ICRUDDao<ConvergeAppsAccessEntit ...@@ -19,11 +19,11 @@ public interface ConvergeAppsAccessDao extends ICRUDDao<ConvergeAppsAccessEntit
* 应用浏览量PV统计 * 应用浏览量PV统计
* @return * @return
*/ */
List<AppsAccessVo> getAppsAccessPv(); List<AppsAccessVo> getAppsAccessPv(String startTime);
/** /**
* 应用浏览量UV统计 * 应用浏览量UV统计
* @return * @return
*/ */
List<AppsAccessVo> getAppsAccessUv(); List<AppsAccessVo> getAppsAccessUv(String startTime);
} }
...@@ -19,12 +19,12 @@ public class ConvergeAppsAccessDaoImpl extends BaseCRUDDaoMybatis<ConvergeAppsAc ...@@ -19,12 +19,12 @@ public class ConvergeAppsAccessDaoImpl extends BaseCRUDDaoMybatis<ConvergeAppsAc
@Override @Override
public List<AppsAccessVo> getAppsAccessPv() { public List<AppsAccessVo> getAppsAccessPv(String startTime) {
return this.getSqlSession().selectList(this.getSqlId("getAppsAccessPv")); return this.getSqlSession().selectList(this.getSqlId("getAppsAccessPv"),startTime);
} }
@Override @Override
public List<AppsAccessVo> getAppsAccessUv() { public List<AppsAccessVo> getAppsAccessUv(String startTime) {
return this.getSqlSession().selectList(this.getSqlId("getAppsAccessUv")); return this.getSqlSession().selectList(this.getSqlId("getAppsAccessUv"),startTime);
} }
} }
...@@ -10,12 +10,16 @@ import lombok.Data; ...@@ -10,12 +10,16 @@ import lombok.Data;
* 设备应用实体对象 * 设备应用实体对象
* *
* @author zxfei * @author zxfei
* @date 2023-06-12 * @date 2023-07-06
*/ */
@Data @Data
public class ConvergeAppsEntity extends ConvergeAppsVo { public class ConvergeAppsEntity extends ConvergeAppsVo {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
/**
* 站点id
*/
private Long siteId;
/** /**
* 设备ID * 设备ID
*/ */
...@@ -43,19 +47,19 @@ public class ConvergeAppsEntity extends ConvergeAppsVo { ...@@ -43,19 +47,19 @@ public class ConvergeAppsEntity extends ConvergeAppsVo {
/** /**
* 应用访问数 * 应用访问数
*/ */
private Integer pv; private Integer totalPv;
/** /**
* 应用访客数 * 应用访客数
*/ */
private Integer uv; private Integer totalUv;
/** /**
* 操作类型 * 操作类型
*/ */
private String opr; private String opr;
/** /**
* 站点id * 统计月份,格式yyyy-MM-dd
*/ */
private Long siteId; private String statYearMonth;
@Override @Override
public int hashCode() { public int hashCode() {
return this.getId().hashCode(); return this.getId().hashCode();
...@@ -74,6 +78,8 @@ public class ConvergeAppsEntity extends ConvergeAppsVo { ...@@ -74,6 +78,8 @@ public class ConvergeAppsEntity extends ConvergeAppsVo {
public void initAttrValue(){ public void initAttrValue(){
this.siteId = -1L;
this.equipmentId = -1L; this.equipmentId = -1L;
this.appEname = ""; this.appEname = "";
...@@ -86,12 +92,12 @@ public class ConvergeAppsEntity extends ConvergeAppsVo { ...@@ -86,12 +92,12 @@ public class ConvergeAppsEntity extends ConvergeAppsVo {
this.origin = ""; this.origin = "";
this.pv = -1; this.totalPv = -1;
this.uv = -1; this.totalUv = -1;
this.opr = ""; this.opr = "";
this.siteId = -1L; this.statYearMonth = "";
} }
} }
\ No newline at end of file
...@@ -6,7 +6,7 @@ import com.mortals.xhx.module.converge.model.ConvergeAppsEntity; ...@@ -6,7 +6,7 @@ import com.mortals.xhx.module.converge.model.ConvergeAppsEntity;
* 设备应用查询对象 * 设备应用查询对象
* *
* @author zxfei * @author zxfei
* @date 2023-06-12 * @date 2023-07-06
*/ */
public class ConvergeAppsQuery extends ConvergeAppsEntity { public class ConvergeAppsQuery extends ConvergeAppsEntity {
/** 开始 序号,主键,自增长 */ /** 开始 序号,主键,自增长 */
...@@ -24,6 +24,21 @@ public class ConvergeAppsQuery extends ConvergeAppsEntity { ...@@ -24,6 +24,21 @@ public class ConvergeAppsQuery extends ConvergeAppsEntity {
/** 序号,主键,自增长排除列表 */ /** 序号,主键,自增长排除列表 */
private List <Long> idNotList; private List <Long> idNotList;
/** 开始 站点id */
private Long siteIdStart;
/** 结束 站点id */
private Long siteIdEnd;
/** 增加 站点id */
private Long siteIdIncrement;
/** 站点id列表 */
private List <Long> siteIdList;
/** 站点id排除列表 */
private List <Long> siteIdNotList;
/** 开始 设备ID */ /** 开始 设备ID */
private Long equipmentIdStart; private Long equipmentIdStart;
...@@ -65,55 +80,45 @@ public class ConvergeAppsQuery extends ConvergeAppsEntity { ...@@ -65,55 +80,45 @@ public class ConvergeAppsQuery extends ConvergeAppsEntity {
/** 应用来源排除列表 */ /** 应用来源排除列表 */
private List <String> originNotList; private List <String> originNotList;
/** 开始 应用访问数 */ /** 开始 应用访问数 */
private Integer pvStart; private Integer totalPvStart;
/** 结束 应用访问数 */ /** 结束 应用访问数 */
private Integer pvEnd; private Integer totalPvEnd;
/** 增加 应用访问数 */ /** 增加 应用访问数 */
private Integer pvIncrement; private Integer totalPvIncrement;
/** 应用访问数列表 */ /** 应用访问数列表 */
private List <Integer> pvList; private List <Integer> totalPvList;
/** 应用访问数排除列表 */ /** 应用访问数排除列表 */
private List <Integer> pvNotList; private List <Integer> totalPvNotList;
/** 开始 应用访客数 */ /** 开始 应用访客数 */
private Integer uvStart; private Integer totalUvStart;
/** 结束 应用访客数 */ /** 结束 应用访客数 */
private Integer uvEnd; private Integer totalUvEnd;
/** 增加 应用访客数 */ /** 增加 应用访客数 */
private Integer uvIncrement; private Integer totalUvIncrement;
/** 应用访客数列表 */ /** 应用访客数列表 */
private List <Integer> uvList; private List <Integer> totalUvList;
/** 应用访客数排除列表 */ /** 应用访客数排除列表 */
private List <Integer> uvNotList; private List <Integer> totalUvNotList;
/** 操作类型 */ /** 操作类型 */
private List<String> oprList; private List<String> oprList;
/** 操作类型排除列表 */ /** 操作类型排除列表 */
private List <String> oprNotList; private List <String> oprNotList;
/** 开始 站点id */ /** 统计月份,格式yyyy-MM-dd */
private Long siteIdStart; private List<String> statYearMonthList;
/** 结束 站点id */
private Long siteIdEnd;
/** 增加 站点id */
private Long siteIdIncrement;
/** 站点id列表 */
private List <Long> siteIdList;
/** 站点id排除列表 */
private List <Long> siteIdNotList;
/** 统计月份,格式yyyy-MM-dd排除列表 */
private List <String> statYearMonthNotList;
/** OR条件集合,列表项之间是OR,项内容之间是AND,如:(list[0].1 and list[0].2) or (list[1].3 and list[1].4) */ /** OR条件集合,列表项之间是OR,项内容之间是AND,如:(list[0].1 and list[0].2) or (list[1].3 and list[1].4) */
private List<ConvergeAppsQuery> orConditionList; private List<ConvergeAppsQuery> orConditionList;
...@@ -203,6 +208,87 @@ public class ConvergeAppsQuery extends ConvergeAppsEntity { ...@@ -203,6 +208,87 @@ public class ConvergeAppsQuery extends ConvergeAppsEntity {
} }
/**
* 获取 开始 站点id
* @return siteIdStart
*/
public Long getSiteIdStart(){
return this.siteIdStart;
}
/**
* 设置 开始 站点id
* @param siteIdStart
*/
public void setSiteIdStart(Long siteIdStart){
this.siteIdStart = siteIdStart;
}
/**
* 获取 结束 站点id
* @return $siteIdEnd
*/
public Long getSiteIdEnd(){
return this.siteIdEnd;
}
/**
* 设置 结束 站点id
* @param siteIdEnd
*/
public void setSiteIdEnd(Long siteIdEnd){
this.siteIdEnd = siteIdEnd;
}
/**
* 获取 增加 站点id
* @return siteIdIncrement
*/
public Long getSiteIdIncrement(){
return this.siteIdIncrement;
}
/**
* 设置 增加 站点id
* @param siteIdIncrement
*/
public void setSiteIdIncrement(Long siteIdIncrement){
this.siteIdIncrement = siteIdIncrement;
}
/**
* 获取 站点id
* @return siteIdList
*/
public List<Long> getSiteIdList(){
return this.siteIdList;
}
/**
* 设置 站点id
* @param siteIdList
*/
public void setSiteIdList(List<Long> siteIdList){
this.siteIdList = siteIdList;
}
/**
* 获取 站点id
* @return siteIdNotList
*/
public List<Long> getSiteIdNotList(){
return this.siteIdNotList;
}
/**
* 设置 站点id
* @param siteIdNotList
*/
public void setSiteIdNotList(List<Long> siteIdNotList){
this.siteIdNotList = siteIdNotList;
}
/** /**
* 获取 开始 设备ID * 获取 开始 设备ID
* @return equipmentIdStart * @return equipmentIdStart
...@@ -446,163 +532,163 @@ public class ConvergeAppsQuery extends ConvergeAppsEntity { ...@@ -446,163 +532,163 @@ public class ConvergeAppsQuery extends ConvergeAppsEntity {
/** /**
* 获取 开始 应用访问数 * 获取 开始 应用访问数
* @return pvStart * @return totalPvStart
*/ */
public Integer getPvStart(){ public Integer getTotalPvStart(){
return this.pvStart; return this.totalPvStart;
} }
/** /**
* 设置 开始 应用访问数 * 设置 开始 应用访问数
* @param pvStart * @param totalPvStart
*/ */
public void setPvStart(Integer pvStart){ public void setTotalPvStart(Integer totalPvStart){
this.pvStart = pvStart; this.totalPvStart = totalPvStart;
} }
/** /**
* 获取 结束 应用访问数 * 获取 结束 应用访问数
* @return $pvEnd * @return $totalPvEnd
*/ */
public Integer getPvEnd(){ public Integer getTotalPvEnd(){
return this.pvEnd; return this.totalPvEnd;
} }
/** /**
* 设置 结束 应用访问数 * 设置 结束 应用访问数
* @param pvEnd * @param totalPvEnd
*/ */
public void setPvEnd(Integer pvEnd){ public void setTotalPvEnd(Integer totalPvEnd){
this.pvEnd = pvEnd; this.totalPvEnd = totalPvEnd;
} }
/** /**
* 获取 增加 应用访问数 * 获取 增加 应用访问数
* @return pvIncrement * @return totalPvIncrement
*/ */
public Integer getPvIncrement(){ public Integer getTotalPvIncrement(){
return this.pvIncrement; return this.totalPvIncrement;
} }
/** /**
* 设置 增加 应用访问数 * 设置 增加 应用访问数
* @param pvIncrement * @param totalPvIncrement
*/ */
public void setPvIncrement(Integer pvIncrement){ public void setTotalPvIncrement(Integer totalPvIncrement){
this.pvIncrement = pvIncrement; this.totalPvIncrement = totalPvIncrement;
} }
/** /**
* 获取 应用访问数 * 获取 应用访问数
* @return pvList * @return totalPvList
*/ */
public List<Integer> getPvList(){ public List<Integer> getTotalPvList(){
return this.pvList; return this.totalPvList;
} }
/** /**
* 设置 应用访问数 * 设置 应用访问数
* @param pvList * @param totalPvList
*/ */
public void setPvList(List<Integer> pvList){ public void setTotalPvList(List<Integer> totalPvList){
this.pvList = pvList; this.totalPvList = totalPvList;
} }
/** /**
* 获取 应用访问数 * 获取 应用访问数
* @return pvNotList * @return totalPvNotList
*/ */
public List<Integer> getPvNotList(){ public List<Integer> getTotalPvNotList(){
return this.pvNotList; return this.totalPvNotList;
} }
/** /**
* 设置 应用访问数 * 设置 应用访问数
* @param pvNotList * @param totalPvNotList
*/ */
public void setPvNotList(List<Integer> pvNotList){ public void setTotalPvNotList(List<Integer> totalPvNotList){
this.pvNotList = pvNotList; this.totalPvNotList = totalPvNotList;
} }
/** /**
* 获取 开始 应用访客数 * 获取 开始 应用访客数
* @return uvStart * @return totalUvStart
*/ */
public Integer getUvStart(){ public Integer getTotalUvStart(){
return this.uvStart; return this.totalUvStart;
} }
/** /**
* 设置 开始 应用访客数 * 设置 开始 应用访客数
* @param uvStart * @param totalUvStart
*/ */
public void setUvStart(Integer uvStart){ public void setTotalUvStart(Integer totalUvStart){
this.uvStart = uvStart; this.totalUvStart = totalUvStart;
} }
/** /**
* 获取 结束 应用访客数 * 获取 结束 应用访客数
* @return $uvEnd * @return $totalUvEnd
*/ */
public Integer getUvEnd(){ public Integer getTotalUvEnd(){
return this.uvEnd; return this.totalUvEnd;
} }
/** /**
* 设置 结束 应用访客数 * 设置 结束 应用访客数
* @param uvEnd * @param totalUvEnd
*/ */
public void setUvEnd(Integer uvEnd){ public void setTotalUvEnd(Integer totalUvEnd){
this.uvEnd = uvEnd; this.totalUvEnd = totalUvEnd;
} }
/** /**
* 获取 增加 应用访客数 * 获取 增加 应用访客数
* @return uvIncrement * @return totalUvIncrement
*/ */
public Integer getUvIncrement(){ public Integer getTotalUvIncrement(){
return this.uvIncrement; return this.totalUvIncrement;
} }
/** /**
* 设置 增加 应用访客数 * 设置 增加 应用访客数
* @param uvIncrement * @param totalUvIncrement
*/ */
public void setUvIncrement(Integer uvIncrement){ public void setTotalUvIncrement(Integer totalUvIncrement){
this.uvIncrement = uvIncrement; this.totalUvIncrement = totalUvIncrement;
} }
/** /**
* 获取 应用访客数 * 获取 应用访客数
* @return uvList * @return totalUvList
*/ */
public List<Integer> getUvList(){ public List<Integer> getTotalUvList(){
return this.uvList; return this.totalUvList;
} }
/** /**
* 设置 应用访客数 * 设置 应用访客数
* @param uvList * @param totalUvList
*/ */
public void setUvList(List<Integer> uvList){ public void setTotalUvList(List<Integer> totalUvList){
this.uvList = uvList; this.totalUvList = totalUvList;
} }
/** /**
* 获取 应用访客数 * 获取 应用访客数
* @return uvNotList * @return totalUvNotList
*/ */
public List<Integer> getUvNotList(){ public List<Integer> getTotalUvNotList(){
return this.uvNotList; return this.totalUvNotList;
} }
/** /**
* 设置 应用访客数 * 设置 应用访客数
* @param uvNotList * @param totalUvNotList
*/ */
public void setUvNotList(List<Integer> uvNotList){ public void setTotalUvNotList(List<Integer> totalUvNotList){
this.uvNotList = uvNotList; this.totalUvNotList = totalUvNotList;
} }
...@@ -639,86 +725,37 @@ public class ConvergeAppsQuery extends ConvergeAppsEntity { ...@@ -639,86 +725,37 @@ public class ConvergeAppsQuery extends ConvergeAppsEntity {
} }
/** /**
* 获取 开始 站点id * 获取 统计月份,格式yyyy-MM-dd
* @return siteIdStart * @return statYearMonthList
*/
public Long getSiteIdStart(){
return this.siteIdStart;
}
/**
* 设置 开始 站点id
* @param siteIdStart
*/
public void setSiteIdStart(Long siteIdStart){
this.siteIdStart = siteIdStart;
}
/**
* 获取 结束 站点id
* @return $siteIdEnd
*/
public Long getSiteIdEnd(){
return this.siteIdEnd;
}
/**
* 设置 结束 站点id
* @param siteIdEnd
*/
public void setSiteIdEnd(Long siteIdEnd){
this.siteIdEnd = siteIdEnd;
}
/**
* 获取 增加 站点id
* @return siteIdIncrement
*/
public Long getSiteIdIncrement(){
return this.siteIdIncrement;
}
/**
* 设置 增加 站点id
* @param siteIdIncrement
*/
public void setSiteIdIncrement(Long siteIdIncrement){
this.siteIdIncrement = siteIdIncrement;
}
/**
* 获取 站点id
* @return siteIdList
*/ */
public List<Long> getSiteIdList(){ public List<String> getStatYearMonthList(){
return this.siteIdList; return this.statYearMonthList;
} }
/** /**
* 设置 站点id * 设置 统计月份,格式yyyy-MM-dd
* @param siteIdList * @param statYearMonthList
*/ */
public void setSiteIdList(List<Long> siteIdList){ public void setStatYearMonthList(List<String> statYearMonthList){
this.siteIdList = siteIdList; this.statYearMonthList = statYearMonthList;
} }
/** /**
* 获取 站点id * 获取 统计月份,格式yyyy-MM-dd
* @return siteIdNotList * @return statYearMonthNotList
*/ */
public List<Long> getSiteIdNotList(){ public List<String> getStatYearMonthNotList(){
return this.siteIdNotList; return this.statYearMonthNotList;
} }
/** /**
* 设置 站点id * 设置 统计月份,格式yyyy-MM-dd
* @param siteIdNotList * @param statYearMonthNotList
*/ */
public void setSiteIdNotList(List<Long> siteIdNotList){ public void setStatYearMonthNotList(List<String> statYearMonthNotList){
this.siteIdNotList = siteIdNotList; this.statYearMonthNotList = statYearMonthNotList;
} }
/** /**
* 设置 序号,主键,自增长 * 设置 序号,主键,自增长
* @param id * @param id
...@@ -773,6 +810,60 @@ public class ConvergeAppsQuery extends ConvergeAppsEntity { ...@@ -773,6 +810,60 @@ public class ConvergeAppsQuery extends ConvergeAppsEntity {
return this; return this;
} }
/**
* 设置 站点id
* @param siteId
*/
public ConvergeAppsQuery siteId(Long siteId){
setSiteId(siteId);
return this;
}
/**
* 设置 开始 站点id
* @param siteIdStart
*/
public ConvergeAppsQuery siteIdStart(Long siteIdStart){
this.siteIdStart = siteIdStart;
return this;
}
/**
* 设置 结束 站点id
* @param siteIdEnd
*/
public ConvergeAppsQuery siteIdEnd(Long siteIdEnd){
this.siteIdEnd = siteIdEnd;
return this;
}
/**
* 设置 增加 站点id
* @param siteIdIncrement
*/
public ConvergeAppsQuery siteIdIncrement(Long siteIdIncrement){
this.siteIdIncrement = siteIdIncrement;
return this;
}
/**
* 设置 站点id
* @param siteIdList
*/
public ConvergeAppsQuery siteIdList(List<Long> siteIdList){
this.siteIdList = siteIdList;
return this;
}
/**
* 设置 站点id
* @param siteIdNotList
*/
public ConvergeAppsQuery siteIdNotList(List<Long> siteIdNotList){
this.siteIdNotList = siteIdNotList;
return this;
}
/** /**
* 设置 设备ID * 设置 设备ID
* @param equipmentId * @param equipmentId
...@@ -924,109 +1015,109 @@ public class ConvergeAppsQuery extends ConvergeAppsEntity { ...@@ -924,109 +1015,109 @@ public class ConvergeAppsQuery extends ConvergeAppsEntity {
/** /**
* 设置 应用访问数 * 设置 应用访问数
* @param pv * @param totalPv
*/ */
public ConvergeAppsQuery pv(Integer pv){ public ConvergeAppsQuery totalPv(Integer totalPv){
setPv(pv); setTotalPv(totalPv);
return this; return this;
} }
/** /**
* 设置 开始 应用访问数 * 设置 开始 应用访问数
* @param pvStart * @param totalPvStart
*/ */
public ConvergeAppsQuery pvStart(Integer pvStart){ public ConvergeAppsQuery totalPvStart(Integer totalPvStart){
this.pvStart = pvStart; this.totalPvStart = totalPvStart;
return this; return this;
} }
/** /**
* 设置 结束 应用访问数 * 设置 结束 应用访问数
* @param pvEnd * @param totalPvEnd
*/ */
public ConvergeAppsQuery pvEnd(Integer pvEnd){ public ConvergeAppsQuery totalPvEnd(Integer totalPvEnd){
this.pvEnd = pvEnd; this.totalPvEnd = totalPvEnd;
return this; return this;
} }
/** /**
* 设置 增加 应用访问数 * 设置 增加 应用访问数
* @param pvIncrement * @param totalPvIncrement
*/ */
public ConvergeAppsQuery pvIncrement(Integer pvIncrement){ public ConvergeAppsQuery totalPvIncrement(Integer totalPvIncrement){
this.pvIncrement = pvIncrement; this.totalPvIncrement = totalPvIncrement;
return this; return this;
} }
/** /**
* 设置 应用访问数 * 设置 应用访问数
* @param pvList * @param totalPvList
*/ */
public ConvergeAppsQuery pvList(List<Integer> pvList){ public ConvergeAppsQuery totalPvList(List<Integer> totalPvList){
this.pvList = pvList; this.totalPvList = totalPvList;
return this; return this;
} }
/** /**
* 设置 应用访问数 * 设置 应用访问数
* @param pvNotList * @param totalPvNotList
*/ */
public ConvergeAppsQuery pvNotList(List<Integer> pvNotList){ public ConvergeAppsQuery totalPvNotList(List<Integer> totalPvNotList){
this.pvNotList = pvNotList; this.totalPvNotList = totalPvNotList;
return this; return this;
} }
/** /**
* 设置 应用访客数 * 设置 应用访客数
* @param uv * @param totalUv
*/ */
public ConvergeAppsQuery uv(Integer uv){ public ConvergeAppsQuery totalUv(Integer totalUv){
setUv(uv); setTotalUv(totalUv);
return this; return this;
} }
/** /**
* 设置 开始 应用访客数 * 设置 开始 应用访客数
* @param uvStart * @param totalUvStart
*/ */
public ConvergeAppsQuery uvStart(Integer uvStart){ public ConvergeAppsQuery totalUvStart(Integer totalUvStart){
this.uvStart = uvStart; this.totalUvStart = totalUvStart;
return this; return this;
} }
/** /**
* 设置 结束 应用访客数 * 设置 结束 应用访客数
* @param uvEnd * @param totalUvEnd
*/ */
public ConvergeAppsQuery uvEnd(Integer uvEnd){ public ConvergeAppsQuery totalUvEnd(Integer totalUvEnd){
this.uvEnd = uvEnd; this.totalUvEnd = totalUvEnd;
return this; return this;
} }
/** /**
* 设置 增加 应用访客数 * 设置 增加 应用访客数
* @param uvIncrement * @param totalUvIncrement
*/ */
public ConvergeAppsQuery uvIncrement(Integer uvIncrement){ public ConvergeAppsQuery totalUvIncrement(Integer totalUvIncrement){
this.uvIncrement = uvIncrement; this.totalUvIncrement = totalUvIncrement;
return this; return this;
} }
/** /**
* 设置 应用访客数 * 设置 应用访客数
* @param uvList * @param totalUvList
*/ */
public ConvergeAppsQuery uvList(List<Integer> uvList){ public ConvergeAppsQuery totalUvList(List<Integer> totalUvList){
this.uvList = uvList; this.totalUvList = totalUvList;
return this; return this;
} }
/** /**
* 设置 应用访客数 * 设置 应用访客数
* @param uvNotList * @param totalUvNotList
*/ */
public ConvergeAppsQuery uvNotList(List<Integer> uvNotList){ public ConvergeAppsQuery totalUvNotList(List<Integer> totalUvNotList){
this.uvNotList = uvNotList; this.totalUvNotList = totalUvNotList;
return this; return this;
} }
...@@ -1049,57 +1140,22 @@ public class ConvergeAppsQuery extends ConvergeAppsEntity { ...@@ -1049,57 +1140,22 @@ public class ConvergeAppsQuery extends ConvergeAppsEntity {
return this; return this;
} }
/**
* 设置 站点id
* @param siteId
*/
public ConvergeAppsQuery siteId(Long siteId){
setSiteId(siteId);
return this;
}
/**
* 设置 开始 站点id
* @param siteIdStart
*/
public ConvergeAppsQuery siteIdStart(Long siteIdStart){
this.siteIdStart = siteIdStart;
return this;
}
/**
* 设置 结束 站点id
* @param siteIdEnd
*/
public ConvergeAppsQuery siteIdEnd(Long siteIdEnd){
this.siteIdEnd = siteIdEnd;
return this;
}
/** /**
* 设置 增加 站点id * 设置 统计月份,格式yyyy-MM-dd
* @param siteIdIncrement * @param statYearMonth
*/ */
public ConvergeAppsQuery siteIdIncrement(Long siteIdIncrement){ public ConvergeAppsQuery statYearMonth(String statYearMonth){
this.siteIdIncrement = siteIdIncrement; setStatYearMonth(statYearMonth);
return this; return this;
} }
/** /**
* 设置 站点id * 设置 统计月份,格式yyyy-MM-dd
* @param siteIdList * @param statYearMonthList
*/ */
public ConvergeAppsQuery siteIdList(List<Long> siteIdList){ public ConvergeAppsQuery statYearMonthList(List<String> statYearMonthList){
this.siteIdList = siteIdList; this.statYearMonthList = statYearMonthList;
return this;
}
/**
* 设置 站点id
* @param siteIdNotList
*/
public ConvergeAppsQuery siteIdNotList(List<Long> siteIdNotList){
this.siteIdNotList = siteIdNotList;
return this; return this;
} }
......
...@@ -27,11 +27,15 @@ public class AppVO { ...@@ -27,11 +27,15 @@ public class AppVO {
/** /**
* 应用访问数 * 应用访问数
*/ */
private Integer pv; private Integer totalPv;
/** /**
* 应用访客数 * 应用访客数
*/ */
private Integer uv; private Integer totalUv;
/**
* 统计月份,格式yyyy-MM-dd
*/
private String statYearMonth;
/** /**
* 操作类型 * 操作类型
*/ */
......
...@@ -35,10 +35,14 @@ public class AppsAccessVo { ...@@ -35,10 +35,14 @@ public class AppsAccessVo {
/** /**
* 应用访问数 * 应用访问数
*/ */
private Integer pv; private Integer totalPv;
/** /**
* 应用访客数 * 应用访客数
*/ */
private Integer uv; private Integer totalUv;
/**
* 统计月份,格式yyyy-MM-dd
*/
private String statYearMonth;
} }
...@@ -23,11 +23,11 @@ public interface ConvergeAppsAccessService extends ICRUDService<ConvergeAppsAcce ...@@ -23,11 +23,11 @@ public interface ConvergeAppsAccessService extends ICRUDService<ConvergeAppsAcce
* 应用浏览量PV统计 * 应用浏览量PV统计
* @return * @return
*/ */
List<AppsAccessVo> getAppsAccessPv() throws AppException; List<AppsAccessVo> getAppsAccessPv(String startTime) throws AppException;
/** /**
* 应用浏览量UV统计 * 应用浏览量UV统计
* @return * @return
*/ */
List<AppsAccessVo> getAppsAccessUv() throws AppException; List<AppsAccessVo> getAppsAccessUv(String startTime) throws AppException;
} }
\ No newline at end of file
...@@ -19,5 +19,5 @@ public interface ConvergeAppsService extends ICRUDService<ConvergeAppsEntity,Lon ...@@ -19,5 +19,5 @@ public interface ConvergeAppsService extends ICRUDService<ConvergeAppsEntity,Lon
* 天府通办数据汇聚 * 天府通办数据汇聚
* @throws AppException * @throws AppException
*/ */
void doConvergeApps() throws AppException; void doConvergeApps(String startTime) throws AppException;
} }
\ No newline at end of file
...@@ -23,12 +23,12 @@ import java.util.List; ...@@ -23,12 +23,12 @@ import java.util.List;
public class ConvergeAppsAccessServiceImpl extends AbstractCRUDServiceImpl<ConvergeAppsAccessDao, ConvergeAppsAccessEntity, Long> implements ConvergeAppsAccessService { public class ConvergeAppsAccessServiceImpl extends AbstractCRUDServiceImpl<ConvergeAppsAccessDao, ConvergeAppsAccessEntity, Long> implements ConvergeAppsAccessService {
@Override @Override
public List<AppsAccessVo> getAppsAccessPv() throws AppException { public List<AppsAccessVo> getAppsAccessPv(String startTime) throws AppException {
return dao.getAppsAccessPv(); return dao.getAppsAccessPv(startTime);
} }
@Override @Override
public List<AppsAccessVo> getAppsAccessUv() throws AppException { public List<AppsAccessVo> getAppsAccessUv(String startTime) throws AppException {
return dao.getAppsAccessUv(); return dao.getAppsAccessUv(startTime);
} }
} }
\ No newline at end of file
...@@ -38,15 +38,15 @@ public class ConvergeAppsServiceImpl extends AbstractCRUDServiceImpl<ConvergeApp ...@@ -38,15 +38,15 @@ public class ConvergeAppsServiceImpl extends AbstractCRUDServiceImpl<ConvergeApp
private ConvergeDeviceService convergeDeviceService; private ConvergeDeviceService convergeDeviceService;
@Override @Override
public void doConvergeApps() throws AppException { public void doConvergeApps(String startTime) throws AppException {
List<AppsAccessVo> accessPvList = convergeAppsAccessService.getAppsAccessPv(); List<AppsAccessVo> accessPvList = convergeAppsAccessService.getAppsAccessPv(startTime);
List<AppsAccessVo> accessUvList = convergeAppsAccessService.getAppsAccessUv(); List<AppsAccessVo> accessUvList = convergeAppsAccessService.getAppsAccessUv(startTime);
if(CollectionUtils.isEmpty(accessPvList)||CollectionUtils.isEmpty(accessUvList)){ if(CollectionUtils.isEmpty(accessPvList)||CollectionUtils.isEmpty(accessUvList)){
return; return;
}else { }else {
Map<String,AppsAccessVo> uvMap = new HashMap<>(); Map<String,AppsAccessVo> uvMap = new HashMap<>();
for (AppsAccessVo vo:accessUvList){ for (AppsAccessVo vo:accessUvList){
String key = vo.getSiteId()+"_"+vo.getEquipmentId()+"_"+vo.getAppEname(); String key = vo.getSiteId()+"_"+vo.getEquipmentId()+"_"+vo.getAppEname()+"_"+vo.getStatYearMonth();
uvMap.put(key,vo); uvMap.put(key,vo);
} }
List<ConvergeAppsEntity> appsList = new ArrayList<>(); List<ConvergeAppsEntity> appsList = new ArrayList<>();
...@@ -70,19 +70,20 @@ public class ConvergeAppsServiceImpl extends AbstractCRUDServiceImpl<ConvergeApp ...@@ -70,19 +70,20 @@ public class ConvergeAppsServiceImpl extends AbstractCRUDServiceImpl<ConvergeApp
entity.setProvider(item.getProvider()); entity.setProvider(item.getProvider());
entity.setOrigin(item.getOrigin()); entity.setOrigin(item.getOrigin());
entity.setSiteId(item.getSiteId()); entity.setSiteId(item.getSiteId());
entity.setPv(item.getPv()); entity.setTotalPv(item.getTotalPv());
String key = item.getSiteId()+"_"+item.getEquipmentId()+"_"+item.getAppEname(); entity.setStatYearMonth(item.getStatYearMonth());
String key = item.getSiteId()+"_"+item.getEquipmentId()+"_"+item.getAppEname()+"_"+item.getStatYearMonth();
if(uvMap.containsKey(key)) { if(uvMap.containsKey(key)) {
entity.setUv(uvMap.get(key).getUv()); entity.setTotalUv(uvMap.get(key).getTotalUv());
} }
appsList.add(entity); appsList.add(entity);
} }
for(ConvergeAppsEntity item:appsList){ for(ConvergeAppsEntity item:appsList){
ConvergeAppsEntity temp = this.selectOne(new ConvergeAppsQuery().appEname(item.getAppEname()).equipmentId(item.getEquipmentId()).siteId(item.getSiteId())); ConvergeAppsEntity temp = this.selectOne(new ConvergeAppsQuery().appEname(item.getAppEname()).equipmentId(item.getEquipmentId()).siteId(item.getSiteId()).statYearMonth(item.getStatYearMonth()));
if(temp!=null){ if(temp!=null){
item.setId(temp.getId()); item.setId(temp.getId());
if(temp.getPv()==item.getPv()&&temp.getUv()==item.getUv()){ if(temp.getTotalPv()==item.getTotalPv()&&temp.getTotalUv()==item.getTotalUv()){
item.setOpr("P"); item.setOpr("P");
}else { }else {
item.setOpr("U"); item.setOpr("U");
......
...@@ -62,6 +62,9 @@ public class ConvergeSiteServiceImpl extends AbstractCRUDServiceImpl<ConvergeSit ...@@ -62,6 +62,9 @@ public class ConvergeSiteServiceImpl extends AbstractCRUDServiceImpl<ConvergeSit
EquipmentVO equipmentVO = new EquipmentVO(); EquipmentVO equipmentVO = new EquipmentVO();
BeanUtils.copyProperties(deviceEntity,equipmentVO,BeanUtil.getNullPropertyNames(deviceEntity)); BeanUtils.copyProperties(deviceEntity,equipmentVO,BeanUtil.getNullPropertyNames(deviceEntity));
List<ConvergeAppsEntity> apps = convergeAppsService.find(new ConvergeAppsQuery().siteId(deviceEntity.getSiteId()).equipmentId(deviceEntity.getId())); List<ConvergeAppsEntity> apps = convergeAppsService.find(new ConvergeAppsQuery().siteId(deviceEntity.getSiteId()).equipmentId(deviceEntity.getId()));
if(CollectionUtils.isEmpty(apps)){
continue;
}
equipmentVO.setAppStats(convertAppVO(apps)); equipmentVO.setAppStats(convertAppVO(apps));
equipments.add(equipmentVO); equipments.add(equipmentVO);
} }
......
package com.mortals.xhx.module.converge.web; package com.mortals.xhx.module.converge.web;
import com.mortals.framework.annotation.UnAuth; import com.mortals.framework.annotation.UnAuth;
import com.mortals.framework.common.Rest; import com.mortals.framework.common.Rest;
import com.mortals.framework.exception.AppException;
import com.mortals.framework.model.PageInfo; import com.mortals.framework.model.PageInfo;
import com.mortals.framework.model.Result; import com.mortals.framework.model.Result;
import com.mortals.framework.util.DateUtils;
import com.mortals.framework.web.BaseCRUDJsonBodyMappingController; import com.mortals.framework.web.BaseCRUDJsonBodyMappingController;
import com.mortals.xhx.base.system.param.service.ParamService; import com.mortals.xhx.base.system.param.service.ParamService;
import com.mortals.xhx.module.converge.model.vo.BranchVO; import com.mortals.xhx.module.converge.model.vo.BranchVO;
import com.mortals.xhx.module.converge.service.ConvergeAppsService;
import com.mortals.xhx.module.converge.service.ConvergeDeviceService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
...@@ -38,6 +42,10 @@ public class ConvergeSiteController extends BaseCRUDJsonBodyMappingController<Co ...@@ -38,6 +42,10 @@ public class ConvergeSiteController extends BaseCRUDJsonBodyMappingController<Co
@Autowired @Autowired
private ParamService paramService; private ParamService paramService;
@Autowired
private ConvergeDeviceService convergeDeviceService;
@Autowired
private ConvergeAppsService convergeAppsService;
public ConvergeSiteController(){ public ConvergeSiteController(){
super.setModuleDesc( "网点信息"); super.setModuleDesc( "网点信息");
...@@ -80,4 +88,29 @@ public class ConvergeSiteController extends BaseCRUDJsonBodyMappingController<Co ...@@ -80,4 +88,29 @@ public class ConvergeSiteController extends BaseCRUDJsonBodyMappingController<Co
} }
return JSONObject.toJSONString(model.get("data")); return JSONObject.toJSONString(model.get("data"));
} }
// @Override
// protected void doListBefore(ConvergeSiteEntity query, Map<String, Object> model, Context context) throws AppException {
// log.info("开始执行省平台数据汇聚任务...");
// try {
// this.service.doConvergeSite();
//
// }catch (Exception e){
// log.error("汇聚网点数据执行出错",e);
// }
// try {
// convergeDeviceService.doConvergeDevice();
//
// }catch (Exception e){
// log.error("汇聚设备数据出错",e);
// }
// try {
// String dateTime = DateUtils.getCurrStrDate();
// convergeAppsService.doConvergeApps(dateTime);
//
// }catch (Exception e){
// log.error("汇聚应用数据出错",e);
// }
// log.info("省平台数据汇聚任务执行完成");
// }
} }
\ No newline at end of file
...@@ -3,46 +3,60 @@ ...@@ -3,46 +3,60 @@
"mybatis-3-mapper.dtd"> "mybatis-3-mapper.dtd">
<mapper namespace="com.mortals.xhx.module.converge.dao.ibatis.ConvergeAppsAccessDaoImpl"> <mapper namespace="com.mortals.xhx.module.converge.dao.ibatis.ConvergeAppsAccessDaoImpl">
<!-- 页面浏览量PV统计 --> <!-- 页面浏览量PV统计 -->
<select id="getAppsAccessPv" resultType="com.mortals.xhx.module.converge.model.vo.AppsAccessVo"> <select id="getAppsAccessPv" parameterType="String" resultType="com.mortals.xhx.module.converge.model.vo.AppsAccessVo">
SELECT SELECT
siteId, siteId,
ecode as equipmentId, ecode as equipmentId,
applicationId as appEname, applicationId as appEname,
applicationName AS appName,
appSimpleName, appSimpleName,
provider, provider,
origin, origin,
count(1) as pv DATE_FORMAT(startTime,'%Y-%m-%d') as statYearMonth,
count(1) as totalPv
FROM FROM
mortals_xhx_converge_apps_access mortals_xhx_converge_apps_access
WHERE
startTime <![CDATA[ >= ]]> STR_TO_DATE(left(concat(#{startTime},' 00:00:00'),19),'%Y-%m-%d %k:%i:%s')
AND
startTime <![CDATA[ <= ]]> STR_TO_DATE(left(concat(#{startTime},' 23:59:59'),19),'%Y-%m-%d %k:%i:%s')
GROUP BY GROUP BY
siteId, siteId,
applicationId, applicationId,
ecode ecode,
DATE_FORMAT(startTime,'%Y-%m-%d')
</select> </select>
<!-- 页面浏览量UV统计 --> <!-- 页面浏览量UV统计 -->
<select id="getAppsAccessUv" resultType="com.mortals.xhx.module.converge.model.vo.AppsAccessVo"> <select id="getAppsAccessUv" parameterType="String" resultType="com.mortals.xhx.module.converge.model.vo.AppsAccessVo">
SELECT SELECT
siteId, siteId,
ecode AS equipmentId, ecode AS equipmentId,
applicationId AS appEname, applicationId AS appEname,
applicationName AS appName,
appSimpleName, appSimpleName,
provider, provider,
origin, origin,
count(1) AS uv statYearMonth,
count(1) AS totalUv
FROM FROM
( (
SELECT SELECT
siteId, siteId,
ecode, ecode,
applicationId, applicationId,
applicationName,
appSimpleName, appSimpleName,
provider, provider,
origin, origin,
count(1), count(1),
DATE_FORMAT(startTime,'%Y-%m-%d') AS accessTime DATE_FORMAT(startTime,'%Y-%m-%d') AS statYearMonth
FROM FROM
mortals_xhx_converge_apps_access mortals_xhx_converge_apps_access
WHERE
startTime <![CDATA[ >= ]]> STR_TO_DATE(left(concat(#{startTime},' 00:00:00'),19),'%Y-%m-%d %k:%i:%s')
AND
startTime <![CDATA[ <= ]]> STR_TO_DATE(left(concat(#{startTime},' 23:59:59'),19),'%Y-%m-%d %k:%i:%s')
GROUP BY GROUP BY
siteId, siteId,
applicationId, applicationId,
......
...@@ -6,16 +6,17 @@ ...@@ -6,16 +6,17 @@
<!-- 字段和属性映射 --> <!-- 字段和属性映射 -->
<resultMap type="ConvergeAppsEntity" id="ConvergeAppsEntity-Map"> <resultMap type="ConvergeAppsEntity" id="ConvergeAppsEntity-Map">
<id property="id" column="id" /> <id property="id" column="id" />
<result property="siteId" column="siteId" />
<result property="equipmentId" column="equipmentId" /> <result property="equipmentId" column="equipmentId" />
<result property="appEname" column="appEname" /> <result property="appEname" column="appEname" />
<result property="appName" column="appName" /> <result property="appName" column="appName" />
<result property="appSimpleName" column="appSimpleName" /> <result property="appSimpleName" column="appSimpleName" />
<result property="provider" column="provider" /> <result property="provider" column="provider" />
<result property="origin" column="origin" /> <result property="origin" column="origin" />
<result property="pv" column="pv" /> <result property="totalPv" column="totalPv" />
<result property="uv" column="uv" /> <result property="totalUv" column="totalUv" />
<result property="opr" column="opr" /> <result property="opr" column="opr" />
<result property="siteId" column="siteId" /> <result property="statYearMonth" column="statYearMonth" />
</resultMap> </resultMap>
...@@ -26,6 +27,9 @@ ...@@ -26,6 +27,9 @@
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('id') or colPickMode == 1 and data.containsKey('id')))"> <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('id') or colPickMode == 1 and data.containsKey('id')))">
a.id, a.id,
</if> </if>
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('siteId') or colPickMode == 1 and data.containsKey('siteId')))">
a.siteId,
</if>
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('equipmentId') or colPickMode == 1 and data.containsKey('equipmentId')))"> <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('equipmentId') or colPickMode == 1 and data.containsKey('equipmentId')))">
a.equipmentId, a.equipmentId,
</if> </if>
...@@ -44,35 +48,35 @@ ...@@ -44,35 +48,35 @@
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('origin') or colPickMode == 1 and data.containsKey('origin')))"> <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('origin') or colPickMode == 1 and data.containsKey('origin')))">
a.origin, a.origin,
</if> </if>
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('pv') or colPickMode == 1 and data.containsKey('pv')))"> <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('totalPv') or colPickMode == 1 and data.containsKey('totalPv')))">
a.pv, a.totalPv,
</if> </if>
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('uv') or colPickMode == 1 and data.containsKey('uv')))"> <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('totalUv') or colPickMode == 1 and data.containsKey('totalUv')))">
a.uv, a.totalUv,
</if> </if>
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('opr') or colPickMode == 1 and data.containsKey('opr')))"> <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('opr') or colPickMode == 1 and data.containsKey('opr')))">
a.opr, a.opr,
</if> </if>
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('siteId') or colPickMode == 1 and data.containsKey('siteId')))"> <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('statYearMonth') or colPickMode == 1 and data.containsKey('statYearMonth')))">
a.siteId, a.statYearMonth,
</if> </if>
</trim> </trim>
</sql> </sql>
<!-- 新增 区分主键自增加还是业务插入 --> <!-- 新增 区分主键自增加还是业务插入 -->
<insert id="insert" parameterType="ConvergeAppsEntity" useGeneratedKeys="true" keyProperty="id"> <insert id="insert" parameterType="ConvergeAppsEntity" useGeneratedKeys="true" keyProperty="id">
insert into mortals_xhx_converge_apps insert into mortals_xhx_converge_apps
(equipmentId,appEname,appName,appSimpleName,provider,origin,pv,uv,opr,siteId) (siteId,equipmentId,appEname,appName,appSimpleName,provider,origin,totalPv,totalUv,opr,statYearMonth)
VALUES VALUES
(#{equipmentId},#{appEname},#{appName},#{appSimpleName},#{provider},#{origin},#{pv},#{uv},#{opr},#{siteId}) (#{siteId},#{equipmentId},#{appEname},#{appName},#{appSimpleName},#{provider},#{origin},#{totalPv},#{totalUv},#{opr},#{statYearMonth})
</insert> </insert>
<!-- 批量新增 --> <!-- 批量新增 -->
<insert id="insertBatch" parameterType="paramDto"> <insert id="insertBatch" parameterType="paramDto">
insert into mortals_xhx_converge_apps insert into mortals_xhx_converge_apps
(equipmentId,appEname,appName,appSimpleName,provider,origin,pv,uv,opr,siteId) (siteId,equipmentId,appEname,appName,appSimpleName,provider,origin,totalPv,totalUv,opr,statYearMonth)
VALUES VALUES
<foreach collection="data.dataList" item="item" index="index" separator="," > <foreach collection="data.dataList" item="item" index="index" separator="," >
(#{item.equipmentId},#{item.appEname},#{item.appName},#{item.appSimpleName},#{item.provider},#{item.origin},#{item.pv},#{item.uv},#{item.opr},#{item.siteId}) (#{item.siteId},#{item.equipmentId},#{item.appEname},#{item.appName},#{item.appSimpleName},#{item.provider},#{item.origin},#{item.totalPv},#{item.totalUv},#{item.opr},#{item.statYearMonth})
</foreach> </foreach>
</insert> </insert>
...@@ -82,6 +86,12 @@ ...@@ -82,6 +86,12 @@
update mortals_xhx_converge_apps as a update mortals_xhx_converge_apps as a
set set
<trim suffixOverrides="," suffix=""> <trim suffixOverrides="," suffix="">
<if test="(colPickMode==0 and data.containsKey('siteId')) or (colPickMode==1 and !data.containsKey('siteId'))">
a.siteId=#{data.siteId},
</if>
<if test="(colPickMode==0 and data.containsKey('siteIdIncrement')) or (colPickMode==1 and !data.containsKey('siteIdIncrement'))">
a.siteId=ifnull(a.siteId,0) + #{data.siteIdIncrement},
</if>
<if test="(colPickMode==0 and data.containsKey('equipmentId')) or (colPickMode==1 and !data.containsKey('equipmentId'))"> <if test="(colPickMode==0 and data.containsKey('equipmentId')) or (colPickMode==1 and !data.containsKey('equipmentId'))">
a.equipmentId=#{data.equipmentId}, a.equipmentId=#{data.equipmentId},
</if> </if>
...@@ -103,26 +113,23 @@ ...@@ -103,26 +113,23 @@
<if test="(colPickMode==0 and data.containsKey('origin')) or (colPickMode==1 and !data.containsKey('origin'))"> <if test="(colPickMode==0 and data.containsKey('origin')) or (colPickMode==1 and !data.containsKey('origin'))">
a.origin=#{data.origin}, a.origin=#{data.origin},
</if> </if>
<if test="(colPickMode==0 and data.containsKey('pv')) or (colPickMode==1 and !data.containsKey('pv'))"> <if test="(colPickMode==0 and data.containsKey('totalPv')) or (colPickMode==1 and !data.containsKey('totalPv'))">
a.pv=#{data.pv}, a.totalPv=#{data.totalPv},
</if> </if>
<if test="(colPickMode==0 and data.containsKey('pvIncrement')) or (colPickMode==1 and !data.containsKey('pvIncrement'))"> <if test="(colPickMode==0 and data.containsKey('totalPvIncrement')) or (colPickMode==1 and !data.containsKey('totalPvIncrement'))">
a.pv=ifnull(a.pv,0) + #{data.pvIncrement}, a.totalPv=ifnull(a.totalPv,0) + #{data.totalPvIncrement},
</if> </if>
<if test="(colPickMode==0 and data.containsKey('uv')) or (colPickMode==1 and !data.containsKey('uv'))"> <if test="(colPickMode==0 and data.containsKey('totalUv')) or (colPickMode==1 and !data.containsKey('totalUv'))">
a.uv=#{data.uv}, a.totalUv=#{data.totalUv},
</if> </if>
<if test="(colPickMode==0 and data.containsKey('uvIncrement')) or (colPickMode==1 and !data.containsKey('uvIncrement'))"> <if test="(colPickMode==0 and data.containsKey('totalUvIncrement')) or (colPickMode==1 and !data.containsKey('totalUvIncrement'))">
a.uv=ifnull(a.uv,0) + #{data.uvIncrement}, a.totalUv=ifnull(a.totalUv,0) + #{data.totalUvIncrement},
</if> </if>
<if test="(colPickMode==0 and data.containsKey('opr')) or (colPickMode==1 and !data.containsKey('opr'))"> <if test="(colPickMode==0 and data.containsKey('opr')) or (colPickMode==1 and !data.containsKey('opr'))">
a.opr=#{data.opr}, a.opr=#{data.opr},
</if> </if>
<if test="(colPickMode==0 and data.containsKey('siteId')) or (colPickMode==1 and !data.containsKey('siteId'))"> <if test="(colPickMode==0 and data.containsKey('statYearMonth')) or (colPickMode==1 and !data.containsKey('statYearMonth'))">
a.siteId=#{data.siteId}, a.statYearMonth=#{data.statYearMonth},
</if>
<if test="(colPickMode==0 and data.containsKey('siteIdIncrement')) or (colPickMode==1 and !data.containsKey('siteIdIncrement'))">
a.siteId=ifnull(a.siteId,0) + #{data.siteIdIncrement},
</if> </if>
</trim> </trim>
<trim suffixOverrides="where" suffix=""> <trim suffixOverrides="where" suffix="">
...@@ -136,6 +143,18 @@ ...@@ -136,6 +143,18 @@
<update id="updateBatch" parameterType="paramDto"> <update id="updateBatch" parameterType="paramDto">
update mortals_xhx_converge_apps as a update mortals_xhx_converge_apps as a
<trim prefix="set" suffixOverrides=","> <trim prefix="set" suffixOverrides=",">
<trim prefix="siteId=(case" suffix="ELSE siteId end),">
<foreach collection="data.dataList" item="item" index="index" separator="" >
<choose>
<when test="(colPickMode==0 and item.containsKey('siteId')) or (colPickMode==1 and !item.containsKey('siteId'))">
when a.id=#{item.id} then #{item.siteId}
</when>
<when test="(colPickMode==0 and item.containsKey('siteIdIncrement')) or (colPickMode==1 and !item.containsKey('siteIdIncrement'))">
when a.id=#{item.id} then ifnull(a.siteId,0) + #{item.siteIdIncrement}
</when>
</choose>
</foreach>
</trim>
<trim prefix="equipmentId=(case" suffix="ELSE equipmentId end),"> <trim prefix="equipmentId=(case" suffix="ELSE equipmentId end),">
<foreach collection="data.dataList" item="item" index="index" separator="" > <foreach collection="data.dataList" item="item" index="index" separator="" >
<choose> <choose>
...@@ -183,26 +202,26 @@ ...@@ -183,26 +202,26 @@
</if> </if>
</foreach> </foreach>
</trim> </trim>
<trim prefix="pv=(case" suffix="ELSE pv end),"> <trim prefix="totalPv=(case" suffix="ELSE totalPv end),">
<foreach collection="data.dataList" item="item" index="index" separator="" > <foreach collection="data.dataList" item="item" index="index" separator="" >
<choose> <choose>
<when test="(colPickMode==0 and item.containsKey('pv')) or (colPickMode==1 and !item.containsKey('pv'))"> <when test="(colPickMode==0 and item.containsKey('totalPv')) or (colPickMode==1 and !item.containsKey('totalPv'))">
when a.id=#{item.id} then #{item.pv} when a.id=#{item.id} then #{item.totalPv}
</when> </when>
<when test="(colPickMode==0 and item.containsKey('pvIncrement')) or (colPickMode==1 and !item.containsKey('pvIncrement'))"> <when test="(colPickMode==0 and item.containsKey('totalPvIncrement')) or (colPickMode==1 and !item.containsKey('totalPvIncrement'))">
when a.id=#{item.id} then ifnull(a.pv,0) + #{item.pvIncrement} when a.id=#{item.id} then ifnull(a.totalPv,0) + #{item.totalPvIncrement}
</when> </when>
</choose> </choose>
</foreach> </foreach>
</trim> </trim>
<trim prefix="uv=(case" suffix="ELSE uv end),"> <trim prefix="totalUv=(case" suffix="ELSE totalUv end),">
<foreach collection="data.dataList" item="item" index="index" separator="" > <foreach collection="data.dataList" item="item" index="index" separator="" >
<choose> <choose>
<when test="(colPickMode==0 and item.containsKey('uv')) or (colPickMode==1 and !item.containsKey('uv'))"> <when test="(colPickMode==0 and item.containsKey('totalUv')) or (colPickMode==1 and !item.containsKey('totalUv'))">
when a.id=#{item.id} then #{item.uv} when a.id=#{item.id} then #{item.totalUv}
</when> </when>
<when test="(colPickMode==0 and item.containsKey('uvIncrement')) or (colPickMode==1 and !item.containsKey('uvIncrement'))"> <when test="(colPickMode==0 and item.containsKey('totalUvIncrement')) or (colPickMode==1 and !item.containsKey('totalUvIncrement'))">
when a.id=#{item.id} then ifnull(a.uv,0) + #{item.uvIncrement} when a.id=#{item.id} then ifnull(a.totalUv,0) + #{item.totalUvIncrement}
</when> </when>
</choose> </choose>
</foreach> </foreach>
...@@ -214,16 +233,11 @@ ...@@ -214,16 +233,11 @@
</if> </if>
</foreach> </foreach>
</trim> </trim>
<trim prefix="siteId=(case" suffix="ELSE siteId end),"> <trim prefix="statYearMonth=(case" suffix="ELSE statYearMonth end),">
<foreach collection="data.dataList" item="item" index="index" separator="" > <foreach collection="data.dataList" item="item" index="index" separator="" >
<choose> <if test="(colPickMode==0 and item.containsKey('statYearMonth')) or (colPickMode==1 and !item.containsKey('statYearMonth'))">
<when test="(colPickMode==0 and item.containsKey('siteId')) or (colPickMode==1 and !item.containsKey('siteId'))"> when a.id=#{item.id} then #{item.statYearMonth}
when a.id=#{item.id} then #{item.siteId} </if>
</when>
<when test="(colPickMode==0 and item.containsKey('siteIdIncrement')) or (colPickMode==1 and !item.containsKey('siteIdIncrement'))">
when a.id=#{item.id} then ifnull(a.siteId,0) + #{item.siteIdIncrement}
</when>
</choose>
</foreach> </foreach>
</trim> </trim>
</trim> </trim>
...@@ -369,6 +383,33 @@ ...@@ -369,6 +383,33 @@
${_conditionType_} a.id <![CDATA[ <= ]]> #{${_conditionParam_}.idEnd} ${_conditionType_} a.id <![CDATA[ <= ]]> #{${_conditionParam_}.idEnd}
</if> </if>
<if test="conditionParamRef.containsKey('siteId')">
<if test="conditionParamRef.siteId != null ">
${_conditionType_} a.siteId = #{${_conditionParam_}.siteId}
</if>
<if test="conditionParamRef.siteId == null">
${_conditionType_} a.siteId is null
</if>
</if>
<if test="conditionParamRef.containsKey('siteIdList') and conditionParamRef.siteIdList.size() > 0">
${_conditionType_} a.siteId in
<foreach collection="conditionParamRef.siteIdList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('siteIdNotList') and conditionParamRef.siteIdNotList.size() > 0">
${_conditionType_} a.siteId not in
<foreach collection="conditionParamRef.siteIdNotList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('siteIdStart') and conditionParamRef.siteIdStart != null">
${_conditionType_} a.siteId <![CDATA[ >= ]]> #{${_conditionParam_}.siteIdStart}
</if>
<if test="conditionParamRef.containsKey('siteIdEnd') and conditionParamRef.siteIdEnd != null">
${_conditionType_} a.siteId <![CDATA[ <= ]]> #{${_conditionParam_}.siteIdEnd}
</if>
<if test="conditionParamRef.containsKey('equipmentId')"> <if test="conditionParamRef.containsKey('equipmentId')">
<if test="conditionParamRef.equipmentId != null "> <if test="conditionParamRef.equipmentId != null ">
${_conditionType_} a.equipmentId = #{${_conditionParam_}.equipmentId} ${_conditionType_} a.equipmentId = #{${_conditionParam_}.equipmentId}
...@@ -501,58 +542,58 @@ ...@@ -501,58 +542,58 @@
#{item} #{item}
</foreach> </foreach>
</if> </if>
<if test="conditionParamRef.containsKey('pv')"> <if test="conditionParamRef.containsKey('totalPv')">
<if test="conditionParamRef.pv != null "> <if test="conditionParamRef.totalPv != null ">
${_conditionType_} a.pv = #{${_conditionParam_}.pv} ${_conditionType_} a.totalPv = #{${_conditionParam_}.totalPv}
</if> </if>
<if test="conditionParamRef.pv == null"> <if test="conditionParamRef.totalPv == null">
${_conditionType_} a.pv is null ${_conditionType_} a.totalPv is null
</if> </if>
</if> </if>
<if test="conditionParamRef.containsKey('pvList') and conditionParamRef.pvList.size() > 0"> <if test="conditionParamRef.containsKey('totalPvList') and conditionParamRef.totalPvList.size() > 0">
${_conditionType_} a.pv in ${_conditionType_} a.totalPv in
<foreach collection="conditionParamRef.pvList" open="(" close=")" index="index" item="item" separator=","> <foreach collection="conditionParamRef.totalPvList" open="(" close=")" index="index" item="item" separator=",">
#{item} #{item}
</foreach> </foreach>
</if> </if>
<if test="conditionParamRef.containsKey('pvNotList') and conditionParamRef.pvNotList.size() > 0"> <if test="conditionParamRef.containsKey('totalPvNotList') and conditionParamRef.totalPvNotList.size() > 0">
${_conditionType_} a.pv not in ${_conditionType_} a.totalPv not in
<foreach collection="conditionParamRef.pvNotList" open="(" close=")" index="index" item="item" separator=","> <foreach collection="conditionParamRef.totalPvNotList" open="(" close=")" index="index" item="item" separator=",">
#{item} #{item}
</foreach> </foreach>
</if> </if>
<if test="conditionParamRef.containsKey('pvStart') and conditionParamRef.pvStart != null"> <if test="conditionParamRef.containsKey('totalPvStart') and conditionParamRef.totalPvStart != null">
${_conditionType_} a.pv <![CDATA[ >= ]]> #{${_conditionParam_}.pvStart} ${_conditionType_} a.totalPv <![CDATA[ >= ]]> #{${_conditionParam_}.totalPvStart}
</if> </if>
<if test="conditionParamRef.containsKey('pvEnd') and conditionParamRef.pvEnd != null"> <if test="conditionParamRef.containsKey('totalPvEnd') and conditionParamRef.totalPvEnd != null">
${_conditionType_} a.pv <![CDATA[ <= ]]> #{${_conditionParam_}.pvEnd} ${_conditionType_} a.totalPv <![CDATA[ <= ]]> #{${_conditionParam_}.totalPvEnd}
</if> </if>
<if test="conditionParamRef.containsKey('uv')"> <if test="conditionParamRef.containsKey('totalUv')">
<if test="conditionParamRef.uv != null "> <if test="conditionParamRef.totalUv != null ">
${_conditionType_} a.uv = #{${_conditionParam_}.uv} ${_conditionType_} a.totalUv = #{${_conditionParam_}.totalUv}
</if> </if>
<if test="conditionParamRef.uv == null"> <if test="conditionParamRef.totalUv == null">
${_conditionType_} a.uv is null ${_conditionType_} a.totalUv is null
</if> </if>
</if> </if>
<if test="conditionParamRef.containsKey('uvList') and conditionParamRef.uvList.size() > 0"> <if test="conditionParamRef.containsKey('totalUvList') and conditionParamRef.totalUvList.size() > 0">
${_conditionType_} a.uv in ${_conditionType_} a.totalUv in
<foreach collection="conditionParamRef.uvList" open="(" close=")" index="index" item="item" separator=","> <foreach collection="conditionParamRef.totalUvList" open="(" close=")" index="index" item="item" separator=",">
#{item} #{item}
</foreach> </foreach>
</if> </if>
<if test="conditionParamRef.containsKey('uvNotList') and conditionParamRef.uvNotList.size() > 0"> <if test="conditionParamRef.containsKey('totalUvNotList') and conditionParamRef.totalUvNotList.size() > 0">
${_conditionType_} a.uv not in ${_conditionType_} a.totalUv not in
<foreach collection="conditionParamRef.uvNotList" open="(" close=")" index="index" item="item" separator=","> <foreach collection="conditionParamRef.totalUvNotList" open="(" close=")" index="index" item="item" separator=",">
#{item} #{item}
</foreach> </foreach>
</if> </if>
<if test="conditionParamRef.containsKey('uvStart') and conditionParamRef.uvStart != null"> <if test="conditionParamRef.containsKey('totalUvStart') and conditionParamRef.totalUvStart != null">
${_conditionType_} a.uv <![CDATA[ >= ]]> #{${_conditionParam_}.uvStart} ${_conditionType_} a.totalUv <![CDATA[ >= ]]> #{${_conditionParam_}.totalUvStart}
</if> </if>
<if test="conditionParamRef.containsKey('uvEnd') and conditionParamRef.uvEnd != null"> <if test="conditionParamRef.containsKey('totalUvEnd') and conditionParamRef.totalUvEnd != null">
${_conditionType_} a.uv <![CDATA[ <= ]]> #{${_conditionParam_}.uvEnd} ${_conditionType_} a.totalUv <![CDATA[ <= ]]> #{${_conditionParam_}.totalUvEnd}
</if> </if>
...@@ -576,33 +617,27 @@ ...@@ -576,33 +617,27 @@
#{item} #{item}
</foreach> </foreach>
</if> </if>
<if test="conditionParamRef.containsKey('siteId')">
<if test="conditionParamRef.siteId != null "> <if test="conditionParamRef.containsKey('statYearMonth')">
${_conditionType_} a.siteId = #{${_conditionParam_}.siteId} <if test="conditionParamRef.statYearMonth != null and conditionParamRef.statYearMonth != ''">
${_conditionType_} a.statYearMonth like #{${_conditionParam_}.statYearMonth}
</if> </if>
<if test="conditionParamRef.siteId == null"> <if test="conditionParamRef.statYearMonth == null">
${_conditionType_} a.siteId is null ${_conditionType_} a.statYearMonth is null
</if> </if>
</if> </if>
<if test="conditionParamRef.containsKey('siteIdList') and conditionParamRef.siteIdList.size() > 0"> <if test="conditionParamRef.containsKey('statYearMonthList') and conditionParamRef.statYearMonthList.size() > 0">
${_conditionType_} a.siteId in ${_conditionType_} a.statYearMonth in
<foreach collection="conditionParamRef.siteIdList" open="(" close=")" index="index" item="item" separator=","> <foreach collection="conditionParamRef.statYearMonthList" open="(" close=")" index="index" item="item" separator=",">
#{item} #{item}
</foreach> </foreach>
</if> </if>
<if test="conditionParamRef.containsKey('siteIdNotList') and conditionParamRef.siteIdNotList.size() > 0"> <if test="conditionParamRef.containsKey('statYearMonthNotList') and conditionParamRef.statYearMonthNotList.size() > 0">
${_conditionType_} a.siteId not in ${_conditionType_} a.statYearMonth not in
<foreach collection="conditionParamRef.siteIdNotList" open="(" close=")" index="index" item="item" separator=","> <foreach collection="conditionParamRef.statYearMonthNotList" open="(" close=")" index="index" item="item" separator=",">
#{item} #{item}
</foreach> </foreach>
</if> </if>
<if test="conditionParamRef.containsKey('siteIdStart') and conditionParamRef.siteIdStart != null">
${_conditionType_} a.siteId <![CDATA[ >= ]]> #{${_conditionParam_}.siteIdStart}
</if>
<if test="conditionParamRef.containsKey('siteIdEnd') and conditionParamRef.siteIdEnd != null">
${_conditionType_} a.siteId <![CDATA[ <= ]]> #{${_conditionParam_}.siteIdEnd}
</if>
</sql> </sql>
<sql id="_orderCols_"> <sql id="_orderCols_">
<if test="orderColList != null and !orderColList.isEmpty()"> <if test="orderColList != null and !orderColList.isEmpty()">
...@@ -621,6 +656,11 @@ ...@@ -621,6 +656,11 @@
<if test='orderCol.id != null and "DESC".equalsIgnoreCase(orderCol.id)'>DESC</if> <if test='orderCol.id != null and "DESC".equalsIgnoreCase(orderCol.id)'>DESC</if>
, ,
</if> </if>
<if test="orderCol.containsKey('siteId')">
a.siteId
<if test='orderCol.siteId != null and "DESC".equalsIgnoreCase(orderCol.siteId)'>DESC</if>
,
</if>
<if test="orderCol.containsKey('equipmentId')"> <if test="orderCol.containsKey('equipmentId')">
a.equipmentId a.equipmentId
<if test='orderCol.equipmentId != null and "DESC".equalsIgnoreCase(orderCol.equipmentId)'>DESC</if> <if test='orderCol.equipmentId != null and "DESC".equalsIgnoreCase(orderCol.equipmentId)'>DESC</if>
...@@ -651,14 +691,14 @@ ...@@ -651,14 +691,14 @@
<if test='orderCol.origin != null and "DESC".equalsIgnoreCase(orderCol.origin)'>DESC</if> <if test='orderCol.origin != null and "DESC".equalsIgnoreCase(orderCol.origin)'>DESC</if>
, ,
</if> </if>
<if test="orderCol.containsKey('pv')"> <if test="orderCol.containsKey('totalPv')">
a.pv a.totalPv
<if test='orderCol.pv != null and "DESC".equalsIgnoreCase(orderCol.pv)'>DESC</if> <if test='orderCol.totalPv != null and "DESC".equalsIgnoreCase(orderCol.totalPv)'>DESC</if>
, ,
</if> </if>
<if test="orderCol.containsKey('uv')"> <if test="orderCol.containsKey('totalUv')">
a.uv a.totalUv
<if test='orderCol.uv != null and "DESC".equalsIgnoreCase(orderCol.uv)'>DESC</if> <if test='orderCol.totalUv != null and "DESC".equalsIgnoreCase(orderCol.totalUv)'>DESC</if>
, ,
</if> </if>
<if test="orderCol.containsKey('opr')"> <if test="orderCol.containsKey('opr')">
...@@ -666,9 +706,9 @@ ...@@ -666,9 +706,9 @@
<if test='orderCol.opr != null and "DESC".equalsIgnoreCase(orderCol.opr)'>DESC</if> <if test='orderCol.opr != null and "DESC".equalsIgnoreCase(orderCol.opr)'>DESC</if>
, ,
</if> </if>
<if test="orderCol.containsKey('siteId')"> <if test="orderCol.containsKey('statYearMonth')">
a.siteId a.statYearMonth
<if test='orderCol.siteId != null and "DESC".equalsIgnoreCase(orderCol.siteId)'>DESC</if> <if test='orderCol.statYearMonth != null and "DESC".equalsIgnoreCase(orderCol.statYearMonth)'>DESC</if>
, ,
</if> </if>
</trim> </trim>
......
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