这是我写的一个。这在select里面的。 ${if(p_type="product","product","")}
${if(p_type="product_category","product_category","")}
${if(p_type="product_family","product_family","")}
${if(p_type="product_big_category","product_big_category","")}
这是写在group by 后面的。
group by
expense_year,
${if(p_type="product","product","")}
${if(p_type="product_category","product_category","")}
${if(p_type="product_family","product_family","")}
${if(p_type="product_big_category","product_big_category","")}