/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package com.ifish.mapper;

import java.util.List;
import java.util.Map;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

/**
 *
 * @author Administrator
 */
public interface Tbl_User_Activity_Mapper {

    /**
     * 分页获取所有用户动态
     *
     * @param pageNum
     * @param pageSize
     * @return
     */
    @Select("select a.activity_id as activityId ,a.user_id as userId,tu.user_img as userImg,tu.nick_name as nickName,u.grade_value,a.activity_type as activityType,a.create_time from  tbl_user_activity a LEFT JOIN tbl_user_asset u ON a.user_id=u.user_id LEFT JOIN tbl_user tu ON a.user_id=tu.user_id ORDER BY activity_id DESC LIMIT ${pageNum},${pageSize}")
    List<Map> getUserActivityByPage(@Param("pageNum") Integer pageNum, @Param("pageSize") Integer pageSize);

    /**
     * 获取用户动态最大ID
     *
     * @return
     */
    @Select("select max(activity_id) from tbl_user_activity ")
    Integer getUserActivityCount();

}
