selectByUserId报错修复
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
package com.sqx.modules.integral.service.Impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.sqx.modules.integral.dao.UserIntegralDao;
|
||||
import com.sqx.modules.integral.entity.UserIntegral;
|
||||
@@ -21,7 +22,7 @@ public class UserIntegralServiceImpl extends ServiceImpl<UserIntegralDao, UserIn
|
||||
|
||||
@Override
|
||||
public UserIntegral selectById(Long id) {
|
||||
UserIntegral userIntegral = baseMapper.selectById(id);
|
||||
UserIntegral userIntegral = baseMapper.selectOne(new LambdaQueryWrapper<UserIntegral>().eq(UserIntegral::getUserId, id));
|
||||
if (userIntegral == null) {
|
||||
userIntegral = new UserIntegral();
|
||||
userIntegral.setUserId(id);
|
||||
@@ -36,4 +37,4 @@ public class UserIntegralServiceImpl extends ServiceImpl<UserIntegralDao, UserIn
|
||||
return userIntegralDao.updateIntegral(type,userId,num);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user