package com.campus.service.imp; import com.campus.domain.Goods; import com.campus.domain.User; import com.campus.mapper.CampusMapper; import com.campus.service.CampusService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import java.util.List; @Service public class CampusServiceimp implements CampusService { @Autowired private CampusMapper campusMapper; //查询用户是否存在 @Override public Boolean userLogin(User user) { List users=campusMapper.userLogin(user); if(!users.isEmpty()) return true; else return false; } //注册新用户 @Override public Boolean newUser(User user) { if(campusMapper.newUser(user)) return true; else return false; } //更新密码 @Override public Boolean userUpdate(User user) { if(campusMapper.userUpdate(user)) return true; else return false; } //查询用户 @Override public List userselect(User user) { return campusMapper.userLogin(user); } //插入物品 @Override public Boolean goodsInter(Goods goods) { if(campusMapper.goodsInter(goods)) return true; else return false; } //更新物品 @Override public Boolean goodsUpdate(Goods goods) { if(campusMapper.goodsUpdate(goods)) return true; else return false; } //删除物品 @Override public Boolean goodsDelete(Goods goods) { if(campusMapper.goodsDelete(goods)) return true; else return false; } //查询物品 @Override public List goodsSelect(Goods goods) { return campusMapper.goodsSelect(goods); } }