| | |
| | | package com.example.springboot.service; |
| | | |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.example.springboot.entity.User; |
| | | import com.example.springboot.mapper.UserMapper; |
| | | import com.example.springboot.entity.vo.UserVo; |
| | | |
| | | @Service |
| | | public class UserService { |
| | | @Autowired |
| | | private UserMapper userMapper; |
| | | import java.util.List; |
| | | |
| | | public void Save(User user) { |
| | | if (user.getId() == null) { |
| | | userMapper.insert(user); |
| | | } else { |
| | | userMapper.update(user); |
| | | } |
| | | } |
| | | public interface UserService extends IService<User> { |
| | | IPage<User> selectPage(UserVo userVO); |
| | | |
| | | User selectByUsername(String username); |
| | | |
| | | Integer countByUsername(String username); |
| | | |
| | | |
| | | List<Long> selectChild(Long id, Boolean bool); |
| | | } |