在mapper.xml中遍历添加多条数据

1
2
3
4
5
6
7
8
9
<insert id="saveAuditDf" parameterType="java.util.List">
    insert into audit_df (jhr, jhtgds, jhbtgds, jhrq, id, time)
    values
    <foreach collection="list" item="item"  separator="," index="">
      <foreach collection="item" item="str" open="(" close=")" separator="," index="">
        #{str}
      </foreach>
  </foreach>
  </insert><br><br>saveAuditDf为接口名称,java.util.List为输入参数的类型,<br><br>

  

posted on   海哥哥99  阅读(1219)  评论(0编辑  收藏  举报

努力加载评论中...

导航

点击右上角即可分享
微信分享提示