瀏覽代碼

资质准入范围查询

Signed-off-by: lijunqing <lijunqing@dashoo.cn>
lijunqing 6 年之前
父節點
當前提交
7a887b6178

+ 25 - 22
src/dashoo.cn/backend/api/business/oilsupplier/selectbusiness/selectservice.go

@@ -18,33 +18,36 @@ func GetSelectService(xormEngine *xorm.Engine) *SelectService {
 	return s
 }
 
-func (s *SelectService) GetMyPagingEntitiesWithOrderBytbl(supplierTableName, supplierCertTableName, OilInfoChangeName, OilSupplierFileName string, pageIndex, itemsPerPage int64, orderby string, asc bool, entitiesPtr interface{}, where string) (total int64) {
+func (s *SelectService) GetMyPagingEntitiesWithOrderBytbl(supplierTableName, supplierCertTableName, OilInfoChangeName, OilSupplierCert2FileName string, pageIndex, itemsPerPage int64, orderby string, asc bool, entitiesPtr interface{}, where,having 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
+	sqlCount := `select count(*) from (`
+	sqlCount += `select a.Id,a.SupplierName,b.AccessCardNo,max(c.OldSupplierName) OldSupplierName,b.SupplierTypeCode,`
+	sqlCount += `a.LegalPerson,a.RegCapital,a.Mobile,b.AuditDate,b.ApplyTime,b.InFlag,a.ContactName,a.CommercialNo, `
+	sqlCount += `a.DepositBank,a.HseTraining,a.CompanyType,a.SetupTime,a.Address,a.Province,a.City,a.Street, `
+	sqlCount += `a.LinkAddress,a.LinkProvince,a.LinkCity,a.LinkStreet,a.BusinessScope, `
+	sqlCount += `group_concat(distinct d.Name) CerSubName,group_concat(distinct d.NeedFileType) NeedFileType `
+	sqlCount += `from ` + supplierTableName + ` a `
+	sqlCount += `left join ` + supplierCertTableName + ` b on b.SupplierId = a.Id `
+	sqlCount += `left join ` + OilInfoChangeName + ` c  on c.SupplierId = a.Id `
+	sqlCount += `left join ` + OilSupplierCert2FileName + ` d  on d.SupplierId = b.Id `
+	sqlCount += `where ` + where
+	sqlCount += `group by a.Id,b.Id `+having+`) f`
 
 	var sql string
-	sql = `select * from (select a.*, b.Id as CertId, b.AccessCardNo, b.SupplierTypeCode, b.SupplierTypeName, b.InFlag, b.AuditDate,`
-	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, `
-	sql += ` b.ApplyTime, `
-	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 += ` where ` + where
+	sql = `select a.Id,a.SupplierName,b.AccessCardNo,max(c.OldSupplierName) OldSupplierName,b.SupplierTypeCode,`
+	sql += `a.LegalPerson,a.RegCapital,a.Mobile,b.AuditDate,b.ApplyTime,b.InFlag,a.ContactName,a.CommercialNo, `
+	sql += `a.DepositBank,a.HseTraining,a.CompanyType,a.SetupTime,a.Address,a.Province,a.City,a.Street, `
+	sql += `a.LinkAddress,a.LinkProvince,a.LinkCity,a.LinkStreet,a.BusinessScope, `
+	sql += `group_concat(distinct d.Name) CerSubName,group_concat(distinct d.NeedFileType) NeedFileType `
+	sql += `from ` + supplierTableName + ` a `
+	sql += `left join ` + supplierCertTableName + ` b on b.SupplierId = a.Id `
+	sql += `left join ` + OilInfoChangeName + ` c  on c.SupplierId = a.Id `
+	sql += `left join ` + OilSupplierCert2FileName + ` d  on d.SupplierId = b.Id `
+	sql += `where ` + where
+
+	sql += ` group by a.Id,b.Id ` + having
 	if asc {
 		sql += ` order by ` + orderby + ` ASC `
 	} else {

+ 111 - 72
src/dashoo.cn/backend/api/business/oilsupplier/supplier/oilsupplier.go

@@ -6,82 +6,81 @@ import (
 
 
 type OilSupplier struct {
-	Id                 int       `xorm:"not null pk autoincr INT(10)"`
-	SupplierName       string    `xorm:"comment('企业名称') VARCHAR(255)"`
-	OilCertificateNo   string    `xorm:"comment('中石油供应商证书号') VARCHAR(50)"`
-	Grade              string    `xorm:"comment('级别') VARCHAR(2)"`
-	MgrUnit            string    `xorm:"comment('管理单位') VARCHAR(50)"`
-	OperType           string    `xorm:"comment('经营方式') VARCHAR(50)"`
-	Country            string    `xorm:"comment('国家') VARCHAR(20)"`
-	MaunAgent          string    `xorm:"comment('所代理制造商名称') VARCHAR(100)"`
-	ConstructTeam      string    `xorm:"comment('施工队伍名称') VARCHAR(100)"`
-	CredentialFlag     string    `xorm:"default '1' comment('证件合一标志') VARCHAR(5)"`
-	CommercialNo       string    `xorm:"comment('工商注册号') VARCHAR(50)"`
-	OrganCode          string    `xorm:"comment('组织机构代码') VARCHAR(50)"`
-	CountryTaxNo       string    `xorm:"comment('税务登记证国税编号') VARCHAR(50)"`
-	LocalTaxNo         string    `xorm:"comment('税务登记证地税编号') VARCHAR(50)"`
-	Address            string    `xorm:"comment('单位地址') VARCHAR(500)"`
-	Province           string    `xorm:"comment('省直辖市') VARCHAR(20)"`
-	City               string    `xorm:"comment('地市区县') VARCHAR(20)"`
-	Street             string    `xorm:"comment('街道') VARCHAR(20)"`
-	HouseNo            string    `xorm:"comment('门牌号') VARCHAR(10)"`
-	ZipCode            string    `xorm:"comment('邮编') VARCHAR(20)"`
-	LinkAddress        string    `xorm:"comment('通信地址-单位地址') VARCHAR(500)"`
-	LinkProvince       string    `xorm:"comment('通信地址-省直辖市') VARCHAR(20)"`
-	LinkCity           string    `xorm:"comment('通信地址-地市区县') VARCHAR(20)"`
-	LinkStreet         string    `xorm:"comment('通信地址-街道') VARCHAR(20)"`
-	LinkHouseNo        string    `xorm:"comment('通信地址-门牌号') VARCHAR(10)"`
-	LinkZipCode        string    `xorm:"comment('通信地址-邮编') VARCHAR(20)"`
-	HseTraining        string    `xorm:"comment('是否需要进行HSE审查培训') VARCHAR(2)"`
-	QualitySystemCert  string    `xorm:"comment('质量管理体系认证情况及认证机构') VARCHAR(200)"`
-	ProductQualityCert string    `xorm:"comment('产品质量认证情况及认证机构') VARCHAR(200)"`
-	MaunLicense        string    `xorm:"comment('生产制造许可证获证情况及编号') VARCHAR(200)"`
-	QualifCert         string    `xorm:"comment('企业资质证书编号') VARCHAR(200)"`
-	QualifCertLevel    string    `xorm:"comment('企业资质证书级别') VARCHAR(10)"`
-	SafetyLicense      string    `xorm:"comment('安全生产许可证') VARCHAR(200)"`
-	TechServiceLic     string    `xorm:"comment('技术服务类准入许可证') VARCHAR(200)"`
-	TjinNotify         string    `xorm:"comment('外地企业进津备案通知书') VARCHAR(50)"`
-	SpecIndustryCert   string    `xorm:"comment('行业特殊要求的认证证书') VARCHAR(200)"`
-	BusinessScope      string    `xorm:"comment('营业范围') TEXT"`
-	LegalPerson        string    `xorm:"comment('法定代表人姓名') VARCHAR(20)"`
-	CategoryCode       string    `xorm:"comment('行业类别代码') VARCHAR(10)"`
-	CategoryName       string    `xorm:"comment('行业类别名称') VARCHAR(20)"`
-	RegCapital         float64   `xorm:"default 0 comment('注册资本') FLOAT"`
-	Currency           string    `xorm:"comment('币种') VARCHAR(10)"`
-	ContactName        string    `xorm:"comment('联系人姓名') VARCHAR(20)"`
-	CompanyType        string    `xorm:"comment('公司类型') VARCHAR(20)"`
-	SetupTime          time.Time `xorm:"comment('成立时间') Date"`
-	DepositBank        string    `xorm:"comment('开户银行') VARCHAR(50)"`
-	BankAccount        string    `xorm:"comment('银行账号') VARCHAR(50)"`
-	EMail              string    `xorm:"comment('电子邮箱') VARCHAR(50)"`
-	BankCreditRating   string    `xorm:"comment('银行信用等级') VARCHAR(10)"`
-	Mobile             string    `xorm:"comment('移动电话') VARCHAR(20)"`
-	Telphone           string    `xorm:"comment('固定电话') VARCHAR(20)"`
-	Fax                string    `xorm:"comment('传真') VARCHAR(20)"`
-	CompanyTel         string    `xorm:"comment('公司电话') VARCHAR(20)"`
-	QQ                 string    `xorm:"comment('QQ号码') VARCHAR(20)"`
-	CompanyUrl         string    `xorm:"comment('公司网址') VARCHAR(20)"`
-	SpecSupplier       string    `xorm:"default '0' comment('是否特殊业务供应商(可不招标)') VARCHAR(2)"`
-	SpecTypeCode       string    `xorm:"comment('业务类型(1战略合作,2内部多经,3区域关键,4专业化实施)') VARCHAR(2)"`
-	SpecTypeName       string    `xorm:"comment('业务类型(1战略合作,2内部多经,3区域关键,4专业化实施)') VARCHAR(20)"`
-	WZAccessCardNo     string    `xorm:"comment('准入证编码--物质') VARCHAR(20)"`
-	JSAccessCardNo     string    `xorm:"comment('准入证编码--基建') VARCHAR(20)"`
-	JFAccessCardNo     string    `xorm:"comment('准入证编码--技术服务类') VARCHAR(20)"`
-	Remark             string    `xorm:"comment('备注') VARCHAR(500)"`
-	IsDelete           int       `xorm:"default 0 comment('删除状态,0正常,1已删除') INT(10)"`
-	CreateOn           time.Time `xorm:"DATETIME"`
-	CreateUserId       int       `xorm:"INT(10)"`
-	CreateBy           string    `xorm:"VARCHAR(50)"`
-	ModifiedOn         time.Time `xorm:"DATETIME"`
-	ModifiedUserId     int       `xorm:"INT(10)"`
-	ModifiedBy         string    `xorm:"VARCHAR(50)"`
-	PACNumber          string    `xorm:"comment('中石油准入证编号') VARCHAR(50)"`
-	SupplierCertificate string   `xorm:"comment('中石油物资供应商证书') VARCHAR(200)"`
+	Id                  int       `xorm:"not null pk autoincr INT(10)"`
+	SupplierName        string    `xorm:"comment('企业名称') VARCHAR(255)"`
+	OilCertificateNo    string    `xorm:"comment('中石油供应商证书号') VARCHAR(50)"`
+	Grade               string    `xorm:"comment('级别') VARCHAR(2)"`
+	MgrUnit             string    `xorm:"comment('管理单位') VARCHAR(50)"`
+	OperType            string    `xorm:"comment('经营方式') VARCHAR(50)"`
+	Country             string    `xorm:"comment('国家') VARCHAR(20)"`
+	MaunAgent           string    `xorm:"comment('所代理制造商名称') VARCHAR(100)"`
+	ConstructTeam       string    `xorm:"comment('施工队伍名称') VARCHAR(100)"`
+	CredentialFlag      string    `xorm:"default '1' comment('证件合一标志') VARCHAR(5)"`
+	CommercialNo        string    `xorm:"comment('工商注册号') VARCHAR(50)"`
+	OrganCode           string    `xorm:"comment('组织机构代码') VARCHAR(50)"`
+	CountryTaxNo        string    `xorm:"comment('税务登记证国税编号') VARCHAR(50)"`
+	LocalTaxNo          string    `xorm:"comment('税务登记证地税编号') VARCHAR(50)"`
+	Address             string    `xorm:"comment('单位地址') VARCHAR(500)"`
+	Province            string    `xorm:"comment('省直辖市') VARCHAR(20)"`
+	City                string    `xorm:"comment('地市区县') VARCHAR(20)"`
+	Street              string    `xorm:"comment('街道') VARCHAR(20)"`
+	HouseNo             string    `xorm:"comment('门牌号') VARCHAR(10)"`
+	ZipCode             string    `xorm:"comment('邮编') VARCHAR(20)"`
+	LinkAddress         string    `xorm:"comment('通信地址-单位地址') VARCHAR(500)"`
+	LinkProvince        string    `xorm:"comment('通信地址-省直辖市') VARCHAR(20)"`
+	LinkCity            string    `xorm:"comment('通信地址-地市区县') VARCHAR(20)"`
+	LinkStreet          string    `xorm:"comment('通信地址-街道') VARCHAR(20)"`
+	LinkHouseNo         string    `xorm:"comment('通信地址-门牌号') VARCHAR(10)"`
+	LinkZipCode         string    `xorm:"comment('通信地址-邮编') VARCHAR(20)"`
+	HseTraining         string    `xorm:"comment('是否需要进行HSE审查培训') VARCHAR(2)"`
+	QualitySystemCert   string    `xorm:"comment('质量管理体系认证情况及认证机构') VARCHAR(200)"`
+	ProductQualityCert  string    `xorm:"comment('产品质量认证情况及认证机构') VARCHAR(200)"`
+	MaunLicense         string    `xorm:"comment('生产制造许可证获证情况及编号') VARCHAR(200)"`
+	QualifCert          string    `xorm:"comment('企业资质证书编号') VARCHAR(200)"`
+	QualifCertLevel     string    `xorm:"comment('企业资质证书级别') VARCHAR(10)"`
+	SafetyLicense       string    `xorm:"comment('安全生产许可证') VARCHAR(200)"`
+	TechServiceLic      string    `xorm:"comment('技术服务类准入许可证') VARCHAR(200)"`
+	TjinNotify          string    `xorm:"comment('外地企业进津备案通知书') VARCHAR(50)"`
+	SpecIndustryCert    string    `xorm:"comment('行业特殊要求的认证证书') VARCHAR(200)"`
+	BusinessScope       string    `xorm:"comment('营业范围') TEXT"`
+	LegalPerson         string    `xorm:"comment('法定代表人姓名') VARCHAR(20)"`
+	CategoryCode        string    `xorm:"comment('行业类别代码') VARCHAR(10)"`
+	CategoryName        string    `xorm:"comment('行业类别名称') VARCHAR(20)"`
+	RegCapital          float64   `xorm:"default 0 comment('注册资本') FLOAT"`
+	Currency            string    `xorm:"comment('币种') VARCHAR(10)"`
+	ContactName         string    `xorm:"comment('联系人姓名') VARCHAR(20)"`
+	CompanyType         string    `xorm:"comment('公司类型') VARCHAR(20)"`
+	SetupTime           time.Time `xorm:"comment('成立时间') Date"`
+	DepositBank         string    `xorm:"comment('开户银行') VARCHAR(50)"`
+	BankAccount         string    `xorm:"comment('银行账号') VARCHAR(50)"`
+	EMail               string    `xorm:"comment('电子邮箱') VARCHAR(50)"`
+	BankCreditRating    string    `xorm:"comment('银行信用等级') VARCHAR(10)"`
+	Mobile              string    `xorm:"comment('移动电话') VARCHAR(20)"`
+	Telphone            string    `xorm:"comment('固定电话') VARCHAR(20)"`
+	Fax                 string    `xorm:"comment('传真') VARCHAR(20)"`
+	CompanyTel          string    `xorm:"comment('公司电话') VARCHAR(20)"`
+	QQ                  string    `xorm:"comment('QQ号码') VARCHAR(20)"`
+	CompanyUrl          string    `xorm:"comment('公司网址') VARCHAR(20)"`
+	SpecSupplier        string    `xorm:"default '0' comment('是否特殊业务供应商(可不招标)') VARCHAR(2)"`
+	SpecTypeCode        string    `xorm:"comment('业务类型(1战略合作,2内部多经,3区域关键,4专业化实施)') VARCHAR(2)"`
+	SpecTypeName        string    `xorm:"comment('业务类型(1战略合作,2内部多经,3区域关键,4专业化实施)') VARCHAR(20)"`
+	WZAccessCardNo      string    `xorm:"comment('准入证编码--物质') VARCHAR(20)"`
+	JSAccessCardNo      string    `xorm:"comment('准入证编码--基建') VARCHAR(20)"`
+	JFAccessCardNo      string    `xorm:"comment('准入证编码--技术服务类') VARCHAR(20)"`
+	Remark              string    `xorm:"comment('备注') VARCHAR(500)"`
+	IsDelete            int       `xorm:"default 0 comment('删除状态,0正常,1已删除') INT(10)"`
+	CreateOn            time.Time `xorm:"DATETIME"`
+	CreateUserId        int       `xorm:"INT(10)"`
+	CreateBy            string    `xorm:"VARCHAR(50)"`
+	ModifiedOn          time.Time `xorm:"DATETIME"`
+	ModifiedUserId      int       `xorm:"INT(10)"`
+	ModifiedBy          string    `xorm:"VARCHAR(50)"`
+	PACNumber           string    `xorm:"comment('中石油准入证编号') VARCHAR(50)"`
+	SupplierCertificate string    `xorm:"comment('中石油物资供应商证书') VARCHAR(200)"`
 }
 
 type OilSupplierView struct {
 	OilSupplier       `xorm:"extends"`
-	OldSupplierName   string    `xorm:"comment('曾用名') VARCHAR(255)"`
 	CertId            string
 	AccessCardNo      string
 	SupplierTypeCode  string
@@ -129,3 +128,43 @@ type OilSupplierView struct {
 	BusinessKey       string    `xorm:"VARCHAR(255)"`
 	AuditIndex        int       `xorm:"INT(10)"`
 }
+
+type OilSupplierSelect struct {
+	Id               int		//Oilsupplier表id
+	AccessCardNo     string    //准入证号
+	SupplierName     string    //企业名称
+	OldSupplierName  string    //企业曾用名
+	SupplierTypeCode string    //准入类别编号
+	LegalPerson      string    //法定代表人姓名
+	RegCapital       float64   //注册资本
+	Mobile           string    //移动电话
+	AuditDate        time.Time //最后一次年审
+	ApplyTime        time.Time //有效期至
+	InFlag           string    //状态
+	ContactName      string    //联系人姓名
+	CommercialNo     string    //统一社会信用代码
+	DepositBank      string    //开户银行
+	HseTraining      string    //是否需要进行HSE审查培训
+	CompanyType      string    //公司类型
+	SetupTime        time.Time //成立时间
+	Address          string    //注册详细地址
+	Province         string    //注册省
+	City             string    //注册市
+	Street           string    //注册区
+	LinkAddress      string    //通信详细地址
+	LinkProvince     string    //通信地址省
+	LinkCity         string    //通信地址市
+	LinkStreet       string    //通信地址区
+	BusinessScope    string    //营业范围
+	NeedFileType     string    //资质
+	CerSubName       string    //准入范围
+}
+
+//type NeedFileTypeStruct struct {
+//	NeedFileType []string
+//	CertSubName string
+//}
+type RegCapitalRange struct {
+	RegCapital1 string
+	RegCapital2 string
+}

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

@@ -1,13 +1,11 @@
 package oilsupplier
 
 import (
-	"encoding/json"
-	"fmt"
-
 	"dashoo.cn/backend/api/business/oilsupplier/annualaudit"
 	"dashoo.cn/backend/api/business/oilsupplier/infochange"
 	"dashoo.cn/backend/api/business/oilsupplier/qualchange"
 	"dashoo.cn/backend/api/business/oilsupplier/suppliercertappend"
+	"encoding/json"
 
 	// "fmt"
 
@@ -21,10 +19,7 @@ type SelectController struct {
 	BaseController
 }
 
-type RegCapitalRange struct {
-	RegCapital1 string
-	RegCapital2 string
-}
+
 type UpSearch struct {
 	FullName string
 }
@@ -37,10 +32,6 @@ type UpInfoSearch struct {
 	Reason              string
 }
 
-type NeedFileTypeStruct struct {
-	NeedFileType []string
-	CertSubName string
-}
 
 // @Title 获取所有
 // @Description
@@ -48,122 +39,122 @@ type NeedFileTypeStruct struct {
 // @router /getcompanylist [post]
 func (this *SelectController) GetTList() {
 
-	var model supplier.OilSupplierView
-	var model1 RegCapitalRange    //注册资金范围
-	var model2 NeedFileTypeStruct //资质结构体
+	var model  supplier.OilSupplierSelect
+	var model1 supplier.RegCapitalRange    //注册资金范围
+	//var model2 supplier.NeedFileTypeStruct //资质结构体
 
 	var jsonBlob = this.Ctx.Input.RequestBody
 	json.Unmarshal(jsonBlob, &model)
 	json.Unmarshal(jsonBlob, &model1)
-	json.Unmarshal(jsonBlob, &model2)
+	//json.Unmarshal(jsonBlob, &model2)
 
 	// //获取分页信息
 	page := this.GetPageInfoForm()
-	where := " 1=1"
-	orderby := "ab.Id"
-	asc := false
+	where := " 1=1 "
+	orderby := "a.Id"
+	asc := true
 	Order := this.GetString("Order")
 	Prop := this.GetString("Prop")
-	fmt.Println(Prop)
+
 	if Order != "" && Prop != "" {
-		orderby = "ab." + Prop
-		if Order == "asc" {
-			asc = true
+		orderby = Prop
+		if Order == "desc" {
+			asc = false
 		}
 	}
 
 	//准入证号
 	if model.AccessCardNo != "" {
-		where = where + " and ab.AccessCardNo like '%" + model.AccessCardNo + "%'"
+		where = where + " and b.AccessCardNo like '%" + model.AccessCardNo + "%'"
 	}
 	//企业名称
 	if model.SupplierName != "" {
-		where = where + " and ab.SupplierName like '%" + model.SupplierName + "%'"
+		where = where + " and a.SupplierName like '%" + model.SupplierName + "%'"
 	}
 
 	if model.OldSupplierName != "" {
-		where = where + " and ab.OldSupplierName like '%" + model.OldSupplierName + "%'"
+		where = where + " and OldSupplierName like '%" + model.OldSupplierName + "%'"
 	}
 
 	//准入类别(基建,物资,技术服务)
 	if model.SupplierTypeCode != "" {
-		where = where + " and ab.SupplierTypeCode = '" + model.SupplierTypeCode + "'"
+		where = where + " and b.SupplierTypeCode = '" + model.SupplierTypeCode + "'"
 	}
 	//准入标识 1 准入 2 暂停 3取消
 	if model.InFlag != "" {
-		where = where + " and ab.InFlag = '" + model.InFlag + "'"
+		where = where + " and b.InFlag = '" + model.InFlag + "'"
 	}
 	//法人
 	if model.LegalPerson != "" {
-		where = where + " and ab.LegalPerson like '%" + model.LegalPerson + "%'"
+		where = where + " and a.LegalPerson like '%" + model.LegalPerson + "%'"
 	}
 	//联系人
 	if model.ContactName != "" {
-		where = where + " and ab.ContactName like '%" + model.ContactName + "%'"
+		where = where + " and a.ContactName like '%" + model.ContactName + "%'"
 	}
 	//统一社会信用代码
 	if model.CommercialNo != "" {
-		where = where + " and ab.CommercialNo like '%" + model.CommercialNo + "%'"
+		where = where + " and a.CommercialNo like '%" + model.CommercialNo + "%'"
 	}
 	//开户银行
 	if model.DepositBank != "" {
-		where = where + " and ab.DepositBank like '%" + model.DepositBank + "%'"
+		where = where + " and a.DepositBank like '%" + model.DepositBank + "%'"
 	}
 	//HSE审查
 	if model.HseTraining != "" {
-		where = where + " and ab.HseTraining = '" + model.HseTraining + "'"
+		where = where + " and a.HseTraining = '" + model.HseTraining + "'"
 	}
 	//公司类型
 	if model.CompanyType != "" {
-		where = where + " and ab.CompanyType like '%" + model.CompanyType + "%'"
+		where = where + " and a.CompanyType like '%" + model.CompanyType + "%'"
 	}
 	//成立时间
 	SetupTime := this.GetString("SetupTime")
 	if SetupTime != "" {
-		where = where + " and ab.SetupTime ='" + SetupTime + "'"
+		where = where + " and a.SetupTime ='" + SetupTime + "'"
 	}
 	//注册资金范围
 	if model1.RegCapital1 != "" {
-		where = where + " and ab.RegCapital >= '" + model1.RegCapital1 + "'"
+		where = where + " and a.RegCapital >= '" + model1.RegCapital1 + "'"
 	}
 	if model1.RegCapital2 != "" {
-		where = where + " and ab.RegCapital <= '" + model1.RegCapital2 + "'"
+		where = where + " and a.RegCapital <= '" + model1.RegCapital2 + "'"
 	}
 
 	//注册省份
 	if model.Province != "" {
-		where = where + " and ab.Province = '" + model.Province + "'"
+		where = where + " and a.Province = '" + model.Province + "'"
 	}
 	//注册市
 	if model.City != "" {
-		where = where + " and ab.City = '" + model.City + "'"
+		where = where + " and a.City = '" + model.City + "'"
 	}
 	//注册区
 	if model.Street != "" {
-		where = where + " and ab.Street = '" + model.Street + "'"
+		where = where + " and a.Street = '" + model.Street + "'"
 	}
 	//注册详细地址
 	if model.Address != "" {
-		where = where + " and ab.Address like '%" + model.Address + "%'"
+		where = where + " and a.Address like '%" + model.Address + "%'"
 	}
 	if model.LinkProvince != "" {
-		where = where + " and ab.LinkProvince = '" + model.LinkProvince + "'"
+		where = where + " and a.LinkProvince = '" + model.LinkProvince + "'"
 	}
 	if model.LinkCity != "" {
-		where = where + " and ab.LinkCity = '" + model.LinkCity + "'"
+		where = where + " and a.LinkCity = '" + model.LinkCity + "'"
 	}
 	if model.LinkStreet != "" {
-		where = where + " and ab.LinkStreet = '" + model.LinkStreet + "'"
+		where = where + " and a.LinkStreet = '" + model.LinkStreet + "'"
 	}
 	if model.LinkAddress != "" {
-		where = where + " and ab.LinkAddress like '%" + model.LinkAddress + "%'"
+		where = where + " and a.LinkAddress like '%" + model.LinkAddress + "%'"
 	}
 	//营业范围
 	if model.BusinessScope != "" {
-		where = where + " and ab.BusinessScope like '%" + model.BusinessScope + "%'"
+		where = where + " and a.BusinessScope like '%" + model.BusinessScope + "%'"
 	}
 
-	////包含资质(有问题)
+	//包含资质
 	//if model2.NeedFileType != nil && len(model2.NeedFileType) > 0 {
 	//	pararm := ""
 	//	for i := 0; i < len(model2.NeedFileType); i++ {
@@ -174,15 +165,23 @@ func (this *SelectController) GetTList() {
 	//	fmt.Println(pararm[0 : len(pararm)-1])
 	//	where = where + " and d.NeedFileType in (" + pararm[0:len(pararm)-1] + ")"
 	//}
-	//
-	////包含准入范围(有问题)
-	//if model2.CertSubName!="" {
-	//
-	//}
+
+	having:=""
+	//准入范围
+	if model.CerSubName!="" {
+		having = " having CerSubName like '%"+model.CerSubName+"%' "
+	}
+	//资质
+	if model.NeedFileType!="" {
+		having = " having NeedFileType like '%"+model.NeedFileType+"%' "
+	}
+	if model.CerSubName!=""&& model.NeedFileType!=""{
+		having = " having CerSubName like '%"+model.CerSubName+"%' and  NeedFileType like '%"+model.NeedFileType+"%' "
+	}
 	svc := selectbusiness.GetSelectService(utils.DBE)
-	var list []supplier.OilSupplierView
+	var list []supplier.OilSupplierSelect
 
-	total := svc.GetMyPagingEntitiesWithOrderBytbl(OilSupplierName, OilSupplierCertName, OilInfoChangeName, OilSupplierFileName, page.CurrentPage, page.Size, orderby, asc, &list, where)
+	total := svc.GetMyPagingEntitiesWithOrderBytbl(OilSupplierName, OilSupplierCertName, OilInfoChangeName,OilSupplierCert2FileName , page.CurrentPage, page.Size, orderby, asc, &list, where,having)
 
 	var datainfo DataInfo
 	datainfo.Items = list

+ 28 - 3
src/dashoo.cn/frontend_web/src/pages/select/companyselect/index.vue

@@ -76,7 +76,11 @@
         <el-table-column label="准入证号" prop="AccessCardNo" sortable align="center"></el-table-column>
         <el-table-column label="企业名称" prop="SupplierName" sortable align="center"></el-table-column>
         <el-table-column label="企业曾用名" prop="OldSupplierName" align="center"></el-table-column>
-        <el-table-column label="准入类别" prop="SupplierTypeName" align="center"></el-table-column>
+        <el-table-column label="准入类别" prop="SupplierTypeCode" align="center">
+          <template slot-scope="scope">
+              {{transferStr(scope.row.SupplierTypeCode)}}
+          </template>
+        </el-table-column>
         <el-table-column label="法人代表" prop="LegalPerson" align="center"></el-table-column>
         <el-table-column label="注册资金(万元)" prop="RegCapital" width="180px" sortable align="center"></el-table-column>
         <el-table-column label="移动电话" prop="Mobile" align="center"></el-table-column>
@@ -408,6 +412,8 @@
       </el-form>
     </el-dialog>
 
+
+    <!--查询框-->
     <el-dialog title="高级查询" :visible.sync="dialogVisible" width="720px">
       <el-form label-width="135px">
         <el-row>
@@ -615,7 +621,7 @@
             </el-form-item>
           </el-col>
         </el-row>
-        <el-row>
+        <!-- <el-row>
           <el-col :span="24">
             <el-form-item label="企业资质">
               <el-select
@@ -635,6 +641,13 @@
               </el-select>
             </el-form-item>
           </el-col>
+        </el-row> -->
+         <el-row>
+          <el-col :span="24">
+            <el-form-item label="企业资质">
+              <el-input size="mini" v-model="searchForm.NeedFileType" placeholder="请输入内容"></el-input>
+            </el-form-item>
+          </el-col>
         </el-row>
         <el-row>
           <el-col :span="24">
@@ -768,7 +781,8 @@ export default {
         BusinessScope: "",
         OldSupplierName: "",
         HseTraining: "", 
-        NeedFileType: [],
+        // NeedFileType: [],
+        NeedFileType:"",
         CerSubName:""
       },
       //列表排序
@@ -781,6 +795,17 @@ export default {
   },
 
   methods: {
+    transferStr (val) {
+        if (val === '01') {
+          return '物资类'
+        } else if (val === '02') {
+          return '基建类'
+        } else if (val === '03') {
+          return '技术服务类'
+        } else {
+          return val
+        }
+      },
     initNftOptions() {
       api
         .getNFTOptions(this.$axios)