@Select("<script> "+
"SELECT d.name as name,SUM(s.number) as `value`, t.tenant_name \n" +
"FROM blade_sales_data s LEFT JOIN blade_dishes d on s.dish_name=d.id \n" +
"LEFT JOIN blade_tenant t on s.tenant_id = t.tenant_id \n" +
"where s.is_deleted=0 " +
" <if test=\"tenantId != null and tenantId != '' \" >" +
" and s.tenant_id = #{tenantId}" +
" </if>" +
" <if test=\"goodsId != null and goodsId != '' \" >" +
" and s.goods_Id = #{goodsId}" +
" </if>" +
" <if test=\"storeId != null and storeId != '' \" >" +
" and s.store_Id = #{storeId}" +
" </if>" +
"GROUP BY s.dish_name\n" +
"order by SUM(s.number) desc"+
" </script>")
List<Echarts> list(Long tenantId,Long goodsId,Long storeId);
2.错误元素内容必须由格式正确的字符数据或标记组成解决
使用<![CDATA[ SQL语句 ]]> 将含有<、>、<=、>=的sql语句包含进去