Sfoglia il codice sorgente

feat:同步master调整

hidewnd 1 mese fa
parent
commit
55453ce46f

+ 9 - 8
ReadMe.md

@@ -29,14 +29,15 @@
 ```text
 
 -- yt-platform 
-----yt-common  公共包
-----yt-gateway 网关
-----yt-oauth   授权中心
-----yt-agent   易推平台代理商系统
-----yt-middle  易推中台
-----yt-risk    风控中心
-
-# 剩余为子包服务
+----yt-common       公共包
+----yt-gateway      网关
+----yt-oauth        授权中心
+----yt-agent        易推平台代理商系统
+----yt-advertise    广告API
+----yt-middle       易推中台
+----yt-risk         风控中心
+----yt-question     答题服务
+
 
 
 ```

+ 44 - 37
yt-question/yt-question-service/src/main/resources/mapper/AdRecordMapper.xml

@@ -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>