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

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

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