|
|
@@ -4,23 +4,27 @@
|
|
|
|
|
|
<insert id="addOne">
|
|
|
insert into yt_dyz_ad_record
|
|
|
- (record_id,
|
|
|
- user_id,
|
|
|
- nick_name,
|
|
|
- placement_id,
|
|
|
- ad_source_id,
|
|
|
- revenue,
|
|
|
- network_form_id,
|
|
|
- network_name,
|
|
|
- network_placement_id,
|
|
|
- begin_time,
|
|
|
- finish_time,
|
|
|
- result_json,
|
|
|
- ad_source_index,
|
|
|
- ad_source_type,
|
|
|
- ecpm,
|
|
|
- app_id)
|
|
|
- values (#{recordId},
|
|
|
+ (
|
|
|
+ record_id,
|
|
|
+ user_id,
|
|
|
+ nick_name,
|
|
|
+ placement_id,
|
|
|
+ ad_source_id,
|
|
|
+ revenue,
|
|
|
+ network_form_id,
|
|
|
+ network_name,
|
|
|
+ network_placement_id,
|
|
|
+ begin_time,
|
|
|
+ finish_time,
|
|
|
+ result_json,
|
|
|
+ ad_source_index,
|
|
|
+ ad_source_type,
|
|
|
+ ecpm,
|
|
|
+ app_id
|
|
|
+ )
|
|
|
+ values
|
|
|
+ (
|
|
|
+ #{recordId},
|
|
|
#{userId},
|
|
|
#{nickName},
|
|
|
#{placementId},
|
|
|
@@ -35,7 +39,8 @@
|
|
|
#{adSourceIndex},
|
|
|
#{adSourceType},
|
|
|
#{ecpm},
|
|
|
- #{appId})
|
|
|
+ #{appId}
|
|
|
+ )
|
|
|
</insert>
|
|
|
<insert id="addOneVisitor">
|
|
|
insert into yt_dyz_ad_record_visitor
|
|
|
@@ -88,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}
|
|
|
@@ -194,23 +217,6 @@
|
|
|
</if>
|
|
|
where record_id in <foreach collection="ids" item="id" open="(" close=")" separator=",">#{id}</foreach>
|
|
|
</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}
|
|
|
- </if>
|
|
|
- order by finish_time desc
|
|
|
- </select>
|
|
|
<select id="getRecordMonthCount" resultType="java.lang.Integer">
|
|
|
SELECT count(record_id) as counts
|
|
|
FROM yt_dyz_ad_record
|
|
|
@@ -222,4 +228,5 @@
|
|
|
and finish_time > #{startTime}
|
|
|
</if>
|
|
|
</select>
|
|
|
-</mapper>
|
|
|
+
|
|
|
+</mapper>
|