From 43a2eb6beec6a8ce81903ed8700ed3f8ef819532 Mon Sep 17 00:00:00 2001 From: louwenzhi Date: Fri, 24 Dec 2021 15:51:42 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=97=E8=A1=A8=E5=85=A8=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dao/ap/implments/CustDemandVerHead.dao.impl.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/dao/ap/implments/CustDemandVerHead.dao.impl.go b/dao/ap/implments/CustDemandVerHead.dao.impl.go index 0c73f1e..15ee713 100644 --- a/dao/ap/implments/CustDemandVerHead.dao.impl.go +++ b/dao/ap/implments/CustDemandVerHead.dao.impl.go @@ -436,6 +436,8 @@ func (impl *CustDemandVerHeadDAOImplement) SelectData(paging *grmi.Paging, group joinstr := " INNER JOIN AP_UserCustlst ON AP_CustDemandVerHead.PlantNr = AP_UserCustlst.PlantNr AND AP_CustDemandVerHead.CustomerId = AP_UserCustlst.CustomerId INNER JOIN AP_CustDemandHead ON AP_CustDemandVerHead.PlantNr = AP_CustDemandHead.PlantNr AND AP_CustDemandVerHead.CustomerId = AP_CustDemandHead.CustomerId AND AP_CustDemandVerHead.VersionId = AP_CustDemandHead.VersionId " + where += fmt.Sprintf(" AND AP_UserCustlst.UserId = '%s'", impl.userid) + if customerId != "" { where += fmt.Sprintf(" AND AP_CustDemandVerHead.CustomerId = '%s'", customerId) } @@ -469,7 +471,7 @@ func (impl *CustDemandVerHeadDAOImplement) SelectData(paging *grmi.Paging, group where := fmt.Sprintf("AP_CustDemandVerHead.PlantNr = %d", impl.plantNr) joinstr := " INNER JOIN AP_UserCustlst ON AP_CustDemandVerHead.PlantNr = AP_UserCustlst.PlantNr AND AP_CustDemandVerHead.CustomerId = AP_UserCustlst.CustomerId " - + where += fmt.Sprintf(" AND AP_UserCustlst.UserId = '%s'", impl.userid) if customerId != "" { where += fmt.Sprintf(" AND AP_CustDemandVerHead.CustomerId = '%s'", customerId) } @@ -516,6 +518,7 @@ func (impl *CustDemandVerHeadDAOImplement) SelectDataCount(grouptype string, cus session = session.Join("INNER", "AP_CustDemandHead", "AP_CustDemandHead.PlantNr = AP_CustDemandVerHead.PlantNr And AP_CustDemandHead.CustomerId = AP_CustDemandVerHead.CustomerId And AP_CustDemandHead.VersionId = AP_CustDemandVerHead.VersionId") session = session.Join("INNER", "AP_UserCustlst", "AP_CustDemandVerHead.PlantNr = AP_UserCustlst.PlantNr And AP_CustDemandVerHead.CustomerId = AP_UserCustlst.CustomerId").Where("AP_CustDemandVerHead.PlantNr = ? and AP_UserCustlst.UserId = ?", impl.plantNr, impl.userid) + if customerId != "" { session = session.And("AP_CustDemandVerHead.CustomerId = ?", customerId) }