| 1234567891011121314151617181920212223242526272829 |
- package tmpzcgf
- import (
- . "dashoo.cn/backend/api/mydb"
- . "dashoo.cn/utils/db"
- "github.com/go-xorm/xorm"
- )
- type TmpzcgfService1 struct {
- MyServiceBase
- }
- func GetTmpzcgfService1(xormEngine *xorm.Engine) *TmpzcgfService1 {
- s := new(TmpzcgfService1)
- s.DBE = xormEngine
- return s
- }
- 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 ) "+
- "where b.Type='3'"
- _, err := s.DBE.Query(sql)
- LogError(err)
- return err
- }
|