记录前台后台交互时关于日期的类型转换异常

 Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.exceptions.PersistenceException: 
### Error querying database.  Cause: java.lang.IllegalArgumentException: invalid comparison: java.util.Date and java.lang.String
### Cause: java.lang.IllegalArgumentException: invalid comparison: java.util.Date and java.lang.String] with root cause

这是前后台交互的时候产生的类型转换异常报错原因是我在写sql xml 文件时的报错

 <if test="vo.start != null and vo.start != ''">
                    and s.birth >= #{vo.start}
                </if>

在if判断中我写时间类型  !=' '  导致的类型转换的报错

 <if test="vo.start != null ">
                    and s.birth >= #{vo.start}
                </if>

这样再进行查询就可以查出数据了

posted on 2022-02-12 10:07  菊_酒  阅读(60)  评论(0)    收藏  举报