jiapeng 7 years ago
parent
commit
d66d1e19f5
1 changed files with 21 additions and 4 deletions
  1. 21 4
      src/main/java/com/ekexiu/portal/service/ProfessorService.java

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

@ -28,6 +28,7 @@ import org.jfw.apt.web.annotation.param.RequestBody;
28 28
import org.jfw.util.PageQueryResult;
29 29
import org.jfw.util.StringUtil;
30 30
import org.jfw.util.jdbc.JdbcUtil;
31
import org.jfw.util.jdbc.PreparedStatementConfig;
31 32

32 33
import com.ekexiu.portal.dao.ArticleDao;
33 34
import com.ekexiu.portal.dao.DemandDao;
@ -726,8 +727,8 @@ public class ProfessorService {
726 727

727 728
	@Get
728 729
	@Path("/pqBaseInfo")
729
	PageQueryResult<EditProfessor> queryEditBaseInfo(@JdbcConn(false) Connection con, @Nullable String key, @Nullable String subject, @Nullable String industry,
730
			@Nullable String address, @Nullable Integer authType, @DefaultValue("10") int pageSize, @DefaultValue("1") int pageNo)
730
	public PageQueryResult<EditProfessor> queryEditBaseInfo(@JdbcConn(false) Connection con, @Nullable String key, @Nullable String subject,
731
			@Nullable String industry, @Nullable String address, @Nullable Integer authType, @DefaultValue("10") int pageSize, @DefaultValue("1") int pageNo)
731 732
			throws SQLException {
732 733
		if (key != null) {
733 734
			key = "%" + key + "%";
@ -756,7 +757,7 @@ public class ProfessorService {
756 757

757 758
	@Get
758 759
	@Path("/pqUserInfo")
759
	PageQueryResult<UserInfo> queryUserInfo(@JdbcConn(false) Connection con, @Nullable String key, @Nullable String address, @Nullable String orgName,
760
	public PageQueryResult<UserInfo> queryUserInfo(@JdbcConn(false) Connection con, @Nullable String key, @Nullable String address, @Nullable String orgName,
760 761
			@Nullable Integer activeState, @Nullable Integer authType, @DefaultValue("20") int pageSize, @DefaultValue("1") int pageNo) throws SQLException {
761 762
		if (key != null) {
762 763
			key = "%" + key + "%";
@ -772,7 +773,7 @@ public class ProfessorService {
772 773

773 774
	@Get
774 775
	@Path("/pq")
775
	PageQueryResult<Professor> query(@JdbcConn(false) Connection con, @Nullable String key, @Nullable String subject, @Nullable String industry,
776
	public PageQueryResult<Professor> query(@JdbcConn(false) Connection con, @Nullable String key, @Nullable String subject, @Nullable String industry,
776 777
			@Nullable String address, @DefaultValue("10") int pageSize, @DefaultValue("1") int pageNo) throws SQLException {
777 778
		// System.out.println("key==["+(key==null?"":key)+"]");
778 779
		// System.out.println("subject==["+(subject==null?"":subject)+"]");
@ -788,6 +789,22 @@ public class ProfessorService {
788 789
		return this.professorDao.query(con, key, subject, industry, address, pageSize, pageNo);
789 790
	}
790 791

792
	@Get
793
	@Path("/agree/sum")
794
	public long agreeSum(@JdbcConn Connection con, final String id) throws SQLException {
795
		return JdbcUtil.queryLong(con,
796
				" select SUM(agree) from (SELECT article_agree agree FROM ARTICLE WHERE STATUS ='1' AND professor_id =? UNION ALL SELECT AGREE FROM ANSWER WHERE STATE='1' AND UID =? ) t",
797
				new PreparedStatementConfig() {
798
					@Override
799
					public void config(PreparedStatement ps) throws SQLException {
800
						ps.setString(1, id);
801
						ps.setString(2, id);
802

803
					}
804
				}, 0);
805

806
	}
807

791 808
	@Get
792 809
	@Path("/editInfo/{id}")
793 810
	public ProfessorInfo editInfo(@JdbcConn(false) Connection con, @PathVar String id) throws SQLException {