dominikruan(提问者) 回复 Z4u3z1oracle 贴了
select t.company,sum(t.amount) amount,count(t.class) class
from INPUT_PP_SECURITY t
where 1=1
${if(len(csdate)==0,\"\",\"and substr(t.CDATE,1,7) >= \'\"+csdate+\"\'\")}
${if(len(cedate)==0,\"\",\"and substr(t.CDATE,1,7) <= \'\"+cedate+\"\'\")}
${if(len(com)== 0,\"\",\"and t.company = \'\" + com + \"\'\")}
and t.class in (0,1,2)
group by t.company
order by t.company asc