浏览代码

统计表同步数据限制Id

lichunlei 2 年之前
父节点
当前提交
811f770b32
共有 1 个文件被更改,包括 6 次插入1 次删除
  1. 6 1
      AppStart/Helper/ProfitService.cs

+ 6 - 1
AppStart/Helper/ProfitService.cs

@@ -266,9 +266,14 @@ namespace MySystem
         {
             try
             {
+                string condition = "";
+                if(TableName == "PosMerchantTradeSummay") condition += " and Id<=14473274";
+                if(TableName == "UserTradeMonthSummary") condition += " and Id<=1132650";
+                if(TableName == "HelpProfitMerTradeSummay") condition += " and Id<=473971";
+                if(TableName == "RecommendTradeSummary") condition += " and Id<=236748";
                 string sql = "";
                 int startId = int.Parse(function.CheckInt(function.ReadInstance("/TradeRecord/" + TableName + "Id.txt")));
-                DataTable dt = CustomerSqlConn.dtable("select * from " + TableName + " where Id>" + startId + " order by Id limit 100", AppConfig.Base.SqlConn);
+                DataTable dt = CustomerSqlConn.dtable("select * from " + TableName + " where Id>" + startId + condition + " order by Id limit 100", AppConfig.Base.SqlConn);
                 if(dt.Rows.Count > 0)
                 {
                     foreach(DataRow dr in dt.Rows)