SQL写法和控件的起始分隔符问题
一、描述
二、步骤
ds1
select
tempalte.类别名称,
temp.产品名称,
sum(te.数量) as 销售数量
from
订单明细 te left join 产品 temp on te.产品ID = temp.产品ID
left join 产品类别 tempalte on tempalte.类别ID = temp.类别ID
where 1=1
${if(len(sort) == 0,"","and tempalte.类别名称 in ('" + sort + "')")}
${if(len(name) == 0,"","and temp.产品名称 in ('" + name + "')")}
group by temp.产品名称
ds2-产品类别
select 类别名称 from 产品类别
where 1 = 1
${if(len(sort) == 0,"","and empalte.类别名称 in ('" + sort + "')")}
group by 类别名称
ds3-产品名称
select
temp.产品名称
from 产品类别 te left join 产品 temp on te.类别ID = temp.类别ID
where 1 = 1
${if(len(sort) == 0,"","and te.类别名称 in ('" +sort+ "')")}
细节注意
最后在设置两个条件属性就可以了 公式
row()%2 ==1
C2 >= 1000