数据集里面那两个的条件调整成下成的格式,就可以了
例如 A B 两个参数控件
那么就在where条件后面加上
${if(len(A)==0,""," and 字段1='"+A+"'")}
${if(len(B)==0,""," and 字段2='"+B+"'")}
select *
from (select a.*, b.dept_id, b.dept_alias
from [ bjchbi ] . [ dbo ] . [ dm_lab_busi_qty_tat_fact ] a,
dimdept b
where a.request_department_id = b.dept_id) c
where rport_date between '${sj1}' and '${sj2}'
${if(len(ks) == 0, "", "and c.dept_alias in ('" + ks + "')") }
${if(len(xmmc) == 0, "", "and c.project_name in ('" + xmmc + "')") }
${if(len(mzzy) == 0,"", "and c.encounter_type_id in ('" + mzzy + "')") }
${if(len(yxjb) == 0, "","and c.priority_indicator in ('" + yxjb + "')") }