报错原因:Mapper文件进行多参数传递时,同时传递了对象参数和基础数据参数
解决方法:将基础数据参数放入对象参数中,可进行适当隐藏处理(最简单解决方法)
例子:mapper文件中原源代码:
List<ResponseEmpList> getOnShipList(@Param("shipId")Integer shipId, @Param("time")String time, @Param("validTime")Integer validTime, @Param("c3OnShipList")QueryC3OnShipList c3OnShipList); 后修改为:
List<ResponseEmpList> getOnShipList(QueryC3OnShipList c3OnShipList); 同时,通过查阅网友处理方法,得到相似问题解决方法: 1.Mapper文件加@Param注释,比如:
@Param("time")String time 2.sql语句加jdbcType=INTEGER,如:
WHERE card_time BETWEEN dateadd(hour ,-(#{validTime},jdbcType=INTEGER) ,#{time})AND #{time}