select id,day,sum(n )from data where 1=1
${if(cx == 0,"and id = '" + jg + "'","and id in ('"+SUBSTITUTE(jg,",","','")+"')")}
group by id,day
其中参数cx是单选框组,jg是下拉框
为什么实现不了功能
select id,day,sum(n) from data where 1=1
${if(LEN(cx) == 0,"and id = '" + jg + "'","and id in ('"+SUBSTITUTE(jg,",","','")+"')")}
${if(len(cx) == 0,"and id = '" + jg + "'"," and id in ('"+SUBSTITUTE(jg,",","','")+"')")}
用SUBSTITUTE影响计算效率,按照下面的改一下试试
${if(cx == 0,"","and id in ('"+jg+"')")}