parent
f9de6b3fcd
commit
690ebcc329
@ -0,0 +1,51 @@
|
||||
package com.hzu.bookingsystem.service.impl;
|
||||
|
||||
|
||||
import com.hzu.bookingsystem.bean.UserCourseBean;
|
||||
import com.hzu.bookingsystem.repository.UserCourseRepository;
|
||||
import com.hzu.bookingsystem.service.UserCourseService;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
public class UserCourseServiceImpl implements UserCourseService{
|
||||
|
||||
@Resource
|
||||
private UserCourseRepository usercourseRepository;
|
||||
|
||||
@Override
|
||||
public UserCourseBean add(UserCourseBean usercourse) {
|
||||
return usercourseRepository.save(usercourse);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<UserCourseBean> findAll() {
|
||||
return usercourseRepository.findAll();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<UserCourseBean> findAllByUidAndYearAndSemester(Integer u_id,String year,Integer semester)
|
||||
{
|
||||
return usercourseRepository.findByUIdAndYearAndSemester(u_id,year,semester);
|
||||
}
|
||||
|
||||
@Override
|
||||
public UserCourseBean findById(Integer uc_id) {
|
||||
return usercourseRepository.findByUcId(uc_id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public UserCourseBean update(UserCourseBean usercourse) {
|
||||
return usercourseRepository.save(usercourse);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public void deleteByUcId(Integer uc_id) {
|
||||
usercourseRepository.deleteByUcId(uc_id);
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in new issue