From 3f481005be717250a2ea87ff9367aa84d6a3eb13 Mon Sep 17 00:00:00 2001
From: 无关风月 <443237572@qq.com>
Date: 星期六, 14 九月 2024 10:55:52 +0800
Subject: [PATCH] 课程代码

---
 xinquan-modules/xinquan-user/src/main/resources/mapper/user/AppUserViewingHistoryMapper.xml |   29 ++++++++++++++++++++++++++++-
 1 files changed, 28 insertions(+), 1 deletions(-)

diff --git a/xinquan-modules/xinquan-user/src/main/resources/mapper/user/AppUserViewingHistoryMapper.xml b/xinquan-modules/xinquan-user/src/main/resources/mapper/user/AppUserViewingHistoryMapper.xml
index 60b7b98..132975c 100644
--- a/xinquan-modules/xinquan-user/src/main/resources/mapper/user/AppUserViewingHistoryMapper.xml
+++ b/xinquan-modules/xinquan-user/src/main/resources/mapper/user/AppUserViewingHistoryMapper.xml
@@ -3,7 +3,7 @@
 <mapper namespace="com.xinquan.user.mapper.AppUserViewingHistoryMapper">
 
     <!-- 通用查询映射结果 -->
-    <resultMap id="BaseResultMap" type="com.xinquan.user.domain.AppUserViewingHistory">
+    <resultMap id="BaseResultMap" type="com.xinquan.system.api.domain.AppUserViewingHistory">
         <id column="id" property="id" />
         <result column="del_flag" property="delFlag" />
         <result column="create_by" property="createBy" />
@@ -24,5 +24,32 @@
         update_time,
         id, app_user_id, biz_id, viewing_type
     </sql>
+    <select id="cumulative" resultType="com.xinquan.system.api.domain.AppUserViewingHistory">
+        SELECT
+            app_user_id,
+            DATE(create_time) AS view_date
+        FROM
+            t_app_user_viewing_history
+        WHERE
+            app_user_id = #{userId}
+            viewing_type = 1
+          AND del_flag = 0
+        GROUP BY
+            app_user_id,
+            DATE(create_time)
+    </select>
+    <select id="today" resultType="java.lang.Integer">
+        SELECT
+             SUM(timeLook)
+        FROM
+            t_app_user_viewing_history
+        WHERE
+            app_user_id = #{userId}
+          AND viewing_type = 1
+
+          AND DATE(create_time) = CURDATE()
+        GROUP BY
+            app_user_id;
+    </select>
 
 </mapper>

--
Gitblit v1.7.1