package com.community.huiju.dao;


import com.community.huiju.model.TpActivitySignup;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface TpActivitySignupMapper {
    int deleteByPrimaryKey(Integer id);

    int insert(TpActivitySignup record);

    int insertSelective(TpActivitySignup record);

    TpActivitySignup selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(TpActivitySignup record);

    int updateByPrimaryKey(TpActivitySignup record);

    Integer sumActivitySignUpNum(@Param("id")Integer id, @Param("communityId")Integer communityId);

    Integer findTpActivetitySignByUserId(@Param("activityId") Integer activityId, @Param("communityId")Integer communityId, @Param("userId")Integer userId);

    /**
     * 获取报名总人数
     * @param tpActivitySignup
     * @return
     */
    Integer selectSignNum(TpActivitySignup tpActivitySignup);
    
    /**
     * 删除报名
     * @param tpActivitySignup
     * @return
     */
    Integer deleteSignUp(TpActivitySignup tpActivitySignup);

    /**
     * 根据 活动ID 小区ID 用户ID 查询报名情况
     * @param activityId
     * @param communityId
     * @param userId
     * @return
     */
    TpActivitySignup selectTpActivetitySignByUserId(@Param("activityId") Integer activityId, @Param("communityId")Integer communityId, @Param("userId")Integer userId);
}