columnList: 列
valueList:值
tablename:表名
int batchSaveList(@Param("columnkey") List<String> columnList,@Param("columnvalue") List<List<String>> valueList,@Param("tableName") String tablename);
<insert id="batchSaveList" parameterType="java.util.HashMap">
insert into ${tableName}
<foreach item='item' index='index' collection='columnkey' open='(' separator=',' close=')'>
${item}
</foreach>
values
<foreach item='colvalue' index='index' collection='columnvalue' separator=',' close=';'>
<foreach item='clv' index='index' collection='colvalue' open='(' separator=',' close=')'>
#{clv}
</foreach>
</foreach>
</insert>
网友评论