Selaa lähdekoodia

--add queryLimitOrg();

zzy.zhiyuan.foxmail 8 vuotta sitten
vanhempi
commit
6cddbc6c96

+ 7 - 1
src/main/java/com/ekexiu/portal/dao/ArticleDao.java

@ -15,10 +15,12 @@ import org.jfw.apt.orm.annotation.dao.method.From;
15 15
import org.jfw.apt.orm.annotation.dao.method.OrderBy;
16 16
import org.jfw.apt.orm.annotation.dao.method.operator.DeleteWith;
17 17
import org.jfw.apt.orm.annotation.dao.method.operator.Insert;
18
import org.jfw.apt.orm.annotation.dao.method.operator.LimitSelect;
18 19
import org.jfw.apt.orm.annotation.dao.method.operator.SelectList;
19 20
import org.jfw.apt.orm.annotation.dao.method.operator.SelectOne;
20 21
import org.jfw.apt.orm.annotation.dao.method.operator.Update;
21 22
import org.jfw.apt.orm.annotation.dao.method.operator.UpdateWith;
23
import org.jfw.apt.orm.annotation.dao.param.LessThan;
22 24
import org.jfw.apt.orm.annotation.dao.param.Set;
23 25
import org.jfw.util.PageQueryResult;
24 26

@ -55,9 +57,13 @@ public abstract class ArticleDao {
55 57
	public abstract List<Article> queryPro(Connection con, String professorId) throws SQLException;
56 58
	
57 59
	@SelectList
58
	@OrderBy(" ORDER BY MODIFY_TIME DESC")
60
	@OrderBy(" ORDER BY MODIFY_TIME DESC ")
59 61
	public abstract List<Article> queryOrg(Connection con, String orgId) throws SQLException;
60 62
	
63
	@LimitSelect
64
	@OrderBy(" ORDER BY MODIFY_TIME DESC ")
65
	public abstract List<Article> queryLimit(Connection con,String orgId,@LessThan String modifyTime,int rows)throws SQLException;
66
	
61 67
	@SelectOne
62 68
	@Nullable
63 69
	public abstract Article queryOne(Connection con, String articleId) throws SQLException;

+ 7 - 0
src/main/java/com/ekexiu/portal/service/ArticleService.java

@ -43,6 +43,7 @@ public class ArticleService {
43 43
	private String dateFormat = "yyyyMMdd";
44 44
	private int artMaxLen=640;
45 45
	private static final String JPG = "jpg";
46
	public static final String MAX_MODIFYTIME = "9";
46 47
	@Autowrie
47 48
	private ArticleDao articleDao;
48 49
	@Autowrie
@ -232,6 +233,12 @@ public class ArticleService {
232 233
		return this.articleDao.queryOrg(con, orgId);
233 234
	}
234 235
	
236
	@Get
237
	@Path("/qlOrg")
238
	public List<Article> queryLimitOrg(@JdbcConn Connection con,String orgId,@DefaultValue("com.ekexiu.portal.service.ArticleService.MAX_MODIFYTIME") String modifyTime,@DefaultValue("20") int rows)throws SQLException{
239
		return this.articleDao.queryLimit(con, orgId, modifyTime, rows);
240
	}
241
	
235 242
	@Get
236 243
	@Path("/query")
237 244
	public Article queryOne(@JdbcConn Connection con, String articleId) throws SQLException{