|
|
@@ -76,7 +76,7 @@ func (s *TmpzcgtSession) InsertSupplier() error {
|
|
|
企业资质证书编号 AS QualifCert,
|
|
|
企业资质证书级别 AS QualifCertLevel,
|
|
|
安全生产许可证 AS SafetyLicense,
|
|
|
- 技术服务类准入许可证 AS TechServiceLic,
|
|
|
+ 服务类准入许可证 AS TechServiceLic,
|
|
|
外地企业进津备案通知书 AS TJInNotify,
|
|
|
行业特殊要求的认证证书 AS SpecIndustryCert,
|
|
|
法定代表人姓名 AS LegalPerson,
|
|
|
@@ -129,7 +129,7 @@ func (s *TmpzcgtSession) UpdateSupplierTypeCodeAndInFlag() error {
|
|
|
if err != nil {
|
|
|
return err
|
|
|
}
|
|
|
- sql3 := "UPDATE `OilSupplierCert` SET SupplierTypeCode = '03' WHERE SupplierTypeName='技术服务类'"
|
|
|
+ sql3 := "UPDATE `OilSupplierCert` SET SupplierTypeCode = '03' WHERE SupplierTypeName='服务类'"
|
|
|
_, err = s.Session.Query(sql3)
|
|
|
if err != nil {
|
|
|
return err
|
|
|
@@ -152,7 +152,7 @@ func (s *TmpzcgtSession) UpdateSupplierTypeCodeAndInFlag() error {
|
|
|
|
|
|
func (s *TmpzcgtSession) InsterAnnual() error {
|
|
|
sql := "INSERT INTO OilAnnualAudit (Status,SupplierTypeName, SupplierName, CreateOn, CreateBy, RecUnitId, ApplyTime, AccessCardNo, OldId) " +
|
|
|
- "SELECT '11' as Status ,(CASE 准入类别 WHEN '物资类' THEN '01' WHEN '基建类' THEN '02' WHEN '技术服务类' THEN '03' END ) SupplierTypeName, " +
|
|
|
+ "SELECT '11' as Status ,(CASE 准入类别 WHEN '物资类' THEN '01' WHEN '基建类' THEN '02' WHEN '服务类' THEN '03' END ) SupplierTypeName, " +
|
|
|
"企业名称 AS SupplierName, 申请日期 AS CreateOn, 录入员 AS CreateBy, 推荐单位编码 AS RecUnitId, 年审日期 AS ApplyTime, 准入证号 AS AccessCardNo, id AS oldId " +
|
|
|
"FROM tmp_nianshen"
|
|
|
|
|
|
@@ -246,7 +246,7 @@ func (s *TmpzcgtSession) InsertCertSub() error {
|
|
|
|
|
|
")SELECT " +
|
|
|
"t.`ID` AS OldId , '1' AS AppendStatus, '1' AS `Type`, '导入1' AS CreateBy, t.企业名称 As Remark, " +
|
|
|
- "(CASE t.`准入类别` WHEN '物资类' THEN '01' WHEN '基建类' THEN '02' WHEN '技术服务类' THEN '03' END) AS SupplierTypeCode," +
|
|
|
+ "(CASE t.`准入类别` WHEN '物资类' THEN '01' WHEN '基建类' THEN '02' WHEN '服务类' THEN '03' END) AS SupplierTypeCode," +
|
|
|
"REPLACE(SUBSTRING_INDEX (SUBSTRING_INDEX(SUBSTRING_INDEX(t.`准入范围`,';', b.help_topic_id + 1), ';', -1),' ' ,1),'BM','') AS `code`, " +
|
|
|
"SUBSTRING_INDEX(SUBSTRING_INDEX(SUBSTRING_INDEX(t.`准入范围`,';', b.help_topic_id + 1), ';', -1),' ' ,-1)AS `name` " +
|
|
|
"FROM tmp_zcgf t " +
|
|
|
@@ -292,13 +292,13 @@ func (s *TmpzcgtSession) UpdateCertSub03classId(where string) error {
|
|
|
|
|
|
func (s *TmpzcgtSession) InsertOilSupplierCertAppend() error {
|
|
|
//sql := " INSERT INTO OilSupplierCertAppend (OldId,CreateOn,AppendType,SupplierName,CreateBy,RecUnitId,ApplyDate) " +
|
|
|
- //"select Max(id) as OldId,申请日期 as CreateOn, (case 准入类别 when '物资类' then '01' when '基建类' then '02' when '技术服务类' then '03' end) AppendType, "+
|
|
|
+ //"select Max(id) as OldId,申请日期 as CreateOn, (case 准入类别 when '物资类' then '01' when '基建类' then '02' when '服务类' then '03' end) AppendType, "+
|
|
|
// "企业名称 as SupplierName, 录入员 as CreateBy, 推荐单位编码 as RecUnitId, 申请日期 as ApplyDate "+
|
|
|
// "from tmp_zengxiang "+
|
|
|
// "group by id,申请日期,企业名称,录入员,推荐单位编码,申请日期,准入类别"
|
|
|
sql := "INSERT INTO OilSupplierCertAppend "+
|
|
|
"(Status,CreateOn,SupplierName,AppendType,CreateBy,ApplyDate,OldId) " +
|
|
|
- "SELECT '11' as Status, a.`申请日期` AS CreateOn, a.`企业名称` AS SupplierName, (CASE 准入类别 WHEN '物资类' THEN '01' WHEN '基建类' THEN '02' WHEN '技术服务类' THEN '03' END) AppendType, "+
|
|
|
+ "SELECT '11' as Status, a.`申请日期` AS CreateOn, a.`企业名称` AS SupplierName, (CASE 准入类别 WHEN '物资类' THEN '01' WHEN '基建类' THEN '02' WHEN '服务类' THEN '03' END) AppendType, "+
|
|
|
"'导入' AS CreateBy,a.`申请日期` AS ApplyDate, MAX(a.id) AS OldId "+
|
|
|
"FROM tmp_zengxiang a WHERE 企业名称 != '' GROUP BY a.`申请日期`, a.`企业名称`, a.`准入类别`"
|
|
|
_, err := s.Session.Query(sql)
|
|
|
@@ -311,10 +311,10 @@ func (s *TmpzcgtSession) InsertOilInfoChange () error {
|
|
|
"Address,ZipCode,QualitySystemCert,ProductQualityCert,MaunLicense,QualifCert,QualifCertLevel,SafetyLicense,TechServiceLic,TJInNotify, "+
|
|
|
"SpecIndustryCert,LegalPerson,CategoryCode,CategoryName,RegCapital,Currency,ContactName,CompanyType,DepositBank,BankAccount,EMail, "+
|
|
|
"BankCreditRating,Mobile,Telphone,Fax,CompanyTel,QQ,CompanyUrl,Remark,CreateOn,CreateBy,HouseNo) "+
|
|
|
- "select '11' as Status, 准入证号 as AccessCardNo, 企业名称 as SupplierName, 曾用名 as OldSupplierName, 准入类别 as SupplierTypeName,(case 准入类别 when '物资类' then '01' when '基建类' then '02' when '技术服务类' then '03' end) SupplierTypeCode, "+
|
|
|
+ "select '11' as Status, 准入证号 as AccessCardNo, 企业名称 as SupplierName, 曾用名 as OldSupplierName, 准入类别 as SupplierTypeName,(case 准入类别 when '物资类' then '01' when '基建类' then '02' when '服务类' then '03' end) SupplierTypeCode, "+
|
|
|
"中石油供应商证书号 as OilCertificateNo, 级别 as Grade, 经营方式 as OperType, 国家 as Country, 所代理制造商名称 as MaunAgent, 施工队伍名称 as ConstructTeam, 工商注册号 as CommercialNo, 组织机构代码 as OrganCode, "+
|
|
|
"税务登记证国税编号 as CountryTaxNo, 税务登记证地税编号 as LocalTaxNo, 单位地址 as Address, 邮编 AS ZipCode, 质量管理体系认证情况及认证机构 AS QualitySystemCert, 产品质量认证情况及认证机构 AS ProductQualityCert, "+
|
|
|
- "生产制造许可证获证情况及编号 AS MaunLicense, 企业资质证书编号 AS QualifCert, 企业资质证书级别 AS QualifCertLevel, 安全生产许可证 AS SafetyLicense, 技术服务类准入许可证 AS TechServiceLic, 外地企业进津备案通知书 AS TJInNotify, "+
|
|
|
+ "生产制造许可证获证情况及编号 AS MaunLicense, 企业资质证书编号 AS QualifCert, 企业资质证书级别 AS QualifCertLevel, 安全生产许可证 AS SafetyLicense, 服务类准入许可证 AS TechServiceLic, 外地企业进津备案通知书 AS TJInNotify, "+
|
|
|
"行业特殊要求的认证证书 AS SpecIndustryCert, 法定代表人姓名 AS LegalPerson, 行业类别代码 AS CategoryCode, 行业类别名称 AS CategoryName, 注册资本 AS RegCapital, 币种 AS Currency, 联系人姓名 AS ContactName, 公司类型 AS CompanyType, "+
|
|
|
"开户银行 AS DepositBank, 银行账号 AS BankAccount, 电子邮箱 AS EMail, 银行信用等级 AS BankCreditRating, 移动电话 AS Mobile, 固定电话 AS Telphone, 传真 AS Fax, 公司电话 AS CompanyTel, QQ号码 AS QQ, 公司网址 AS CompanyUrl, "+
|
|
|
"申请变更原因及内容 AS Remark, 审核日期 as CreateOn, 录入员 as CreateBy,ID AS HouseNo from tmp_biangenxinxi "
|
|
|
@@ -324,7 +324,7 @@ func (s *TmpzcgtSession) InsertOilInfoChange () error {
|
|
|
|
|
|
func (s *TmpzcgtSession) InsertOilSupplierCertSub () error {
|
|
|
sql := "insert into OilSupplierCertSub (ModifiedBy,Type, OldId, SupplierTypeCode, Code, Name, Remark, CreateOn, CreateBy) "+
|
|
|
- "select 企业名称 as ModifiedBy,'3' as Type, id as OldId, ( case 准入类别 when '物资类' then '01' when '基建类' then '02' when '技术服务类' then '03' end ) SupplierTypeCode, 物资编码 as Code, 产品名称 as Name, 备注 as Remark, 申请日期 as CreateOn, 录入员 as CreateBy "+
|
|
|
+ "select 企业名称 as ModifiedBy,'3' as Type, id as OldId, ( case 准入类别 when '物资类' then '01' when '基建类' then '02' when '服务类' then '03' end ) SupplierTypeCode, 物资编码 as Code, 产品名称 as Name, 备注 as Remark, 申请日期 as CreateOn, 录入员 as CreateBy "+
|
|
|
"from tmp_zengxiang "
|
|
|
_, err := s.Session.Query(sql)
|
|
|
return err
|
|
|
@@ -358,7 +358,7 @@ func (s *TmpzcgtSession) UpdateCertSubIsType2 (where string) error {
|
|
|
func (s *TmpzcgtSession) InsertFileName () error {
|
|
|
sql := "INSERT INTO `OilSupplierFile` (Remark, NeedFileType, OtherRemark, SupplierTypeCode,CreateBy) " +
|
|
|
"SELECT z.企业名称 AS Remark ,f.类别 AS NeedFileType, f.说明 AS OtherRemark, " +
|
|
|
- "( CASE 准入类别 WHEN '物资类' THEN '01' WHEN '基建类' THEN '02' WHEN '技术服务类' THEN '03' END ) SupplierTypeCode, " +
|
|
|
+ "( CASE 准入类别 WHEN '物资类' THEN '01' WHEN '基建类' THEN '02' WHEN '服务类' THEN '03' END ) SupplierTypeCode, " +
|
|
|
"'导入' AS CreateBy " +
|
|
|
"FROM `tmp_file` f " +
|
|
|
"LEFT JOIN `tmp_zcgf` z ON (f.ID_GF = z.ID) " +
|