|
@@ -278,6 +278,7 @@
|
|
|
|
|
|
<!-- 查询 头条利润表 返点类型和比列-->
|
|
|
<select id="getProfitBytedance" resultType="java.util.LinkedHashMap">
|
|
|
+<!--
|
|
|
|
|
|
SELECT
|
|
|
pp.create_user_id,
|
|
@@ -306,6 +307,41 @@
|
|
|
<if test="endTime !=null and endTime != ''">
|
|
|
AND (cp.policy_end_date >= #{startTime} or cp.policy_end_date <= #{endTime})
|
|
|
</if>
|
|
|
+
|
|
|
+-->
|
|
|
+
|
|
|
+ SELECT t.* from (
|
|
|
+ SELECT
|
|
|
+ cp.rebate_type AS rebateType,
|
|
|
+ cp.rebate_rate AS rebateRate,
|
|
|
+ cp.approved_status AS approvedStatus,
|
|
|
+ min(r.policy_date )as policyStartDate,
|
|
|
+ max(r.policy_date ) as policyEndDate,
|
|
|
+ cp.create_time as createTime
|
|
|
+ FROM
|
|
|
+ ctop_cwjs_policy_info cp
|
|
|
+ RIGHT JOIN ctop_cwjs_slettement_report r on r.policy_id = cp.id and r.advertiser_name = cp.advertiser_name
|
|
|
+ WHERE
|
|
|
+ cp.del_flag = 0
|
|
|
+ and cp.approved_status = 3
|
|
|
+ <if test="mediaType !=null and mediaType != ''">
|
|
|
+ AND cp.media_type = #{mediaType}
|
|
|
+ </if>
|
|
|
+ <if test="productName !=null and productName != ''">
|
|
|
+ AND r.product_name = #{productName}
|
|
|
+ </if>
|
|
|
+ GROUP BY r.policy_id
|
|
|
+ ) t
|
|
|
+<where>
|
|
|
+ <if test="startTime !=null and startTime != ''">
|
|
|
+ AND (t.policyStartDate >= #{startTime} or t.policyStartDate <= #{endTime})
|
|
|
+ </if>
|
|
|
+ <if test="endTime !=null and endTime != ''">
|
|
|
+ AND (t.policyEndDate >= #{startTime} or t.policyEndDate <= #{endTime})
|
|
|
+ </if>
|
|
|
+</where>
|
|
|
+
|
|
|
+
|
|
|
</select>
|
|
|
|
|
|
|