1、出错还原如下:

<if test=”inVo.manageOrg!=null and inVo.manageOrg.size!=’’”>

<foreach collection=”inVo.manageOrg.split(‘,’)” item=”value” separator=”\\|’”open=”(“ close=”)”>

#{value}

</foreach>

</if>

2.解决问题步骤:

1. 检查报错方法体内,是否采用了@Param注解import org.apache.ibatis.annotations.Param; 

  List<User> QueryUserByPage(@Param("inVo") UserInVo inVo,@Param(page) Page page);

2. 检查在<foreach>标签中的collection属性中是否与list一致

<if test=inVo.manageOrg!=null and inVo.manageOrg.size!=’’”>

<foreach collection=inVo.manageOrg.split(,) item=value separator=\\|’”open=( close=)>

#{value}

</foreach>

</if>

3. 检查forEach中的item中所修饰的Demo的字段是否进行改变,也就是这是否是你之前编写的代码(数据表的字段名发生修改),但是你更新了po类中的update_time字段,但是在你的mapper中foreach的时候并没有进行修改

通过上边的方法并没有解决bug:

代码修改为:

<if test=”inVo.manageOrg!=null and inVo.manageOrg.size!=’’”>

<foreach collection=”inVo.manageOrg.split(‘,’)” item=”value” separator=”\\|’”open=”(“ close=”)”>

‘${value}’

</foreach>

</if>

能正确查询,不会报错,目前不明白错误发生的原因

Logo

腾讯云面向开发者汇聚海量精品云计算使用和开发经验,营造开放的云计算技术生态圈。

更多推荐