Mybatis插入list对象Mapper模板

 oracle

begin

   INSERT INTO CW_GE_USER
      (
         ID,
         USER_ID,
         ROLE_ID
      ) VALUES
      (
         #{item.id, jdbcType=VARCHAR},
         #{item.userId, jdbcType=VARCHAR},
         #{item.roleId, jdbcType=VARCHAR}
      )

end;

 oracle & mysql

INSERT INTO CW_GE_USER
(
ID,
USER_ID,
ROLE_ID
)

   (
   SELECT
   #{item.id, jdbcType=VARCHAR},
   #{item.userId, jdbcType=VARCHAR},
   #{item.roleId, jdbcType=VARCHAR}
   FROM DUAL
   )

 

你可能感兴趣的:(mybatis)