sql批量新增,修改

   <insert id="insertExtDocList" parameterType="map">
INSERT INTO extprjdoc
(docName,createTime,extProjectId)
VALUES
<foreach collection="list" item="item" index="index" separator=","> <!-- list 为传来的集合数据 -->
(#{item.docName},NOW(),#{extProjectId})
</foreach>
</insert> <update id="updateList" parameterType="map">
UPDATE extprjdoc SET sendUnit = #{sendUnit},reveiceUnit = #{reveiceUnit}
WHERE extProjectId IN
<foreach collection="list" item="item" index="index" separator="," open="("
close=")">
#{item}
</foreach>
</update>
上一篇:mysql简单介绍


下一篇:【转】AVL