package com.cdzy.activity.service.impl; import com.cdzy.activity.model.vo.UserVo; import com.mybatisflex.core.query.QueryWrapper; import com.mybatisflex.spring.service.impl.ServiceImpl; import com.cdzy.activity.model.User; import com.cdzy.activity.mapper.UserMapper; import com.cdzy.activity.service.UserService; import jakarta.annotation.Resource; import org.springframework.stereotype.Service; /** * 服务层实现。 * * @author attiya * @since 2025-09-19 */ @Service public class UserServiceImpl extends ServiceImpl implements UserService { @Resource private UserMapper userMapper; @Override public void saveUser(UserVo user) { QueryWrapper queryWrapper = QueryWrapper .create() .eq(User::getWxOpenId, user.getWxOpenId()); User entity = userMapper.selectOneByQuery(queryWrapper); if (entity == null) { throw new RuntimeException("用户登陆信息错误"); } entity.setName(user.getName()); entity.setPhone(user.getPhone()); entity.setGender(user.getGender()); entity.setAddress(user.getAddress()); entity.setAge(user.getAge()); entity.setChronicDiseasesHistory(user.getChronicDiseasesHistory()); entity.setChronicDisease(user.getChronicDisease()); entity.setHeath(user.getHeath()); entity.setIsFilled(2); userMapper.update(entity); } }