|
@@ -33,8 +33,9 @@ public class XxhTagManager {
|
|
@Autowired
|
|
@Autowired
|
|
private MobileRangeService mobileRangeService;
|
|
private MobileRangeService mobileRangeService;
|
|
|
|
|
|
|
|
+ final static long _STEP=22000000L;
|
|
/**
|
|
/**
|
|
- * 从etl表向 xxh表转化
|
|
|
|
|
|
+ * 从etl表向 xxh表转化 转化时 重复消除重复
|
|
* @param month 月份
|
|
* @param month 月份
|
|
*/
|
|
*/
|
|
private void xxhFromEtl(String month, String mobileLeft, String mobileRight) {
|
|
private void xxhFromEtl(String month, String mobileLeft, String mobileRight) {
|
|
@@ -45,7 +46,8 @@ public class XxhTagManager {
|
|
.appendLn("TOTAL_FLUX, TOTAL_FEE, ifNull(MON_TOTAL_FEE,'0') AS MON_TOTAL_FEE, PRODUCT_CLASS_DESC, null as MON_FEE, FLUX_M, RESOURCE_NAME,")
|
|
.appendLn("TOTAL_FLUX, TOTAL_FEE, ifNull(MON_TOTAL_FEE,'0') AS MON_TOTAL_FEE, PRODUCT_CLASS_DESC, null as MON_FEE, FLUX_M, RESOURCE_NAME,")
|
|
.appendLn("PKG_NAME, MANU_NAME, MODEL_NAME, IS_ACCT ,TOTAL_FLUX_VIDEO, AREA as ARAE")
|
|
.appendLn("PKG_NAME, MANU_NAME, MODEL_NAME, IS_ACCT ,TOTAL_FLUX_VIDEO, AREA as ARAE")
|
|
.appendLn(String.format("from %s",ETL_TABLE_NAME))
|
|
.appendLn(String.format("from %s",ETL_TABLE_NAME))
|
|
- .appendLn("where MONTH_ID ='"+month+"'" + lrMobileSql);
|
|
|
|
|
|
+ .appendLn("where MONTH_ID ='"+month+"'" + lrMobileSql)
|
|
|
|
+ .appendLn(String.format("and DEVICE_NUMBER not in (SELECT DEVICE_NUMBER from ads.XXH_ALL_MONTH where MONTH_ID ='%s' and SEARCH_FLAG in('b','B') %s)",month,lrMobileSql));
|
|
log.info("\n" + sqlBuilder.toString());
|
|
log.info("\n" + sqlBuilder.toString());
|
|
dynamicExecuteService.execute(DsEnum.clickhouse, sqlBuilder.toString(), "ETL导入数据转化为XXH基础数据1");
|
|
dynamicExecuteService.execute(DsEnum.clickhouse, sqlBuilder.toString(), "ETL导入数据转化为XXH基础数据1");
|
|
|
|
|
|
@@ -56,6 +58,7 @@ public class XxhTagManager {
|
|
.appendLn("from ")
|
|
.appendLn("from ")
|
|
.appendLn("( select MONTH_ID,DEVICE_NUMBER, APP_PRE, CON_PRE, APP_NAME, DAYS,TIMES,MINS,ifNull(ONE_FLUX,'0') as ONE_FLUX")
|
|
.appendLn("( select MONTH_ID,DEVICE_NUMBER, APP_PRE, CON_PRE, APP_NAME, DAYS,TIMES,MINS,ifNull(ONE_FLUX,'0') as ONE_FLUX")
|
|
.appendLn("from "+ETL_TABLE_NAME+" where MONTH_ID ='"+month+"'" + lrMobileSql)
|
|
.appendLn("from "+ETL_TABLE_NAME+" where MONTH_ID ='"+month+"'" + lrMobileSql)
|
|
|
|
+ .appendLn(String.format("and DEVICE_NUMBER not in (SELECT DEVICE_NUMBER from ads.XXH_ALL_MONTH where MONTH_ID ='%s' and SEARCH_FLAG in('b','B') %s)",month,lrMobileSql))
|
|
.appendLn(") s")
|
|
.appendLn(") s")
|
|
.appendLn("group by MONTH_ID,DEVICE_NUMBER, APP_PRE, CON_PRE, APP_NAME, TIMES, MINS, ONE_FLUX");
|
|
.appendLn("group by MONTH_ID,DEVICE_NUMBER, APP_PRE, CON_PRE, APP_NAME, TIMES, MINS, ONE_FLUX");
|
|
log.info("\n" + sqlBuilderApp.toString());
|
|
log.info("\n" + sqlBuilderApp.toString());
|
|
@@ -69,7 +72,7 @@ public class XxhTagManager {
|
|
* @param month 月份
|
|
* @param month 月份
|
|
*/
|
|
*/
|
|
public void xxhFromEtlSp(String month) {
|
|
public void xxhFromEtlSp(String month) {
|
|
- SortedSet<String> mobileList = mobileRangeService.getList(MobileRangeService.DEFAULT_STEP);
|
|
|
|
|
|
+ SortedSet<String> mobileList = mobileRangeService.getList(_STEP);
|
|
String mobileLeft = mobileList.first();
|
|
String mobileLeft = mobileList.first();
|
|
for(Iterator<String> it = mobileList.iterator(); it.hasNext(); ) {
|
|
for(Iterator<String> it = mobileList.iterator(); it.hasNext(); ) {
|
|
String mobileRight = it.next();
|
|
String mobileRight = it.next();
|
|
@@ -81,4 +84,6 @@ public class XxhTagManager {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+
|
|
|
|
+
|
|
}
|
|
}
|