[CMLR-040] 迁移 User 域注解 SQL 到 Lambda
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
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;
|
||||
@@ -13,8 +14,10 @@ import java.util.List;
|
||||
public interface UserDao extends BaseMapper<UserModel> {
|
||||
|
||||
// 根据用户的手机号查询用户
|
||||
@Select("SELECT * FROM system_user WHERE mobile = #{phoneNumber}")
|
||||
UserModel queryWithPhoneNumber(@Param("phoneNumber") String phoneNumber);
|
||||
default UserModel queryWithPhoneNumber(String phoneNumber) {
|
||||
return selectOne(Wrappers.<UserModel>lambdaQuery()
|
||||
.eq(UserModel::getMobile, phoneNumber));
|
||||
}
|
||||
|
||||
// 我邀请的pk数据
|
||||
@Select("SELECT * FROM pk_record WHERE user_id_b = #{userId} ORDER BY id DESC LIMIT #{page}, #{size};")
|
||||
|
||||
@@ -11,6 +11,7 @@ public class UserModel {
|
||||
@TableId(type = IdType.AUTO)
|
||||
private Integer id; // 主键
|
||||
private String nickname; // 昵称
|
||||
private String mobile; // 手机号
|
||||
private Integer status; // 用户状态 0 正常 其他业务逻辑待定
|
||||
private String userChatId; // 聊天使用的id,使用微信的openid作为标识
|
||||
private Integer points; // 用户积分
|
||||
|
||||
Reference in New Issue
Block a user