@Override
 public List<UserInfo> getUserInfoByIsAdmin(int userId, int isAdmin) {
   Map<String, Object> params = new HashMap<String, Object>();
   params.put("userId", userId);
   params.put("isAdmin", isAdmin);
   return userInfoMapper.getUserInfoByIsAdmin(params);
 }
 @Override
 public int checkLoginInfo(String userName, String userPassword) {
   Map<String, Object> params = new HashMap<String, Object>();
   params.put("userName", userName);
   params.put("userPassword", MD5Util.MD5(userPassword));
   List<UserInfo> list = userInfoMapper.checkLoginInfo(params);
   if (list.size() == 0) {
     return 0;
   }
   return list.get(0).getId();
 }
 @Override
 public int deleteUserById(int id) {
   Map<String, Object> params = new HashMap<String, Object>();
   params.put("id", id);
   return userInfoMapper.deleteUserById(params);
 }
 @Override
 public int changePassword(UserInfo userInfo) {
   userInfo.setUserPassword(MD5Util.MD5(userInfo.getUserPassword()));
   return userInfoMapper.changePassword(userInfo);
 }
 @Override
 public UserInfo getUserInfo(String userName) {
   Map<String, Object> params = new HashMap<String, Object>();
   params.put("userName", userName);
   return userInfoMapper.getUserInfoByUserName(params);
 }
 @Override
 public UserInfo getUserInfo(int id) {
   Map<String, Object> params = new HashMap<String, Object>();
   params.put("id", id);
   return userInfoMapper.getUserInfoById(params);
 }
 @Override
 public List<UserInfo> getUserInfoList() {
   return userInfoMapper.getUserInfoList();
 }
 @Override
 public int addUserInfo(UserInfo userInfo) {
   userInfo.setUserPassword(MD5Util.MD5(userInfo.getUserPassword()));
   return userInfoMapper.addUserInfo(userInfo);
 }