直接数据集中
select * from 表
where 日期字段='${日期控件名}'
这个格式
=====
你语句拼接问题,拷贝sql,帮你修改下
select COALESCE(SUM(f.fhdsl), 0) AS total_fhdsl from ZS_FHSJHZ f
where 1=1
${if(len(factory) == 0,""," and sapcode = '" + factory + "'")}
${if(len(province) == 0,""," and province_name = '" + province + "'")}
${if(len(startDate) == 0,""," and to_date(fhdate,'yyyy-MM-dd') >= to_date("+startDate+",'yyyy-MM-dd')")}
${if(len(endDate) == 0,""," and to_date(fhdate,'yyyy-MM-dd') >= to_date("+endDate+",'yyyy-MM-dd')")}