⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 borrowserviceimpl.java

📁 实现图书的借阅和管理信息化
💻 JAVA
字号:
package com.moonman.libraryManager.model.serviceImpl;

import java.util.List;

import com.moonman.libraryManager.model.dao.BorrowDAO;
import com.moonman.libraryManager.model.service.BorrowService;
import com.moonman.libraryManager.model.vo.Books;
import com.moonman.libraryManager.model.vo.Borrow;
import com.moonman.libraryManager.model.vo.Punish;
import com.moonman.libraryManager.model.vo.Store;

public class BorrowServiceImpl implements BorrowService {

	private BorrowDAO borrowDAO;

	public void setBorrowDAO(BorrowDAO borrowDAO) {
		this.borrowDAO = borrowDAO;
	}

	/**
	 * 添加一个图书借阅信息
	 */
	public boolean addBorrow(Borrow borrow) {
		return this.borrowDAO.addBorrow(borrow);
	}

	/**
	 * 删除一条图书借阅记录
	 * 
	 * @param borrowId
	 * @return
	 */
	public boolean deleteBorrowByBorrowId(String borrowId) {
		return this.borrowDAO.deleteBorrowByBorrowId(borrowId);
	}

	/**
	 * 根据读者编号查询读者借书记录
	 * 
	 * @param readerId
	 * @return
	 */
	public List<Object[]> getStoresByReaderId(String readerId) {
		return this.borrowDAO.getStoresByReaderId(readerId);
	}

	/**
	 * 根据读者编号查询读者的信息
	 * 
	 * @param readerId
	 * @return
	 */
	public List<Borrow> getBooksByReaderId(String readerId) {
		return this.borrowDAO.getBooksByReaderId(readerId);
	}

	/**
	 * 根据索取号获得官藏信息
	 * 
	 * @param sqh
	 * @return
	 */
	public Borrow getStoreBySqh(Integer sqh) {
		return this.borrowDAO.getStoreBySqh(sqh);
	}

	/**
	 * 根据用户编号和索取号查询用户的交易信息
	 * 
	 * @param readerId
	 * @param sqh
	 * @return
	 */
	public Borrow getBorrowByReaderIdAndSqh(Integer readerId, Integer sqh) {
		return this.borrowDAO.getBorrowByReaderIdAndSqh(readerId, sqh);
	}

	/**
	 * 更新借阅信息的状态
	 * 
	 * @param borrow
	 * @return
	 */
	public boolean modifyBorrowByBorrow(Borrow borrow) {
		return this.borrowDAO.modifyBorrowByBorrow(borrow);
	}

	/**
	 * 根据读者编号和借阅状态查询读者的信息
	 * 
	 * @param readerId
	 * @param 图书状态
	 * @return
	 */
	public List<Borrow> getBorrowsByReaderIdAndStatus(Integer readerId,
			Integer stauts) {
		return this.borrowDAO.getBorrowsByReaderIdAndStatus(readerId, stauts);
	}

	/**
	 * 根据用户编号和索取号,状态查询用户的交易信息
	 * 
	 * @param readerId
	 * @param sqh
	 * @return
	 */
	public Borrow getBorrowByReaderIdAndSqh(Integer readerId, Integer sqh,
			Integer status) {
		return this.borrowDAO.getBorrowByReaderIdAndSqh(readerId, sqh, status);
	}

	/**
	 * 添加一条罚款消息
	 * 
	 * @param punish
	 *            罚款实体
	 * @return
	 */
	public boolean addPunish(Punish punish) {
		return this.borrowDAO.addPunish(punish);
	}

	/**
	 * 根据索取号码删除图书的信息
	 * 
	 * @param sqh
	 *            索取号码
	 * @return 是否删除成功
	 */
	public boolean deleteBorrowBySqh(String sqh) {
		return this.borrowDAO.deleteBorrowBySqh(sqh);
	}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -