数据集使用between and查询月份之间的数据,结果查询的结果不包含起始月份的,比如我查询的时间段是2020-06到2020-12,结果出来的数据是从2020-07到2020-12。 数据集脚本: select a.* from ( (SELECT lcfwkkd_month_x lcfwkkd,'线网' AS line, date_format( selectDate, '%Y-%m' ) selectDate FROM tb_company_month_service) )a where 1=1 ${if(len(dateEditor9) == 0,""," and a.selectDate BETWEEN '" + dateEditor9 + "'")} ${if(len(dateEditor10) == 0,""," AND '" + dateEditor10 + "'")} order by a.selectDate asc,a.line 在mysql中单独执行就是正常的: |