StudentService.java 2.75 KB
package com.fh.service.sunvote.student.impl;

import java.util.List;
import javax.annotation.Resource;
import org.springframework.stereotype.Service;
import com.fh.dao.DaoSupport;
import com.fh.entity.Page;
import com.fh.util.PageData;
import com.fh.service.sunvote.student.StudentManager;

/** 
 * 说明: 学生管理
 * 创建人:FH Q313596790
 * 创建时间:2018-04-28
 * @version
 */
@Service("studentService")
public class StudentService implements StudentManager{

	@Resource(name = "daoSupport")
	private DaoSupport dao;
	
	/**新增
	 * @param pd
	 * @throws Exception
	 */
	public void save(PageData pd)throws Exception{
		dao.save("StudentMapper.save", pd);
	}
	
	/**删除
	 * @param pd
	 * @throws Exception
	 */
	public void delete(PageData pd)throws Exception{
		dao.delete("StudentMapper.delete", pd);
	}
	
	/**修改
	 * @param pd
	 * @throws Exception
	 */
	public void edit(PageData pd)throws Exception{
		dao.update("StudentMapper.edit", pd);
	}
	
	/**列表
	 * @param page
	 * @throws Exception
	 */
	@SuppressWarnings("unchecked")
	public List<PageData> list(Page page)throws Exception{
		return (List<PageData>)dao.findForList("StudentMapper.datalistPage", page);
	}
	
	/**列表
	 * @param page
	 * @throws Exception
	 */
	@SuppressWarnings("unchecked")
	public List<PageData> datalistclassPage(Page page)throws Exception{
		return (List<PageData>)dao.findForList("StudentMapper.dataclasslistPage", page);
	}
	
	/**列表(全部)
	 * @param pd
	 * @throws Exception
	 */
	@SuppressWarnings("unchecked")
	public List<PageData> listAll(PageData pd)throws Exception{
		return (List<PageData>)dao.findForList("StudentMapper.listAll", pd);
	}
	
	@SuppressWarnings("unchecked")
	public List<PageData> findByClassId(PageData pd)throws Exception{
		return (List<PageData>)dao.findForList("StudentMapper.findByClassId", pd);
	}
	
	
	@SuppressWarnings("unchecked")
	public List<PageData> listAllClass(PageData pd)throws Exception{
		return (List<PageData>)dao.findForList("StudentMapper.listAllClass", pd);
	}
	
	@SuppressWarnings("unchecked")
	public List<PageData> listAllClassByTerm(PageData pd)throws Exception{
		return (List<PageData>)dao.findForList("StudentMapper.listAllClassByTerm", pd);
	}
	
	/**通过id获取数据
	 * @param pd
	 * @throws Exception
	 */
	public PageData findById(PageData pd)throws Exception{
		return (PageData)dao.findForObject("StudentMapper.findById", pd);
	}
	
	/**通过id获取数据
	 * @param pd
	 * @throws Exception
	 */
	public PageData findByName(PageData pd)throws Exception{
		return (PageData)dao.findForObject("StudentMapper.findByName", pd);
	}
	
	/**批量删除
	 * @param ArrayDATA_IDS
	 * @throws Exception
	 */
	public void deleteAll(String[] ArrayDATA_IDS)throws Exception{
		dao.delete("StudentMapper.deleteAll", ArrayDATA_IDS);
	}
	
}