package com.ekexiu.portal.dao;

import java.sql.Connection;
import java.sql.SQLException;
import java.util.List;

import org.jfw.apt.orm.annotation.dao.DAO;
import org.jfw.apt.orm.annotation.dao.method.From;
import org.jfw.apt.orm.annotation.dao.method.OrderBy;
import org.jfw.apt.orm.annotation.dao.method.operator.DeleteWith;
import org.jfw.apt.orm.annotation.dao.method.operator.Insert;
import org.jfw.apt.orm.annotation.dao.method.operator.SelectList;

import com.ekexiu.portal.po.Watch;

@DAO
public abstract class WatchDao {
	@Insert
	public abstract int insert(Connection con, Watch watch) throws SQLException;
	
	@DeleteWith
	@From(Watch.class)
	public abstract int delete(Connection con, String professorId, String watchObject) throws SQLException;
	
	@DeleteWith
	@From(Watch.class)
	public abstract int deletePro(Connection con, String professorId) throws SQLException;
	
	@DeleteWith
	@From(Watch.class)
	public abstract int deleteWatch(Connection con, String watchObject) throws SQLException;
	
//	@Nullable
//	@SelectOne
//	public abstract Watch queryOne(Connection con, String professorId, String watchObject) throws SQLException;
	
	@SelectList
	@OrderBy(" ORDER BY CREATE_TIME DESC ")
	public abstract List<Watch> queryPro(Connection con, String professorId, Integer watchType) throws SQLException;
	
	@SelectList
	@OrderBy(" ORDER BY CREATE_TIME DESC ")
	public abstract List<Watch> queryWatch(Connection con, String watchObject) throws SQLException;
	
}
