|
package com.ekexiu.portal.dao;
import com.ekexiu.portal.po.Watch;
import org.jfw.apt.annotation.DefaultValue;
import org.jfw.apt.annotation.Nullable;
import org.jfw.apt.orm.annotation.dao.Column;
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.LimitColumn;
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.LimitSelect;
import org.jfw.apt.orm.annotation.dao.method.operator.PageSelect;
import org.jfw.apt.orm.annotation.dao.method.operator.QueryVal;
import org.jfw.apt.orm.annotation.dao.method.operator.SelectList;
import org.jfw.apt.orm.annotation.dao.method.operator.SelectOne;
import org.jfw.apt.orm.core.defaultImpl.IntHandler;
import org.jfw.util.PageQueryResult;
import java.sql.Connection;
import java.sql.SQLException;
import java.util.List;
@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,short watchType,String watchObject) 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;
@PageSelect
@OrderBy(" ORDER BY CREATE_TIME DESC ")
public abstract PageQueryResult<Watch> queryPro(Connection con, String professorId, short watchType, int pageSize, int pageNo) throws SQLException;
@LimitSelect
@OrderBy(cols = {@LimitColumn(value = "createTime", asc = false), @LimitColumn(value = "watchObject", asc = false)}, value = "")
public abstract List<Watch> proList(Connection con, String professorId, short watchType, String createTime, String watchObject, int rows) throws SQLException;
@SelectList
@OrderBy(" ORDER BY CREATE_TIME DESC ")
public abstract List<Watch> queryWatch(Connection con, String watchObject) throws SQLException;
@LimitSelect
@OrderBy(cols = {@LimitColumn(value = "createTime", asc = false), @LimitColumn(value = "professorId", asc = false)}, value = "")
public abstract List<Watch> watchList(Connection con, String createTime, String professorId, String watchObject,int rows) throws SQLException;
@QueryVal
@From(Watch.class)
@Column(value = "COUNT(1)", handlerClass = IntHandler.class)
@DefaultValue("0")
public abstract int countWatchObject(Connection con, String professorId, short watchType) throws SQLException;
@QueryVal
@From(Watch.class)
@Column(value = "COUNT(1)", handlerClass = IntHandler.class)
@DefaultValue("0")
public abstract int countProfessor(Connection con, String watchObject, short watchType) throws SQLException;
}
|