你是SQLServer数据库吗?
首先进行格式转化再进行比较
${if(len(start)=0,""," and kjsj>=CONVERT(varchar(100), '"+start+"', 20)")}
${if(len(end)=0,""," and tjsj<=CONVERT(varchar(100), '"+end+"', 20)")}
mySQL的话是:
${if(len(start)=0,""," and kjsj>=str_to_date('"+start+"','%Y-%m-%d %H:%I:%S')")}
${if(len(end)=0,""," and tjsj<=str_to_date('"+end+"','%Y-%m-%d %H:%I:%S')")}