0
点赞
收藏
分享

微信扫一扫

mybatis实现多行新增

琛彤麻麻 2022-02-22 阅读 58
sqlmybatis

sqlMap层

<insert id="insertList">
     INSERT INTO sys_organizations_path(
     	ancestor_id, descendant_id, distance)
     VALUES
     	<foreach collection="dtoList" item="dto" separator=",">
            (#{dto.ancestorId,jdbcType=BIGINT}, #{dto.descendantId,jdbcType=BIGINT}, #{dto.distance,jdbcType=INTEGER})
        </foreach>
 </insert>

dao层

int insertList(@Param("dtoList") List<Map<String,Object>> dtoList);
举报

相关推荐

0 条评论