zhengkun 1 년 전
부모
커밋
ad9c1fbe56
2개의 변경된 파일18개의 추가작업 그리고 1개의 파일을 삭제
  1. 6 1
      ent_contact/contact_full.go
  2. 12 0
      ent_util/mysql.go

+ 6 - 1
ent_contact/contact_full.go

@@ -13,9 +13,14 @@ import (
 // from tidb
 func InjectContactTidbInfo() {
 	index, total := 0, 0
+	q := map[string]interface{}{
+		"createtime": map[string]interface{}{
+			"lt": "2024-04-19 00:00:00",
+		},
+	}
 L:
 	for {
-		dataArr := ul.MysqlGlobalTool.Find(ul.G_Units_Contact, map[string]interface{}{}, "name_id,contact_name,contact_tel,contact_email,source_type", "id", index*50000, 50000)
+		dataArr := ul.MysqlGlobalTool.Find(ul.G_Units_Contact, q, "name_id,contact_name,contact_tel,contact_email,source_type", "id", index*50000, 50000)
 		if dataArr != nil {
 			if len(*dataArr) == 0 {
 				break

+ 12 - 0
ent_util/mysql.go

@@ -204,6 +204,18 @@ func (m *Mysql) Find(tableName string, query map[string]interface{}, fields, ord
 					fs = append(fs, fmt.Sprintf("%s>=?", k))
 					vs = append(vs, rv.MapIndex(rv_k).Interface())
 				}
+				if rv_k.String() == "gt" {
+					fs = append(fs, fmt.Sprintf("%s>?", k))
+					vs = append(vs, rv.MapIndex(rv_k).Interface())
+				}
+				if rv_k.String() == "lte" {
+					fs = append(fs, fmt.Sprintf("%s<=?", k))
+					vs = append(vs, rv.MapIndex(rv_k).Interface())
+				}
+				if rv_k.String() == "lt" {
+					fs = append(fs, fmt.Sprintf("%s<?", k))
+					vs = append(vs, rv.MapIndex(rv_k).Interface())
+				}
 				if rv_k.String() == "in" {
 					if len(rv.MapIndex(rv_k).Interface().([]interface{})) > 0 {
 						_fs := fmt.Sprintf("%s in (?", k)