填报表 事业参数设置:单选下拉,从其他系统传bg参数,控制显示什么,数据集为: with temp_table as ( select 'LCD' as bg_name union select 'OLED' as bg_name union select '核心部品' as bg_name union select '终端产品' as bg_name ) select bg_name from temp_table where 1=1 --and bg_name = ${bg} ${if(len(bg) == 0,"and 1=0","and bg_name in ("+"'"+replace(bg,',',"','")+"'"+")")} 三级科目依据事业筛选框联动,多选下拉,设置的数据集为: select distinct third_sub ,order_num from ods_finereport.to_qa_subject_cfg where second_sub ='外部损失' and data_source ='手工录入' and is_del = 'N' --${if(len(事业)=0, "" , "and gp_type in ('"+事业+"')")} ${if(len(bg) = 0,"and 1=2", "and gp_type in ('"+replace(bg,",","','")+"')")} ${if(len(事业) = 0,"", "and gp_type ='"+事业+"'")} order by order_num 四级科目根据三级科目以及事业筛选联动,设置的数据集为: select distinct forth_sub ,third_sub ,order_num from ods_finereport.to_qa_subject_cfg where second_sub ='外部损失' and data_source ='手工录入' and is_del = 'N' ${if(len(三级科目)=0, "" , "and third_sub in ('"+三级科目+"')")} ${if(len(bg) = 0,"and 1=2", "and gp_type in ('"+replace(bg,",","','")+"')")} ${if(len(事业) = 0,"", "and gp_type ='"+事业+"'")} order by order_num 但是选中四级科目,会清空三级科目的筛选,但是对事业筛选不会造成影响 |