基于ssm框架的出道选秀管理系统的功能模块代码
时间: 2023-09-09 19:08:33 浏览: 181
由于出道选秀管理系统的功能模块比较多,这里我只能给你提供一个大致的代码框架,具体实现还需要根据你的具体需求进行开发。
1. 用户管理模块代码:
```
//UserMapper.java
public interface UserMapper {
//添加用户
int addUser(User user);
//更新用户
int updateUser(User user);
//删除用户
int deleteUser(int id);
//查询用户
User selectUserById(int id);
//查询所有用户
List<User> selectAllUsers();
}
//UserServiceImpl.java
@Service
public class UserServiceImpl implements UserService {
@Autowired
private UserMapper userMapper;
@Override
public int addUser(User user) {
return userMapper.addUser(user);
}
@Override
public int updateUser(User user) {
return userMapper.updateUser(user);
}
@Override
public int deleteUser(int id) {
return userMapper.deleteUser(id);
}
@Override
public User selectUserById(int id) {
return userMapper.selectUserById(id);
}
@Override
public List<User> selectAllUsers() {
return userMapper.selectAllUsers();
}
}
```
2. 选秀活动管理模块代码:
```
//ActivityMapper.java
public interface ActivityMapper {
//添加选秀活动
int addActivity(Activity activity);
//更新选秀活动
int updateActivity(Activity activity);
//删除选秀活动
int deleteActivity(int id);
//查询选秀活动
Activity selectActivityById(int id);
//查询所有选秀活动
List<Activity> selectAllActivities();
}
//ActivityServiceImpl.java
@Service
public class ActivityServiceImpl implements ActivityService {
@Autowired
private ActivityMapper activityMapper;
@Override
public int addActivity(Activity activity) {
return activityMapper.addActivity(activity);
}
@Override
public int updateActivity(Activity activity) {
return activityMapper.updateActivity(activity);
}
@Override
public int deleteActivity(int id) {
return activityMapper.deleteActivity(id);
}
@Override
public Activity selectActivityById(int id) {
return activityMapper.selectActivityById(id);
}
@Override
public List<Activity> selectAllActivities() {
return activityMapper.selectAllActivities();
}
}
```
3. 选手管理模块代码:
```
//PlayerMapper.java
public interface PlayerMapper {
//添加选手
int addPlayer(Player player);
//更新选手
int updatePlayer(Player player);
//删除选手
int deletePlayer(int id);
//查询选手
Player selectPlayerById(int id);
//查询所有选手
List<Player> selectAllPlayers();
}
//PlayerServiceImpl.java
@Service
public class PlayerServiceImpl implements PlayerService {
@Autowired
private PlayerMapper playerMapper;
@Override
public int addPlayer(Player player) {
return playerMapper.addPlayer(player);
}
@Override
public int updatePlayer(Player player) {
return playerMapper.updatePlayer(player);
}
@Override
public int deletePlayer(int id) {
return playerMapper.deletePlayer(id);
}
@Override
public Player selectPlayerById(int id) {
return playerMapper.selectPlayerById(id);
}
@Override
public List<Player> selectAllPlayers() {
return playerMapper.selectAllPlayers();
}
}
```
4. 投票管理模块代码:
```
//VoteMapper.java
public interface VoteMapper {
//添加投票记录
int addVote(Vote vote);
//更新投票记录
int updateVote(Vote vote);
//查询投票记录
Vote selectVoteById(int id);
//查询某个选手的所有投票记录
List<Vote> selectAllVotesByPlayerId(int playerId);
//查询某个用户对某个选手的投票记录
Vote selectVoteByUserIdAndPlayerId(int userId, int playerId);
}
//VoteServiceImpl.java
@Service
public class VoteServiceImpl implements VoteService {
@Autowired
private VoteMapper voteMapper;
@Override
public int addVote(Vote vote) {
return voteMapper.addVote(vote);
}
@Override
public int updateVote(Vote vote) {
return voteMapper.updateVote(vote);
}
@Override
public Vote selectVoteById(int id) {
return voteMapper.selectVoteById(id);
}
@Override
public List<Vote> selectAllVotesByPlayerId(int playerId) {
return voteMapper.selectAllVotesByPlayerId(playerId);
}
@Override
public Vote selectVoteByUserIdAndPlayerId(int userId, int playerId) {
return voteMapper.selectVoteByUserIdAndPlayerId(userId, playerId);
}
}
```
阅读全文