Преглед на файлове

修改PageQueryResult<Professor> query方法,增加返回地址参数,专家排序按照机构名称排序。

zzy.zhiyuan.foxmail преди 8 години
родител
ревизия
906d006a14
променени са 1 файла, в които са добавени 17 реда и са изтрити 12 реда
  1. 17 12
      src/main/java/com/ekexiu/portal/dao/ProfessorDao.java

+ 17 - 12
src/main/java/com/ekexiu/portal/dao/ProfessorDao.java

@ -198,10 +198,11 @@ public abstract class ProfessorDao {
198 198
		if (1 == pageNo) {
199 199
			_result.setPageNo(1);
200 200
			sql = new StringBuilder();
201
			sql.append("SELECT OFFICE,SUBJECT,INDUSTRY,DEPARTMENT,ORG_ID,TITLE,AUTHENTICATION,ID,NAME,DESCP,CREATE_TIME,MODIFY_TIME FROM PROFESSOR");
201
			sql.append("SELECT OFFICE,SUBJECT,INDUSTRY,ADDRESS,DEPARTMENT,ORG_ID,organization.NAME AS ONAME,TITLE,AUTHENTICATION,professor.ID,professor.NAME,professor.DESCP,professor.CREATE_TIME,professor.MODIFY_TIME FROM PROFESSOR LEFT JOIN ORGANIZATION ON professor.ORG_ID=organization.ID ORDER BY ONAME");
202 202
			if (whereSql.length() > 0) {
203 203
				sql.append(whereSql);
204 204
			}
205
			sql.append(" ORDER BY ONAME");
205 206
			sql.append(" LIMIT ").append(pageSize);
206 207
		} else {
207 208
			int _pageSize = totalSize / pageSize;
@ -215,11 +216,11 @@ public abstract class ProfessorDao {
215 216
			--pageNo;
216 217
			int _m_10 = (pageNo * pageSize);
217 218
			sql = new StringBuilder();
218
			sql.append("SELECT OFFICE,SUBJECT,INDUSTRY,DEPARTMENT,ORG_ID,TITLE,AUTHENTICATION,ID,NAME,DESCP,CREATE_TIME,MODIFY_TIME FROM PROFESSOR");
219
			sql.append("SELECT OFFICE,SUBJECT,INDUSTRY,ADDRESS,DEPARTMENT,ORG_ID,organization.NAME AS ONAME,TITLE,AUTHENTICATION,professor.ID,professor.NAME,professor.DESCP,professor.CREATE_TIME,professor.MODIFY_TIME FROM PROFESSOR LEFT JOIN ORGANIZATION ON professor.ORG_ID=organization.ID ORDER BY ONAME");
219 220
			if (whereSql.length() > 0) {
220 221
				sql.append(whereSql);
221 222
			}
222
			sql.append(" ORDER BY ID");
223
			sql.append(" ORDER BY ONAME");
223 224
			sql.append(" LIMIT ").append(pageSize).append(" OFFSET ").append(_m_10);
224 225
		}
225 226
		ps = con.prepareStatement(sql.toString());
@ -256,19 +257,23 @@ public abstract class ProfessorDao {
256 257
						_m_15 = null;
257 258
					}
258 259
					_obj.setIndustry(_m_15);
259
					_obj.setDepartment(rs.getString(4));
260
					_obj.setOrgId(rs.getString(5));
261
					_obj.setTitle(rs.getString(6));
262
					_obj.setAuthentication("1".equals(rs.getString(7)));
263
					_obj.setId(rs.getString(8));
264
					_obj.setName(rs.getString(9));
265
					java.lang.String _m_16 = rs.getString(10);
260
					_obj.setAddress(rs.getString(4));
261
					_obj.setDepartment(rs.getString(5));
262
					Organization organization = new Organization();
263
					organization.setId(rs.getString(6));
264
					organization.setName(rs.getString(7));
265
					_obj.setOrganization(organization);
266
					_obj.setTitle(rs.getString(8));
267
					_obj.setAuthentication("1".equals(rs.getString(9)));
268
					_obj.setId(rs.getString(10));
269
					_obj.setName(rs.getString(11));
270
					java.lang.String _m_16 = rs.getString(12);
266 271
					if (rs.wasNull()) {
267 272
						_m_16 = null;
268 273
					}
269 274
					_obj.setDescp(_m_16);
270
					_obj.setCreateTime(rs.getString(11));
271
					_obj.setModifyTime(rs.getString(12));
275
					_obj.setCreateTime(rs.getString(13));
276
					_obj.setModifyTime(rs.getString(14));
272 277
					_m_11.add(_obj);
273 278
				}
274 279
				return _result;