Ver Código Fonte

解决专家和资源相关接口的undefined问题。

zzy.zhiyuan.foxmail 8 anos atrás
pai
commit
753127f15e

+ 118 - 39
src/main/java/com/ekexiu/portal/dao/ProfessorDao.java

79
	 * @throws SQLException
79
	 * @throws SQLException
80
	 */
80
	 */
81
	public EditProfessor queryBaseInfo(Connection con, String id) throws SQLException {
81
	public EditProfessor queryBaseInfo(Connection con, String id) throws SQLException {
82
		int _m_1 = 1;
82
		int index = 1;
83
        String sql = "SELECT P.OFFICE,P.DEPARTMENT,P.TITLE,AUTHENTICATION,P.ID,P.NAME,P.ADDRESS,ORGANIZATION.NAME "
83
        String sql = "SELECT P.OFFICE,P.DEPARTMENT,P.TITLE,AUTHENTICATION,P.ID,P.NAME,P.ADDRESS,ORGANIZATION.NAME "
84
        		+ " FROM PROFESSOR P LEFT JOIN ORGANIZATION ON P.ORG_ID = ORGANIZATION.ID WHERE P.ID = ?";
84
        		+ " FROM PROFESSOR P LEFT JOIN ORGANIZATION ON P.ORG_ID = ORGANIZATION.ID WHERE P.ID = ?";
85
        PreparedStatement ps = con.prepareStatement(sql);
85
        PreparedStatement ps = con.prepareStatement(sql);
86
        try{
86
        try{
87
            ps.setString(_m_1++,id);
87
            ps.setString(index++,id);
88
            ResultSet rs = ps.executeQuery();
88
            ResultSet rs = ps.executeQuery();
89
            try{
89
            try{
90
                if(rs.next()){
90
                if(rs.next()){
91
                	EditProfessor professor = new EditProfessor();
91
                	EditProfessor professor = new EditProfessor();
92
                    professor.setOffice(rs.getString(1));
93
                    professor.setDepartment(rs.getString(2));
94
                    professor.setTitle(rs.getString(3));
92
                	String office = rs.getString(1);
93
                	if(rs.wasNull()){
94
                		office = null;
95
                	}
96
                    professor.setOffice(office);
97
                    String depart = rs.getString(2);
98
                    if(rs.wasNull()){
99
                    	depart = null;
100
                	}
101
                    professor.setDepartment(depart);
102
                    String title = rs.getString(3);
103
                    if(rs.wasNull()){
104
                    	title = null;
105
                	}
106
                    professor.setTitle(title);
95
                    professor.setAuthentication("1".equals(rs.getString(4)));
107
                    professor.setAuthentication("1".equals(rs.getString(4)));
96
                    professor.setId(rs.getString(5));
108
                    professor.setId(rs.getString(5));
97
                    professor.setName(rs.getString(6));
109
                    professor.setName(rs.getString(6));
98
                    professor.setAddress(rs.getString(7));
110
                    String address = rs.getString(7);
111
                    if(rs.wasNull()){
112
                    	address = null;
113
                	}
114
                    professor.setAddress(address);
99
                    professor.setOrgName(rs.getString(8));
115
                    professor.setOrgName(rs.getString(8));
100
                    return professor;
116
                    return professor;
101
                }else{
117
                }else{
117
	 * @throws SQLException
133
	 * @throws SQLException
118
	 */
134
	 */
119
	public EditProfessor queryEditBaseInfo(Connection con, String id) throws SQLException {
135
	public EditProfessor queryEditBaseInfo(Connection con, String id) throws SQLException {
120
		int _m_1 = 1;
136
		int index = 1;
121
        String sql = "SELECT P.OFFICE,P.DEPARTMENT,P.TITLE,AUTHENTICATION,P.ID,P.NAME,"
137
        String sql = "SELECT P.OFFICE,P.DEPARTMENT,P.TITLE,AUTHENTICATION,P.ID,P.NAME,"
122
        		+ " P.ADDRESS,P.STAR_LEVEL,P.CONSULT_COUNT,ORGANIZATION.NAME "
138
        		+ " P.ADDRESS,P.STAR_LEVEL,P.CONSULT_COUNT,ORGANIZATION.NAME "
123
        		+ " FROM PROFESSOR P LEFT JOIN ORGANIZATION ON P.ORG_ID = ORGANIZATION.ID WHERE P.ID = ?";
139
        		+ " FROM PROFESSOR P LEFT JOIN ORGANIZATION ON P.ORG_ID = ORGANIZATION.ID WHERE P.ID = ?";
124
        PreparedStatement ps = con.prepareStatement(sql);
140
        PreparedStatement ps = con.prepareStatement(sql);
125
        try{
141
        try{
126
            ps.setString(_m_1++,id);
142
            ps.setString(index++,id);
127
            ResultSet rs = ps.executeQuery();
143
            ResultSet rs = ps.executeQuery();
128
            try{
144
            try{
129
                if(rs.next()){
145
                if(rs.next()){
130
                	EditProfessor professor = new EditProfessor();
146
                	EditProfessor professor = new EditProfessor();
131
                    professor.setOffice(rs.getString(1));
132
                    professor.setDepartment(rs.getString(2));
133
                    professor.setTitle(rs.getString(3));
147
                	String office = rs.getString(1);
148
                	if(rs.wasNull()){
149
                		office = null;
150
                	}
151
                    professor.setOffice(office);
152
                    String depart = rs.getString(2);
153
                	if(rs.wasNull()){
154
                		depart = null;
155
                	}
156
                    professor.setDepartment(depart);
157
                    String title = rs.getString(3);
158
                	if(rs.wasNull()){
159
                		title = null;
160
                	}
161
                    professor.setTitle(title);
134
                    professor.setAuthentication("1".equals(rs.getString(4)));
162
                    professor.setAuthentication("1".equals(rs.getString(4)));
135
                    professor.setId(rs.getString(5));
163
                    professor.setId(rs.getString(5));
136
                    professor.setName(rs.getString(6));
164
                    professor.setName(rs.getString(6));
137
                    professor.setAddress(rs.getString(7));
138
                    BigDecimal starLevel = rs.getBigDecimal(8);
139
                    if(rs.wasNull()){
140
                    	starLevel = null;
141
                    }
142
                    professor.setStarLevel(starLevel);
165
                    String address = rs.getString(7);
166
                	if(rs.wasNull()){
167
                		address = null;
168
                	}
169
                    professor.setAddress(address);
170
                    professor.setStarLevel(rs.getBigDecimal(8));
143
                    professor.setConsultCount(rs.getInt(9));
171
                    professor.setConsultCount(rs.getInt(9));
144
                    professor.setOrgName(rs.getString(10));
172
                    professor.setOrgName(rs.getString(10));
145
                    return professor;
173
                    return professor;
147
                    return null;
175
                    return null;
148
                }
176
                }
149
            }finally{
177
            }finally{
150
                try{rs.close();}catch(Exception _m_9){}
178
                try{rs.close();}catch(Exception e1){}
151
            }
179
            }
152
        }finally{
180
        }finally{
153
            try{ps.close();}catch(Exception _m_10){}
181
            try{ps.close();}catch(Exception e2){}
154
        }
182
        }
155
	}
183
	}
156
	
184
	
220
        }
248
        }
221
    }
249
    }
222

250

223
//	@SelectList
224
//	public abstract List<Professor> query(Connection con) throws SQLException;
251
//	public abstract List<Professor> query(Connection con) throws SQLException;
225
	
252
	
226
	public List<Professor> query(Connection con) throws SQLException{
253
	public List<Professor> query(Connection con) throws SQLException{
493
				_result.setData(_m_11);
520
				_result.setData(_m_11);
494
				while (rs.next()) {
521
				while (rs.next()) {
495
					EditProfessor professor =  new EditProfessor();
522
					EditProfessor professor =  new EditProfessor();
496
                    String _m_1 = rs.getString(1);
523
                    String office = rs.getString(1);
497
                    if(rs.wasNull()){
524
                    if(rs.wasNull()){
498
                        _m_1 = null;
525
                    	office = null;
526
                    }
527
                    professor.setOffice(office);
528
                    String address = rs.getString(2);
529
                    if(rs.wasNull()){
530
                    	address = null;
531
                    }
532
                    professor.setAddress(address);
533
                    String title = rs.getString(3);
534
                    if(rs.wasNull()){
535
                    	title = null;
499
                    }
536
                    }
500
                    professor.setOffice(_m_1);
501
                    professor.setAddress(rs.getString(2));
502
                    professor.setTitle(rs.getString(3));
537
                    professor.setTitle(title);
503
                    professor.setAuthentication("1".equals(rs.getString(4)));
538
                    professor.setAuthentication("1".equals(rs.getString(4)));
504
                    professor.setId(rs.getString(5));
539
                    professor.setId(rs.getString(5));
505
                    professor.setName(rs.getString(6));
540
                    professor.setName(rs.getString(6));
687
				_result.setData(_m_11);
722
				_result.setData(_m_11);
688
				while (rs.next()) {
723
				while (rs.next()) {
689
					EditProfessor professor =  new EditProfessor();
724
					EditProfessor professor =  new EditProfessor();
690
                    String _m_1 = rs.getString(1);
725
                    String office = rs.getString(1);
691
                    if(rs.wasNull()){
726
                    if(rs.wasNull()){
692
                        _m_1 = null;
727
                    	office = null;
693
                    }
728
                    }
694
                    professor.setOffice(_m_1);
695
                    professor.setAddress(rs.getString(2));
696
                    professor.setTitle(rs.getString(3));
729
                    professor.setOffice(office);
730
                    String addr = rs.getString(2);
731
                    if(rs.wasNull()){
732
                    	addr = null;
733
                    }
734
                    professor.setAddress(addr);
735
                    String title = rs.getString(3);
736
                    if(rs.wasNull()){
737
                    	title = null;
738
                    }
739
                    professor.setTitle(title);
697
                    professor.setAuthentication("1".equals(rs.getString(4)));
740
                    professor.setAuthentication("1".equals(rs.getString(4)));
698
                    professor.setId(rs.getString(5));
741
                    professor.setId(rs.getString(5));
699
                    professor.setName(rs.getString(6));
742
                    professor.setName(rs.getString(6));
868
				_result.setData(_m_11);
911
				_result.setData(_m_11);
869
				while (rs.next()) {
912
				while (rs.next()) {
870
					EditProfessor professor = new EditProfessor();
913
					EditProfessor professor = new EditProfessor();
871
					professor.setOffice(rs.getString(1));
872
					professor.setSubject(rs.getString(2));
873
					professor.setIndustry(rs.getString(3));
874
					professor.setAddress(rs.getString(4));
875
					professor.setDepartment(rs.getString(5));
914
					String office = rs.getString(1);
915
                    if(rs.wasNull()){
916
                    	office = null;
917
                    }
918
                    professor.setOffice(office);
919
                    String subj = rs.getString(2);
920
                    if(rs.wasNull()){
921
                    	subj = null;
922
                    }
923
					professor.setSubject(subj);
924
					String indus = rs.getString(3);
925
					if(rs.wasNull()){
926
						indus = null;
927
					}
928
					professor.setIndustry(indus);
929
					String addr = rs.getString(4);
930
					if(rs.wasNull()){
931
						addr = null;
932
					}
933
					professor.setAddress(addr);
934
					String depart = rs.getString(5);
935
					if(rs.wasNull()){
936
						depart = null;
937
					}
938
					professor.setDepartment(depart);
876
					professor.setOrgName(rs.getString(6));
939
					professor.setOrgName(rs.getString(6));
877
					professor.setTitle(rs.getString(7));
940
					String title = rs.getString(7);
941
					if(rs.wasNull()){
942
						title = null;
943
					}
944
					professor.setTitle(title);
878
					professor.setAuthentication("1".equals(rs.getString(8)));
945
					professor.setAuthentication("1".equals(rs.getString(8)));
879
					professor.setId(rs.getString(9));
946
					professor.setId(rs.getString(9));
880
					professor.setName(rs.getString(10));
947
					professor.setName(rs.getString(10));
1040
						_m_15 = null;
1107
						_m_15 = null;
1041
					}
1108
					}
1042
					_obj.setIndustry(_m_15);
1109
					_obj.setIndustry(_m_15);
1043
					_obj.setAddress(rs.getString(4));
1044
					_obj.setDepartment(rs.getString(5));
1110
					String addr = rs.getString(4);
1111
					if(rs.wasNull()){
1112
						addr = null;
1113
					}
1114
					_obj.setAddress(addr);
1115
					String depart = rs.getString(5);
1116
					if(rs.wasNull()){
1117
						depart = null;
1118
					}
1119
					_obj.setDepartment(depart);
1045
					Organization organization = new Organization();
1120
					Organization organization = new Organization();
1046
					organization.setId(rs.getString(6));
1121
					organization.setId(rs.getString(6));
1047
					organization.setName(rs.getString(7));
1122
					organization.setName(rs.getString(7));
1048
					_obj.setOrganization(organization);
1123
					_obj.setOrganization(organization);
1049
					_obj.setTitle(rs.getString(8));
1124
					String title = rs.getString(8);
1125
					if(rs.wasNull()){
1126
						title = null;
1127
					}
1128
					_obj.setTitle(title);
1050
					_obj.setAuthentication("1".equals(rs.getString(9)));
1129
					_obj.setAuthentication("1".equals(rs.getString(9)));
1051
					_obj.setId(rs.getString(10));
1130
					_obj.setId(rs.getString(10));
1052
					_obj.setName(rs.getString(11));
1131
					_obj.setName(rs.getString(11));

+ 25 - 5
src/main/java/com/ekexiu/portal/dao/ResourceDao.java

107
                    Professor professor = new Professor();
107
                    Professor professor = new Professor();
108
                    professor.setId(rs.getString(7));
108
                    professor.setId(rs.getString(7));
109
                    _result.setAscription(rs.getString(8));
109
                    _result.setAscription(rs.getString(8));
110
                    _result.setHopePayMethod(rs.getString(9));
110
                    String hopePay = rs.getString(9);
111
                    if(rs.wasNull()){
112
                    	hopePay = null;
113
                    }
114
                    _result.setHopePayMethod(hopePay);
111
                    String _m_5 = rs.getString(10);
115
                    String _m_5 = rs.getString(10);
112
                    if(rs.wasNull()){
116
                    if(rs.wasNull()){
113
                        _m_5 = null;
117
                        _m_5 = null;
780
                    _obj.setCreateTime(rs.getString(11));
784
                    _obj.setCreateTime(rs.getString(11));
781
                    _obj.setModifyTime(rs.getString(12));
785
                    _obj.setModifyTime(rs.getString(12));
782
                    professor.setName(rs.getString(13));
786
                    professor.setName(rs.getString(13));
783
                    professor.setTitle(rs.getString(14));
784
                    professor.setDepartment(rs.getString(15));
785
                    professor.setAddress(rs.getString(16));
786
                    professor.setOffice(rs.getString(17));
787
                    String title = rs.getString(14);
788
                    if(rs.wasNull()){
789
                    	title = null;
790
                    }
791
                    professor.setTitle(title);
792
                    String depart = rs.getString(15);
793
                    if(rs.wasNull()){
794
                    	depart = null;
795
                    }
796
                    professor.setDepartment(depart);
797
                    String addr = rs.getString(16);
798
                    if(rs.wasNull()){
799
                    	addr = null;
800
                    }
801
                    professor.setAddress(addr);
802
                    String office = rs.getString(17);
803
                    if(rs.wasNull()){
804
                    	office = null;
805
                    }
806
                    professor.setOffice(office);
787
                    professor.setOrgName(rs.getString(18));
807
                    professor.setOrgName(rs.getString(18));
788
                    _obj.setProfessor(professor);
808
                    _obj.setProfessor(professor);
789
                    List<Image> images = this.imageDao.queryRes(con, _obj.getResourceId());
809
                    List<Image> images = this.imageDao.queryRes(con, _obj.getResourceId());