场景洞察0217需求
2025-03-03 19:03:51 0 举报
AI智能生成
场景洞察0217需求
作者其他创作
大纲/内容
1、原有接口改造(原有key、value返回基础上增加表名table_name返回)
前端点击某个echarts后,新增实时返回mid数组接口
入参:作为3.1接口入参
tableName
fieldName:注意接口返回key可能与表字段名不对应,例如:车生活分布中字段car_ecosystem_car_prduct与carProduct
fieldValue
注意:<>未知、is not null、common_conditions公有查询条件等情况
2、多级联动
以性别为例:
select user_sex as `key`, count(distinct mid) as `value`
from iceberg_zjyprc_hadoop.mi_car.ads_usr_profile_crowd_data_di
<include refid="common_conditions"/>
and user_sex <![CDATA[ <> ]]> '未知'
group by user_sex
order by case user_sex
when '男' then 1
when '女' then 2
else 3
end
select user_sex as `key`, count(distinct mid) as `value`
from iceberg_zjyprc_hadoop.mi_car.ads_usr_profile_crowd_data_di
<include refid="common_conditions"/>
and user_sex <![CDATA[ <> ]]> '未知'
group by user_sex
order by case user_sex
when '男' then 1
when '女' then 2
else 3
end
select user_sex as `key`, count(distinct mid) as `value`
from iceberg_zjyprc_hadoop.mi_car.ads_usr_profile_crowd_data_di
<if test="tableName != null and tableName != ''">
INNER JOIN tableName ON tableName.mid = iceberg_zjyprc_hadoop.mid
</if>
WHERE 1=1
<if test="tableName != null and tableName != ''">
and tableName.#{fieldName} = #{fieldValue}
</if>
<include refid="common_conditions"/>
and user_sex <![CDATA[ <> ]]> '未知'
group by user_sex
order by case user_sex
when '男' then 1
when '女' then 2
else 3
end
from iceberg_zjyprc_hadoop.mi_car.ads_usr_profile_crowd_data_di
<if test="tableName != null and tableName != ''">
INNER JOIN tableName ON tableName.mid = iceberg_zjyprc_hadoop.mid
</if>
WHERE 1=1
<if test="tableName != null and tableName != ''">
and tableName.#{fieldName} = #{fieldValue}
</if>
<include refid="common_conditions"/>
and user_sex <![CDATA[ <> ]]> '未知'
group by user_sex
order by case user_sex
when '男' then 1
when '女' then 2
else 3
end
3、同步至人群管理
3.1、前端传入联动勾选的mid数组
示例:[
["111111", "222222"],
["33333", "444444"]
]
["111111", "222222"],
["33333", "444444"]
]
3.2、job_id后端生成
3.3、联动时点击的查询条件
示例:{
"dataType": "Leads",
"channelName": [],
"cityNameList": [],
"activityNameList": [],
"shopNameList": [],
"startDate": 1738368000000,
"endDate": 1740960000000,
"linkageCondition": [{
"tableName": "aaa",
"fieldName": "user_sex",
"fieldValue": "男",
"linkageSort": 1
}, {
"tableName": "bbb",
"fieldName": "car_ecosystem_car_prduct",
"fieldValue": "轻量棒球帽",
"linkageSort": 2
}]
}
"dataType": "Leads",
"channelName": [],
"cityNameList": [],
"activityNameList": [],
"shopNameList": [],
"startDate": 1738368000000,
"endDate": 1740960000000,
"linkageCondition": [{
"tableName": "aaa",
"fieldName": "user_sex",
"fieldValue": "男",
"linkageSort": 1
}, {
"tableName": "bbb",
"fieldName": "car_ecosystem_car_prduct",
"fieldValue": "轻量棒球帽",
"linkageSort": 2
}]
}

收藏
0 条评论
下一页