SELECT 销售日期,员工, sum(销售额) AS 销售额, sum(预计销售) AS 预计销售, sum(销量) AS 销量, sum(预计销量) AS 预计销量 FROM 员工 sales WHERE 1 = 1 ${ IF ( datetype = "day", " and 销售日期 = 'today()'", "" )} --直接用 today写不可以 $ { IF ( datetype = "yesterday", " and 销售日期 = '2021-01-25'", "" )} $ { IF ( datetype = "week", " and 销售日期 >= '2021-01-25' and 销售日期 AND 区域 = '${area}' AND 门店 = '${shop}' GROUP BY 销售日期,员工 ORDER BY 销售额 DESC -------------------------------------------- 把上面的日期替换成 语句应该如何修改呀?展示效果如图 |