瀏覽代碼

new changes

administrator@LIANGJIAN.COM 5 年之前
父節點
當前提交
1b21b5e340

文件差異過大導致無法顯示
+ 138 - 49
perday/mem_order_perday_page.kjb


+ 10 - 2
perday/etl_all_OrderProducts.ktr

@@ -515,10 +515,18 @@
         <code>FORCE_IDENTIFIERS_TO_UPPERCASE</code>
         <attribute>N</attribute>
       </attribute>
+      <attribute>
+        <code>INITIAL_POOL_SIZE</code>
+        <attribute>30</attribute>
+      </attribute>
       <attribute>
         <code>IS_CLUSTERED</code>
         <attribute>N</attribute>
       </attribute>
+      <attribute>
+        <code>MAXIMUM_POOL_SIZE</code>
+        <attribute>1000</attribute>
+      </attribute>
       <attribute>
         <code>MSSQLUseIntegratedSecurity</code>
         <attribute>false</attribute>
@@ -549,7 +557,7 @@
       </attribute>
       <attribute>
         <code>USE_POOLING</code>
-        <attribute>N</attribute>
+        <attribute>Y</attribute>
       </attribute>
     </attributes>
   </connection>
@@ -809,7 +817,7 @@ if(database == null){
     <sql>
 SELECT * FROM OrderProducts a 
 where a.CreationDate > '2019-05-07 13:51:51'--'2019-05-03 03:54:20'
-and  datediff(day,DATEADD(d,0,DATEDIFF(d,0,getdate())-90),CreationDate )>0
+and  datediff(day,DATEADD(d,0,DATEDIFF(d,0,getdate())-5),CreationDate )>0
 order by CreationDate asc
 </sql>
     <limit>0</limit>

+ 10 - 2
perday/etl_all_Orders.ktr

@@ -515,10 +515,18 @@
         <code>FORCE_IDENTIFIERS_TO_UPPERCASE</code>
         <attribute>N</attribute>
       </attribute>
+      <attribute>
+        <code>INITIAL_POOL_SIZE</code>
+        <attribute>30</attribute>
+      </attribute>
       <attribute>
         <code>IS_CLUSTERED</code>
         <attribute>N</attribute>
       </attribute>
+      <attribute>
+        <code>MAXIMUM_POOL_SIZE</code>
+        <attribute>1000</attribute>
+      </attribute>
       <attribute>
         <code>MSSQLUseIntegratedSecurity</code>
         <attribute>false</attribute>
@@ -549,7 +557,7 @@
       </attribute>
       <attribute>
         <code>USE_POOLING</code>
-        <attribute>N</attribute>
+        <attribute>Y</attribute>
       </attribute>
     </attributes>
   </connection>
@@ -905,7 +913,7 @@ if(database == null){
 FROM Orders
 where 1=1 
 and  OrderTime>'2019-06-09 22:22:47'--'2019-05-03 03:51:59'
-and  datediff(day,DATEADD(d,0,DATEDIFF(d,0,getdate())-90),OrderTime )>0
+and  datediff(day,DATEADD(d,0,DATEDIFF(d,0,getdate())-5),OrderTime )>0
 order by OrderTime asc
 </sql>
     <limit>0</limit>

+ 3 - 3
perday/etl_all_OrdersPrescription.ktr

@@ -807,9 +807,9 @@ if(database == null){
     </partitioning>
     <connection>219.128.77.96Mall</connection>
     <sql>
-SELECT top 10 * FROM PrescriptionRecord a 
-where a.CreationDate > '2019-05-02 17:56:29'
-and  datediff(day,DATEADD(d,0,DATEDIFF(d,0,getdate())-90),CreationDate )>0
+SELECT * FROM PrescriptionRecord a 
+where a.CreationDate > '2019-05-01 17:56:29'
+and  datediff(day,DATEADD(d,0,DATEDIFF(d,0,getdate())-10),CreationDate )>0
 order by CreationDate asc
 </sql>
     <limit>0</limit>

+ 2 - 1
perday/etl_all_Orders.kjb

@@ -1,9 +1,10 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <job>
-  <name>etl_all_Orders</name>
+  <name>etl_all_OrderProducts</name>
   <description/>
   <extended_description/>
   <job_version/>
+  <job_status>0</job_status>
   <directory>/</directory>
   <created_user>-</created_user>
   <created_date>2019/07/12 19:30:58.949</created_date>

文件差異過大導致無法顯示
+ 611 - 0
perday/mem_OrderProducts.kjb


+ 85 - 60
perday/mem_Order_perday_etl.ktr

@@ -408,7 +408,7 @@
       <offset>0.0</offset>
       <maxdiff>0.0</maxdiff>
     </maxdate>
-    <size_rowset>2</size_rowset>
+    <size_rowset>1</size_rowset>
     <sleep_time_empty>50</sleep_time_empty>
     <sleep_time_full>50</sleep_time_full>
     <unique_connections>N</unique_connections>
@@ -437,7 +437,7 @@
   <notepads>
   </notepads>
   <connection>
-    <name>MallSqlserver</name>
+    <name>mall</name>
     <server>192.168.50.32</server>
     <type>MSSQLNATIVE</type>
     <access>Native</access>
@@ -459,7 +459,7 @@
       </attribute>
       <attribute>
         <code>INITIAL_POOL_SIZE</code>
-        <attribute>1</attribute>
+        <attribute>30</attribute>
       </attribute>
       <attribute>
         <code>IS_CLUSTERED</code>
@@ -467,7 +467,7 @@
       </attribute>
       <attribute>
         <code>MAXIMUM_POOL_SIZE</code>
-        <attribute>1</attribute>
+        <attribute>1000</attribute>
       </attribute>
       <attribute>
         <code>MSSQLUseIntegratedSecurity</code>
@@ -527,16 +527,16 @@
       <schema_name/>
     </partitioning>
     <general>
-      <index>crm_order_routingphone1</index>
-      <type>_doc?routing=%{MemPhone}</type>
-      <batchSize>100</batchSize>
+      <index>crm_order_routingphone_v1</index>
+      <type>_doc</type>
+      <batchSize>50</batchSize>
       <timeout>100</timeout>
       <timeoutUnit>SECONDS</timeoutUnit>
       <isJson>N</isJson>
       <idField>OrderKey</idField>
-      <overwriteIfExists>Y</overwriteIfExists>
+      <overwriteIfExists>N</overwriteIfExists>
       <useOutput>N</useOutput>
-      <stopOnError>Y</stopOnError>
+      <stopOnError>N</stopOnError>
     </general>
     <fields>
       <field>
@@ -647,14 +647,6 @@
         <columnName>CustomerName</columnName>
         <targetName>CustomerName</targetName>
       </field>
-      <field>
-        <columnName>DataId</columnName>
-        <targetName>DataId</targetName>
-      </field>
-      <field>
-        <columnName>DataName</columnName>
-        <targetName>DataName</targetName>
-      </field>
       <field>
         <columnName>DeliveryType</columnName>
         <targetName>DeliveryType</targetName>
@@ -699,10 +691,6 @@
         <columnName>HuaWuOriginType</columnName>
         <targetName>HuaWuOriginType</targetName>
       </field>
-      <field>
-        <columnName>Id</columnName>
-        <targetName>Id</targetName>
-      </field>
       <field>
         <columnName>InitSum</columnName>
         <targetName>InitSum</targetName>
@@ -903,10 +891,6 @@
         <columnName>ShippingTime</columnName>
         <targetName>ShippingTime</targetName>
       </field>
-      <field>
-        <columnName>SourceDataId</columnName>
-        <targetName>SourceDataId</targetName>
-      </field>
       <field>
         <columnName>SourcePlatforms</columnName>
         <targetName>SourcePlatforms</targetName>
@@ -939,14 +923,10 @@
         <columnName>Weight</columnName>
         <targetName>Weight</targetName>
       </field>
-      <field>
-        <columnName>order_join_field</columnName>
-        <targetName>order_join_field</targetName>
-      </field>
     </fields>
     <servers>
       <server>
-        <address>192.168.50.32</address>
+        <address>192.168.50.34</address>
         <port>9300</port>
       </server>
     </servers>
@@ -955,9 +935,13 @@
         <name>cluster.name</name>
         <value>es</value>
       </setting>
+      <setting>
+        <name>custom.aliase.source</name>
+        <value>mem_order_routingphone</value>
+      </setting>
       <setting>
         <name>custom.fields.ADeliveryAddress</name>
-        <value>{"type":"date","format":"yyyy-MM-dd HH:mm:ss||yyyy-MM-dd||strict_date_optional_time||epoch_millis"}</value>
+        <value>{"type":"text","analyzer": "ik_max_word","search_analyzer":"ik_smart","index":true}</value>
       </setting>
       <setting>
         <name>custom.fields.AllocationTime</name>
@@ -993,10 +977,22 @@
         <name>custom.fields.OrderTime</name>
         <value>{"type":"date","format":"yyyy-MM-dd HH:mm:ss||yyyy-MM-dd||strict_date_optional_time||epoch_millis"}</value>
       </setting>
+      <setting>
+        <name>custom.fields.PreferentialRate</name>
+        <value>{"type":"double"}</value>
+      </setting>
       <setting>
         <name>custom.fields.ShippingTime</name>
         <value>{"type":"date","format":"yyyy-MM-dd HH:mm:ss||yyyy-MM-dd||strict_date_optional_time||epoch_millis"}</value>
       </setting>
+      <setting>
+        <name>custom.index.number_of_replicas</name>
+        <value>1</value>
+      </setting>
+      <setting>
+        <name>custom.index.number_of_shards</name>
+        <value>11</value>
+      </setting>
     </settings>
     <attributes/>
     <cluster_schema/>
@@ -1007,8 +1003,8 @@
       </output>
     </remotesteps>
     <GUI>
-      <xloc>336</xloc>
-      <yloc>144</yloc>
+      <xloc>368</xloc>
+      <yloc>64</yloc>
       <draw>Y</draw>
     </GUI>
   </step>
@@ -1018,7 +1014,7 @@
     <description/>
     <distribute>Y</distribute>
     <custom_distribution/>
-    <copies>10</copies>
+    <copies>1</copies>
     <partitioning>
       <method>none</method>
       <schema_name/>
@@ -1056,9 +1052,12 @@ Database database = null;
 PreparedStatement stat = null;
 PreparedStatement stat1 = null;
 
-RestHighLevelClient client = new RestHighLevelClient(
+RestHighLevelClient client = null;
+/*{
+ client = new RestHighLevelClient(
         RestClient.builder(
-                new HttpHost[]{new HttpHost("192.168.50.32", 9200, "http")}));
+                new HttpHost[]{new HttpHost("192.168.50.34", 9200, "http")}));
+}*/
 Integer index = 0;
 public  boolean processRow(StepMetaInterface smi, StepDataInterface sdi) throws KettleException
 {
@@ -1094,11 +1093,11 @@ public  boolean processRow(StepMetaInterface smi, StepDataInterface sdi) throws
     r = createOutputRow(r, data.outputRowMeta.size());
     //获取数据库名和表名
     String dbName = "MemberSqlServer";//getInputRowMeta().getString(r, "conname", null );
-    String tablename = "DataImport_memext";//getInputRowMeta().getString(r, "tablename", null );
-    String idname = "MemberPhone";//getInputRowMeta().getString(r, "idname", null );
+    String tablename = "DataImport_order";//getInputRowMeta().getString(r, "tablename", null );
+    String idname = "MemPhone";//getInputRowMeta().getString(r, "idname", null );
 
-    String sourceidname = "DataId";//getInputRowMeta().getString(r, "sourceidname", null );
-    String sourcetablename = "Orders";//getInputRowMeta().getString(r, "sourcetablename", null );
+    String sourceidname = "OrderKey";//getInputRowMeta().getString(r, "sourceidname", null );
+    String sourcetablename = "OrdersCode";//getInputRowMeta().getString(r, "sourcetablename", null );
     if (dbName==null||tablename==null) {
       throw new KettleException("Unable to find field with name "+tablename+" in the input row.");
     }
@@ -1143,6 +1142,7 @@ if(database == null){
         // Add the column name
         
         String DataId = idxRowMeta.getString(r, sourceidname, null);
+        String OrdersCode = idxRowMeta.getString(r, sourcetablename, null);
         
         
         /*String sqlSelect = "select Id from "+tablename + " where DataId = '"+ DataId +"'";
@@ -1163,10 +1163,13 @@ if(database == null){
         //logBasic("idxRow--Id"+Id);
         //logBasic("idxRow--sourcetablename"+sourcetablename);
         //logBasic("idxRow--DataId"+DataId);
+
+ 		//logBasic("idxRow--curpageNum:"+getVariable("mem_orders_page1"));
 		
-		
+		Thread.sleep(100);
+		/*
 		GetRequest getRequest = new GetRequest(
-    	"crm_order_routingphone",  // Index
+    	"crm_order_routingphone_v1",  // Index
     	"_doc",    // /Type
     	DataId);     // Document id
 		getRequest.fetchSourceContext(new FetchSourceContext(false));  // 禁用 _source 字段
@@ -1176,12 +1179,12 @@ if(database == null){
 		if(exists ){
     		return true;
 	 	}
+		
 		//if(!exists &amp;&amp; idxRow == null){
     	//	return true;
 	 	//}
-				
-        
-		/*
+		*/		
+        /*
         //3.获得预处理对象
         String sql="insert into "+tablename+" values (?,?,?,?);";//begin tran t2;  commit tran t2
         //logBasic("idxRow--database"+ database);
@@ -1192,7 +1195,7 @@ if(database == null){
         //stat.addBatch(sql);
 		//4.SQL语句占位符设置实际参数
 		stat.setString(1, Id);//索引参数1代表着sql中的第一个?号,也就是我需要将条件sid所对应的sname数据更新为“儿童玩具测试”
-		stat.setString(2, sourcetablename);//索引参数2代表着sql中的第二个?号,也就是条件是sid为3
+		stat.setString(2, OrdersCode);//索引参数2代表着sql中的第二个?号,也就是条件是sid为3
 		stat.setString(3, DataId);//索引参数2代表着sql中的第二个?号,也就是条件是sid为3
     	stat.setString(4, "phone1");
     	//stat.setInt(5, index);
@@ -1203,9 +1206,7 @@ if(database == null){
 		//6.释放资源
 
 		//stat.close();
-
-		*/
-   	
+*/ 	
     
    }
    catch(SQLServerException e) { 
@@ -1242,8 +1243,8 @@ if(database == null){
       </output>
     </remotesteps>
     <GUI>
-      <xloc>234</xloc>
-      <yloc>63</yloc>
+      <xloc>208</xloc>
+      <yloc>80</yloc>
       <draw>Y</draw>
     </GUI>
   </step>
@@ -1258,10 +1259,13 @@ if(database == null){
       <method>none</method>
       <schema_name/>
     </partitioning>
-    <connection>MallSqlserver</connection>
-    <sql>
+    <connection>mall</connection>
+    <sql>--select *,
+--concat('{"name": "Order","parent": "',MemKey,'"}')as order_join_field 
+--from (
 SELECT 
-  row_number() over (order by AConsigneePhone2 asc ) as MemKey,
+  --row_number() over (order by AConsigneePhone2 asc ) 
+  1 as MemKey,
   OrdersCode as OrderKey,
   OrdersCode
   ,case when AConsigneePhone2= '' then 
@@ -1362,11 +1366,32 @@ SELECT
 , IsPrescription
 , ConfirmId	
 FROM Orders a
-where 1=1 and (AconsigneePhone1!='' or AconsigneePhone2!='')
-and  datediff(day,DATEADD(d,0,DATEDIFF(d,0,getdate())-120),OrderTime )>0
-order by AConsigneePhone2 asc 
+where 1=1 and (AconsigneePhone2!='' or  AconsigneePhone1!='' or AConsigneePhone3!='')
+and a.OrderTime > '2019-07-24 16:56:17'
+		-- and  datediff(day,DATEADD(d,0,DATEDIFF(d,0,getdate())-100),a.OrderTime )>0
+order by a.OrderTime asc 
+--offset 20000 rows 
+ --offset 35040 rows --fetch NEXT  1 rows only
+offset ((${mem_orders_page1}-1)*${mem_orders_pagesize1}) rows fetch next (${mem_orders_pagesize1}) rows only
 
-	</sql>
+--order by AConsigneePhone2 asc 
+ 
+--)a
+--left join MemberData..DataImport as b on a.MemKey = b.Id
+
+--dbo.DesEncryptFixKey('123456','123456e10adc3949ba59abbe56e057f20f883e',b.dataid ) = (case when AConsigneePhone2= '' then 
+--(case 
+--	when AconsigneePhone1!='' then AconsigneePhone1
+--	else ''end)
+--  ELSE AconsigneePhone2 end) 
+	
+--where   
+--1=1  --and b.DataId is not null 
+--and MemKey >0  and MemKey &lt;= 10
+--order by AConsigneePhone2 asc 
+--offset ((${page}-1)*${pagesize}) rows fetch next (${pagesize}) rows only
+--offset ((389-1)*5000) rows --fetch next (5000) rows only
+</sql>
     <limit>0</limit>
     <lookup/>
     <execute_each_row>N</execute_each_row>
@@ -1381,8 +1406,8 @@ order by AConsigneePhone2 asc
       </output>
     </remotesteps>
     <GUI>
-      <xloc>112</xloc>
-      <yloc>112</yloc>
+      <xloc>96</xloc>
+      <yloc>32</yloc>
       <draw>Y</draw>
     </GUI>
   </step>

+ 54 - 33
perday/mem_Order_product_etl.ktr

@@ -437,14 +437,14 @@
   <notepads>
   </notepads>
   <connection>
-    <name>MallSqlserver</name>
+    <name>mall</name>
     <server>192.168.50.32</server>
     <type>MSSQLNATIVE</type>
     <access>Native</access>
     <database>Mall</database>
     <port>1433</port>
     <username>sa</username>
-    <password>Encrypted 2be98afc819c69e8ea300ff228dd38f99</password>
+    <password>Encrypted 2be98afc86aa7f297aa15a478c7d38f99</password>
     <servername/>
     <data_tablespace/>
     <index_tablespace/>
@@ -457,10 +457,18 @@
         <code>FORCE_IDENTIFIERS_TO_UPPERCASE</code>
         <attribute>N</attribute>
       </attribute>
+      <attribute>
+        <code>INITIAL_POOL_SIZE</code>
+        <attribute>30</attribute>
+      </attribute>
       <attribute>
         <code>IS_CLUSTERED</code>
         <attribute>N</attribute>
       </attribute>
+      <attribute>
+        <code>MAXIMUM_POOL_SIZE</code>
+        <attribute>1000</attribute>
+      </attribute>
       <attribute>
         <code>MSSQLUseIntegratedSecurity</code>
         <attribute>false</attribute>
@@ -491,7 +499,7 @@
       </attribute>
       <attribute>
         <code>USE_POOLING</code>
-        <attribute>N</attribute>
+        <attribute>Y</attribute>
       </attribute>
     </attributes>
   </connection>
@@ -519,16 +527,16 @@
       <schema_name/>
     </partitioning>
     <general>
-      <index>crm_orderproducts</index>
-      <type>_doc?routing=%{MemberPhone}</type>
-      <batchSize>200</batchSize>
+      <index>crm_orderproducts_shards</index>
+      <type>_doc</type>
+      <batchSize>50</batchSize>
       <timeout>100</timeout>
       <timeoutUnit>SECONDS</timeoutUnit>
       <isJson>N</isJson>
       <idField>DataId</idField>
-      <overwriteIfExists>Y</overwriteIfExists>
+      <overwriteIfExists>N</overwriteIfExists>
       <useOutput>N</useOutput>
-      <stopOnError>Y</stopOnError>
+      <stopOnError>N</stopOnError>
     </general>
     <fields>
       <field>
@@ -654,7 +662,7 @@
     </fields>
     <servers>
       <server>
-        <address>192.168.50.32</address>
+        <address>192.168.50.34</address>
         <port>9300</port>
       </server>
     </servers>
@@ -665,12 +673,16 @@
       </setting>
       <setting>
         <name>custom.aliase.source</name>
-        <value>mem_orderproducts</value>
+        <value>mem_orderproducts_shards</value>
       </setting>
       <setting>
         <name>custom.fields.CreationDate</name>
         <value>{"type":"date","format":"yyyy-MM-dd HH:mm:ss||yyyy-MM-dd||strict_date_optional_time||epoch_millis"}</value>
       </setting>
+      <setting>
+        <name>custom.fields.IntegralAmount</name>
+        <value>{"type":"text"}</value>
+      </setting>
       <setting>
         <name>custom.fields.LastModified</name>
         <value>{"type":"date","format":"yyyy-MM-dd HH:mm:ss||yyyy-MM-dd||strict_date_optional_time||epoch_millis"}</value>
@@ -685,6 +697,14 @@
         <value>{"type":"text","analyzer": "ik_smart",
 "search_analyzer":"ik_smart","index":true}</value>
       </setting>
+      <setting>
+        <name>custom.index.number_of_replicas</name>
+        <value>1</value>
+      </setting>
+      <setting>
+        <name>custom.index.number_of_shards</name>
+        <value>11</value>
+      </setting>
     </settings>
     <attributes/>
     <cluster_schema/>
@@ -695,7 +715,7 @@
       </output>
     </remotesteps>
     <GUI>
-      <xloc>368</xloc>
+      <xloc>352</xloc>
       <yloc>64</yloc>
       <draw>Y</draw>
     </GUI>
@@ -706,7 +726,7 @@
     <description/>
     <distribute>Y</distribute>
     <custom_distribution/>
-    <copies>10</copies>
+    <copies>1</copies>
     <partitioning>
       <method>none</method>
       <schema_name/>
@@ -746,7 +766,7 @@ PreparedStatement stat1 = null;
 
 RestHighLevelClient client = new RestHighLevelClient(
         RestClient.builder(
-                new HttpHost[]{new HttpHost("192.168.50.32", 9200, "http")}));
+                new HttpHost[]{new HttpHost("192.168.50.34", 9200, "http")}));
 Integer index = 0;
 public  boolean processRow(StepMetaInterface smi, StepDataInterface sdi) throws KettleException
 {
@@ -852,8 +872,9 @@ if(database == null){
         //logBasic("idxRow--Id"+Id);
         //logBasic("idxRow--sourcetablename"+sourcetablename);
         //logBasic("idxRow--DataId"+DataId);
-		Thread.sleep(10);
-		
+ 		//logBasic("idxRow--curpageNum:"+getVariable("mem_orderproducts_page1"));
+		Thread.sleep(500);
+		/*
 		GetRequest getRequest = new GetRequest(
     	"crm_orderproducts",  // Index
     	"_doc",    // /Type
@@ -868,8 +889,11 @@ if(database == null){
 		//if(!exists &amp;&amp; idxRow == null){
     	//	return true;
 	 	//}
-				
-        
+			
+		*/
+
+	
+        /*
         //3.获得预处理对象
         String sql="insert into "+tablename+" values (?,?,?,?);";//begin tran t2;  commit tran t2
         //logBasic("idxRow--database"+ database);
@@ -891,17 +915,7 @@ if(database == null){
 		//6.释放资源
 
 		//stat.close();
-
-		//Integer pn = Integer.parseInt(Id);
-		//Integer curpageNum =  Integer.parseInt(Id) % pagesize;
-		//if(pn > 0 &amp;&amp; curpageNum == 0){
-		//	setVariable("page",String.valueOf(page));
-		//}
- 		//logBasic("idxRow--getVariable"+getVariable("page"));
- 		//logBasic("idxRow--curpageNum"+curpageNum);
-
-        //logBasic("idxRow--length"+i);
-		
+*/	
    	
     
    }
@@ -939,7 +953,7 @@ if(database == null){
       </output>
     </remotesteps>
     <GUI>
-      <xloc>240</xloc>
+      <xloc>224</xloc>
       <yloc>48</yloc>
       <draw>Y</draw>
     </GUI>
@@ -955,7 +969,7 @@ if(database == null){
       <method>none</method>
       <schema_name/>
     </partitioning>
-    <connection>MallSqlserver</connection>
+    <connection>mall</connection>
     <sql>SELECT
 Id as DataId
 , case when AConsigneePhone2= '' then 
@@ -994,8 +1008,15 @@ Id as DataId
 FROM OrderProducts a
 left join Orders b on a.OrdersCode = b.OrdersCode  
 where AConsigneePhone2!=''
-order by AConsigneePhone2
- offset 9602000 rows --fetch NEXT  2 rows only
+	and b.CreationDate >'2019-07-31 23:57:07'
+		 --and  datediff(day,DATEADD(d,0,DATEDIFF(d,0,getdate())-121),b.CreationDate )>0
+order by b.CreationDate desc 
+	
+--offset 17100  rows --fetch NEXT  2 rows only
+offset ((${mem_orderproducts_page1}-1)*${mem_orderproducts_pagesize1}) rows fetch next (${mem_orderproducts_pagesize1}) rows only
+
+--order by AConsigneePhone2
+ --offset 9602000 rows --fetch NEXT  2 rows only
 </sql>
     <limit>0</limit>
     <lookup/>
@@ -1012,7 +1033,7 @@ order by AConsigneePhone2
     </remotesteps>
     <GUI>
       <xloc>80</xloc>
-      <yloc>48</yloc>
+      <yloc>32</yloc>
       <draw>Y</draw>
     </GUI>
   </step>

文件差異過大導致無法顯示
+ 620 - 0
perday/mem_Orders.kjb


+ 598 - 0
perday/mem_memberbase_etl_count_perday.ktr

@@ -0,0 +1,598 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<transformation>
+  <info>
+    <name>mem_memberbase_etl_count_perday</name>
+    <description/>
+    <extended_description/>
+    <trans_version/>
+    <trans_type>Normal</trans_type>
+    <directory>/</directory>
+    <parameters>
+    </parameters>
+    <log>
+      <trans-log-table>
+        <connection/>
+        <schema/>
+        <table/>
+        <size_limit_lines/>
+        <interval/>
+        <timeout_days/>
+        <field>
+          <id>ID_BATCH</id>
+          <enabled>Y</enabled>
+          <name>ID_BATCH</name>
+        </field>
+        <field>
+          <id>CHANNEL_ID</id>
+          <enabled>Y</enabled>
+          <name>CHANNEL_ID</name>
+        </field>
+        <field>
+          <id>TRANSNAME</id>
+          <enabled>Y</enabled>
+          <name>TRANSNAME</name>
+        </field>
+        <field>
+          <id>STATUS</id>
+          <enabled>Y</enabled>
+          <name>STATUS</name>
+        </field>
+        <field>
+          <id>LINES_READ</id>
+          <enabled>Y</enabled>
+          <name>LINES_READ</name>
+          <subject/>
+        </field>
+        <field>
+          <id>LINES_WRITTEN</id>
+          <enabled>Y</enabled>
+          <name>LINES_WRITTEN</name>
+          <subject/>
+        </field>
+        <field>
+          <id>LINES_UPDATED</id>
+          <enabled>Y</enabled>
+          <name>LINES_UPDATED</name>
+          <subject/>
+        </field>
+        <field>
+          <id>LINES_INPUT</id>
+          <enabled>Y</enabled>
+          <name>LINES_INPUT</name>
+          <subject/>
+        </field>
+        <field>
+          <id>LINES_OUTPUT</id>
+          <enabled>Y</enabled>
+          <name>LINES_OUTPUT</name>
+          <subject/>
+        </field>
+        <field>
+          <id>LINES_REJECTED</id>
+          <enabled>Y</enabled>
+          <name>LINES_REJECTED</name>
+          <subject/>
+        </field>
+        <field>
+          <id>ERRORS</id>
+          <enabled>Y</enabled>
+          <name>ERRORS</name>
+        </field>
+        <field>
+          <id>STARTDATE</id>
+          <enabled>Y</enabled>
+          <name>STARTDATE</name>
+        </field>
+        <field>
+          <id>ENDDATE</id>
+          <enabled>Y</enabled>
+          <name>ENDDATE</name>
+        </field>
+        <field>
+          <id>LOGDATE</id>
+          <enabled>Y</enabled>
+          <name>LOGDATE</name>
+        </field>
+        <field>
+          <id>DEPDATE</id>
+          <enabled>Y</enabled>
+          <name>DEPDATE</name>
+        </field>
+        <field>
+          <id>REPLAYDATE</id>
+          <enabled>Y</enabled>
+          <name>REPLAYDATE</name>
+        </field>
+        <field>
+          <id>LOG_FIELD</id>
+          <enabled>Y</enabled>
+          <name>LOG_FIELD</name>
+        </field>
+        <field>
+          <id>EXECUTING_SERVER</id>
+          <enabled>N</enabled>
+          <name>EXECUTING_SERVER</name>
+        </field>
+        <field>
+          <id>EXECUTING_USER</id>
+          <enabled>N</enabled>
+          <name>EXECUTING_USER</name>
+        </field>
+        <field>
+          <id>CLIENT</id>
+          <enabled>N</enabled>
+          <name>CLIENT</name>
+        </field>
+      </trans-log-table>
+      <perf-log-table>
+        <connection/>
+        <schema/>
+        <table/>
+        <interval/>
+        <timeout_days/>
+        <field>
+          <id>ID_BATCH</id>
+          <enabled>Y</enabled>
+          <name>ID_BATCH</name>
+        </field>
+        <field>
+          <id>SEQ_NR</id>
+          <enabled>Y</enabled>
+          <name>SEQ_NR</name>
+        </field>
+        <field>
+          <id>LOGDATE</id>
+          <enabled>Y</enabled>
+          <name>LOGDATE</name>
+        </field>
+        <field>
+          <id>TRANSNAME</id>
+          <enabled>Y</enabled>
+          <name>TRANSNAME</name>
+        </field>
+        <field>
+          <id>STEPNAME</id>
+          <enabled>Y</enabled>
+          <name>STEPNAME</name>
+        </field>
+        <field>
+          <id>STEP_COPY</id>
+          <enabled>Y</enabled>
+          <name>STEP_COPY</name>
+        </field>
+        <field>
+          <id>LINES_READ</id>
+          <enabled>Y</enabled>
+          <name>LINES_READ</name>
+        </field>
+        <field>
+          <id>LINES_WRITTEN</id>
+          <enabled>Y</enabled>
+          <name>LINES_WRITTEN</name>
+        </field>
+        <field>
+          <id>LINES_UPDATED</id>
+          <enabled>Y</enabled>
+          <name>LINES_UPDATED</name>
+        </field>
+        <field>
+          <id>LINES_INPUT</id>
+          <enabled>Y</enabled>
+          <name>LINES_INPUT</name>
+        </field>
+        <field>
+          <id>LINES_OUTPUT</id>
+          <enabled>Y</enabled>
+          <name>LINES_OUTPUT</name>
+        </field>
+        <field>
+          <id>LINES_REJECTED</id>
+          <enabled>Y</enabled>
+          <name>LINES_REJECTED</name>
+        </field>
+        <field>
+          <id>ERRORS</id>
+          <enabled>Y</enabled>
+          <name>ERRORS</name>
+        </field>
+        <field>
+          <id>INPUT_BUFFER_ROWS</id>
+          <enabled>Y</enabled>
+          <name>INPUT_BUFFER_ROWS</name>
+        </field>
+        <field>
+          <id>OUTPUT_BUFFER_ROWS</id>
+          <enabled>Y</enabled>
+          <name>OUTPUT_BUFFER_ROWS</name>
+        </field>
+      </perf-log-table>
+      <channel-log-table>
+        <connection/>
+        <schema/>
+        <table/>
+        <timeout_days/>
+        <field>
+          <id>ID_BATCH</id>
+          <enabled>Y</enabled>
+          <name>ID_BATCH</name>
+        </field>
+        <field>
+          <id>CHANNEL_ID</id>
+          <enabled>Y</enabled>
+          <name>CHANNEL_ID</name>
+        </field>
+        <field>
+          <id>LOG_DATE</id>
+          <enabled>Y</enabled>
+          <name>LOG_DATE</name>
+        </field>
+        <field>
+          <id>LOGGING_OBJECT_TYPE</id>
+          <enabled>Y</enabled>
+          <name>LOGGING_OBJECT_TYPE</name>
+        </field>
+        <field>
+          <id>OBJECT_NAME</id>
+          <enabled>Y</enabled>
+          <name>OBJECT_NAME</name>
+        </field>
+        <field>
+          <id>OBJECT_COPY</id>
+          <enabled>Y</enabled>
+          <name>OBJECT_COPY</name>
+        </field>
+        <field>
+          <id>REPOSITORY_DIRECTORY</id>
+          <enabled>Y</enabled>
+          <name>REPOSITORY_DIRECTORY</name>
+        </field>
+        <field>
+          <id>FILENAME</id>
+          <enabled>Y</enabled>
+          <name>FILENAME</name>
+        </field>
+        <field>
+          <id>OBJECT_ID</id>
+          <enabled>Y</enabled>
+          <name>OBJECT_ID</name>
+        </field>
+        <field>
+          <id>OBJECT_REVISION</id>
+          <enabled>Y</enabled>
+          <name>OBJECT_REVISION</name>
+        </field>
+        <field>
+          <id>PARENT_CHANNEL_ID</id>
+          <enabled>Y</enabled>
+          <name>PARENT_CHANNEL_ID</name>
+        </field>
+        <field>
+          <id>ROOT_CHANNEL_ID</id>
+          <enabled>Y</enabled>
+          <name>ROOT_CHANNEL_ID</name>
+        </field>
+      </channel-log-table>
+      <step-log-table>
+        <connection/>
+        <schema/>
+        <table/>
+        <timeout_days/>
+        <field>
+          <id>ID_BATCH</id>
+          <enabled>Y</enabled>
+          <name>ID_BATCH</name>
+        </field>
+        <field>
+          <id>CHANNEL_ID</id>
+          <enabled>Y</enabled>
+          <name>CHANNEL_ID</name>
+        </field>
+        <field>
+          <id>LOG_DATE</id>
+          <enabled>Y</enabled>
+          <name>LOG_DATE</name>
+        </field>
+        <field>
+          <id>TRANSNAME</id>
+          <enabled>Y</enabled>
+          <name>TRANSNAME</name>
+        </field>
+        <field>
+          <id>STEPNAME</id>
+          <enabled>Y</enabled>
+          <name>STEPNAME</name>
+        </field>
+        <field>
+          <id>STEP_COPY</id>
+          <enabled>Y</enabled>
+          <name>STEP_COPY</name>
+        </field>
+        <field>
+          <id>LINES_READ</id>
+          <enabled>Y</enabled>
+          <name>LINES_READ</name>
+        </field>
+        <field>
+          <id>LINES_WRITTEN</id>
+          <enabled>Y</enabled>
+          <name>LINES_WRITTEN</name>
+        </field>
+        <field>
+          <id>LINES_UPDATED</id>
+          <enabled>Y</enabled>
+          <name>LINES_UPDATED</name>
+        </field>
+        <field>
+          <id>LINES_INPUT</id>
+          <enabled>Y</enabled>
+          <name>LINES_INPUT</name>
+        </field>
+        <field>
+          <id>LINES_OUTPUT</id>
+          <enabled>Y</enabled>
+          <name>LINES_OUTPUT</name>
+        </field>
+        <field>
+          <id>LINES_REJECTED</id>
+          <enabled>Y</enabled>
+          <name>LINES_REJECTED</name>
+        </field>
+        <field>
+          <id>ERRORS</id>
+          <enabled>Y</enabled>
+          <name>ERRORS</name>
+        </field>
+        <field>
+          <id>LOG_FIELD</id>
+          <enabled>N</enabled>
+          <name>LOG_FIELD</name>
+        </field>
+      </step-log-table>
+      <metrics-log-table>
+        <connection/>
+        <schema/>
+        <table/>
+        <timeout_days/>
+        <field>
+          <id>ID_BATCH</id>
+          <enabled>Y</enabled>
+          <name>ID_BATCH</name>
+        </field>
+        <field>
+          <id>CHANNEL_ID</id>
+          <enabled>Y</enabled>
+          <name>CHANNEL_ID</name>
+        </field>
+        <field>
+          <id>LOG_DATE</id>
+          <enabled>Y</enabled>
+          <name>LOG_DATE</name>
+        </field>
+        <field>
+          <id>METRICS_DATE</id>
+          <enabled>Y</enabled>
+          <name>METRICS_DATE</name>
+        </field>
+        <field>
+          <id>METRICS_CODE</id>
+          <enabled>Y</enabled>
+          <name>METRICS_CODE</name>
+        </field>
+        <field>
+          <id>METRICS_DESCRIPTION</id>
+          <enabled>Y</enabled>
+          <name>METRICS_DESCRIPTION</name>
+        </field>
+        <field>
+          <id>METRICS_SUBJECT</id>
+          <enabled>Y</enabled>
+          <name>METRICS_SUBJECT</name>
+        </field>
+        <field>
+          <id>METRICS_TYPE</id>
+          <enabled>Y</enabled>
+          <name>METRICS_TYPE</name>
+        </field>
+        <field>
+          <id>METRICS_VALUE</id>
+          <enabled>Y</enabled>
+          <name>METRICS_VALUE</name>
+        </field>
+      </metrics-log-table>
+    </log>
+    <maxdate>
+      <connection/>
+      <table/>
+      <field/>
+      <offset>0.0</offset>
+      <maxdiff>0.0</maxdiff>
+    </maxdate>
+    <size_rowset>10000</size_rowset>
+    <sleep_time_empty>50</sleep_time_empty>
+    <sleep_time_full>50</sleep_time_full>
+    <unique_connections>N</unique_connections>
+    <feedback_shown>Y</feedback_shown>
+    <feedback_size>50000</feedback_size>
+    <using_thread_priorities>Y</using_thread_priorities>
+    <shared_objects_file/>
+    <capture_step_performance>N</capture_step_performance>
+    <step_performance_capturing_delay>1000</step_performance_capturing_delay>
+    <step_performance_capturing_size_limit>100</step_performance_capturing_size_limit>
+    <dependencies>
+    </dependencies>
+    <partitionschemas>
+    </partitionschemas>
+    <slaveservers>
+    </slaveservers>
+    <clusterschemas>
+    </clusterschemas>
+    <created_user>-</created_user>
+    <created_date>2019/07/17 16:55:33.177</created_date>
+    <modified_user>-</modified_user>
+    <modified_date>2019/07/17 16:55:33.177</modified_date>
+    <key_for_session_key>H4sIAAAAAAAAAAMAAAAAAAAAAAA=</key_for_session_key>
+    <is_key_private>N</is_key_private>
+  </info>
+  <notepads>
+  </notepads>
+  <connection>
+    <name>mall</name>
+    <server>192.168.50.32</server>
+    <type>MSSQLNATIVE</type>
+    <access>Native</access>
+    <database>Mall</database>
+    <port>1433</port>
+    <username>sa</username>
+    <password>Encrypted 2be98afc86aa7f297aa15a478c7d38f99</password>
+    <servername/>
+    <data_tablespace/>
+    <index_tablespace/>
+    <attributes>
+      <attribute>
+        <code>FORCE_IDENTIFIERS_TO_LOWERCASE</code>
+        <attribute>N</attribute>
+      </attribute>
+      <attribute>
+        <code>FORCE_IDENTIFIERS_TO_UPPERCASE</code>
+        <attribute>N</attribute>
+      </attribute>
+      <attribute>
+        <code>INITIAL_POOL_SIZE</code>
+        <attribute>30</attribute>
+      </attribute>
+      <attribute>
+        <code>IS_CLUSTERED</code>
+        <attribute>N</attribute>
+      </attribute>
+      <attribute>
+        <code>MAXIMUM_POOL_SIZE</code>
+        <attribute>1000</attribute>
+      </attribute>
+      <attribute>
+        <code>MSSQLUseIntegratedSecurity</code>
+        <attribute>false</attribute>
+      </attribute>
+      <attribute>
+        <code>MSSQL_DOUBLE_DECIMAL_SEPARATOR</code>
+        <attribute>N</attribute>
+      </attribute>
+      <attribute>
+        <code>PORT_NUMBER</code>
+        <attribute>1433</attribute>
+      </attribute>
+      <attribute>
+        <code>PRESERVE_RESERVED_WORD_CASE</code>
+        <attribute>Y</attribute>
+      </attribute>
+      <attribute>
+        <code>QUOTE_ALL_FIELDS</code>
+        <attribute>N</attribute>
+      </attribute>
+      <attribute>
+        <code>SUPPORTS_BOOLEAN_DATA_TYPE</code>
+        <attribute>Y</attribute>
+      </attribute>
+      <attribute>
+        <code>SUPPORTS_TIMESTAMP_DATA_TYPE</code>
+        <attribute>Y</attribute>
+      </attribute>
+      <attribute>
+        <code>USE_POOLING</code>
+        <attribute>Y</attribute>
+      </attribute>
+    </attributes>
+  </connection>
+  <order>
+    <hop>
+      <from>表输入 2</from>
+      <to>复制记录到结果 2</to>
+      <enabled>Y</enabled>
+    </hop>
+  </order>
+  <step>
+    <name>复制记录到结果 2</name>
+    <type>RowsToResult</type>
+    <description/>
+    <distribute>Y</distribute>
+    <custom_distribution/>
+    <copies>1</copies>
+    <partitioning>
+      <method>none</method>
+      <schema_name/>
+    </partitioning>
+    <attributes/>
+    <cluster_schema/>
+    <remotesteps>
+      <input>
+      </input>
+      <output>
+      </output>
+    </remotesteps>
+    <GUI>
+      <xloc>320</xloc>
+      <yloc>96</yloc>
+      <draw>Y</draw>
+    </GUI>
+  </step>
+  <step>
+    <name>表输入 2</name>
+    <type>TableInput</type>
+    <description/>
+    <distribute>Y</distribute>
+    <custom_distribution/>
+    <copies>1</copies>
+    <partitioning>
+      <method>none</method>
+      <schema_name/>
+    </partitioning>
+    <connection>mall</connection>
+    <sql>select (
+SELECT count(1)/50 +1 as count1 
+
+FROM Orders a
+where 1=1 and (AconsigneePhone1!='' and AconsigneePhone1 is not null)
+		 and OrderTime>'2019-05-01 00:22:10'
+		-- and  datediff(day,DATEADD(d,0,DATEDIFF(d,0,getdate())-30),OrderTime )>0
+) as count1,
+
+(SELECT count(1)/50 +1  as count2 
+
+FROM Orders a
+where 1=1 and (AconsigneePhone2!='' and AconsigneePhone2 is not null)
+		 and OrderTime>'2019-05-01 00:22:10'
+		-- and  datediff(day,DATEADD(d,0,DATEDIFF(d,0,getdate())-30),OrderTime )>0
+) as count2,
+
+(SELECT count(1)/50 +1  as count3 
+
+FROM Orders a
+where 1=1 and (AconsigneePhone3!='' and AconsigneePhone3 is not null)
+		 and OrderTime>'2019-05-01 00:22:10'
+		-- and  datediff(day,DATEADD(d,0,DATEDIFF(d,0,getdate())-30),OrderTime )>0
+) as count3</sql>
+    <limit>0</limit>
+    <lookup/>
+    <execute_each_row>N</execute_each_row>
+    <variables_active>N</variables_active>
+    <lazy_conversion_active>N</lazy_conversion_active>
+    <attributes/>
+    <cluster_schema/>
+    <remotesteps>
+      <input>
+      </input>
+      <output>
+      </output>
+    </remotesteps>
+    <GUI>
+      <xloc>112</xloc>
+      <yloc>80</yloc>
+      <draw>Y</draw>
+    </GUI>
+  </step>
+  <step_error_handling>
+  </step_error_handling>
+  <slave-step-copy-partition-distribution>
+  </slave-step-copy-partition-distribution>
+  <slave_transformation>N</slave_transformation>
+  <attributes/>
+</transformation>

文件差異過大導致無法顯示
+ 243 - 913
perday/mem_memberbase_query_perday_page.ktr


+ 162 - 28
perday/mem_memberbase_query_perday_page_.kjb

@@ -297,26 +297,66 @@
       <file_variable_type>JVM</file_variable_type>
       <fields>
         <field>
-          <variable_name>page</variable_name>
-          <variable_value>1134</variable_value>
+          <variable_name>mem_membase_page1</variable_name>
+          <variable_value>150</variable_value>
           <variable_type>JVM</variable_type>
         </field>
         <field>
-          <variable_name>pagesize</variable_name>
-          <variable_value>5000</variable_value>
+          <variable_name>mem_membase_pagesize1</variable_name>
+          <variable_value>50</variable_value>
           <variable_type>JVM</variable_type>
         </field>
         <field>
-          <variable_name>pagecount</variable_name>
-          <variable_value>1237</variable_value>
+          <variable_name>mem_membase_pagecount1</variable_name>
+          <variable_value>${mem_membase_count1}</variable_value>
+          <variable_type>JVM</variable_type>
+        </field>
+        <field>
+          <variable_name>mem_membase_pagecountSum</variable_name>
+          <variable_value>${mem_membase_countSum}</variable_value>
+          <variable_type>JVM</variable_type>
+        </field>
+        <field>
+          <variable_name>mem_membase_pagetSum</variable_name>
+          <variable_value>${mem_membase_pagetSum}</variable_value>
+          <variable_type>JVM</variable_type>
+        </field>
+        <field>
+          <variable_name>mem_membase_page2</variable_name>
+          <variable_value>150</variable_value>
+          <variable_type>JVM</variable_type>
+        </field>
+        <field>
+          <variable_name>mem_membase_pagesize2</variable_name>
+          <variable_value>50</variable_value>
+          <variable_type>JVM</variable_type>
+        </field>
+        <field>
+          <variable_name>mem_membase_pagecount2</variable_name>
+          <variable_value>${mem_membase_count2}</variable_value>
+          <variable_type>JVM</variable_type>
+        </field>
+        <field>
+          <variable_name>mem_membase_page3</variable_name>
+          <variable_value>150</variable_value>
+          <variable_type>JVM</variable_type>
+        </field>
+        <field>
+          <variable_name>mem_membase_pagesize3</variable_name>
+          <variable_value>50</variable_value>
+          <variable_type>JVM</variable_type>
+        </field>
+        <field>
+          <variable_name>mem_membase_pagecount3</variable_name>
+          <variable_value>${mem_membase_count3}</variable_value>
           <variable_type>JVM</variable_type>
         </field>
       </fields>
       <parallel>N</parallel>
       <draw>Y</draw>
       <nr>0</nr>
-      <xloc>320</xloc>
-      <yloc>144</yloc>
+      <xloc>272</xloc>
+      <yloc>128</yloc>
       <attributes_kjc/>
     </entry>
     <entry>
@@ -337,8 +377,8 @@
       <parallel>N</parallel>
       <draw>Y</draw>
       <nr>0</nr>
-      <xloc>96</xloc>
-      <yloc>176</yloc>
+      <xloc>48</xloc>
+      <yloc>112</yloc>
       <attributes_kjc/>
     </entry>
     <entry>
@@ -348,10 +388,10 @@
       <attributes/>
       <valuetype>variable</valuetype>
       <fieldname/>
-      <variablename>page</variablename>
+      <variablename>mem_membase_pageSum</variablename>
       <fieldtype>number</fieldtype>
       <mask/>
-      <comparevalue>${pagecount}</comparevalue>
+      <comparevalue>${mem_membase_pagecountSum}</comparevalue>
       <minvalue/>
       <maxvalue/>
       <successcondition>equal</successcondition>
@@ -370,16 +410,28 @@
       <description/>
       <type>EVAL</type>
       <attributes/>
-      <script>var page;
+      <script>var page1;
+var page2;
+var page3;
 
-page = parent_job.getVariable("page");
-var pagecount = parent_job.getVariable("pagecount");
+page1 = parent_job.getVariable("mem_membase_page1");
+var pagecount1 = parent_job.getVariable("mem_membase_pagecount1");
+page2 = parent_job.getVariable("mem_membase_page2");
+var pagecount2 = parent_job.getVariable("mem_membase_pagecount2");
+page3 = parent_job.getVariable("mem_membase_page3");
+var pagecount3 = parent_job.getVariable("mem_membase_pagecount3");
 
-if(page == pagecount){
+if(page1 == pagecount1 &amp;&amp;page2 == pagecount2&amp;&amp;page3 == pagecount3  ){
     false;
 }else{
-	page++;
-	parent_job.setVariable("page",page);
+	page1++;
+	page2++;
+	page3++;
+	parent_job.setVariable("mem_membase_page1",page1);
+	parent_job.setVariable("mem_membase_page2",page2);
+	parent_job.setVariable("mem_membase_page3",page3);
+	parent_job.setVariable("mem_membase_pageSum",page1+page2 +page3);
+
 	true;
 }</script>
       <parallel>N</parallel>
@@ -439,17 +491,72 @@ if(page == pagecount){
       <yloc>272</yloc>
       <attributes_kjc/>
     </entry>
+    <entry>
+      <name>转换 (2)</name>
+      <description/>
+      <type>TRANS</type>
+      <attributes/>
+      <specification_method>filename</specification_method>
+      <trans_object_id/>
+      <filename>${Internal.Entry.Current.Directory}/mem_memberbase_etl_count_perday.ktr</filename>
+      <transname/>
+      <arg_from_previous>N</arg_from_previous>
+      <params_from_previous>N</params_from_previous>
+      <exec_per_row>N</exec_per_row>
+      <clear_rows>N</clear_rows>
+      <clear_files>N</clear_files>
+      <set_logfile>N</set_logfile>
+      <logfile/>
+      <logext/>
+      <add_date>N</add_date>
+      <add_time>N</add_time>
+      <loglevel>Basic</loglevel>
+      <cluster>N</cluster>
+      <slave_server_name/>
+      <set_append_logfile>N</set_append_logfile>
+      <wait_until_finished>Y</wait_until_finished>
+      <follow_abort_remote>N</follow_abort_remote>
+      <create_parent_folder>N</create_parent_folder>
+      <logging_remote_work>N</logging_remote_work>
+      <run_configuration>Pentaho local</run_configuration>
+      <parameters>
+        <pass_all_parameters>Y</pass_all_parameters>
+      </parameters>
+      <parallel>N</parallel>
+      <draw>Y</draw>
+      <nr>1</nr>
+      <xloc>128</xloc>
+      <yloc>176</yloc>
+      <attributes_kjc/>
+    </entry>
+    <entry>
+      <name>JavaScript 2</name>
+      <description/>
+      <type>EVAL</type>
+      <attributes/>
+      <script>var prevRow = previous_result.getRows();
+
+if(prevRow == null){
+    false;
+}else{
+	parent_job.setVariable("mem_membase_count1",prevRow.get(0).getString("count1",""));
+	parent_job.setVariable("mem_membase_count2",prevRow.get(0).getString("count2",""));
+	parent_job.setVariable("mem_membase_count3",prevRow.get(0).getString("count3",""));
+	parent_job.setVariable("mem_membase_countSum",0+prevRow.get(0).getString("count1","")
++prevRow.get(0).getString("count2","")
++prevRow.get(0).getString("count3",""));
+	parent_job.setVariable("mem_membase_pageSum",0);
+	true;
+}</script>
+      <parallel>N</parallel>
+      <draw>Y</draw>
+      <nr>0</nr>
+      <xloc>201</xloc>
+      <yloc>113</yloc>
+      <attributes_kjc/>
+    </entry>
   </entries>
   <hops>
-    <hop>
-      <from>Start</from>
-      <to>设置变量1237</to>
-      <from_nr>0</from_nr>
-      <to_nr>0</to_nr>
-      <enabled>Y</enabled>
-      <evaluation>Y</evaluation>
-      <unconditional>Y</unconditional>
-    </hop>
     <hop>
       <from>page&lt;=pagecount</from>
       <to>转换</to>
@@ -484,7 +591,7 @@ if(page == pagecount){
       <to_nr>0</to_nr>
       <enabled>Y</enabled>
       <evaluation>Y</evaluation>
-      <unconditional>N</unconditional>
+      <unconditional>Y</unconditional>
     </hop>
     <hop>
       <from>JavaScript</from>
@@ -495,6 +602,33 @@ if(page == pagecount){
       <evaluation>Y</evaluation>
       <unconditional>N</unconditional>
     </hop>
+    <hop>
+      <from>Start</from>
+      <to>转换 (2)</to>
+      <from_nr>0</from_nr>
+      <to_nr>1</to_nr>
+      <enabled>Y</enabled>
+      <evaluation>Y</evaluation>
+      <unconditional>Y</unconditional>
+    </hop>
+    <hop>
+      <from>转换 (2)</from>
+      <to>JavaScript 2</to>
+      <from_nr>1</from_nr>
+      <to_nr>0</to_nr>
+      <enabled>Y</enabled>
+      <evaluation>Y</evaluation>
+      <unconditional>N</unconditional>
+    </hop>
+    <hop>
+      <from>JavaScript 2</from>
+      <to>设置变量1237</to>
+      <from_nr>0</from_nr>
+      <to_nr>0</to_nr>
+      <enabled>Y</enabled>
+      <evaluation>Y</evaluation>
+      <unconditional>N</unconditional>
+    </hop>
   </hops>
   <notepads>
   </notepads>

+ 598 - 0
perday/mem_memberext_etl_count_perday.ktr

@@ -0,0 +1,598 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<transformation>
+  <info>
+    <name>mem_memberext_temp_etl_count_perday</name>
+    <description/>
+    <extended_description/>
+    <trans_version/>
+    <trans_type>Normal</trans_type>
+    <directory>/</directory>
+    <parameters>
+    </parameters>
+    <log>
+      <trans-log-table>
+        <connection/>
+        <schema/>
+        <table/>
+        <size_limit_lines/>
+        <interval/>
+        <timeout_days/>
+        <field>
+          <id>ID_BATCH</id>
+          <enabled>Y</enabled>
+          <name>ID_BATCH</name>
+        </field>
+        <field>
+          <id>CHANNEL_ID</id>
+          <enabled>Y</enabled>
+          <name>CHANNEL_ID</name>
+        </field>
+        <field>
+          <id>TRANSNAME</id>
+          <enabled>Y</enabled>
+          <name>TRANSNAME</name>
+        </field>
+        <field>
+          <id>STATUS</id>
+          <enabled>Y</enabled>
+          <name>STATUS</name>
+        </field>
+        <field>
+          <id>LINES_READ</id>
+          <enabled>Y</enabled>
+          <name>LINES_READ</name>
+          <subject/>
+        </field>
+        <field>
+          <id>LINES_WRITTEN</id>
+          <enabled>Y</enabled>
+          <name>LINES_WRITTEN</name>
+          <subject/>
+        </field>
+        <field>
+          <id>LINES_UPDATED</id>
+          <enabled>Y</enabled>
+          <name>LINES_UPDATED</name>
+          <subject/>
+        </field>
+        <field>
+          <id>LINES_INPUT</id>
+          <enabled>Y</enabled>
+          <name>LINES_INPUT</name>
+          <subject/>
+        </field>
+        <field>
+          <id>LINES_OUTPUT</id>
+          <enabled>Y</enabled>
+          <name>LINES_OUTPUT</name>
+          <subject/>
+        </field>
+        <field>
+          <id>LINES_REJECTED</id>
+          <enabled>Y</enabled>
+          <name>LINES_REJECTED</name>
+          <subject/>
+        </field>
+        <field>
+          <id>ERRORS</id>
+          <enabled>Y</enabled>
+          <name>ERRORS</name>
+        </field>
+        <field>
+          <id>STARTDATE</id>
+          <enabled>Y</enabled>
+          <name>STARTDATE</name>
+        </field>
+        <field>
+          <id>ENDDATE</id>
+          <enabled>Y</enabled>
+          <name>ENDDATE</name>
+        </field>
+        <field>
+          <id>LOGDATE</id>
+          <enabled>Y</enabled>
+          <name>LOGDATE</name>
+        </field>
+        <field>
+          <id>DEPDATE</id>
+          <enabled>Y</enabled>
+          <name>DEPDATE</name>
+        </field>
+        <field>
+          <id>REPLAYDATE</id>
+          <enabled>Y</enabled>
+          <name>REPLAYDATE</name>
+        </field>
+        <field>
+          <id>LOG_FIELD</id>
+          <enabled>Y</enabled>
+          <name>LOG_FIELD</name>
+        </field>
+        <field>
+          <id>EXECUTING_SERVER</id>
+          <enabled>N</enabled>
+          <name>EXECUTING_SERVER</name>
+        </field>
+        <field>
+          <id>EXECUTING_USER</id>
+          <enabled>N</enabled>
+          <name>EXECUTING_USER</name>
+        </field>
+        <field>
+          <id>CLIENT</id>
+          <enabled>N</enabled>
+          <name>CLIENT</name>
+        </field>
+      </trans-log-table>
+      <perf-log-table>
+        <connection/>
+        <schema/>
+        <table/>
+        <interval/>
+        <timeout_days/>
+        <field>
+          <id>ID_BATCH</id>
+          <enabled>Y</enabled>
+          <name>ID_BATCH</name>
+        </field>
+        <field>
+          <id>SEQ_NR</id>
+          <enabled>Y</enabled>
+          <name>SEQ_NR</name>
+        </field>
+        <field>
+          <id>LOGDATE</id>
+          <enabled>Y</enabled>
+          <name>LOGDATE</name>
+        </field>
+        <field>
+          <id>TRANSNAME</id>
+          <enabled>Y</enabled>
+          <name>TRANSNAME</name>
+        </field>
+        <field>
+          <id>STEPNAME</id>
+          <enabled>Y</enabled>
+          <name>STEPNAME</name>
+        </field>
+        <field>
+          <id>STEP_COPY</id>
+          <enabled>Y</enabled>
+          <name>STEP_COPY</name>
+        </field>
+        <field>
+          <id>LINES_READ</id>
+          <enabled>Y</enabled>
+          <name>LINES_READ</name>
+        </field>
+        <field>
+          <id>LINES_WRITTEN</id>
+          <enabled>Y</enabled>
+          <name>LINES_WRITTEN</name>
+        </field>
+        <field>
+          <id>LINES_UPDATED</id>
+          <enabled>Y</enabled>
+          <name>LINES_UPDATED</name>
+        </field>
+        <field>
+          <id>LINES_INPUT</id>
+          <enabled>Y</enabled>
+          <name>LINES_INPUT</name>
+        </field>
+        <field>
+          <id>LINES_OUTPUT</id>
+          <enabled>Y</enabled>
+          <name>LINES_OUTPUT</name>
+        </field>
+        <field>
+          <id>LINES_REJECTED</id>
+          <enabled>Y</enabled>
+          <name>LINES_REJECTED</name>
+        </field>
+        <field>
+          <id>ERRORS</id>
+          <enabled>Y</enabled>
+          <name>ERRORS</name>
+        </field>
+        <field>
+          <id>INPUT_BUFFER_ROWS</id>
+          <enabled>Y</enabled>
+          <name>INPUT_BUFFER_ROWS</name>
+        </field>
+        <field>
+          <id>OUTPUT_BUFFER_ROWS</id>
+          <enabled>Y</enabled>
+          <name>OUTPUT_BUFFER_ROWS</name>
+        </field>
+      </perf-log-table>
+      <channel-log-table>
+        <connection/>
+        <schema/>
+        <table/>
+        <timeout_days/>
+        <field>
+          <id>ID_BATCH</id>
+          <enabled>Y</enabled>
+          <name>ID_BATCH</name>
+        </field>
+        <field>
+          <id>CHANNEL_ID</id>
+          <enabled>Y</enabled>
+          <name>CHANNEL_ID</name>
+        </field>
+        <field>
+          <id>LOG_DATE</id>
+          <enabled>Y</enabled>
+          <name>LOG_DATE</name>
+        </field>
+        <field>
+          <id>LOGGING_OBJECT_TYPE</id>
+          <enabled>Y</enabled>
+          <name>LOGGING_OBJECT_TYPE</name>
+        </field>
+        <field>
+          <id>OBJECT_NAME</id>
+          <enabled>Y</enabled>
+          <name>OBJECT_NAME</name>
+        </field>
+        <field>
+          <id>OBJECT_COPY</id>
+          <enabled>Y</enabled>
+          <name>OBJECT_COPY</name>
+        </field>
+        <field>
+          <id>REPOSITORY_DIRECTORY</id>
+          <enabled>Y</enabled>
+          <name>REPOSITORY_DIRECTORY</name>
+        </field>
+        <field>
+          <id>FILENAME</id>
+          <enabled>Y</enabled>
+          <name>FILENAME</name>
+        </field>
+        <field>
+          <id>OBJECT_ID</id>
+          <enabled>Y</enabled>
+          <name>OBJECT_ID</name>
+        </field>
+        <field>
+          <id>OBJECT_REVISION</id>
+          <enabled>Y</enabled>
+          <name>OBJECT_REVISION</name>
+        </field>
+        <field>
+          <id>PARENT_CHANNEL_ID</id>
+          <enabled>Y</enabled>
+          <name>PARENT_CHANNEL_ID</name>
+        </field>
+        <field>
+          <id>ROOT_CHANNEL_ID</id>
+          <enabled>Y</enabled>
+          <name>ROOT_CHANNEL_ID</name>
+        </field>
+      </channel-log-table>
+      <step-log-table>
+        <connection/>
+        <schema/>
+        <table/>
+        <timeout_days/>
+        <field>
+          <id>ID_BATCH</id>
+          <enabled>Y</enabled>
+          <name>ID_BATCH</name>
+        </field>
+        <field>
+          <id>CHANNEL_ID</id>
+          <enabled>Y</enabled>
+          <name>CHANNEL_ID</name>
+        </field>
+        <field>
+          <id>LOG_DATE</id>
+          <enabled>Y</enabled>
+          <name>LOG_DATE</name>
+        </field>
+        <field>
+          <id>TRANSNAME</id>
+          <enabled>Y</enabled>
+          <name>TRANSNAME</name>
+        </field>
+        <field>
+          <id>STEPNAME</id>
+          <enabled>Y</enabled>
+          <name>STEPNAME</name>
+        </field>
+        <field>
+          <id>STEP_COPY</id>
+          <enabled>Y</enabled>
+          <name>STEP_COPY</name>
+        </field>
+        <field>
+          <id>LINES_READ</id>
+          <enabled>Y</enabled>
+          <name>LINES_READ</name>
+        </field>
+        <field>
+          <id>LINES_WRITTEN</id>
+          <enabled>Y</enabled>
+          <name>LINES_WRITTEN</name>
+        </field>
+        <field>
+          <id>LINES_UPDATED</id>
+          <enabled>Y</enabled>
+          <name>LINES_UPDATED</name>
+        </field>
+        <field>
+          <id>LINES_INPUT</id>
+          <enabled>Y</enabled>
+          <name>LINES_INPUT</name>
+        </field>
+        <field>
+          <id>LINES_OUTPUT</id>
+          <enabled>Y</enabled>
+          <name>LINES_OUTPUT</name>
+        </field>
+        <field>
+          <id>LINES_REJECTED</id>
+          <enabled>Y</enabled>
+          <name>LINES_REJECTED</name>
+        </field>
+        <field>
+          <id>ERRORS</id>
+          <enabled>Y</enabled>
+          <name>ERRORS</name>
+        </field>
+        <field>
+          <id>LOG_FIELD</id>
+          <enabled>N</enabled>
+          <name>LOG_FIELD</name>
+        </field>
+      </step-log-table>
+      <metrics-log-table>
+        <connection/>
+        <schema/>
+        <table/>
+        <timeout_days/>
+        <field>
+          <id>ID_BATCH</id>
+          <enabled>Y</enabled>
+          <name>ID_BATCH</name>
+        </field>
+        <field>
+          <id>CHANNEL_ID</id>
+          <enabled>Y</enabled>
+          <name>CHANNEL_ID</name>
+        </field>
+        <field>
+          <id>LOG_DATE</id>
+          <enabled>Y</enabled>
+          <name>LOG_DATE</name>
+        </field>
+        <field>
+          <id>METRICS_DATE</id>
+          <enabled>Y</enabled>
+          <name>METRICS_DATE</name>
+        </field>
+        <field>
+          <id>METRICS_CODE</id>
+          <enabled>Y</enabled>
+          <name>METRICS_CODE</name>
+        </field>
+        <field>
+          <id>METRICS_DESCRIPTION</id>
+          <enabled>Y</enabled>
+          <name>METRICS_DESCRIPTION</name>
+        </field>
+        <field>
+          <id>METRICS_SUBJECT</id>
+          <enabled>Y</enabled>
+          <name>METRICS_SUBJECT</name>
+        </field>
+        <field>
+          <id>METRICS_TYPE</id>
+          <enabled>Y</enabled>
+          <name>METRICS_TYPE</name>
+        </field>
+        <field>
+          <id>METRICS_VALUE</id>
+          <enabled>Y</enabled>
+          <name>METRICS_VALUE</name>
+        </field>
+      </metrics-log-table>
+    </log>
+    <maxdate>
+      <connection/>
+      <table/>
+      <field/>
+      <offset>0.0</offset>
+      <maxdiff>0.0</maxdiff>
+    </maxdate>
+    <size_rowset>10000</size_rowset>
+    <sleep_time_empty>50</sleep_time_empty>
+    <sleep_time_full>50</sleep_time_full>
+    <unique_connections>N</unique_connections>
+    <feedback_shown>Y</feedback_shown>
+    <feedback_size>50000</feedback_size>
+    <using_thread_priorities>Y</using_thread_priorities>
+    <shared_objects_file/>
+    <capture_step_performance>N</capture_step_performance>
+    <step_performance_capturing_delay>1000</step_performance_capturing_delay>
+    <step_performance_capturing_size_limit>100</step_performance_capturing_size_limit>
+    <dependencies>
+    </dependencies>
+    <partitionschemas>
+    </partitionschemas>
+    <slaveservers>
+    </slaveservers>
+    <clusterschemas>
+    </clusterschemas>
+    <created_user>-</created_user>
+    <created_date>2019/07/17 16:55:33.177</created_date>
+    <modified_user>-</modified_user>
+    <modified_date>2019/07/17 16:55:33.177</modified_date>
+    <key_for_session_key>H4sIAAAAAAAAAAMAAAAAAAAAAAA=</key_for_session_key>
+    <is_key_private>N</is_key_private>
+  </info>
+  <notepads>
+  </notepads>
+  <connection>
+    <name>mall</name>
+    <server>192.168.50.32</server>
+    <type>MSSQLNATIVE</type>
+    <access>Native</access>
+    <database>Mall</database>
+    <port>1433</port>
+    <username>sa</username>
+    <password>Encrypted 2be98afc86aa7f297aa15a478c7d38f99</password>
+    <servername/>
+    <data_tablespace/>
+    <index_tablespace/>
+    <attributes>
+      <attribute>
+        <code>FORCE_IDENTIFIERS_TO_LOWERCASE</code>
+        <attribute>N</attribute>
+      </attribute>
+      <attribute>
+        <code>FORCE_IDENTIFIERS_TO_UPPERCASE</code>
+        <attribute>N</attribute>
+      </attribute>
+      <attribute>
+        <code>INITIAL_POOL_SIZE</code>
+        <attribute>30</attribute>
+      </attribute>
+      <attribute>
+        <code>IS_CLUSTERED</code>
+        <attribute>N</attribute>
+      </attribute>
+      <attribute>
+        <code>MAXIMUM_POOL_SIZE</code>
+        <attribute>1000</attribute>
+      </attribute>
+      <attribute>
+        <code>MSSQLUseIntegratedSecurity</code>
+        <attribute>false</attribute>
+      </attribute>
+      <attribute>
+        <code>MSSQL_DOUBLE_DECIMAL_SEPARATOR</code>
+        <attribute>N</attribute>
+      </attribute>
+      <attribute>
+        <code>PORT_NUMBER</code>
+        <attribute>1433</attribute>
+      </attribute>
+      <attribute>
+        <code>PRESERVE_RESERVED_WORD_CASE</code>
+        <attribute>Y</attribute>
+      </attribute>
+      <attribute>
+        <code>QUOTE_ALL_FIELDS</code>
+        <attribute>N</attribute>
+      </attribute>
+      <attribute>
+        <code>SUPPORTS_BOOLEAN_DATA_TYPE</code>
+        <attribute>Y</attribute>
+      </attribute>
+      <attribute>
+        <code>SUPPORTS_TIMESTAMP_DATA_TYPE</code>
+        <attribute>Y</attribute>
+      </attribute>
+      <attribute>
+        <code>USE_POOLING</code>
+        <attribute>Y</attribute>
+      </attribute>
+    </attributes>
+  </connection>
+  <order>
+    <hop>
+      <from>表输入 2</from>
+      <to>复制记录到结果 2</to>
+      <enabled>Y</enabled>
+    </hop>
+  </order>
+  <step>
+    <name>复制记录到结果 2</name>
+    <type>RowsToResult</type>
+    <description/>
+    <distribute>Y</distribute>
+    <custom_distribution/>
+    <copies>1</copies>
+    <partitioning>
+      <method>none</method>
+      <schema_name/>
+    </partitioning>
+    <attributes/>
+    <cluster_schema/>
+    <remotesteps>
+      <input>
+      </input>
+      <output>
+      </output>
+    </remotesteps>
+    <GUI>
+      <xloc>320</xloc>
+      <yloc>96</yloc>
+      <draw>Y</draw>
+    </GUI>
+  </step>
+  <step>
+    <name>表输入 2</name>
+    <type>TableInput</type>
+    <description/>
+    <distribute>Y</distribute>
+    <custom_distribution/>
+    <copies>1</copies>
+    <partitioning>
+      <method>none</method>
+      <schema_name/>
+    </partitioning>
+    <connection>mall</connection>
+    <sql>select (
+SELECT count(1)/50 +1 as count1 
+
+FROM Orders a
+where 1=1 and (AconsigneePhone1!='' and AconsigneePhone1 is not null)
+		and OrderTime > '2019-05-01 00:00:01'
+		-- and  datediff(day,DATEADD(d,0,DATEDIFF(d,0,getdate())-120),OrderTime )>0
+) as count1,
+
+(SELECT count(1)/50+1  as count2 
+
+FROM Orders a
+where 1=1 and (AconsigneePhone2!='' and AconsigneePhone2 is not null)
+		and OrderTime > '2019-05-01 00:00:01'
+		-- and  datediff(day,DATEADD(d,0,DATEDIFF(d,0,getdate())-120),OrderTime )>0
+) as count2,
+
+(SELECT count(1)/50+1  as count3 
+
+FROM Orders a
+where 1=1 and (AconsigneePhone3!='' and AconsigneePhone3 is not null)
+		and OrderTime > '2019-05-01 00:00:01'
+		-- and  datediff(day,DATEADD(d,0,DATEDIFF(d,0,getdate())-120),OrderTime )>0
+) as count3</sql>
+    <limit>0</limit>
+    <lookup/>
+    <execute_each_row>N</execute_each_row>
+    <variables_active>N</variables_active>
+    <lazy_conversion_active>N</lazy_conversion_active>
+    <attributes/>
+    <cluster_schema/>
+    <remotesteps>
+      <input>
+      </input>
+      <output>
+      </output>
+    </remotesteps>
+    <GUI>
+      <xloc>128</xloc>
+      <yloc>80</yloc>
+      <draw>Y</draw>
+    </GUI>
+  </step>
+  <step_error_handling>
+  </step_error_handling>
+  <slave-step-copy-partition-distribution>
+  </slave-step-copy-partition-distribution>
+  <slave_transformation>N</slave_transformation>
+  <attributes/>
+</transformation>

文件差異過大導致無法顯示
+ 167 - 664
perday/mem_memberext_etl_perday.ktr


+ 164 - 32
perday/mem_order_page.kjb

@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <job>
-  <name>mem_order_page</name>
+  <name>mem_memberext_etl_perday_page</name>
   <description/>
   <extended_description/>
   <job_version/>
@@ -297,25 +297,65 @@
       <file_variable_type>JVM</file_variable_type>
       <fields>
         <field>
-          <variable_name>page</variable_name>
-          <variable_value>495</variable_value>
+          <variable_name>mem_memext_page1</variable_name>
+          <variable_value>100</variable_value>
           <variable_type>JVM</variable_type>
         </field>
         <field>
-          <variable_name>pagesize</variable_name>
-          <variable_value>5000</variable_value>
+          <variable_name>mem_memext_pagesize1</variable_name>
+          <variable_value>50</variable_value>
           <variable_type>JVM</variable_type>
         </field>
         <field>
-          <variable_name>pagecount</variable_name>
-          <variable_value>1237</variable_value>
+          <variable_name>mem_memext_pagecount1</variable_name>
+          <variable_value>${mem_memext_count1}</variable_value>
+          <variable_type>JVM</variable_type>
+        </field>
+        <field>
+          <variable_name>mem_memext_page2</variable_name>
+          <variable_value>100</variable_value>
+          <variable_type>JVM</variable_type>
+        </field>
+        <field>
+          <variable_name>mem_memext_pagesize2</variable_name>
+          <variable_value>50</variable_value>
+          <variable_type>JVM</variable_type>
+        </field>
+        <field>
+          <variable_name>mem_memext_pagecount2</variable_name>
+          <variable_value>${mem_memext_count2}</variable_value>
+          <variable_type>JVM</variable_type>
+        </field>
+        <field>
+          <variable_name>mem_memext_page3</variable_name>
+          <variable_value>100</variable_value>
+          <variable_type>JVM</variable_type>
+        </field>
+        <field>
+          <variable_name>mem_memext_pagesize3</variable_name>
+          <variable_value>50</variable_value>
+          <variable_type>JVM</variable_type>
+        </field>
+        <field>
+          <variable_name>mem_memext_pagecount3</variable_name>
+          <variable_value>${mem_memext_count2}</variable_value>
+          <variable_type>JVM</variable_type>
+        </field>
+        <field>
+          <variable_name>mem_memext_pagecountSum</variable_name>
+          <variable_value>${mem_memext_countSum}</variable_value>
+          <variable_type>JVM</variable_type>
+        </field>
+        <field>
+          <variable_name>mem_memext_pagesum</variable_name>
+          <variable_value>0</variable_value>
           <variable_type>JVM</variable_type>
         </field>
       </fields>
       <parallel>N</parallel>
       <draw>Y</draw>
       <nr>0</nr>
-      <xloc>272</xloc>
+      <xloc>320</xloc>
       <yloc>144</yloc>
       <attributes_kjc/>
     </entry>
@@ -347,11 +387,11 @@
       <type>SIMPLE_EVAL</type>
       <attributes/>
       <valuetype>variable</valuetype>
-      <fieldname/>
-      <variablename>page</variablename>
+      <fieldname>pageSum</fieldname>
+      <variablename>mem_memext_pagesum</variablename>
       <fieldtype>number</fieldtype>
       <mask/>
-      <comparevalue>${pagecount}</comparevalue>
+      <comparevalue>${mem_memext_pagecountSum}</comparevalue>
       <minvalue/>
       <maxvalue/>
       <successcondition>equal</successcondition>
@@ -361,7 +401,7 @@
       <parallel>N</parallel>
       <draw>Y</draw>
       <nr>0</nr>
-      <xloc>432</xloc>
+      <xloc>416</xloc>
       <yloc>208</yloc>
       <attributes_kjc/>
     </entry>
@@ -370,16 +410,28 @@
       <description/>
       <type>EVAL</type>
       <attributes/>
-      <script>var page;
+      <script>var page1;
+var page2;
+var page3;
 
-page = parent_job.getVariable("page");
-var pagecount = parent_job.getVariable("pagecount");
+page1 = parent_job.getVariable("mem_memext_page1");
+page2 = parent_job.getVariable("mem_memext_page2");
+page3 = parent_job.getVariable("mem_memext_page3");
+var pagecount1 = parent_job.getVariable("mem_memext_pagecount1");
+var pagecount2 = parent_job.getVariable("mem_memext_pagecount2");
+var pagecount3 = parent_job.getVariable("mem_memext_pagecount3");
 
-if(page == pagecount){
+if(page1 == pagecount1 &amp;&amp; page2 == pagecount2  &amp;&amp; page3 == pagecount3 ){
     false;
 }else{
-	page++;
-	parent_job.setVariable("page",page);
+	page1++;
+	page2++;
+	page3++;
+	parent_job.setVariable("mem_memext_page1",page1);
+	parent_job.setVariable("mem_memext_page2",page2);
+	parent_job.setVariable("mem_memext_page3",page3);
+	parent_job.setVariable("mem_memext_pagesum",page1 + page2 + page3);
+
 	true;
 }</script>
       <parallel>N</parallel>
@@ -396,7 +448,7 @@ if(page == pagecount){
       <attributes/>
       <specification_method>filename</specification_method>
       <trans_object_id/>
-      <filename>${Internal.Entry.Current.Directory}/mem_Order_etl.ktr</filename>
+      <filename>${Internal.Entry.Current.Directory}/mem_memberext_etl_perday.ktr</filename>
       <transname/>
       <arg_from_previous>N</arg_from_previous>
       <params_from_previous>N</params_from_previous>
@@ -439,28 +491,99 @@ if(page == pagecount){
       <yloc>272</yloc>
       <attributes_kjc/>
     </entry>
+    <entry>
+      <name>转换 (2)</name>
+      <description/>
+      <type>TRANS</type>
+      <attributes/>
+      <specification_method>filename</specification_method>
+      <trans_object_id/>
+      <filename>${Internal.Entry.Current.Directory}/mem_memberext_etl_count_perday.ktr</filename>
+      <transname/>
+      <arg_from_previous>N</arg_from_previous>
+      <params_from_previous>N</params_from_previous>
+      <exec_per_row>N</exec_per_row>
+      <clear_rows>N</clear_rows>
+      <clear_files>N</clear_files>
+      <set_logfile>N</set_logfile>
+      <logfile/>
+      <logext/>
+      <add_date>N</add_date>
+      <add_time>N</add_time>
+      <loglevel>Basic</loglevel>
+      <cluster>N</cluster>
+      <slave_server_name/>
+      <set_append_logfile>N</set_append_logfile>
+      <wait_until_finished>Y</wait_until_finished>
+      <follow_abort_remote>N</follow_abort_remote>
+      <create_parent_folder>N</create_parent_folder>
+      <logging_remote_work>N</logging_remote_work>
+      <run_configuration>Pentaho local</run_configuration>
+      <parameters>
+        <pass_all_parameters>Y</pass_all_parameters>
+      </parameters>
+      <parallel>N</parallel>
+      <draw>Y</draw>
+      <nr>1</nr>
+      <xloc>192</xloc>
+      <yloc>144</yloc>
+      <attributes_kjc/>
+    </entry>
+    <entry>
+      <name>JavaScript 2</name>
+      <description/>
+      <type>EVAL</type>
+      <attributes/>
+      <script>var prevRow = previous_result.getRows();
+
+if(prevRow == null){
+    false;
+}else{
+	parent_job.setVariable("mem_memext_count1",prevRow.get(0).getString("count1",""));
+	parent_job.setVariable("mem_memext_count2",prevRow.get(0).getString("count2",""));
+	parent_job.setVariable("mem_memext_count3",prevRow.get(0).getString("count3",""));
+	parent_job.setVariable("mem_memext_countSum",prevRow.get(0).getString("count1","")+
+		prevRow.get(0).getString("count2","")+prevRow.get(0).getString("count3",""));
+	true;
+}</script>
+      <parallel>N</parallel>
+      <draw>Y</draw>
+      <nr>0</nr>
+      <xloc>240</xloc>
+      <yloc>48</yloc>
+      <attributes_kjc/>
+    </entry>
   </entries>
   <hops>
     <hop>
-      <from>Start</from>
-      <to>设置变量1237</to>
+      <from>page&lt;=pagecount</from>
+      <to>转换</to>
       <from_nr>0</from_nr>
       <to_nr>0</to_nr>
       <enabled>Y</enabled>
       <evaluation>Y</evaluation>
-      <unconditional>Y</unconditional>
+      <unconditional>N</unconditional>
     </hop>
     <hop>
       <from>page&lt;=pagecount</from>
-      <to>转换</to>
+      <to>成功</to>
       <from_nr>0</from_nr>
       <to_nr>0</to_nr>
       <enabled>Y</enabled>
-      <evaluation>Y</evaluation>
+      <evaluation>N</evaluation>
       <unconditional>N</unconditional>
     </hop>
     <hop>
-      <from>设置变量1237</from>
+      <from>转换</from>
+      <to>JavaScript</to>
+      <from_nr>0</from_nr>
+      <to_nr>0</to_nr>
+      <enabled>Y</enabled>
+      <evaluation>Y</evaluation>
+      <unconditional>Y</unconditional>
+    </hop>
+    <hop>
+      <from>JavaScript</from>
       <to>page&lt;=pagecount</to>
       <from_nr>0</from_nr>
       <to_nr>0</to_nr>
@@ -469,26 +592,35 @@ if(page == pagecount){
       <unconditional>N</unconditional>
     </hop>
     <hop>
-      <from>page&lt;=pagecount</from>
-      <to>成功</to>
+      <from>设置变量1237</from>
+      <to>page&lt;=pagecount</to>
       <from_nr>0</from_nr>
       <to_nr>0</to_nr>
       <enabled>Y</enabled>
-      <evaluation>N</evaluation>
+      <evaluation>Y</evaluation>
       <unconditional>N</unconditional>
     </hop>
     <hop>
-      <from>转换</from>
-      <to>JavaScript</to>
+      <from>Start</from>
+      <to>转换 (2)</to>
       <from_nr>0</from_nr>
+      <to_nr>1</to_nr>
+      <enabled>Y</enabled>
+      <evaluation>Y</evaluation>
+      <unconditional>Y</unconditional>
+    </hop>
+    <hop>
+      <from>转换 (2)</from>
+      <to>JavaScript 2</to>
+      <from_nr>1</from_nr>
       <to_nr>0</to_nr>
       <enabled>Y</enabled>
       <evaluation>Y</evaluation>
       <unconditional>N</unconditional>
     </hop>
     <hop>
-      <from>JavaScript</from>
-      <to>page&lt;=pagecount</to>
+      <from>JavaScript 2</from>
+      <to>设置变量1237</to>
       <from_nr>0</from_nr>
       <to_nr>0</to_nr>
       <enabled>Y</enabled>

+ 598 - 0
perday/mem_memberext_temp_etl_count_perday.ktr

@@ -0,0 +1,598 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<transformation>
+  <info>
+    <name>mem_memberext_temp_etl_count_perday</name>
+    <description/>
+    <extended_description/>
+    <trans_version/>
+    <trans_type>Normal</trans_type>
+    <directory>/</directory>
+    <parameters>
+    </parameters>
+    <log>
+      <trans-log-table>
+        <connection/>
+        <schema/>
+        <table/>
+        <size_limit_lines/>
+        <interval/>
+        <timeout_days/>
+        <field>
+          <id>ID_BATCH</id>
+          <enabled>Y</enabled>
+          <name>ID_BATCH</name>
+        </field>
+        <field>
+          <id>CHANNEL_ID</id>
+          <enabled>Y</enabled>
+          <name>CHANNEL_ID</name>
+        </field>
+        <field>
+          <id>TRANSNAME</id>
+          <enabled>Y</enabled>
+          <name>TRANSNAME</name>
+        </field>
+        <field>
+          <id>STATUS</id>
+          <enabled>Y</enabled>
+          <name>STATUS</name>
+        </field>
+        <field>
+          <id>LINES_READ</id>
+          <enabled>Y</enabled>
+          <name>LINES_READ</name>
+          <subject/>
+        </field>
+        <field>
+          <id>LINES_WRITTEN</id>
+          <enabled>Y</enabled>
+          <name>LINES_WRITTEN</name>
+          <subject/>
+        </field>
+        <field>
+          <id>LINES_UPDATED</id>
+          <enabled>Y</enabled>
+          <name>LINES_UPDATED</name>
+          <subject/>
+        </field>
+        <field>
+          <id>LINES_INPUT</id>
+          <enabled>Y</enabled>
+          <name>LINES_INPUT</name>
+          <subject/>
+        </field>
+        <field>
+          <id>LINES_OUTPUT</id>
+          <enabled>Y</enabled>
+          <name>LINES_OUTPUT</name>
+          <subject/>
+        </field>
+        <field>
+          <id>LINES_REJECTED</id>
+          <enabled>Y</enabled>
+          <name>LINES_REJECTED</name>
+          <subject/>
+        </field>
+        <field>
+          <id>ERRORS</id>
+          <enabled>Y</enabled>
+          <name>ERRORS</name>
+        </field>
+        <field>
+          <id>STARTDATE</id>
+          <enabled>Y</enabled>
+          <name>STARTDATE</name>
+        </field>
+        <field>
+          <id>ENDDATE</id>
+          <enabled>Y</enabled>
+          <name>ENDDATE</name>
+        </field>
+        <field>
+          <id>LOGDATE</id>
+          <enabled>Y</enabled>
+          <name>LOGDATE</name>
+        </field>
+        <field>
+          <id>DEPDATE</id>
+          <enabled>Y</enabled>
+          <name>DEPDATE</name>
+        </field>
+        <field>
+          <id>REPLAYDATE</id>
+          <enabled>Y</enabled>
+          <name>REPLAYDATE</name>
+        </field>
+        <field>
+          <id>LOG_FIELD</id>
+          <enabled>Y</enabled>
+          <name>LOG_FIELD</name>
+        </field>
+        <field>
+          <id>EXECUTING_SERVER</id>
+          <enabled>N</enabled>
+          <name>EXECUTING_SERVER</name>
+        </field>
+        <field>
+          <id>EXECUTING_USER</id>
+          <enabled>N</enabled>
+          <name>EXECUTING_USER</name>
+        </field>
+        <field>
+          <id>CLIENT</id>
+          <enabled>N</enabled>
+          <name>CLIENT</name>
+        </field>
+      </trans-log-table>
+      <perf-log-table>
+        <connection/>
+        <schema/>
+        <table/>
+        <interval/>
+        <timeout_days/>
+        <field>
+          <id>ID_BATCH</id>
+          <enabled>Y</enabled>
+          <name>ID_BATCH</name>
+        </field>
+        <field>
+          <id>SEQ_NR</id>
+          <enabled>Y</enabled>
+          <name>SEQ_NR</name>
+        </field>
+        <field>
+          <id>LOGDATE</id>
+          <enabled>Y</enabled>
+          <name>LOGDATE</name>
+        </field>
+        <field>
+          <id>TRANSNAME</id>
+          <enabled>Y</enabled>
+          <name>TRANSNAME</name>
+        </field>
+        <field>
+          <id>STEPNAME</id>
+          <enabled>Y</enabled>
+          <name>STEPNAME</name>
+        </field>
+        <field>
+          <id>STEP_COPY</id>
+          <enabled>Y</enabled>
+          <name>STEP_COPY</name>
+        </field>
+        <field>
+          <id>LINES_READ</id>
+          <enabled>Y</enabled>
+          <name>LINES_READ</name>
+        </field>
+        <field>
+          <id>LINES_WRITTEN</id>
+          <enabled>Y</enabled>
+          <name>LINES_WRITTEN</name>
+        </field>
+        <field>
+          <id>LINES_UPDATED</id>
+          <enabled>Y</enabled>
+          <name>LINES_UPDATED</name>
+        </field>
+        <field>
+          <id>LINES_INPUT</id>
+          <enabled>Y</enabled>
+          <name>LINES_INPUT</name>
+        </field>
+        <field>
+          <id>LINES_OUTPUT</id>
+          <enabled>Y</enabled>
+          <name>LINES_OUTPUT</name>
+        </field>
+        <field>
+          <id>LINES_REJECTED</id>
+          <enabled>Y</enabled>
+          <name>LINES_REJECTED</name>
+        </field>
+        <field>
+          <id>ERRORS</id>
+          <enabled>Y</enabled>
+          <name>ERRORS</name>
+        </field>
+        <field>
+          <id>INPUT_BUFFER_ROWS</id>
+          <enabled>Y</enabled>
+          <name>INPUT_BUFFER_ROWS</name>
+        </field>
+        <field>
+          <id>OUTPUT_BUFFER_ROWS</id>
+          <enabled>Y</enabled>
+          <name>OUTPUT_BUFFER_ROWS</name>
+        </field>
+      </perf-log-table>
+      <channel-log-table>
+        <connection/>
+        <schema/>
+        <table/>
+        <timeout_days/>
+        <field>
+          <id>ID_BATCH</id>
+          <enabled>Y</enabled>
+          <name>ID_BATCH</name>
+        </field>
+        <field>
+          <id>CHANNEL_ID</id>
+          <enabled>Y</enabled>
+          <name>CHANNEL_ID</name>
+        </field>
+        <field>
+          <id>LOG_DATE</id>
+          <enabled>Y</enabled>
+          <name>LOG_DATE</name>
+        </field>
+        <field>
+          <id>LOGGING_OBJECT_TYPE</id>
+          <enabled>Y</enabled>
+          <name>LOGGING_OBJECT_TYPE</name>
+        </field>
+        <field>
+          <id>OBJECT_NAME</id>
+          <enabled>Y</enabled>
+          <name>OBJECT_NAME</name>
+        </field>
+        <field>
+          <id>OBJECT_COPY</id>
+          <enabled>Y</enabled>
+          <name>OBJECT_COPY</name>
+        </field>
+        <field>
+          <id>REPOSITORY_DIRECTORY</id>
+          <enabled>Y</enabled>
+          <name>REPOSITORY_DIRECTORY</name>
+        </field>
+        <field>
+          <id>FILENAME</id>
+          <enabled>Y</enabled>
+          <name>FILENAME</name>
+        </field>
+        <field>
+          <id>OBJECT_ID</id>
+          <enabled>Y</enabled>
+          <name>OBJECT_ID</name>
+        </field>
+        <field>
+          <id>OBJECT_REVISION</id>
+          <enabled>Y</enabled>
+          <name>OBJECT_REVISION</name>
+        </field>
+        <field>
+          <id>PARENT_CHANNEL_ID</id>
+          <enabled>Y</enabled>
+          <name>PARENT_CHANNEL_ID</name>
+        </field>
+        <field>
+          <id>ROOT_CHANNEL_ID</id>
+          <enabled>Y</enabled>
+          <name>ROOT_CHANNEL_ID</name>
+        </field>
+      </channel-log-table>
+      <step-log-table>
+        <connection/>
+        <schema/>
+        <table/>
+        <timeout_days/>
+        <field>
+          <id>ID_BATCH</id>
+          <enabled>Y</enabled>
+          <name>ID_BATCH</name>
+        </field>
+        <field>
+          <id>CHANNEL_ID</id>
+          <enabled>Y</enabled>
+          <name>CHANNEL_ID</name>
+        </field>
+        <field>
+          <id>LOG_DATE</id>
+          <enabled>Y</enabled>
+          <name>LOG_DATE</name>
+        </field>
+        <field>
+          <id>TRANSNAME</id>
+          <enabled>Y</enabled>
+          <name>TRANSNAME</name>
+        </field>
+        <field>
+          <id>STEPNAME</id>
+          <enabled>Y</enabled>
+          <name>STEPNAME</name>
+        </field>
+        <field>
+          <id>STEP_COPY</id>
+          <enabled>Y</enabled>
+          <name>STEP_COPY</name>
+        </field>
+        <field>
+          <id>LINES_READ</id>
+          <enabled>Y</enabled>
+          <name>LINES_READ</name>
+        </field>
+        <field>
+          <id>LINES_WRITTEN</id>
+          <enabled>Y</enabled>
+          <name>LINES_WRITTEN</name>
+        </field>
+        <field>
+          <id>LINES_UPDATED</id>
+          <enabled>Y</enabled>
+          <name>LINES_UPDATED</name>
+        </field>
+        <field>
+          <id>LINES_INPUT</id>
+          <enabled>Y</enabled>
+          <name>LINES_INPUT</name>
+        </field>
+        <field>
+          <id>LINES_OUTPUT</id>
+          <enabled>Y</enabled>
+          <name>LINES_OUTPUT</name>
+        </field>
+        <field>
+          <id>LINES_REJECTED</id>
+          <enabled>Y</enabled>
+          <name>LINES_REJECTED</name>
+        </field>
+        <field>
+          <id>ERRORS</id>
+          <enabled>Y</enabled>
+          <name>ERRORS</name>
+        </field>
+        <field>
+          <id>LOG_FIELD</id>
+          <enabled>N</enabled>
+          <name>LOG_FIELD</name>
+        </field>
+      </step-log-table>
+      <metrics-log-table>
+        <connection/>
+        <schema/>
+        <table/>
+        <timeout_days/>
+        <field>
+          <id>ID_BATCH</id>
+          <enabled>Y</enabled>
+          <name>ID_BATCH</name>
+        </field>
+        <field>
+          <id>CHANNEL_ID</id>
+          <enabled>Y</enabled>
+          <name>CHANNEL_ID</name>
+        </field>
+        <field>
+          <id>LOG_DATE</id>
+          <enabled>Y</enabled>
+          <name>LOG_DATE</name>
+        </field>
+        <field>
+          <id>METRICS_DATE</id>
+          <enabled>Y</enabled>
+          <name>METRICS_DATE</name>
+        </field>
+        <field>
+          <id>METRICS_CODE</id>
+          <enabled>Y</enabled>
+          <name>METRICS_CODE</name>
+        </field>
+        <field>
+          <id>METRICS_DESCRIPTION</id>
+          <enabled>Y</enabled>
+          <name>METRICS_DESCRIPTION</name>
+        </field>
+        <field>
+          <id>METRICS_SUBJECT</id>
+          <enabled>Y</enabled>
+          <name>METRICS_SUBJECT</name>
+        </field>
+        <field>
+          <id>METRICS_TYPE</id>
+          <enabled>Y</enabled>
+          <name>METRICS_TYPE</name>
+        </field>
+        <field>
+          <id>METRICS_VALUE</id>
+          <enabled>Y</enabled>
+          <name>METRICS_VALUE</name>
+        </field>
+      </metrics-log-table>
+    </log>
+    <maxdate>
+      <connection/>
+      <table/>
+      <field/>
+      <offset>0.0</offset>
+      <maxdiff>0.0</maxdiff>
+    </maxdate>
+    <size_rowset>10000</size_rowset>
+    <sleep_time_empty>50</sleep_time_empty>
+    <sleep_time_full>50</sleep_time_full>
+    <unique_connections>N</unique_connections>
+    <feedback_shown>Y</feedback_shown>
+    <feedback_size>50000</feedback_size>
+    <using_thread_priorities>Y</using_thread_priorities>
+    <shared_objects_file/>
+    <capture_step_performance>N</capture_step_performance>
+    <step_performance_capturing_delay>1000</step_performance_capturing_delay>
+    <step_performance_capturing_size_limit>100</step_performance_capturing_size_limit>
+    <dependencies>
+    </dependencies>
+    <partitionschemas>
+    </partitionschemas>
+    <slaveservers>
+    </slaveservers>
+    <clusterschemas>
+    </clusterschemas>
+    <created_user>-</created_user>
+    <created_date>2019/07/17 16:55:33.177</created_date>
+    <modified_user>-</modified_user>
+    <modified_date>2019/07/17 16:55:33.177</modified_date>
+    <key_for_session_key>H4sIAAAAAAAAAAMAAAAAAAAAAAA=</key_for_session_key>
+    <is_key_private>N</is_key_private>
+  </info>
+  <notepads>
+  </notepads>
+  <connection>
+    <name>mall</name>
+    <server>192.168.50.32</server>
+    <type>MSSQLNATIVE</type>
+    <access>Native</access>
+    <database>Mall</database>
+    <port>1433</port>
+    <username>sa</username>
+    <password>Encrypted 2be98afc86aa7f297aa15a478c7d38f99</password>
+    <servername/>
+    <data_tablespace/>
+    <index_tablespace/>
+    <attributes>
+      <attribute>
+        <code>FORCE_IDENTIFIERS_TO_LOWERCASE</code>
+        <attribute>N</attribute>
+      </attribute>
+      <attribute>
+        <code>FORCE_IDENTIFIERS_TO_UPPERCASE</code>
+        <attribute>N</attribute>
+      </attribute>
+      <attribute>
+        <code>INITIAL_POOL_SIZE</code>
+        <attribute>30</attribute>
+      </attribute>
+      <attribute>
+        <code>IS_CLUSTERED</code>
+        <attribute>N</attribute>
+      </attribute>
+      <attribute>
+        <code>MAXIMUM_POOL_SIZE</code>
+        <attribute>1000</attribute>
+      </attribute>
+      <attribute>
+        <code>MSSQLUseIntegratedSecurity</code>
+        <attribute>false</attribute>
+      </attribute>
+      <attribute>
+        <code>MSSQL_DOUBLE_DECIMAL_SEPARATOR</code>
+        <attribute>N</attribute>
+      </attribute>
+      <attribute>
+        <code>PORT_NUMBER</code>
+        <attribute>1433</attribute>
+      </attribute>
+      <attribute>
+        <code>PRESERVE_RESERVED_WORD_CASE</code>
+        <attribute>Y</attribute>
+      </attribute>
+      <attribute>
+        <code>QUOTE_ALL_FIELDS</code>
+        <attribute>N</attribute>
+      </attribute>
+      <attribute>
+        <code>SUPPORTS_BOOLEAN_DATA_TYPE</code>
+        <attribute>Y</attribute>
+      </attribute>
+      <attribute>
+        <code>SUPPORTS_TIMESTAMP_DATA_TYPE</code>
+        <attribute>Y</attribute>
+      </attribute>
+      <attribute>
+        <code>USE_POOLING</code>
+        <attribute>Y</attribute>
+      </attribute>
+    </attributes>
+  </connection>
+  <order>
+    <hop>
+      <from>表输入 2</from>
+      <to>复制记录到结果 2</to>
+      <enabled>Y</enabled>
+    </hop>
+  </order>
+  <step>
+    <name>复制记录到结果 2</name>
+    <type>RowsToResult</type>
+    <description/>
+    <distribute>Y</distribute>
+    <custom_distribution/>
+    <copies>1</copies>
+    <partitioning>
+      <method>none</method>
+      <schema_name/>
+    </partitioning>
+    <attributes/>
+    <cluster_schema/>
+    <remotesteps>
+      <input>
+      </input>
+      <output>
+      </output>
+    </remotesteps>
+    <GUI>
+      <xloc>320</xloc>
+      <yloc>96</yloc>
+      <draw>Y</draw>
+    </GUI>
+  </step>
+  <step>
+    <name>表输入 2</name>
+    <type>TableInput</type>
+    <description/>
+    <distribute>Y</distribute>
+    <custom_distribution/>
+    <copies>1</copies>
+    <partitioning>
+      <method>none</method>
+      <schema_name/>
+    </partitioning>
+    <connection>mall</connection>
+    <sql>select (
+SELECT count(1)/50  as count1 
+
+FROM Orders a
+where 1=1 and (AconsigneePhone1!='' and AconsigneePhone1 is not null)
+		and OrderTime > '2019-05-01 00:00:01' 
+		--and  datediff(day,DATEADD(d,0,DATEDIFF(d,0,getdate())-90),OrderTime )>0
+) as count1,
+
+(SELECT count(1)/50  as count2 
+
+FROM Orders a
+where 1=1 and (AconsigneePhone2!='' and AconsigneePhone2 is not null)
+		and OrderTime > '2019-05-01 00:00:01' 
+		--and  datediff(day,DATEADD(d,0,DATEDIFF(d,0,getdate())-90),OrderTime )>0
+) as count2,
+
+(SELECT count(1)/50  as count3 
+
+FROM Orders a
+where 1=1 and (AconsigneePhone3!='' and AconsigneePhone3 is not null)
+		and OrderTime > '2019-05-01 00:00:01' 
+		--and  datediff(day,DATEADD(d,0,DATEDIFF(d,0,getdate())-90),OrderTime )>0
+) as count3</sql>
+    <limit>0</limit>
+    <lookup/>
+    <execute_each_row>N</execute_each_row>
+    <variables_active>N</variables_active>
+    <lazy_conversion_active>N</lazy_conversion_active>
+    <attributes/>
+    <cluster_schema/>
+    <remotesteps>
+      <input>
+      </input>
+      <output>
+      </output>
+    </remotesteps>
+    <GUI>
+      <xloc>112</xloc>
+      <yloc>80</yloc>
+      <draw>Y</draw>
+    </GUI>
+  </step>
+  <step_error_handling>
+  </step_error_handling>
+  <slave-step-copy-partition-distribution>
+  </slave-step-copy-partition-distribution>
+  <slave_transformation>N</slave_transformation>
+  <attributes/>
+</transformation>

+ 531 - 73
perday/mem_memberext_temp_etl_perday.ktr

@@ -437,14 +437,14 @@
   <notepads>
   </notepads>
   <connection>
-    <name>MallSqlserver</name>
+    <name>mall</name>
     <server>192.168.50.32</server>
     <type>MSSQLNATIVE</type>
     <access>Native</access>
     <database>Mall</database>
     <port>1433</port>
     <username>sa</username>
-    <password>Encrypted 2be98afc819c69e8ea300ff228dd38f99</password>
+    <password>Encrypted 2be98afc86aa7f297aa15a478c7d38f99</password>
     <servername/>
     <data_tablespace/>
     <index_tablespace/>
@@ -457,10 +457,18 @@
         <code>FORCE_IDENTIFIERS_TO_UPPERCASE</code>
         <attribute>N</attribute>
       </attribute>
+      <attribute>
+        <code>INITIAL_POOL_SIZE</code>
+        <attribute>30</attribute>
+      </attribute>
       <attribute>
         <code>IS_CLUSTERED</code>
         <attribute>N</attribute>
       </attribute>
+      <attribute>
+        <code>MAXIMUM_POOL_SIZE</code>
+        <attribute>1000</attribute>
+      </attribute>
       <attribute>
         <code>MSSQLUseIntegratedSecurity</code>
         <attribute>false</attribute>
@@ -491,16 +499,31 @@
       </attribute>
       <attribute>
         <code>USE_POOLING</code>
-        <attribute>N</attribute>
+        <attribute>Y</attribute>
       </attribute>
     </attributes>
   </connection>
   <order>
     <hop>
-      <from>表输入 2</from>
+      <from>表输入 1</from>
+      <to>Java 代码</to>
+      <enabled>Y</enabled>
+    </hop>
+    <hop>
+      <from>Java 代码</from>
       <to>Elasticsearch bulk insert 2</to>
       <enabled>Y</enabled>
     </hop>
+    <hop>
+      <from>表输入 2</from>
+      <to>Java 代码</to>
+      <enabled>Y</enabled>
+    </hop>
+    <hop>
+      <from>表输入 3</from>
+      <to>Java 代码</to>
+      <enabled>Y</enabled>
+    </hop>
   </order>
   <step>
     <name>Elasticsearch bulk insert 2</name>
@@ -508,22 +531,22 @@
     <description/>
     <distribute>Y</distribute>
     <custom_distribution/>
-    <copies>30</copies>
+    <copies>1</copies>
     <partitioning>
       <method>none</method>
       <schema_name/>
     </partitioning>
     <general>
-      <index>crm_memberext_temp</index>
+      <index>crm_memberext_temp_orderkey_v1</index>
       <type>_doc</type>
-      <batchSize>3</batchSize>
+      <batchSize>150</batchSize>
       <timeout>100</timeout>
       <timeoutUnit>SECONDS</timeoutUnit>
       <isJson>N</isJson>
-      <idField>MemKey</idField>
-      <overwriteIfExists>Y</overwriteIfExists>
+      <idField>OrderKey</idField>
+      <overwriteIfExists>N</overwriteIfExists>
       <useOutput>N</useOutput>
-      <stopOnError>Y</stopOnError>
+      <stopOnError>N</stopOnError>
     </general>
     <fields>
       <field>
@@ -559,8 +582,8 @@
         <targetName>AgainOrderCount</targetName>
       </field>
       <field>
-        <columnName>Age</columnName>
-        <targetName>Age</targetName>
+        <columnName>BirthDay</columnName>
+        <targetName>BirthDay</targetName>
       </field>
       <field>
         <columnName>BusinessId</columnName>
@@ -598,14 +621,6 @@
         <columnName>CustomerName</columnName>
         <targetName>CustomerName</targetName>
       </field>
-      <field>
-        <columnName>DataId</columnName>
-        <targetName>DataId</targetName>
-      </field>
-      <field>
-        <columnName>DataName</columnName>
-        <targetName>DataName</targetName>
-      </field>
       <field>
         <columnName>DeliveryType</columnName>
         <targetName>DeliveryType</targetName>
@@ -626,10 +641,6 @@
         <columnName>DeviceType</columnName>
         <targetName>DeviceType</targetName>
       </field>
-      <field>
-        <columnName>Discountprice</columnName>
-        <targetName>Discountprice</targetName>
-      </field>
       <field>
         <columnName>DiseaseClassCode</columnName>
         <targetName>DiseaseClassCode</targetName>
@@ -638,14 +649,6 @@
         <columnName>HuaWuOriginType</columnName>
         <targetName>HuaWuOriginType</targetName>
       </field>
-      <field>
-        <columnName>Id</columnName>
-        <targetName>Id</targetName>
-      </field>
-      <field>
-        <columnName>InitSum</columnName>
-        <targetName>InitSum</targetName>
-      </field>
       <field>
         <columnName>InventoryAuditDate</columnName>
         <targetName>InventoryAuditDate</targetName>
@@ -802,10 +805,6 @@
         <columnName>PreferentialRate</columnName>
         <targetName>PreferentialRate</targetName>
       </field>
-      <field>
-        <columnName>ProductCost</columnName>
-        <targetName>ProductCost</targetName>
-      </field>
       <field>
         <columnName>ProductLine</columnName>
         <targetName>ProductLine</targetName>
@@ -814,18 +813,10 @@
         <columnName>ReceivingTime</columnName>
         <targetName>ReceivingTime</targetName>
       </field>
-      <field>
-        <columnName>Reducing</columnName>
-        <targetName>Reducing</targetName>
-      </field>
       <field>
         <columnName>RegionCode</columnName>
         <targetName>RegionCode</targetName>
       </field>
-      <field>
-        <columnName>SDataId</columnName>
-        <targetName>SDataId</targetName>
-      </field>
       <field>
         <columnName>ShippingNo</columnName>
         <targetName>ShippingNo</targetName>
@@ -842,10 +833,6 @@
         <columnName>SubProductLine</columnName>
         <targetName>SubProductLine</targetName>
       </field>
-      <field>
-        <columnName>Sum</columnName>
-        <targetName>Sum</targetName>
-      </field>
       <field>
         <columnName>SyncStatus</columnName>
         <targetName>SyncStatus</targetName>
@@ -857,7 +844,7 @@
     </fields>
     <servers>
       <server>
-        <address>192.168.50.32</address>
+        <address>192.168.50.34</address>
         <port>9300</port>
       </server>
     </servers>
@@ -868,23 +855,42 @@
       </setting>
       <setting>
         <name>custom.aliase.source</name>
-        <value>mem_memberext_temp</value>
+        <value>mem_memberexts_temp</value>
       </setting>
       <setting>
-        <name>custom.fields.HasOrder</name>
-        <value>{"type":"boolean"}</value>
+        <name>custom.fields.BirthDay</name>
+        <value>{"type":"date","format":"yyyy-MM-dd HH:mm:ss||yyyy-MM-dd||strict_date_optional_time||epoch_millis"}</value>
       </setting>
       <setting>
-        <name>custom.fields.MemDesc</name>
-        <value>{"type":"text","analyzer": "ik_smart",
-"search_analyzer":"ik_smart","index":true}</value>
+        <name>custom.fields.CreationDate</name>
+        <value>{"type":"date","format":"yyyy-MM-dd HH:mm:ss||yyyy-MM-dd||strict_date_optional_time||epoch_millis"}</value>
       </setting>
       <setting>
-        <name>custom.fields.MemberBirthday</name>
+        <name>custom.fields.InventoryAuditDate</name>
         <value>{"type":"date","format":"yyyy-MM-dd HH:mm:ss||yyyy-MM-dd||strict_date_optional_time||epoch_millis"}</value>
       </setting>
       <setting>
-        <name>custom.fields.RegisterTime</name>
+        <name>custom.fields.LastModified</name>
+        <value>{"type":"date","format":"yyyy-MM-dd HH:mm:ss||yyyy-MM-dd||strict_date_optional_time||epoch_millis"}</value>
+      </setting>
+      <setting>
+        <name>custom.fields.OrderProcessDate</name>
+        <value>{"type":"date","format":"yyyy-MM-dd HH:mm:ss||yyyy-MM-dd||strict_date_optional_time||epoch_millis"}</value>
+      </setting>
+      <setting>
+        <name>custom.fields.OrderTime</name>
+        <value>{"type":"date","format":"yyyy-MM-dd HH:mm:ss||yyyy-MM-dd||strict_date_optional_time||epoch_millis"}</value>
+      </setting>
+      <setting>
+        <name>custom.fields.PreferentialRate</name>
+        <value>{"type":"double"}</value>
+      </setting>
+      <setting>
+        <name>custom.fields.ReceivingTime</name>
+        <value>{"type":"date","format":"yyyy-MM-dd HH:mm:ss||yyyy-MM-dd||strict_date_optional_time||epoch_millis"}</value>
+      </setting>
+      <setting>
+        <name>custom.fields.ShippingTime</name>
         <value>{"type":"date","format":"yyyy-MM-dd HH:mm:ss||yyyy-MM-dd||strict_date_optional_time||epoch_millis"}</value>
       </setting>
       <setting>
@@ -906,7 +912,341 @@
     </remotesteps>
     <GUI>
       <xloc>480</xloc>
-      <yloc>96</yloc>
+      <yloc>32</yloc>
+      <draw>Y</draw>
+    </GUI>
+  </step>
+  <step>
+    <name>Java 代码</name>
+    <type>UserDefinedJavaClass</type>
+    <description/>
+    <distribute>Y</distribute>
+    <custom_distribution/>
+    <copies>1</copies>
+    <partitioning>
+      <method>none</method>
+      <schema_name/>
+    </partitioning>
+    <definitions>
+      <definition>
+        <class_type>TRANSFORM_CLASS</class_type>
+        <class_name>Processor</class_name>
+        <class_source>import java.sql.*;
+import org.pentaho.di.core.database.*;
+
+import org.apache.http.HttpHost;
+import org.elasticsearch.ElasticsearchException;
+import org.elasticsearch.action.get.GetRequest;
+import org.elasticsearch.action.get.GetResponse;
+import org.elasticsearch.client.RestHighLevelClient;
+import org.elasticsearch.client.RequestOptions;
+import org.elasticsearch.client.RestClient;
+import org.elasticsearch.common.Strings;
+import org.elasticsearch.rest.RestStatus;
+import org.elasticsearch.search.fetch.subphase.FetchSourceContext;
+
+import org.elasticsearch.action.update.UpdateRequest;
+import org.elasticsearch.action.update.UpdateResponse;
+
+import org.elasticsearch.common.xcontent.XContentBuilder;
+import org.elasticsearch.common.xcontent.XContentFactory;
+import org.elasticsearch.script.Script;
+
+import java.lang.reflect.InvocationTargetException;  
+import java.lang.reflect.Method;  
+import com.microsoft.sqlserver.jdbc.SQLServerException;
+
+Database database = null;
+PreparedStatement stat = null;
+PreparedStatement stat1 = null;
+
+RestHighLevelClient client = new RestHighLevelClient(
+        RestClient.builder(
+                new HttpHost[]{new HttpHost("192.168.50.34", 9200, "http")}));
+Integer index = 0;
+public  boolean processRow(StepMetaInterface smi, StepDataInterface sdi) throws KettleException
+{
+    //logBasic("start---");
+	String type = getVariable("type");
+	String indexs = getVariable("index");
+	//if (indexs != null) index = Integer.parseInt(indexs);
+
+    Object[] r = getRow();
+    if (r == null) {
+	
+     	try {
+			if (stat!=null) {
+ 			stat.close();
+			}
+			
+			if (stat1!=null) {
+ 			stat1.close();
+			}
+			if (database!=null) {
+    	  	database.disconnect();
+    		}
+			if(client!=null){
+				client.close();
+			}
+		}
+   		catch(Exception e) {
+     		throw new KettleException(e);
+   		} 
+        setOutputDone();
+        return false;
+    }
+
+ synchronized(this) {
+
+    r = createOutputRow(r, data.outputRowMeta.size());
+    //获取数据库名和表名
+    String dbName = "MemberSqlServer";//getInputRowMeta().getString(r, "conname", null );
+    String tablename = "DataImport_membase";//getInputRowMeta().getString(r, "tablename", null );
+    String idname = "MemberKey";//getInputRowMeta().getString(r, "idname", null );
+    String idname1 = "MemPhone1";//getInputRowMeta().getString(r, "idname", null );
+    String idname2 = "MemPhone2";//getInputRowMeta().getString(r, "idname", null );
+    String idname3 = "MemPhone3";//getInputRowMeta().getString(r, "idname", null );
+
+    String sourceidname = "OrderKey";//getInputRowMeta().getString(r, "sourceidname", null );
+    String sourcetablename = "Orders";//getInputRowMeta().getString(r, "sourcetablename", null );
+    if (dbName==null||tablename==null) {
+      throw new KettleException("Unable to find field with name "+tablename+" in the input row.");
+    }
+    //logBasic("table---"+tablename);
+
+/*
+if(database == null){
+//数据库连接
+    DatabaseMeta databaseMeta=null;
+    try  {
+          databaseMeta = getTransMeta().findDatabase(dbName);
+         if (databaseMeta==null) {
+         logError("A connection with name "+dbName+" could not be found!");
+         setErrors(1);
+         return false;
+    }
+      database = new Database(getTrans(), databaseMeta);
+      database.connect();
+       //logBasic("success!");
+    } catch(Exception e) {
+      logError("Connecting to database "+dbName+" failed.", e);
+      setErrors(1);
+      return false;
+    }
+}
+*/
+
+//查询表数据
+     try {
+      RowMetaInterface idxRowMeta =data.outputRowMeta;
+ 
+      int i=0;
+
+          r = createOutputRow(r, data.outputRowMeta.size());
+		  
+          //int index = getInputRowMeta().size();
+          
+
+        // Add the index name
+        //
+        String Id = idxRowMeta.getString(r, idname, null);
+        String Id1 = idxRowMeta.getString(r, idname1, null);
+        String Id2 = idxRowMeta.getString(r, idname2, null);
+        String Id3 = idxRowMeta.getString(r, idname3, null);
+
+        // Add the column name
+        
+        String DataId = idxRowMeta.getString(r, sourceidname, null);
+        
+		Thread.sleep(100);
+        /*
+		GetRequest getRequest = new GetRequest(
+    	"crm_memberext_temp_orderkey_v1",  // Index
+    	"_doc",    // /Type
+    	DataId);     // Document id
+		getRequest.fetchSourceContext(new FetchSourceContext(false));  // 禁用 _source 字段
+		getRequest.storedFields(new String[]{"_none_"}); // 禁止存储任何字段      
+     	boolean exists = client.exists(getRequest,RequestOptions.DEFAULT);
+		    //client.close();
+		if(exists ){
+    		return true;
+	 	}
+		*/
+
+		
+        //logBasic("idxRow--Id"+Id);
+        //logBasic("idxRow--sourcetablename"+sourcetablename);
+        //logBasic("idxRow--DataId"+DataId);
+		
+		
+
+		//Integer pn = Integer.parseInt(Id);
+		//Integer curpageNum =  Integer.parseInt(Id) % pagesize;
+		//if(pn > 0 &amp;&amp; curpageNum == 0){
+		//	setVariable("page",String.valueOf(page));
+		//}
+ 		//logBasic("idxRow--getVariable"+getVariable("page"));
+ 		//logBasic("idxRow--curpageNum"+curpageNum);
+
+        //logBasic("idxRow--length"+i);
+    
+   }
+   catch(SQLServerException e) { 
+     return true;
+   }catch(Exception e) {
+     
+     throw new KettleException(e);
+   }
+	//释放连接
+    //if (database!=null) {
+    //  database.disconnect();
+    //}
+
+  // Send the row on to the next step.
+}
+  putRow(data.outputRowMeta, r);
+
+    return true;
+}</class_source>
+      </definition>
+    </definitions>
+    <fields>
+    </fields>
+    <clear_result_fields>N</clear_result_fields>
+    <info_steps/>
+    <target_steps/>
+    <usage_parameters/>
+    <attributes/>
+    <cluster_schema/>
+    <remotesteps>
+      <input>
+      </input>
+      <output>
+      </output>
+    </remotesteps>
+    <GUI>
+      <xloc>368</xloc>
+      <yloc>48</yloc>
+      <draw>Y</draw>
+    </GUI>
+  </step>
+  <step>
+    <name>表输入 1</name>
+    <type>TableInput</type>
+    <description/>
+    <distribute>Y</distribute>
+    <custom_distribution/>
+    <copies>1</copies>
+    <partitioning>
+      <method>none</method>
+      <schema_name/>
+    </partitioning>
+    <connection>mall</connection>
+    <sql>
+SELECT 
+  1 as MemKey,
+  OrdersCode as OrderKey,
+  OrdersCode
+  ,
+	dbo.DesDecryptFixKey('123456','123456e10adc3949ba59abbe56e057f20f883e',AConsigneePhone1) as MemUsualPhone
+, convert(varchar(19),[CreationDate],120) as [CreationDate]
+, convert(varchar(19),[LastModified],120) as [LastModified]
+, AccountId
+, AccountName
+, Consignee as MemberNickName
+, DeliveryZipCode
+, Invoice
+, InvoiceNo
+, OrderNotes
+, PaymentType
+, DeliveryType
+, convert(varchar(19),[OrderTime],120) as [OrderTime]
+, convert(varchar(19),[ShippingTime],120) as [ShippingTime]
+, convert(varchar(19),[ReceivingTime],120) as [ReceivingTime]
+, ShippingNo
+, OrderStatus
+, IsReturn
+, TransportCosts
+, RegionCode
+, IsRxDrug
+, OriginType
+, OperateID
+, DeptId
+, DeptCode
+, BuyUserId
+, ProductLine
+, SubProductLine
+, DiseaseClassCode
+, convert(varchar(19),[Age],120) as [BirthDay]
+, Sex as MemberGender
+, SyncStatus
+, IsVisible
+, SourcePlatforms
+, DeviceType
+, IsReward
+, IsEmailmark
+, CustomerDataId
+, IsDrug
+, HuaWuOriginType
+, AgainOrderCount
+, ConfimLevel
+, BusinessId
+, IsPayByCard
+, PreferentialRate
+, dbo.DesDecryptFixKey('123456','123456e10adc3949ba59abbe56e057f20f883e',AConsigneePhone1) as AConsigneePhone1
+, dbo.DesDecryptFixKey('123456','123456e10adc3949ba59abbe56e057f20f883e',AConsigneePhone2) as AConsigneePhone2
+, dbo.DesDecryptFixKey('123456','123456e10adc3949ba59abbe56e057f20f883e',AConsigneePhone3) as AConsigneePhone3
+, dbo.DesDecryptFixKey('123456','123456e10adc3949ba59abbe56e057f20f883e',ADeliveryAddress) as ADeliveryAddress
+, IsDealWith
+, IsNewOrder
+, ConsigneeType
+, CustomerCode
+, CustomerName
+, InvoiceContent
+, InvoiceContentType
+, OrdersType
+, LeverNumber
+, IsO2O
+, AdvancePayType
+, convert(varchar(19),[InventoryAuditDate],120) as [InventoryAuditDate]
+, convert(varchar(19),[OrderProcessDate],120) as [OrderProcessDate]
+, IsToERP
+, MerchantNote
+, OtherNote
+, IsPrescription
+, ConfirmId	
+,
+  case when b0.Level= 3  then a.RegionCode else null  end as MemUsualAreaCode,
+  case when b1.Level= 2  then b.ParentCode else b.AreaCode  end as MemUsualCityCode,
+  case when c1.Level= 1  then c.ParentCode else c.AreaCode  end as MemUsualProvinceCode
+FROM Orders a
+	left join Areamap b0 on b0.MappingCode=a.RegionCode
+   left join AreaRegion b on b.AreaCode=a.RegionCode left join Areamap b1 on b1.MappingCode=b.ParentCode
+   left join AreaRegion c on c.AreaCode=b.ParentCode left join Areamap c1 on c1.MappingCode=c.ParentCode
+where 1=1 and (AconsigneePhone1!='' and AconsigneePhone1 is not null)
+		and OrderTime > '2019-05-01 00:00:01' 
+		 --and  datediff(day,DATEADD(d,0,DATEDIFF(d,0,getdate())-100),OrderTime )>0
+order by OrderTime desc 
+--order by AConsigneePhone2 asc 
+--  offset 4600 rows --fetch NEXT  2 rows only
+--offset ((524-1)*5000) rows --fetch next (10) rows only
+offset ((${mem_ext_temp_page1}-1)*${mem_ext_temp_pagesize1}) rows fetch next (${mem_ext_temp_pagesize1}) rows only</sql>
+    <limit>0</limit>
+    <lookup/>
+    <execute_each_row>N</execute_each_row>
+    <variables_active>Y</variables_active>
+    <lazy_conversion_active>N</lazy_conversion_active>
+    <attributes/>
+    <cluster_schema/>
+    <remotesteps>
+      <input>
+      </input>
+      <output>
+      </output>
+    </remotesteps>
+    <GUI>
+      <xloc>224</xloc>
+      <yloc>48</yloc>
       <draw>Y</draw>
     </GUI>
   </step>
@@ -921,17 +1261,13 @@
       <method>none</method>
       <schema_name/>
     </partitioning>
-    <connection>MallSqlserver</connection>
+    <connection>mall</connection>
     <sql>
 SELECT 
-  row_number() over (order by AConsigneePhone2 asc ) as MemKey,
+  1 as MemKey,
   OrdersCode as OrderKey,
   OrdersCode
-  ,case when AConsigneePhone2= '' then 
-(case 
-	when AconsigneePhone1!='' then dbo.DesDecryptFixKey('123456','123456e10adc3949ba59abbe56e057f20f883e',AConsigneePhone1) 
-	else ''end)
-  ELSE dbo.DesDecryptFixKey('123456','123456e10adc3949ba59abbe56e057f20f883e',AConsigneePhone2) end as MemUsualPhone
+  ,dbo.DesDecryptFixKey('123456','123456e10adc3949ba59abbe56e057f20f883e',AConsigneePhone2) as MemUsualPhone
 , convert(varchar(19),[CreationDate],120) as [CreationDate]
 , convert(varchar(19),[LastModified],120) as [LastModified]
 , AccountId
@@ -1006,16 +1342,138 @@ FROM Orders a
 	left join Areamap b0 on b0.MappingCode=a.RegionCode
    left join AreaRegion b on b.AreaCode=a.RegionCode left join Areamap b1 on b1.MappingCode=b.ParentCode
    left join AreaRegion c on c.AreaCode=b.ParentCode left join Areamap c1 on c1.MappingCode=c.ParentCode
-where 1=1 and (AconsigneePhone1!='' or AconsigneePhone2!='')
+where 1=1 and (AConsigneePhone2!='' and AConsigneePhone2 is not null)
+		and OrderTime > '2019-05-01 00:00:01' 
+		 --and  datediff(day,DATEADD(d,0,DATEDIFF(d,0,getdate())-100),OrderTime )>0
+	order by OrderTime	 asc 
 --order by AConsigneePhone2 asc 
- --offset 0 rows fetch NEXT  2 rows only
-
-order by AConsigneePhone2 asc 
-offset ((524-1)*5000) rows --fetch next (10) rows only</sql>
+ --offset 8600 rows --fetch NEXT  2 rows only
+--offset ((524-1)*5000) rows --fetch next (10) rows only
+offset ((${mem_ext_temp_page2}-1)*${mem_ext_temp_pagesize2}) rows fetch next (${mem_ext_temp_pagesize2}) rows only</sql>
+    <limit>0</limit>
+    <lookup/>
+    <execute_each_row>N</execute_each_row>
+    <variables_active>Y</variables_active>
+    <lazy_conversion_active>N</lazy_conversion_active>
+    <attributes/>
+    <cluster_schema/>
+    <remotesteps>
+      <input>
+      </input>
+      <output>
+      </output>
+    </remotesteps>
+    <GUI>
+      <xloc>224</xloc>
+      <yloc>144</yloc>
+      <draw>Y</draw>
+    </GUI>
+  </step>
+  <step>
+    <name>表输入 3</name>
+    <type>TableInput</type>
+    <description/>
+    <distribute>Y</distribute>
+    <custom_distribution/>
+    <copies>1</copies>
+    <partitioning>
+      <method>none</method>
+      <schema_name/>
+    </partitioning>
+    <connection>mall</connection>
+    <sql>
+SELECT 
+  1 as MemKey,
+  OrdersCode as OrderKey,
+  OrdersCode
+  ,
+	dbo.DesDecryptFixKey('123456','123456e10adc3949ba59abbe56e057f20f883e',AConsigneePhone3) as MemUsualPhone
+, convert(varchar(19),[CreationDate],120) as [CreationDate]
+, convert(varchar(19),[LastModified],120) as [LastModified]
+, AccountId
+, AccountName
+, Consignee as MemberNickName
+, DeliveryZipCode
+, Invoice
+, InvoiceNo
+, OrderNotes
+, PaymentType
+, DeliveryType
+, convert(varchar(19),[OrderTime],120) as [OrderTime]
+, convert(varchar(19),[ShippingTime],120) as [ShippingTime]
+, convert(varchar(19),[ReceivingTime],120) as [ReceivingTime]
+, ShippingNo
+, OrderStatus
+, IsReturn
+, TransportCosts
+, RegionCode
+, IsRxDrug
+, OriginType
+, OperateID
+, DeptId
+, DeptCode
+, BuyUserId
+, ProductLine
+, SubProductLine
+, DiseaseClassCode
+, convert(varchar(19),[Age],120) as [BirthDay]
+, Sex as MemberGender
+, SyncStatus
+, IsVisible
+, SourcePlatforms
+, DeviceType
+, IsReward
+, IsEmailmark
+, CustomerDataId
+, IsDrug
+, HuaWuOriginType
+, AgainOrderCount
+, ConfimLevel
+, BusinessId
+, IsPayByCard
+, PreferentialRate
+, dbo.DesDecryptFixKey('123456','123456e10adc3949ba59abbe56e057f20f883e',AConsigneePhone1) as AConsigneePhone1
+, dbo.DesDecryptFixKey('123456','123456e10adc3949ba59abbe56e057f20f883e',AConsigneePhone2) as AConsigneePhone2
+, dbo.DesDecryptFixKey('123456','123456e10adc3949ba59abbe56e057f20f883e',AConsigneePhone3) as AConsigneePhone3
+, dbo.DesDecryptFixKey('123456','123456e10adc3949ba59abbe56e057f20f883e',ADeliveryAddress) as ADeliveryAddress
+, IsDealWith
+, IsNewOrder
+, ConsigneeType
+, CustomerCode
+, CustomerName
+, InvoiceContent
+, InvoiceContentType
+, OrdersType
+, LeverNumber
+, IsO2O
+, AdvancePayType
+, convert(varchar(19),[InventoryAuditDate],120) as [InventoryAuditDate]
+, convert(varchar(19),[OrderProcessDate],120) as [OrderProcessDate]
+, IsToERP
+, MerchantNote
+, OtherNote
+, IsPrescription
+, ConfirmId	
+,
+  case when b0.Level= 3  then a.RegionCode else null  end as MemUsualAreaCode,
+  case when b1.Level= 2  then b.ParentCode else b.AreaCode  end as MemUsualCityCode,
+  case when c1.Level= 1  then c.ParentCode else c.AreaCode  end as MemUsualProvinceCode
+FROM Orders a
+	left join Areamap b0 on b0.MappingCode=a.RegionCode
+   left join AreaRegion b on b.AreaCode=a.RegionCode left join Areamap b1 on b1.MappingCode=b.ParentCode
+   left join AreaRegion c on c.AreaCode=b.ParentCode left join Areamap c1 on c1.MappingCode=c.ParentCode
+where 1=1 and (AConsigneePhone3!='' and AConsigneePhone3 is not null)
+		and OrderTime > '2019-05-01 00:00:01' 
+		 --and  datediff(day,DATEADD(d,0,DATEDIFF(d,0,getdate())-100),OrderTime )>0
+order by OrderTime desc 
+--order by AConsigneePhone3 asc 
+--offset 10450 rows --fetch NEXT  2 rows only
+--offset ((524-1)*5000) rows --fetch next (10) rows only
+offset ((${mem_ext_temp_page3}-1)*${mem_ext_temp_pagesize3}) rows fetch next (${mem_ext_temp_pagesize3}) rows only</sql>
     <limit>0</limit>
     <lookup/>
     <execute_each_row>N</execute_each_row>
-    <variables_active>N</variables_active>
+    <variables_active>Y</variables_active>
     <lazy_conversion_active>N</lazy_conversion_active>
     <attributes/>
     <cluster_schema/>
@@ -1026,8 +1484,8 @@ offset ((524-1)*5000) rows --fetch next (10) rows only</sql>
       </output>
     </remotesteps>
     <GUI>
-      <xloc>256</xloc>
-      <yloc>112</yloc>
+      <xloc>242</xloc>
+      <yloc>240</yloc>
       <draw>Y</draw>
     </GUI>
   </step>

+ 164 - 32
perday/mem_memberext_temp_etl_perday_page.kjb

@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <job>
-  <name>mem_memberbase_page</name>
+  <name>mem_memberext_temp_etl_perday_page</name>
   <description/>
   <extended_description/>
   <job_version/>
@@ -292,23 +292,63 @@
       <description/>
       <type>SET_VARIABLES</type>
       <attributes/>
-      <replacevars>Y</replacevars>
+      <replacevars>N</replacevars>
       <filename/>
       <file_variable_type>JVM</file_variable_type>
       <fields>
         <field>
-          <variable_name>page</variable_name>
-          <variable_value>1</variable_value>
+          <variable_name>mem_ext_temp_page1</variable_name>
+          <variable_value>156</variable_value>
           <variable_type>JVM</variable_type>
         </field>
         <field>
-          <variable_name>pagesize</variable_name>
-          <variable_value>5000</variable_value>
+          <variable_name>mem_ext_temp_pagesize1</variable_name>
+          <variable_value>50</variable_value>
           <variable_type>JVM</variable_type>
         </field>
         <field>
-          <variable_name>pagecount</variable_name>
-          <variable_value>1237</variable_value>
+          <variable_name>mem_ext_temp_pagecount1</variable_name>
+          <variable_value>${mem_ext_temp_count1}</variable_value>
+          <variable_type>JVM</variable_type>
+        </field>
+        <field>
+          <variable_name>mem_ext_temp_page2</variable_name>
+          <variable_value>156</variable_value>
+          <variable_type>JVM</variable_type>
+        </field>
+        <field>
+          <variable_name>mem_ext_temp_pagesize2</variable_name>
+          <variable_value>50</variable_value>
+          <variable_type>JVM</variable_type>
+        </field>
+        <field>
+          <variable_name>mem_ext_temp_pagecount2</variable_name>
+          <variable_value>${mem_ext_temp_count2}</variable_value>
+          <variable_type>JVM</variable_type>
+        </field>
+        <field>
+          <variable_name>mem_ext_temp_page3</variable_name>
+          <variable_value>107</variable_value>
+          <variable_type>JVM</variable_type>
+        </field>
+        <field>
+          <variable_name>mem_ext_temp_pagesize3</variable_name>
+          <variable_value>50</variable_value>
+          <variable_type>JVM</variable_type>
+        </field>
+        <field>
+          <variable_name>mem_ext_temp_pagecount3</variable_name>
+          <variable_value>${mem_ext_temp_count2}</variable_value>
+          <variable_type>JVM</variable_type>
+        </field>
+        <field>
+          <variable_name>mem_ext_temp_pagecountSum</variable_name>
+          <variable_value>${mem_ext_temp_countSum}</variable_value>
+          <variable_type>JVM</variable_type>
+        </field>
+        <field>
+          <variable_name>mem_ext_temp_pageSum</variable_name>
+          <variable_value>0</variable_value>
           <variable_type>JVM</variable_type>
         </field>
       </fields>
@@ -347,11 +387,11 @@
       <type>SIMPLE_EVAL</type>
       <attributes/>
       <valuetype>variable</valuetype>
-      <fieldname/>
-      <variablename>page</variablename>
+      <fieldname>pageSum</fieldname>
+      <variablename>mem_ext_temp_pageSum</variablename>
       <fieldtype>number</fieldtype>
       <mask/>
-      <comparevalue>${pagecount}</comparevalue>
+      <comparevalue>${mem_ext_temp_pagecountSum}</comparevalue>
       <minvalue/>
       <maxvalue/>
       <successcondition>equal</successcondition>
@@ -361,7 +401,7 @@
       <parallel>N</parallel>
       <draw>Y</draw>
       <nr>0</nr>
-      <xloc>432</xloc>
+      <xloc>400</xloc>
       <yloc>208</yloc>
       <attributes_kjc/>
     </entry>
@@ -370,16 +410,28 @@
       <description/>
       <type>EVAL</type>
       <attributes/>
-      <script>var page;
+      <script>var page1;
+var page2;
+var page3;
 
-page = parent_job.getVariable("page");
-var pagecount = parent_job.getVariable("pagecount");
+page1 = parent_job.getVariable("mem_ext_temp_page1");
+page2 = parent_job.getVariable("mem_ext_temp_page2");
+page3 = parent_job.getVariable("mem_ext_temp_page3");
+var pagecount1 = parent_job.getVariable("mem_ext_temp_pagecount1");
+var pagecount2 = parent_job.getVariable("mem_ext_temp_pagecount2");
+var pagecount3 = parent_job.getVariable("mem_ext_temp_pagecount3");
 
-if(page == pagecount){
+if(page1 == pagecount1 &amp;&amp; page2 == pagecount2  &amp;&amp; page3 == pagecount3 ){
     false;
 }else{
-	page++;
-	parent_job.setVariable("page",page);
+	page1++;
+	page2++;
+	page3++;
+	parent_job.setVariable("mem_ext_temp_page1",page1);
+	parent_job.setVariable("mem_ext_temp_page2",page2);
+	parent_job.setVariable("mem_ext_temp_page3",page3);
+	parent_job.setVariable("mem_ext_temp_pageSum",page1 + page2 + page3);
+
 	true;
 }</script>
       <parallel>N</parallel>
@@ -396,7 +448,7 @@ if(page == pagecount){
       <attributes/>
       <specification_method>filename</specification_method>
       <trans_object_id/>
-      <filename>${Internal.Entry.Current.Directory}/mem_memberext_temp_etl_nojava.ktr</filename>
+      <filename>${Internal.Entry.Current.Directory}/mem_memberext_temp_etl_perday.ktr</filename>
       <transname/>
       <arg_from_previous>N</arg_from_previous>
       <params_from_previous>N</params_from_previous>
@@ -439,28 +491,99 @@ if(page == pagecount){
       <yloc>272</yloc>
       <attributes_kjc/>
     </entry>
+    <entry>
+      <name>转换 (2)</name>
+      <description/>
+      <type>TRANS</type>
+      <attributes/>
+      <specification_method>filename</specification_method>
+      <trans_object_id/>
+      <filename>${Internal.Entry.Current.Directory}/mem_memberext_temp_etl_count_perday.ktr</filename>
+      <transname/>
+      <arg_from_previous>N</arg_from_previous>
+      <params_from_previous>N</params_from_previous>
+      <exec_per_row>N</exec_per_row>
+      <clear_rows>N</clear_rows>
+      <clear_files>N</clear_files>
+      <set_logfile>N</set_logfile>
+      <logfile/>
+      <logext/>
+      <add_date>N</add_date>
+      <add_time>N</add_time>
+      <loglevel>Basic</loglevel>
+      <cluster>N</cluster>
+      <slave_server_name/>
+      <set_append_logfile>N</set_append_logfile>
+      <wait_until_finished>Y</wait_until_finished>
+      <follow_abort_remote>N</follow_abort_remote>
+      <create_parent_folder>N</create_parent_folder>
+      <logging_remote_work>N</logging_remote_work>
+      <run_configuration>Pentaho local</run_configuration>
+      <parameters>
+        <pass_all_parameters>Y</pass_all_parameters>
+      </parameters>
+      <parallel>N</parallel>
+      <draw>Y</draw>
+      <nr>1</nr>
+      <xloc>192</xloc>
+      <yloc>144</yloc>
+      <attributes_kjc/>
+    </entry>
+    <entry>
+      <name>JavaScript 2</name>
+      <description/>
+      <type>EVAL</type>
+      <attributes/>
+      <script>var prevRow = previous_result.getRows();
+
+if(prevRow == null){
+    false;
+}else{
+	parent_job.setVariable("mem_ext_temp_count1",prevRow.get(0).getString("count1",""));
+	parent_job.setVariable("mem_ext_temp_count2",prevRow.get(0).getString("count2",""));
+	parent_job.setVariable("mem_ext_temp_count3",prevRow.get(0).getString("count3",""));
+	parent_job.setVariable("mem_ext_temp_countSum",0+prevRow.get(0).getString("count1","")+
+prevRow.get(0).getString("count2","")+prevRow.get(0).getString("count3",""));
+	true;
+}</script>
+      <parallel>N</parallel>
+      <draw>Y</draw>
+      <nr>0</nr>
+      <xloc>256</xloc>
+      <yloc>48</yloc>
+      <attributes_kjc/>
+    </entry>
   </entries>
   <hops>
     <hop>
-      <from>Start</from>
-      <to>设置变量1237</to>
+      <from>page&lt;=pagecount</from>
+      <to>转换</to>
       <from_nr>0</from_nr>
       <to_nr>0</to_nr>
       <enabled>Y</enabled>
       <evaluation>Y</evaluation>
-      <unconditional>Y</unconditional>
+      <unconditional>N</unconditional>
     </hop>
     <hop>
       <from>page&lt;=pagecount</from>
-      <to>转换</to>
+      <to>成功</to>
       <from_nr>0</from_nr>
       <to_nr>0</to_nr>
       <enabled>Y</enabled>
-      <evaluation>Y</evaluation>
+      <evaluation>N</evaluation>
       <unconditional>N</unconditional>
     </hop>
     <hop>
-      <from>设置变量1237</from>
+      <from>转换</from>
+      <to>JavaScript</to>
+      <from_nr>0</from_nr>
+      <to_nr>0</to_nr>
+      <enabled>Y</enabled>
+      <evaluation>Y</evaluation>
+      <unconditional>Y</unconditional>
+    </hop>
+    <hop>
+      <from>JavaScript</from>
       <to>page&lt;=pagecount</to>
       <from_nr>0</from_nr>
       <to_nr>0</to_nr>
@@ -469,26 +592,35 @@ if(page == pagecount){
       <unconditional>N</unconditional>
     </hop>
     <hop>
-      <from>page&lt;=pagecount</from>
-      <to>成功</to>
+      <from>设置变量1237</from>
+      <to>page&lt;=pagecount</to>
       <from_nr>0</from_nr>
       <to_nr>0</to_nr>
       <enabled>Y</enabled>
-      <evaluation>N</evaluation>
+      <evaluation>Y</evaluation>
       <unconditional>N</unconditional>
     </hop>
     <hop>
-      <from>转换</from>
-      <to>JavaScript</to>
+      <from>Start</from>
+      <to>转换 (2)</to>
       <from_nr>0</from_nr>
+      <to_nr>1</to_nr>
+      <enabled>Y</enabled>
+      <evaluation>Y</evaluation>
+      <unconditional>Y</unconditional>
+    </hop>
+    <hop>
+      <from>转换 (2)</from>
+      <to>JavaScript 2</to>
+      <from_nr>1</from_nr>
       <to_nr>0</to_nr>
       <enabled>Y</enabled>
       <evaluation>Y</evaluation>
       <unconditional>N</unconditional>
     </hop>
     <hop>
-      <from>JavaScript</from>
-      <to>page&lt;=pagecount</to>
+      <from>JavaScript 2</from>
+      <to>设置变量1237</to>
       <from_nr>0</from_nr>
       <to_nr>0</to_nr>
       <enabled>Y</enabled>

+ 585 - 0
perday/mem_orderproducts_etl_count_perday.ktr

@@ -0,0 +1,585 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<transformation>
+  <info>
+    <name>mem_orderproducts_etl_count_perday</name>
+    <description/>
+    <extended_description/>
+    <trans_version/>
+    <trans_type>Normal</trans_type>
+    <trans_status>0</trans_status>
+    <directory>/</directory>
+    <parameters>
+    </parameters>
+    <log>
+      <trans-log-table>
+        <connection/>
+        <schema/>
+        <table/>
+        <size_limit_lines/>
+        <interval/>
+        <timeout_days/>
+        <field>
+          <id>ID_BATCH</id>
+          <enabled>Y</enabled>
+          <name>ID_BATCH</name>
+        </field>
+        <field>
+          <id>CHANNEL_ID</id>
+          <enabled>Y</enabled>
+          <name>CHANNEL_ID</name>
+        </field>
+        <field>
+          <id>TRANSNAME</id>
+          <enabled>Y</enabled>
+          <name>TRANSNAME</name>
+        </field>
+        <field>
+          <id>STATUS</id>
+          <enabled>Y</enabled>
+          <name>STATUS</name>
+        </field>
+        <field>
+          <id>LINES_READ</id>
+          <enabled>Y</enabled>
+          <name>LINES_READ</name>
+          <subject/>
+        </field>
+        <field>
+          <id>LINES_WRITTEN</id>
+          <enabled>Y</enabled>
+          <name>LINES_WRITTEN</name>
+          <subject/>
+        </field>
+        <field>
+          <id>LINES_UPDATED</id>
+          <enabled>Y</enabled>
+          <name>LINES_UPDATED</name>
+          <subject/>
+        </field>
+        <field>
+          <id>LINES_INPUT</id>
+          <enabled>Y</enabled>
+          <name>LINES_INPUT</name>
+          <subject/>
+        </field>
+        <field>
+          <id>LINES_OUTPUT</id>
+          <enabled>Y</enabled>
+          <name>LINES_OUTPUT</name>
+          <subject/>
+        </field>
+        <field>
+          <id>LINES_REJECTED</id>
+          <enabled>Y</enabled>
+          <name>LINES_REJECTED</name>
+          <subject/>
+        </field>
+        <field>
+          <id>ERRORS</id>
+          <enabled>Y</enabled>
+          <name>ERRORS</name>
+        </field>
+        <field>
+          <id>STARTDATE</id>
+          <enabled>Y</enabled>
+          <name>STARTDATE</name>
+        </field>
+        <field>
+          <id>ENDDATE</id>
+          <enabled>Y</enabled>
+          <name>ENDDATE</name>
+        </field>
+        <field>
+          <id>LOGDATE</id>
+          <enabled>Y</enabled>
+          <name>LOGDATE</name>
+        </field>
+        <field>
+          <id>DEPDATE</id>
+          <enabled>Y</enabled>
+          <name>DEPDATE</name>
+        </field>
+        <field>
+          <id>REPLAYDATE</id>
+          <enabled>Y</enabled>
+          <name>REPLAYDATE</name>
+        </field>
+        <field>
+          <id>LOG_FIELD</id>
+          <enabled>Y</enabled>
+          <name>LOG_FIELD</name>
+        </field>
+        <field>
+          <id>EXECUTING_SERVER</id>
+          <enabled>N</enabled>
+          <name>EXECUTING_SERVER</name>
+        </field>
+        <field>
+          <id>EXECUTING_USER</id>
+          <enabled>N</enabled>
+          <name>EXECUTING_USER</name>
+        </field>
+        <field>
+          <id>CLIENT</id>
+          <enabled>N</enabled>
+          <name>CLIENT</name>
+        </field>
+      </trans-log-table>
+      <perf-log-table>
+        <connection/>
+        <schema/>
+        <table/>
+        <interval/>
+        <timeout_days/>
+        <field>
+          <id>ID_BATCH</id>
+          <enabled>Y</enabled>
+          <name>ID_BATCH</name>
+        </field>
+        <field>
+          <id>SEQ_NR</id>
+          <enabled>Y</enabled>
+          <name>SEQ_NR</name>
+        </field>
+        <field>
+          <id>LOGDATE</id>
+          <enabled>Y</enabled>
+          <name>LOGDATE</name>
+        </field>
+        <field>
+          <id>TRANSNAME</id>
+          <enabled>Y</enabled>
+          <name>TRANSNAME</name>
+        </field>
+        <field>
+          <id>STEPNAME</id>
+          <enabled>Y</enabled>
+          <name>STEPNAME</name>
+        </field>
+        <field>
+          <id>STEP_COPY</id>
+          <enabled>Y</enabled>
+          <name>STEP_COPY</name>
+        </field>
+        <field>
+          <id>LINES_READ</id>
+          <enabled>Y</enabled>
+          <name>LINES_READ</name>
+        </field>
+        <field>
+          <id>LINES_WRITTEN</id>
+          <enabled>Y</enabled>
+          <name>LINES_WRITTEN</name>
+        </field>
+        <field>
+          <id>LINES_UPDATED</id>
+          <enabled>Y</enabled>
+          <name>LINES_UPDATED</name>
+        </field>
+        <field>
+          <id>LINES_INPUT</id>
+          <enabled>Y</enabled>
+          <name>LINES_INPUT</name>
+        </field>
+        <field>
+          <id>LINES_OUTPUT</id>
+          <enabled>Y</enabled>
+          <name>LINES_OUTPUT</name>
+        </field>
+        <field>
+          <id>LINES_REJECTED</id>
+          <enabled>Y</enabled>
+          <name>LINES_REJECTED</name>
+        </field>
+        <field>
+          <id>ERRORS</id>
+          <enabled>Y</enabled>
+          <name>ERRORS</name>
+        </field>
+        <field>
+          <id>INPUT_BUFFER_ROWS</id>
+          <enabled>Y</enabled>
+          <name>INPUT_BUFFER_ROWS</name>
+        </field>
+        <field>
+          <id>OUTPUT_BUFFER_ROWS</id>
+          <enabled>Y</enabled>
+          <name>OUTPUT_BUFFER_ROWS</name>
+        </field>
+      </perf-log-table>
+      <channel-log-table>
+        <connection/>
+        <schema/>
+        <table/>
+        <timeout_days/>
+        <field>
+          <id>ID_BATCH</id>
+          <enabled>Y</enabled>
+          <name>ID_BATCH</name>
+        </field>
+        <field>
+          <id>CHANNEL_ID</id>
+          <enabled>Y</enabled>
+          <name>CHANNEL_ID</name>
+        </field>
+        <field>
+          <id>LOG_DATE</id>
+          <enabled>Y</enabled>
+          <name>LOG_DATE</name>
+        </field>
+        <field>
+          <id>LOGGING_OBJECT_TYPE</id>
+          <enabled>Y</enabled>
+          <name>LOGGING_OBJECT_TYPE</name>
+        </field>
+        <field>
+          <id>OBJECT_NAME</id>
+          <enabled>Y</enabled>
+          <name>OBJECT_NAME</name>
+        </field>
+        <field>
+          <id>OBJECT_COPY</id>
+          <enabled>Y</enabled>
+          <name>OBJECT_COPY</name>
+        </field>
+        <field>
+          <id>REPOSITORY_DIRECTORY</id>
+          <enabled>Y</enabled>
+          <name>REPOSITORY_DIRECTORY</name>
+        </field>
+        <field>
+          <id>FILENAME</id>
+          <enabled>Y</enabled>
+          <name>FILENAME</name>
+        </field>
+        <field>
+          <id>OBJECT_ID</id>
+          <enabled>Y</enabled>
+          <name>OBJECT_ID</name>
+        </field>
+        <field>
+          <id>OBJECT_REVISION</id>
+          <enabled>Y</enabled>
+          <name>OBJECT_REVISION</name>
+        </field>
+        <field>
+          <id>PARENT_CHANNEL_ID</id>
+          <enabled>Y</enabled>
+          <name>PARENT_CHANNEL_ID</name>
+        </field>
+        <field>
+          <id>ROOT_CHANNEL_ID</id>
+          <enabled>Y</enabled>
+          <name>ROOT_CHANNEL_ID</name>
+        </field>
+      </channel-log-table>
+      <step-log-table>
+        <connection/>
+        <schema/>
+        <table/>
+        <timeout_days/>
+        <field>
+          <id>ID_BATCH</id>
+          <enabled>Y</enabled>
+          <name>ID_BATCH</name>
+        </field>
+        <field>
+          <id>CHANNEL_ID</id>
+          <enabled>Y</enabled>
+          <name>CHANNEL_ID</name>
+        </field>
+        <field>
+          <id>LOG_DATE</id>
+          <enabled>Y</enabled>
+          <name>LOG_DATE</name>
+        </field>
+        <field>
+          <id>TRANSNAME</id>
+          <enabled>Y</enabled>
+          <name>TRANSNAME</name>
+        </field>
+        <field>
+          <id>STEPNAME</id>
+          <enabled>Y</enabled>
+          <name>STEPNAME</name>
+        </field>
+        <field>
+          <id>STEP_COPY</id>
+          <enabled>Y</enabled>
+          <name>STEP_COPY</name>
+        </field>
+        <field>
+          <id>LINES_READ</id>
+          <enabled>Y</enabled>
+          <name>LINES_READ</name>
+        </field>
+        <field>
+          <id>LINES_WRITTEN</id>
+          <enabled>Y</enabled>
+          <name>LINES_WRITTEN</name>
+        </field>
+        <field>
+          <id>LINES_UPDATED</id>
+          <enabled>Y</enabled>
+          <name>LINES_UPDATED</name>
+        </field>
+        <field>
+          <id>LINES_INPUT</id>
+          <enabled>Y</enabled>
+          <name>LINES_INPUT</name>
+        </field>
+        <field>
+          <id>LINES_OUTPUT</id>
+          <enabled>Y</enabled>
+          <name>LINES_OUTPUT</name>
+        </field>
+        <field>
+          <id>LINES_REJECTED</id>
+          <enabled>Y</enabled>
+          <name>LINES_REJECTED</name>
+        </field>
+        <field>
+          <id>ERRORS</id>
+          <enabled>Y</enabled>
+          <name>ERRORS</name>
+        </field>
+        <field>
+          <id>LOG_FIELD</id>
+          <enabled>N</enabled>
+          <name>LOG_FIELD</name>
+        </field>
+      </step-log-table>
+      <metrics-log-table>
+        <connection/>
+        <schema/>
+        <table/>
+        <timeout_days/>
+        <field>
+          <id>ID_BATCH</id>
+          <enabled>Y</enabled>
+          <name>ID_BATCH</name>
+        </field>
+        <field>
+          <id>CHANNEL_ID</id>
+          <enabled>Y</enabled>
+          <name>CHANNEL_ID</name>
+        </field>
+        <field>
+          <id>LOG_DATE</id>
+          <enabled>Y</enabled>
+          <name>LOG_DATE</name>
+        </field>
+        <field>
+          <id>METRICS_DATE</id>
+          <enabled>Y</enabled>
+          <name>METRICS_DATE</name>
+        </field>
+        <field>
+          <id>METRICS_CODE</id>
+          <enabled>Y</enabled>
+          <name>METRICS_CODE</name>
+        </field>
+        <field>
+          <id>METRICS_DESCRIPTION</id>
+          <enabled>Y</enabled>
+          <name>METRICS_DESCRIPTION</name>
+        </field>
+        <field>
+          <id>METRICS_SUBJECT</id>
+          <enabled>Y</enabled>
+          <name>METRICS_SUBJECT</name>
+        </field>
+        <field>
+          <id>METRICS_TYPE</id>
+          <enabled>Y</enabled>
+          <name>METRICS_TYPE</name>
+        </field>
+        <field>
+          <id>METRICS_VALUE</id>
+          <enabled>Y</enabled>
+          <name>METRICS_VALUE</name>
+        </field>
+      </metrics-log-table>
+    </log>
+    <maxdate>
+      <connection/>
+      <table/>
+      <field/>
+      <offset>0.0</offset>
+      <maxdiff>0.0</maxdiff>
+    </maxdate>
+    <size_rowset>10000</size_rowset>
+    <sleep_time_empty>50</sleep_time_empty>
+    <sleep_time_full>50</sleep_time_full>
+    <unique_connections>N</unique_connections>
+    <feedback_shown>Y</feedback_shown>
+    <feedback_size>50000</feedback_size>
+    <using_thread_priorities>Y</using_thread_priorities>
+    <shared_objects_file/>
+    <capture_step_performance>N</capture_step_performance>
+    <step_performance_capturing_delay>1000</step_performance_capturing_delay>
+    <step_performance_capturing_size_limit>100</step_performance_capturing_size_limit>
+    <dependencies>
+    </dependencies>
+    <partitionschemas>
+    </partitionschemas>
+    <slaveservers>
+    </slaveservers>
+    <clusterschemas>
+    </clusterschemas>
+    <created_user>-</created_user>
+    <created_date>2019/07/17 16:55:33.177</created_date>
+    <modified_user>-</modified_user>
+    <modified_date>2019/07/17 16:55:33.177</modified_date>
+    <key_for_session_key>H4sIAAAAAAAAAAMAAAAAAAAAAAA=</key_for_session_key>
+    <is_key_private>N</is_key_private>
+  </info>
+  <notepads>
+  </notepads>
+  <connection>
+    <name>mall</name>
+    <server>192.168.50.32</server>
+    <type>MSSQLNATIVE</type>
+    <access>Native</access>
+    <database>Mall</database>
+    <port>1433</port>
+    <username>sa</username>
+    <password>Encrypted 2be98afc86aa7f297aa15a478c7d38f99</password>
+    <servername/>
+    <data_tablespace/>
+    <index_tablespace/>
+    <attributes>
+      <attribute>
+        <code>FORCE_IDENTIFIERS_TO_LOWERCASE</code>
+        <attribute>N</attribute>
+      </attribute>
+      <attribute>
+        <code>FORCE_IDENTIFIERS_TO_UPPERCASE</code>
+        <attribute>N</attribute>
+      </attribute>
+      <attribute>
+        <code>INITIAL_POOL_SIZE</code>
+        <attribute>30</attribute>
+      </attribute>
+      <attribute>
+        <code>IS_CLUSTERED</code>
+        <attribute>N</attribute>
+      </attribute>
+      <attribute>
+        <code>MAXIMUM_POOL_SIZE</code>
+        <attribute>1000</attribute>
+      </attribute>
+      <attribute>
+        <code>MSSQLUseIntegratedSecurity</code>
+        <attribute>false</attribute>
+      </attribute>
+      <attribute>
+        <code>MSSQL_DOUBLE_DECIMAL_SEPARATOR</code>
+        <attribute>N</attribute>
+      </attribute>
+      <attribute>
+        <code>PORT_NUMBER</code>
+        <attribute>1433</attribute>
+      </attribute>
+      <attribute>
+        <code>PRESERVE_RESERVED_WORD_CASE</code>
+        <attribute>Y</attribute>
+      </attribute>
+      <attribute>
+        <code>QUOTE_ALL_FIELDS</code>
+        <attribute>N</attribute>
+      </attribute>
+      <attribute>
+        <code>SUPPORTS_BOOLEAN_DATA_TYPE</code>
+        <attribute>Y</attribute>
+      </attribute>
+      <attribute>
+        <code>SUPPORTS_TIMESTAMP_DATA_TYPE</code>
+        <attribute>Y</attribute>
+      </attribute>
+      <attribute>
+        <code>USE_POOLING</code>
+        <attribute>Y</attribute>
+      </attribute>
+    </attributes>
+  </connection>
+  <order>
+    <hop>
+      <from>表输入 2</from>
+      <to>复制记录到结果 2</to>
+      <enabled>Y</enabled>
+    </hop>
+  </order>
+  <step>
+    <name>复制记录到结果 2</name>
+    <type>RowsToResult</type>
+    <description/>
+    <distribute>Y</distribute>
+    <custom_distribution/>
+    <copies>1</copies>
+    <partitioning>
+      <method>none</method>
+      <schema_name/>
+    </partitioning>
+    <attributes/>
+    <cluster_schema/>
+    <remotesteps>
+      <input>
+      </input>
+      <output>
+      </output>
+    </remotesteps>
+    <GUI>
+      <xloc>320</xloc>
+      <yloc>96</yloc>
+      <draw>Y</draw>
+    </GUI>
+  </step>
+  <step>
+    <name>表输入 2</name>
+    <type>TableInput</type>
+    <description/>
+    <distribute>Y</distribute>
+    <custom_distribution/>
+    <copies>1</copies>
+    <partitioning>
+      <method>none</method>
+      <schema_name/>
+    </partitioning>
+    <connection>mall</connection>
+    <sql>select (
+SELECT count(1)/500 +1 as count1 
+
+FROM OrderProducts b left join Orders a on a.OrdersCode=b.OrdersCode and 
+datediff(day,DATEADD(d,0,DATEDIFF(d,0,getdate())-90),a.OrderTime )>0 
+
+where 1=1 and 
+
+		   datediff(day,DATEADD(d,0,DATEDIFF(d,0,getdate())-120),a.OrderTime )>0
+) as count1</sql>
+    <limit>0</limit>
+    <lookup/>
+    <execute_each_row>N</execute_each_row>
+    <variables_active>N</variables_active>
+    <lazy_conversion_active>N</lazy_conversion_active>
+    <attributes/>
+    <cluster_schema/>
+    <remotesteps>
+      <input>
+      </input>
+      <output>
+      </output>
+    </remotesteps>
+    <GUI>
+      <xloc>112</xloc>
+      <yloc>80</yloc>
+      <draw>Y</draw>
+    </GUI>
+  </step>
+  <step_error_handling>
+  </step_error_handling>
+  <slave-step-copy-partition-distribution>
+  </slave-step-copy-partition-distribution>
+  <slave_transformation>N</slave_transformation>
+  <attributes/>
+</transformation>

+ 584 - 0
perday/mem_orders_etl_count_perday.ktr

@@ -0,0 +1,584 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<transformation>
+  <info>
+    <name>mem_orders_etl_count_perday</name>
+    <description/>
+    <extended_description/>
+    <trans_version/>
+    <trans_type>Normal</trans_type>
+    <trans_status>0</trans_status>
+    <directory>/</directory>
+    <parameters>
+    </parameters>
+    <log>
+      <trans-log-table>
+        <connection/>
+        <schema/>
+        <table/>
+        <size_limit_lines/>
+        <interval/>
+        <timeout_days/>
+        <field>
+          <id>ID_BATCH</id>
+          <enabled>Y</enabled>
+          <name>ID_BATCH</name>
+        </field>
+        <field>
+          <id>CHANNEL_ID</id>
+          <enabled>Y</enabled>
+          <name>CHANNEL_ID</name>
+        </field>
+        <field>
+          <id>TRANSNAME</id>
+          <enabled>Y</enabled>
+          <name>TRANSNAME</name>
+        </field>
+        <field>
+          <id>STATUS</id>
+          <enabled>Y</enabled>
+          <name>STATUS</name>
+        </field>
+        <field>
+          <id>LINES_READ</id>
+          <enabled>Y</enabled>
+          <name>LINES_READ</name>
+          <subject/>
+        </field>
+        <field>
+          <id>LINES_WRITTEN</id>
+          <enabled>Y</enabled>
+          <name>LINES_WRITTEN</name>
+          <subject/>
+        </field>
+        <field>
+          <id>LINES_UPDATED</id>
+          <enabled>Y</enabled>
+          <name>LINES_UPDATED</name>
+          <subject/>
+        </field>
+        <field>
+          <id>LINES_INPUT</id>
+          <enabled>Y</enabled>
+          <name>LINES_INPUT</name>
+          <subject/>
+        </field>
+        <field>
+          <id>LINES_OUTPUT</id>
+          <enabled>Y</enabled>
+          <name>LINES_OUTPUT</name>
+          <subject/>
+        </field>
+        <field>
+          <id>LINES_REJECTED</id>
+          <enabled>Y</enabled>
+          <name>LINES_REJECTED</name>
+          <subject/>
+        </field>
+        <field>
+          <id>ERRORS</id>
+          <enabled>Y</enabled>
+          <name>ERRORS</name>
+        </field>
+        <field>
+          <id>STARTDATE</id>
+          <enabled>Y</enabled>
+          <name>STARTDATE</name>
+        </field>
+        <field>
+          <id>ENDDATE</id>
+          <enabled>Y</enabled>
+          <name>ENDDATE</name>
+        </field>
+        <field>
+          <id>LOGDATE</id>
+          <enabled>Y</enabled>
+          <name>LOGDATE</name>
+        </field>
+        <field>
+          <id>DEPDATE</id>
+          <enabled>Y</enabled>
+          <name>DEPDATE</name>
+        </field>
+        <field>
+          <id>REPLAYDATE</id>
+          <enabled>Y</enabled>
+          <name>REPLAYDATE</name>
+        </field>
+        <field>
+          <id>LOG_FIELD</id>
+          <enabled>Y</enabled>
+          <name>LOG_FIELD</name>
+        </field>
+        <field>
+          <id>EXECUTING_SERVER</id>
+          <enabled>N</enabled>
+          <name>EXECUTING_SERVER</name>
+        </field>
+        <field>
+          <id>EXECUTING_USER</id>
+          <enabled>N</enabled>
+          <name>EXECUTING_USER</name>
+        </field>
+        <field>
+          <id>CLIENT</id>
+          <enabled>N</enabled>
+          <name>CLIENT</name>
+        </field>
+      </trans-log-table>
+      <perf-log-table>
+        <connection/>
+        <schema/>
+        <table/>
+        <interval/>
+        <timeout_days/>
+        <field>
+          <id>ID_BATCH</id>
+          <enabled>Y</enabled>
+          <name>ID_BATCH</name>
+        </field>
+        <field>
+          <id>SEQ_NR</id>
+          <enabled>Y</enabled>
+          <name>SEQ_NR</name>
+        </field>
+        <field>
+          <id>LOGDATE</id>
+          <enabled>Y</enabled>
+          <name>LOGDATE</name>
+        </field>
+        <field>
+          <id>TRANSNAME</id>
+          <enabled>Y</enabled>
+          <name>TRANSNAME</name>
+        </field>
+        <field>
+          <id>STEPNAME</id>
+          <enabled>Y</enabled>
+          <name>STEPNAME</name>
+        </field>
+        <field>
+          <id>STEP_COPY</id>
+          <enabled>Y</enabled>
+          <name>STEP_COPY</name>
+        </field>
+        <field>
+          <id>LINES_READ</id>
+          <enabled>Y</enabled>
+          <name>LINES_READ</name>
+        </field>
+        <field>
+          <id>LINES_WRITTEN</id>
+          <enabled>Y</enabled>
+          <name>LINES_WRITTEN</name>
+        </field>
+        <field>
+          <id>LINES_UPDATED</id>
+          <enabled>Y</enabled>
+          <name>LINES_UPDATED</name>
+        </field>
+        <field>
+          <id>LINES_INPUT</id>
+          <enabled>Y</enabled>
+          <name>LINES_INPUT</name>
+        </field>
+        <field>
+          <id>LINES_OUTPUT</id>
+          <enabled>Y</enabled>
+          <name>LINES_OUTPUT</name>
+        </field>
+        <field>
+          <id>LINES_REJECTED</id>
+          <enabled>Y</enabled>
+          <name>LINES_REJECTED</name>
+        </field>
+        <field>
+          <id>ERRORS</id>
+          <enabled>Y</enabled>
+          <name>ERRORS</name>
+        </field>
+        <field>
+          <id>INPUT_BUFFER_ROWS</id>
+          <enabled>Y</enabled>
+          <name>INPUT_BUFFER_ROWS</name>
+        </field>
+        <field>
+          <id>OUTPUT_BUFFER_ROWS</id>
+          <enabled>Y</enabled>
+          <name>OUTPUT_BUFFER_ROWS</name>
+        </field>
+      </perf-log-table>
+      <channel-log-table>
+        <connection/>
+        <schema/>
+        <table/>
+        <timeout_days/>
+        <field>
+          <id>ID_BATCH</id>
+          <enabled>Y</enabled>
+          <name>ID_BATCH</name>
+        </field>
+        <field>
+          <id>CHANNEL_ID</id>
+          <enabled>Y</enabled>
+          <name>CHANNEL_ID</name>
+        </field>
+        <field>
+          <id>LOG_DATE</id>
+          <enabled>Y</enabled>
+          <name>LOG_DATE</name>
+        </field>
+        <field>
+          <id>LOGGING_OBJECT_TYPE</id>
+          <enabled>Y</enabled>
+          <name>LOGGING_OBJECT_TYPE</name>
+        </field>
+        <field>
+          <id>OBJECT_NAME</id>
+          <enabled>Y</enabled>
+          <name>OBJECT_NAME</name>
+        </field>
+        <field>
+          <id>OBJECT_COPY</id>
+          <enabled>Y</enabled>
+          <name>OBJECT_COPY</name>
+        </field>
+        <field>
+          <id>REPOSITORY_DIRECTORY</id>
+          <enabled>Y</enabled>
+          <name>REPOSITORY_DIRECTORY</name>
+        </field>
+        <field>
+          <id>FILENAME</id>
+          <enabled>Y</enabled>
+          <name>FILENAME</name>
+        </field>
+        <field>
+          <id>OBJECT_ID</id>
+          <enabled>Y</enabled>
+          <name>OBJECT_ID</name>
+        </field>
+        <field>
+          <id>OBJECT_REVISION</id>
+          <enabled>Y</enabled>
+          <name>OBJECT_REVISION</name>
+        </field>
+        <field>
+          <id>PARENT_CHANNEL_ID</id>
+          <enabled>Y</enabled>
+          <name>PARENT_CHANNEL_ID</name>
+        </field>
+        <field>
+          <id>ROOT_CHANNEL_ID</id>
+          <enabled>Y</enabled>
+          <name>ROOT_CHANNEL_ID</name>
+        </field>
+      </channel-log-table>
+      <step-log-table>
+        <connection/>
+        <schema/>
+        <table/>
+        <timeout_days/>
+        <field>
+          <id>ID_BATCH</id>
+          <enabled>Y</enabled>
+          <name>ID_BATCH</name>
+        </field>
+        <field>
+          <id>CHANNEL_ID</id>
+          <enabled>Y</enabled>
+          <name>CHANNEL_ID</name>
+        </field>
+        <field>
+          <id>LOG_DATE</id>
+          <enabled>Y</enabled>
+          <name>LOG_DATE</name>
+        </field>
+        <field>
+          <id>TRANSNAME</id>
+          <enabled>Y</enabled>
+          <name>TRANSNAME</name>
+        </field>
+        <field>
+          <id>STEPNAME</id>
+          <enabled>Y</enabled>
+          <name>STEPNAME</name>
+        </field>
+        <field>
+          <id>STEP_COPY</id>
+          <enabled>Y</enabled>
+          <name>STEP_COPY</name>
+        </field>
+        <field>
+          <id>LINES_READ</id>
+          <enabled>Y</enabled>
+          <name>LINES_READ</name>
+        </field>
+        <field>
+          <id>LINES_WRITTEN</id>
+          <enabled>Y</enabled>
+          <name>LINES_WRITTEN</name>
+        </field>
+        <field>
+          <id>LINES_UPDATED</id>
+          <enabled>Y</enabled>
+          <name>LINES_UPDATED</name>
+        </field>
+        <field>
+          <id>LINES_INPUT</id>
+          <enabled>Y</enabled>
+          <name>LINES_INPUT</name>
+        </field>
+        <field>
+          <id>LINES_OUTPUT</id>
+          <enabled>Y</enabled>
+          <name>LINES_OUTPUT</name>
+        </field>
+        <field>
+          <id>LINES_REJECTED</id>
+          <enabled>Y</enabled>
+          <name>LINES_REJECTED</name>
+        </field>
+        <field>
+          <id>ERRORS</id>
+          <enabled>Y</enabled>
+          <name>ERRORS</name>
+        </field>
+        <field>
+          <id>LOG_FIELD</id>
+          <enabled>N</enabled>
+          <name>LOG_FIELD</name>
+        </field>
+      </step-log-table>
+      <metrics-log-table>
+        <connection/>
+        <schema/>
+        <table/>
+        <timeout_days/>
+        <field>
+          <id>ID_BATCH</id>
+          <enabled>Y</enabled>
+          <name>ID_BATCH</name>
+        </field>
+        <field>
+          <id>CHANNEL_ID</id>
+          <enabled>Y</enabled>
+          <name>CHANNEL_ID</name>
+        </field>
+        <field>
+          <id>LOG_DATE</id>
+          <enabled>Y</enabled>
+          <name>LOG_DATE</name>
+        </field>
+        <field>
+          <id>METRICS_DATE</id>
+          <enabled>Y</enabled>
+          <name>METRICS_DATE</name>
+        </field>
+        <field>
+          <id>METRICS_CODE</id>
+          <enabled>Y</enabled>
+          <name>METRICS_CODE</name>
+        </field>
+        <field>
+          <id>METRICS_DESCRIPTION</id>
+          <enabled>Y</enabled>
+          <name>METRICS_DESCRIPTION</name>
+        </field>
+        <field>
+          <id>METRICS_SUBJECT</id>
+          <enabled>Y</enabled>
+          <name>METRICS_SUBJECT</name>
+        </field>
+        <field>
+          <id>METRICS_TYPE</id>
+          <enabled>Y</enabled>
+          <name>METRICS_TYPE</name>
+        </field>
+        <field>
+          <id>METRICS_VALUE</id>
+          <enabled>Y</enabled>
+          <name>METRICS_VALUE</name>
+        </field>
+      </metrics-log-table>
+    </log>
+    <maxdate>
+      <connection/>
+      <table/>
+      <field/>
+      <offset>0.0</offset>
+      <maxdiff>0.0</maxdiff>
+    </maxdate>
+    <size_rowset>10000</size_rowset>
+    <sleep_time_empty>50</sleep_time_empty>
+    <sleep_time_full>50</sleep_time_full>
+    <unique_connections>N</unique_connections>
+    <feedback_shown>Y</feedback_shown>
+    <feedback_size>50000</feedback_size>
+    <using_thread_priorities>Y</using_thread_priorities>
+    <shared_objects_file/>
+    <capture_step_performance>N</capture_step_performance>
+    <step_performance_capturing_delay>1000</step_performance_capturing_delay>
+    <step_performance_capturing_size_limit>100</step_performance_capturing_size_limit>
+    <dependencies>
+    </dependencies>
+    <partitionschemas>
+    </partitionschemas>
+    <slaveservers>
+    </slaveservers>
+    <clusterschemas>
+    </clusterschemas>
+    <created_user>-</created_user>
+    <created_date>2019/07/17 16:55:33.177</created_date>
+    <modified_user>-</modified_user>
+    <modified_date>2019/07/17 16:55:33.177</modified_date>
+    <key_for_session_key>H4sIAAAAAAAAAAMAAAAAAAAAAAA=</key_for_session_key>
+    <is_key_private>N</is_key_private>
+  </info>
+  <notepads>
+  </notepads>
+  <connection>
+    <name>mall</name>
+    <server>192.168.50.32</server>
+    <type>MSSQLNATIVE</type>
+    <access>Native</access>
+    <database>Mall</database>
+    <port>1433</port>
+    <username>sa</username>
+    <password>Encrypted 2be98afc86aa7f297aa15a478c7d38f99</password>
+    <servername/>
+    <data_tablespace/>
+    <index_tablespace/>
+    <attributes>
+      <attribute>
+        <code>FORCE_IDENTIFIERS_TO_LOWERCASE</code>
+        <attribute>N</attribute>
+      </attribute>
+      <attribute>
+        <code>FORCE_IDENTIFIERS_TO_UPPERCASE</code>
+        <attribute>N</attribute>
+      </attribute>
+      <attribute>
+        <code>INITIAL_POOL_SIZE</code>
+        <attribute>30</attribute>
+      </attribute>
+      <attribute>
+        <code>IS_CLUSTERED</code>
+        <attribute>N</attribute>
+      </attribute>
+      <attribute>
+        <code>MAXIMUM_POOL_SIZE</code>
+        <attribute>1000</attribute>
+      </attribute>
+      <attribute>
+        <code>MSSQLUseIntegratedSecurity</code>
+        <attribute>false</attribute>
+      </attribute>
+      <attribute>
+        <code>MSSQL_DOUBLE_DECIMAL_SEPARATOR</code>
+        <attribute>N</attribute>
+      </attribute>
+      <attribute>
+        <code>PORT_NUMBER</code>
+        <attribute>1433</attribute>
+      </attribute>
+      <attribute>
+        <code>PRESERVE_RESERVED_WORD_CASE</code>
+        <attribute>Y</attribute>
+      </attribute>
+      <attribute>
+        <code>QUOTE_ALL_FIELDS</code>
+        <attribute>N</attribute>
+      </attribute>
+      <attribute>
+        <code>SUPPORTS_BOOLEAN_DATA_TYPE</code>
+        <attribute>Y</attribute>
+      </attribute>
+      <attribute>
+        <code>SUPPORTS_TIMESTAMP_DATA_TYPE</code>
+        <attribute>Y</attribute>
+      </attribute>
+      <attribute>
+        <code>USE_POOLING</code>
+        <attribute>Y</attribute>
+      </attribute>
+    </attributes>
+  </connection>
+  <order>
+    <hop>
+      <from>表输入 2</from>
+      <to>复制记录到结果 2</to>
+      <enabled>Y</enabled>
+    </hop>
+  </order>
+  <step>
+    <name>复制记录到结果 2</name>
+    <type>RowsToResult</type>
+    <description/>
+    <distribute>Y</distribute>
+    <custom_distribution/>
+    <copies>1</copies>
+    <partitioning>
+      <method>none</method>
+      <schema_name/>
+    </partitioning>
+    <attributes/>
+    <cluster_schema/>
+    <remotesteps>
+      <input>
+      </input>
+      <output>
+      </output>
+    </remotesteps>
+    <GUI>
+      <xloc>320</xloc>
+      <yloc>96</yloc>
+      <draw>Y</draw>
+    </GUI>
+  </step>
+  <step>
+    <name>表输入 2</name>
+    <type>TableInput</type>
+    <description/>
+    <distribute>Y</distribute>
+    <custom_distribution/>
+    <copies>1</copies>
+    <partitioning>
+      <method>none</method>
+      <schema_name/>
+    </partitioning>
+    <connection>mall</connection>
+    <sql>select (
+SELECT count(1)/50+1  as count1 
+
+FROM Orders a 
+where 1=1 
+
+and OrderTime > '2019-07-24 16:56:17'
+		 -- and  datediff(day,DATEADD(d,0,DATEDIFF(d,0,getdate())-90),a.OrderTime )>0
+) as count1</sql>
+    <limit>0</limit>
+    <lookup/>
+    <execute_each_row>N</execute_each_row>
+    <variables_active>N</variables_active>
+    <lazy_conversion_active>N</lazy_conversion_active>
+    <attributes/>
+    <cluster_schema/>
+    <remotesteps>
+      <input>
+      </input>
+      <output>
+      </output>
+    </remotesteps>
+    <GUI>
+      <xloc>112</xloc>
+      <yloc>80</yloc>
+      <draw>Y</draw>
+    </GUI>
+  </step>
+  <step_error_handling>
+  </step_error_handling>
+  <slave-step-copy-partition-distribution>
+  </slave-step-copy-partition-distribution>
+  <slave_transformation>N</slave_transformation>
+  <attributes/>
+</transformation>

文件差異過大導致無法顯示
+ 20 - 0
perday/新建文本文档.txt