|
@@ -127,6 +127,77 @@
|
|
|
order by ${parameter} ${orderBy}
|
|
|
</select>
|
|
|
|
|
|
+ <select id="selectKuaishouPromoterList3" resultType="com.ruixuan.isc.entity.JYKuaishouPromoter">
|
|
|
+ SELECT
|
|
|
+ t1.id,
|
|
|
+ t1.user_id,
|
|
|
+ t1.type,
|
|
|
+ t1.media_id,
|
|
|
+ t1.user_name,
|
|
|
+ t1.promoter_id,
|
|
|
+ t1.promoter_nick_name,
|
|
|
+ t1.`state`,
|
|
|
+ t1.province,
|
|
|
+ t1.commission_requirement,
|
|
|
+ t1.category_requirement,
|
|
|
+ t1.promoter_url,
|
|
|
+ t1.phone,
|
|
|
+ t1.consignee,
|
|
|
+ t1.promoter_address,
|
|
|
+ if(t1.media_id = 1, t1.total_sale,t3.total_sale ) as 'total_sale',
|
|
|
+ if(t1.media_id = 1, t1.fans_number,t3.fans_number ) as 'fans_number',
|
|
|
+ if(t1.media_id = 1, t1.avg_video_sales,t3.avg_video_sales ) as 'avg_video_sales',
|
|
|
+ if(t1.media_id = 1,t1.video_sales ,t3.video_sales ) as 'video_sales',
|
|
|
+ t1.create_time,
|
|
|
+ t2.30day_gmv,
|
|
|
+ t2.30day_order_num,
|
|
|
+ t1.follower_incr,
|
|
|
+ t1.live_count_30,
|
|
|
+ t1.aweme_avg_digg_count_30,
|
|
|
+ t1.aweme_digg_follower_ration,
|
|
|
+ t1.live_average_user_30,
|
|
|
+ case
|
|
|
+ WHEN t3.total_sale like '%万%'
|
|
|
+ then SUBSTRING_INDEX(t3.total_sale,'-',-1)+0
|
|
|
+ else SUBSTRING_INDEX(t3.total_sale,'-',-1)/10000 end as 'totalSaleOrder',
|
|
|
+ case
|
|
|
+ WHEN t3.video_sales like '%万%'
|
|
|
+ then SUBSTRING_INDEX(t3.video_sales,'-',-1)+0
|
|
|
+ else SUBSTRING_INDEX(t3.video_sales,'-',-1)/10000 end as 'videoSalesOrder',
|
|
|
+ case
|
|
|
+ WHEN t3.avg_video_sales like '%万%'
|
|
|
+ then SUBSTRING_INDEX(t3.avg_video_sales,'-',-1)+0
|
|
|
+ else SUBSTRING_INDEX(t3.avg_video_sales,'-',-1)/10000 end as 'avgVideoSalesOrder',
|
|
|
+ t4.rule_id,
|
|
|
+ t4.rule_name
|
|
|
+ FROM
|
|
|
+ jy_kuaishou_promoter t1
|
|
|
+ LEFT JOIN promoter_oerder_amount t2 on t1.promoter_id = t2.promoter_id
|
|
|
+ LEFT JOIN promoter_sales_info t3 ON t1.promoter_id = t3.promoter_id
|
|
|
+ left join promoter_bind_rule t4 on t1.promoter_id = t4.promoter_id
|
|
|
+ <where>
|
|
|
+ <if test="userList != null and userList.size() > 0 ">
|
|
|
+ and t1.user_id in
|
|
|
+ <foreach collection="userList" item="userId" open="(" separator="," close=")">
|
|
|
+ #{userId}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ <if test="promoterId != null ">
|
|
|
+ and t1.promoter_id = #{promoterId}
|
|
|
+ </if>
|
|
|
+ <if test="promoterNickName != null and promoterNickName != ''">
|
|
|
+ and t1.promoter_nick_name like concat('%', #{promoterNickName}, '%')
|
|
|
+ </if>
|
|
|
+ <if test="mediaId != null and mediaId != ''">
|
|
|
+ and t1.media_id = #{mediaId}
|
|
|
+ </if>
|
|
|
+ <if test="type != null and type != ''">
|
|
|
+ and t1.type = #{type}
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ order by ${parameter} ${orderBy}
|
|
|
+ </select>
|
|
|
+
|
|
|
<select id="selectAllPromoterList" resultType="com.alibaba.fastjson.JSONObject">
|
|
|
SELECT *
|
|
|
FROM (
|
|
@@ -240,14 +311,14 @@
|
|
|
select promoter_id
|
|
|
from promoter_bind_channel_date
|
|
|
WHERE stat_date >= #{startDate}
|
|
|
- AND stat_date <= #{endDate}
|
|
|
- <if test="userList != null ">
|
|
|
- AND user_id in
|
|
|
- <foreach collection="userList" item="item" separator=","
|
|
|
- open="(" close=")">
|
|
|
- #{item}
|
|
|
- </foreach>
|
|
|
- </if>
|
|
|
+ AND stat_date <= #{endDate}
|
|
|
+ <if test="userList != null ">
|
|
|
+ AND user_id in
|
|
|
+ <foreach collection="userList" item="item" separator=","
|
|
|
+ open="(" close=")">
|
|
|
+ #{item}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
</select>
|
|
|
|
|
|
<select id="getOneByIdAndPromoterId" resultMap="KuaishouPromoterResult">
|
|
@@ -259,6 +330,37 @@
|
|
|
limit 1
|
|
|
</select>
|
|
|
|
|
|
+ <select id="getOneByIdAndPromoterId3" resultMap="KuaishouPromoterResult">
|
|
|
+ select
|
|
|
+ id,
|
|
|
+ media_id,
|
|
|
+ `type`,
|
|
|
+ user_id,
|
|
|
+ user_name,
|
|
|
+ promoter_id,
|
|
|
+ promoter_nick_name,
|
|
|
+ `state`,
|
|
|
+ province,
|
|
|
+ commission_requirement,
|
|
|
+ category_requirement,
|
|
|
+ promoter_url,
|
|
|
+ phone,
|
|
|
+ consignee,
|
|
|
+ promoter_address,
|
|
|
+ total_sale,
|
|
|
+ fans_number,
|
|
|
+ avg_video_sales,
|
|
|
+ video_sales,
|
|
|
+ create_time,
|
|
|
+ update_time
|
|
|
+ from jy_kuaishou_promoter
|
|
|
+ where promoter_id = #{promoterId}
|
|
|
+ <if test="userId != null ">
|
|
|
+ AND user_id = #{userId}
|
|
|
+ </if>
|
|
|
+ limit 1
|
|
|
+ </select>
|
|
|
+
|
|
|
|
|
|
<select id="getgetMonthPromoterTotal" resultType="com.alibaba.fastjson.JSONObject">
|
|
|
SELECT t1.count,
|
|
@@ -337,6 +439,52 @@
|
|
|
</trim>
|
|
|
</insert>
|
|
|
|
|
|
+
|
|
|
+ <insert id="insertKuaishouPromoter3" parameterType="com.ruixuan.isc.entity.KuaishouPromoter" useGeneratedKeys="true"
|
|
|
+ keyProperty="id">
|
|
|
+ insert into jy_kuaishou_promoter
|
|
|
+ <trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="userId != null">user_id,</if>
|
|
|
+ <if test="mediaId != null">media_id,</if>
|
|
|
+ <if test="type != null">type,</if>
|
|
|
+ <if test="userName != null">user_name,</if>
|
|
|
+ <if test="promoterId != null">promoter_id,</if>
|
|
|
+ <if test="promoterNickName != null">promoter_nick_name,</if>
|
|
|
+ <if test="state != null">state,</if>
|
|
|
+ <if test="province != null">province,</if>
|
|
|
+ <if test="commissionRequirement != null">commission_requirement,</if>
|
|
|
+ <if test="categoryRequirement != null">category_requirement,</if>
|
|
|
+ <if test="createTime != null">create_time,</if>
|
|
|
+ <if test="updateTime != null">update_time,</if>
|
|
|
+ <if test="totalSale != null">total_sale,</if>
|
|
|
+ <if test="fansNumber != null">fans_number,</if>
|
|
|
+ <if test="promoterUrl != null">promoter_url,</if>
|
|
|
+ <if test="phone != null">phone,</if>
|
|
|
+ <if test="consignee != null">consignee,</if>
|
|
|
+ <if test="promoterAddress != null">promoter_address,</if>
|
|
|
+ </trim>
|
|
|
+ <trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="userId != null">#{userId},</if>
|
|
|
+ <if test="mediaId != null">#{mediaId},</if>
|
|
|
+ <if test="type != null">#{type},</if>
|
|
|
+ <if test="userName != null">#{userName},</if>
|
|
|
+ <if test="promoterId != null">#{promoterId},</if>
|
|
|
+ <if test="promoterNickName != null">#{promoterNickName},</if>
|
|
|
+ <if test="state != null">#{state},</if>
|
|
|
+ <if test="province != null">#{province},</if>
|
|
|
+ <if test="commissionRequirement != null">#{commissionRequirement},</if>
|
|
|
+ <if test="categoryRequirement != null">#{categoryRequirement},</if>
|
|
|
+ <if test="createTime != null">#{createTime},</if>
|
|
|
+ <if test="updateTime != null">#{updateTime},</if>
|
|
|
+ <if test="totalSale != null">#{totalSale},</if>
|
|
|
+ <if test="fansNumber != null">#{fansNumber},</if>
|
|
|
+ <if test="promoterUrl != null">#{promoterUrl},</if>
|
|
|
+ <if test="phone != null">#{phone},</if>
|
|
|
+ <if test="consignee != null">#{consignee},</if>
|
|
|
+ <if test="promoterAddress != null">#{promoterAddress},</if>
|
|
|
+ </trim>
|
|
|
+ </insert>
|
|
|
+
|
|
|
<insert id="addFollowUpRecords">
|
|
|
insert into kuaishou_promoter_follow_up_record
|
|
|
(promoter_id,
|
|
@@ -410,6 +558,38 @@
|
|
|
where promoter_id = #{promoterId}
|
|
|
</update>
|
|
|
|
|
|
+ <update id="updateKuaishouPromoterByPromoterId3" parameterType="com.ruixuan.isc.entity.KuaishouPromoter">
|
|
|
+ update jy_kuaishou_promoter
|
|
|
+ <trim prefix="SET" suffixOverrides=",">
|
|
|
+ <if test="userId != null">user_id = #{userId},</if>
|
|
|
+ <if test="type != null">`type` = #{type},</if>
|
|
|
+ <if test="mediaId != null">media_id = #{mediaId},</if>
|
|
|
+ <if test="userName != null">user_name = #{userName},</if>
|
|
|
+ <if test="promoterId != null">promoter_id = #{promoterId},</if>
|
|
|
+ <if test="promoterNickName != null">promoter_nick_name = #{promoterNickName},</if>
|
|
|
+ <if test="totalSale != null">total_sale = #{totalSale},</if>
|
|
|
+ <if test="fansNumber != null">fans_number = #{fansNumber},</if>
|
|
|
+ <if test="promoterUrl != null">promoter_url = #{promoterUrl},</if>
|
|
|
+ <if test="phone != null">phone = #{phone},</if>
|
|
|
+ <if test="consignee != null">consignee = #{consignee},</if>
|
|
|
+ <if test="promoterAddress != null">promoter_address = #{promoterAddress},</if>
|
|
|
+ <if test="state != null">`state` = #{state},</if>
|
|
|
+ <if test="province != null">province = #{province},</if>
|
|
|
+ <if test="commissionRequirement != null">commission_requirement = #{commissionRequirement},</if>
|
|
|
+ <if test="categoryRequirement != null">category_requirement = #{categoryRequirement},</if>
|
|
|
+ <if test="avgVideoSales != null">avg_video_sales = #{avgVideoSales},</if>
|
|
|
+ <if test="videoSales != null">video_sales = #{videoSales},</if>
|
|
|
+ <if test="createTime != null">create_time = #{createTime},</if>
|
|
|
+ <if test="updateTime != null">update_time = #{updateTime},</if>
|
|
|
+ <if test="followerIncr != null">follower_incr = #{followerIncr},</if>
|
|
|
+ <if test="liveCount30 != null">live_count_30 = #{liveCount30},</if>
|
|
|
+ <if test="awemeAvgDiggCount30 != null">aweme_avg_digg_count_30 = #{awemeAvgDiggCount30},</if>
|
|
|
+ <if test="awemeDiggFollowerRation != null">aweme_digg_follower_ration = #{awemeDiggFollowerRation},</if>
|
|
|
+ <if test="liveAverageUser30 != null">live_average_user_30 = #{liveAverageUser30},</if>
|
|
|
+ </trim>
|
|
|
+ where promoter_id = #{promoterId}
|
|
|
+ </update>
|
|
|
+
|
|
|
<delete id="deleteKuaishouPromoterById" parameterType="Long">
|
|
|
delete
|
|
|
from kuaishou_promoter
|
|
@@ -528,7 +708,6 @@
|
|
|
</select>
|
|
|
<select id="getRuleName" resultType="java.lang.String" parameterType="java.lang.Long">
|
|
|
select rule_name from kuaishou_settlement_rules where id = #{ruleId}
|
|
|
-
|
|
|
</select>
|
|
|
|
|
|
|