feat(mapper): 添加获取用户项目 ID 列表的方法

- 在 StatisticsMapper 接口中新增 getProjectIdListForUser 方法
- 在 StatisticsMapper.xml 中添加对应的 SQL 查询语句
- 该方法用于获取用户在指定时间之前的项目 ID 列表
This commit is contained in:
2025-09-17 15:11:03 +08:00
parent a5e882e693
commit 2a8bdaec28
2 changed files with 6 additions and 0 deletions

View File

@@ -93,6 +93,7 @@ public interface StatisticsMapper {
int addStatisticsRecord(StatisticsRecordAddReq req); int addStatisticsRecord(StatisticsRecordAddReq req);
List<Long> getBrokerIdListForUser(Long memberId, Date startTime, Date endTime); List<Long> getBrokerIdListForUser(Long memberId, Date startTime, Date endTime);
List<Long> getProjectIdListForUser(Long memberId, Date startTime, Date endTime);
Long getUserRecentEnterType(Long memberId, Date endTime); Long getUserRecentEnterType(Long memberId, Date endTime);

View File

@@ -525,5 +525,10 @@
</if> </if>
) stats_data ) stats_data
</select> </select>
<select id="getProjectIdListForUser" resultType="java.lang.Long">
select identifier from t_stats_record r left join t_stats s on r.trace_id = s.trace_id where s.member_id = #{memberId}
and r.action = 'ENTER_PROJECT' and r.create_time &lt; #{endTime} and r.create_time &gt; #{startTime}
order by r.create_time desc limit 1
</select>
</mapper> </mapper>