|
|
@@ -225,7 +225,7 @@ func (s *OilGoodsAptitudeService) GetPagingCheckedEntities(pageIndex, itemsPerPa
|
|
|
sql = `SELECT
|
|
|
a.Id,a.SupplierName,
|
|
|
b.SupplierTypeCode, b.SupplierTypeName,
|
|
|
- b.AccessCardNo,b.SupplierTypeCode, a.DepositBank,a.HseTraining,
|
|
|
+ b.AccessCardNo, a.DepositBank,a.HseTraining,
|
|
|
a.CompanyType,a.SetupTime,a.Address,a.Province,a.City,a.Street,
|
|
|
a.LegalPerson,a.RegCapital,a.Mobile,b.AuditDate,b.ApplyTime,b.InFlag,
|
|
|
a.ContactName,a.CommercialNo,a.LinkAddress,a.LinkProvince,
|
|
|
@@ -363,7 +363,7 @@ func (s *OilGoodsAptitudeService) GetPagingTmpCheckedEntities(pageIndex, itemsPe
|
|
|
sql = `SELECT
|
|
|
a.Id,a.SupplierName,
|
|
|
b.SupplierTypeCode, b.SupplierTypeName,
|
|
|
- b.AccessCardNo,b.SupplierTypeCode, a.DepositBank,a.HseTraining,
|
|
|
+ b.AccessCardNo, a.DepositBank,a.HseTraining,
|
|
|
a.CompanyType,a.SetupTime,a.Address,a.Province,a.City,a.Street,
|
|
|
a.LegalPerson,a.RegCapital,a.Mobile,b.AuditDate,b.ApplyTime,b.InFlag,
|
|
|
a.ContactName,a.CommercialNo,a.LinkAddress,a.LinkProvince,
|
|
|
@@ -421,51 +421,52 @@ func (s *OilGoodsAptitudeService) GetPagingTmpCheckedEntities(pageIndex, itemsPe
|
|
|
max(goods.F46) AS F46,
|
|
|
|
|
|
(
|
|
|
- if((max(goods.F01)='1' AND LOCATE('F01', group_concat(DISTINCT header.Code)) >= 0), TRUE, FALSE) AND
|
|
|
- if((max(goods.F02)='1' AND LOCATE('F02', group_concat(DISTINCT header.Code)) >= 0), TRUE, FALSE) AND
|
|
|
- if((max(goods.F03)='1' AND LOCATE('F03', group_concat(DISTINCT header.Code)) >= 0), TRUE, FALSE) AND
|
|
|
- if((max(goods.F04)='1' AND LOCATE('F04', group_concat(DISTINCT header.Code)) >= 0), TRUE, FALSE) AND
|
|
|
- if((max(goods.F05)='1' AND LOCATE('F05', group_concat(DISTINCT header.Code)) >= 0), TRUE, FALSE) AND
|
|
|
- if((max(goods.F06)='1' AND LOCATE('F06', group_concat(DISTINCT header.Code)) >= 0), TRUE, FALSE) AND
|
|
|
- if((max(goods.F07)='1' AND LOCATE('F07', group_concat(DISTINCT header.Code)) >= 0), TRUE, FALSE) AND
|
|
|
- if((max(goods.F08)='1' AND LOCATE('F08', group_concat(DISTINCT header.Code)) >= 0), TRUE, FALSE) AND
|
|
|
- if((max(goods.F09)='1' AND LOCATE('F09', group_concat(DISTINCT header.Code)) >= 0), TRUE, FALSE) AND
|
|
|
- if((max(goods.F10)='1' AND LOCATE('F10', group_concat(DISTINCT header.Code)) >= 0), TRUE, FALSE) AND
|
|
|
- if((max(goods.F11)='1' AND LOCATE('F12', group_concat(DISTINCT header.Code)) >= 0), TRUE, FALSE) AND
|
|
|
- if((max(goods.F13)='1' AND LOCATE('F13', group_concat(DISTINCT header.Code)) >= 0), TRUE, FALSE) AND
|
|
|
- if((max(goods.F14)='1' AND LOCATE('F14', group_concat(DISTINCT header.Code)) >= 0), TRUE, FALSE) AND
|
|
|
- if((max(goods.F15)='1' AND LOCATE('F15', group_concat(DISTINCT header.Code)) >= 0), TRUE, FALSE) AND
|
|
|
- if((max(goods.F16)='1' AND LOCATE('F16', group_concat(DISTINCT header.Code)) >= 0), TRUE, FALSE) AND
|
|
|
- if((max(goods.F17)='1' AND LOCATE('F17', group_concat(DISTINCT header.Code)) >= 0), TRUE, FALSE) AND
|
|
|
- if((max(goods.F18)='1' AND LOCATE('F18', group_concat(DISTINCT header.Code)) >= 0), TRUE, FALSE) AND
|
|
|
- if((max(goods.F19)='1' AND LOCATE('F19', group_concat(DISTINCT header.Code)) >= 0), TRUE, FALSE) AND
|
|
|
- if((max(goods.F20)='1' AND LOCATE('F20', group_concat(DISTINCT header.Code)) >= 0), TRUE, FALSE) AND
|
|
|
- if((max(goods.F21)='1' AND LOCATE('F21', group_concat(DISTINCT header.Code)) >= 0), TRUE, FALSE) AND
|
|
|
- if((max(goods.F22)='1' AND LOCATE('F22', group_concat(DISTINCT header.Code)) >= 0), TRUE, FALSE) AND
|
|
|
- if((max(goods.F23)='1' AND LOCATE('F23', group_concat(DISTINCT header.Code)) >= 0), TRUE, FALSE) AND
|
|
|
- if((max(goods.F24)='1' AND LOCATE('F24', group_concat(DISTINCT header.Code)) >= 0), TRUE, FALSE) AND
|
|
|
- if((max(goods.F25)='1' AND LOCATE('F25', group_concat(DISTINCT header.Code)) >= 0), TRUE, FALSE) AND
|
|
|
- if((max(goods.F26)='1' AND LOCATE('F26', group_concat(DISTINCT header.Code)) >= 0), TRUE, FALSE) AND
|
|
|
- if((max(goods.F27)='1' AND LOCATE('F27', group_concat(DISTINCT header.Code)) >= 0), TRUE, FALSE) AND
|
|
|
- if((max(goods.F28)='1' AND LOCATE('F28', group_concat(DISTINCT header.Code)) >= 0), TRUE, FALSE) AND
|
|
|
- if((max(goods.F29)='1' AND LOCATE('F29', group_concat(DISTINCT header.Code)) >= 0), TRUE, FALSE) AND
|
|
|
- if((max(goods.F30)='1' AND LOCATE('F30', group_concat(DISTINCT header.Code)) >= 0), TRUE, FALSE) AND
|
|
|
- if((max(goods.F31)='1' AND LOCATE('F31', group_concat(DISTINCT header.Code)) >= 0), TRUE, FALSE) AND
|
|
|
- if((max(goods.F32)='1' AND LOCATE('F32', group_concat(DISTINCT header.Code)) >= 0), TRUE, FALSE) AND
|
|
|
- if((max(goods.F33)='1' AND LOCATE('F33', group_concat(DISTINCT header.Code)) >= 0), TRUE, FALSE) AND
|
|
|
- if((max(goods.F34)='1' AND LOCATE('F34', group_concat(DISTINCT header.Code)) >= 0), TRUE, FALSE) AND
|
|
|
- if((max(goods.F35)='1' AND LOCATE('F35', group_concat(DISTINCT header.Code)) >= 0), TRUE, FALSE) AND
|
|
|
- if((max(goods.F36)='1' AND LOCATE('F36', group_concat(DISTINCT header.Code)) >= 0), TRUE, FALSE) AND
|
|
|
- if((max(goods.F37)='1' AND LOCATE('F37', group_concat(DISTINCT header.Code)) >= 0), TRUE, FALSE) AND
|
|
|
- if((max(goods.F38)='1' AND LOCATE('F38', group_concat(DISTINCT header.Code)) >= 0), TRUE, FALSE) AND
|
|
|
- if((max(goods.F39)='1' AND LOCATE('F39', group_concat(DISTINCT header.Code)) >= 0), TRUE, FALSE) AND
|
|
|
- if((max(goods.F40)='1' AND LOCATE('F40', group_concat(DISTINCT header.Code)) >= 0), TRUE, FALSE) AND
|
|
|
- if((max(goods.F41)='1' AND LOCATE('F41', group_concat(DISTINCT header.Code)) >= 0), TRUE, FALSE) AND
|
|
|
- if((max(goods.F42)='1' AND LOCATE('F42', group_concat(DISTINCT header.Code)) >= 0), TRUE, FALSE) AND
|
|
|
- if((max(goods.F43)='1' AND LOCATE('F43', group_concat(DISTINCT header.Code)) >= 0), TRUE, FALSE) AND
|
|
|
- if((max(goods.F44)='1' AND LOCATE('F44', group_concat(DISTINCT header.Code)) >= 0), TRUE, FALSE) AND
|
|
|
- if((max(goods.F45)='1' AND LOCATE('F45', group_concat(DISTINCT header.Code)) >= 0), TRUE, FALSE) AND
|
|
|
- if((max(goods.F46)='1' AND LOCATE('F46', group_concat(DISTINCT header.Code)) >= 0), TRUE, FALSE)
|
|
|
+ if((max(goods.F01)='1' AND LOCATE('F01', group_concat(DISTINCT header.Code)) > 0) or (max(goods.F01) is null) or (max(goods.F01) = ''), TRUE, FALSE) AND
|
|
|
+ if((max(goods.F02)='1' AND LOCATE('F02', group_concat(DISTINCT header.Code)) > 0) or (max(goods.F02) is null) or (max(goods.F02) = ''), TRUE, FALSE) AND
|
|
|
+ if((max(goods.F03)='1' AND LOCATE('F03', group_concat(DISTINCT header.Code)) > 0) or (max(goods.F03) is null) or (max(goods.F03) = ''), TRUE, FALSE) AND
|
|
|
+ if((max(goods.F04)='1' AND LOCATE('F04', group_concat(DISTINCT header.Code)) > 0) or (max(goods.F04) is null) or (max(goods.F04) = ''), TRUE, FALSE) AND
|
|
|
+ if((max(goods.F05)='1' AND LOCATE('F05', group_concat(DISTINCT header.Code)) > 0) or (max(goods.F05) is null) or (max(goods.F05) = ''), TRUE, FALSE) AND
|
|
|
+ if((max(goods.F06)='1' AND LOCATE('F06', group_concat(DISTINCT header.Code)) > 0) or (max(goods.F06) is null) or (max(goods.F06) = ''), TRUE, FALSE) AND
|
|
|
+ if((max(goods.F07)='1' AND LOCATE('F07', group_concat(DISTINCT header.Code)) > 0) or (max(goods.F07) is null) or (max(goods.F07) = ''), TRUE, FALSE) AND
|
|
|
+ if((max(goods.F08)='1' AND LOCATE('F08', group_concat(DISTINCT header.Code)) > 0) or (max(goods.F08) is null) or (max(goods.F08) = ''), TRUE, FALSE) AND
|
|
|
+ if((max(goods.F09)='1' AND LOCATE('F09', group_concat(DISTINCT header.Code)) > 0) or (max(goods.F09) is null) or (max(goods.F09) = ''), TRUE, FALSE) AND
|
|
|
+ if((max(goods.F10)='1' AND LOCATE('F10', group_concat(DISTINCT header.Code)) > 0) or (max(goods.F10) is null) or (max(goods.F10) = ''), TRUE, FALSE) AND
|
|
|
+ if((max(goods.F10)='1' AND LOCATE('F11', group_concat(DISTINCT header.Code)) > 0) or (max(goods.F11) is null) or (max(goods.F11) = ''), TRUE, FALSE) AND
|
|
|
+ if((max(goods.F11)='1' AND LOCATE('F12', group_concat(DISTINCT header.Code)) > 0) or (max(goods.F12) is null) or (max(goods.F12) = ''), TRUE, FALSE) AND
|
|
|
+ if((max(goods.F13)='1' AND LOCATE('F13', group_concat(DISTINCT header.Code)) > 0) or (max(goods.F13) is null) or (max(goods.F13) = ''), TRUE, FALSE) AND
|
|
|
+ if((max(goods.F14)='1' AND LOCATE('F14', group_concat(DISTINCT header.Code)) > 0) or (max(goods.F14) is null) or (max(goods.F14) = ''), TRUE, FALSE) AND
|
|
|
+ if((max(goods.F15)='1' AND LOCATE('F15', group_concat(DISTINCT header.Code)) > 0) or (max(goods.F15) is null) or (max(goods.F15) = ''), TRUE, FALSE) AND
|
|
|
+ if((max(goods.F16)='1' AND LOCATE('F16', group_concat(DISTINCT header.Code)) > 0) or (max(goods.F16) is null) or (max(goods.F16) = ''), TRUE, FALSE) AND
|
|
|
+ if((max(goods.F17)='1' AND LOCATE('F17', group_concat(DISTINCT header.Code)) > 0) or (max(goods.F17) is null) or (max(goods.F17) = ''), TRUE, FALSE) AND
|
|
|
+ if((max(goods.F18)='1' AND LOCATE('F18', group_concat(DISTINCT header.Code)) > 0) or (max(goods.F18) is null) or (max(goods.F18) = ''), TRUE, FALSE) AND
|
|
|
+ if((max(goods.F19)='1' AND LOCATE('F19', group_concat(DISTINCT header.Code)) > 0) or (max(goods.F19) is null) or (max(goods.F19) = ''), TRUE, FALSE) AND
|
|
|
+ if((max(goods.F20)='1' AND LOCATE('F20', group_concat(DISTINCT header.Code)) > 0) or (max(goods.F20) is null) or (max(goods.F20) = ''), TRUE, FALSE) AND
|
|
|
+ if((max(goods.F21)='1' AND LOCATE('F21', group_concat(DISTINCT header.Code)) > 0) or (max(goods.F21) is null) or (max(goods.F21) = ''), TRUE, FALSE) AND
|
|
|
+ if((max(goods.F22)='1' AND LOCATE('F22', group_concat(DISTINCT header.Code)) > 0) or (max(goods.F22) is null) or (max(goods.F22) = ''), TRUE, FALSE) AND
|
|
|
+ if((max(goods.F23)='1' AND LOCATE('F23', group_concat(DISTINCT header.Code)) > 0) or (max(goods.F23) is null) or (max(goods.F23) = ''), TRUE, FALSE) AND
|
|
|
+ if((max(goods.F24)='1' AND LOCATE('F24', group_concat(DISTINCT header.Code)) > 0) or (max(goods.F24) is null) or (max(goods.F24) = ''), TRUE, FALSE) AND
|
|
|
+ if((max(goods.F25)='1' AND LOCATE('F25', group_concat(DISTINCT header.Code)) > 0) or (max(goods.F25) is null) or (max(goods.F25) = ''), TRUE, FALSE) AND
|
|
|
+ if((max(goods.F26)='1' AND LOCATE('F26', group_concat(DISTINCT header.Code)) > 0) or (max(goods.F26) is null) or (max(goods.F26) = ''), TRUE, FALSE) AND
|
|
|
+ if((max(goods.F27)='1' AND LOCATE('F27', group_concat(DISTINCT header.Code)) > 0) or (max(goods.F27) is null) or (max(goods.F27) = ''), TRUE, FALSE) AND
|
|
|
+ if((max(goods.F28)='1' AND LOCATE('F28', group_concat(DISTINCT header.Code)) > 0) or (max(goods.F28) is null) or (max(goods.F28) = ''), TRUE, FALSE) AND
|
|
|
+ if((max(goods.F29)='1' AND LOCATE('F29', group_concat(DISTINCT header.Code)) > 0) or (max(goods.F29) is null) or (max(goods.F29) = ''), TRUE, FALSE) AND
|
|
|
+ if((max(goods.F30)='1' AND LOCATE('F30', group_concat(DISTINCT header.Code)) > 0) or (max(goods.F30) is null) or (max(goods.F30) = ''), TRUE, FALSE) AND
|
|
|
+ if((max(goods.F31)='1' AND LOCATE('F31', group_concat(DISTINCT header.Code)) > 0) or (max(goods.F31) is null) or (max(goods.F31) = ''), TRUE, FALSE) AND
|
|
|
+ if((max(goods.F32)='1' AND LOCATE('F32', group_concat(DISTINCT header.Code)) > 0) or (max(goods.F32) is null) or (max(goods.F32) = ''), TRUE, FALSE) AND
|
|
|
+ if((max(goods.F33)='1' AND LOCATE('F33', group_concat(DISTINCT header.Code)) > 0) or (max(goods.F33) is null) or (max(goods.F33) = ''), TRUE, FALSE) AND
|
|
|
+ if((max(goods.F34)='1' AND LOCATE('F34', group_concat(DISTINCT header.Code)) > 0) or (max(goods.F34) is null) or (max(goods.F34) = ''), TRUE, FALSE) AND
|
|
|
+ if((max(goods.F35)='1' AND LOCATE('F35', group_concat(DISTINCT header.Code)) > 0) or (max(goods.F35) is null) or (max(goods.F35) = ''), TRUE, FALSE) AND
|
|
|
+ if((max(goods.F36)='1' AND LOCATE('F36', group_concat(DISTINCT header.Code)) > 0) or (max(goods.F36) is null) or (max(goods.F36) = ''), TRUE, FALSE) AND
|
|
|
+ if((max(goods.F37)='1' AND LOCATE('F37', group_concat(DISTINCT header.Code)) > 0) or (max(goods.F37) is null) or (max(goods.F37) = ''), TRUE, FALSE) AND
|
|
|
+ if((max(goods.F38)='1' AND LOCATE('F38', group_concat(DISTINCT header.Code)) > 0) or (max(goods.F38) is null) or (max(goods.F38) = ''), TRUE, FALSE) AND
|
|
|
+ if((max(goods.F39)='1' AND LOCATE('F39', group_concat(DISTINCT header.Code)) > 0) or (max(goods.F39) is null) or (max(goods.F39) = ''), TRUE, FALSE) AND
|
|
|
+ if((max(goods.F40)='1' AND LOCATE('F40', group_concat(DISTINCT header.Code)) > 0) or (max(goods.F40) is null) or (max(goods.F40) = ''), TRUE, FALSE) AND
|
|
|
+ if((max(goods.F41)='1' AND LOCATE('F41', group_concat(DISTINCT header.Code)) > 0) or (max(goods.F41) is null) or (max(goods.F41) = ''), TRUE, FALSE) AND
|
|
|
+ if((max(goods.F42)='1' AND LOCATE('F42', group_concat(DISTINCT header.Code)) > 0) or (max(goods.F42) is null) or (max(goods.F42) = ''), TRUE, FALSE) AND
|
|
|
+ if((max(goods.F43)='1' AND LOCATE('F43', group_concat(DISTINCT header.Code)) > 0) or (max(goods.F43) is null) or (max(goods.F43) = ''), TRUE, FALSE) AND
|
|
|
+ if((max(goods.F44)='1' AND LOCATE('F44', group_concat(DISTINCT header.Code)) > 0) or (max(goods.F44) is null) or (max(goods.F44) = ''), TRUE, FALSE) AND
|
|
|
+ if((max(goods.F45)='1' AND LOCATE('F45', group_concat(DISTINCT header.Code)) > 0) or (max(goods.F45) is null) or (max(goods.F45) = ''), TRUE, FALSE) AND
|
|
|
+ if((max(goods.F46)='1' AND LOCATE('F46', group_concat(DISTINCT header.Code)) > 0) or (max(goods.F46) is null) or (max(goods.F46) = ''), TRUE, FALSE)
|
|
|
) AS checked
|
|
|
|
|
|
FROM OilSupplier a
|
|
|
@@ -485,7 +486,7 @@ func (s *OilGoodsAptitudeService) GetPagingTmpCheckedEntities(pageIndex, itemsPe
|
|
|
}
|
|
|
sql += ` limit ` + utils.ToStr((pageIndex-1)*itemsPerPage) + "," + utils.ToStr(itemsPerPage)
|
|
|
|
|
|
- sqlCount := "SELECT count(*) as total FROM OilSupplier a LEFT JOIN OilSupplierCert b ON a.Id=b.SupplierId WHERE b.SupplierTypeCode='01'"
|
|
|
+ sqlCount := "SELECT count(DISTINCT a.Id) as total FROM OilSupplier a LEFT JOIN OilSupplierCert b ON a.Id=b.SupplierId LEFT JOIN OilSupplierCertSub sub ON b.Id=sub.SupplierCertId LEFT JOIN OilSupplierFile files ON a.Id=files.SupplierId LEFT JOIN Base_TableHeader header ON files.NeedFileType=header.Name LEFT JOIN tmp_OilGoodsAptitudeClass class ON sub.Code=class.Code LEFT JOIN tmp_OilGoodsAptitude goods ON class.Id=goods.ClassId WHERE b.SupplierTypeCode='01' AND " + having
|
|
|
|
|
|
var totalResult TotalResult
|
|
|
s.DBE.SQL(sql).Find(entitiesPtr)
|