|
|
@@ -65,7 +65,7 @@ func (s *SelectService) GetMyPagingEntitiesWithOrderBytbl(supplierTableName, sup
|
|
|
return total
|
|
|
}
|
|
|
|
|
|
-func (s *SelectService) GetUp(supplierTableName, supplierCertTableName string, pageIndex, itemsPerPage int64, orderby string, asc bool, entitiesPtr interface{}, where string) (total int64) {
|
|
|
+func (s *SelectService) GetUp(supplierTableName, supplierCertTableName, supplierCertSubTableName string, pageIndex, itemsPerPage int64, orderby string, asc bool, entitiesPtr interface{}, where string) (total int64) {
|
|
|
var resultsSlice []map[string][]byte
|
|
|
|
|
|
//获取总记录数
|
|
|
@@ -74,10 +74,13 @@ func (s *SelectService) GetUp(supplierTableName, supplierCertTableName string, p
|
|
|
sqlCount += ` where ` + where
|
|
|
|
|
|
var sql string
|
|
|
- sql = `select a.SupplierName,b.SupplierTypeCode, b.SupplierTypeName`
|
|
|
+ sql = `select max(a.SupplierName) as SupplierName,b.SupplierTypeCode, b.SupplierTypeName, count(b.Id) as AllUpNum `
|
|
|
sql += ` from ` + supplierTableName + ` a `
|
|
|
- sql += ` left join ` + supplierCertTableName + " b on b.SupplierId = a.Id"
|
|
|
+ sql += ` left join ` + supplierCertTableName + " b on b.SupplierId = a.Id "
|
|
|
+ sql += ` left join ` + supplierCertSubTableName + " c on c.SupplierCertId = b.Id "
|
|
|
sql += ` where ` + where
|
|
|
+ sql += ` group by b.Id `
|
|
|
+
|
|
|
if asc {
|
|
|
sql += ` order by ` + orderby + ` ASC `
|
|
|
} else {
|