where
1=1
${if(len(p_start_c)=0,""," and DATE>='"+p_start_c+"'")}
${if(len(p_end_c)=0,""," and DATE<='"+p_end_c+"'")}
用一个控件,直接=
${if(len(p_start_c)=0,""," and DATE='"+p_start_c+"'")}
字段date 和参数格式一致吗?
问题是?需要查询区间?还是只查当天?
SELECT * FROM 订单 where 1=1
${if(len(starttime)=0,""," and 订购日期>='"+starttime+"'")}
${if(len(endtime)=0,""," and 订购日期<='"+endtime+"'")}
参考
JS实现日期控件查询天数控制 https://help.fanruan.com/finereport/doc-view-3060.html
稍微改下代码
是不是输入的结束时间和开始时间输入反了,开始时间大于结束时间了,看一下你的入参试试看.