Nessuna descrizione

ArticleDao.java 2.6KB

    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.Batch; 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.Where; 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.method.operator.SelectOne; import org.jfw.apt.orm.annotation.dao.method.operator.UpdateWith; import org.jfw.apt.orm.annotation.dao.param.*; 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 @SelectOne Article query(Connection con, String articleId) throws SQLException; @Nullable @QueryVal @Column(handlerClass = StringHandler.class, value = "article_title") @From(Article.class) String queryById(Connection con, String articleId) throws SQLException; @PageQuery @OrderBy(" ORDER BY publish_time DESC NULLS LAST") @Where("status='1'") PageQueryResult<ArticleInfo> queryByTime(Connection con, @Nullable @Like String articleTitle, @SqlColumn(value = {"(p.name is null or p.name like ?)", "(o.name is null or o.name like ?)"}, handlerClass = StringHandler.class) String name, @Nullable @GtEq @Alias("publishTime") String bt, @Nullable @Alias("publishTime") @LtEq String et, int pageSize, int pageNo) throws SQLException; @PageQuery @OrderBy(" ORDER BY page_views DESC NULLS LAST") @Where("status='1'") PageQueryResult<ArticleInfo> queryByPV(Connection con, @Nullable @Like String articleTitle, @SqlColumn(value = {"(p.name is null or p.name like ?)", "(o.name is null or o.name like ?)"}, handlerClass = StringHandler.class) String name, @Nullable @GtEq @Alias("publishTime") String bt, @Nullable @Alias("publishTime") @LtEq String et, int pageSize, int pageNo) throws SQLException; @Batch @UpdateWith @From(Article.class) int[] updateStatus(Connection con,@Batch String[] articleId,@Set String status) throws SQLException; @UpdateWith @From(Article.class) int updateStatus(Connection con,String articleId,@Set String status) throws SQLException; @UpdateWith @From(Article.class) int updateSortNum(Connection con, String articleId, @Set long sortNum) throws SQLException; }