Ver Código Fonte

searchForTeam

XMTT 5 anos atrás
pai
commit
4f0d762f53

+ 5 - 0
src/main/java/com/ekexiu/portal/dao/PpaperDao.java

95
	@OrderBy(cols = {@LimitColumn(value = "sortNum", asc = false, handlerClass = LongHandler.class), @LimitColumn(value = "createTime", asc = false), @LimitColumn(value = "id", asc = false)}, value = "")
95
	@OrderBy(cols = {@LimitColumn(value = "sortNum", asc = false, handlerClass = LongHandler.class), @LimitColumn(value = "createTime", asc = false), @LimitColumn(value = "id", asc = false)}, value = "")
96
	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;
96
	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;
97

97

98
	@LimitSelect
99
	@Exclude("summary")
100
	@OrderBy(cols = {@LimitColumn(value = "sortNum", asc = false, handlerClass = LongHandler.class), @LimitColumn(value = "createTime", asc = false), @LimitColumn(value = "id", asc = false)}, value = "")
101
	public abstract List<Ppaper> searchForTeam(Connection con,@Nullable @GroupSqlColumn(handlerClass = StringHandler.class, value = {"EN4PERIODICAL LIKE ?", "CN4PERIODICAL LIKE ?", "KEYWORDS LIKE ?", "AUTHORS LIKE ?", "NAME LIKE ?"}, isAnd = false) String key,@SqlColumn(handlerClass = StringHandler.class,value = "ID NOT IN (SELECT PAPER FROM TEAM_PAPER WHERE ID = ?)")String team, long sortNum, String createTime, String id, int rows) throws SQLException;
102

98
	@SelectOne
103
	@SelectOne
99
	@Nullable
104
	@Nullable
100
	public abstract Ppaper query(Connection con,long shareId)throws SQLException;
105
	public abstract Ppaper query(Connection con,long shareId)throws SQLException;

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

97
	@OrderBy(cols = {@LimitColumn(value = "sortNum", handlerClass = LongHandler.class, asc = false), @LimitColumn(value = "createTime", asc = false), @LimitColumn(value = "id", asc = false)}, value = "")
97
	@OrderBy(cols = {@LimitColumn(value = "sortNum", handlerClass = LongHandler.class, asc = false), @LimitColumn(value = "createTime", asc = false), @LimitColumn(value = "id", asc = false)}, value = "")
98
	public abstract List<Ppatent> indexSearch(Connection con, @Nullable @GroupSqlColumn(handlerClass = StringHandler.class, value = {"REQ_PERSON LIKE ?", "KEYWORDS LIKE ?", "NAME LIKE ?", "AUTHORS LIKE ?", "CODE LIKE ?"},isAnd = false) String key, long sortNum, String createTime, String id, int rows) throws SQLException;
98
	public abstract List<Ppatent> indexSearch(Connection con, @Nullable @GroupSqlColumn(handlerClass = StringHandler.class, value = {"REQ_PERSON LIKE ?", "KEYWORDS LIKE ?", "NAME LIKE ?", "AUTHORS LIKE ?", "CODE LIKE ?"},isAnd = false) String key, long sortNum, String createTime, String id, int rows) throws SQLException;
99

99

100
	@Exclude("summary")
101
	@LimitSelect
102
	@OrderBy(cols = {@LimitColumn(value = "sortNum", handlerClass = LongHandler.class, asc = false), @LimitColumn(value = "createTime", asc = false), @LimitColumn(value = "id", asc = false)}, value = "")
103
	public abstract List<Ppatent> searchForTeam(Connection con, @Nullable @GroupSqlColumn(handlerClass = StringHandler.class, value = {"REQ_PERSON LIKE ?", "KEYWORDS LIKE ?", "NAME LIKE ?", "AUTHORS LIKE ?", "CODE LIKE ?"},isAnd = false) String key,@SqlColumn(handlerClass = StringHandler.class,value = "ID NOT IN (SELECT PATENT FROM TEAM_PATENT WHERE ID = ?)")String team, long sortNum, String createTime, String id, int rows) throws SQLException;
104

100
	@SelectOne
105
	@SelectOne
101
	@Nullable
106
	@Nullable
102
	public abstract Ppatent query(Connection con, long shareId) throws SQLException;
107
	public abstract Ppatent query(Connection con, long shareId) throws SQLException;

+ 8 - 0
src/main/java/com/ekexiu/portal/dao/ProfessorDao.java

1418
			"P.NAME LIKE ?", "O.NAME LIKE ?", "P.DEPARTMENT LIKE ?", "P.DESCP LIKE ?", "P.SUBJECT LIKE ?", "P.INDUSTRY LIKE ?", "P.ID IN (SELECT DISTINCT PROFESSOR_ID FROM RESEARCH_AREA WHERE CAPTION LIKE ?)", "P.ID IN (SELECT DISTINCT PROFESSOR_ID FROM RESOURCE WHERE RESOURCE_NAME LIKE ?)", "P.ID IN (SELECT DISTINCT OWNER_ID FROM ARTICLE WHERE ARTICLE_TYPE='1' AND ARTICLE_TITLE LIKE ?)", "P.ID IN (SELECT DISTINCT PROFESSOR_ID FROM PAPER_AUTHOR WHERE PAPER_ID IN (SELECT ID FROM PPAPER WHERE NAME LIKE ?))", "P.ID IN (SELECT DISTINCT PROFESSOR_ID FROM PATENT_AUTHOR WHERE PATENT_ID IN (SELECT ID FROM PPATENT WHERE NAME LIKE ?))"
1418
			"P.NAME LIKE ?", "O.NAME LIKE ?", "P.DEPARTMENT LIKE ?", "P.DESCP LIKE ?", "P.SUBJECT LIKE ?", "P.INDUSTRY LIKE ?", "P.ID IN (SELECT DISTINCT PROFESSOR_ID FROM RESEARCH_AREA WHERE CAPTION LIKE ?)", "P.ID IN (SELECT DISTINCT PROFESSOR_ID FROM RESOURCE WHERE RESOURCE_NAME LIKE ?)", "P.ID IN (SELECT DISTINCT OWNER_ID FROM ARTICLE WHERE ARTICLE_TYPE='1' AND ARTICLE_TITLE LIKE ?)", "P.ID IN (SELECT DISTINCT PROFESSOR_ID FROM PAPER_AUTHOR WHERE PAPER_ID IN (SELECT ID FROM PPAPER WHERE NAME LIKE ?))", "P.ID IN (SELECT DISTINCT PROFESSOR_ID FROM PATENT_AUTHOR WHERE PATENT_ID IN (SELECT ID FROM PPATENT WHERE NAME LIKE ?))"
1419
	}, handlerClass = StringHandler.class, isAnd = false) String key, @Nullable @Like String subject, @Nullable @Like String industry, @Nullable @Like String address, @Nullable Integer authType, int rows) throws SQLException;
1419
	}, handlerClass = StringHandler.class, isAnd = false) String key, @Nullable @Like String subject, @Nullable @Like String industry, @Nullable @Like String address, @Nullable Integer authType, int rows) throws SQLException;
1420

1420

1421
	@LimitQuery
1422
	@OrderBy("ORDER BY sort_desc DESC ")
1423
	public abstract List<SortedPro> teamSearch(Connection con,
1424
												@SqlColumn(handlerClass = StringHandler.class, value = {"(case when sort_first=0 then '00000' else TO_CHAR(sort_first,'00009') end || TO_CHAR(CEIL(star_level * 100),'0009') || p.id )< ? "}) String sortDesc, @Nullable @GroupSqlColumn(value = {
1425
			"P.NAME LIKE ?", "O.NAME LIKE ?", "P.DEPARTMENT LIKE ?", "P.DESCP LIKE ?", "P.SUBJECT LIKE ?", "P.INDUSTRY LIKE ?", "P.ID IN (SELECT DISTINCT PROFESSOR_ID FROM RESEARCH_AREA WHERE CAPTION LIKE ?)", "P.ID IN (SELECT DISTINCT PROFESSOR_ID FROM RESOURCE WHERE RESOURCE_NAME LIKE ?)", "P.ID IN (SELECT DISTINCT OWNER_ID FROM ARTICLE WHERE ARTICLE_TYPE='1' AND ARTICLE_TITLE LIKE ?)", "P.ID IN (SELECT DISTINCT PROFESSOR_ID FROM PAPER_AUTHOR WHERE PAPER_ID IN (SELECT ID FROM PPAPER WHERE NAME LIKE ?))", "P.ID IN (SELECT DISTINCT PROFESSOR_ID FROM PATENT_AUTHOR WHERE PATENT_ID IN (SELECT ID FROM PPATENT WHERE NAME LIKE ?))"
1426
	}, handlerClass = StringHandler.class, isAnd = false) String key,@Nullable @SqlColumn(handlerClass = StringHandler.class,value = "ID NOT IN (SELECT PROFESSOR FROM TEAM_PRO WHERE ID = ?)") String team, @Nullable Integer authType, int rows) throws SQLException;
1427

1428

1421
	/**
1429
	/**
1422
	 * 分页查询专家基础信息,多条件查询专家列表。
1430
	 * 分页查询专家基础信息,多条件查询专家列表。
1423
	 * 
1431
	 * 

+ 4 - 0
src/main/java/com/ekexiu/portal/resResult/ResearchResultDao.java

53
    @OrderBy("ORDER BY CREATE_TIME DESC")
53
    @OrderBy("ORDER BY CREATE_TIME DESC")
54
    PageQueryResult<ResearchResult> pageQuery(Connection con, @Nullable @In String[] status, @Nullable @GroupSqlColumn(handlerClass = StringHandler.class, value = {"name like ?", "ID IN (SELECT ID FROM RESEARCHER WHERE NAME LIKE ?)", "SUBJECT LIKE ?", "INDUSTRY LIKE ?"}, isAnd = false) String key, int pageSize, int pageNo) throws SQLException;
54
    PageQueryResult<ResearchResult> pageQuery(Connection con, @Nullable @In String[] status, @Nullable @GroupSqlColumn(handlerClass = StringHandler.class, value = {"name like ?", "ID IN (SELECT ID FROM RESEARCHER WHERE NAME LIKE ?)", "SUBJECT LIKE ?", "INDUSTRY LIKE ?"}, isAnd = false) String key, int pageSize, int pageNo) throws SQLException;
55
55
56
    @PageQuery
57
    @OrderBy("ORDER BY CREATE_TIME DESC")
58
    PageQueryResult<ResearchResult> searchForTeam(Connection con, @Nullable @In String[] status, @Nullable @GroupSqlColumn(handlerClass = StringHandler.class, value = {"name like ?", "ID IN (SELECT ID FROM RESEARCHER WHERE NAME LIKE ?)", "SUBJECT LIKE ?", "INDUSTRY LIKE ?"}, isAnd = false) String key,@SqlColumn(handlerClass = StringHandler.class,value = "ID NOT IN (SELECT RESEARCH_RESULT FROM TEAM_RES_RESULT WHERE ID = ?)")String team, int pageSize, int pageNo) throws SQLException;
59
56
    @PageQuery
60
    @PageQuery
57
    @OrderBy("ORDER BY PAGE_VIEWS DESC")
61
    @OrderBy("ORDER BY PAGE_VIEWS DESC")
58
    PageQueryResult<ResearchResult> pqByPageViews(Connection con, @Nullable @In String[] status, @Nullable @GroupSqlColumn(handlerClass = StringHandler.class, value = {"name like ?", "ID IN (SELECT ID FROM RESEARCHER WHERE NAME LIKE ?)", "SUBJECT LIKE ?", "INDUSTRY LIKE ?"}, isAnd = false) String key, int pageSize, int pageNo) throws SQLException;
62
    PageQueryResult<ResearchResult> pqByPageViews(Connection con, @Nullable @In String[] status, @Nullable @GroupSqlColumn(handlerClass = StringHandler.class, value = {"name like ?", "ID IN (SELECT ID FROM RESEARCHER WHERE NAME LIKE ?)", "SUBJECT LIKE ?", "INDUSTRY LIKE ?"}, isAnd = false) String key, int pageSize, int pageNo) throws SQLException;

+ 110 - 0
src/main/java/com/ekexiu/portal/team/TeamService.java

1
package com.ekexiu.portal.team;
1
package com.ekexiu.portal.team;
2
2
3
import com.ekexiu.portal.dao.PpaperDao;
4
import com.ekexiu.portal.dao.PpatentDao;
5
import com.ekexiu.portal.dao.ProfessorDao;
3
import com.ekexiu.portal.dao.WatchDao;
6
import com.ekexiu.portal.dao.WatchDao;
7
import com.ekexiu.portal.po.Ppaper;
8
import com.ekexiu.portal.po.Ppatent;
9
import com.ekexiu.portal.pojo.SortedPro;
10
import com.ekexiu.portal.resResult.ResearchResult;
11
import com.ekexiu.portal.resResult.ResearchResultDao;
12
import com.ekexiu.portal.service.ImageService;
4
import com.ekexiu.portal.service.KeyWordService;
13
import com.ekexiu.portal.service.KeyWordService;
14
import com.ekexiu.portal.service.ProfessorService;
5
import org.jfw.apt.annotation.Autowrie;
15
import org.jfw.apt.annotation.Autowrie;
16
import org.jfw.apt.annotation.DefaultValue;
6
import org.jfw.apt.annotation.Nullable;
17
import org.jfw.apt.annotation.Nullable;
7
import org.jfw.apt.web.annotation.Path;
18
import org.jfw.apt.web.annotation.Path;
8
import org.jfw.apt.web.annotation.operate.Get;
19
import org.jfw.apt.web.annotation.operate.Get;
51
    @Autowrie
62
    @Autowrie
52
    private WatchDao watchDao;
63
    private WatchDao watchDao;
53
64
65
    @Autowrie
66
    private ProfessorDao professorDao;
67
68
    @Autowrie
69
    private ImageService imageService;
70
71
    @Autowrie
72
    private ResearchResultDao researchResultDao;
73
74
    @Autowrie
75
    private PpatentDao ppatentDao;
76
77
    @Autowrie
78
    private PpaperDao ppaperDao;
54
    public TeamDao getTeamDao() {
79
    public TeamDao getTeamDao() {
55
        return teamDao;
80
        return teamDao;
56
    }
81
    }
95
        this.watchDao = watchDao;
120
        this.watchDao = watchDao;
96
    }
121
    }
97
122
123
    public ProfessorDao getProfessorDao() {
124
        return professorDao;
125
    }
126
127
    public void setProfessorDao(ProfessorDao professorDao) {
128
        this.professorDao = professorDao;
129
    }
130
131
    public ImageService getImageService() {
132
        return imageService;
133
    }
134
135
    public void setImageService(ImageService imageService) {
136
        this.imageService = imageService;
137
    }
138
139
    public ResearchResultDao getResearchResultDao() {
140
        return researchResultDao;
141
    }
142
143
    public void setResearchResultDao(ResearchResultDao researchResultDao) {
144
        this.researchResultDao = researchResultDao;
145
    }
146
147
    public PpatentDao getPpatentDao() {
148
        return ppatentDao;
149
    }
150
151
    public void setPpatentDao(PpatentDao ppatentDao) {
152
        this.ppatentDao = ppatentDao;
153
    }
154
155
    public PpaperDao getPpaperDao() {
156
        return ppaperDao;
157
    }
158
159
    public void setPpaperDao(PpaperDao ppaperDao) {
160
        this.ppaperDao = ppaperDao;
161
    }
162
98
    /**
163
    /**
99
     * 上传文件
164
     * 上传文件
100
     *
165
     *
219
        return teamDao.queryPro(con, id, pageSize, pageNo);
284
        return teamDao.queryPro(con, id, pageSize, pageNo);
220
    }
285
    }
221
286
287
    @Get
288
    @Path("/pro/search")
289
    public List<SortedPro> proSearch(@JdbcConn(false) Connection con, @Nullable String key,String team, @Nullable Integer authType, @DefaultValue("99999") int sortFirst, @DefaultValue("\"Z\"")String id, @DefaultValue("0")double starLevel, @DefaultValue("10000000") int rows)
290
            throws SQLException {
291
        if (key != null) {
292
            key = "%" + key + "%";
293
        }
294
        String sortDesc = "000000"+ sortFirst;
295
        String a =  "0000" + (int)(starLevel*100);
296
        sortDesc = sortDesc.substring(sortDesc.length()-5)+a.substring(a.length()-4)+id;
297
        List<SortedPro> queryResult = this.professorDao.teamSearch(con,sortDesc, key,team, authType,rows );
298
        if (!queryResult.isEmpty()) {
299
            for (SortedPro editProfessor : queryResult) {
300
                editProfessor.setHasHeadImage(this.imageService.hasProfessorImage(editProfessor.getId()));
301
            }
302
            ProfessorService.hiddenPrivacyInfo(queryResult);
303
        }
304
        return queryResult;
305
    }
306
222
    @Get
307
    @Get
223
    @Path("/patent")
308
    @Path("/patent")
224
    public PageQueryResult<TeamPatent> queryPatent(@JdbcConn Connection con,String id,int pageSize,int pageNo)throws SQLException {
309
    public PageQueryResult<TeamPatent> queryPatent(@JdbcConn Connection con,String id,int pageSize,int pageNo)throws SQLException {
225
        return teamDao.queryPatent(con, id, pageSize, pageNo);
310
        return teamDao.queryPatent(con, id, pageSize, pageNo);
226
    }
311
    }
227
312
313
    @Get
314
    @Path("/patent/search")
315
    public List<Ppatent> patentSearch(@JdbcConn Connection con, @Nullable String key, String team,@DefaultValue("Long.MAX_VALUE") long sortNum, @DefaultValue("\"9\"") String createTime, @DefaultValue("\"G\"")String id, @DefaultValue("10000000") int rows)throws SQLException {
316
        if (key != null) {
317
            key = "%" + key + "%";
318
        }
319
        return this.ppatentDao.searchForTeam(con, key,team, sortNum, createTime,id, rows);
320
    }
321
228
    @Get
322
    @Get
229
    @Path("/paper")
323
    @Path("/paper")
230
    public PageQueryResult<TeamPaper> queryPaper(@JdbcConn Connection con,String id,int pageSize,int pageNo)throws SQLException {
324
    public PageQueryResult<TeamPaper> queryPaper(@JdbcConn Connection con,String id,int pageSize,int pageNo)throws SQLException {
231
        return teamDao.queryPaper(con, id, pageSize, pageNo);
325
        return teamDao.queryPaper(con, id, pageSize, pageNo);
232
    }
326
    }
233
327
328
    @Get
329
    @Path("/paper/search")
330
    public List<Ppaper> paperSearch(@JdbcConn Connection con, @Nullable String key,String team, @DefaultValue("Long.MAX_VALUE") long sortNum, @DefaultValue("\"9\"") String createTime, @DefaultValue("\"G\"")String id, @DefaultValue("10000000") int rows)throws SQLException {
331
        if (key != null) {
332
            key = "%" + key + "%";
333
        }
334
        return this.ppaperDao.searchForTeam(con, key,team, sortNum, createTime, id, rows);
335
336
    }
337
234
    @Get
338
    @Get
235
    @Path("/resResult")
339
    @Path("/resResult")
236
    public PageQueryResult<TeamResResult> queryResResult(@JdbcConn Connection con,String id,int pageSize,int pageNo)throws SQLException {
340
    public PageQueryResult<TeamResResult> queryResResult(@JdbcConn Connection con,String id,int pageSize,int pageNo)throws SQLException {
237
        return teamDao.queryResResult(con, id, pageSize, pageNo);
341
        return teamDao.queryResResult(con, id, pageSize, pageNo);
238
    }
342
    }
239
343
344
    @Get
345
    @Path("/resResult/search")
346
    public PageQueryResult<ResearchResult> resResultSearch(@JdbcConn Connection con, @Nullable String[] status,String team, @Nullable String key, int pageSize, int pageNo) throws SQLException {
347
        return researchResultDao.searchForTeam(con, status, key == null ? null : "%" + key + "%",team, pageSize, pageNo);
348
    }
349
240
    @Post
350
    @Post
241
    @Path("/deletePro")
351
    @Path("/deletePro")
242
    public void deletePro(@JdbcConn(true) Connection con,String id,String professor)throws SQLException {
352
    public void deletePro(@JdbcConn(true) Connection con,String id,String professor)throws SQLException {