select distinct 品类,sum(aexp_w+aexp_n)/10000 as '加税合计' from V_LUJJ_SAL_mt where 1=1 and 月份 = replace('${ny}','-','') ${if(len(zzmc) == 0,"","and 组织简称 = '" + zzmc + "'")} ${if(len(pl) == 0,"","and 品类 = '" + pl + "'")} ${if(len(dq) == 0||dq = "中国","","and 省 = '" + dq + "'")} ${if(len(dq) == 0||dq = "中国","","and 城市 = '" + dq + "'")} ${if(len(dq) == 0||dq = "中国","","and 区县 = '" + dq + "'")} group by 品类 如何写这个where条件,根据参数dq不同,显示各层级(中国,省,城市,区县)的数据? |