mybatis的xml文件
<when test="sqfbcz=='是'"> left join bdc_zs_qlr_rel f on f.zsid = x.zsid left join bdc_qlr g on g.qlrid = f.qlrid </when>前台调用时报错:
org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.exceptions.PersistenceException:
### Error querying database. Cause: java.lang.NumberFormatException: For input string: "否"
### Cause: java.lang.NumberFormatException: For input string: "否"
at org.mybatis.spring.MyBatisExceptionTranslator.translateExceptionIfPossible(MyBatisExceptionTranslator.java:73)
at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:364)
at com.sun.proxy.$Proxy14.selectOne(Unknown Source)
at org.mybatis.spring.SqlSessionTemplate.selectOne(SqlSessionTemplate.java:159)
at cn.gtmap.estateplat.core.support.mybatis.page.repository.Repository.selectOne(Repository.java:36)
at cn.gtmap.estateplat.server.web.query.BdcqzController.getBdcdyhxx(BdcqzController.java:101)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
解决办法:
<when test="sqfbcz=='是'">改为:<when test='sqfbcz=="是"'>