瀏覽代碼

个人页

XMTT 7 年之前
父節點
當前提交
8e4f9319a9

+ 19 - 95
src/main/java/com/ekexiu/portal/dao/ArticleDao.java

@ -9,6 +9,7 @@ import org.jfw.apt.orm.annotation.dao.DAO;
9 9
import org.jfw.apt.orm.annotation.dao.Dynamic;
10 10
import org.jfw.apt.orm.annotation.dao.method.Exclude;
11 11
import org.jfw.apt.orm.annotation.dao.method.From;
12
import org.jfw.apt.orm.annotation.dao.method.LimitColumn;
12 13
import org.jfw.apt.orm.annotation.dao.method.OrderBy;
13 14
import org.jfw.apt.orm.annotation.dao.method.SetSentence;
14 15
import org.jfw.apt.orm.annotation.dao.method.Where;
@ -28,6 +29,7 @@ import org.jfw.apt.orm.annotation.dao.param.LessThan;
28 29
import org.jfw.apt.orm.annotation.dao.param.Like;
29 30
import org.jfw.apt.orm.annotation.dao.param.Set;
30 31
import org.jfw.apt.orm.annotation.dao.param.SqlColumn;
32
import org.jfw.apt.orm.core.defaultImpl.LongHandler;
31 33
import org.jfw.apt.orm.core.defaultImpl.StringHandler;
32 34
import org.jfw.util.PageQueryResult;
33 35

@ -116,6 +118,18 @@ public abstract class ArticleDao {
116 118
	@Where("STATUS = '1'")
117 119
	public abstract PageQueryResult<Article> pageQueryProPublish(Connection con, String professorId, int pageSize, int pageNo) throws SQLException;
118 120

121
	@LimitSelect
122
	@Exclude("articleContent")
123
	@OrderBy(cols = {@LimitColumn(value = "publishTime", asc = false), @LimitColumn(value = "shareId", handlerClass = LongHandler.class)}, value = "")
124
	@Where("STATUS = '1'")
125
	public abstract List<Article> proPublish(Connection con, String professorId, String publishTime, long shareId, int rows)throws SQLException;
126

127
	@LimitSelect
128
	@Exclude("articleContent")
129
	@OrderBy(cols = {@LimitColumn(value = "publishTime", asc = false), @LimitColumn(value = "shareId", handlerClass = LongHandler.class)}, value = "")
130
	@Where("STATUS = '1'")
131
	public abstract List<Article> orgPublish(Connection con, String orgId, String publishTime, long shareId, int rows)throws SQLException;
132

119 133
	@Exclude("articleContent")
120 134
	@SelectList
121 135
	@OrderBy(" ORDER BY MODIFY_TIME DESC ")
@ -492,101 +506,11 @@ public abstract class ArticleDao {
492 506
					"SUBJECT LIKE ?" }, additional = 1) @Nullable String key,
493 507
			int pageSize, int pageNo) throws SQLException;
494 508

495
	public List<Article> indexSearch(Connection con, String key, long sortNum, String publishTime, String id, int rows) throws SQLException {
496
		int index = 1;
497
		List<Article> result = new ArrayList<>();
498
		StringBuilder sql = new StringBuilder();
499
		sql.append("SELECT ARTICLE_ID,PROFESSOR_ID,ARTICLE_TITLE,SUBJECT,INDUSTRY,PUBLISH_TIME,ARTICLE_IMG,ORG_ID,ARTICLE_TYPE,ARTICLE_AGREE,PAGE_VIEWS,STATUS,SHARE_ID,COL_NUM,CREATE_TIME,MODIFY_TIME,SORT_NUM FROM ARTICLE");
500
		sql.append(" WHERE STATUS = '1' AND ((SORT_NUM < ?) OR (SORT_NUM = ? AND PUBLISH_TIME < ?) OR (SORT_NUM= ? AND PUBLISH_TIME=? AND ARTICLE_ID <?)) ");
501
		if (key != null) {
502
			sql.append(" AND ((PROFESSOR_ID IN (SELECT ID FROM PROFESSOR WHERE NAME LIKE ?)) OR (ORG_ID IN (SELECT ID FROM ORGANIZATION WHERE NAME LIKE ? OR FOR_SHORT LIKE ?)) OR (ARTICLE_TITLE LIKE ?) OR (SUBJECT LIKE ?)) ");
503
		}
504
		sql.append(" ORDER BY SORT_NUM DESC,PUBLISH_TIME DESC,ARTICLE_ID DESC LIMIT ? ");
505
		PreparedStatement ps = con.prepareStatement(sql.toString());
506
		try {
507
			ps.setLong(index++, sortNum);
508
			ps.setLong(index++, sortNum);
509
			ps.setString(index++, publishTime);
510
			ps.setLong(index++, sortNum);
511
			ps.setString(index++, publishTime);
512
			ps.setString(index++, id);
513
			if (key != null) {
514
				ps.setString(index++, key);
515
				ps.setString(index++, key);
516
				ps.setString(index++, key);
517
				ps.setString(index++, key);
518
				ps.setString(index++, key);
519
			}
520
			ps.setInt(index++, rows);
521
			ResultSet rs = ps.executeQuery();
522
			try {
523
				while (rs.next()) {
524
					Article article = new Article();
525
					article.setArticleId(rs.getString(1));
526
					java.lang.String _m_12 = rs.getString(2);
527
					if (rs.wasNull()) {
528
						_m_12 = null;
529
					}
530
					article.setProfessorId(_m_12);
531
					article.setArticleTitle(rs.getString(3));
532
					java.lang.String _m_13 = rs.getString(4);
533
					if (rs.wasNull()) {
534
						_m_13 = null;
535
					}
536
					article.setSubject(_m_13);
537
					java.lang.String _m_14 = rs.getString(5);
538
					if (rs.wasNull()) {
539
						_m_14 = null;
540
					}
541
					article.setIndustry(_m_14);
542
					java.lang.String _m_15 = rs.getString(6);
543
					if (rs.wasNull()) {
544
						_m_15 = null;
545
					}
546
					article.setPublishTime(_m_15);
547
					java.lang.String _m_16 = rs.getString(7);
548
					if (rs.wasNull()) {
549
						_m_16 = null;
550
					}
551
					article.setArticleImg(_m_16);
552
					java.lang.String _m_17 = rs.getString(8);
553
					if (rs.wasNull()) {
554
						_m_17 = null;
555
					}
556
					article.setOrgId(_m_17);
557
					java.lang.String _m_18 = rs.getString(9);
558
					if (rs.wasNull()) {
559
						_m_18 = null;
560
					}
561
					article.setArticleType(_m_18);
562
					article.setArticleAgree(rs.getInt(10));
563
					article.setPageViews(rs.getInt(11));
564
					java.lang.String _m_19 = rs.getString(12);
565
					if (rs.wasNull()) {
566
						_m_19 = null;
567
					}
568
					article.setStatus(_m_19);
569
					article.setShareId(rs.getLong(13));
570
					article.setColNum(rs.getInt(14));
571
					article.setCreateTime(rs.getString(15));
572
					article.setModifyTime(rs.getString(16));
573
					article.setSortNum(rs.getInt(17));
574
					result.add(article);
575
				}
576
				return result;
577
			} finally {
578
				try {
579
					rs.close();
580
				} catch (Exception _m_20) {
581
				}
582
			}
583
		} finally {
584
			try {
585
				ps.close();
586
			} catch (Exception _m_21) {
587
			}
588
		}
589
	}
509
	@LimitSelect
510
	@Exclude("articleContent")
511
	@Where("STATUS = '1'")
512
	@OrderBy(cols = {@LimitColumn(value = "sortNum", asc = false, handlerClass = LongHandler.class), @LimitColumn(value = "publishTime", asc = false), @LimitColumn(value = "articleId", asc = false)}, value = "")
513
	public abstract List<Article> indexSearch(Connection con,@Nullable @GroupSqlColumn(handlerClass = StringHandler.class, value = {"PROFESSOR_ID IN (SELECT ID FROM PROFESSOR WHERE NAME LIKE ?)", "ORG_ID IN (SELECT ID FROM ORGANIZATION WHERE NAME LIKE ? OR FOR_SHORT LIKE ?)", "ARTICLE_TITLE LIKE ?", "SUBJECT LIKE ?"}, additional = 1, isAnd = false) String key, long sortNum, String publishTime, String articleId, int rows) throws SQLException;
590 514

591 515
	// public PageQueryResult<Article> firstPageQuery(Connection con, String
592 516
	// key, int pageSize, int pageNo) throws SQLException {

+ 9 - 145
src/main/java/com/ekexiu/portal/dao/OrgDao.java

@ -7,6 +7,7 @@ import org.jfw.apt.annotation.Nullable;
7 7
import org.jfw.apt.orm.annotation.dao.Column;
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.LimitColumn;
10 11
import org.jfw.apt.orm.annotation.dao.method.Or;
11 12
import org.jfw.apt.orm.annotation.dao.method.OrderBy;
12 13
import org.jfw.apt.orm.annotation.dao.method.Select;
@ -29,6 +30,7 @@ import org.jfw.apt.orm.annotation.dao.param.In;
29 30
import org.jfw.apt.orm.annotation.dao.param.Like;
30 31
import org.jfw.apt.orm.annotation.dao.param.Set;
31 32
import org.jfw.apt.orm.annotation.dao.param.SqlColumn;
33
import org.jfw.apt.orm.core.defaultImpl.LongHandler;
32 34
import org.jfw.apt.orm.core.defaultImpl.StringHandler;
33 35
import org.jfw.util.PageQueryResult;
34 36
@ -218,151 +220,13 @@ public abstract class OrgDao {
218 220
					"(ID IN (SELECT ORG_ID FROM ARTICLE WHERE ARTICLE_TYPE='2' AND ARTICLE_TITLE LIKE ?) AND IS_JOIN ='1')" }) String kw,
219 221
			int pageSize, int pageNo) throws SQLException;
220 222
221
	public List<EditOrganization> indexSearch(Connection con, String kw,long sortNum,String modifyTime,String id,int rows)throws SQLException {
222
		int index = 1;
223
		StringBuilder sql = new StringBuilder();
224
		sql.append("SELECT FOR_SHORT,ORG_URL,FOUND_TIME,PROVINCE,CITY,SUBJECT,INDUSTRY,ORG_SIZE,QUALIFICATION,IS_JOIN,AUTH_STATUS,ADDR,EMAIL,CONTACT_NUM,FIELD_OF_CUSTOMER,FIELD_OF_SUPPLIER,SORT_NUM,PAGE_VIEWS,SHARE_ID,COL_MGR,RES_MGR,ORG_ATTR,ID,NAME,ORG_TYPE,CREATE_TIME,MODIFY_TIME,DESCP FROM ORGANIZATION");
225
		sql.append(" WHERE (SORT_NUM < ? OR (SORT_NUM = ? AND MODIFY_TIME < ?) OR (SORT_NUM = ? AND MODIFY_TIME = ? AND ID < ?)) ");
226
		if (kw != null) {
227
			sql.append(" AND ((ID IN (SELECT ORG_ID FROM ARTICLE WHERE ARTICLE_TYPE='2' AND ARTICLE_TITLE LIKE ?) AND IS_JOIN ='1') OR (ID IN (SELECT ORG_ID FROM RESOURCE WHERE RESOURCE_TYPE='2' AND RESOURCE_NAME LIKE ?) AND IS_JOIN ='1') OR (industry LIKE ?  AND IS_JOIN ='1') OR (SUBJECT LIKE ? AND IS_JOIN ='1') OR (DESCP LIKE ?  AND IS_JOIN ='1') OR (FOR_SHORT LIKE ? AND IS_JOIN ='1') OR (NAME LIKE ? AND IS_JOIN ='1')) ");
228
		}
229
		sql.append(" ORDER BY SORT_NUM DESC, MODIFY_TIME DESC LIMIT ? ");
230
		PreparedStatement ps = con.prepareStatement(sql.toString());
231
		try {
232
			ps.setLong(index++, sortNum);
233
			ps.setLong(index++, sortNum);
234
			ps.setString(index++, modifyTime);
235
			ps.setLong(index++, sortNum);
236
			ps.setString(index++, modifyTime);
237
			ps.setString(index++, id);
238
			if (kw != null) {
239
				ps.setString(index++, kw);
240
				ps.setString(index++, kw);
241
				ps.setString(index++, kw);
242
				ps.setString(index++, kw);
243
				ps.setString(index++, kw);
244
				ps.setString(index++, kw);
245
				ps.setString(index++, kw);
246
			}
247
			ps.setInt(index++, rows);
248
			ResultSet resultSet = ps.executeQuery();
249
			try {
250
				List<EditOrganization> orgs = new ArrayList<>();
251
				while (resultSet.next()) {
252
					EditOrganization organization = new EditOrganization();
253
					String forshort = resultSet.getString(1);
254
					if(resultSet.wasNull()){
255
						forshort = null;
256
					}
257
					organization.setForShort(forshort);
258
					String orgUrl = resultSet.getString(2);
259
					if(resultSet.wasNull()){
260
						orgUrl = null;
261
					}
262
					organization.setOrgUrl(orgUrl);
263
					String foundTime = resultSet.getString(3);
264
					if(resultSet.wasNull()){
265
						foundTime = null;
266
					}
267
					organization.setFoundTime(foundTime);
268
					String province = resultSet.getString(4);
269
					if(resultSet.wasNull()){
270
						province = null;
271
					}
272
					organization.setProvince(province);
273
					String city = resultSet.getString(5);
274
					if(resultSet.wasNull()){
275
						city = null;
276
					}
277
					organization.setCity(city);
278
					String subject = resultSet.getString(6);
279
					if(resultSet.wasNull()){
280
						subject = null;
281
					}
282
					organization.setSubject(subject);
283
					String industry = resultSet.getString(7);
284
					if(resultSet.wasNull()){
285
						industry = null;
286
					}
287
					organization.setIndustry(industry);
288
					String orgSize = resultSet.getString(8);
289
					if(resultSet.wasNull()){
290
						orgSize = null;
291
					}
292
					organization.setOrgSize(orgSize);
293
					String qualification = resultSet.getString(9);
294
					if(resultSet.wasNull()){
295
						qualification = null;
296
					}
297
					organization.setQualification(qualification);
298
					organization.setIsJoin(resultSet.getString(10));
299
					organization.setAuthStatus(resultSet.getString(11));
300
					String addr = resultSet.getString(12);
301
					if(resultSet.wasNull()){
302
						addr = null;
303
					}
304
					organization.setAddr(addr);
305
					String email = resultSet.getString(13);
306
					if(resultSet.wasNull()){
307
						email = null;
308
					}
309
					organization.setEmail(email);
310
					String contactNum = resultSet.getString(14);
311
					if(resultSet.wasNull()){
312
						contactNum = null;
313
					}
314
					organization.setContactNum(contactNum);
315
					String fieldOfCustomer = resultSet.getString(15);
316
					if(resultSet.wasNull()){
317
						fieldOfCustomer = null;
318
					}
319
					organization.setFieldOfCustomer(fieldOfCustomer);
320
					String fieldOfSupplier = resultSet.getString(16);
321
					if(resultSet.wasNull()){
322
						fieldOfSupplier = null;
323
					}
324
					organization.setFieldOfSupplier(fieldOfSupplier);
325
					organization.setSortNum(resultSet.getLong(17));
326
					organization.setPageViews(resultSet.getLong(18));
327
					organization.setShareId(resultSet.getLong(19));
328
					organization.setColMgr("1".equals(resultSet.getString(20)));
329
					organization.setResMgr("1".equals(resultSet.getString(21)));
330
					String orgAttr = resultSet.getString(22);
331
					if(resultSet.wasNull()){
332
						orgAttr = null;
333
					}
334
					organization.setOrgAttr(orgAttr);
335
					organization.setId(resultSet.getString(23));
336
					organization.setName(resultSet.getString(24));
337
					String orgType = resultSet.getString(25);
338
					if(resultSet.wasNull()){
339
						orgType = null;
340
					}
341
					organization.setOrgType(orgType);
342
					organization.setCreateTime(resultSet.getString(26));
343
					organization.setModifyTime(resultSet.getString(27));
344
					String descp = resultSet.getString(28);
345
					if(resultSet.wasNull()){
346
						descp = null;
347
					}
348
					organization.setDescp(descp);
349
					orgs.add(organization);
350
				}
351
				return orgs;
352
			} finally {
353
				try {
354
					resultSet.close();
355
				} catch (Exception e1) {
356
				}
357
			}
358
		} finally {
359
			try {
360
				ps.close();
361
			} catch (Exception e2) {
362
			}
363
		}
364
365
	}
223
	@LimitQuery
224
	@Select(Organization.class)
225
	@From(Organization.class)
226
	@OrderBy(cols = {@LimitColumn(value = "sortNum", asc = false, handlerClass = LongHandler.class), @LimitColumn(value = "modifyTime", asc = false), @LimitColumn(value = "id", asc = false)}, value = "")
227
	public abstract List<EditOrganization> indexSearch(Connection con, @Nullable @GroupSqlColumn(handlerClass = StringHandler.class, value = {"NAME LIKE ? AND IS_JOIN ='1'", "FOR_SHORT LIKE ? AND IS_JOIN ='1'", "DESCP LIKE ?  AND IS_JOIN ='1'", "SUBJECT LIKE ? AND IS_JOIN ='1' ", "industry LIKE ?  AND IS_JOIN ='1'",
228
			"ID IN (SELECT ORG_ID FROM RESOURCE WHERE RESOURCE_TYPE='2' AND RESOURCE_NAME LIKE ?) AND IS_JOIN ='1'",
229
			"ID IN (SELECT ORG_ID FROM ARTICLE WHERE ARTICLE_TYPE='2' AND ARTICLE_TITLE LIKE ?) AND IS_JOIN ='1'"},isAnd = false) String kw, long sortNum, String modifyTime, String id, int rows) throws SQLException;
366 230
367 231
	@PageQuery
368 232
	@Select(Organization.class)

+ 15 - 80
src/main/java/com/ekexiu/portal/dao/PpaperDao.java

@ -6,20 +6,26 @@ import org.jfw.apt.annotation.Nullable;
6 6
import org.jfw.apt.orm.annotation.dao.DAO;
7 7
import org.jfw.apt.orm.annotation.dao.method.Exclude;
8 8
import org.jfw.apt.orm.annotation.dao.method.From;
9
import org.jfw.apt.orm.annotation.dao.method.LimitColumn;
9 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;
13
import org.jfw.apt.orm.annotation.dao.method.operator.LimitQuery;
14
import org.jfw.apt.orm.annotation.dao.method.operator.LimitSelect;
12 15
import org.jfw.apt.orm.annotation.dao.method.operator.PageQuery;
13 16
import org.jfw.apt.orm.annotation.dao.method.operator.PageSelect;
14 17
import org.jfw.apt.orm.annotation.dao.method.operator.SelectList;
15 18
import org.jfw.apt.orm.annotation.dao.method.operator.SelectOne;
16 19
import org.jfw.apt.orm.annotation.dao.method.operator.UpdateWith;
17 20
import org.jfw.apt.orm.annotation.dao.param.Alias;
21
import org.jfw.apt.orm.annotation.dao.param.GroupSqlColumn;
18 22
import org.jfw.apt.orm.annotation.dao.param.In;
19 23
import org.jfw.apt.orm.annotation.dao.param.Like;
20 24
import org.jfw.apt.orm.annotation.dao.param.Set;
21 25
import org.jfw.apt.orm.annotation.dao.param.SqlColumn;
22 26
import org.jfw.apt.orm.core.defaultImpl.FixLenStringHandler;
27
import org.jfw.apt.orm.core.defaultImpl.LongHandler;
28
import org.jfw.apt.orm.core.defaultImpl.StringHandler;
23 29
import org.jfw.util.PageQueryResult;
24 30

25 31
import java.sql.Connection;
@ -51,6 +57,11 @@ public abstract class PpaperDao {
51 57
			@SqlColumn(handlerClass = FixLenStringHandler.class, value = { "A.PROFESSOR_ID=?" })  String professorId,
52 58
			@SqlColumn(handlerClass = FixLenStringHandler.class, value = { "P.NAME LIKE ?" }) String name, int pageSize, int pageNo) throws SQLException;
53 59

60
	@Exclude("summary")
61
	@LimitQuery
62
	@OrderBy(cols = {@LimitColumn(value = "assTime", asc = false), @LimitColumn(value = "id", asc = false)}, value = "")
63
	public abstract List<AssedPaper> queryProfessor(Connection con, String professorId,@Nullable @SqlColumn(handlerClass = StringHandler.class,value = {"P.NAME LIKE ?"}) String name, String assTime, String id, int rows) throws SQLException;
64

54 65
	@Exclude("summary")
55 66
	@PageQuery
56 67
	@OrderBy(" ORDER BY ASS_TIME DESC,ID ASC")
@ -76,86 +87,10 @@ public abstract class PpaperDao {
76 87
	@Or
77 88
	public abstract PageQueryResult<Ppaper> query(Connection con,@Alias({"name","authors","keywords","cn4periodical","en4periodical"}) @Like String cnt,int pageSize,int pageNo) throws SQLException;
78 89

79
	public List<Ppaper> indexSearch(Connection con, String key, long sortNum, String createTime, String id, int rows) throws SQLException {
80
		List<Ppaper> result = new ArrayList<>();
81
		StringBuilder sql = new StringBuilder();
82
		sql.append("SELECT AUTHORS,SORT_NUM,ID,NAME,PAGE_VIEWS,CN4PERIODICAL,EN4PERIODICAL,PERIODICALTYPE,PUB_DAY,KEYWORDS,REF_PARAM,SHARE_ID,CREATE_TIME FROM PPAPER");
83
		sql.append(" WHERE (SORT_NUM < ? OR (SORT_NUM = ? AND CREATE_TIME < ?) OR (SORT_NUM=? AND CREATE_TIME = ? AND ID < ?)) ");
84
		if (key != null) {
85
			sql.append(" AND (EN4PERIODICAL LIKE ? OR CN4PERIODICAL LIKE ? OR KEYWORDS LIKE ? OR AUTHORS LIKE ? OR NAME LIKE ?) ");
86
		}
87
		sql.append(" ORDER BY SORT_NUM DESC,CREATE_TIME DESC,ID DESC LIMIT ? ");
88
		PreparedStatement ps = con.prepareStatement(sql.toString());
89
		try {
90
			int index = 1;
91
			ps.setLong(index++, sortNum);
92
			ps.setLong(index++, sortNum);
93
			ps.setString(index++, createTime);
94
			ps.setLong(index++, sortNum);
95
			ps.setString(index++, createTime);
96
			ps.setString(index++, id);
97
			if (key != null) {
98
				ps.setString(index++, key);
99
				ps.setString(index++, key);
100
				ps.setString(index++, key);
101
				ps.setString(index++, key);
102
				ps.setString(index++, key);
103
			}
104
			ps.setInt(index++, rows);
105
			ResultSet rs = ps.executeQuery();
106
			try {
107
				while (rs.next()) {
108
					Ppaper ppaper = new Ppaper();
109
					ppaper.setAuthors(rs.getString(1));
110
					ppaper.setSortNum(rs.getLong(2));
111
					ppaper.setId(rs.getString(3));
112
					ppaper.setName(rs.getString(4));
113
					ppaper.setPageViews(rs.getLong(5));
114
					String cn4periodical = rs.getString(6);
115
					if (rs.wasNull()) {
116
						cn4periodical = null;
117
					}
118
					ppaper.setCn4periodical(cn4periodical);
119
					String en4periodical = rs.getString(7);
120
					if (rs.wasNull()) {
121
						en4periodical = null;
122
					}
123
					ppaper.setEn4periodical(en4periodical);
124
					String periodicaltype = rs.getString(8);
125
					if (rs.wasNull()) {
126
						periodicaltype = null;
127
					}
128
					ppaper.setPeriodicaltype(periodicaltype);
129
					ppaper.setPubDay(rs.getString(9));
130
					String keywords = rs.getString(10);
131
					if (rs.wasNull()) {
132
						keywords = null;
133
					}
134
					ppaper.setKeywords(keywords);
135
					String refParam = rs.getString(11);
136
					if (rs.wasNull()) {
137
						refParam = null;
138
					}
139
					ppaper.setRef_param(refParam);
140
					ppaper.setShareId(rs.getLong(12));
141
					ppaper.setCreateTime(rs.getString(13));
142
					result.add(ppaper);
143
				}
144
				return result;
145
			} finally {
146
				try {
147
					rs.close();
148
				} catch (Exception _m_16) {
149
				}
150
			}
151
		} finally {
152
			try {
153
				ps.close();
154
			} catch (Exception _m_17) {
155
			}
156
		}
157
	}
158

90
	@LimitSelect
91
	@Exclude("summary")
92
	@OrderBy(cols = {@LimitColumn(value = "sortNum", asc = false, handlerClass = LongHandler.class), @LimitColumn(value = "createTime", asc = false), @LimitColumn(value = "id", asc = false)}, value = "")
93
	public abstract List<Ppaper> indexSearch(Connection con,@Nullable @GroupSqlColumn(handlerClass = StringHandler.class, value = {"EN4PERIODICAL LIKE ?", "CN4PERIODICAL LIKE ?", "KEYWORDS LIKE ?", "AUTHORS LIKE ?", "NAME LIKE ?"}, isAnd = false) String key, long sortNum, String createTime, String id, int rows) throws SQLException;
159 94

160 95
	@SelectOne
161 96
	@Nullable

+ 15 - 90
src/main/java/com/ekexiu/portal/dao/PpatentDao.java

@ -6,20 +6,26 @@ import org.jfw.apt.annotation.Nullable;
6 6
import org.jfw.apt.orm.annotation.dao.DAO;
7 7
import org.jfw.apt.orm.annotation.dao.method.Exclude;
8 8
import org.jfw.apt.orm.annotation.dao.method.From;
9
import org.jfw.apt.orm.annotation.dao.method.LimitColumn;
9 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;
13
import org.jfw.apt.orm.annotation.dao.method.operator.LimitQuery;
14
import org.jfw.apt.orm.annotation.dao.method.operator.LimitSelect;
12 15
import org.jfw.apt.orm.annotation.dao.method.operator.PageQuery;
13 16
import org.jfw.apt.orm.annotation.dao.method.operator.PageSelect;
14 17
import org.jfw.apt.orm.annotation.dao.method.operator.SelectList;
15 18
import org.jfw.apt.orm.annotation.dao.method.operator.SelectOne;
16 19
import org.jfw.apt.orm.annotation.dao.method.operator.UpdateWith;
17 20
import org.jfw.apt.orm.annotation.dao.param.Alias;
21
import org.jfw.apt.orm.annotation.dao.param.GroupSqlColumn;
18 22
import org.jfw.apt.orm.annotation.dao.param.In;
19 23
import org.jfw.apt.orm.annotation.dao.param.Like;
20 24
import org.jfw.apt.orm.annotation.dao.param.Set;
21 25
import org.jfw.apt.orm.annotation.dao.param.SqlColumn;
22 26
import org.jfw.apt.orm.core.defaultImpl.FixLenStringHandler;
27
import org.jfw.apt.orm.core.defaultImpl.LongHandler;
28
import org.jfw.apt.orm.core.defaultImpl.StringHandler;
23 29
import org.jfw.util.PageQueryResult;
24 30

25 31
import java.sql.Connection;
@ -52,6 +58,11 @@ public abstract class PpatentDao {
52 58
			@SqlColumn(handlerClass = FixLenStringHandler.class, value = { "A.PROFESSOR_ID=?" }) String professId,
53 59
			@SqlColumn(handlerClass = FixLenStringHandler.class, value = { "P.NAME LIKE ?" }) String name, int pageSize, int pageNo) throws SQLException;
54 60

61
	@Exclude("summary")
62
	@LimitQuery
63
	@OrderBy(cols = {@LimitColumn(value = "assTime", asc = false), @LimitColumn(value = "id", asc = false)}, value = "")
64
	public abstract List<AssedPatent> queryProfessor(Connection con, String professorId, @Nullable @SqlColumn(handlerClass = StringHandler.class,value = {"P.NAME LIKE ?"}) String name, String assTime, String id, int rows) throws SQLException;
65

55 66
	@Exclude("summary")
56 67
	@PageQuery
57 68
	@OrderBy(" ORDER BY ASS_TIME DESC,ID ASC")
@ -78,96 +89,10 @@ public abstract class PpatentDao {
78 89
	public abstract PageQueryResult<Ppatent> query(Connection con, @Alias({ "code", "authors", "name", "keywords","reqPerson" }) @Like String cnt, int pageSize, int pageNo)
79 90
			throws SQLException;
80 91

81

82
	public List<Ppatent> indexSearch(Connection con, String key, long sortNum, String createTime, String id, int rows) throws SQLException {
83
		List<Ppatent> result = new ArrayList<>();
84
		StringBuilder sql = new StringBuilder();
85
		sql.append("SELECT AUTHORS,SORT_NUM,ID,NAME,PAGE_VIEWS,CODE,REQ_CODE,REQ_PERSON,REQ_DAY,PUB_DAY,REF_PARAM,KEYWORDS,SHARE_ID,CREATE_TIME FROM PPATENT");
86
		sql.append(" WHERE (SORT_NUM < ? OR (SORT_NUM = ? AND CREATE_TIME < ?) OR (SORT_NUM=? AND CREATE_TIME = ? AND ID < ?)) ");
87
		if (key != null) {
88
			sql.append(" AND (REQ_PERSON LIKE ? OR KEYWORDS LIKE ? OR NAME LIKE ? OR AUTHORS LIKE ? OR CODE LIKE ?) ");
89
		}
90
		sql.append("ORDER BY SORT_NUM DESC,CREATE_TIME DESC,ID DESC LIMIT ?");
91
		PreparedStatement ps = con.prepareStatement(sql.toString());
92
		try {
93
			int index = 1;
94
			ps.setLong(index++, sortNum);
95
			ps.setLong(index++, sortNum);
96
			ps.setString(index++, createTime);
97
			ps.setLong(index++, sortNum);
98
			ps.setString(index++, createTime);
99
			ps.setString(index++, id);
100
			if (key != null) {
101
				ps.setString(index++, key);
102
				ps.setString(index++, key);
103
				ps.setString(index++, key);
104
				ps.setString(index++, key);
105
				ps.setString(index++, key);
106
			}
107
			ps.setInt(index++, rows);
108
			ResultSet rs = ps.executeQuery();
109
			try {
110
				while (rs.next()) {
111
					Ppatent ppatent = new Ppatent();
112
					ppatent.setAuthors(rs.getString(1));
113
					ppatent.setSortNum(rs.getLong(2));
114
					ppatent.setId(rs.getString(3));
115
					ppatent.setName(rs.getString(4));
116
					ppatent.setPageViews(rs.getLong(5));
117
					String code = rs.getString(6);
118
					if (rs.wasNull()) {
119
						code = null;
120
					}
121
					ppatent.setCode(code);
122
					String reqCode = rs.getString(7);
123
					if (rs.wasNull()) {
124
						reqCode = null;
125
					}
126
					ppatent.setReqCode(reqCode);
127
					String reqPerson = rs.getString(8);
128
					if (rs.wasNull()) {
129
						reqPerson = null;
130
					}
131
					ppatent.setReqPerson(reqPerson);
132
					String reqDay = rs.getString(9);
133
					if (rs.wasNull()) {
134
						reqDay = null;
135
					}
136
					ppatent.setReqDay(reqDay);
137
					String pubDay = rs.getString(10);
138
					if (rs.wasNull()) {
139
						pubDay = null;
140
					}
141
					ppatent.setPubDay(pubDay);
142
					String refParam = rs.getString(11);
143
					if (rs.wasNull()) {
144
						refParam = null;
145
					}
146
					ppatent.setRef_param(refParam);
147
					String keyWords = rs.getString(12);
148
					if (rs.wasNull()) {
149
						keyWords = null;
150
					}
151
					ppatent.setKeywords(keyWords);
152
					ppatent.setShareId(rs.getLong(13));
153
					ppatent.setCreateTime(rs.getString(14));
154
					result.add(ppatent);
155
				}
156
				return result;
157
			} finally {
158
				try {
159
					rs.close();
160
				} catch (Exception _m_18) {
161
				}
162
			}
163
		} finally {
164
			try {
165
				ps.close();
166
			} catch (Exception _m_19) {
167
			}
168
		}
169
	}
170

92
	@Exclude("summary")
93
	@LimitSelect
94
	@OrderBy(cols = {@LimitColumn(value = "sortNum", handlerClass = LongHandler.class, asc = false), @LimitColumn(value = "createTime", asc = false), @LimitColumn(value = "id", asc = false)}, value = "")
95
	public abstract List<Ppatent> indexSearch(Connection con, @Nullable @GroupSqlColumn(handlerClass = StringHandler.class, value = {"REQ_PERSON LIKE ?", "KEYWORDS LIKE ?", "NAME LIKE ?", "AUTHORS LIKE ?", "CODE LIKE ?"}) String key, long sortNum, String createTime, String id, int rows) throws SQLException;
171 96

172 97
	@SelectOne
173 98
	@Nullable

+ 18 - 134
src/main/java/com/ekexiu/portal/dao/ResourceDao.java

@ -9,6 +9,7 @@ import org.jfw.apt.annotation.Nullable;
9 9
import org.jfw.apt.orm.annotation.dao.DAO;
10 10
import org.jfw.apt.orm.annotation.dao.Dynamic;
11 11
import org.jfw.apt.orm.annotation.dao.method.From;
12
import org.jfw.apt.orm.annotation.dao.method.LimitColumn;
12 13
import org.jfw.apt.orm.annotation.dao.method.OrderBy;
13 14
import org.jfw.apt.orm.annotation.dao.method.SetSentence;
14 15
import org.jfw.apt.orm.annotation.dao.method.Where;
@ -20,9 +21,13 @@ import org.jfw.apt.orm.annotation.dao.method.operator.SelectList;
20 21
import org.jfw.apt.orm.annotation.dao.method.operator.SelectOne;
21 22
import org.jfw.apt.orm.annotation.dao.method.operator.Update;
22 23
import org.jfw.apt.orm.annotation.dao.method.operator.UpdateWith;
24
import org.jfw.apt.orm.annotation.dao.param.GroupSqlColumn;
23 25
import org.jfw.apt.orm.annotation.dao.param.In;
26
import org.jfw.apt.orm.annotation.dao.param.LessThan;
24 27
import org.jfw.apt.orm.annotation.dao.param.Like;
25 28
import org.jfw.apt.orm.annotation.dao.param.Set;
29
import org.jfw.apt.orm.core.defaultImpl.LongHandler;
30
import org.jfw.apt.orm.core.defaultImpl.StringHandler;
26 31
import org.jfw.util.PageQueryResult;
27 32

28 33
import java.sql.Connection;
@ -1085,7 +1090,15 @@ public abstract class ResourceDao {
1085 1090
	@OrderBy("ORDER BY PUBLISH_TIME DESC")
1086 1091
	@Where("STATUS = '1'")
1087 1092
	public abstract PageQueryResult<Resource> pageQueryProPublish(Connection con,String professorId,int pageSize,int pageNo) throws SQLException;
1088
	
1093

1094
    @LimitSelect
1095
    @Where("STATUS='1'")
1096
    public abstract List<Resource> proPublish(Connection con, String professorId, @LessThan String publishTime, int rows) throws SQLException;
1097

1098
    @LimitSelect
1099
    @Where("STATUS='1'")
1100
    public abstract List<Resource> orgPublish(Connection con, String orgId, @LessThan String publishTime, int rows) throws SQLException;
1101

1089 1102
	@SelectList
1090 1103
	@OrderBy("ORDER BY PUBLISH_TIME DESC")
1091 1104
	@Where("STATUS IN ('0','1')")
@ -1324,139 +1337,10 @@ public abstract class ResourceDao {
1324 1337
        }
1325 1338
    }
1326 1339

1327
    public List<Resource> indexSearch(Connection con, String key, long sortNum, String modifyTime, String id, int rows)throws SQLException {
1328
        List<Resource> result = new ArrayList<>();
1329
        StringBuilder sql = new StringBuilder();
1330
        sql.append("SELECT RESOURCE_ID,RESOURCE_NAME,SUBJECT,INDUSTRY,SUPPORTED_SERVICES,ORG_NAME,SPEC,PARAMETER,STATUS,DESCP,PROFESSOR_ID,ASCRIPTION,HOPE_PAY_METHOD,COOPERATION_NOTES,PUBLISH_TIME,PAGE_VIEWS,COMP,RESOURCE_TYPE,ORG_ID,SHARE_ID,CREATE_TIME,MODIFY_TIME,SORT_NUM FROM RESOURCE");
1331
        sql.append(" WHERE STATUS='1' AND ((SORT_NUM < ?) OR (SORT_NUM = ? AND PUBLISH_TIME < ?) OR (SORT_NUM=? AND PUBLISH_TIME = ? AND RESOURCE_ID < ?)) ");
1332
        if (key != null) {
1333
            sql.append(" AND (PROFESSOR_ID IN (SELECT ID FROM PROFESSOR WHERE NAME LIKE ?) OR ORG_ID IN (SELECT ID FROM ORGANIZATION WHERE NAME LIKE ? OR FOR_SHORT LIKE ?) OR RESOURCE_NAME LIKE ? OR SUBJECT LIKE ? OR SUPPORTED_SERVICES LIKE ? OR ORG_NAME LIKE ? OR SPEC LIKE ?) ");
1334
        }
1335
        sql.append(" ORDER BY SORT_NUM DESC,PUBLISH_TIME DESC,RESOURCE_ID DESC LIMIT ? ");
1336
        PreparedStatement ps = con.prepareStatement(sql.toString());
1337
        try {
1338
            int index = 1;
1339
            ps.setLong(index++,sortNum);
1340
            ps.setLong(index++,sortNum);
1341
            ps.setString(index++, modifyTime);
1342
            ps.setLong(index++, sortNum);
1343
            ps.setString(index++, modifyTime);
1344
            ps.setString(index++, id);
1345
            if (key != null) {
1346
                ps.setString(index++,key);
1347
                ps.setString(index++,key);
1348
                ps.setString(index++,key);
1349
                ps.setString(index++,key);
1350
                ps.setString(index++,key);
1351
                ps.setString(index++,key);
1352
                ps.setString(index++,key);
1353
                ps.setString(index++,key);
1354
            }
1355
            ps.setInt(index++,rows);
1356
            ResultSet rs = ps.executeQuery();
1357
            try {
1358
                while (rs.next()) {
1359
                    Resource resource =  new Resource();
1360
                    resource.setResourceId(rs.getString(1));
1361
                    resource.setResourceName(rs.getString(2));
1362
                    String subject = rs.getString(3);
1363
                    if(rs.wasNull()){
1364
                        subject = null;
1365
                    }
1366
                    resource.setSubject(subject);
1367
                    String indeustry = rs.getString(4);
1368
                    if(rs.wasNull()){
1369
                        indeustry = null;
1370
                    }
1371
                    resource.setIndustry(indeustry);
1372
                    resource.setSupportedServices(rs.getString(5));
1373
                    String orgName = rs.getString(6);
1374
                    if(rs.wasNull()){
1375
                        orgName = null;
1376
                    }
1377
                    resource.setOrgName(orgName);
1378
                    String spec = rs.getString(7);
1379
                    if(rs.wasNull()){
1380
                        spec = null;
1381
                    }
1382
                    resource.setSpec(spec);
1383
                    String parameter = rs.getString(8);
1384
                    if(rs.wasNull()){
1385
                        parameter = null;
1386
                    }
1387
                    resource.setParameter(parameter);
1388
                    String status = rs.getString(9);
1389
                    if(rs.wasNull()){
1390
                        status = null;
1391
                    }
1392
                    resource.setStatus(status);
1393
                    String descp = rs.getString(10);
1394
                    if(rs.wasNull()){
1395
                        descp = null;
1396
                    }
1397
                    resource.setDescp(descp);
1398
                    String professorId = rs.getString(11);
1399
                    if(rs.wasNull()){
1400
                        professorId = null;
1401
                    }
1402
                    resource.setProfessorId(professorId);
1403
                    String ascription = rs.getString(12);
1404
                    if(rs.wasNull()){
1405
                        ascription = null;
1406
                    }
1407
                    resource.setAscription(ascription);
1408
                    String payMethod = rs.getString(13);
1409
                    if(rs.wasNull()){
1410
                        payMethod = null;
1411
                    }
1412
                    resource.setHopePayMethod(payMethod);
1413
                    String cooperationNotes = rs.getString(14);
1414
                    if(rs.wasNull()){
1415
                        cooperationNotes = null;
1416
                    }
1417
                    resource.setCooperationNotes(cooperationNotes);
1418
                    String publishTime = rs.getString(15);
1419
                    if(rs.wasNull()){
1420
                        publishTime = null;
1421
                    }
1422
                    resource.setPublishTime(publishTime);
1423
                    resource.setPageViews(rs.getInt(16));
1424
                    String comp = rs.getString(17);
1425
                    if(rs.wasNull()){
1426
                        comp = null;
1427
                    }
1428
                    resource.setComp(comp);
1429
                    String resourceType = rs.getString(18);
1430
                    if(rs.wasNull()){
1431
                        resourceType = null;
1432
                    }
1433
                    resource.setResourceType(resourceType);
1434
                    String orgId = rs.getString(19);
1435
                    if(rs.wasNull()){
1436
                        orgId = null;
1437
                    }
1438
                    resource.setOrgId(orgId);
1439
                    resource.setShareId(rs.getLong(20));
1440
                    resource.setCreateTime(rs.getString(21));
1441
                    resource.setModifyTime(rs.getString(22));
1442
                    resource.setSortNum(rs.getInt(23));
1443
                    result.add(resource);
1444
                }
1445
                return result;
1446
            }finally {
1447
                try {
1448
                    rs.close();
1449
                } catch (Exception _m_8) {
1450
                }
1451
            }
1452
        }finally {
1453
            try {
1454
                ps.close();
1455
            } catch (Exception _m_9) {
1456
            }
1457
        }
1458

1459
    }
1340
    @LimitSelect
1341
    @Where("STATUE='1'")
1342
    @OrderBy(cols = {@LimitColumn(value = "sortNum", asc = false, handlerClass = LongHandler.class), @LimitColumn(value = "publishTime", asc = false, handlerClass = StringHandler.class), @LimitColumn(value = "resourceId", asc = false, handlerClass = StringHandler.class)}, value = "")
1343
    public abstract List<Resource> indexSearch(Connection con, @Nullable @GroupSqlColumn(handlerClass = StringHandler.class, value = {"PROFESSOR_ID IN (SELECT ID FROM PROFESSOR WHERE NAME LIKE ?", "ORG_ID IN (SELECT ID FROM ORGANIZATION WHERE NAME LIKE ? OR FOR_SHORT LIKE ?)", "RESOURCE_NAME LIKE ?", "SUBJECT LIKE ?", "SUPPORTED_SERVICES LIKE ?", "ORG_NAME LIKE ?", "SPEC LIKE ?"}, additional = 1, isAnd = false, force = true) String key, long sortNum, String publishTime, String resourceId, int rows) throws SQLException;
1460 1344

1461 1345
    /**
1462 1346
	 * 资源搜索页面接口,添加资源拥有者基本信息

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

@ -885,6 +885,17 @@ public class ArticleService {
885 885
		return this.articleDao.pageQueryProPublish(con, professorId, pageSize, pageNo);
886 886
	}
887 887

888
	@Get
889
	@Path("/publish")
890
	public List<Article> proPublish(@JdbcConn Connection con, String category, String owner, @DefaultValue("\"9\"") String publishTime,@DefaultValue("Long.MAX_VALUE")long shareId, int rows)throws SQLException {
891
		if (category == "1") {
892
			return this.articleDao.proPublish(con, owner, publishTime,shareId, rows);
893
		} else if (category == "2") {
894
			return this.articleDao.orgPublish(con, owner, publishTime,shareId, rows);
895
		}
896
		return null;
897
	}
898

888 899
	@Get
889 900
	@Path("/qaForDesk")
890 901
	public List<Article> queryForDesk(@JdbcConn Connection con, String professorId) throws SQLException {

+ 11 - 0
src/main/java/com/ekexiu/portal/service/PpaperService.java

@ -118,6 +118,17 @@ public class PpaperService {
118 118
		return this.ppaperDao.pageQueryWithProfessor(con, id, name, pageSize, pageNo);
119 119
	}
120 120

121
	@Get
122
	@Path("/professor")
123
	public List<AssedPaper> queryProfessor(@JdbcConn Connection con,String owner,@Nullable String name,@DefaultValue("\"9\"")String assTime,@DefaultValue("\"Z\"")String id,int rows)throws SQLException {
124
		if (name == null) {
125
			name = "%";
126
		} else {
127
			name = "%" + name + "%";
128
		}
129
		return this.ppaperDao.queryProfessor(con, id, name, assTime, id,rows);
130
	}
131

121 132
	@Get
122 133
	@Path("/byAuthor")
123 134
	public PageQueryResult<AssedPaper> queryByAuthor(@JdbcConn Connection con, String author, String id, @Nullable String name,

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

@ -123,6 +123,18 @@ public class PpatentServcie {
123 123
		}
124 124
		return this.ppatentDao.pageQueryWithProfessor(con, id, name, pageSize, pageNo);
125 125
	}
126

127
	@Get
128
	@Path("/professor")
129
	public List<AssedPatent> queryProfessor(@JdbcConn Connection con, String owner, @Nullable String name, @DefaultValue("\"9\"")String assTime, @DefaultValue("\"Z\"")String id, int rows)throws SQLException {
130
		if (name == null) {
131
			name = "%";
132
		} else {
133
			name = "%" + name + "%";
134
		}
135
		return this.ppatentDao.queryProfessor(con, id, name, assTime, id,rows);
136
	}
137

126 138
	@Get
127 139
	@Path("/byAuthor")
128 140
	public PageQueryResult<AssedPatent> queryByAuthor(@JdbcConn Connection con,String author,String id,@Nullable String name,@DefaultValue("10") int pageSize,@DefaultValue("1") int pageNo)throws SQLException{

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

@ -38,6 +38,7 @@ import java.text.SimpleDateFormat;
38 38
import java.util.Collections;
39 39
import java.util.Date;
40 40
import java.util.List;
41
import java.util.Objects;
41 42

42 43
@Path("/resource")
43 44
public class ResourceService {
@ -826,7 +827,18 @@ public class ResourceService {
826 827
		}
827 828
		return resources;
828 829
	}
829
	
830

831
	@Get
832
	@Path("/publish")
833
	List<Resource> queryPublish(@JdbcConn Connection con, String category, String owner, @DefaultValue("\"9\"") String publishTime, int rows) throws SQLException {
834
		if (Objects.equals(category, "1")) {
835
			return this.resourceDao.proPublish(con, owner, publishTime, rows);
836
		} else if (Objects.equals(category, "2")) {
837
			return this.resourceDao.orgPublish(con, owner, publishTime, rows);
838
		}
839
		return null;
840
	}
841

830 842
	@Get
831 843
	@Path("/qaForDesk")
832 844
	public List<Resource> queryForDesk(@JdbcConn Connection con, String professorId) throws SQLException {