|
|
@@ -93,8 +93,26 @@
|
|
|
</select>
|
|
|
<select id="getByUserId" resultType="com.ytpm.app.model.YtDyzAdRecord">
|
|
|
select
|
|
|
- record_id, user_id,app_id, nick_name, placement_id, ad_source_id, revenue, network_form_id, network_name, network_placement_id, finish_time, begin_time,result_json,ad_source_type,ad_source_index,ecpm
|
|
|
+ record_id, user_id,app_id, nick_name, placement_id, ad_source_id, revenue, network_form_id, network_name,
|
|
|
+ network_placement_id, finish_time, begin_time,result_json,ad_source_type,ad_source_index,ecpm
|
|
|
from yt_dyz_ad_record
|
|
|
+ where user_id = #{userId} and DATE_FORMAT(finish_time, '%Y-%m-%d') = DATE_FORMAT(now(), '%Y-%m-%d')
|
|
|
+ <if test="adsourceType != null and adsourceType!=888">
|
|
|
+ and ad_source_type = #{adsourceType}
|
|
|
+ </if>
|
|
|
+ order by finish_time desc
|
|
|
+ </select>
|
|
|
+ <select id="getByUserByParam" resultType="com.ytpm.app.model.YtDyzAdRecord">
|
|
|
+ select
|
|
|
+ record_id, user_id,app_id, nick_name, placement_id, ad_source_id, revenue, network_form_id, network_name,
|
|
|
+ network_placement_id, finish_time, begin_time,result_json,ad_source_type,ad_source_index,ecpm,
|
|
|
+ ifnull(#{loginStatus}, 2) as loginStatus
|
|
|
+ <if test="loginStatus != null and loginStatus == 1">
|
|
|
+ from yt_dyz_ad_record_visitor
|
|
|
+ </if>
|
|
|
+ <if test="loginStatus == null or loginStatus != 1">
|
|
|
+ from yt_dyz_ad_record
|
|
|
+ </if>
|
|
|
where user_id = #{userId}
|
|
|
<if test="adsourceType != null and adsourceType!=888">
|
|
|
and ad_source_type = #{adsourceType}
|
|
|
@@ -109,6 +127,14 @@
|
|
|
<foreach collection="userIds.split(',')" open="(" close=")" separator="," item="item">
|
|
|
#{item}
|
|
|
</foreach>
|
|
|
+ union
|
|
|
+ select
|
|
|
+ record_id, user_id,app_id, nick_name, placement_id, ad_source_id, revenue, network_form_id, network_name, network_placement_id, finish_time, begin_time,result_json,ad_source_type,ad_source_index,ecpm
|
|
|
+ from yt_dyz_ad_record_visitor
|
|
|
+ where ad_source_type != 1 and user_id in
|
|
|
+ <foreach collection="userIds.split(',')" open="(" close=")" separator="," item="item">
|
|
|
+ #{item}
|
|
|
+ </foreach>
|
|
|
order by finish_time
|
|
|
</select>
|
|
|
<select id="getHourRevenue" resultType="com.ytpm.middle.view.AppRevenueHourVO">
|
|
|
@@ -191,4 +217,16 @@
|
|
|
</if>
|
|
|
where record_id in <foreach collection="ids" item="id" open="(" close=")" separator=",">#{id}</foreach>
|
|
|
</select>
|
|
|
+ <select id="getRecordMonthCount" resultType="java.lang.Integer">
|
|
|
+ SELECT count(record_id) as counts
|
|
|
+ FROM yt_dyz_ad_record
|
|
|
+ where user_id= #{userId} and revenue > 0
|
|
|
+ <if test="adSourceType != null and adSourceType!=888">
|
|
|
+ and ad_source_type = #{adSourceType}
|
|
|
+ </if>
|
|
|
+ <if test="startTime != null">
|
|
|
+ and finish_time > #{startTime}
|
|
|
+ </if>
|
|
|
+ </select>
|
|
|
+
|
|
|
</mapper>
|