From a0020f033980ab047e0fb37004d03327dcebbbf9 Mon Sep 17 00:00:00 2001 From: YunaiV Date: Sun, 7 Jul 2024 09:13:42 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=B8=BB=E5=AD=90=E8=A1=A8ER?= =?UTF-8?q?P=E6=A8=A1=E5=BC=8F=E4=B8=8B=E4=BB=A3=E7=A0=81=E8=87=AA?= =?UTF-8?q?=E5=8A=A8=E7=94=9F=E6=88=90=E4=B8=8D=E5=85=A8=E9=97=AE=E9=A2=98?= =?UTF-8?q?=20#583?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/codegen/java/dal/mapper_sub.vm | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/java/dal/mapper_sub.vm b/yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/java/dal/mapper_sub.vm index e5589e99d..6ccaea79e 100644 --- a/yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/java/dal/mapper_sub.vm +++ b/yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/java/dal/mapper_sub.vm @@ -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}); } -} \ No newline at end of file +}