4 回答

TA贡献1804条经验 获得超2个赞

TA贡献1829条经验 获得超4个赞
<if test="search.dataforArray != null"> and datefor in ;
<foreach item="item" index="index";
collection="search.dataforArray";
open="("separator="," close=")">#{item}</foreach>
</if>。
循环体中的具体对象:支持属性的点路径访问,如item.age,item.info.details,具体说明:在list和数组中是其中的对象,在map中是value,collection,要做foreach的对象,作为入参时,List<?>对象默认用list代替作为键,数组对象有array代替作为键,Map对象没有默认的键。当然在作为入参时可以使用@Param("keyName")来设置键,设置keyName后,list,array将会失效。 除了入参这种情况外,还有一种作为参数对象的某个字段的时候。

TA贡献1827条经验 获得超4个赞
<if test="search.dataforArray != null">
and datefor in
<foreach item="item" index="index" collection="search.dataforArray" open="(" separator="," close=")">#{item}</foreach>
</if>

TA贡献1856条经验 获得超5个赞
这个<if test="search.dataforArray != null">
改为:
<if test="search.dataforArray != null and search.dataforArray !=''" >
添加回答
举报