|
@@ -178,6 +178,48 @@
|
|
|
group by t.stat_date
|
|
|
order by t.stat_date asc
|
|
|
</select>
|
|
|
+ <select id="getClipCooperation" resultType="com.alibaba.fastjson.JSONObject">
|
|
|
+ select t1.*,
|
|
|
+ ifnull(t2.videoCount30d,0) as 'frontVideoCount30d',
|
|
|
+ ifnull(t1.videoCount30d - t2.videoCount30d,0) as 'groundingCount'
|
|
|
+ from (select clip_id as 'clipId',
|
|
|
+ clip_name as 'clipName',
|
|
|
+ head_img as 'headImg',
|
|
|
+ fans_num as 'fansNum',
|
|
|
+ gmv_30d as 'gmv30d',
|
|
|
+ start_time as 'startTime',
|
|
|
+ end_time as 'endTime',
|
|
|
+ (case when status = 1
|
|
|
+ then '上架'
|
|
|
+ when status = 3
|
|
|
+ then '已结束'
|
|
|
+ when status = 2
|
|
|
+ then '待确认'
|
|
|
+ else '-'
|
|
|
+ end
|
|
|
+ ) as 'status',
|
|
|
+ termination_reason as 'terminationReason',
|
|
|
+ concat(commission_rate_view,'%') as 'commissionRateView',
|
|
|
+ shop_score as 'shopScore',
|
|
|
+ clip_gmv_30d as 'clipGmv30d',
|
|
|
+ auth_item_gmv_30d as 'authItemGmv30d',
|
|
|
+ video_count_30d as 'videoCount30d',
|
|
|
+ stat_date as 'statDate'
|
|
|
+ from jy_clip_cooperation
|
|
|
+ where stat_date = #{date}) t1
|
|
|
+ left join (select clip_id as 'clipId',
|
|
|
+ video_count_30d as 'videoCount30d'
|
|
|
+ from jy_clip_cooperation
|
|
|
+ where stat_date = date_format(date_sub(#{date}, interval 1 day), '%Y%m%d')) t2
|
|
|
+ on t1.clipId = t2.clipId
|
|
|
+ where 1 = 1
|
|
|
+ <if test="promoterId != null and promoterId != ''">
|
|
|
+ and t1.clipId = #{promoterId}
|
|
|
+ </if>
|
|
|
+ <if test="promoterName != null and promoterName != ''">
|
|
|
+ and t1.clipName like concat(concat('%',#{promoterName}),'%')
|
|
|
+ </if>
|
|
|
+ </select>
|
|
|
|
|
|
|
|
|
</mapper>
|