From fad4cd512aa6c584bafe33e2b62fcabefd0a9ed1 Mon Sep 17 00:00:00 2001 From: louwenzhi Date: Fri, 17 Dec 2021 16:58:21 +0800 Subject: [PATCH] =?UTF-8?q?=E6=A8=A1=E7=B3=8A=E6=9F=A5=E8=AF=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dao/ap/implments/CustDemandVerHead.dao.impl.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dao/ap/implments/CustDemandVerHead.dao.impl.go b/dao/ap/implments/CustDemandVerHead.dao.impl.go index 77f5d48..7eecf56 100644 --- a/dao/ap/implments/CustDemandVerHead.dao.impl.go +++ b/dao/ap/implments/CustDemandVerHead.dao.impl.go @@ -360,7 +360,7 @@ func (impl *CustDemandVerHeadDAOImplement) IssueGlobalVersion(entity *model.Cust func (impl *CustDemandVerHeadDAOImplement) SelectData(customerId string, artId string, Valid bool) ([]model.CustDemandVerHead, error) { if Valid { - session := impl.session.Table("AP_CustDemandVerHead").Select("AP_CustDemandVerHead.*").Distinct("AP_CustDemandVerHead.VersionId").Join("LEFT", "AP_CustDemandHead", "AP_CustDemandHead.PlantNr = AP_CustDemandVerHead.PlantNr And AP_CustDemandHead.CustomerId = AP_CustDemandVerHead.CustomerId And AP_CustDemandHead.VersionId = AP_CustDemandVerHead.VersionId").Join("LEFT", meta.CustDemandVerDetail.TableName, "AP_CustDemandVerHead.PlantNr = AP_CustDemandVerDetail.PlantNr And AP_CustDemandVerHead.CustomerId = AP_CustDemandVerDetail.CustomerId And AP_CustDemandVerHead.VersionId = AP_CustDemandVerDetail.VersionId").Where("AP_CustDemandVerHead.PlantNr = ?", impl.plantNr) + session := impl.session.Table("AP_CustDemandVerHead").Select("AP_CustDemandVerHead.*").Distinct("AP_CustDemandVerHead.VersionId").Join("INNER", "AP_CustDemandHead", "AP_CustDemandHead.PlantNr = AP_CustDemandVerHead.PlantNr And AP_CustDemandHead.CustomerId = AP_CustDemandVerHead.CustomerId And AP_CustDemandHead.VersionId = AP_CustDemandVerHead.VersionId").Join("INNER", meta.CustDemandVerDetail.TableName, "AP_CustDemandVerHead.PlantNr = AP_CustDemandVerDetail.PlantNr And AP_CustDemandVerHead.CustomerId = AP_CustDemandVerDetail.CustomerId And AP_CustDemandVerHead.VersionId = AP_CustDemandVerDetail.VersionId").Where("AP_CustDemandVerHead.PlantNr = ?", impl.plantNr) if customerId != "" { session = session.And("AP_CustDemandVerHead.CustomerId = ?", customerId) } @@ -376,7 +376,7 @@ func (impl *CustDemandVerHeadDAOImplement) SelectData(customerId string, artId s } return data, nil } else { - session := impl.session.Table(impl.meta.TableName).Select("AP_CustDemandVerHead.*").Distinct("AP_CustDemandVerHead.VersionId").Join("LEFT", meta.CustDemandVerDetail.TableName, "AP_CustDemandVerHead.PlantNr = AP_CustDemandVerDetail.PlantNr And AP_CustDemandVerHead.CustomerId = AP_CustDemandVerDetail.CustomerId And AP_CustDemandVerHead.VersionId = AP_CustDemandVerDetail.VersionId").Where("AP_CustDemandVerHead.PlantNr = ?", impl.plantNr) + session := impl.session.Table(impl.meta.TableName).Select("AP_CustDemandVerHead.*").Distinct("AP_CustDemandVerHead.VersionId").Join("INNER", meta.CustDemandVerDetail.TableName, "AP_CustDemandVerHead.PlantNr = AP_CustDemandVerDetail.PlantNr And AP_CustDemandVerHead.CustomerId = AP_CustDemandVerDetail.CustomerId And AP_CustDemandVerHead.VersionId = AP_CustDemandVerDetail.VersionId").Where("AP_CustDemandVerHead.PlantNr = ?", impl.plantNr) if customerId != "" { session = session.And("AP_CustDemandVerHead.CustomerId = ?", customerId) }