33333333333
This commit is contained in:
@@ -25,6 +25,14 @@ public class UserCount implements Serializable {
|
||||
*/
|
||||
@TableId(value = "user_id",type = IdType.INPUT)
|
||||
private Long userId;
|
||||
/**
|
||||
* 新增粉丝数
|
||||
*/
|
||||
private Long newFansCount;
|
||||
/**
|
||||
* 新增访客数
|
||||
*/
|
||||
private Long newVisitorCount;
|
||||
/**
|
||||
* 粉丝总数
|
||||
*/
|
||||
|
||||
@@ -16,7 +16,15 @@ public interface UserCountMapper extends BaseMapper<UserCount> {
|
||||
|
||||
void starIncs(@Param("userId") Long userId, @Param("fansIncs") int fansIncs, @Param("followIncs") int followIncs);
|
||||
|
||||
void newStarIncs(@Param("userId") Long userId);
|
||||
|
||||
void resetNewStarIncs(@Param("userId") Long userId);
|
||||
|
||||
void visitorIncs(@Param("userId") Long userId, @Param("footIncs") int footIncs, @Param("visitorIncs") int visitorIncs);
|
||||
|
||||
void newVisitorIncs(Long userId);
|
||||
|
||||
void resetNewVisitorIncs(Long userId);
|
||||
|
||||
Page<UserCountAdminVo> pageAdmin(@Param("build") Page<Object> build, @Param("bo") UserCountAdminVo bo);
|
||||
}
|
||||
|
||||
@@ -43,6 +43,7 @@ public class UserCountServiceImpl extends ServiceImpl<UserCountMapper, UserCount
|
||||
public void star(Long fromUserId, Long toUserId) {
|
||||
baseMapper.starIncs(fromUserId,0,1);
|
||||
baseMapper.starIncs(toUserId,1,0);
|
||||
baseMapper.newStarIncs(toUserId);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -55,6 +56,7 @@ public class UserCountServiceImpl extends ServiceImpl<UserCountMapper, UserCount
|
||||
public void visitor(Long fromUserId, Long toUserId) {
|
||||
baseMapper.visitorIncs(fromUserId,1,0);
|
||||
baseMapper.visitorIncs(toUserId,0,1);
|
||||
baseMapper.newVisitorIncs(toUserId);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -15,6 +15,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<result property="giveGiftCount" column="give_gift_count"/>
|
||||
<result property="createTime" column="create_time"/>
|
||||
</resultMap>
|
||||
<update id="newStarIncs">
|
||||
update cai_user_count
|
||||
set new_fans_count = new_fans_count + 1
|
||||
where user_id = #{userId}
|
||||
</update>
|
||||
<update id="newVisitorIncs">
|
||||
update cai_user_count
|
||||
set new_visitor_count = new_visitor_count + 1
|
||||
where user_id = #{userId}
|
||||
</update>
|
||||
<update id="visitorIncs">
|
||||
update cai_user_count
|
||||
set
|
||||
@@ -22,6 +32,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
visitor_count = visitor_count + #{visitorIncs}
|
||||
where user_id = #{userId}
|
||||
</update>
|
||||
<update id="resetNewStarIncs">
|
||||
update cai_user_count
|
||||
set new_fans_count = 0
|
||||
where user_id = #{userId} and new_fans_count > 0
|
||||
</update>
|
||||
<update id="resetNewVisitorIncs">
|
||||
update cai_user_count
|
||||
set new_visitor_count = 0
|
||||
where user_id = #{userId} and new_visitor_count > 0
|
||||
</update>
|
||||
<select id="starIncs">
|
||||
update cai_user_count
|
||||
set
|
||||
|
||||
Reference in New Issue
Block a user