xml -- forearch遍历用法

// in的多参数查找,比较常见
<select id="selectSearchAttrIds" resultType="java.lang.Long"> SELECT attr_id FROM `pms_attr` WHERE attr_id IN <foreach collection="attrIds" item="id" separator="," open="(" close=")"> #{id} </foreach> AND search_type = 1 </select>

// 对应的mapper接口【根据多个id进行查询】

List<Long> selectSearchAttrIds(@Param("attrIds") List<Long> attrIds);

 

上一篇:Ajax请求导出Excel的问题


下一篇:const {attr} = obj