Authored by DengXinFei

联盟激活添加按总数排序

... ... @@ -25,6 +25,7 @@
<result column="union_name" property="unionName" jdbcType="VARCHAR"/>
<result column="idfa_count" property="idfaCount" jdbcType="INTEGER"/>
<result column="imei_count" property="imeiCount" jdbcType="INTEGER"/>
<result column="total_count" property="totalCount" jdbcType="INTEGER"/>
</resultMap>
<resultMap id="YHActivateMap" type="com.yoho.service.model.union.response.YHActivateDeviceIdRspBO">
<result column="union_type" property="unionType" jdbcType="VARCHAR"/>
... ... @@ -148,7 +149,7 @@
</select>
<select id="selectListByParam" resultMap="ActivateMap"
parameterType="com.yoho.service.model.union.request.ActivateDeviceIdReqBO">
select union_type,union_name,count(idfa) as idfa_count,count(imei) as imei_count
select union_type,union_name,count(*) as total_count, count(idfa) as idfa_count,count(imei) as imei_count
from union_logs
where 1=1
<if test="interfaceType != null and interfaceType !='' ">
... ... @@ -164,7 +165,7 @@
and union_type = #{unionType}
</if>
group by union_type
order by count(idfa) desc,count(imei) desc
order by count(*) desc,count(idfa) desc
</select>
<select id="matchIdfa" resultMap="BaseResultMap">
select
... ...
... ... @@ -623,11 +623,11 @@ public class UnionServiceImpl implements IUnionService,ApplicationEventPublisher
//(1).查询出各渠道激活的设备id数
List<ActivateDeviceIdRspBO> activateDeviceIdRspList = unionLogsDAO.selectListByParam(activateDeviceIdReqBO);
if(null != activateDeviceIdRspList && activateDeviceIdRspList.size() > 0){
for(ActivateDeviceIdRspBO rspBO: activateDeviceIdRspList){
rspBO.setTotalCount(rspBO.getIdfaCount() + rspBO.getImeiCount());
}
}
// if(null != activateDeviceIdRspList && activateDeviceIdRspList.size() > 0){
// for(ActivateDeviceIdRspBO rspBO: activateDeviceIdRspList){
// rspBO.setTotalCount(rspBO.getIdfaCount() + rspBO.getImeiCount());
// }
// }
// int total = unionLogsDAO.selectListCountByParam(activateDeviceIdReqBO);
// if(total>0){
// activateDeviceIdRspList = unionLogsDAO.selectListByParam(activateDeviceIdReqBO);
... ...