|
|
@@ -24,7 +24,6 @@ func (s *SelectService) GetMyPagingEntitiesWithOrderBytbl(supplierTableName, sup
|
|
|
//获取总记录数
|
|
|
sqlCount := `select count(*) from ` + supplierTableName + ` a `
|
|
|
sqlCount += ` left join ` + supplierCertTableName + " b on b.SupplierId = a.Id"
|
|
|
- // sqlCount += ` left join ` + OilSupplierFileName + ` d on d.SupplierId = a.Id `
|
|
|
sqlCount += ` where ` + where
|
|
|
|
|
|
var sql string
|
|
|
@@ -45,7 +44,6 @@ func (s *SelectService) GetMyPagingEntitiesWithOrderBytbl(supplierTableName, sup
|
|
|
sql += ` (select c.OldSupplierName from OilInfoChange c where c.SupplierId=a.Id order by c.CreateOn desc limit 1) OldSupplierName `
|
|
|
sql += ` from ` + supplierTableName + ` a `
|
|
|
sql += ` left join ` + supplierCertTableName + ` b on b.SupplierId = a.Id) ab`
|
|
|
- // sql += ` left join ` + OilSupplierFileName + ` d on d.SupplierId = a.Id `
|
|
|
sql += ` where ` + where
|
|
|
if asc {
|
|
|
sql += ` order by ` + orderby + ` ASC `
|
|
|
@@ -68,30 +66,30 @@ func (s *SelectService) GetMyPagingEntitiesWithOrderBytbl(supplierTableName, sup
|
|
|
return total
|
|
|
}
|
|
|
|
|
|
-func (s *SelectService) GetUp(supplierTableName, supplierCertTableName, supplierCertSubTableName string, pageIndex, itemsPerPage int64, orderby string, asc bool, entitiesPtr interface{}, where string) (total int64) {
|
|
|
+func (s *SelectService) GetUp( supplierCertTableName string, pageIndex, itemsPerPage int64, orderby string, asc bool, entitiesPtr interface{}, where string) (total int64) {
|
|
|
var resultsSlice []map[string][]byte
|
|
|
|
|
|
- //获取总记录数
|
|
|
- sqlCount := `select count(*) from ` + supplierTableName + ` a `
|
|
|
- sqlCount += ` left join ` + supplierCertTableName + " b on b.SupplierId = a.Id"
|
|
|
- sqlCount += ` where ` + where
|
|
|
|
|
|
var sql string
|
|
|
- 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 ` + supplierCertSubTableName + " c on c.SupplierCertId = b.Id "
|
|
|
- sql += ` where ` + where
|
|
|
- sql += ` group by b.Id `
|
|
|
+ sql = ` select (select FullName from Base_Organize where Id = a.CommitComId) FullName,a.CommitComId,a.SupplierTypeName,`
|
|
|
+ sql +=` count(a.Status=6 or null ) HeGe,count(a.Status=-5 or null ) BuHeGe,count(a.Status=-5 or null ) + count(a.Status=6 or null ) ZongShu `
|
|
|
+ sql += ` from ` + supplierCertTableName + ` a `
|
|
|
+ sql += ` where a.CommitComId is not null and a.CommitComId!="" and a.CommitComId!=0 ` + where
|
|
|
+ sql += ` group by FullName,SupplierTypeName `
|
|
|
|
|
|
if asc {
|
|
|
sql += ` order by ` + orderby + ` ASC `
|
|
|
} else {
|
|
|
sql += ` order by ` + orderby + ` DESC `
|
|
|
}
|
|
|
+ //获取总记录数
|
|
|
+ sqlCount := `select count(*) from (` + sql+ `) a `
|
|
|
+
|
|
|
sql += ` limit ` + utils.ToStr((pageIndex-1)*itemsPerPage) + "," + utils.ToStr(itemsPerPage)
|
|
|
s.DBE.SQL(sql).Find(entitiesPtr)
|
|
|
|
|
|
+
|
|
|
+
|
|
|
resultsSlice, _ = s.DBE.Query(sqlCount)
|
|
|
|
|
|
if len(resultsSlice) > 0 {
|