|
|
@@ -290,11 +290,44 @@ func (s *TmpzcgtSession) UpdateCertSub03classId(where string) error {
|
|
|
return err
|
|
|
}
|
|
|
|
|
|
+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, "+
|
|
|
+ "企业名称 as SupplierName, 录入员 as CreateBy, 推荐单位编码 as RecUnitId, 申请日期 as ApplyDate "+
|
|
|
+ "from tmp_zengxiang "+
|
|
|
+ "group by id,申请日期,企业名称,录入员,推荐单位编码,申请日期,准入类别"
|
|
|
+ _, err := s.Session.Query(sql)
|
|
|
+ return err
|
|
|
+}
|
|
|
|
|
|
|
|
|
+func (s *TmpzcgtSession) InsertOilInfoChange () error {
|
|
|
+ sql := "INSERT INTO OilInfoChange (AccessCardNo,SupplierName,OldSupplierName,SupplierTypeName,SupplierTypeCode,OilCertificateNo,Grade,OperType,Country,MaunAgent,ConstructTeam,CommercialNo,OrganCode,CountryTaxNo,LocalTaxNo, "+
|
|
|
+ "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 准入证号 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 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 "
|
|
|
+ _, err := s.Session.Query(sql)
|
|
|
+ return err
|
|
|
+}
|
|
|
|
|
|
+func (s *TmpzcgtSession) InsertOilSupplierCertSub () error {
|
|
|
+ sql := "insert into OilSupplierCertSub (Type, OldId, SupplierTypeCode, Code, Name, Remark, CreateOn, CreateBy) "+
|
|
|
+ "select '2' 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
|
|
|
+}
|
|
|
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
+func (s *TmpzcgtSession) UpdateOilInfoChange () error {
|
|
|
+ sql := "UPDATE OilInfoChange b SET b.SupplierId=(SELECT a.SupplierId FROM OilSupplierCert a WHERE a.GfId = b.HouseNo)"
|
|
|
+ _, err := s.Session.Query(sql)
|
|
|
+ return err
|
|
|
+}
|
|
|
|