`

Mybatis的list循环插入

 
阅读更多
@Mapper
public interface NoticeDeptRangeDTOMapper
    int batchInsertInfo(List<NoticeDeptRangeDTO> list);



<insert id="batchInsertInfo" parameterType="java.util.List">
		insert all into XTGL_GGGL_BMFW (BMGGFW_ID, BM_ID, TZGG_ID,CJR, CJSJ,ZHXGR,ZHXGSJ)
		<foreach close=")" collection="list" item="item" index="index"
			open="(" separator="union">
			select
			#{item.noticeDeptScopeId,jdbcType=VARCHAR},
			#{item.deptId,jdbcType=VARCHAR},
			#{item.noticeId,jdbcType=VARCHAR},
			#{item.creator,jdbcType=VARCHAR},
			#{item.createTime,jdbcType=VARCHAR}, #{item.editor,jdbcType=VARCHAR},
			#{item.editeTime,jdbcType=VARCHAR}
			from dual
		</foreach>
	</insert>

 

 

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics