| 
					
				 | 
			
			
				@@ -834,12 +834,12 @@ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         sum(CASE 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         WHEN t2.flow_point != 'REFUND' and t2.colonel_type != 2 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         THEN t2.second_estimated_commission 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        ELSE 0 END) / 100 AS 'secondEstimatedCommission', 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        ELSE 0 END) / 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        100 AS 'secondEstimatedCommission', 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         round(sum(t2.colonel_real_commission) / 100, 2) as 'totalRegimentalSettleAmount' 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        from promoter_bind_channel_date t1 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        left join bytedance_promoter_order_list t2 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        on t1.promoter_id = t2.author_short_id and t1.stat_date = t2.pay_success_time 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        where 1 = 1 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        from (select user_id, user_name, promoter_id, stat_date 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        from promoter_bind_channel_date 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        where media_id = 1 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         <if test="start != null and start != ''"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             and t1.stat_date >= #{start} 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         </if> 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -849,6 +849,18 @@ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         <if test="collectSampleId != null and collectSampleId != ''"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             and t1.user_id = #{collectSampleId} 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         </if> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        ) t1 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        left join (select * 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        from bytedance_order_list 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        where 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        <if test="start != null and start != ''"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            and pay_success_time >= #{start} 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        </if> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        <if test="end != null and end != ''"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            and pay_success_time <= #{end} 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        </if> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        ) t2 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        on t1.promoter_id = t2.author_short_id and t1.stat_date = t2.pay_success_time 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         group by t1.user_id) t 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         left join (select user_id, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         count(distinct promoter_id) as 'promoterCount' 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -973,5 +985,27 @@ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         where t.orderNum > 0 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         order by t.orderNum desc 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     </select> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    <select id="getproDate" resultType="com.alibaba.fastjson.JSONObject"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        select promoter_id as 'promoter_id', min(stat_date) as 'start', max(stat_date) as 'end' 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        from promoter_bind_channel_date 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        where user_name = '胡勤朴' 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          and stat_date >= 20240101 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          and stat_date <= 20240131 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        group by promoter_id 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    </select> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    <select id="getCount" resultType="java.math.BigDecimal"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        select sum(CASE 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                       WHEN flow_point != 'REFUND' and colonel_type != 2 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                   THEN colonel_estimated_commission 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+               WHEN flow_point != 'REFUND' and colonel_type = 2 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                   then second_estimated_commission 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+               ELSE 0 END) * 0.9 / 100 AS 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                                                                                                       'regimentalPromotionAmount' 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        from bytedance_order_list 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        where author_short_id = #{promoterId} 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          and pay_success_time >= #{start} 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          and pay_success_time <= #{end} 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    </select> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 </mapper> 
			 |