下面是sql里where的一段,查在开始和结束时间内的数据有什么问题
${IF(LEN(startDate)==0,"","T1.ATTENDANCE_DATE >= ('"+startDate+"')")}
${IF(LEN(endDate)==0,"","T1.ATTENDANCE_DATE <=('"+endDate+"')")}
这么写
1=1
${IF(LEN(startDate)==0,""," and T1.ATTENDANCE_DATE >= '"+startDate+"'")}
${IF(LEN(endDate)==0,""," and T1.ATTENDANCE_DATE <='"+endDate+"'")}
日期参数为什么要括号啊。
括弧去掉
是不是你的数据库那个字段和你的参数的日期类型不一样
${IF(LEN(startDate)==0,"","T1.ATTENDANCE_DATE >= ('"+startDate+"') and T1.ATTENDANCE_DATE <=('"+endDate+"')")}