Authored by linlong

update

... ... @@ -169,9 +169,12 @@
group by union_type
</select>
<select id="queryActivateIdfaCount" resultType="java.lang.Integer" parameterType="com.yoho.service.model.union.request.ActivateDeviceIdReqBO">
select count(idfa)
select count(1)
from union_click_logs
where union_type = #{unionType} and idfa!=''
where union_type = #{unionType}
<if test="interfaceType == null or interfaceType =='' ">
and interface_type in ('addUnion_ios','addUnion4Jump_ios','addMonitor_ios')
</if>
<if test="interfaceType != null and interfaceType !='' ">
and interface_type=#{interfaceType}
</if>
... ... @@ -181,9 +184,12 @@
group by union_type
</select>
<select id="queryActivateImeiCount" resultType="java.lang.Integer" parameterType="com.yoho.service.model.union.request.ActivateDeviceIdReqBO">
select count(imei)
select count(1)
from union_click_logs
where union_type = #{unionType} and imei!=''
where union_type = #{unionType}
<if test="interfaceType == null or interfaceType =='' ">
and interface_type in ('addUnion_android','addUnion4Jump_android','addMonitor_android')
</if>
<if test="interfaceType != null and interfaceType !='' ">
and interface_type=#{interfaceType}
</if>
... ...
... ... @@ -41,6 +41,7 @@ import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.net.URLDecoder;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.LinkedBlockingQueue;
... ... @@ -109,6 +110,15 @@ public class UnionServiceImpl implements IUnionService,ApplicationEventPublisher
@Resource(name="unionServiceImpl")
IUnionService unionService;
public final static List<String> IOS_INTERFACE_LIST = new ArrayList<String>(){{
add("addUnion_ios");add("addUnion4Jump_ios");add("addMonitor_ios");
}};
public final static List<String> ANDROID_INTERFACE_LIST = new ArrayList<String>(){{
add("addUnion_android");add("addUnion4Jump_android");add("addMonitor_android");
}};
/**
* 默认10个线程,
*/
... ... @@ -607,10 +617,16 @@ public class UnionServiceImpl implements IUnionService,ApplicationEventPublisher
String dateStr = activateDeviceIdReqBO.getActivateTime().replaceAll("-","/");
activateDeviceIdReqBO.setActivateTimeStr(DateUtils.getTimesmorning(dateStr));
}
if(activateDeviceIdReqBO.getIsIdfa()>0){
count = unionClickLogsDAO.queryActivateIdfaCount(activateDeviceIdReqBO);
if(activateDeviceIdReqBO.getIsIdfa()>0 ){
//ios查询时,接口为全部或者是ios接口才查询
if(IOS_INTERFACE_LIST.contains(activateDeviceIdReqBO.getInterfaceType())||StringUtils.isEmpty(activateDeviceIdReqBO.getInterfaceType())){
count = unionClickLogsDAO.queryActivateIdfaCount(activateDeviceIdReqBO);
}
}else{
count = unionClickLogsDAO.queryActivateImeiCount(activateDeviceIdReqBO);
//android查询时,接口为全部或者是android接口才查询
if(StringUtils.isEmpty(activateDeviceIdReqBO.getInterfaceType())|| ANDROID_INTERFACE_LIST.contains(activateDeviceIdReqBO.getInterfaceType())){
count = unionClickLogsDAO.queryActivateImeiCount(activateDeviceIdReqBO);
}
}
log.info("out queryActivateCount.count={}", count);
return count;
... ...