解决Mybatis系统异常org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.reflection.ReflectionException: There is no getter for property named ‘date’ in ‘class java.lang.String’
- 在ssm三层架构项目中,遇到这样的需求: 根据表名(每天一张表,表名和日期相关)查表中信息。
表名类似:t_log_20221102、t_log_20221102 - 不能使用#{} 或者concat() 因为这样只是占位符传值,最终传入字符串的话会带引号,sql语句变成: select * from
t_log_‘20221102’ 语法错误
思路肯定是使用${}进行先拼接字符串,再编译如下:
<select id="selectByDate" resultType="myLog" parameterType="String">
select <include refid="allColumns"

本文介绍如何解决MyBatis动态SQL中的异常问题,特别是使用${}
最低0.47元/天 解锁文章
6418

被折叠的 条评论
为什么被折叠?



