查询今日数据
date_format(a.date,'%Y-%m-%d') = #{date}
查询上月数据
(select date_format(DATE_SUB(a.date, INTERVAL 0 MONTH), '%Y-%m')) =
(select date_format(DATE_SUB(curdate(), INTERVAL 1 MONTH), '%Y-%m'))
查询本月数据
(select date_format(DATE_SUB(a.date, INTERVAL 0 MONTH), '%Y-%m')) =
(select date_format(DATE_SUB(curdate(), INTERVAL 0 MONTH), '%Y-%m'))