|
|
@@ -65,6 +65,54 @@ func (s *OilSupplierService) GetMyPagingEntitiesWithOrderBytbl(supplierTableName
|
|
|
|
|
|
return total
|
|
|
}
|
|
|
+func (s *OilSupplierService) GetMyPagingEntitiesWithOrderBytbl2(supplierTableName, 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 DISTINCT a.*, b.Id as CertId, b.AccessCardNo, b.SupplierTypeCode, b.SupplierTypeName, b.InFlag, b.ApplyTime, `
|
|
|
+ sql += ` b.WorkerTotal, `
|
|
|
+ sql += ` b.ContractNum, `
|
|
|
+ sql += ` b.UniversityNum, `
|
|
|
+ sql += ` b.TechnicalNum, `
|
|
|
+ sql += ` b.AboveProfNum, `
|
|
|
+ sql += ` b.MiddleProfNum, `
|
|
|
+ sql += ` b.NationalRegNum, `
|
|
|
+ sql += ` b.NationalCertTotal, `
|
|
|
+ sql += ` b.DesignerTotal, `
|
|
|
+ sql += ` b.SkillerTotal, `
|
|
|
+ sql += ` b.Status, `
|
|
|
+ sql += ` b.WorkflowId, b.CreateOn ,b.ProcessKey,b.BusinessKey,b.BackRemark,b.IsRestrict`
|
|
|
+ sql += ` from ` + supplierTableName + ` a `
|
|
|
+ sql += ` left join ` + supplierCertTableName + " b on b.SupplierId = a.Id"
|
|
|
+ sql += ` left join ` + "OilSupplierCert2File c on c.SupplierId = a.Id and c.SupplierCertId = b.Id"
|
|
|
+ sql += ` where ` + where
|
|
|
+ if asc {
|
|
|
+ sql += ` order by ` + orderby + ` ASC `
|
|
|
+ } else {
|
|
|
+ sql += ` order by ` + orderby + ` DESC `
|
|
|
+ }
|
|
|
+ if (pageIndex != 0 && itemsPerPage !=0) {
|
|
|
+ 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 {
|
|
|
+ results := resultsSlice[0]
|
|
|
+ for _, value := range results {
|
|
|
+ total, _ = strconv.ParseInt(string(value), 10, 64)
|
|
|
+ break
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ return total
|
|
|
+}
|
|
|
|
|
|
func (s *OilSupplierService) CheckRepeatApplyInfo(supplierTableName, supplierCertTableName, typeCode, SupplierName, CommercialNo, OrganCode, BankAccount, CompanyUrl string, entitiesPtr interface{}) {
|
|
|
|