Merge pull request #582 from jiushinakecai/com-dev

Update mapper_sub.vm
This commit is contained in:
芋道源码 2024-07-07 09:11:04 +08:00 committed by GitHub
commit 0337b1df68
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 7 additions and 1 deletions

View File

@ -29,6 +29,12 @@ public interface ${subTable.className}Mapper extends BaseMapperX<${subTable.clas
.orderByDesc(${subTable.className}DO::getId));## 大多数情况下id 倒序
}
## 主表与子表是一对一时
#if (!$subTable.subJoinMany)
default ${subTable.className}DO selectBy${SubJoinColumnName}(${subJoinColumn.javaType} ${subJoinColumn.javaField}) {
return selectOne(${subTable.className}DO::get${SubJoinColumnName}, ${subJoinColumn.javaField});
}
#end
## 情况二:非 MASTER_ERP 时,需要列表查询子表
#else
@ -48,4 +54,4 @@ public interface ${subTable.className}Mapper extends BaseMapperX<${subTable.clas
return delete(${subTable.className}DO::get${SubJoinColumnName}, ${subJoinColumn.javaField});
}
}
}