|
@ -41,7 +41,8 @@ public abstract class ProfessorDao {
|
41
|
41
|
|
42
|
42
|
@UpdateWith
|
43
|
43
|
@From(Professor.class)
|
44
|
|
public abstract int updateAuthentication(Connection con, String id, @Set boolean authentication) throws SQLException;
|
|
44
|
public abstract int updateAuthentication(Connection con, String id, @Set Integer authentication,
|
|
45
|
@Set Integer authType) throws SQLException;
|
45
|
46
|
|
46
|
47
|
@UpdateWith
|
47
|
48
|
@From(Professor.class)
|
|
@ -49,7 +50,7 @@ public abstract class ProfessorDao {
|
49
|
50
|
|
50
|
51
|
@UpdateWith
|
51
|
52
|
@From(Professor.class)
|
52
|
|
public abstract int updateConsultCount(Connection con, String id, @Set int consultCount) throws SQLException;
|
|
53
|
public abstract int updateConsultCount(Connection con, String id, @Set Integer consultCount) throws SQLException;
|
53
|
54
|
|
54
|
55
|
@UpdateWith
|
55
|
56
|
@From(Professor.class)
|
|
@ -108,7 +109,7 @@ public abstract class ProfessorDao {
|
108
|
109
|
title = null;
|
109
|
110
|
}
|
110
|
111
|
professor.setTitle(title);
|
111
|
|
professor.setAuthentication("1".equals(rs.getString(4)));
|
|
112
|
professor.setAuthentication(rs.getInt(4));
|
112
|
113
|
professor.setId(rs.getString(5));
|
113
|
114
|
professor.setName(rs.getString(6));
|
114
|
115
|
String address = rs.getString(7);
|
|
@ -163,7 +164,7 @@ public abstract class ProfessorDao {
|
163
|
164
|
title = null;
|
164
|
165
|
}
|
165
|
166
|
professor.setTitle(title);
|
166
|
|
professor.setAuthentication("1".equals(rs.getString(4)));
|
|
167
|
professor.setAuthentication(rs.getInt(4));
|
167
|
168
|
professor.setId(rs.getString(5));
|
168
|
169
|
professor.setName(rs.getString(6));
|
169
|
170
|
String address = rs.getString(7);
|
|
@ -188,7 +189,9 @@ public abstract class ProfessorDao {
|
188
|
189
|
|
189
|
190
|
public Professor query(Connection con, String id) throws SQLException{
|
190
|
191
|
int _m_1 = 1;
|
191
|
|
String sql = "SELECT P.OFFICE,P.SUBJECT,P.INDUSTRY,P.ADDRESS,P.DEPARTMENT,ORG_ID,P.TITLE,AUTHENTICATION,P.ID,P.NAME,P.DESCP,P.CREATE_TIME,P.MODIFY_TIME,ORGANIZATION.NAME FROM PROFESSOR P LEFT JOIN ORGANIZATION ON P.ORG_ID = ORGANIZATION.ID WHERE P.ID = ?";
|
|
192
|
String sql = "SELECT P.OFFICE,P.SUBJECT,P.INDUSTRY,P.ADDRESS,P.DEPARTMENT,ORG_ID,P.TITLE,"
|
|
193
|
+ "AUTHENTICATION,P.ID,P.NAME,P.DESCP,P.CREATE_TIME,P.MODIFY_TIME,ORGANIZATION.NAME "
|
|
194
|
+ "FROM PROFESSOR P LEFT JOIN ORGANIZATION ON P.ORG_ID = ORGANIZATION.ID WHERE P.ID = ?";
|
192
|
195
|
PreparedStatement ps = con.prepareStatement(sql);
|
193
|
196
|
try{
|
194
|
197
|
ps.setString(_m_1++,id);
|
|
@ -228,7 +231,7 @@ public abstract class ProfessorDao {
|
228
|
231
|
_m_7 = null;
|
229
|
232
|
}
|
230
|
233
|
_result.setTitle(_m_7);
|
231
|
|
_result.setAuthentication("1".equals(rs.getString(8)));
|
|
234
|
_result.setAuthentication(rs.getInt(8));
|
232
|
235
|
_result.setId(rs.getString(9));
|
233
|
236
|
_result.setName(rs.getString(10));
|
234
|
237
|
String _m_8 = rs.getString(11);
|
|
@ -288,7 +291,7 @@ public abstract class ProfessorDao {
|
288
|
291
|
organization.setName(rs.getString(7));
|
289
|
292
|
_obj.setOrganization(organization);
|
290
|
293
|
_obj.setTitle(rs.getString(8));
|
291
|
|
_obj.setAuthentication("1".equals(rs.getString(9)));
|
|
294
|
_obj.setAuthentication(rs.getInt(9));
|
292
|
295
|
_obj.setId(rs.getString(10));
|
293
|
296
|
_obj.setName(rs.getString(11));
|
294
|
297
|
String _m_4 = rs.getString(12);
|
|
@ -453,7 +456,7 @@ public abstract class ProfessorDao {
|
453
|
456
|
public PageQueryResult<EditProfessor> queryHot(Connection con, int pageSize, int pageNo) throws SQLException {
|
454
|
457
|
PageQueryResult<EditProfessor> _result = new PageQueryResult<EditProfessor>();
|
455
|
458
|
StringBuilder sql = new StringBuilder();
|
456
|
|
sql.append(" WHERE AUTHENTICATION = '1' ");
|
|
459
|
sql.append(" WHERE AUTH_TYPE = 1 ");
|
457
|
460
|
StringBuilder whereSql = sql;
|
458
|
461
|
sql = new StringBuilder();
|
459
|
462
|
sql.append("SELECT COUNT(1) FROM PROFESSOR");
|
|
@ -539,7 +542,7 @@ public abstract class ProfessorDao {
|
539
|
542
|
title = null;
|
540
|
543
|
}
|
541
|
544
|
professor.setTitle(title);
|
542
|
|
professor.setAuthentication("1".equals(rs.getString(4)));
|
|
545
|
professor.setAuthentication(rs.getInt(4));
|
543
|
546
|
professor.setId(rs.getString(5));
|
544
|
547
|
professor.setName(rs.getString(6));
|
545
|
548
|
professor.setOrgId(rs.getString(7));
|
|
@ -576,7 +579,7 @@ public abstract class ProfessorDao {
|
576
|
579
|
* @throws SQLException
|
577
|
580
|
*/
|
578
|
581
|
public PageQueryResult<EditProfessor> queryAPP(Connection con, @Nullable String key, String subject, String industry,
|
579
|
|
String province, String address, @Nullable Integer authentication, int pageSize, int pageNo) throws SQLException {
|
|
582
|
String province, String address, Integer authType, int pageSize, int pageNo) throws SQLException {
|
580
|
583
|
PageQueryResult<EditProfessor> _result = new PageQueryResult<EditProfessor>();
|
581
|
584
|
StringBuilder sql = new StringBuilder();
|
582
|
585
|
boolean hasKey = null != key;
|
|
@ -590,7 +593,7 @@ public abstract class ProfessorDao {
|
590
|
593
|
boolean hasIndustry = null != industry;
|
591
|
594
|
boolean hasProvince = null != province;
|
592
|
595
|
boolean hasAddress = null != address;
|
593
|
|
boolean hasAuth = null != authentication;
|
|
596
|
boolean hasAuthType = null != authType;
|
594
|
597
|
if (hasSubject) {
|
595
|
598
|
sql.append(sql.length() > 0 ? " AND " : " WHERE ").append("(SUBJECT LIKE ?)");
|
596
|
599
|
}
|
|
@ -603,12 +606,8 @@ public abstract class ProfessorDao {
|
603
|
606
|
if (hasAddress) {
|
604
|
607
|
sql.append(sql.length() > 0 ? " AND " : " WHERE ").append("(ADDRESS LIKE ?)");
|
605
|
608
|
}
|
606
|
|
if (hasAuth) {
|
607
|
|
if(0 == authentication){
|
608
|
|
sql.append(sql.length() > 0 ? " AND " : " WHERE ").append("(AUTHENTICATION = '0')");
|
609
|
|
}else if(1 == authentication){
|
610
|
|
sql.append(sql.length() > 0 ? " AND " : " WHERE ").append("(AUTHENTICATION = '1')");
|
611
|
|
}
|
|
609
|
if (hasAuthType) {
|
|
610
|
sql.append(sql.length() > 0 ? " AND " : " WHERE ").append("(AUTH_TYPE = ?)");
|
612
|
611
|
}
|
613
|
612
|
StringBuilder whereSql = sql;
|
614
|
613
|
sql = new StringBuilder();
|
|
@ -642,6 +641,9 @@ public abstract class ProfessorDao {
|
642
|
641
|
if (hasAddress) {
|
643
|
642
|
ps.setString(paramIndex++, address);
|
644
|
643
|
}
|
|
644
|
if (hasAuthType) {
|
|
645
|
ps.setInt(paramIndex++, authType);
|
|
646
|
}
|
645
|
647
|
_result.setPageSize(pageSize);
|
646
|
648
|
ResultSet _pageRs = ps.executeQuery();
|
647
|
649
|
try {
|
|
@ -720,7 +722,10 @@ public abstract class ProfessorDao {
|
720
|
722
|
if (hasAddress) {
|
721
|
723
|
ps.setString(paramIndex++, address);
|
722
|
724
|
}
|
723
|
|
java.sql.ResultSet rs = ps.executeQuery();
|
|
725
|
if (hasAuthType) {
|
|
726
|
ps.setInt(paramIndex++, authType);
|
|
727
|
}
|
|
728
|
ResultSet rs = ps.executeQuery();
|
724
|
729
|
try {
|
725
|
730
|
List<EditProfessor> _m_11 = new ArrayList<EditProfessor>();
|
726
|
731
|
_result.setData(_m_11);
|
|
@ -741,7 +746,7 @@ public abstract class ProfessorDao {
|
741
|
746
|
title = null;
|
742
|
747
|
}
|
743
|
748
|
professor.setTitle(title);
|
744
|
|
professor.setAuthentication("1".equals(rs.getString(4)));
|
|
749
|
professor.setAuthentication(rs.getInt(4));
|
745
|
750
|
professor.setId(rs.getString(5));
|
746
|
751
|
professor.setName(rs.getString(6));
|
747
|
752
|
professor.setOrgId(rs.getString(7));
|
|
@ -776,7 +781,7 @@ public abstract class ProfessorDao {
|
776
|
781
|
* @throws SQLException
|
777
|
782
|
*/
|
778
|
783
|
public PageQueryResult<EditProfessor> queryEditBaseInfo(Connection con, @Nullable String key, String subject,
|
779
|
|
String industry, String address,@Nullable Integer authentication, int pageSize, int pageNo) throws SQLException {
|
|
784
|
String industry, String address, Integer authType, int pageSize, int pageNo) throws SQLException {
|
780
|
785
|
PageQueryResult<EditProfessor> _result = new PageQueryResult<EditProfessor>();
|
781
|
786
|
StringBuilder sql = new StringBuilder();
|
782
|
787
|
boolean hasKey = null != key;
|
|
@ -789,7 +794,7 @@ public abstract class ProfessorDao {
|
789
|
794
|
boolean hasSubject = null != subject;
|
790
|
795
|
boolean hasIndustry = null != industry;
|
791
|
796
|
boolean hasAddress = null != address;
|
792
|
|
boolean hasAuth = null != authentication;
|
|
797
|
boolean hasAuthType = null != authType;
|
793
|
798
|
if (hasSubject) {
|
794
|
799
|
sql.append(sql.length() > 0 ? " AND " : " WHERE ").append("(SUBJECT LIKE ?)");
|
795
|
800
|
}
|
|
@ -799,12 +804,8 @@ public abstract class ProfessorDao {
|
799
|
804
|
if (hasAddress) {
|
800
|
805
|
sql.append(sql.length() > 0 ? " AND " : " WHERE ").append("(ADDRESS LIKE ?)");
|
801
|
806
|
}
|
802
|
|
if (hasAuth) {
|
803
|
|
if(0 == authentication){
|
804
|
|
sql.append(sql.length() > 0 ? " AND " : " WHERE ").append("(AUTHENTICATION = '0')");
|
805
|
|
}else if(1 == authentication){
|
806
|
|
sql.append(sql.length() > 0 ? " AND " : " WHERE ").append("(AUTHENTICATION = '1')");
|
807
|
|
}
|
|
807
|
if (hasAuthType) {
|
|
808
|
sql.append(sql.length() > 0 ? " AND " : " WHERE ").append("(AUTH_TYPE = ?)");
|
808
|
809
|
}
|
809
|
810
|
|
810
|
811
|
StringBuilder whereSql = sql;
|
|
@ -834,6 +835,9 @@ public abstract class ProfessorDao {
|
834
|
835
|
if (hasAddress) {
|
835
|
836
|
ps.setString(paramIndex++, address);
|
836
|
837
|
}
|
|
838
|
if (hasAuthType) {
|
|
839
|
ps.setInt(paramIndex++, authType);
|
|
840
|
}
|
837
|
841
|
_result.setPageSize(pageSize);
|
838
|
842
|
ResultSet _pageRs = ps.executeQuery();
|
839
|
843
|
try {
|
|
@ -909,7 +913,10 @@ public abstract class ProfessorDao {
|
909
|
913
|
if (hasAddress) {
|
910
|
914
|
ps.setString(paramIndex++, address);
|
911
|
915
|
}
|
912
|
|
java.sql.ResultSet rs = ps.executeQuery();
|
|
916
|
if (hasAuthType) {
|
|
917
|
ps.setInt(paramIndex++, authType);
|
|
918
|
}
|
|
919
|
ResultSet rs = ps.executeQuery();
|
913
|
920
|
try {
|
914
|
921
|
List<EditProfessor> _m_11 = new ArrayList<EditProfessor>();
|
915
|
922
|
_result.setData(_m_11);
|
|
@ -946,7 +953,7 @@ public abstract class ProfessorDao {
|
946
|
953
|
title = null;
|
947
|
954
|
}
|
948
|
955
|
professor.setTitle(title);
|
949
|
|
professor.setAuthentication("1".equals(rs.getString(8)));
|
|
956
|
professor.setAuthentication(rs.getInt(8));
|
950
|
957
|
professor.setId(rs.getString(9));
|
951
|
958
|
professor.setName(rs.getString(10));
|
952
|
959
|
professor.setStarLevel(rs.getBigDecimal(11));
|
|
@ -971,13 +978,15 @@ public abstract class ProfessorDao {
|
971
|
978
|
public PageQueryResult<Professor> query(Connection con, @Nullable String key, String subject, String industry, String address, int pageSize, int pageNo)
|
972
|
979
|
throws SQLException {
|
973
|
980
|
|
974
|
|
org.jfw.util.PageQueryResult<com.ekexiu.portal.po.Professor> _result = new org.jfw.util.PageQueryResult<com.ekexiu.portal.po.Professor>();
|
|
981
|
PageQueryResult<Professor> _result = new PageQueryResult<Professor>();
|
975
|
982
|
|
976
|
983
|
StringBuilder sql = new StringBuilder();
|
977
|
984
|
boolean hasKey = null != key;
|
978
|
985
|
if (hasKey) {
|
979
|
|
sql.append(
|
980
|
|
" WHERE (( professor.ID IN (SELECT PROFESSOR_ID FROM RESEARCH_AREA WHERE CAPTION LIKE ?)) OR (ORG_ID IN(SELECT organization.ID FROM ORGANIZATION WHERE organization.NAME LIKE ?)) OR ( professor.NAME LIKE ?) OR (professor.SUBJECT LIKE ?) OR (professor.INDUSTRY LIKE ?) OR (professor.ADDRESS LIKE ?))");
|
|
986
|
sql.append(" WHERE (( professor.ID IN (SELECT PROFESSOR_ID FROM RESEARCH_AREA WHERE CAPTION LIKE ?)) "
|
|
987
|
+ " OR (ORG_ID IN(SELECT organization.ID FROM ORGANIZATION WHERE organization.NAME LIKE ?)) "
|
|
988
|
+ " OR ( professor.NAME LIKE ?) OR (professor.SUBJECT LIKE ?) "
|
|
989
|
+ " OR (professor.INDUSTRY LIKE ?) OR (professor.ADDRESS LIKE ?))");
|
981
|
990
|
}
|
982
|
991
|
boolean hasSubject = null != subject;
|
983
|
992
|
boolean hasIndustry = null != industry;
|
|
@ -998,7 +1007,7 @@ public abstract class ProfessorDao {
|
998
|
1007
|
if (whereSql.length() > 0) {
|
999
|
1008
|
sql.append(whereSql);
|
1000
|
1009
|
}
|
1001
|
|
java.sql.PreparedStatement ps = con.prepareStatement(sql.toString());
|
|
1010
|
PreparedStatement ps = con.prepareStatement(sql.toString());
|
1002
|
1011
|
int paramIndex = 1;
|
1003
|
1012
|
int totalSize = 0;
|
1004
|
1013
|
try {
|
|
@ -1020,7 +1029,7 @@ public abstract class ProfessorDao {
|
1020
|
1029
|
ps.setString(paramIndex++, address);
|
1021
|
1030
|
}
|
1022
|
1031
|
_result.setPageSize(pageSize);
|
1023
|
|
java.sql.ResultSet _pageRs = ps.executeQuery();
|
|
1032
|
ResultSet _pageRs = ps.executeQuery();
|
1024
|
1033
|
try {
|
1025
|
1034
|
_pageRs.next();
|
1026
|
1035
|
totalSize = _pageRs.getInt(1);
|
|
@ -1039,14 +1048,16 @@ public abstract class ProfessorDao {
|
1039
|
1048
|
_result.setTotal(totalSize);
|
1040
|
1049
|
if (0 == totalSize) {
|
1041
|
1050
|
_result.setPageNo(1);
|
1042
|
|
_result.setData(java.util.Collections.<com.ekexiu.portal.po.Professor> emptyList());
|
|
1051
|
_result.setData(Collections.<Professor> emptyList());
|
1043
|
1052
|
return _result;
|
1044
|
1053
|
}
|
1045
|
1054
|
paramIndex = 1;
|
1046
|
1055
|
if (1 == pageNo) {
|
1047
|
1056
|
_result.setPageNo(1);
|
1048
|
1057
|
sql = new StringBuilder();
|
1049
|
|
sql.append("SELECT OFFICE,SUBJECT,INDUSTRY,ADDRESS,DEPARTMENT,ORG_ID,organization.NAME AS ONAME,TITLE,AUTHENTICATION,professor.ID,professor.NAME AS PNAME,professor.DESCP,professor.CREATE_TIME,professor.MODIFY_TIME FROM PROFESSOR LEFT JOIN ORGANIZATION ON professor.ORG_ID=organization.ID ");
|
|
1058
|
sql.append("SELECT OFFICE,SUBJECT,INDUSTRY,ADDRESS,DEPARTMENT,ORG_ID,organization.NAME AS ONAME,TITLE,"
|
|
1059
|
+ " AUTHENTICATION,professor.ID,professor.NAME AS PNAME,professor.DESCP,professor.CREATE_TIME,"
|
|
1060
|
+ " professor.MODIFY_TIME FROM PROFESSOR LEFT JOIN ORGANIZATION ON professor.ORG_ID=organization.ID ");
|
1050
|
1061
|
if (whereSql.length() > 0) {
|
1051
|
1062
|
sql.append(whereSql);
|
1052
|
1063
|
}
|
|
@ -1064,7 +1075,9 @@ public abstract class ProfessorDao {
|
1064
|
1075
|
--pageNo;
|
1065
|
1076
|
int _m_10 = (pageNo * pageSize);
|
1066
|
1077
|
sql = new StringBuilder();
|
1067
|
|
sql.append("SELECT OFFICE,SUBJECT,INDUSTRY,ADDRESS,DEPARTMENT,ORG_ID,organization.NAME AS ONAME,TITLE,AUTHENTICATION,professor.ID,professor.NAME AS PNAME,professor.DESCP,professor.CREATE_TIME,professor.MODIFY_TIME FROM PROFESSOR LEFT JOIN ORGANIZATION ON professor.ORG_ID=organization.ID ");
|
|
1078
|
sql.append("SELECT OFFICE,SUBJECT,INDUSTRY,ADDRESS,DEPARTMENT,ORG_ID,organization.NAME AS ONAME,TITLE,"
|
|
1079
|
+ " AUTHENTICATION,professor.ID,professor.NAME AS PNAME,professor.DESCP,professor.CREATE_TIME,"
|
|
1080
|
+ " professor.MODIFY_TIME FROM PROFESSOR LEFT JOIN ORGANIZATION ON professor.ORG_ID=organization.ID ");
|
1068
|
1081
|
if (whereSql.length() > 0) {
|
1069
|
1082
|
sql.append(whereSql);
|
1070
|
1083
|
}
|
|
@ -1090,23 +1103,23 @@ public abstract class ProfessorDao {
|
1090
|
1103
|
if (hasAddress) {
|
1091
|
1104
|
ps.setString(paramIndex++, address);
|
1092
|
1105
|
}
|
1093
|
|
java.sql.ResultSet rs = ps.executeQuery();
|
|
1106
|
ResultSet rs = ps.executeQuery();
|
1094
|
1107
|
try {
|
1095
|
|
java.util.List<com.ekexiu.portal.po.Professor> _m_11 = new java.util.ArrayList<com.ekexiu.portal.po.Professor>();
|
|
1108
|
List<Professor> _m_11 = new ArrayList<Professor>();
|
1096
|
1109
|
_result.setData(_m_11);
|
1097
|
1110
|
while (rs.next()) {
|
1098
|
|
com.ekexiu.portal.po.Professor _obj = new com.ekexiu.portal.po.Professor();
|
1099
|
|
java.lang.String _m_13 = rs.getString(1);
|
|
1111
|
Professor _obj = new Professor();
|
|
1112
|
String _m_13 = rs.getString(1);
|
1100
|
1113
|
if (rs.wasNull()) {
|
1101
|
1114
|
_m_13 = null;
|
1102
|
1115
|
}
|
1103
|
1116
|
_obj.setOffice(_m_13);
|
1104
|
|
java.lang.String _m_14 = rs.getString(2);
|
|
1117
|
String _m_14 = rs.getString(2);
|
1105
|
1118
|
if (rs.wasNull()) {
|
1106
|
1119
|
_m_14 = null;
|
1107
|
1120
|
}
|
1108
|
1121
|
_obj.setSubject(_m_14);
|
1109
|
|
java.lang.String _m_15 = rs.getString(3);
|
|
1122
|
String _m_15 = rs.getString(3);
|
1110
|
1123
|
if (rs.wasNull()) {
|
1111
|
1124
|
_m_15 = null;
|
1112
|
1125
|
}
|
|
@ -1130,10 +1143,10 @@ public abstract class ProfessorDao {
|
1130
|
1143
|
title = null;
|
1131
|
1144
|
}
|
1132
|
1145
|
_obj.setTitle(title);
|
1133
|
|
_obj.setAuthentication("1".equals(rs.getString(9)));
|
|
1146
|
_obj.setAuthentication(rs.getInt(9));
|
1134
|
1147
|
_obj.setId(rs.getString(10));
|
1135
|
1148
|
_obj.setName(rs.getString(11));
|
1136
|
|
java.lang.String _m_16 = rs.getString(12);
|
|
1149
|
String _m_16 = rs.getString(12);
|
1137
|
1150
|
if (rs.wasNull()) {
|
1138
|
1151
|
_m_16 = null;
|
1139
|
1152
|
}
|