|
@@ -2,7 +2,75 @@
|
|
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
|
<mapper namespace="cn.com.ctop.kuaishou.modules.batch.mapper.MgsSupplyChainMapper">
|
|
|
|
|
|
- <insert id="replace">
|
|
|
+ <insert id="replaceRuixuanSupplyChains">
|
|
|
+ replace into ruixuan.kuaishou_supply_chain(
|
|
|
+ id,
|
|
|
+ oid,
|
|
|
+ item_id,
|
|
|
+ item_title,
|
|
|
+ reserve_price,
|
|
|
+ image_url,
|
|
|
+ order_status,
|
|
|
+ order_create_time,
|
|
|
+ send_status,
|
|
|
+ settlement_biz_type,
|
|
|
+ settlement_biz_type_desc,
|
|
|
+ send_time,
|
|
|
+ recv_time,
|
|
|
+ seller_id,
|
|
|
+ promoter_id,
|
|
|
+ promoter_nick_name,
|
|
|
+ activity_id,
|
|
|
+ order_amount,
|
|
|
+ pay_amount,
|
|
|
+ regimental_promotion_rate,
|
|
|
+ share_rate,
|
|
|
+ base_amount,
|
|
|
+ service_amount,
|
|
|
+ regimental_promotion_amount,
|
|
|
+ total_regimental_settle_amount,
|
|
|
+ stat_date,
|
|
|
+ stat_hour,
|
|
|
+ item_commission_rate
|
|
|
+ )
|
|
|
+ values
|
|
|
+ <foreach collection="adds" item="add" separator=",">
|
|
|
+ (
|
|
|
+ #{add.id},
|
|
|
+ #{add.oid},
|
|
|
+ #{add.itemId},
|
|
|
+ #{add.itemTitle},
|
|
|
+ #{add.reservePrice},
|
|
|
+ #{add.imageUrl},
|
|
|
+ #{add.orderStatus},
|
|
|
+ #{add.orderCreateTime},
|
|
|
+ #{add.sendStatus},
|
|
|
+ #{add.settlementBizType},
|
|
|
+ #{add.settlementBizTypeDesc},
|
|
|
+ #{add.sendTime},
|
|
|
+ #{add.recvTime},
|
|
|
+ #{add.sellerId},
|
|
|
+ #{add.promoterId},
|
|
|
+ #{add.promoterNickName},
|
|
|
+ #{add.activityId},
|
|
|
+ #{add.orderAmount},
|
|
|
+ #{add.payAmount},
|
|
|
+ #{add.regimentalPromotionRate},
|
|
|
+ #{add.shareRate},
|
|
|
+ #{add.baseAmount},
|
|
|
+ #{add.serviceAmount},
|
|
|
+ #{add.regimentalPromotionAmount},
|
|
|
+ #{add.totalRegimentalSettleAmount},
|
|
|
+ #{add.statDate},
|
|
|
+ #{add.statHour},
|
|
|
+ #{add.itemCommissionRate}
|
|
|
+ )
|
|
|
+
|
|
|
+ </foreach>
|
|
|
+
|
|
|
+
|
|
|
+ </insert>
|
|
|
+ <insert id="replaceMgsSupplyChains">
|
|
|
replace into miaogousi.kuaishou_supply_chain(
|
|
|
id,
|
|
|
oid,
|
|
@@ -68,120 +136,153 @@
|
|
|
|
|
|
</foreach>
|
|
|
</insert>
|
|
|
- <insert id="replaceSettlement">
|
|
|
- replace into miaogousi.kuaishou_supply_chain_settlement(
|
|
|
+ <insert id="replaceRocketSupplyChains">
|
|
|
+ replace into rocket.kuaishou_supply_chain(
|
|
|
+ id,
|
|
|
oid,
|
|
|
- settlement_amount,
|
|
|
- settlement_time
|
|
|
+ item_id,
|
|
|
+ item_title,
|
|
|
+ reserve_price,
|
|
|
+ image_url,
|
|
|
+ order_status,
|
|
|
+ order_create_time,
|
|
|
+ send_status,
|
|
|
+ settlement_biz_type,
|
|
|
+ settlement_biz_type_desc,
|
|
|
+ send_time,
|
|
|
+ recv_time,
|
|
|
+ seller_id,
|
|
|
+ promoter_id,
|
|
|
+ promoter_nick_name,
|
|
|
+ activity_id,
|
|
|
+ order_amount,
|
|
|
+ pay_amount,
|
|
|
+ regimental_promotion_rate,
|
|
|
+ share_rate,
|
|
|
+ base_amount,
|
|
|
+ service_amount,
|
|
|
+ regimental_promotion_amount,
|
|
|
+ total_regimental_settle_amount,
|
|
|
+ stat_date,
|
|
|
+ stat_hour,
|
|
|
+ item_commission_rate
|
|
|
+ )
|
|
|
+ values
|
|
|
+ <foreach collection="adds" item="add" separator=",">
|
|
|
+ (
|
|
|
+ #{add.id},
|
|
|
+ #{add.oid},
|
|
|
+ #{add.itemId},
|
|
|
+ #{add.itemTitle},
|
|
|
+ #{add.reservePrice},
|
|
|
+ #{add.imageUrl},
|
|
|
+ #{add.orderStatus},
|
|
|
+ #{add.orderCreateTime},
|
|
|
+ #{add.sendStatus},
|
|
|
+ #{add.settlementBizType},
|
|
|
+ #{add.settlementBizTypeDesc},
|
|
|
+ #{add.sendTime},
|
|
|
+ #{add.recvTime},
|
|
|
+ #{add.sellerId},
|
|
|
+ #{add.promoterId},
|
|
|
+ #{add.promoterNickName},
|
|
|
+ #{add.activityId},
|
|
|
+ #{add.orderAmount},
|
|
|
+ #{add.payAmount},
|
|
|
+ #{add.regimentalPromotionRate},
|
|
|
+ #{add.shareRate},
|
|
|
+ #{add.baseAmount},
|
|
|
+ #{add.serviceAmount},
|
|
|
+ #{add.regimentalPromotionAmount},
|
|
|
+ #{add.totalRegimentalSettleAmount},
|
|
|
+ #{add.statDate},
|
|
|
+ #{add.statHour},
|
|
|
+ #{add.itemCommissionRate}
|
|
|
+ )
|
|
|
|
|
|
+ </foreach>
|
|
|
+
|
|
|
+ </insert>
|
|
|
+ <insert id="replaceYufuSupplyChains">
|
|
|
+ replace into yufu.kuaishou_supply_chain(
|
|
|
+ id,
|
|
|
+ oid,
|
|
|
+ item_id,
|
|
|
+ item_title,
|
|
|
+ reserve_price,
|
|
|
+ image_url,
|
|
|
+ order_status,
|
|
|
+ order_create_time,
|
|
|
+ send_status,
|
|
|
+ settlement_biz_type,
|
|
|
+ settlement_biz_type_desc,
|
|
|
+ send_time,
|
|
|
+ recv_time,
|
|
|
+ seller_id,
|
|
|
+ promoter_id,
|
|
|
+ promoter_nick_name,
|
|
|
+ activity_id,
|
|
|
+ order_amount,
|
|
|
+ pay_amount,
|
|
|
+ regimental_promotion_rate,
|
|
|
+ share_rate,
|
|
|
+ base_amount,
|
|
|
+ service_amount,
|
|
|
+ regimental_promotion_amount,
|
|
|
+ total_regimental_settle_amount,
|
|
|
+ stat_date,
|
|
|
+ stat_hour,
|
|
|
+ item_commission_rate
|
|
|
)
|
|
|
values
|
|
|
<foreach collection="adds" item="add" separator=",">
|
|
|
(
|
|
|
+ #{add.id},
|
|
|
#{add.oid},
|
|
|
- #{add.settlementAmount},
|
|
|
- #{add.settlementTime}
|
|
|
+ #{add.itemId},
|
|
|
+ #{add.itemTitle},
|
|
|
+ #{add.reservePrice},
|
|
|
+ #{add.imageUrl},
|
|
|
+ #{add.orderStatus},
|
|
|
+ #{add.orderCreateTime},
|
|
|
+ #{add.sendStatus},
|
|
|
+ #{add.settlementBizType},
|
|
|
+ #{add.settlementBizTypeDesc},
|
|
|
+ #{add.sendTime},
|
|
|
+ #{add.recvTime},
|
|
|
+ #{add.sellerId},
|
|
|
+ #{add.promoterId},
|
|
|
+ #{add.promoterNickName},
|
|
|
+ #{add.activityId},
|
|
|
+ #{add.orderAmount},
|
|
|
+ #{add.payAmount},
|
|
|
+ #{add.regimentalPromotionRate},
|
|
|
+ #{add.shareRate},
|
|
|
+ #{add.baseAmount},
|
|
|
+ #{add.serviceAmount},
|
|
|
+ #{add.regimentalPromotionAmount},
|
|
|
+ #{add.totalRegimentalSettleAmount},
|
|
|
+ #{add.statDate},
|
|
|
+ #{add.statHour},
|
|
|
+ #{add.itemCommissionRate}
|
|
|
)
|
|
|
</foreach>
|
|
|
</insert>
|
|
|
- <insert id="cleanKuaiShouPromoterBindChannel" parameterType="java.lang.Long">
|
|
|
- insert into miaogousi.promoter_bind_channel_date (promoter_id, promoter_name,promoter_url, user_id, user_name, stat_date,media_id)
|
|
|
- select t1.promoter_id, t1.promoter_nick_name, t1.promoter_url,t1.user_id, t1.user_name, #{date},media_id
|
|
|
- from miaogousi.kuaishou_promoter t1
|
|
|
- left join miaogousi.sys_user_role t2
|
|
|
- on t1.user_id = t2.user_id
|
|
|
- left join miaogousi.sys_role t3
|
|
|
- on t2.role_id = t3.role_id
|
|
|
- where 1 = 1
|
|
|
- and t1.media_id = '2'
|
|
|
- and t3.role_key in ('bdManager', 'bd')
|
|
|
- and date_format(t1.create_time, '%Y%m%d') < #{date}
|
|
|
- group by t1.promoter_id
|
|
|
|
|
|
- </insert>
|
|
|
- <delete id="deletePromoterBindChannelByDate" parameterType="java.lang.Long">
|
|
|
- delete from miaogousi.promoter_bind_channel_date where stat_date = #{date}
|
|
|
- </delete>
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
<select id="getCookie" resultType="com.alibaba.fastjson.JSONObject">
|
|
|
|
|
|
select id ,cookie from miaogousi.kuaishou_supply_chain_cookie
|
|
|
|
|
|
</select>
|
|
|
- <select id="getDataList" resultType="com.alibaba.fastjson.JSONObject" parameterType="java.lang.Long">
|
|
|
- select t.*, tt.rule_type
|
|
|
- from (select *
|
|
|
- from (select t1.relate_id as 'relateId',
|
|
|
- (case
|
|
|
- when t2.rule_id is not null
|
|
|
- then t2.rule_id
|
|
|
- else 1
|
|
|
- end
|
|
|
- ) as 'ruleId',
|
|
|
- group_concat(t1.item_id) as 'itemIds',
|
|
|
- t1.promoter_id as 'promoterId',
|
|
|
- t1.promoter_name as 'promoterName',
|
|
|
- t1.item_create_id as 'itemCreateId',
|
|
|
- t1.item_create_name as 'itemCreateName',
|
|
|
- t1.promoter_create_id as 'promoterCreateId',
|
|
|
- t1.promoter_create_name as 'promoterCreateName',
|
|
|
- ifnull(sum(t1.order_num), 0) as 'orderNum',
|
|
|
- ifnull(sum(t1.valid_order_num), 0) as 'validOrderNum',
|
|
|
- ifnull(sum(t1.yesterday_order_num), 0) as 'yesterdayOrderNum',
|
|
|
- ifnull(sum(t1.yesterday_valid_order_num), 0) as 'yesterdayValidOrderNum',
|
|
|
- t1.stat_date as 'statDate',
|
|
|
- round(t2.item_price / 100, 2) as 'itemPrice'
|
|
|
- from miaogousi.kuaishou_rule_order_data t1
|
|
|
- left join miaogousi.kuaishou_item_list t2 on t1.item_id = t2.item_id
|
|
|
- where t1.stat_date = #{statDate}
|
|
|
- and t1.relate_id is not null
|
|
|
- group by t1.relate_id, t1.promoter_id) t
|
|
|
- where t.itemPrice >= 6
|
|
|
- order by t.validOrderNum desc) t
|
|
|
- left join miaogousi.kuaishou_settlement_rules tt
|
|
|
- on t.ruleId = tt.id
|
|
|
- </select>
|
|
|
- <select id="getPromoterDataList" resultType="com.alibaba.fastjson.JSONObject" parameterType="java.lang.Long">
|
|
|
-select t1.rule_id as 'ruleId',
|
|
|
- t1.promoter_id as 'promoterId',
|
|
|
- t2.promoter_name as 'promoterName',
|
|
|
- ifnull(sum(t2.order_num), 0) as 'orderNum',
|
|
|
- ifnull(sum(t2.valid_order_num), 0) as 'validOrderNum',
|
|
|
- ifnull(sum(t2.yesterday_order_num), 0) as 'yesterdayOrderNum',
|
|
|
- ifnull(sum(t2.yesterday_valid_order_num), 0) as 'yesterdayValidOrderNum',
|
|
|
- t2.stat_date as 'statDate',
|
|
|
- 3 as 'rule_type',
|
|
|
- t3.item_price as 'itemPrice'
|
|
|
-
|
|
|
-from miaogousi.promoter_bind_rule t1
|
|
|
- left join miaogousi.kuaishou_rule_order_data t2 on t1.promoter_id = t2.promoter_id
|
|
|
- left join miaogousi.kuaishou_item_list t3 on t2.item_id = t3.item_id
|
|
|
-where 1 = 1
|
|
|
- and t2.stat_date = #{statDate}
|
|
|
- and t3.item_price >= 600
|
|
|
-group by t1.promoter_id;
|
|
|
|
|
|
|
|
|
- </select>
|
|
|
- <select id="getSamplesData" resultType="com.alibaba.fastjson.JSONObject" parameterType="java.lang.String">
|
|
|
- select id,courier_number as 'courierNumber',company_code as 'companyCode' from miaogousi.kuaishou_item_collect_samples
|
|
|
- where courier_number_time >= str_to_date(CONCAT(date_format(#{startDate}, '%Y-%m-%d'), '00:00:01'), '%Y-%m-%d %H:%i:%s')
|
|
|
- and collect_sample_status = 4
|
|
|
- and collect_sample_desc = '单号异常'
|
|
|
- </select>
|
|
|
- <select id="cleanBytedancePromoterBindChannel" parameterType="java.lang.Long">
|
|
|
- insert into miaogousi.promoter_bind_channel_date (promoter_id, promoter_name,promoter_url, user_id, user_name, stat_date,media_id)
|
|
|
- select t1.promoter_id, t1.promoter_nick_name, t1.promoter_url,t1.user_id, t1.user_name, #{date},media_id
|
|
|
- from miaogousi.kuaishou_promoter t1
|
|
|
- left join miaogousi.sys_user_role t2
|
|
|
- on t1.user_id = t2.user_id
|
|
|
- left join miaogousi.sys_role t3
|
|
|
- on t2.role_id = t3.role_id
|
|
|
- where 1 = 1
|
|
|
- and t1.media_id = '1'
|
|
|
- and t3.role_key in ('bdManager', 'bd')
|
|
|
- and date_format(t1.create_time, '%Y%m%d') <= #{date}
|
|
|
- group by t1.promoter_id
|
|
|
|
|
|
- </select>
|
|
|
+
|
|
|
|
|
|
</mapper>
|