ソースを参照

专家个人信息修改页所有跟时间相关的,按时间倒序排序。

zzy.zhiyuan.foxmail 8 年 前
コミット
6b419ac817

+ 2 - 0
src/main/java/com/ekexiu/portal/dao/HonorDao.java

@ -7,6 +7,7 @@ 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.OrderBy;
10 11
import org.jfw.apt.orm.annotation.dao.method.operator.DeleteWith;
11 12
import org.jfw.apt.orm.annotation.dao.method.operator.Insert;
12 13
import org.jfw.apt.orm.annotation.dao.method.operator.SelectList;
@ -24,6 +25,7 @@ public interface HonorDao {
24 25
	int update(Connection con, Honor honor) throws SQLException;
25 26
26 27
	@SelectList
28
	@OrderBy(" ORDER BY YEAR DESC ")
27 29
	List<Honor> query(Connection con, String professorId) throws SQLException;
28 30
29 31
	@Nullable

+ 2 - 0
src/main/java/com/ekexiu/portal/dao/PaperDao.java

@ -7,6 +7,7 @@ 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.OrderBy;
10 11
import org.jfw.apt.orm.annotation.dao.method.operator.DeleteWith;
11 12
import org.jfw.apt.orm.annotation.dao.method.operator.Insert;
12 13
import org.jfw.apt.orm.annotation.dao.method.operator.SelectList;
@ -24,6 +25,7 @@ public interface PaperDao {
24 25
	int update(Connection con,Paper paper) throws SQLException;
25 26
	
26 27
	@SelectList
28
	@OrderBy(" ORDER BY YEAR DESC ")
27 29
	List<Paper> query(Connection con,String professorId) throws SQLException;
28 30
	
29 31
	@Nullable

+ 2 - 0
src/main/java/com/ekexiu/portal/dao/PartTimeJobDao.java

@ -7,6 +7,7 @@ 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.OrderBy;
10 11
import org.jfw.apt.orm.annotation.dao.method.operator.DeleteWith;
11 12
import org.jfw.apt.orm.annotation.dao.method.operator.Insert;
12 13
import org.jfw.apt.orm.annotation.dao.method.operator.SelectList;
@ -24,6 +25,7 @@ public interface PartTimeJobDao {
24 25
	int update(Connection con,PartTimeJob job) throws SQLException;
25 26
	
26 27
	@SelectList
28
	@OrderBy(" ORDER BY STOP_MONTH DESC ")
27 29
	List<PartTimeJob> query(Connection con,String professorId) throws SQLException;
28 30
	
29 31
	@Nullable

+ 2 - 0
src/main/java/com/ekexiu/portal/dao/PatentDao.java

@ -7,6 +7,7 @@ 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.OrderBy;
10 11
import org.jfw.apt.orm.annotation.dao.method.operator.DeleteWith;
11 12
import org.jfw.apt.orm.annotation.dao.method.operator.Insert;
12 13
import org.jfw.apt.orm.annotation.dao.method.operator.SelectList;
@ -23,6 +24,7 @@ public interface PatentDao {
23 24
	int update(Connection con, Patent patent) throws SQLException;
24 25
25 26
	@SelectList
27
	@OrderBy(" ORDER BY YEAR DESC ")
26 28
	List<Patent> query(Connection con, String professorId) throws SQLException;
27 29
28 30
	@Nullable

+ 2 - 0
src/main/java/com/ekexiu/portal/dao/ProfessorEduBgDao.java

@ -7,6 +7,7 @@ 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.OrderBy;
10 11
import org.jfw.apt.orm.annotation.dao.method.operator.DeleteWith;
11 12
import org.jfw.apt.orm.annotation.dao.method.operator.Insert;
12 13
import org.jfw.apt.orm.annotation.dao.method.operator.SelectList;
@ -24,6 +25,7 @@ public interface ProfessorEduBgDao {
24 25
	int update(Connection con,ProfessorEduBg edu) throws SQLException;
25 26
	
26 27
	@SelectList
28
	@OrderBy(" ORDER BY YEAR DESC ")
27 29
	List<ProfessorEduBg> query(Connection con,String professorId) throws SQLException;
28 30
	
29 31
	@Nullable

+ 2 - 0
src/main/java/com/ekexiu/portal/dao/ProjectDao.java

@ -7,6 +7,7 @@ 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.OrderBy;
10 11
import org.jfw.apt.orm.annotation.dao.method.operator.DeleteWith;
11 12
import org.jfw.apt.orm.annotation.dao.method.operator.Insert;
12 13
import org.jfw.apt.orm.annotation.dao.method.operator.SelectList;
@ -23,6 +24,7 @@ public interface ProjectDao {
23 24
	int update(Connection con,Project project) throws SQLException;
24 25
	
25 26
	@SelectList
27
	@OrderBy(" ORDER BY STOP_MONTH DESC ")
26 28
	List<Project> query(Connection con,String professorId) throws SQLException;
27 29
	
28 30
	@Nullable

+ 8 - 4
src/main/java/com/ekexiu/portal/dao/ResourceDao.java

@ -77,6 +77,14 @@ public abstract class ResourceDao {
77 77
	@From(Resource.class)
78 78
	public abstract int updateCooperationNotes(Connection con,String resourceId,@Set String cooperationNotes) throws SQLException;
79 79
	
80
	@DeleteWith
81
	@From(Resource.class)
82
	public abstract int deletePro(Connection con, String professorId) throws SQLException;
83
	
84
	@DeleteWith
85
	@From(Resource.class)
86
	public abstract int delete(Connection con, String resourceId) throws SQLException;
87
	
80 88
	/**
81 89
	 * 查询资源基础信息(ID,名称,学术领域,应用行业,可提供服务,发布者ID,资源图片)
82 90
	 * @param con
@ -453,10 +461,6 @@ public abstract class ResourceDao {
453 461
        }
454 462
    }
455 463
	
456
	@DeleteWith
457
	@From(Resource.class)
458
	public abstract int delete(Connection con, String resourceId) throws SQLException;
459
	
460 464
	/**
461 465
	 * 资源搜索页面接口,添加资源拥有者基本信息
462 466
	 * @param key 搜索条件

+ 4 - 4
src/main/java/com/ekexiu/portal/service/ConsultService.java

@ -122,7 +122,7 @@ public class ConsultService {
122 122
	public PageQueryResult<Consult> queryAssessHis(@JdbcConn Connection con, String professorId,@DefaultValue("5") int pageSize,@DefaultValue("1") int pageNo) throws SQLException {
123 123
		PageQueryResult<Consult> queryResult = this.consultDao.queryAssessHis(con, professorId, pageSize, pageNo);
124 124
		List<Consult> consults = queryResult.getData();
125
		if(consults != null){
125
		if(!consults.isEmpty()){
126 126
			for (Consult consult : consults) {
127 127
				EditProfessor professor = this.professorDao.queryBaseInfo(con, consult.getConsultantId());
128 128
				if(professor != null){
@ -186,7 +186,7 @@ public class ConsultService {
186 186
			@DefaultValue("5") int pageSize, @DefaultValue("1") int pageNo) throws SQLException {
187 187
		PageQueryResult<Consult> queryResult = this.consultDao.queryPageProBase(con, professorId, status, timeType, sortType, pageSize, pageNo);
188 188
		List<Consult> consults = queryResult.getData();
189
		if(consults != null){
189
		if(!consults.isEmpty()){
190 190
			for (Consult consult : consults) {
191 191
				EditProfessor professor = this.professorDao.queryBaseInfo(con, consult.getConsultantId());
192 192
				if(professor!=null){
@ -214,7 +214,7 @@ public class ConsultService {
214 214
			@DefaultValue("5") int pageSize, @DefaultValue("1") int pageNo) throws SQLException {
215 215
		PageQueryResult<Consult> queryResult = this.consultDao.queryPageConBase(con, consultantId, status, timeType, sortType, pageSize, pageNo);
216 216
		List<Consult> consults = queryResult.getData();
217
		if(consults != null){
217
		if(!consults.isEmpty()){
218 218
			for (Consult consult : consults) {
219 219
				EditProfessor professor = this.professorDao.queryBaseInfo(con, consult.getProfessorId());
220 220
				if(professor!=null){
@ -242,7 +242,7 @@ public class ConsultService {
242 242
			@DefaultValue("1") int timeType, @DefaultValue("10") int pageSize, @DefaultValue("1") int pageNo) throws SQLException {
243 243
		PageQueryResult<Consult> queryResult = this.consultDao.queryPageBase(con, professorId, consultOrNeed, consultType, status, timeType, pageSize, pageNo);
244 244
		List<Consult> consults = queryResult.getData();
245
		if(consults != null){
245
		if(!consults.isEmpty()){
246 246
			for (Consult consult : consults) {
247 247
				EditProfessor professor = new EditProfessor();
248 248
				if(0 == consultOrNeed){

+ 6 - 5
src/main/java/com/ekexiu/portal/service/ProfessorService.java

@ -331,7 +331,7 @@ public class ProfessorService {
331 331
	public PageQueryResult<EditProfessor> queryHot(@JdbcConn Connection con,@DefaultValue("8") int pageSize,@DefaultValue("1") int pageNo) throws SQLException {
332 332
		PageQueryResult<EditProfessor> queryResult = this.professorDao.queryHot(con, pageSize, pageNo);
333 333
		List<EditProfessor> professors = queryResult.getData();
334
		if(professors != null){
334
		if(!professors.isEmpty()){
335 335
			for (EditProfessor editProfessor : professors) {
336 336
				editProfessor.setHasHeadImage(this.imageService.hasProfessorImage(editProfessor.getId()));
337 337
				editProfessor.setResearchAreas(this.researchAreaDao.query(con, editProfessor.getId()));
@ -354,7 +354,7 @@ public class ProfessorService {
354 354
		if(null!=address) {address="%"+address+"%";}
355 355
		PageQueryResult<EditProfessor> queryResult = this.professorDao.queryAPP(con,key,subject,industry,province,address,authType,pageSize,pageNo);
356 356
		List<EditProfessor> editProfessors = queryResult.getData();
357
		if(editProfessors != null) {
357
		if(!editProfessors.isEmpty()) {
358 358
			for (EditProfessor editProfessor : editProfessors) {
359 359
				editProfessor.setHasHeadImage(this.imageService.hasProfessorImage(editProfessor.getId()));
360 360
				editProfessor.setResearchAreas(this.researchAreaDao.query(con, editProfessor.getId()));
@ -429,6 +429,7 @@ public class ProfessorService {
429 429
		this.projectDao.delete(con, id);
430 430
		this.watchDao.deletePro(con, id);
431 431
		this.watchDao.deleteWatch(con, id);
432
		this.resourceDao.deletePro(con, id);
432 433
	}
433 434
	
434 435
	@Get
@ -442,7 +443,7 @@ public class ProfessorService {
442 443
		if(null!=address) {address="%"+address+"%";}
443 444
		PageQueryResult<EditProfessor> queryResult = this.professorDao.queryEditBaseInfo(con, key, subject, industry, address, authType, pageSize, pageNo);
444 445
		List<EditProfessor> editProfessors = queryResult.getData();
445
		if(editProfessors != null){
446
		if(!editProfessors.isEmpty()){
446 447
			for (EditProfessor editProfessor : editProfessors) {
447 448
				editProfessor.setHasHeadImage(this.imageService.hasProfessorImage(editProfessor.getId()));
448 449
				editProfessor.setResearchAreas(this.researchAreaDao.query(con, editProfessor.getId()));
@ -481,7 +482,7 @@ public class ProfessorService {
481 482
			info.setPatents(this.patentDao.query(con, id));
482 483
			info.setProjects(this.projectDao.query(con, id));
483 484
			List<EditResearchAreaLog> logs = this.researchAreaLogDao.query(con, id);
484
			if(logs != null){
485
			if(!logs.isEmpty()){
485 486
				for (EditResearchAreaLog log : logs) {
486 487
					log.setHasHeadImage(this.imageService.hasProfessorImage(log.getOpreteProfessorId()));
487 488
				}
@ -489,7 +490,7 @@ public class ProfessorService {
489 490
			info.setEditResearchAreaLogs(logs);
490 491
			info.setResearchAreas(this.researchAreaDao.query(con, id));
491 492
			List<Resource> resources = this.resourceDao.queryPro(con, id);
492
			if(resources != null){
493
			if(!resources.isEmpty()){
493 494
				for (Resource resource : resources) {
494 495
					resource.setImages(this.imageDao.queryRes(con, resource.getResourceId()));
495 496
				}

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

@ -178,7 +178,7 @@ public class ResourceService {
178 178
	public PageQueryResult<Resource> queryPageAll(@JdbcConn Connection con, @DefaultValue("10") int pageSize, @DefaultValue("1") int pageNo) throws SQLException {
179 179
		PageQueryResult<Resource> queryResult = this.resourceDao.queryPageAll(con, pageSize, pageNo);
180 180
		List<Resource> resources = queryResult.getData();
181
		if(resources != null){
181
		if(!resources.isEmpty()){
182 182
			for (Resource resource : resources) {
183 183
				resource.setImages(this.imageDao.queryRes(con, resource.getResourceId()));
184 184
			}
@ -191,7 +191,7 @@ public class ResourceService {
191 191
	@Path("/qapro")
192 192
	public List<Resource> queryPro(@JdbcConn Connection con, String professorId) throws SQLException {
193 193
		List<Resource> resources = this.resourceDao.queryPro(con, professorId);
194
		if(resources != null) {
194
		if(!resources.isEmpty()) {
195 195
			for (Resource resource : resources) {
196 196
				resource.setImages(this.imageDao.queryRes(con, resource.getResourceId()));
197 197
			}
@ -262,7 +262,7 @@ public class ResourceService {
262 262
		if(address!=null)address="%"+address+"%";
263 263
		PageQueryResult<Resource> queryResult =  this.resourceDao.queryPageRes(con, key, subject, industry, province, address, authType, pageSize, pageNo);
264 264
		List<Resource> resources = queryResult.getData();
265
		if(resources != null){
265
		if(!resources.isEmpty()){
266 266
			for (Resource resource : resources) {
267 267
				resource.setProfessor(this.professorDao.queryBaseInfo(con, resource.getProfessorId()));
268 268
				resource.setImages(this.imageDao.queryRes(con, resource.getResourceId()));
@ -282,7 +282,7 @@ public class ResourceService {
282 282
		if(address!=null)address="%"+address+"%";
283 283
		PageQueryResult<Resource> queryResult = this.resourceDao.queryPage(con, key, subject, industry, address, authType, pageSize, pageNo);
284 284
		List<Resource> resources = queryResult.getData();
285
		if(resources != null){
285
		if(!resources.isEmpty()){
286 286
			for (Resource resource : resources) {
287 287
				resource.setImages(this.imageDao.queryRes(con, resource.getResourceId()));
288 288
			}