diff --git a/src/main/resources/modules/SpringBoot/java/module/mpr/mapper.ftl b/src/main/resources/modules/SpringBoot/java/module/mpr/mapper.ftl index 677318b6..bd4af70a 100644 --- a/src/main/resources/modules/SpringBoot/java/module/mpr/mapper.ftl +++ b/src/main/resources/modules/SpringBoot/java/module/mpr/mapper.ftl @@ -112,6 +112,31 @@ ) + + INSERT INTO + + ( + + ) + VALUES + + ( + ${r"#{"}item.id}, + <#list table.fields as f> + <#if !f.isSystem> + ${r"#{"}item.${f.getFName()},jdbcType=${f.fieldType.jdbcType()}}, + + + 0, + 0, + ${r"#{"}token.userId,jdbcType=NUMERIC}, + <#if dataBase == 'ORACLE'>sysdate<#elseif dataBase == 'MYSQL'>sysdate(), + NULL, + NULL + ) + + + UPDATE diff --git a/src/main/resources/modules/SpringBoot/java/module/mpr/mapperJava.ftl b/src/main/resources/modules/SpringBoot/java/module/mpr/mapperJava.ftl index 547c19e4..c8cd7204 100644 --- a/src/main/resources/modules/SpringBoot/java/module/mpr/mapperJava.ftl +++ b/src/main/resources/modules/SpringBoot/java/module/mpr/mapperJava.ftl @@ -27,6 +27,15 @@ public interface ${table.getCName()}Mapper { * @return 返回数量 */ long insert(@Param("request") ${table.getCName()} request, @Param("token") Token token); + + /** + * 批量插入 + * + * @param request 请求对象 + * @param token 令牌 + * @return 返回数量 + */ + long insertBatch(@Param("list") List<${table.getCName()}> request, @Param("token") Token token); <#if table.getDelete()>