当前位置: 首页 > news >正文

产品访问分析

1、DWD产品访问明细

1.1、用户产品权限数据

--用户产品权限数据INSERT OVERWRITE TABLE temp_lms.dm_lms_platform_usergroup_app_tmpselect '仓储司南'															as pro_name,'CCSN'															as pro_code,c.user_name													as user_name,d.account_name													as user_mip,c.org_name														as org_name,c.org_code														as org_code,case when c.org_name like '%_财经_%'										then '财经'when c.org_name like '%营销中心%'										then '营销中心'when c.org_name like '%产品中心%'										then '产品中心'when c.org_name like '%技术中心%'										then '技术中心'when c.org_name like '%营运与人力资源%'									then '营运与人力资源'when c.org_name like '%_运营本部_基地干线公司%'							then '基地干线公司'when c.org_name like '%_运营本部_城配送装公司%'							then '城配送装公司'when c.org_name like '%_运营本部_生产供应链系统工程公司%'						then '生产供应链系统工程公司'when c.org_name like '%_运营本部_订单与品质部%'							then '订单与品质部'when c.org_name like '%_运营本部_规划与变革部%'							then '规划与变革部'when c.org_name like '%_运营本部_仓储管理部%'								then '仓储管理部'when c.org_name like '%_运营本部_营运支持部%'								then '营运支持部'when c.org_name like '%_运营本部_运营管理部%'								then '运营管理部'when c.org_name like '%区' or c.org_name like '%京津冀'				then replace(c.org_name,'_集团_数字化创新业务_ANDE智联科技公司_区域经营中心_','')when c.org_name like '%分公司%' and c.org_name like '%京津冀%'			then regexp_replace(regexp_replace(c.org_name,'.*京津冀_',''),'分公司_.*','分公司')when c.org_name like '%分公司%'										then regexp_replace(regexp_replace(c.org_name,'.*区_',''),'分公司.*','分公司')when c.org_name like '%_运营本部_%'									then regexp_replace(replace(c.org_name,'_集团_数字化创新业务_ANDE智联科技公司_运营本部_',''),'_.*','')when c.org_name like '%_区域经营中心%'									then '区域经营中心'when c.org_name='_集团_数字化创新业务_ANDE智联科技公司'						then 'ANDE'else 'NO-ANNTO'end														as shortorg_name,case when c.org_name like '%_财经_%'										then '总部'when c.org_name like '%营销中心%'										then '总部'when c.org_name like '%产品中心%'										then '总部'when c.org_name like '%技术中心%'										then '总部'when c.org_name like '%营运与人力资源%'									then '总部'when c.org_name like '%_运营本部_基地干线公司%'							then '总部'when c.org_name like '%_运营本部_城配送装公司%'							then '总部'when c.org_name like '%_运营本部_生产供应链系统工程公司%'						then '总部'when c.org_name like '%_运营本部_订单与品质部%'							then '总部'when c.org_name like '%_运营本部_规划与变革部%'							then '总部'when c.org_name like '%_运营本部_仓储管理部%'								then '总部'when c.org_name like '%_运营本部_营运支持部%'								then '总部'when c.org_name like '%_运营本部_运营管理部%'								then '总部'when c.org_name like '%_区域经营中心_%'									then '分公司'when c.org_name='_集团_数字化创新业务_ANDE智联科技公司'						then 'ANDE'else '非ANDE'end														as org_catery,c.position_name												as position_name,a.gmt_create													as perm_time,case when a.gmt_create is not null then '是' else '否' end 		as is_perm,from_unixtime(unix_timestamp(), 'yyyy-MM-dd HH:mm:ss')			as w_insert_dt,current_date()													as period_wid           --统计日期from (select usergroup_id,user_id,min(gmt_create) as gmt_create from platform.yunbi_usergroup_member group by usergroup_id,user_id) aleft join platform.yunbi_usergroup b on a.usergroup_id=b.usergroup_idleft join platform.yunbi_user d on a.user_id=d.user_idleft join lms.logistics_auth_user_info c on d.account_name =c.user_code where b.usergroup_name like '%仓储司南%'union allselect '万象台'					as pro_name,'WXTYL'				as pro_code,c.user_name			as user_name,d.account_name			as user_mip,c.org_name				as org_name,c.org_code				as org_code,case when c.org_name like '%_财经_%'										then '财经'when c.org_name like '%营销中心%'										then '营销中心'when c.org_name like '%产品中心%'										then '产品中心'when c.org_name like '%技术中心%'										then '技术中心'when c.org_name like '%营运与人力资源%'									then '营运与人力资源'when c.org_name like '%_运营本部_基地干线公司%'							then '基地干线公司'when c.org_name like '%_运营本部_城配送装公司%'							then '城配送装公司'when c.org_name like '%_运营本部_生产供应链系统工程公司%'						then '生产供应链系统工程公司'when c.org_name like '%_运营本部_订单与品质部%'							then '订单与品质部'when c.org_name like '%_运营本部_规划与变革部%'							then '规划与变革部'when c.org_name like '%_运营本部_仓储管理部%'								then '仓储管理部'when c.org_name like '%_运营本部_营运支持部%'								then '营运支持部'when c.org_name like '%_运营本部_运营管理部%'								then '运营管理部'when c.org_name like '%区' or c.org_name like '%京津冀'				then replace(c.org_name,'_集团_数字化创新业务_ANDE智联科技公司_区域经营中心_','')when c.org_name like '%分公司%' and c.org_name like '%京津冀%'			then regexp_replace(regexp_replace(c.org_name,'.*京津冀_',''),'分公司_.*','分公司')when c.org_name like '%分公司%'										then regexp_replace(regexp_replace(c.org_name,'.*区_',''),'分公司.*','分公司')when c.org_name like '%_运营本部_%'									then regexp_replace(replace(c.org_name,'_集团_数字化创新业务_ANDE智联科技公司_运营本部_',''),'_.*','')when c.org_name like '%_区域经营中心%'									then '区域经营中心'when c.org_name='_集团_数字化创新业务_ANDE智联科技公司'						then 'ANDE'else '非ANDE'end             as shortorg_name,case when c.org_name like '%_财经_%'										then '总部'when c.org_name like '%营销中心%'										then '总部'when c.org_name like '%产品中心%'										then '总部'when c.org_name like '%技术中心%'										then '总部'when c.org_name like '%营运与人力资源%'									then '总部'when c.org_name like '%_运营本部_基地干线公司%'							then '总部'when c.org_name like '%_运营本部_城配送装公司%'							then '总部'when c.org_name like '%_运营本部_生产供应链系统工程公司%'						then '总部'when c.org_name like '%_运营本部_订单与品质部%'							then '总部'when c.org_name like '%_运营本部_规划与变革部%'							then '总部'when c.org_name like '%_运营本部_仓储管理部%'								then '总部'when c.org_name like '%_运营本部_营运支持部%'								then '总部'when c.org_name like '%_运营本部_运营管理部%'								then '总部'		  when c.org_name like '%_区域经营中心_%'									then '分公司'when c.org_name='_集团_数字化创新业务_ANDE智联科技公司'						then 'ANDE'else '非ANDE'end														as org_catery,c.position_name												as position_name,a.gmt_create													as perm_time,case when a.gmt_create is not null then '是' else '否' end		as is_perm,from_unixtime(unix_timestamp(), 'yyyy-MM-dd HH:mm:ss')			as w_insert_dt,current_date()													as period_wid           --统计日期from (select usergroup_id,user_id,min(gmt_create) as gmt_create from platform.yunbi_usergroup_member group by usergroup_id,user_id) aleft join platform.yunbi_usergroup b on a.usergroup_id=b.usergroup_idleft join platform.yunbi_user d on a.user_id=d.user_idleft join lms.logistics_auth_user_info c on a.user_id =c.user_code where b.usergroup_name like '%万象台%'union all select '智慧星'                as pro_name,'ZHXCJ'              as pro_code,c.user_name          as user_name,d.account_name       as user_mip,c.org_name           as org_name,c.org_code           as org_code,case when c.org_name like '%_财经_%'									then '财经'when c.org_name like '%营销中心%'									then '营销中心'when c.org_name like '%产品中心%'									then '产品中心'when c.org_name like '%技术中心%'									then '技术中心'when c.org_name like '%营运与人力资源%'								then '营运与人力资源'when c.org_name like '%_运营本部_基地干线公司%'          				then '基地干线公司'when c.org_name like '%_运营本部_城配送装公司%'          				then '城配送装公司'when c.org_name like '%_运营本部_生产供应链系统工程公司%'					then '生产供应链系统工程公司'when c.org_name like '%_运营本部_订单与品质部%'          				then '订单与品质部'when c.org_name like '%_运营本部_规划与变革部%'          				then '规划与变革部'when c.org_name like '%_运营本部_仓储管理部%'            				then '仓储管理部'when c.org_name like '%_运营本部_营运支持部%'            				then '营运支持部'when c.org_name like '%_运营本部_运营管理部%'            				then '运营管理部'		  when c.org_name like '%区' or c.org_name like '%京津冀'			then replace(c.org_name,'_集团_数字化创新业务_ANDE智联科技公司_区域经营中心_','')when c.org_name like '%分公司%' and c.org_name like '%京津冀%'		then regexp_replace(regexp_replace(c.org_name,'.*京津冀_',''),'分公司_.*','分公司')when c.org_name like '%分公司%'									then regexp_replace(regexp_replace(c.org_name,'.*区_',''),'分公司.*','分公司')when c.org_name like '%_运营本部_%'								then regexp_replace(replace(c.org_name,'_集团_数字化创新业务_ANDE智联科技公司_运营本部_',''),'_.*','')when c.org_name like '%_区域经营中心%'								then '区域经营中心'when c.org_name='_集团_数字化创新业务_ANDE智联科技公司'					then 'ANDE'else '非ANDE'end             as shortorg_name,case when c.org_name like '%_财经_%'									then '总部'when c.org_name like '%营销中心%'									then '总部'when c.org_name like '%产品中心%'									then '总部'when c.org_name like '%技术中心%'									then '总部'when c.org_name like '%营运与人力资源%'								then '总部'when c.org_name like '%_运营本部_基地干线公司%'						then '总部'when c.org_name like '%_运营本部_城配送装公司%'						then '总部'when c.org_name like '%_运营本部_生产供应链系统工程公司%'					then '总部'when c.org_name like '%_运营本部_订单与品质部%'						then '总部'when c.org_name like '%_运营本部_规划与变革部%'						then '总部'when c.org_name like '%_运营本部_仓储管理部%'							then '总部'when c.org_name like '%_运营本部_营运支持部%'							then '总部'when c.org_name like '%_运营本部_运营管理部%'							then '总部'when c.org_name like '%_区域经营中心_%'								then '分公司'when c.org_name='_集团_数字化创新业务_ANDE智联科技公司'					then 'ANDE'else '非ANDE'end														as org_catery,c.position_name												as position_name,a.gmt_create													as perm_time,case when a.gmt_create is not null then '是' else '否' end 		as is_perm,from_unixtime(unix_timestamp(), 'yyyy-MM-dd HH:mm:ss')			as w_insert_dt,current_date()													as period_wid           --统计日期
from (select usergroup_id,user_id,min(gmt_create) as gmt_create from platform.yunbi_usergroup_member group by usergroup_id,user_id) aleft join platform.yunbi_usergroup b on a.usergroup_id=b.usergroup_idleft join platform.yunbi_user d on a.user_id=d.user_idleft join lms.logistics_auth_user_info c on a.user_id =c.user_code where b.usergroup_name like '%智慧星-经营分析角色%' or b.usergroup_name in ('智慧星-项目盈利分析角色','智慧星-白名单角色')union all select '管理报表'              as pro_name,'ZHXGL'              as pro_code,c.user_name          as user_name,d.account_name       as user_mip,c.org_name           as org_name,c.org_code           as org_code,case when c.org_name like '%_财经_%'									then '财经'when c.org_name like '%营销中心%'									then '营销中心'when c.org_name like '%产品中心%'									then '产品中心'when c.org_name like '%技术中心%'									then '技术中心'when c.org_name like '%营运与人力资源%'								then '营运与人力资源'when c.org_name like '%_运营本部_基地干线公司%'							then '基地干线公司'when c.org_name like '%_运营本部_城配送装公司%'							then '城配送装公司'when c.org_name like '%_运营本部_生产供应链系统工程公司%'						then '生产供应链系统工程公司'when c.org_name like '%_运营本部_订单与品质部%'							then '订单与品质部'when c.org_name like '%_运营本部_规划与变革部%'							then '规划与变革部'when c.org_name like '%_运营本部_仓储管理部%'							then '仓储管理部'when c.org_name like '%_运营本部_营运支持部%'							then '营运支持部'when c.org_name like '%_运营本部_运营管理部%'							then '运营管理部'		when c.org_name like '%区' or c.org_name like '%京津冀'				then replace(c.org_name,'_集团_数字化创新业务_ANDE智联科技公司_区域经营中心_','')when c.org_name like '%分公司%' and c.org_name like '%京津冀%'		then regexp_replace(regexp_replace(c.org_name,'.*京津冀_',''),'分公司_.*','分公司')when c.org_name like '%分公司%'									then regexp_replace(regexp_replace(c.org_name,'.*区_',''),'分公司.*','分公司')when c.org_name like '%_运营本部_%'									then regexp_replace(replace(c.org_name,'_集团_数字化创新业务_ANDE智联科技公司_运营本部_',''),'_.*','')when c.org_name like '%_区域经营中心%'								then '区域经营中心'when c.org_name='_集团_数字化创新业务_ANDE智联科技公司'					then 'ANDE'else '非ANDE'end             as shortorg_name,case when c.org_name like '%_财经_%'									then '总部'when c.org_name like '%营销中心%'      								then '总部'when c.org_name like '%产品中心%'      								then '总部'when c.org_name like '%技术中心%'      								then '总部'when c.org_name like '%营运与人力资源%'								then '总部'when c.org_name like '%_运营本部_基地干线公司%'							then '总部'when c.org_name like '%_运营本部_城配送装公司%'							then '总部'when c.org_name like '%_运营本部_生产供应链系统工程公司%'						then '总部'when c.org_name like '%_运营本部_订单与品质部%'							then '总部'when c.org_name like '%_运营本部_规划与变革部%'							then '总部'when c.org_name like '%_运营本部_仓储管理部%'							then '总部'when c.org_name like '%_运营本部_营运支持部%'							then '总部'when c.org_name like '%_运营本部_运营管理部%'							then '总部'when c.org_name like '%_区域经营中心_%'								then '分公司'when c.org_name='_集团_数字化创新业务_ANDE智联科技公司'					then 'ANDE'else '非ANDE'end															as org_catery,c.position_name												as position_name,a.gmt_create													as perm_time,case when a.gmt_create is not null then '是' else '否' end 		as is_perm,from_unixtime(unix_timestamp(), 'yyyy-MM-dd HH:mm:ss')			as w_insert_dt,current_date()													as period_wid           --统计日期from (select usergroup_id,user_id,min(gmt_create) as gmt_create from platform.yunbi_usergroup_member group by usergroup_id,user_id) aleft join platform.yunbi_usergroup b on a.usergroup_id=b.usergroup_idleft join platform.yunbi_user d on a.user_id=d.user_idleft join lms.logistics_auth_user_info c on a.user_id =c.user_codewhere b.usergroup_name like '%智慧星-管报%'union all select'摘星台'                as pro_name,'ZXTCP'              as pro_code,ui.user_name         as user_name,ui.user_code         as user_code,ui.org_name          as org_name,ui.org_code          as org_code,case when ui.org_name like '%_财经_%'										then '财经'when ui.org_name like '%营销中心%'											then '营销中心'when ui.org_name like '%产品中心%'											then '产品中心'when ui.org_name like '%技术中心%'											then '技术中心'when ui.org_name like '%营运与人力资源%'										then '营运与人力资源'when ui.org_name like '%_运营本部_基地干线公司%'									then '基地干线公司'when ui.org_name like '%_运营本部_城配送装公司%'									then '城配送装公司'when ui.org_name like '%_运营本部_生产供应链系统工程公司%'							then '生产供应链系统工程公司'when ui.org_name like '%_运营本部_订单与品质部%'									then '订单与品质部'when ui.org_name like '%_运营本部_规划与变革部%'									then '规划与变革部'when ui.org_name like '%_运营本部_仓储管理部%'									then '仓储管理部'when ui.org_name like '%_运营本部_营运支持部%'									then '营运支持部'when ui.org_name like '%_运营本部_运营管理部%'									then '运营管理部'when ui.org_name like '%区' or ui.org_name like '%京津冀'					then replace(ui.org_name,'_集团_数字化创新业务_ANDE智联科技公司_区域经营中心_','')when ui.org_name like '%分公司%' and ui.org_name like '%京津冀%'				then regexp_replace(regexp_replace(ui.org_name,'.*京津冀_',''),'分公司_.*','分公司')when ui.org_name like '%分公司%'											then regexp_replace(regexp_replace(ui.org_name,'.*区_',''),'分公司.*','分公司')when ui.org_name like '%_运营本部_%'										then regexp_replace(replace(ui.org_name,'_集团_数字化创新业务_ANDE智联科技公司_运营本部_',''),'_.*','')when ui.org_name like '%_区域经营中心%'										then '区域经营中心'when ui.org_name='_集团_数字化创新业务_ANDE智联科技公司'							then 'ANDE'else '非ANDE'end              as shortorg_name,case when ui.org_name like '%_财经_%'										then '总部'when ui.org_name like '%营销中心%'											then '总部'when ui.org_name like '%产品中心%'											then '总部'when ui.org_name like '%技术中心%'											then '总部'when ui.org_name like '%营运与人力资源%'										then '总部'when ui.org_name like '%_运营本部_基地干线公司%'									then '总部'when ui.org_name like '%_运营本部_城配送装公司%'									then '总部'when ui.org_name like '%_运营本部_生产供应链系统工程公司%'							then '总部'when ui.org_name like '%_运营本部_订单与品质部%'									then '总部'when ui.org_name like '%_运营本部_规划与变革部%'									then '总部'when ui.org_name like '%_运营本部_仓储管理部%'									then '总部'when ui.org_name like '%_运营本部_营运支持部%'									then '总部'when ui.org_name like '%_运营本部_运营管理部%'									then '总部'when ui.org_name like '%_区域经营中心_%'										then '分公司'when ui.org_name='_集团_数字化创新业务_ANDE智联科技公司'							then 'ANDE'else '非ANDE'end               as org_catery,ui.position_name     as position_name,ur.create_time        as perm_time,case when ur.create_time is not null then '是' else '否' end		as is_perm,from_unixtime(unix_timestamp(), 'yyyy-MM-dd HH:mm:ss')			as w_insert_dt,current_date()													as period_wid           --统计日期from  (select role_codefrom lms.logistics_auth_role where delete_flag=0 and enable_flag=1 and role_name in ( '线长维度-管理岗','线长规则维护') group by role_code) r
inner join  (select role_code from lms.logistics_auth_role_application --APP编码where application_code='APP201904250002') ra  on r.role_code=ra.role_code
inner join  (select role_code,user_code,min(create_time) as create_time  from lms.logistics_auth_user_role where delete_flag = 0 and tenant_code ='annto' and enable_flag=1group by  role_code,user_code) ur on r.role_code =ur.role_code
inner join  (select org_code,org_name,user_code,user_name,position_name from lms.logistics_auth_user_info where delete_flag=0) ui on ur.user_code = ui.user_codeunion all select '北极星'																as pro_name,'ACCSX'															as pro_code,ui.user_name														as user_name,ui.user_code														as user_code,ui.org_name														as org_name,ui.org_code														as org_code,case when ui.org_name like '%_财经_%'										then '财经'when ui.org_name like '%营销中心%'											then '营销中心'when ui.org_name like '%产品中心%'											then '产品中心'when ui.org_name like '%技术中心%'											then '技术中心'when ui.org_name like '%营运与人力资源%'										then '营运与人力资源'when ui.org_name like '%_运营本部_基地干线公司%'									then '基地干线公司'when ui.org_name like '%_运营本部_城配送装公司%'									then '城配送装公司'when ui.org_name like '%_运营本部_生产供应链系统工程公司%'							then '生产供应链系统工程公司'when ui.org_name like '%_运营本部_订单与品质部%'									then '订单与品质部'when ui.org_name like '%_运营本部_规划与变革部%'									then '规划与变革部'when ui.org_name like '%_运营本部_仓储管理部%'									then '仓储管理部'when ui.org_name like '%_运营本部_营运支持部%'									then '营运支持部'when ui.org_name like '%_运营本部_运营管理部%'									then '运营管理部'when ui.org_name like '%区' or ui.org_name like '%京津冀'					then replace(ui.org_name,'_集团_数字化创新业务_ANDE智联科技公司_区域经营中心_','')when ui.org_name like '%分公司%' and ui.org_name like '%京津冀%'				then regexp_replace(regexp_replace(ui.org_name,'.*京津冀_',''),'分公司_.*','分公司')when ui.org_name like '%分公司%'											then regexp_replace(regexp_replace(ui.org_name,'.*区_',''),'分公司.*','分公司')when ui.org_name like '%_运营本部_%'										then regexp_replace(replace(ui.org_name,'_集团_数字化创新业务_ANDE智联科技公司_运营本部_',''),'_.*','')when ui.org_name like '%_区域经营中心%'										then '区域经营中心'when ui.org_name='_集团_数字化创新业务_ANDE智联科技公司'							then 'ANDE'else '非ANDE'end																as shortorg_name,case when ui.org_name like '%_财经_%'										then '总部'when ui.org_name like '%营销中心%'											then '总部'when ui.org_name like '%产品中心%'											then '总部'when ui.org_name like '%技术中心%'											then '总部'when ui.org_name like '%营运与人力资源%'										then '总部'when ui.org_name like '%_运营本部_基地干线公司%'									then '总部'when ui.org_name like '%_运营本部_城配送装公司%'									then '总部'when ui.org_name like '%_运营本部_生产供应链系统工程公司%'							then '总部'when ui.org_name like '%_运营本部_订单与品质部%'									then '总部'when ui.org_name like '%_运营本部_规划与变革部%'									then '总部'when ui.org_name like '%_运营本部_仓储管理部%'									then '总部'when ui.org_name like '%_运营本部_营运支持部%'									then '总部'when ui.org_name like '%_运营本部_运营管理部%'									then '总部'when ui.org_name like '%_区域经营中心_%'										then '分公司'when ui.org_name='_集团_数字化创新业务_ANDE智联科技公司'							then 'ANDE'else '非ANDE'end																as org_catery,ui.position_name													as position_name,ur.create_time														as perm_time,case when ur.create_time is not null then '是' else '否' end   		as is_perm,from_unixtime(unix_timestamp(), 'yyyy-MM-dd HH:mm:ss')				as w_insert_dt,current_date()														as period_wid           --统计日期from  (select role_codefrom lms.logistics_auth_rolewhere delete_flag=0 and enable_flag=1 and role_name in ('ACC管理中心-业务','ACC-时效看板','ACC-指标中心','ACC-管理员') group by role_code) r
inner join (select role_code from lms.logistics_auth_role_application --APP编码where application_code='APP202303160047') ra  on ra.role_code=r.role_code
inner join  (select role_code,user_code,min(create_time) as create_time  from lms.logistics_auth_user_role where delete_flag = 0 and enable_flag=1 and tenant_code ='annto'group by role_code,user_code) ur on r.role_code =ur.role_code
inner join  (select org_code,org_name,user_code,user_name,position_name from lms.logistics_auth_user_info where delete_flag=0) ui on ur.user_code = ui.user_codeunion all select'驾驶舱'               	as pro_name             --产品名称,'U-MCP'                as pro_code             --产品编码,a.user_name            as user_name            --姓名,a.user_code            as user_mip             -- MIP,a.department_name      as org_name             --部门名称,a.department_code      as org_code             --部门编码,a.shortorg_name        as shortorg_name        --部门简称,a.org_catery           as org_catery           --部门分类,a.position_name        as position_name        --岗位,min(a.valid_time)      as perm_time            -- 授权时间,'是'                   as is_perm               -- 是否有权限,from_unixtime(unix_timestamp(), 'yyyy-MM-dd HH:mm:ss')     as w_insert_dt,a.period_wid           as period_wid           --统计日期from  
(select user_name,user_code,department_name,department_code,case when department_name like '%_财经_%'									then '财经'when department_name like '%营销中心%'										then '营销中心'when department_name like '%产品中心%'										then '产品中心'when department_name like '%技术中心%'										then '技术中心'when department_name like '%营运与人力资源%'									then '营运与人力资源'when department_name like '%_运营本部_基地干线公司%'								then '基地干线公司'when department_name like '%_运营本部_城配送装公司%'								then '城配送装公司'when department_name like '%_运营本部_生产供应链系统工程公司%'						then '生产供应链系统工程公司'when department_name like '%_运营本部_订单与品质部%'								then '订单与品质部'when department_name like '%_运营本部_规划与变革部%'								then '规划与变革部'when department_name like '%_运营本部_仓储管理部%'								then '仓储管理部'when department_name like '%_运营本部_营运支持部%'								then '营运支持部'when department_name like '%_运营本部_运营管理部%'								then '运营管理部'when department_name like '%区' or department_name like '%京津冀'			then replace(department_name,'_集团_数字化创新业务_ANDE智联科技公司_区域经营中心_','')when department_name like '%分公司%' and department_name like '%京津冀%'		then regexp_replace(regexp_replace(department_name,'.*京津冀_',''),'分公司_.*','分公司')when department_name like '%分公司%'										then regexp_replace(regexp_replace(department_name,'.*区_',''),'分公司.*','分公司')when department_name like '%_运营本部_%'									then regexp_replace(replace(department_name,'_集团_数字化创新业务_ANDE智联科技公司_运营本部_',''),'_.*','')when department_name like '%_区域经营中心%'									then '区域经营中心'when department_name='_集团_数字化创新业务_ANDE智联科技公司'						then 'ANDE'else '非ANDE'end                  as shortorg_name,case when department_name like '%_财经_%'									then '总部'when department_name like '%营销中心%'										then '总部'when department_name like '%产品中心%'										then '总部'when department_name like '%技术中心%'										then '总部'when department_name like '%营运与人力资源%'									then '总部'when department_name like '%_运营本部_基地干线公司%'								then '总部'when department_name like '%_运营本部_城配送装公司%'								then '总部'when department_name like '%_运营本部_生产供应链系统工程公司%'						then '总部'when department_name like '%_运营本部_订单与品质部%'								then '总部'when department_name like '%_运营本部_规划与变革部%'								then '总部'when department_name like '%_运营本部_仓储管理部%'								then '总部'when department_name like '%_运营本部_营运支持部%'								then '总部'when department_name like '%_运营本部_运营管理部%'								then '总部'when department_name like '%_区域经营中心_%'									then '分公司'when department_name='_集团_数字化创新业务_ANDE智联科技公司'						then 'ANDE'else '非ANDE'end                  as org_catery,main_position           as position_name,valid_time              as valid_time,period_wid              as period_wid,(case when role_code='RL2022042820140' and (is_area+is_company+is_center+is_professional_comp+is_transaction_type+is_big_industry+is_customer)=7        then '有效用户' --客户画像需具备7个维度数据权限when role_code<>'RL2022042820140' and (is_area+is_company+is_center+is_professional_comp+is_transaction_type+is_big_industry)=6                      then '有效用户' --非客户画像且具备6个维度数据权限when role_code in ('RL2022052725507','RL2022052725508','RL2022052725509') and (is_area+is_company+is_center)=3                                       then '有效用户' -- 责任制得分:权限控制只有片区+分公司+经营中心when role_code in ('RL2022090946149','RL2022090946147') and (is_company+is_center)=2                                                                 then '有效用户' -- 销售空仓率:权限控制只有分公司+经营中心when role_code in ('RL2022052725501','RL2022052725502','RL2022052725504') and is_center=1                                                            then '有效用户' -- 时长监控:权限控制只有经营中心权限when role_code='RL2022061729550' and (is_area+is_company+is_professional_comp+is_transaction_type+is_big_industry)=5                                 then '有效用户' -- 无经营中心维度:商机全流程when role_code='RL2022031013212' and (is_company+is_center+is_professional_comp+is_transaction_type+is_big_industry)=5                               then '有效用户' -- 逾期应收:无片区维度权限控制when role_code='RL2022031013213' and (is_company+is_center+is_transaction_type+is_big_industry)=4                                                    then '有效用户' -- 开票回款:无片区维度和专司维度权限控制when role_code in ('RL2022111158820','RL2022111860264') and (is_area+is_company+is_center+is_transaction_type+is_big_industry)=5                     then '有效用户' -- 无专司维度:资金周期when role_code in ('RL2022093050616','RL202306010842','RL202305180644') and (is_area+is_company+is_transaction_type+is_big_industry)=4               then '有效用户' -- 既无经营中心维度又无专司维度:投标毛利偏差、合同续签、营销个人销售达成 else '缺数据权限' end) as user_typefrom dm_lms.dm_mcp_valid_user_dtlwhere 1=1 and delete_flag=0and role_name not like '%_annto'and role_code<>'RL202112153873' --剔除掉IT-ANDE驾驶舱and role_code<>'RL2022123067721' --剔除掉付款额度and user_code not in ('qianglei1','liangpf','zhangyuan65','xuanjm1','wangpc18') --剔除IT用户and period_wid<substr(to_date(current_timestamp()),1,10))a where a.user_type='有效用户'group by a.user_name,a.user_code,a.department_name,a.department_code,a.shortorg_name,a.org_catery,a.position_name,a.period_wid;

1.2、用户产品权限数据去重

--用户产品权限数据去重INSERT OVERWRITE TABLE temp_lms.dm_lms_platform_usergroup_app_dist_tmpselect pro_name                                         --产品名称,pro_code                                         --产品编码,user_name                                        --姓名,user_mip                                         --MIP,org_name                                         --部门名称,org_code                                         --部门编码,shortorg_name                                    --部门简称,org_catery                                       --部门分类,position_name                                    --岗位,substr(perm_time,1,10) as perm_time              --授权日期,is_perm                                          --是否有权限,from_unixtime(unix_timestamp(), 'yyyy-MM-dd HH:mm:ss')   as w_insert_dt --数据插入时间,period_wid           							  --统计日期fromtemp_lms.dm_lms_platform_usergroup_app_tmpwhere user_mip is not nullgroup by pro_name                                         --产品名称,pro_code                                         --产品编码,user_name                                        --姓名,user_mip                                         --MIP,org_name                                         --部门名称,org_code                                         --部门编码,shortorg_name                                    --部门简称,org_catery                                       --部门分类,position_name                                    --岗位,substr(perm_time,1,10)                           --授权日期,is_perm                                          --是否有权限,period_wid           							  --统计日期;

1.3、产品访问数据

--产品访问数据INSERT OVERWRITE TABLE temp_lms.dm_lms_platform_app_visit_tmpselectmip_code    							                 as user_mip      --MIP,'仓储司南'                                                  as pro_name      --产品名称,'CCSN'                                                  as pro_code      --产品编码,report_name							                 as visit_menu	  --访问菜单,report_name							                 as visit_table   --访问报表,case when star_dt is not null then '是' else '否' end     as is_visit      --是否有访问,substr(star_dt,1,10)                                    as visit_time    --访问日期时间,from_unixtime(unix_timestamp(), 'yyyy-MM-dd HH:mm:ss')  as w_insert_dt   --数据插入时间fromplatform.ads_user_qbi_visit_log
where 1=1 --star_dt >= '2024-01-01'and mip_code is not nulland portal_name = '仓储司南'and workspace_name = '安得'and star_dt >= '${START_DATE}'and star_dt <  '${END_DATE}'union all selectmip_code    							                 as user_mip      --MIP,'万象台'                                                   as pro_name      --产品名称,'WXTYL'                                                 as pro_code      --产品编码,report_name							                 as visit_menu	  --访问菜单,report_name							                 as visit_table   --访问报表,case when star_dt is not null then '是' else '否' end     as is_visit    --是否有访问,substr(star_dt,1,10)                                    as visit_time    --访问日期时间,from_unixtime(unix_timestamp(), 'yyyy-MM-dd HH:mm:ss')  as w_insert_dt   --数据插入时间fromplatform.ads_user_qbi_visit_log
where 1=1 --star_dt >= '2024-01-01'and mip_code is not nulland portal_name like '%万象台%'and workspace_name = '安得'and star_dt >= '${START_DATE}'and star_dt <  '${END_DATE}'union all selectmip_code    							                 as user_mip      --MIP,'智慧星'                                                   as pro_name      --产品名称,'ZHXCJ'                                                 as pro_code      --产品编码,report_name							                 as visit_menu	  --访问菜单,report_name							                 as visit_table   --访问报表,case when star_dt is not null then '是' else '否' end   as is_visit      --是否有访问,substr(star_dt,1,10)                                    as visit_time    --访问日期时间,from_unixtime(unix_timestamp(), 'yyyy-MM-dd HH:mm:ss')  as w_insert_dt --数据插入时间fromplatform.ads_user_qbi_visit_log 
where 1=1 --star_dt >= '2024-01-01'and mip_code is not nulland portal_name = '智慧星'and workspace_name = '安得'and report_name in ('整体经营达成情况_整体分析', '整体经营达成情况_分公司分析', '整体经营达成情况_经营中心分析', '整体经营达成情况_片区分析', '采购毛利_分公司分析', '采购毛利_经营中心分析', '采购毛利率预算_经营中心', '采购毛利率预算_专司', '采购毛利率预算_行业', '销售预测', '智慧星', '整体经营达成情况', '经营中心利润明细', '客户经营中心利润', '采购毛利', '月累计采购毛利波动分析', '年累计采购毛利波动分析', '毛利明细', '客户毛利', '采购毛利率预算', '收入预算', '收入成本明细')and star_dt >= '${START_DATE}'and star_dt <  '${END_DATE}'union all selectmip_code    							                 as user_mip      --MIP,'管理报表'                                                  as pro_name    --产品名称,'ZHXGL'                                                 as pro_code      --产品编码,report_name							                 as visit_menu	  --访问菜单,report_name							                 as visit_table   --访问报表,case when star_dt is not null then '是' else '否' end   as is_visit      --是否有访问,substr(star_dt,1,10)                                    as visit_time    --访问日期时间,from_unixtime(unix_timestamp(), 'yyyy-MM-dd HH:mm:ss')  as w_insert_dt --数据插入时间fromplatform.ads_user_qbi_visit_log 
where 1=1 --star_dt >= '2024-01-01'and mip_code is not nulland portal_name='智慧星'and workspace_name='安得'and (report_name='管理报表' or report_name='管报')and star_dt >= '${START_DATE}'and star_dt <  '${END_DATE}'union all selectusername    							                  as user_mip      --MIP,'摘星台'                                                    as pro_name    --产品名称,'ZXTCP'                                                  as pro_code      --产品编码,model_name1							                  as visit_menu	   --访问菜单,model_name2							                  as visit_table   --访问报表,case when part_dt is not null then '是' else '否' end    as is_visit      --是否有访问,part_dt                                                  as visit_time    --访问日期时间,from_unixtime(unix_timestamp(), 'yyyy-MM-dd HH:mm:ss')   as w_insert_dt --数据插入时间fromdm.dm_sys_product_visit_detail_log_jt
where 1=1 --part_dt >= '2024-01-01'and username is not null and module_code_en like '%C-TMS%'and model_name1 like '%摘星台%'and part_dt >= '${START_DATE}'and part_dt <  '${END_DATE}'union all select  username                                                  as user_mip      --MIP,'北极星'                                                     as pro_name    --产品名称,'ACCSX'                                                   as pro_code      --产品编码,model_name1                                               as visit_menu	--访问菜单,model_name2                                               as visit_table   --访问报表,case when part_dt is not null then '是' else '否' end     as is_visit      --是否有访问,part_dt                                                   as visit_time    --访问日期时间,from_unixtime(unix_timestamp(), 'yyyy-MM-dd HH:mm:ss')    as w_insert_dt --数据插入时间
from dm.dm_sys_product_visit_detail_log_jt
where 1=1 --part_dt >='2024-01-01'and username is not null and module_code_en like '%U-ACC%'and model_name1 in('首页','指标中心','个性报表','配置化报表','时效看板')and part_dt >= '${START_DATE}'and part_dt <  '${END_DATE}'union all select a.user_code                                               as user_mip      --MIP,'驾驶舱'                                                    as pro_name    --产品名称,'U-MCP'                                                   as pro_code      --产品编码,a.active_index                                            as visit_menu	--访问菜单,''                                                        as visit_table   --访问报表,'是'                                                       as is_visit      --是否有访问,a.period_wid                                              as visit_time    -- 访问日期,from_unixtime(unix_timestamp(), 'yyyy-MM-dd HH:mm:ss')    as w_insert_dt   --数据插入时间FROM 
(select period_wid,user_code,(case when page_L3='驾驶舱-送装' then '送装专题'when page_L3='专题' or (page_L3='指标库' and page_L4='' and page_L5='日月年筛选框') then '客户画像' when (page_L6 is not null and page_L6<>'') or (page_L5 is not null and page_L5<>'') then if((page_L4='' or page_L4 is null),if(page_L5 like '%收入%','收入','指标汇总'),page_L4)when (page_L4 is not null and page_L4<>'') or (page_L3 is not null and page_L3<>'') then page_L3else '指标汇总' end) as active_indexfrom dm_lms.dm_mcp_log_trck_bsc_byte_dtl_diwhere 1=1 
--      and period_wid>='2024-01-01' and event_name<>'app_launch'and period_wid >= '${START_DATE}'and period_wid <  '${END_DATE}'group by period_wid,user_code,(case when page_L3='驾驶舱-送装' then '送装专题'when page_L3='专题' or (page_L3='指标库' and page_L4='' and page_L5='日月年筛选框') then '客户画像' when (page_L6 is not null and page_L6<>'') or (page_L5 is not null and page_L5<>'') then if((page_L4='' or page_L4 is null),if(page_L5 like '%收入%','收入','指标汇总'),page_L4)when (page_L4 is not null and page_L4<>'') or (page_L3 is not null and page_L3<>'') then page_L3else '指标汇总' end)
) a 
left join 
( 	select a.period_wid, a.user_code, (case when role_name like '责任制时效%' or role_name like '时长监控%' then '时长监控'when role_name like '责任制得分%' then '责任制得分'when role_name like '销售空仓率%' then '销售空仓率'when role_name like '送装专题%' then '送装专题'when role_name like '客户画像%' then '客户画像'when role_name='营销个人销售达成' then '个人销售达成'when role_name='付款额度' then '资金周期'when role_name='采购毛利率' then '采购毛利'else role_name end) as index_namefrom dm_lms.dm_mcp_valid_user_dtl awhere 1=1 and delete_flag=0and role_name not like '%_annto'and role_code<>'RL202112153873' --剔除掉IT-安得驾驶舱and role_code<>'RL2022123067721' --剔除掉付款额度and user_code not in ('qianglei1','liangpf','zhangyuan65','xuanjm1','wangpc18') and (case when a.role_code='RL2022042820140' and is_area+is_company+is_center+is_professional_comp+is_transaction_type+is_big_industry+is_customer=7 then 1=1 --客户画像需具备7个维度数据权限when a.role_code<>'RL2022042820140' and is_area+is_company+is_center+is_professional_comp+is_transaction_type+is_big_industry=6 then 1=1 --非客户画像且具备6个维度数据权限when a.role_code in ('RL2022052725507','RL2022052725508','RL2022052725509') and is_area+is_company+is_center=3 then 1=1 -- 责任制得分:权限控制只有片区+分公司+经营中心when a.role_code in ('RL2022090946149','RL2022090946147') and is_company+is_center=2 then 1=1 -- 销售空仓率:权限控制只有分公司+经营中心when a.role_code in ('RL2022052725501','RL2022052725502','RL2022052725504') and is_center=1 then 1=1 -- 时长监控:权限控制只有经营中心权限when a.role_code='RL2022061729550' and is_area+is_company+is_professional_comp+is_transaction_type+is_big_industry=5 then 1=1 -- 无经营中心维度:商机全流程when a.role_code='RL2022031013212' and is_company+is_center+is_professional_comp+is_transaction_type+is_big_industry=5 then 1=1 -- 逾期应收:无片区维度权限控制when a.role_code='RL2022031013213' and is_company+is_center+is_transaction_type+is_big_industry=4 then 1=1 -- 开票回款:无片区维度和专司维度权限控制when a.role_code in ('RL2022111158820','RL2022111860264') and is_area+is_company+is_center+is_transaction_type+is_big_industry=5 then 1=1 -- 无专司维度:资金周期when a.role_code in ('RL2022093050616','RL202306010842','RL202305180644') and is_area+is_company+is_transaction_type+is_big_industry=4 then 1=1 -- 既无经营中心维度又无专司维度:投标毛利偏差、合同续签、营销个人销售达成 else 1=0 end)group by a.period_wid, a.user_code, (case when role_name like '责任制时效%' or role_name like '时长监控%' then '时长监控'when role_name like '责任制得分%' then '责任制得分'when role_name like '销售空仓率%' then '销售空仓率'when role_name like '送装专题%' then '送装专题'when role_name like '客户画像%' then '客户画像'when role_name='营销个人销售达成' then '个人销售达成'when role_name='付款额度' then '资金周期'when role_name='采购毛利率' then '采购毛利'else role_name end)
)b on a.period_wid=b.period_wid and a.user_code=b.user_code and b.index_name=a.active_index
where b.user_code is not null;

1.4、产品访问数据去重

--产品访问数据去重INSERT OVERWRITE TABLE temp_lms.dm_lms_platform_app_visit_dist_tmpselectuser_mip,pro_name                --产品名称,pro_code                --产品编码,visit_menu              --访问菜单,visit_table             --访问报表,is_visit                --是否有访问,visit_time              --访问日期,from_unixtime(unix_timestamp(), 'yyyy-MM-dd HH:mm:ss')   as w_insert_dt --数据插入时间fromtemp_lms.dm_lms_platform_app_visit_tmpwhere user_mip is not nullgroup by user_mip,pro_name                --产品名称,pro_code                --产品编码,visit_menu              --访问菜单,visit_table             --访问报表,is_visit                --是否有访问,visit_time              --访问日期;

1.5、产品访问数据明细临时表

--产品访问数据明细insert overwrite table temp_lms.dwd_lms_app_visit_detail_di_tmpselectp.pro_name                                                                                       --产品名称,p.pro_code                                                                                       --产品编码,p.user_name                                                                                      --姓名,p.user_mip                                                                                       --MIP,p.org_name                                                                                       --部门名称,p.org_code                                                                                       --部门编码,p.shortorg_name                                                                                  --部门简称,p.org_catery                                                                                     --部门分类,p.position_name                                                                                  --岗位,p.perm_time                                                                                      --授权日期,case when substr(p.perm_time,1,10)<=substr(f.part_dt,1,10) then '是' else '否' end as  is_perm     --是否有权限,v.visit_menu                                                                                     --访问菜单,v.visit_table                                                                                    --访问报表,case when v.visit_time is not null then '是' else '否' end as is_visit                             --是否有访问,f.part_dt                                                                                        --访问日期   ,from_unixtime(unix_timestamp(), 'yyyy-MM-dd HH:mm:ss')   as w_insert_dt                          --数据插入时间,f.part_dt						  						  as period_wid							  --统计日期from (select pro_name                                         --产品名称,pro_code                                         --产品编码,user_name                                        --姓名,user_mip                                         --MIP,org_name                                         --部门名称,org_code                                         --部门编码,shortorg_name                                    --部门简称,org_catery                                       --部门分类,position_name                                    --岗位,substr(perm_time,1,10) as perm_time              --授权日期,is_perm                                          --是否有权限,period_wid           							  --统计日期fromtemp_lms.dm_lms_platform_usergroup_app_dist_tmpwhere pro_name <> '驾驶舱' and pro_code <> 'U-MCP') pjoin (select period_wid as part_dt from dm_lms.dm_bi_dashboard_business_kpi_dim_date_dimension where period_wid >='${START_DATE}' and period_wid < '${END_DATE}') f
on 1=1left join (selectuser_mip,pro_name                --产品名称,pro_code                --产品编码,visit_menu              --访问菜单,visit_table             --访问报表,is_visit                --是否有访问,visit_time              --访问日期fromtemp_lms.dm_lms_platform_app_visit_dist_tmp) von  f.part_dt=v.visit_timeand p.user_mip=v.user_mip and p.pro_code=v.pro_code and p.pro_name=v.pro_nameunion allselectp.pro_name                                                                                       --产品名称,p.pro_code                                                                                       --产品编码,p.user_name                                                                                      --姓名,p.user_mip                                                                                       --MIP,p.org_name                                                                                       --部门名称,p.org_code                                                                                       --部门编码,p.shortorg_name                                                                                  --部门简称,p.org_catery                                                                                     --部门分类,p.position_name                                                                                  --岗位,p.perm_time                                                                                      --授权日期,'是' as  is_perm     																			  --是否有权限,v.visit_menu                                                                                     --访问菜单,v.visit_table                                                                                    --访问报表,case when v.visit_time is not null then '是' else '否' end as is_visit                             --是否有访问,v.visit_time                                                                                     --访问日期   ,from_unixtime(unix_timestamp(), 'yyyy-MM-dd HH:mm:ss')   as w_insert_dt                          --数据插入时间,p.period_wid											  as period_wid							  --统计日期from 	(select pro_name                                         --产品名称,pro_code                                         --产品编码,user_name                                        --姓名,user_mip                                         --MIP,org_name                                         --部门名称,org_code                                         --部门编码,shortorg_name                                    --部门简称,org_catery                                       --部门分类,position_name                                    --岗位,substr(perm_time,1,10) as perm_time              --授权日期,is_perm                                          --是否有权限,period_wid           							  --统计日期fromtemp_lms.dm_lms_platform_usergroup_app_dist_tmpwhere pro_name = '驾驶舱' and pro_code = 'U-MCP') pleft join (selectuser_mip,pro_name                --产品名称,pro_code                --产品编码,visit_menu              --访问菜单,visit_table             --访问报表,is_visit                --是否有访问,visit_time              --访问日期fromtemp_lms.dm_lms_platform_app_visit_dist_tmp) von  p.period_wid=v.visit_timeand p.user_mip=v.user_mip and p.pro_code=v.pro_code and p.pro_name=v.pro_name;

1.6、产品访问数据明细

--产品访问数据明细insert overwrite table dwd_lms.dwd_lms_app_visit_detail_di_p partition(part_dt)select pro_name                                       --产品名称,pro_code                                       --产品编码,user_name                                      --姓名,user_mip                                       --MIP,org_name                                       --部门名称,org_code                                       --部门编码,shortorg_name                                  --部门简称,org_catery                                     --部门分类,position_name                                  --岗位,perm_time                                      --授权日期,is_perm                                        --是否有权限,visit_menu                                     --访问菜单,visit_table                                    --访问报表,is_visit                                       --是否有访问,visit_time                                     --访问日期,period_wid           							--统计日期,from_unixtime(unix_timestamp(), 'yyyy-MM-dd HH:mm:ss')                as w_insert_dt     --数据更新时间,substr(period_wid,1,7)			                                       as part_dt		  --日期分区from temp_lms.dwd_lms_app_visit_detail_di_tmp aunion all select pro_name                                       --产品名称,pro_code                                       --产品编码,user_name                                      --姓名,user_mip                                       --MIP,org_name                                       --部门名称,org_code                                       --部门编码,shortorg_name                                  --部门简称,org_catery                                     --部门分类,position_name                                  --岗位,perm_time                                      --授权日期,is_perm                                        --是否有权限,visit_menu                                     --访问菜单,visit_table                                    --访问报表,is_visit                                       --是否有访问,visit_time                                     --访问日期,period_wid           							--统计日期,w_insert_dt									--数据更新时间,part_dt										--日期分区
from dwd_lms.dwd_lms_app_visit_detail_di_p b left anti join (select org_code,pro_code,substr(period_wid,1,7) as visit_timefrom temp_lms.dwd_lms_app_visit_detail_di_tmp group by org_code,pro_code,substr(period_wid,1,7)) c on     b.pro_code=c.pro_codeand b.org_code =c.org_codeand b.part_dt=c.visit_time;

2、DWS产品访问数据

2.1、产品访问数据月去重

--产品访问数据月去重insert overwrite table temp_lms.dws_lms_app_visit_summary_month_tmpselect pro_name                                       --产品名称,pro_code                                       --产品编码,user_name                                      --姓名,user_mip                                       --IP,org_name                                       --部门名称,org_code                                       --部门编码,shortorg_name                                  --部门简称,org_catery                                     --部门分类,position_name                                  --岗位,perm_time                                      --授权日期,is_perm                                        --是否有权限,is_visit                                       --是否有访问,visit_time                                     --日期,from_unixtime(unix_timestamp(), 'yyyy-MM-dd HH:mm:ss')    as w_insert_dt     --数据更新时间
from (select pro_name                                       --产品名称,pro_code                                       --产品编码,user_name                                      --姓名,user_mip                                       --IP,org_name                                       --部门名称,org_code                                       --部门编码,shortorg_name                                  --部门简称,org_catery                                     --部门分类,position_name                                  --岗位,perm_time                                      --授权日期,is_perm                                        --是否有权限,is_visit                                       --是否有访问,substr(period_wid,1,7)   as visit_time         --日期,row_number() over(partition by pro_name,pro_code,user_mip,org_name,org_code order by period_wid) rnfrom dwd_lms.dwd_lms_app_visit_detail_di_pwhere part_dt >= substr('${START_DATE}',1,7)and part_dt <= substr('${END_DATE}',1,7)
) v
where rn > 1;

2.2、日汇总产品访问

--日汇总产品访问insert overwrite table temp_lms.dws_lms_app_visit_summary_tmpselect pro_name                                                                     --产品名称,pro_code                                                                     --产品编码,org_name                                                                     --部门名称,org_code                                                                     --部门编码,shortorg_name                                                                --部门简称,org_catery                                                                   --部门分类,count(distinct case when is_perm ='是' then user_mip end)  as perm_total      --权限人数,count(distinct case when is_visit='是' then user_mip end)  as visit_total     --访问人数,visit_time                                                as part_dt         --日期,from_unixtime(unix_timestamp(), 'yyyy-MM-dd HH:mm:ss')    as w_insert_dt     --数据更新时间from temp_lms.dws_lms_app_visit_summary_month_tmpwhere is_perm ='是'group by pro_name,pro_code,org_name,org_code,shortorg_name,org_catery,visit_time;

2.3、合并数据,将数据回写到目标表

--合并数据,将数据回写到目标表insert overwrite table dws_lms.dws_lms_app_visit_summary_di_pselect a.pro_name           --产品名称,a.pro_code           --产品编码,a.org_name           --部门名称,a.org_code           --部门编码,a.shortorg_name      --部门简称,a.org_catery         --部门分类,a.perm_total         --权限人数,a.visit_total        --访问人数,a.part_dt            --日期,from_unixtime(unix_timestamp(), 'yyyy-MM-dd HH:mm:ss') as w_insert_dt
from temp_lms.dws_lms_app_visit_summary_tmp a union all select b.pro_name          --产品名称,b.pro_code          --产品编码,b.org_name          --部门名称,b.org_code          --部门编码,b.shortorg_name     --部门简称,b.org_catery        --部门分类,b.perm_total        --权限人数,b.visit_total       --访问人数,b.part_dt           --日期,b.w_insert_dt       --数据更新时间from dws_lms.dws_lms_app_visit_summary_di_p bleft anti join (select pro_code,part_dt,org_code from temp_lms.dws_lms_app_visit_summary_tmp group by pro_code,part_dt,org_code) c on     b.part_dt=c.part_dtand b.pro_code=c.pro_codeand b.org_code =c.org_code;

相关文章:

产品访问分析

1、DWD产品访问明细 1.1、用户产品权限数据 --用户产品权限数据INSERT OVERWRITE TABLE temp_lms.dm_lms_platform_usergroup_app_tmpselect 仓储司南 as pro_name,CCSN as pro_code,c.user_name as user_name,d.account_name …...

【算法】代码随想录之链表(更新中)

文章目录 前言 一、移除链表元素&#xff08;LeetCode--203&#xff09; 前言 跟随代码随想录&#xff0c;学习链表相关的算法题目&#xff0c;记录学习过程中的tips。 一、移除链表元素&#xff08;LeetCode--203&#xff09; 【1】题目描述&#xff1a; 【2】解决思想&am…...

react 18中,使用useRef 获取其他组件的dom并操作节点,flushSync强制同步更新useState

React 不允许组件访问其他组件的 DOM 节点。甚至自己的子组件也不行&#xff01;这是故意的。Refs 是一种脱围机制&#xff0c;应该谨慎使用。手动操作 另一个 组件的 DOM 节点会使你的代码更加脆弱。 相反&#xff0c;想要 暴露其 DOM 节点的组件必须选择该行为。一个组件可以…...

Jupyter Notebook基础:用IPython实现动态编程

Jupyter Notebook基础&#xff1a;用IPython实现动态编程 1. 引言 Jupyter Notebook是一个基于Web的交互式计算环境&#xff0c;允许用户创建和共享包含实时代码、方程式、可视化和文本叙述的文档。它广泛应用于数据清洗与转换、数值模拟、统计建模、机器学习以及其他数据科学…...

Python 爬虫:使用打码平台来识别各种验证码:

本课程使用的是 超级鹰 打码平台&#xff0c; 没有账户的请自行注册&#xff01; 超级鹰验证码识别-专业的验证码云端识别服务,让验证码识别更快速、更准确、更强大 使用打码平台来攻破验证码难题&#xff0c; 是很简单容易的&#xff0c; 但是要钱&#xff01; 案例代码及测…...

理解算法复杂度:空间复杂度详解

引言 在计算机科学中&#xff0c;算法复杂度是衡量算法效率的重要指标。时间复杂度和空间复杂度是算法复杂度的两个主要方面。在这篇博客中&#xff0c;我们将深入探讨空间复杂度&#xff0c;了解其定义、常见类型以及如何进行分析。空间复杂度是衡量算法在执行过程中所需内存…...

浅析Kafka Streams消息流式处理流程及原理

以下结合案例&#xff1a;统计消息中单词出现次数&#xff0c;来测试并说明kafka消息流式处理的执行流程 Maven依赖 <dependencies><dependency><groupId>org.apache.kafka</groupId><artifactId>kafka-streams</artifactId><exclusio…...

QGroundControl的总体架构,模块化设计和主要组件的功能。

QGroundControl 总体架构详细描述 QGroundControl (QGC) 作为一个开源地面控制站软件&#xff0c;其设计原则是模块化、高扩展性和高可维护性。 总体架构 QGroundControl 由多个层次构成&#xff0c;每个层次负责不同的功能。这种分层结构确保了系统的高内聚性和低耦合性。 …...

oracle 表空间文件迁移

表空间文件迁移 背景 由于各种原因&#xff0c;在实际工作中可能会出现oracle服务器数据盘空间被占满的情况&#xff0c;这个时候单纯的添加新磁盘&#xff0c;后续表空间文件放新盘的方案已经不适用了&#xff0c;因为源盘已经占用满了&#xff0c;数据库服务会异常&#xf…...

JVM学习(day1)

JVM 运行时数据区 线程共享&#xff1a;方法区、堆 线程独享&#xff08;与个体“同生共死”&#xff09;&#xff1a;虚拟机栈、本地方法栈、程序计数器 程序计数器 作用&#xff1a;记录下次要执行的代码行的行号 特点&#xff1a;为一个没有OOM&#xff08;内存溢出&a…...

js项目生产环境中移除 console

1、terser-webpack-plugin webpack 构建的项目中安装使用 安装&#xff1a; npm install terser-webpack-plugin --save-dev 配置 在webpack.config.js文件中 new TerserPlugin({terserOptions: {output: {comments: false, // 去除注释},warnings: false, // 去除黄色警告,co…...

ROS2 + 科大讯飞 初步实现机器人语音控制

环境配置&#xff1a; 电脑端&#xff1a; ubuntu22.04实体机作为上位机 ROS版本&#xff1a;ros2-humble 实体机器人&#xff1a; STM32 思岚A1激光雷达 科大讯飞语音SDK 讯飞开放平台-以语音交互为核心的人工智能开放平台 实现步骤&#xff1a; 1. 下载和处理科大讯飞语音模…...

HTML5新增的input元素属性:placeholder、required、autofocus、min、max等

HTML5 大幅度地增加与改良了 input 元素的属性&#xff0c;可以简单地使用这些属性来实现 HTML5 之前需要使用 JavaScript 才能实现的许多功能。 下面将详细介绍这些新增的 input 元素的属性。 属性说明属性说明placeholder在输入框显示描述性或提示性文本autocomplete是否保…...

Cornerstone3D导致浏览器崩溃的踩坑记录

WebGL: CONTEXT_LOST_WEBGL: loseContext: context lost ⛳️ 问题描述 在使用vue3vite重构Cornerstone相关项目后&#xff0c;在Mac本地运行良好&#xff0c;但是部署测试环境后&#xff0c;在window系统的Chrome浏览器中切换页面会导致页面崩溃。查看Chrome的任务管理器&am…...

【鸿蒙学习笔记】Stage模型

官方文档&#xff1a;Stage模型开发概述 目录标题 Stage模型好处Stage模型概念图ContextAbilityStageUIAbility组件和ExtensionAbility组件WindowStage Stage模型-组件模型Stage模型-进程模型Stage模型-ArkTS线程模型和任务模型关于任务模型&#xff0c;我们先来了解一下什么是…...

Docker进入MongoDB

先是命令行开启docker镜像&#xff0c;然后进入docker镜像&#xff0c;这是两步 进入之后&#xff0c;开头会变成root&#xff0c;我的理解是进入了另一个linux系统了&#xff0c;直接执行相应的软件 这里直接use databse就是进入了&#xff0c;据说MongoDB是慢启动&#xff0c…...

APP与API:魔法世界的咒语与念咒者

1. 什么是API&#xff1f; API&#xff0c;即应用程序编程接口&#xff08;Application Programming Interface&#xff09;&#xff0c;就像是魔法世界中的咒语。API是两个独立软件系统之间进行通信和数据交换的桥梁。通过API&#xff0c;一个软件系统可以调用另一个软件系统中…...

云计算安全需求分析与安全保护工程

云计算基本概念 云计算&#xff08;Cloud Computing&#xff09;是一种通过互联网提供计算资源和服务的技术。它允许用户按需访问和使用计算资源&#xff0c;如服务器、存储、数据库、网络、安全、分析和软件应用等&#xff0c;而无需管理底层基础设施。以下是云计算的基本概念…...

七天.NET 8操作SQLite入门到实战 - 第二天 在 Windows 上配置 SQLite环境

前言 SQLite的一个重要的特性是零配置的、无需服务器&#xff0c;这意味着不需要复杂的安装或管理。它跟微软的Access差不多&#xff0c;只是一个.db格式的文件。但是与Access不同的是&#xff0c;它不需要安装任何软件&#xff0c;非常轻巧。 七天.NET 8操作SQLite入门到实战…...

操作系统——进程的状态与转换

...

LBE-LEX系列工业语音播放器|预警播报器|喇叭蜂鸣器的上位机配置操作说明

LBE-LEX系列工业语音播放器|预警播报器|喇叭蜂鸣器专为工业环境精心打造&#xff0c;完美适配AGV和无人叉车。同时&#xff0c;集成以太网与语音合成技术&#xff0c;为各类高级系统&#xff08;如MES、调度系统、库位管理、立库等&#xff09;提供高效便捷的语音交互体验。 L…...

多模态2025:技术路线“神仙打架”,视频生成冲上云霄

文&#xff5c;魏琳华 编&#xff5c;王一粟 一场大会&#xff0c;聚集了中国多模态大模型的“半壁江山”。 智源大会2025为期两天的论坛中&#xff0c;汇集了学界、创业公司和大厂等三方的热门选手&#xff0c;关于多模态的集中讨论达到了前所未有的热度。其中&#xff0c;…...

多场景 OkHttpClient 管理器 - Android 网络通信解决方案

下面是一个完整的 Android 实现&#xff0c;展示如何创建和管理多个 OkHttpClient 实例&#xff0c;分别用于长连接、普通 HTTP 请求和文件下载场景。 <?xml version"1.0" encoding"utf-8"?> <LinearLayout xmlns:android"http://schemas…...

【磁盘】每天掌握一个Linux命令 - iostat

目录 【磁盘】每天掌握一个Linux命令 - iostat工具概述安装方式核心功能基础用法进阶操作实战案例面试题场景生产场景 注意事项 【磁盘】每天掌握一个Linux命令 - iostat 工具概述 iostat&#xff08;I/O Statistics&#xff09;是Linux系统下用于监视系统输入输出设备和CPU使…...

测试markdown--肇兴

day1&#xff1a; 1、去程&#xff1a;7:04 --11:32高铁 高铁右转上售票大厅2楼&#xff0c;穿过候车厅下一楼&#xff0c;上大巴车 &#xffe5;10/人 **2、到达&#xff1a;**12点多到达寨子&#xff0c;买门票&#xff0c;美团/抖音&#xff1a;&#xffe5;78人 3、中饭&a…...

【OSG学习笔记】Day 16: 骨骼动画与蒙皮(osgAnimation)

骨骼动画基础 骨骼动画是 3D 计算机图形中常用的技术&#xff0c;它通过以下两个主要组件实现角色动画。 骨骼系统 (Skeleton)&#xff1a;由层级结构的骨头组成&#xff0c;类似于人体骨骼蒙皮 (Mesh Skinning)&#xff1a;将模型网格顶点绑定到骨骼上&#xff0c;使骨骼移动…...

什么?连接服务器也能可视化显示界面?:基于X11 Forwarding + CentOS + MobaXterm实战指南

文章目录 什么是X11?环境准备实战步骤1️⃣ 服务器端配置(CentOS)2️⃣ 客户端配置(MobaXterm)3️⃣ 验证X11 Forwarding4️⃣ 运行自定义GUI程序(Python示例)5️⃣ 成功效果![在这里插入图片描述](https://i-blog.csdnimg.cn/direct/55aefaea8a9f477e86d065227851fe3d.pn…...

pikachu靶场通关笔记22-1 SQL注入05-1-insert注入(报错法)

目录 一、SQL注入 二、insert注入 三、报错型注入 四、updatexml函数 五、源码审计 六、insert渗透实战 1、渗透准备 2、获取数据库名database 3、获取表名table 4、获取列名column 5、获取字段 本系列为通过《pikachu靶场通关笔记》的SQL注入关卡(共10关&#xff0…...

学习STC51单片机32(芯片为STC89C52RCRC)OLED显示屏2

每日一言 今天的每一份坚持&#xff0c;都是在为未来积攒底气。 案例&#xff1a;OLED显示一个A 这边观察到一个点&#xff0c;怎么雪花了就是都是乱七八糟的占满了屏幕。。 解释 &#xff1a; 如果代码里信号切换太快&#xff08;比如 SDA 刚变&#xff0c;SCL 立刻变&#…...

3-11单元格区域边界定位(End属性)学习笔记

返回一个Range 对象&#xff0c;只读。该对象代表包含源区域的区域上端下端左端右端的最后一个单元格。等同于按键 End 向上键(End(xlUp))、End向下键(End(xlDown))、End向左键(End(xlToLeft)End向右键(End(xlToRight)) 注意&#xff1a;它移动的位置必须是相连的有内容的单元格…...