[CMLR-060] 修复跨表归属并新增 SignInRecordDao

This commit is contained in:
2026-02-08 20:24:24 +08:00
parent 8692b10d07
commit 3246146b7a
9 changed files with 92 additions and 45 deletions

View File

@@ -2,13 +2,8 @@ package vvpkassistant.User.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import vvpkassistant.User.model.UserModel;
import vvpkassistant.pk.model.PkRecord;
import java.util.List;
@Mapper
public interface UserDao extends BaseMapper<UserModel> {
@@ -19,20 +14,4 @@ public interface UserDao extends BaseMapper<UserModel> {
.eq(UserModel::getMobile, phoneNumber));
}
// 我邀请的pk数据
@Select("SELECT * FROM pk_record WHERE user_id_b = #{userId} ORDER BY id DESC LIMIT #{page}, #{size};")
List<PkRecord> getMyGuestPkList(@Param("userId") Integer userId , @Param("page") Integer page, @Param("size") Integer size);
// 我发起的pk数据
@Select("SELECT * FROM pk_record WHERE user_id_a = #{userId} ORDER BY id DESC LIMIT #{page}, #{size};")
List<PkRecord> findCreatedPk(@Param("userId") Integer userId , @Param("page") Integer page, @Param("size") Integer size);
// 签到
@Insert("insert into `sign_in_records` set user_id = #{userId} , time = replace(current_date, '-', '')")
int signIn(@Param("userId") int userId);
// 查询当天签到状态
@Select("SELECT COUNT(*) FROM `sign_in_records` WHERE user_id = #{userId} AND time = REPLACE(CURDATE(), '-', '')")
int checkSignStatus(@Param("userId") int userId);
}