提交 | 用户 | 时间
|
e7c126
|
1 |
package ${basePackage}.module.${table.moduleName}.service.${table.businessName}; |
H |
2 |
|
|
3 |
import java.util.*; |
|
4 |
import ${jakartaPackage}.validation.*; |
|
5 |
import ${basePackage}.module.${table.moduleName}.controller.${sceneEnum.basePackage}.${table.businessName}.vo.*; |
|
6 |
import ${basePackage}.module.${table.moduleName}.dal.dataobject.${table.businessName}.${table.className}DO; |
|
7 |
## 特殊:主子表专属逻辑 |
|
8 |
#foreach ($subTable in $subTables) |
|
9 |
import ${basePackage}.module.${subTable.moduleName}.dal.dataobject.${subTable.businessName}.${subTable.className}DO; |
|
10 |
#end |
|
11 |
import ${PageResultClassName}; |
|
12 |
import ${PageParamClassName}; |
|
13 |
|
|
14 |
/** |
|
15 |
* ${table.classComment} Service 接口 |
|
16 |
* |
|
17 |
* @author ${table.author} |
|
18 |
*/ |
|
19 |
public interface ${table.className}Service { |
|
20 |
|
|
21 |
/** |
|
22 |
* 创建${table.classComment} |
|
23 |
* |
|
24 |
* @param createReqVO 创建信息 |
|
25 |
* @return 编号 |
|
26 |
*/ |
|
27 |
${primaryColumn.javaType} create${simpleClassName}(@Valid ${sceneEnum.prefixClass}${table.className}SaveReqVO createReqVO); |
|
28 |
|
|
29 |
/** |
|
30 |
* 更新${table.classComment} |
|
31 |
* |
|
32 |
* @param updateReqVO 更新信息 |
|
33 |
*/ |
|
34 |
void update${simpleClassName}(@Valid ${sceneEnum.prefixClass}${table.className}SaveReqVO updateReqVO); |
|
35 |
|
|
36 |
/** |
|
37 |
* 删除${table.classComment} |
|
38 |
* |
|
39 |
* @param id 编号 |
|
40 |
*/ |
|
41 |
void delete${simpleClassName}(${primaryColumn.javaType} id); |
|
42 |
|
|
43 |
/** |
|
44 |
* 获得${table.classComment} |
|
45 |
* |
|
46 |
* @param id 编号 |
|
47 |
* @return ${table.classComment} |
|
48 |
*/ |
|
49 |
${table.className}DO get${simpleClassName}(${primaryColumn.javaType} id); |
|
50 |
|
|
51 |
## 特殊:树表专属逻辑(树不需要分页接口) |
|
52 |
#if ( $table.templateType != 2 ) |
|
53 |
/** |
|
54 |
* 获得${table.classComment}分页 |
|
55 |
* |
|
56 |
* @param pageReqVO 分页查询 |
|
57 |
* @return ${table.classComment}分页 |
|
58 |
*/ |
|
59 |
PageResult<${table.className}DO> get${simpleClassName}Page(${sceneEnum.prefixClass}${table.className}PageReqVO pageReqVO); |
|
60 |
#else |
|
61 |
/** |
|
62 |
* 获得${table.classComment}列表 |
|
63 |
* |
|
64 |
* @param listReqVO 查询条件 |
|
65 |
* @return ${table.classComment}列表 |
|
66 |
*/ |
|
67 |
List<${table.className}DO> get${simpleClassName}List(${sceneEnum.prefixClass}${table.className}ListReqVO listReqVO); |
|
68 |
#end |
|
69 |
|
|
70 |
## 特殊:主子表专属逻辑 |
|
71 |
#foreach ($subTable in $subTables) |
|
72 |
#set ($index = $foreach.count - 1) |
|
73 |
#set ($subSimpleClassName = $subSimpleClassNames.get($index)) |
|
74 |
#set ($subPrimaryColumn = $subPrimaryColumns.get($index))##当前 primary 字段 |
|
75 |
#set ($subJoinColumn = $subJoinColumns.get($index))##当前 join 字段 |
|
76 |
#set ($SubJoinColumnName = $subJoinColumn.javaField.substring(0,1).toUpperCase() + ${subJoinColumn.javaField.substring(1)})##首字母大写 |
|
77 |
#set ($subClassNameVar = $subClassNameVars.get($index)) |
|
78 |
// ==================== 子表($subTable.classComment) ==================== |
|
79 |
|
|
80 |
## 情况一:MASTER_ERP 时,需要分查询页子表 |
|
81 |
#if ( $table.templateType == 11 ) |
|
82 |
/** |
|
83 |
* 获得${subTable.classComment}分页 |
|
84 |
* |
|
85 |
* @param pageReqVO 分页查询 |
|
86 |
* @param ${subJoinColumn.javaField} ${subJoinColumn.columnComment} |
|
87 |
* @return ${subTable.classComment}分页 |
|
88 |
*/ |
|
89 |
PageResult<${subTable.className}DO> get${subSimpleClassName}Page(PageParam pageReqVO, ${subJoinColumn.javaType} ${subJoinColumn.javaField}); |
|
90 |
|
|
91 |
## 情况二:非 MASTER_ERP 时,需要列表查询子表 |
|
92 |
#else |
|
93 |
#if ( $subTable.subJoinMany ) |
|
94 |
/** |
|
95 |
* 获得${subTable.classComment}列表 |
|
96 |
* |
|
97 |
* @param ${subJoinColumn.javaField} ${subJoinColumn.columnComment} |
|
98 |
* @return ${subTable.classComment}列表 |
|
99 |
*/ |
|
100 |
List<${subTable.className}DO> get${subSimpleClassName}ListBy${SubJoinColumnName}(${subJoinColumn.javaType} ${subJoinColumn.javaField}); |
|
101 |
|
|
102 |
#else |
|
103 |
/** |
|
104 |
* 获得${subTable.classComment} |
|
105 |
* |
|
106 |
* @param ${subJoinColumn.javaField} ${subJoinColumn.columnComment} |
|
107 |
* @return ${subTable.classComment} |
|
108 |
*/ |
|
109 |
${subTable.className}DO get${subSimpleClassName}By${SubJoinColumnName}(${subJoinColumn.javaType} ${subJoinColumn.javaField}); |
|
110 |
|
|
111 |
#end |
|
112 |
#end |
|
113 |
## 特殊:MASTER_ERP 时,支持单个的新增、修改、删除操作 |
|
114 |
#if ( $table.templateType == 11 ) |
|
115 |
/** |
|
116 |
* 创建${subTable.classComment} |
|
117 |
* |
|
118 |
* @param ${subClassNameVar} 创建信息 |
|
119 |
* @return 编号 |
|
120 |
*/ |
|
121 |
${subPrimaryColumn.javaType} create${subSimpleClassName}(@Valid ${subTable.className}DO ${subClassNameVar}); |
|
122 |
|
|
123 |
/** |
|
124 |
* 更新${subTable.classComment} |
|
125 |
* |
|
126 |
* @param ${subClassNameVar} 更新信息 |
|
127 |
*/ |
|
128 |
void update${subSimpleClassName}(@Valid ${subTable.className}DO ${subClassNameVar}); |
|
129 |
|
|
130 |
/** |
|
131 |
* 删除${subTable.classComment} |
|
132 |
* |
|
133 |
* @param id 编号 |
|
134 |
*/ |
|
135 |
void delete${subSimpleClassName}(${subPrimaryColumn.javaType} id); |
|
136 |
|
|
137 |
/** |
|
138 |
* 获得${subTable.classComment} |
|
139 |
* |
|
140 |
* @param id 编号 |
|
141 |
* @return ${subTable.classComment} |
|
142 |
*/ |
|
143 |
${subTable.className}DO get${subSimpleClassName}(${subPrimaryColumn.javaType} id); |
|
144 |
|
|
145 |
#end |
|
146 |
#end |
|
147 |
} |