瀏覽代碼

关注收藏

XMTT 7 年之前
父節點
當前提交
d170c2a3ea

+ 15 - 5
src/main/java/com/ekexiu/portal/dao/WatchDao.java

@ -1,17 +1,16 @@
1 1
package com.ekexiu.portal.dao;
2 2

3
import java.sql.Connection;
4
import java.sql.SQLException;
5
import java.util.List;
6

3
import com.ekexiu.portal.po.Watch;
7 4
import org.jfw.apt.annotation.DefaultValue;
8 5
import org.jfw.apt.annotation.Nullable;
9 6
import org.jfw.apt.orm.annotation.dao.Column;
10 7
import org.jfw.apt.orm.annotation.dao.DAO;
11 8
import org.jfw.apt.orm.annotation.dao.method.From;
9
import org.jfw.apt.orm.annotation.dao.method.LimitColumn;
12 10
import org.jfw.apt.orm.annotation.dao.method.OrderBy;
13 11
import org.jfw.apt.orm.annotation.dao.method.operator.DeleteWith;
14 12
import org.jfw.apt.orm.annotation.dao.method.operator.Insert;
13
import org.jfw.apt.orm.annotation.dao.method.operator.LimitSelect;
15 14
import org.jfw.apt.orm.annotation.dao.method.operator.PageSelect;
16 15
import org.jfw.apt.orm.annotation.dao.method.operator.QueryVal;
17 16
import org.jfw.apt.orm.annotation.dao.method.operator.SelectList;
@ -19,7 +18,9 @@ import org.jfw.apt.orm.annotation.dao.method.operator.SelectOne;
19 18
import org.jfw.apt.orm.core.defaultImpl.IntHandler;
20 19
import org.jfw.util.PageQueryResult;
21 20

22
import com.ekexiu.portal.po.Watch;
21
import java.sql.Connection;
22
import java.sql.SQLException;
23
import java.util.List;
23 24

24 25
@DAO
25 26
public abstract class WatchDao {
@ -46,10 +47,19 @@ public abstract class WatchDao {
46 47
	@OrderBy(" ORDER BY CREATE_TIME DESC ")
47 48
	public abstract PageQueryResult<Watch> queryPro(Connection con, String professorId, short watchType, int pageSize, int pageNo) throws SQLException;
48 49

50
	@LimitSelect
51
	@OrderBy(cols = {@LimitColumn(value = "createTime", asc = false), @LimitColumn(value = "watchObject", asc = false)}, value = "")
52
	public abstract List<Watch> proList(Connection con, String professorId, short watchType, String createTime, String watchObject, int rows) throws SQLException;
53

49 54
	@SelectList
50 55
	@OrderBy(" ORDER BY CREATE_TIME DESC ")
51 56
	public abstract List<Watch> queryWatch(Connection con, String watchObject) throws SQLException;
52 57

58
	@LimitSelect
59
	@OrderBy(cols = {@LimitColumn(value = "createTime", asc = false), @LimitColumn(value = "professorId", asc = false)}, value = "")
60
	public abstract List<Watch> watchList(Connection con, String createTime, String professorId, String watchObject,int rows) throws SQLException;
61

62

53 63
	@QueryVal
54 64
	@From(Watch.class)
55 65
	@Column(value = "COUNT(1)", handlerClass = IntHandler.class)

+ 12 - 0
src/main/java/com/ekexiu/portal/service/WatchService.java

@ -193,6 +193,12 @@ public class WatchService {
193 193
		return queryResult;
194 194
	}
195 195

196
	@Get
197
	@Path("/proList")
198
	public List<Watch> proList(@JdbcConn Connection con,String professorId,short watchType,@DefaultValue("\"9\"")String createTime,@DefaultValue("\"Z\"")String watchObject,int rows)throws SQLException {
199
		return this.watchDao.proList(con, professorId, watchType, createTime, watchObject, rows);
200
	}
201

196 202
	@Get
197 203
	@Path("/qaWatch")
198 204
	public List<Watch> queryWatch(@JdbcConn Connection con, String watchObject) throws SQLException {
@ -209,6 +215,12 @@ public class WatchService {
209 215
		return watchs;
210 216
	}
211 217

218
	@Get
219
	@Path("/watchList")
220
	public List<Watch> watchList(@JdbcConn Connection con,String watchObject,@DefaultValue("\"9\"")String createTime,@DefaultValue("\"Z\"")String professorId,int rows) throws SQLException {
221
		return this.watchDao.watchList(con, createTime, professorId, watchObject, rows);
222
	}
223

212 224
	@Get
213 225
	@Path("/countObject")
214 226
	public int countObject(@JdbcConn Connection con, String id, short type) throws SQLException {