提交 | 用户 | 时间
|
e7c126
|
1 |
#set ($subTable = $subTables.get($subIndex))##当前表 |
H |
2 |
#set ($subColumns = $subJoinColumnsList.get($subIndex))##当前字段数组 |
|
3 |
#set ($subJoinColumn = $subJoinColumns.get($subIndex))##当前 join 字段 |
|
4 |
#set ($SubJoinColumnName = $subJoinColumn.javaField.substring(0,1).toUpperCase() + ${subJoinColumn.javaField.substring(1)})##首字母大写 |
|
5 |
package ${basePackage}.module.${subTable.moduleName}.dal.mysql.${subTable.businessName}; |
|
6 |
|
|
7 |
import java.util.*; |
|
8 |
|
|
9 |
import ${PageResultClassName}; |
|
10 |
import ${PageParamClassName}; |
|
11 |
import ${QueryWrapperClassName}; |
|
12 |
import ${BaseMapperClassName}; |
|
13 |
import ${basePackage}.module.${subTable.moduleName}.dal.dataobject.${subTable.businessName}.${subTable.className}DO; |
|
14 |
import org.apache.ibatis.annotations.Mapper; |
|
15 |
|
|
16 |
/** |
|
17 |
* ${subTable.classComment} Mapper |
|
18 |
* |
|
19 |
* @author ${subTable.author} |
|
20 |
*/ |
|
21 |
@Mapper |
|
22 |
public interface ${subTable.className}Mapper extends BaseMapperX<${subTable.className}DO> { |
|
23 |
|
|
24 |
## 情况一:MASTER_ERP 时,需要分查询页子表 |
|
25 |
#if ( $table.templateType == 11 ) |
|
26 |
default PageResult<${subTable.className}DO> selectPage(PageParam reqVO, ${subJoinColumn.javaType} ${subJoinColumn.javaField}) { |
|
27 |
return selectPage(reqVO, new LambdaQueryWrapperX<${subTable.className}DO>() |
|
28 |
.eq(${subTable.className}DO::get${SubJoinColumnName}, ${subJoinColumn.javaField}) |
|
29 |
.orderByDesc(${subTable.className}DO::getId));## 大多数情况下,id 倒序 |
|
30 |
|
|
31 |
} |
|
32 |
|
|
33 |
## 情况二:非 MASTER_ERP 时,需要列表查询子表 |
|
34 |
#else |
|
35 |
#if ( $subTable.subJoinMany) |
|
36 |
default List<${subTable.className}DO> selectListBy${SubJoinColumnName}(${subJoinColumn.javaType} ${subJoinColumn.javaField}) { |
|
37 |
return selectList(${subTable.className}DO::get${SubJoinColumnName}, ${subJoinColumn.javaField}); |
|
38 |
} |
|
39 |
|
|
40 |
#else |
|
41 |
default ${subTable.className}DO selectBy${SubJoinColumnName}(${subJoinColumn.javaType} ${subJoinColumn.javaField}) { |
|
42 |
return selectOne(${subTable.className}DO::get${SubJoinColumnName}, ${subJoinColumn.javaField}); |
|
43 |
} |
|
44 |
|
|
45 |
#end |
|
46 |
#end |
|
47 |
default int deleteBy${SubJoinColumnName}(${subJoinColumn.javaType} ${subJoinColumn.javaField}) { |
|
48 |
return delete(${subTable.className}DO::get${SubJoinColumnName}, ${subJoinColumn.javaField}); |
|
49 |
} |
|
50 |
|
|
51 |
} |