Browse Source

历史数据导入-由于运行到此处中断,上面的代码临时注释

yuedefeng 5 years ago
parent
commit
cf226e3772

+ 3 - 3
src/dashoo.cn/backend/api/business/tmpzcgf/tmpzcgfService.go

@@ -19,9 +19,9 @@ func GetTmpzcgfService1(xormEngine *xorm.Engine) *TmpzcgfService1 {
 
 func (s *TmpzcgfService1) UpdateCertSubIsType3 () error {
 	sql := "UPDATE OilSupplierCertSub b SET "+
-		"b.SupplierId = (SELECT a.`SupplierId` FROM OilSupplierCertAppend a WHERE a.`OldId` = b.OldId AND a.AppendType = b.SupplierTypeCode AND a.ApplyDate = b.CreateOn ), "+
-		"b.SupplierCertId = (SELECT a.`SupplierCertId` FROM OilSupplierCertAppend a WHERE a.`OldId` = b.OldId AND a.AppendType = b.SupplierTypeCode AND a.ApplyDate = b.CreateOn ), "+
-		"b.SupplierCertAppendId = (SELECT a.`Id` FROM OilSupplierCertAppend a WHERE a.`OldId` = b.OldId AND a.AppendType = b.SupplierTypeCode AND a.ApplyDate = b.CreateOn ) "+
+		"b.SupplierId = IFNULL((SELECT a.`SupplierId` FROM OilSupplierCertAppend a WHERE a.`OldId` = b.OldId AND a.AppendType = b.SupplierTypeCode AND a.ApplyDate = b.CreateOn limit 1), 0), "+
+		"b.SupplierCertId = IFNULL((SELECT a.`SupplierCertId` FROM OilSupplierCertAppend a WHERE a.`OldId` = b.OldId AND a.AppendType = b.SupplierTypeCode AND a.ApplyDate = b.CreateOn limit 1), 0), "+
+		"b.SupplierCertAppendId = IFNULL((SELECT a.`Id` FROM OilSupplierCertAppend a WHERE a.`OldId` = b.OldId AND a.AppendType = b.SupplierTypeCode AND a.ApplyDate = b.CreateOn limit 1), 0) "+
 		"where b.Type='3'"
 	_, err := s.DBE.Query(sql)
 	LogError(err)

+ 3 - 2
src/dashoo.cn/backend/api/controllers/tmpzcgf/tmpzcgf.go

@@ -868,7 +868,7 @@ func (this *TmpzcgfController) ClearAll() {
 // @router /insertAll [get]
 func (this *TmpzcgfController) InsertAll() {
 	//清空所有资质
-	this.ClearAll()
+	/*this.ClearAll()
 
 	this.InsertSupplier()
 	this.InsertSupplierCert()
@@ -882,7 +882,8 @@ func (this *TmpzcgfController) InsertAll() {
 	this.InsertOilSupplierCertSub()
 	this.UpdateCertSubIsType1()
 
-	this.CapacityExpansion()
+	this.CapacityExpansion()*/
+	// 历史数据导入-由于运行到此处中断,上面的代码临时注释
 	this.UpdateCertSubIsType3()
 	this.InsterAnnualAudit()
 	this.UpdateAnnualAudit()