Explorar el Código

后:业务流程查询总条数问题

dubch hace 5 años
padre
commit
84150e4d0e

+ 5 - 1
src/dashoo.cn/backend/api/business/oilsupplier/annualaudit/annualauditService.go

@@ -160,7 +160,11 @@ func (s *OilAnnualAuditService) GetProcessInfoWithOrderBytbl(oilAnnualAuditName
 	var resultsSlice []map[string][]byte
 
 	//获取总记录数
-	sqlCount := `select count(*) from ` + oilAnnualAuditName
+	sqlCount := `select count(*) from ` + oilAnnualAuditName + ` a `
+	sqlCount += ` LEFT JOIN Base_User u ON a.CreateUserId = u.Id`
+	sqlCount += ` Left join OilSupplier s on a.SupplierId = s.Id
+			 left join Base_User uu on s.CreateUserId = uu.Id
+			 left join OilCorporateInfo c on s.CreateUserId = c.UserId`
 	sqlCount += ` where ` + where
 
 	var sql string

+ 4 - 1
src/dashoo.cn/backend/api/business/oilsupplier/supplier/oilsupplierService.go

@@ -305,7 +305,10 @@ func (s *OilSupplierService) GetProcessInfoWithOrderBytbl(supplierTableName, sup
 	var resultsSlice []map[string][]byte
 
 	//获取总记录数
-	sqlCount := `select count(*) from ` + supplierCertTableName + ` a `
+	sqlCount := `select count(*) from ` + supplierTableName + ` a `
+	sqlCount += ` left join ` + supplierCertTableName + ` b on b.SupplierId = a.Id`
+	sqlCount += ` Left join Base_User u on a.CreateUserId = u.Id `
+	sqlCount += ` LEFT JOIN Base_Organize org ON b.CommitComId = org.Id`
 	sqlCount += ` where ` + where
 
 	var sql string

+ 2 - 2
src/dashoo.cn/backend/api/controllers/oilsupplier/select.go

@@ -497,7 +497,7 @@ func (this *SelectController) GetProcessAuditList() {
 		where = where + " and (b.CreateUserId = '" + this.User.Id + "' or a.CommercialNo='" + registerUser.CommercialNo + "')"
 	}
 	if supplierTypeCode != "" {
-		where = where + " and b.SupplierTypeCode like '%" + supplierTypeCode + "%'"
+		where = where + " and b.SupplierTypeCode = '" + supplierTypeCode + "'"
 	}
 	if supplierName != "" {
 		where = where + " and a.SupplierName like '%" + supplierName + "%'"
@@ -551,7 +551,7 @@ func (this *SelectController) GetProcessAuditList() {
 			whereapp = whereapp + " and a.CreateUserId = '" + this.User.Id + "'"
 		}
 		if supplierTypeCode != "" {
-			whereapp = whereapp + " and a.SupplierTypeName like '%" + supplierTypeCode + "%'"
+			whereapp = whereapp + " and a.SupplierTypeName = '" + supplierTypeCode + "'"
 		}
 		if supplierName != "" {
 			whereapp = whereapp + " and a.SupplierName like '%" + supplierName + "%'"