| | |
| | | <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" /> |
| | |
| | | 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> |