mybatis用Map<Long,List<String>>作为参数
mapper.xml文件里的
<insert id="insertByMap" parameterType="java.util.Map">
insert ignore into custom_search_enums (`search_field_id`,`value`) values
<foreach collection="searchKeyMap" index="fieldId" item="key">
<foreach collection="key" item="enum" separator=",">
<trim prefix="(" suffix=")">
#{fieldId},#{enum}
</trim>
</foreach>
</foreach>
</insert>
mapper里的方法:
void insertByMap(@Param("searchKeyMap") Map<Long, Set<String>> map);