MyBatis插入多条

 

  <insert id="insertProjectPropertyRelList" parameterType="java.util.List">
    INSERT INTO atm_project_property_rel (
      project_id,
      property_id,
      property_type,
      create_by,
      create_date,
      update_by,
      update_date,
      del_flag
    ) VALUES
    <foreach collection="list" item="rel" separator=",">
    (
      #{rel.projectId},
      #{rel.propertyId},
      #{rel.propertyType},
      #{rel.createBy.id},
      #{rel.createDate},
      #{rel.updateBy.id},
      #{rel.updateDate},
      0
    )
    </foreach>
  </insert>

 

posted @ 2015-06-24 16:28  VoctrALs  阅读(228)  评论(0编辑  收藏  举报