|
package com.ekexiu.console.system.dao;
import com.ekexiu.console.system.po.Article;
import com.ekexiu.console.system.pojo.ArticleInfo;
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.OrderBy;
import org.jfw.apt.orm.annotation.dao.method.operator.PageQuery;
import org.jfw.apt.orm.annotation.dao.method.operator.QueryVal;
import org.jfw.apt.orm.annotation.dao.param.Alias;
import org.jfw.apt.orm.annotation.dao.param.GtEq;
import org.jfw.apt.orm.annotation.dao.param.Like;
import org.jfw.apt.orm.annotation.dao.param.LtEq;
import org.jfw.apt.orm.core.defaultImpl.StringHandler;
import org.jfw.util.PageQueryResult;
import java.sql.Connection;
import java.sql.SQLException;
/**
* Created by TT on 2017/7/26.
*/
@DAO
public interface ArticleDao {
@Nullable
@QueryVal
@Column(handlerClass = StringHandler.class, value = "article_title")
@From(Article.class)
String queryById(Connection con, String articleId) throws SQLException;
@PageQuery
@OrderBy(" ORDER BY create_time DESC NULLS LAST")
PageQueryResult<ArticleInfo> queryByTime(Connection con, @Nullable @Like String articleTitle, @Nullable @Like String professorName, @Nullable @GtEq @Alias("createTime") String bt, @Nullable @Alias("createTime") @LtEq String et, int pageSize, int pageNo) throws SQLException;
@PageQuery
@OrderBy(" ORDER BY page_views DESC NULLS LAST")
PageQueryResult<ArticleInfo> queryByPV(Connection con, @Nullable @Like String articleTitle,@Nullable @Like String professorName, @Nullable @GtEq @Alias("createTime") String bt, @Nullable @Alias("createTime") @LtEq String et, int pageSize, int pageNo) throws SQLException;
}
|