mirror of
https://gitee.com/hhyykk/ipms-sjy.git
synced 2025-08-06 22:31:53 +08:00
代码生成:简化现有 crud 模版的各种 pretty 相关的判断,交给 Java 代码后置统一处理。
This commit is contained in:
@@ -48,7 +48,7 @@ public class ${table.className}ServiceImpl implements ${table.className}Service
|
||||
|
||||
@Override
|
||||
## 特殊:主子表专属逻辑
|
||||
#if ( $subTables.size() > 0)
|
||||
#if ( $subTables && $subTables.size() > 0 )
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
#end
|
||||
public ${primaryColumn.javaType} create${simpleClassName}(${sceneEnum.prefixClass}${table.className}CreateReqVO createReqVO) {
|
||||
@@ -56,7 +56,7 @@ public class ${table.className}ServiceImpl implements ${table.className}Service
|
||||
${table.className}DO ${classNameVar} = ${table.className}Convert.INSTANCE.convert(createReqVO);
|
||||
${classNameVar}Mapper.insert(${classNameVar});
|
||||
## 特殊:主子表专属逻辑
|
||||
#if ( $subTables.size() > 0)
|
||||
#if ( $subTables && $subTables.size() > 0)
|
||||
|
||||
// 插入子表($subTable.classComment)
|
||||
#foreach ($subTable in $subTables)
|
||||
@@ -77,7 +77,7 @@ public class ${table.className}ServiceImpl implements ${table.className}Service
|
||||
|
||||
@Override
|
||||
## 特殊:主子表专属逻辑
|
||||
#if ( $subTables.size() > 0)
|
||||
#if ( $subTables && $subTables.size() > 0)
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
#end
|
||||
public void update${simpleClassName}(${sceneEnum.prefixClass}${table.className}UpdateReqVO updateReqVO) {
|
||||
@@ -87,7 +87,7 @@ public class ${table.className}ServiceImpl implements ${table.className}Service
|
||||
${table.className}DO updateObj = ${table.className}Convert.INSTANCE.convert(updateReqVO);
|
||||
${classNameVar}Mapper.updateById(updateObj);
|
||||
## 特殊:主子表专属逻辑
|
||||
#if ( $subTables.size() > 0)
|
||||
#if ( $subTables && $subTables.size() > 0)
|
||||
|
||||
// 更新子表
|
||||
#foreach ($subTable in $subTables)
|
||||
@@ -106,7 +106,7 @@ public class ${table.className}ServiceImpl implements ${table.className}Service
|
||||
|
||||
@Override
|
||||
## 特殊:主子表专属逻辑
|
||||
#if ( $subTables.size() > 0)
|
||||
#if ( $subTables && $subTables.size() > 0)
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
#end
|
||||
public void delete${simpleClassName}(${primaryColumn.javaType} id) {
|
||||
@@ -115,7 +115,7 @@ public class ${table.className}ServiceImpl implements ${table.className}Service
|
||||
// 删除
|
||||
${classNameVar}Mapper.deleteById(id);
|
||||
## 特殊:主子表专属逻辑
|
||||
#if ( $subTables.size() > 0)
|
||||
#if ( $subTables && $subTables.size() > 0)
|
||||
|
||||
// 删除子表
|
||||
#foreach ($subTable in $subTables)
|
||||
|
Reference in New Issue
Block a user