Oracle,mybatis批量插入,id自增

Boolean insertCalender(@Param("calenderList")List  calenderList);





< insert id ="insertCalender" parameterType ="java.util.List" > select ST_SEQ_DD_CALENDER.NEXTVAL,m. * from ( < foreach collection ="calenderList" item ="item" index ="index" separator ="union all" > select #{item.spotDate,jdbcType=VARCHAR}, #{item.restFlag,jdbcType=CHAR}, #{item.usingFlag,jdbcType=CHAR} from dual foreach > ) m insert >

你可能感兴趣的:(Oracle,mybatis批量插入,id自增)