jiapeng 7 年之前
父节点
当前提交
06f61f2a16

+ 16 - 2
src/main/java/com/ekexiu/portal/dao/PpaperDao.java

@ -7,13 +7,17 @@ import java.util.List;
7 7
import org.jfw.apt.annotation.Nullable;
8 8
import org.jfw.apt.orm.annotation.dao.DAO;
9 9
import org.jfw.apt.orm.annotation.dao.method.From;
10
import org.jfw.apt.orm.annotation.dao.method.Or;
10 11
import org.jfw.apt.orm.annotation.dao.method.OrderBy;
11 12
import org.jfw.apt.orm.annotation.dao.method.SetSentence;
12 13
import org.jfw.apt.orm.annotation.dao.method.operator.PageQuery;
14
import org.jfw.apt.orm.annotation.dao.method.operator.PageSelect;
13 15
import org.jfw.apt.orm.annotation.dao.method.operator.SelectList;
14 16
import org.jfw.apt.orm.annotation.dao.method.operator.SelectOne;
15 17
import org.jfw.apt.orm.annotation.dao.method.operator.UpdateWith;
18
import org.jfw.apt.orm.annotation.dao.param.Alias;
16 19
import org.jfw.apt.orm.annotation.dao.param.In;
20
import org.jfw.apt.orm.annotation.dao.param.Like;
17 21
import org.jfw.apt.orm.annotation.dao.param.Set;
18 22
import org.jfw.apt.orm.annotation.dao.param.SqlColumn;
19 23
import org.jfw.apt.orm.core.defaultImpl.FixLenStringHandler;
@ -39,7 +43,7 @@ public interface PpaperDao {
39 43
	@PageQuery
40 44
	@OrderBy(" ORDER BY ASS_TIMIE DESC,ID ASC")
41 45
	PageQueryResult<AssedPaper> pageQueryWithProfessor(Connection con,
42
			@SqlColumn(handlerClass = FixLenStringHandler.class, value = { "A.PROFESSOR_ID=?" }) String professId,
46
			@SqlColumn(handlerClass = FixLenStringHandler.class, value = { "A.PROFESSOR_ID=?" })  String professorId,
43 47
			@SqlColumn(handlerClass = FixLenStringHandler.class, value = { "P.NAME LIKE ?" }) String name, int pageSize, int pageNo) throws SQLException;
44 48

45 49
	@PageQuery
@ -52,6 +56,16 @@ public interface PpaperDao {
52 56
	@From(Ppaper.class)
53 57
	@UpdateWith
54 58
	@SetSentence("PAGE_VIEWS = PAGE_VIEWS + 1")
55
	public abstract int incPageViews(Connection con,String id)throws SQLException;
59
	 int incPageViews(Connection con,String id)throws SQLException;
60
	
61
	@PageSelect
62
	@OrderBy(" ORDER BY SORT_NUM DESC,CREATE_TIME DESC,ID DESC")
63
	PageQueryResult<Ppaper> query(Connection con,int pageSize,int pageNo) throws SQLException;
64
	
65
	@PageSelect
66
	@OrderBy(" ORDER BY SORT_NUM DESC,CREATE_TIME DESC,ID DESC")
67
	@Or
68
	PageQueryResult<Ppaper> query(Connection con,@Alias({"name","authors","keywords"}) @Like String cnt,int pageSize,int pageNo) throws SQLException;
69
	
56 70

57 71
}

+ 12 - 0
src/main/java/com/ekexiu/portal/dao/PpatentDao.java

@ -10,10 +10,13 @@ import org.jfw.apt.orm.annotation.dao.method.From;
10 10
import org.jfw.apt.orm.annotation.dao.method.OrderBy;
11 11
import org.jfw.apt.orm.annotation.dao.method.SetSentence;
12 12
import org.jfw.apt.orm.annotation.dao.method.operator.PageQuery;
13
import org.jfw.apt.orm.annotation.dao.method.operator.PageSelect;
13 14
import org.jfw.apt.orm.annotation.dao.method.operator.SelectList;
14 15
import org.jfw.apt.orm.annotation.dao.method.operator.SelectOne;
15 16
import org.jfw.apt.orm.annotation.dao.method.operator.UpdateWith;
17
import org.jfw.apt.orm.annotation.dao.param.Alias;
16 18
import org.jfw.apt.orm.annotation.dao.param.In;
19
import org.jfw.apt.orm.annotation.dao.param.Like;
17 20
import org.jfw.apt.orm.annotation.dao.param.Set;
18 21
import org.jfw.apt.orm.annotation.dao.param.SqlColumn;
19 22
import org.jfw.apt.orm.core.defaultImpl.FixLenStringHandler;
@ -52,5 +55,14 @@ public interface PpatentDao {
52 55
	@UpdateWith
53 56
	@SetSentence("PAGE_VIEWS = PAGE_VIEWS + 1")
54 57
	public abstract int incPageViews(Connection con,String id)throws SQLException;
58
	
59
	
60
	@PageSelect
61
	@OrderBy(" ORDER BY SORT_NUM DESC,CREATE_TIME DESC,ID DESC")
62
	PageQueryResult<Ppatent> query(Connection con,int pageSize,int pageNo) throws SQLException;
63
	
64
	@PageSelect
65
	@OrderBy(" ORDER BY SORT_NUM DESC,CREATE_TIME DESC,ID DESC")
66
	PageQueryResult<Ppatent> query(Connection con,@Alias({"code","authors","name","keywords"}) @Like String cnt,int pageSize,int pageNo) throws SQLException;
55 67

56 68
}

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

@ -617,7 +617,7 @@ public class ArticleService {
617 617
	}
618 618
	
619 619
	@Get
620
	@Path("/pgOrgPublish")
620
	@Path("/pqOrgPublish")
621 621
	public PageQueryResult<Article> pageQueryOrgPublish(@JdbcConn Connection con,String orgId,@DefaultValue("10") int pageSize,@DefaultValue("1") int pageNo)throws SQLException{
622 622
		return this.articleDao.pageQueryOrgPublish(con, orgId,pageSize,pageNo);
623 623
	}

+ 50 - 43
src/main/java/com/ekexiu/portal/service/PpaperService.java

@ -21,114 +21,121 @@ import com.ekexiu.portal.pojo.AssedPaper;
21 21

22 22
@Path("/ppaper")
23 23
public class PpaperService {
24
	
24

25 25
	@Autowrie
26 26
	private PpaperDao ppaperDao;
27 27
	@Autowrie
28 28
	private PaperAuthorDao paperAuthorDao;
29
	
30
	
31
	
29

32 30
	public PpaperDao getPpaperDao() {
33 31
		return ppaperDao;
34 32
	}
35 33

36

37

38 34
	public void setPpaperDao(PpaperDao ppaperDao) {
39 35
		this.ppaperDao = ppaperDao;
40 36
	}
41 37

42

43

44 38
	public PaperAuthorDao getPaperAuthorDao() {
45 39
		return paperAuthorDao;
46 40
	}
47 41

48

49

50 42
	public void setPaperAuthorDao(PaperAuthorDao paperAuthorDao) {
51 43
		this.paperAuthorDao = paperAuthorDao;
52 44
	}
53 45

54

55

56 46
	@Get
57 47
	@Path("/qo")
58
	public Ppaper query(@JdbcConn Connection con,String id)throws SQLException{
48
	public Ppaper query(@JdbcConn Connection con, String id) throws SQLException {
59 49
		return this.ppaperDao.query(con, id);
60 50
	}
51

61 52
	@Get
62 53
	@Path("/qm")
63
	public List<Ppaper> query(@JdbcConn Connection con,String[] id)throws SQLException{
54
	public List<Ppaper> query(@JdbcConn Connection con, String[] id) throws SQLException {
64 55
		return this.ppaperDao.query(con, id);
65 56
	}
66
	
57

67 58
	@Get
68 59
	@Path("/byProfessor")
69
	public PageQueryResult<AssedPaper> queryByProfessor(@JdbcConn Connection con,String id,@Nullable String name,@DefaultValue("10") int pageSize,@DefaultValue("1") int pageNo)throws SQLException{
70
		if(name == null ){
71
			name ="%";
72
		}else{
73
			name ="%"+name+"%";
60
	public PageQueryResult<AssedPaper> queryByProfessor(@JdbcConn Connection con, String id, @Nullable String name, @DefaultValue("10") int pageSize,
61
			@DefaultValue("1") int pageNo) throws SQLException {
62
		if (name == null) {
63
			name = "%";
64
		} else {
65
			name = "%" + name + "%";
74 66
		}
75 67
		return this.ppaperDao.pageQueryWithProfessor(con, id, name, pageSize, pageNo);
76 68
	}
69

77 70
	@Get
78 71
	@Path("/byAuthor")
79
	public PageQueryResult<AssedPaper> queryByAuthor(@JdbcConn Connection con,String author,String id,@Nullable String name,@DefaultValue("10") int pageSize,@DefaultValue("1") int pageNo)throws SQLException{
80
		if(name == null ){
81
			name ="%";
82
		}else{
83
			name ="%"+name+"%";
72
	public PageQueryResult<AssedPaper> queryByAuthor(@JdbcConn Connection con, String author, String id, @Nullable String name,
73
			@DefaultValue("10") int pageSize, @DefaultValue("1") int pageNo) throws SQLException {
74
		if (name == null) {
75
			name = "%";
76
		} else {
77
			name = "%" + name + "%";
84 78
		}
85
		return this.ppaperDao.pageQueryWithAuthor(con, author,id, name, pageSize, pageNo);
79
		return this.ppaperDao.pageQueryWithAuthor(con, author, id, name, pageSize, pageNo);
86 80
	}
87
	
81

88 82
	@Get
89 83
	@Path("/authors")
90
	public List<PaperAuthor> queryAuthors(@JdbcConn Connection con,String id)throws SQLException{
91
		return this.paperAuthorDao.query(con,id);
84
	public List<PaperAuthor> queryAuthors(@JdbcConn Connection con, String id) throws SQLException {
85
		return this.paperAuthorDao.query(con, id);
86
	}
87

88
	@Get
89
	@Path("/pq")
90
	public PageQueryResult<Ppaper> pageQuery(@JdbcConn Connection con, @Nullable String qw, @DefaultValue("20") int pageSize, @DefaultValue("1") int pageNo)
91
			throws SQLException {
92
		return null == qw ? this.ppaperDao.query(con, pageSize, pageNo) : this.ppaperDao.query(con, "%" + qw + "%", pageSize, pageNo);
92 93
	}
93
	
94

94 95
	/**
95 96
	 * 
96 97
	 * @param con
97
	 * @param uid 专家ID(用户ID) 
98
	 * @param id  论文ID
99
	 * @param author 作者名称
98
	 * @param uid
99
	 *            专家ID(用户ID)
100
	 * @param id
101
	 *            论文ID
102
	 * @param author
103
	 *            作者名称
100 104
	 * @return
101 105
	 * @throws SQLException
102 106
	 */
103 107
	@Post
104 108
	@Path("/ass")
105
	public int ass(@JdbcConn(true) Connection con,String uid,String id,String author)throws SQLException{
109
	public int ass(@JdbcConn(true) Connection con, String uid, String id, String author) throws SQLException {
106 110
		return this.paperAuthorDao.update(con, id, uid, author);
107 111
	}
112

108 113
	/**
109 114
	 * 
110 115
	 * @param con
111
	 * @param uid 专家ID(用户ID) 
112
	 * @param id  论文ID
116
	 * @param uid
117
	 *            专家ID(用户ID)
118
	 * @param id
119
	 *            论文ID
113 120
	 * @return
114 121
	 * @throws SQLException
115 122
	 */
116 123
	@Post
117 124
	@Path("/cAss")
118
	public int cAss(@JdbcConn(true) Connection con,String uid,String id)throws SQLException{
125
	public int cAss(@JdbcConn(true) Connection con, String uid, String id) throws SQLException {
119 126
		return this.paperAuthorDao.update(con, id, uid);
120
	}	
121
	
127
	}
128

122 129
	@Post
123 130
	@Path("/incPageViews")
124
	public void incPageViews(@JdbcConn(true) Connection con,String id)throws SQLException{
131
	public void incPageViews(@JdbcConn(true) Connection con, String id) throws SQLException {
125 132
		this.ppaperDao.incPageViews(con, id);
126 133
	}
127
	
134

128 135
	@Post
129 136
	@Path("/kw")
130
	public void update(@JdbcConn(true) Connection con,String id,@Nullable String keywords)throws SQLException{
137
	public void update(@JdbcConn(true) Connection con, String id, @Nullable String keywords) throws SQLException {
131 138
		this.ppaperDao.update(con, id, keywords);
132 139
	}
133
	
140

134 141
}

+ 6 - 1
src/main/java/com/ekexiu/portal/service/PpatentServcie.java

@ -90,7 +90,12 @@ public class PpatentServcie {
90 90
	public List<PatentAuthor> queryAuthors(@JdbcConn Connection con,String id)throws SQLException{
91 91
		return this.patentAuthorDao.query(con,id);
92 92
	}
93
	
93
	@Get
94
	@Path("/pq")
95
	public PageQueryResult<Ppatent> pageQuery(@JdbcConn Connection con, @Nullable String qw, @DefaultValue("20") int pageSize, @DefaultValue("1") int pageNo)
96
			throws SQLException {
97
		return null == qw ? this.ppatentDao.query(con, pageSize, pageNo) : this.ppatentDao.query(con, "%" + qw + "%", pageSize, pageNo);
98
	}
94 99
	/**
95 100
	 * 
96 101
	 * @param con