use of com.baomidou.mybatisplus.mapper.EntityWrapper in project haha by hahafreeasair666.
the class PhoneServiceImpl method checkPhoneNum.
@Override
public Boolean checkPhoneNum(String mobile) {
Wrapper<Phone> wrapper = new EntityWrapper<>();
wrapper.eq("phone_num", mobile);
Integer count = this.selectCount(wrapper);
if (count != 0) {
return false;
} else {
Phone phone = new Phone(mobile);
this.insert(phone);
return true;
}
}
use of com.baomidou.mybatisplus.mapper.EntityWrapper in project haha by hahafreeasair666.
the class UserInfoServiceImpl method getUserCenterInfo.
@Override
public OtherCenterVO getUserCenterInfo(Integer userId, Integer loginUserId) {
OtherCenterVO userCenterVO = new OtherCenterVO();
UserCenterInfoCountVO userInfoCount = getUserInfoCount(userId);
userCenterVO.setUserId(userId);
userCenterVO.setFollows(userInfoCount.getFollow());
userCenterVO.setFans(userInfoCount.getFans());
UserInfoBO one = userInfoBORepository.findOne(userId);
if (one == null) {
return null;
}
userCenterVO.setAvatar(one.getUserInfo().getPicPath());
userCenterVO.setDescription(one.getUserInfo().getAutograph());
userCenterVO.setMyCredit(one.getCreditInfo().get("creditNum") != null ? (int) one.getCreditInfo().get("creditNum") : 0);
userCenterVO.setUserName(one.getUserInfo().getUsername());
// 组装是否已关注信息
if (loginUserId != null) {
Wrapper<UserFans> wrapper = new EntityWrapper<>();
wrapper.eq("userid1", loginUserId);
wrapper.eq("userid2", userId);
if (userFansService.selectCount(wrapper) == 0 && !userId.equals(loginUserId)) {
userCenterVO.setIsCanFollow(true);
} else {
userCenterVO.setIsCanFollow(false);
}
} else {
userCenterVO.setIsCanFollow(true);
}
return userCenterVO;
}
use of com.baomidou.mybatisplus.mapper.EntityWrapper in project haha by hahafreeasair666.
the class ApiTests method test1.
@Test
public void test1() {
Wrapper<News> newsWrapper = new EntityWrapper<>();
newsWrapper.eq("parentid", 15).lt("createtime", new Date());
List<News> news = newsService.selectList(newsWrapper);
System.out.println();
}
Aggregations