代码如下:
@Override public List<ScoreLogEntity> queryScoreLogs(ScoreLogQuery scoreLogQuery, int offset, int limit) { HashMap<String, Object> paramMap = new HashMap<>(); paramMap.put("scoreLogQuery",scoreLogQuery); paramMap.put("offset",offset); paramMap.put("limit",limit); return scoreLogtemplate.selectList(BaseSatement.concat("queryScoreLogs"),paramMap); }
mapper.xml如下:
<select id="queryScoreLogs" parameterType="java.util.HashMap" resultType="java.util.ArrayList"> SELECT * from score_log where member_id=#{scoreLogQuery.customerId_} ORDER BY create_stamp desc limit #{offset} AND #{limit} </select>
报错如下:
org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.builder.BuilderException: Error evaluating expression “scoreLogQuery.customerId_ > 0”. Cause: org.apache.ibatis.ognl.NoSuchPropertyException: common.scoreCenter.contract.ScoreLogQuery.customerId_
问一下 本人有三个参数要怎么传入mybatis映射? 第一个是个Object,第二个和第三个是基本类型.
解决方案
20
customerId_ 这个字段是scoreLogQuery 的字段么? get / set方法设置了?