|
@@ -261,24 +261,24 @@ func (s *TmpzcgtSession) UpdateOilAnnualAudit() error {
|
|
|
|
|
|
|
|
func (s *TmpzcgtSession) InsertCertSub() error {
|
|
func (s *TmpzcgtSession) InsertCertSub() error {
|
|
|
|
|
|
|
|
- countSql := "SELECT count(*) FROM tmp_zcgf t " +
|
|
|
|
|
- "CROSS JOIN mysql.help_topic b " +
|
|
|
|
|
- "ON b.help_topic_id < (LENGTH(t.`准入范围`) - LENGTH(REPLACE(t.`准入范围`, ';', '')) + 1) " +
|
|
|
|
|
- "WHERE " +
|
|
|
|
|
- "1=1 and 准入标识 != '取消' " +
|
|
|
|
|
- "AND LENGTH( SUBSTRING_INDEX(SUBSTRING_INDEX(t.`准入范围`,';', b.help_topic_id + 1), ';', -1) ) > 0 "
|
|
|
|
|
- countStr, err := s.DBE.Query(countSql)
|
|
|
|
|
- var total int64
|
|
|
|
|
- if len(countStr) > 0 {
|
|
|
|
|
- results := countStr[0]
|
|
|
|
|
- for _, value := range results {
|
|
|
|
|
- total, err = strconv.ParseInt(string(value), 10, 64)
|
|
|
|
|
- break
|
|
|
|
|
- }
|
|
|
|
|
- n := math.Ceil(float64(total) / 2000)
|
|
|
|
|
- for i:=0; i <= int(n); i++ {
|
|
|
|
|
- start := strconv.Itoa(i * 2000)
|
|
|
|
|
- end := strconv.Itoa(2000)
|
|
|
|
|
|
|
+ //countSql := "SELECT count(*) FROM tmp_zcgf t " +
|
|
|
|
|
+ // "CROSS JOIN mysql.help_topic b " +
|
|
|
|
|
+ // "ON b.help_topic_id < (LENGTH(t.`准入范围`) - LENGTH(REPLACE(t.`准入范围`, ';', '')) + 1) " +
|
|
|
|
|
+ // "WHERE " +
|
|
|
|
|
+ // "1=1 and 准入标识 != '取消' " +
|
|
|
|
|
+ // "AND LENGTH( SUBSTRING_INDEX(SUBSTRING_INDEX(t.`准入范围`,';', b.help_topic_id + 1), ';', -1) ) > 0 "
|
|
|
|
|
+ //countStr, err := s.DBE.Query(countSql)
|
|
|
|
|
+ ////var total int64
|
|
|
|
|
+ //if len(countStr) > 0 {
|
|
|
|
|
+ // results := countStr[0]
|
|
|
|
|
+ // for _, value := range results {
|
|
|
|
|
+ // total, err = strconv.ParseInt(string(value), 10, 64)
|
|
|
|
|
+ // break
|
|
|
|
|
+ // }
|
|
|
|
|
+ //n := math.Ceil(float64(total) / 2000)
|
|
|
|
|
+ //for i:=0; i <= int(n); i++ {
|
|
|
|
|
+ // start := strconv.Itoa(i * 2000)
|
|
|
|
|
+ // end := strconv.Itoa(2000)
|
|
|
sql := "INSERT `OilSupplierCertSub` (" +
|
|
sql := "INSERT `OilSupplierCertSub` (" +
|
|
|
"OldId," +
|
|
"OldId," +
|
|
|
"AppendStatus," +
|
|
"AppendStatus," +
|
|
@@ -299,12 +299,12 @@ func (s *TmpzcgtSession) InsertCertSub() error {
|
|
|
"ON b.help_topic_id < (LENGTH(t.`准入范围`) - LENGTH(REPLACE(t.`准入范围`, ';', '')) + 1) " +
|
|
"ON b.help_topic_id < (LENGTH(t.`准入范围`) - LENGTH(REPLACE(t.`准入范围`, ';', '')) + 1) " +
|
|
|
"WHERE " +
|
|
"WHERE " +
|
|
|
"1=1 and 准入标识 != '取消' " +
|
|
"1=1 and 准入标识 != '取消' " +
|
|
|
- "AND LENGTH( SUBSTRING_INDEX(SUBSTRING_INDEX(t.`准入范围`,';', b.help_topic_id + 1), ';', -1) ) > 0 " +
|
|
|
|
|
- "ORDER BY t.ID, SupplierTypeCode, `code` " +
|
|
|
|
|
- "limit " + start + "," + end
|
|
|
|
|
- _, err = s.DBE.Query(sql)
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ "AND LENGTH( SUBSTRING_INDEX(SUBSTRING_INDEX(t.`准入范围`,';', b.help_topic_id + 1), ';', -1) ) > 0 "
|
|
|
|
|
+ //"ORDER BY t.ID, SupplierTypeCode, `code` " +
|
|
|
|
|
+ //"limit " + start + "," + end
|
|
|
|
|
+ _, err := s.DBE.Query(sql)
|
|
|
|
|
+ //}
|
|
|
|
|
+ //}
|
|
|
return err
|
|
return err
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -361,10 +361,10 @@ func (s *TmpzcgtSession) InsertOilSupplierCertAppend() error {
|
|
|
total, err = strconv.ParseInt(string(value), 10, 64)
|
|
total, err = strconv.ParseInt(string(value), 10, 64)
|
|
|
break
|
|
break
|
|
|
}
|
|
}
|
|
|
- n := math.Ceil(float64(total) / 200)
|
|
|
|
|
|
|
+ n := math.Ceil(float64(total) / 2000)
|
|
|
for i:=0; i <= int(n); i++ {
|
|
for i:=0; i <= int(n); i++ {
|
|
|
- start := strconv.Itoa(i * 200)
|
|
|
|
|
- end := strconv.Itoa(200)
|
|
|
|
|
|
|
+ start := strconv.Itoa(i * 2000)
|
|
|
|
|
+ end := strconv.Itoa(2000)
|
|
|
sql := "INSERT INTO OilSupplierCertAppend " +
|
|
sql := "INSERT INTO OilSupplierCertAppend " +
|
|
|
"(Status,CreateOn,SupplierName,AppendType,CreateBy,ApplyDate,OldId) " +
|
|
"(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' 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' WHEN '技术服务类' THEN '03' END) AppendType, " +
|
|
@@ -411,10 +411,10 @@ func (s *TmpzcgtSession) InsertOilSupplierCertSub() error {
|
|
|
total, err = strconv.ParseInt(string(value), 10, 64)
|
|
total, err = strconv.ParseInt(string(value), 10, 64)
|
|
|
break
|
|
break
|
|
|
}
|
|
}
|
|
|
- n := math.Ceil(float64(total) / 200)
|
|
|
|
|
|
|
+ n := math.Ceil(float64(total) / 2000)
|
|
|
for i:=0; i <= int(n); i++ {
|
|
for i:=0; i <= int(n); i++ {
|
|
|
- start := strconv.Itoa(i * 200)
|
|
|
|
|
- end := strconv.Itoa(200)
|
|
|
|
|
|
|
+ start := strconv.Itoa(i * 2000)
|
|
|
|
|
+ end := strconv.Itoa(2000)
|
|
|
sql := "insert into OilSupplierCertSub (ModifiedBy,Type, OldId, SupplierTypeCode, Code, Name, Remark, CreateOn, CreateBy) " +
|
|
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' 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' WHEN '技术服务类' THEN '03' end ) SupplierTypeCode, 物资编码 as Code, 产品名称 as Name, 备注 as Remark, 申请日期 as CreateOn, 录入员 as CreateBy " +
|
|
|
"from tmp_zengxiang " +
|
|
"from tmp_zengxiang " +
|