Browse Source

--add delete();

zzy.zhiyuan.foxmail 8 years ago
parent
commit
e2607039e4

+ 7 - 0
src/main/java/com/ekexiu/portal/dao/LeaveWordDao.java

@ -5,7 +5,9 @@ import java.sql.SQLException;
5 5
import java.util.List;
6 6

7 7
import org.jfw.apt.orm.annotation.dao.DAO;
8
import org.jfw.apt.orm.annotation.dao.method.From;
8 9
import org.jfw.apt.orm.annotation.dao.method.OrderBy;
10
import org.jfw.apt.orm.annotation.dao.method.operator.DeleteWith;
9 11
import org.jfw.apt.orm.annotation.dao.method.operator.Insert;
10 12
import org.jfw.apt.orm.annotation.dao.method.operator.LimitSelect;
11 13
import org.jfw.apt.orm.annotation.dao.param.LessThan;
@ -20,4 +22,9 @@ public abstract class LeaveWordDao {
20 22
	@LimitSelect
21 23
	@OrderBy("ORDER BY CREATE_TIME DESC,ORDER_KEY DESC")
22 24
	public abstract List<LeaveWord> query(Connection con,String articleId,@LessThan String createTime,@LessThan long orderKey,int rows) throws SQLException; 
25
	
26
	@DeleteWith
27
	@From(LeaveWord.class)
28
	public abstract int deleteArticle(Connection con,String articleId)throws SQLException;
29
	
23 30
}

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

@ -105,16 +105,16 @@ public abstract class ResourceDao {
105 105
                    Resource resource = new Resource();
106 106
                    resource.setResourceId(rs.getString(1));
107 107
                    resource.setResourceName(rs.getString(2));
108
                    String m1 = rs.getString(3);
108
                    String subject = rs.getString(3);
109 109
                    if(rs.wasNull()){
110
                        m1 = null;
110
                    	subject = null;
111 111
                    }
112
                    resource.setSubject(m1);
113
                    String m2 = rs.getString(4);
112
                    resource.setSubject(subject);
113
                    String industry = rs.getString(4);
114 114
                    if(rs.wasNull()){
115
                        m2 = null;
115
                    	industry = null;
116 116
                    }
117
                    resource.setIndustry(m2);
117
                    resource.setIndustry(industry);
118 118
                    resource.setSupportedServices(rs.getString(5));
119 119
                    resource.setProfessorId(rs.getString(6));
120 120
                    resource.setImages(images);
@ -131,62 +131,62 @@ public abstract class ResourceDao {
131 131
    }
132 132
	
133 133
	public Resource query(Connection con,String resourceId) throws SQLException{
134
		int _m_1 = 1;
134
		int index = 1;
135 135
        String sql = "SELECT RESOURCE_ID,RESOURCE_NAME,RESOURCE.SUBJECT,RESOURCE.INDUSTRY,"
136 136
        		+ " SUPPORTED_SERVICES,RESOURCE.DESCP,PROFESSOR_ID,ASCRIPTION,HOPE_PAY_METHOD,"
137 137
        		+ " COOPERATION_NOTES,RESOURCE.CREATE_TIME,RESOURCE.MODIFY_TIME,PROFESSOR.NAME "
138 138
        		+ " FROM RESOURCE LEFT JOIN PROFESSOR ON PROFESSOR_ID = PROFESSOR.ID WHERE RESOURCE_ID = ?";
139 139
        PreparedStatement ps = con.prepareStatement(sql);
140 140
        try{
141
            ps.setString(_m_1++,resourceId);
141
            ps.setString(index++,resourceId);
142 142
            ResultSet rs = ps.executeQuery();
143 143
            try{
144 144
                if(rs.next()){
145
                    Resource _result = new Resource();
146
                    _result.setResourceId(rs.getString(1));
147
                    _result.setResourceName(rs.getString(2));
148
                    String _m_2 = rs.getString(3);
145
                    Resource resource = new Resource();
146
                    resource.setResourceId(rs.getString(1));
147
                    resource.setResourceName(rs.getString(2));
148
                    String subject = rs.getString(3);
149 149
                    if(rs.wasNull()){
150
                        _m_2 = null;
150
                    	subject = null;
151 151
                    }
152
                    _result.setSubject(_m_2);
153
                    String _m_3 = rs.getString(4);
152
                    resource.setSubject(subject);
153
                    String industry = rs.getString(4);
154 154
                    if(rs.wasNull()){
155
                        _m_3 = null;
155
                    	industry = null;
156 156
                    }
157
                    _result.setIndustry(_m_3);
158
                    _result.setSupportedServices(rs.getString(5));
159
                    String _m_4 = rs.getString(6);
157
                    resource.setIndustry(industry);
158
                    resource.setSupportedServices(rs.getString(5));
159
                    String descp = rs.getString(6);
160 160
                    if(rs.wasNull()){
161
                        _m_4 = null;
161
                    	descp = null;
162 162
                    }
163
                    _result.setDescp(_m_4);
163
                    resource.setDescp(descp);
164 164
                    Professor professor = new Professor();
165 165
                    professor.setId(rs.getString(7));
166
                    _result.setAscription(rs.getString(8));
166
                    resource.setAscription(rs.getString(8));
167 167
                    String hopePay = rs.getString(9);
168 168
                    if(rs.wasNull()){
169 169
                    	hopePay = null;
170 170
                    }
171
                    _result.setHopePayMethod(hopePay);
172
                    String _m_5 = rs.getString(10);
171
                    resource.setHopePayMethod(hopePay);
172
                    String cooperationNotes = rs.getString(10);
173 173
                    if(rs.wasNull()){
174
                        _m_5 = null;
174
                    	cooperationNotes = null;
175 175
                    }
176
                    _result.setCooperationNotes(_m_5);
177
                    _result.setCreateTime(rs.getString(11));
178
                    _result.setModifyTime(rs.getString(12));
176
                    resource.setCooperationNotes(cooperationNotes);
177
                    resource.setCreateTime(rs.getString(11));
178
                    resource.setModifyTime(rs.getString(12));
179 179
                    professor.setName(rs.getString(13));
180
                    _result.setProfessor(professor);
181
                    return _result;
180
                    resource.setProfessor(professor);
181
                    return resource;
182 182
                }else{
183 183
                    return null;
184 184
                }
185 185
            }finally{
186
                try{rs.close();}catch(Exception _m_6){}
186
                try{rs.close();}catch(Exception e1){}
187 187
            }
188 188
        }finally{
189
            try{ps.close();}catch(Exception _m_7){}
189
            try{ps.close();}catch(Exception e2){}
190 190
        }
191 191
    }
192 192
	
@ -198,88 +198,88 @@ public abstract class ResourceDao {
198 198
	 * @throws SQLException
199 199
	 */
200 200
	public Resource queryInfo(Connection con,String resourceId) throws SQLException{
201
		int _m_1 = 1;
201
		int index = 1;
202 202
        String sql = "SELECT RESOURCE_ID,RESOURCE_NAME,SUBJECT,INDUSTRY,SUPPORTED_SERVICES,DESCP,PROFESSOR_ID,"
203 203
        		+ " ASCRIPTION,HOPE_PAY_METHOD,COOPERATION_NOTES,CREATE_TIME,MODIFY_TIME "
204 204
        		+ " FROM RESOURCE WHERE RESOURCE_ID = ?";
205 205
        PreparedStatement ps = con.prepareStatement(sql);
206 206
        try{
207
            ps.setString(_m_1++,resourceId);
207
            ps.setString(index++,resourceId);
208 208
            ResultSet rs = ps.executeQuery();
209 209
            try{
210 210
                if(rs.next()){
211
                    Resource _result = new Resource();
212
                    _result.setResourceId(rs.getString(1));
213
                    _result.setResourceName(rs.getString(2));
214
                    String _m_2 = rs.getString(3);
211
                    Resource resource = new Resource();
212
                    resource.setResourceId(rs.getString(1));
213
                    resource.setResourceName(rs.getString(2));
214
                    String subject = rs.getString(3);
215 215
                    if(rs.wasNull()){
216
                        _m_2 = null;
216
                    	subject = null;
217 217
                    }
218
                    _result.setSubject(_m_2);
219
                    String _m_3 = rs.getString(4);
218
                    resource.setSubject(subject);
219
                    String industry = rs.getString(4);
220 220
                    if(rs.wasNull()){
221
                        _m_3 = null;
221
                    	industry = null;
222 222
                    }
223
                    _result.setIndustry(_m_3);
224
                    _result.setSupportedServices(rs.getString(5));
225
                    String _m_4 = rs.getString(6);
223
                    resource.setIndustry(industry);
224
                    resource.setSupportedServices(rs.getString(5));
225
                    String descp = rs.getString(6);
226 226
                    if(rs.wasNull()){
227
                        _m_4 = null;
227
                    	descp = null;
228 228
                    }
229
                    _result.setDescp(_m_4);
230
                    _result.setProfessorId(rs.getString(7));
231
                    _result.setAscription(rs.getString(8));
229
                    resource.setDescp(descp);
230
                    resource.setProfessorId(rs.getString(7));
231
                    resource.setAscription(rs.getString(8));
232 232
                    String hopePay = rs.getString(9);
233 233
                    if(rs.wasNull()){
234 234
                    	hopePay = null;
235 235
                    }
236
                    _result.setHopePayMethod(hopePay);
237
                    String _m_5 = rs.getString(10);
236
                    resource.setHopePayMethod(hopePay);
237
                    String cooperationNotes = rs.getString(10);
238 238
                    if(rs.wasNull()){
239
                        _m_5 = null;
239
                    	cooperationNotes = null;
240 240
                    }
241
                    _result.setCooperationNotes(_m_5);
242
                    _result.setCreateTime(rs.getString(11));
243
                    _result.setModifyTime(rs.getString(12));
244
                    return _result;
241
                    resource.setCooperationNotes(cooperationNotes);
242
                    resource.setCreateTime(rs.getString(11));
243
                    resource.setModifyTime(rs.getString(12));
244
                    return resource;
245 245
                }else{
246 246
                    return null;
247 247
                }
248 248
            }finally{
249
                try{rs.close();}catch(Exception _m_6){}
249
                try{rs.close();}catch(Exception e1){}
250 250
            }
251 251
        }finally{
252
            try{ps.close();}catch(Exception _m_7){}
252
            try{ps.close();}catch(Exception e2){}
253 253
        }
254 254
    }
255 255
	
256 256
	public PageQueryResult<Resource> queryPageAll(Connection con,int pageSize,int pageNo) throws SQLException{
257
        int _m_1 = 0;
258
        PageQueryResult<Resource> _result = new PageQueryResult<Resource>();
257
        int total = 0;
258
        PageQueryResult<Resource> queryResult = new PageQueryResult<Resource>();
259 259
        String sql = null;
260 260
        sql = " SELECT COUNT(1) FROM RESOURCE ";
261 261
        PreparedStatement ps = con.prepareStatement(sql);
262 262
        try{
263
            _result.setPageSize(pageSize);
264
            ResultSet _pageRs = ps.executeQuery();
263
        	queryResult.setPageSize(pageSize);
264
            ResultSet rs = ps.executeQuery();
265 265
            try{
266
                _pageRs.next();
267
                _m_1 = _pageRs.getInt(1);
266
                rs.next();
267
                total = rs.getInt(1);
268 268
            }finally{
269
                try{_pageRs.close();}catch(Exception _m_3){}
269
                try{rs.close();}catch(Exception e1){}
270 270
            }
271 271
        }finally{
272
            try{ps.close();}catch(Exception _m_4){}
272
            try{ps.close();}catch(Exception e2){}
273 273
        }
274
        _result.setTotal(_m_1);
275
        if(0== _m_1){
276
            _result.setPageNo(1);
277
            _result.setData(Collections.<Resource>emptyList());
278
            return _result;
274
        queryResult.setTotal(total);
275
        if(0== total){
276
        	queryResult.setPageNo(1);
277
        	queryResult.setData(Collections.<Resource>emptyList());
278
            return queryResult;
279 279
        }
280
        boolean _m_5 = (1 == pageNo);
281
        if(_m_5){
282
            _result.setPageNo(1);
280
        boolean firstPage = (1 == pageNo);
281
        if(firstPage){
282
        	queryResult.setPageNo(1);
283 283
            sql = " SELECT RESOURCE_ID,RESOURCE_NAME,RESOURCE.SUBJECT,RESOURCE.INDUSTRY,"
284 284
            		+ " SUPPORTED_SERVICES,RESOURCE.DESCP,PROFESSOR_ID,ASCRIPTION,HOPE_PAY_METHOD,"
285 285
            		+ " COOPERATION_NOTES,RESOURCE.CREATE_TIME,RESOURCE.MODIFY_TIME,PROFESSOR.NAME "
@ -287,80 +287,80 @@ public abstract class ResourceDao {
287 287
            sql = sql + " ORDER BY RESOURCE_NAME ";
288 288
            sql = sql + " LIMIT " + pageSize;
289 289
        }else{
290
            int _m_6 = _m_1 / pageSize;
291
            if(_m_1 % pageSize != 0){
292
                ++_m_6;
290
            int pageNum = total / pageSize;
291
            if(total % pageSize != 0){
292
                ++pageNum;
293 293
            }
294
            if(pageNo > _m_6){
295
                pageNo = _m_6;
294
            if(pageNo > pageNum){
295
                pageNo = pageNum;
296 296
            }
297
            _result.setPageNo(pageNo);
297
            queryResult.setPageNo(pageNo);
298 298
            --pageNo;
299
            int _m_7 = (pageNo * pageSize);
299
            int offset = (pageNo * pageSize);
300 300
            sql = " SELECT RESOURCE_ID,RESOURCE_NAME,RESOURCE.SUBJECT,RESOURCE.INDUSTRY,"
301 301
            		+ " SUPPORTED_SERVICES,RESOURCE.DESCP,PROFESSOR_ID,ASCRIPTION,HOPE_PAY_METHOD,"
302 302
            		+ " COOPERATION_NOTES,RESOURCE.CREATE_TIME,RESOURCE.MODIFY_TIME,PROFESSOR.NAME "
303 303
            		+ " FROM RESOURCE LEFT JOIN PROFESSOR ON PROFESSOR_ID = PROFESSOR.ID ";
304 304
            sql = sql + " ORDER BY RESOURCE_NAME ";
305
            sql = sql + " LIMIT " + pageSize+ " OFFSET "+_m_7;
305
            sql = sql + " LIMIT " + pageSize+ " OFFSET " + offset;
306 306
        }
307 307
        ps = con.prepareStatement(sql);
308 308
        try{
309 309
            ResultSet rs = ps.executeQuery();
310 310
            try{
311
                List<Resource> _m_8 = new ArrayList<Resource>();
312
                _result.setData(_m_8);
313
                int _m_9 = 0;
314
                while((_m_9<pageSize) && rs.next()){
315
                    ++_m_9;
316
                    Resource _obj =  new Resource();
317
                    _obj.setResourceId(rs.getString(1));
318
                    _obj.setResourceName(rs.getString(2));
319
                    String _m_10 = rs.getString(3);
311
                List<Resource> resources = new ArrayList<Resource>();
312
                queryResult.setData(resources);
313
                int size = 0;
314
                while((size<pageSize) && rs.next()){
315
                    ++size;
316
                    Resource resource =  new Resource();
317
                    resource.setResourceId(rs.getString(1));
318
                    resource.setResourceName(rs.getString(2));
319
                    String subject = rs.getString(3);
320 320
                    if(rs.wasNull()){
321
                        _m_10 = null;
321
                    	subject = null;
322 322
                    }
323
                    _obj.setSubject(_m_10);
324
                    String _m_11 = rs.getString(4);
323
                    resource.setSubject(subject);
324
                    String industry = rs.getString(4);
325 325
                    if(rs.wasNull()){
326
                        _m_11 = null;
326
                    	industry = null;
327 327
                    }
328
                    _obj.setIndustry(_m_11);
329
                    _obj.setSupportedServices(rs.getString(5));
330
                    String _m_12 = rs.getString(6);
328
                    resource.setIndustry(industry);
329
                    resource.setSupportedServices(rs.getString(5));
330
                    String descp = rs.getString(6);
331 331
                    if(rs.wasNull()){
332
                        _m_12 = null;
332
                    	descp = null;
333 333
                    }
334
                    _obj.setDescp(_m_12);
334
                    resource.setDescp(descp);
335 335
                    Professor professor = new Professor();
336 336
                    professor.setId(rs.getString(7));
337
                    String _m_13 = rs.getString(8);
337
                    String ascription = rs.getString(8);
338 338
                    if(rs.wasNull()){
339
                        _m_13 = null;
339
                    	ascription = null;
340 340
                    }
341
                    _obj.setAscription(_m_13);
342
                    String _m_14 = rs.getString(9);
341
                    resource.setAscription(ascription);
342
                    String hopePay = rs.getString(9);
343 343
                    if(rs.wasNull()){
344
                        _m_14 = null;
344
                    	hopePay = null;
345 345
                    }
346
                    _obj.setHopePayMethod(_m_14);
347
                    String _m_15 = rs.getString(10);
346
                    resource.setHopePayMethod(hopePay);
347
                    String cooperationNotes = rs.getString(10);
348 348
                    if(rs.wasNull()){
349
                        _m_15 = null;
349
                    	cooperationNotes = null;
350 350
                    }
351
                    _obj.setCooperationNotes(_m_15);
352
                    _obj.setCreateTime(rs.getString(11));
353
                    _obj.setModifyTime(rs.getString(12));
351
                    resource.setCooperationNotes(cooperationNotes);
352
                    resource.setCreateTime(rs.getString(11));
353
                    resource.setModifyTime(rs.getString(12));
354 354
                    professor.setName(rs.getString(13));
355
                    _obj.setProfessor(professor);
356
                    _m_8.add(_obj);
355
                    resource.setProfessor(professor);
356
                    resources.add(resource);
357 357
                }
358
                return _result;
358
                return queryResult;
359 359
            }finally{
360
                try{rs.close();}catch(Exception _m_16){}
360
                try{rs.close();}catch(Exception e3){}
361 361
            }
362 362
        }finally{
363
            try{ps.close();}catch(Exception _m_17){}
363
            try{ps.close();}catch(Exception e4){}
364 364
        }
365 365
    }
366 366
		
@ -387,10 +387,10 @@ public abstract class ResourceDao {
387 387
                }
388 388
                return resources;
389 389
            }finally{
390
                try{rs.close();}catch(Exception e){}
390
                try{rs.close();}catch(Exception e1){}
391 391
            }
392 392
        }finally{
393
            try{ps.close();}catch(Exception e){}
393
            try{ps.close();}catch(Exception e2){}
394 394
        }
395 395
    }
396 396
	
@ -402,62 +402,62 @@ public abstract class ResourceDao {
402 402
	 * @throws SQLException
403 403
	 */
404 404
	public List<Resource> queryPro(Connection con,String professorId) throws SQLException{
405
        int _m_1 = 1;
405
        int index = 1;
406 406
        String sql = "SELECT RESOURCE_ID,RESOURCE_NAME,SUBJECT,INDUSTRY,SUPPORTED_SERVICES,DESCP,"
407 407
        		+ " PROFESSOR_ID,ASCRIPTION,HOPE_PAY_METHOD,COOPERATION_NOTES,CREATE_TIME,MODIFY_TIME "
408 408
        		+ " FROM RESOURCE WHERE PROFESSOR_ID = ? ORDER BY CREATE_TIME DESC";
409 409
        PreparedStatement ps = con.prepareStatement(sql);
410 410
        try{
411
            ps.setString(_m_1++,professorId);
411
            ps.setString(index++,professorId);
412 412
            ResultSet rs = ps.executeQuery();
413 413
            try{
414
                List<Resource> _result = new ArrayList<Resource>();
414
                List<Resource> resources = new ArrayList<Resource>();
415 415
                while(rs.next()){
416
                    Resource _obj =  new Resource();
417
                    _obj.setResourceId(rs.getString(1));
418
                    _obj.setResourceName(rs.getString(2));
419
                    String _m_2 = rs.getString(3);
416
                    Resource resource =  new Resource();
417
                    resource.setResourceId(rs.getString(1));
418
                    resource.setResourceName(rs.getString(2));
419
                    String subject = rs.getString(3);
420 420
                    if(rs.wasNull()){
421
                        _m_2 = null;
421
                    	subject = null;
422 422
                    }
423
                    _obj.setSubject(_m_2);
424
                    String _m_3 = rs.getString(4);
423
                    resource.setSubject(subject);
424
                    String industry = rs.getString(4);
425 425
                    if(rs.wasNull()){
426
                        _m_3 = null;
426
                    	industry = null;
427 427
                    }
428
                    _obj.setIndustry(_m_3);
429
                    _obj.setSupportedServices(rs.getString(5));
430
                    String _m_4 = rs.getString(6);
428
                    resource.setIndustry(industry);
429
                    resource.setSupportedServices(rs.getString(5));
430
                    String descp = rs.getString(6);
431 431
                    if(rs.wasNull()){
432
                        _m_4 = null;
432
                    	descp = null;
433 433
                    }
434
                    _obj.setDescp(_m_4);
435
                    _obj.setProfessorId(rs.getString(7));
436
                    String _m_5 = rs.getString(8);
434
                    resource.setDescp(descp);
435
                    resource.setProfessorId(rs.getString(7));
436
                    String ascription = rs.getString(8);
437 437
                    if(rs.wasNull()){
438
                        _m_5 = null;
438
                    	ascription = null;
439 439
                    }
440
                    _obj.setAscription(_m_5);
441
                    String _m_6 = rs.getString(9);
440
                    resource.setAscription(ascription);
441
                    String hopePay = rs.getString(9);
442 442
                    if(rs.wasNull()){
443
                        _m_6 = null;
443
                    	hopePay = null;
444 444
                    }
445
                    _obj.setHopePayMethod(_m_6);
446
                    String _m_7 = rs.getString(10);
445
                    resource.setHopePayMethod(hopePay);
446
                    String cooperationNotes = rs.getString(10);
447 447
                    if(rs.wasNull()){
448
                        _m_7 = null;
448
                    	cooperationNotes = null;
449 449
                    }
450
                    _obj.setCooperationNotes(_m_7);
451
                    _obj.setCreateTime(rs.getString(11));
452
                    _obj.setModifyTime(rs.getString(12));
453
                    _result.add(_obj);
450
                    resource.setCooperationNotes(cooperationNotes);
451
                    resource.setCreateTime(rs.getString(11));
452
                    resource.setModifyTime(rs.getString(12));
453
                    resources.add(resource);
454 454
                }
455
                return _result;
455
                return resources;
456 456
            }finally{
457
                try{rs.close();}catch(Exception _m_8){}
457
                try{rs.close();}catch(Exception e1){}
458 458
            }
459 459
        }finally{
460
            try{ps.close();}catch(Exception _m_9){}
460
            try{ps.close();}catch(Exception e2){}
461 461
        }
462 462
    }
463 463
	
@ -474,17 +474,17 @@ public abstract class ResourceDao {
474 474
	 */
475 475
	public PageQueryResult<Resource> queryPageRes(Connection con,String key,String subject,String industry,
476 476
			String province,String address,Integer authType,int pageSize,int pageNo) throws SQLException{
477
        int _m_1 = 0;
478
        PageQueryResult<Resource> _result = new PageQueryResult<Resource>();
479
        int _m_3 = 1;
480
        boolean _m_2 = null == key;
481
        boolean _m_4 = null == subject;
482
        boolean _m_5 = null == industry;
483
        boolean _m5 = null == province;
484
        boolean _m6 = null == address;
485
        boolean _m7 = null == authType;
477
        int total = 0;
478
        PageQueryResult<Resource> queryResult = new PageQueryResult<Resource>();
479
        int index = 1;
480
        boolean hasKey = null != key;
481
        boolean hasSubject = null != subject;
482
        boolean hasIndustry = null != industry;
483
        boolean hsaProvince = null != province;
484
        boolean hasAddress = null != address;
485
        boolean hasAuthType = null != authType;
486 486
        StringBuilder sql = new StringBuilder();
487
        if(!_m_2){
487
        if(hasKey){
488 488
            sql.append(" WHERE ((RESOURCE_NAME LIKE ?) OR (SUPPORTED_SERVICES LIKE ?) "
489 489
            		+ " OR (RESOURCE.SUBJECT LIKE ?) OR (RESOURCE.INDUSTRY LIKE ?) "
490 490
            		+ " OR (RESOURCE.PROFESSOR_ID IN (SELECT PROFESSOR.ID FROM PROFESSOR "
@ -492,177 +492,177 @@ public abstract class ResourceDao {
492 492
            		+ " OR (RESOURCE.PROFESSOR_ID IN (SELECT PROFESSOR.ID FROM PROFESSOR WHERE ORG_ID "
493 493
            		+ " IN(SELECT ORGANIZATION.ID FROM ORGANIZATION WHERE ORGANIZATION.NAME LIKE ?) )) ) ");
494 494
        }
495
        if(!_m_4){
495
        if(hasSubject){
496 496
            sql.append(sql.length() > 0 ? " AND " : " WHERE ").append("(RESOURCE.SUBJECT LIKE ?)");
497 497
        }
498
        if(!_m_5){
498
        if(hasIndustry){
499 499
            sql.append(sql.length() > 0 ? " AND " : " WHERE ").append("(RESOURCE.INDUSTRY LIKE ?)");
500 500
        }
501
        if(!_m5){
501
        if(hsaProvince){
502 502
        	sql.append(sql.length() > 0 ? " AND " : " WHERE ").
503 503
        	append("(RESOURCE.PROFESSOR_ID IN (SELECT PROFESSOR.ID FROM PROFESSOR WHERE PROFESSOR.PROVINCE LIKE ?))");
504 504
        }
505
        if(!_m6){
505
        if(hasAddress){
506 506
        	sql.append(sql.length() > 0 ? " AND " : " WHERE ").
507 507
        	append("(RESOURCE.PROFESSOR_ID IN (SELECT PROFESSOR.ID FROM PROFESSOR WHERE PROFESSOR.ADDRESS LIKE ?))");
508 508
        }
509
        if(!_m7){
509
        if(hasAuthType){
510 510
			sql.append(sql.length() > 0 ? " AND " : " WHERE ").
511 511
			append("(RESOURCE.PROFESSOR_ID IN (SELECT PROFESSOR.ID FROM PROFESSOR WHERE PROFESSOR.AUTH_TYPE = ?))");
512 512
		}
513
        StringBuilder _m_6 = sql;
513
        StringBuilder whereSql = sql;
514 514
        sql = new StringBuilder();
515 515
        sql.append(" SELECT COUNT(1) FROM RESOURCE ");
516
        if(_m_6.length()>0){
517
            sql.append(_m_6);
516
        if(whereSql.length()>0){
517
            sql.append(whereSql);
518 518
        }
519 519
        PreparedStatement ps = con.prepareStatement(sql.toString());
520 520
        try{
521
            if(!_m_2){
522
                ps.setString(_m_3++,key);
523
                ps.setString(_m_3++,key);
524
                ps.setString(_m_3++,key);
525
                ps.setString(_m_3++,key);
526
                ps.setString(_m_3++,key);
527
                ps.setString(_m_3++,key);
528
                ps.setString(_m_3++,key);
529
                ps.setString(_m_3++,key);
521
            if(hasKey){
522
                ps.setString(index++,key);
523
                ps.setString(index++,key);
524
                ps.setString(index++,key);
525
                ps.setString(index++,key);
526
                ps.setString(index++,key);
527
                ps.setString(index++,key);
528
                ps.setString(index++,key);
529
                ps.setString(index++,key);
530 530
            }
531
            if(!_m_4){
532
                ps.setString(_m_3++,subject);
531
            if(hasSubject){
532
                ps.setString(index++,subject);
533 533
            }
534
            if(!_m_5){
535
                ps.setString(_m_3++,industry);
534
            if(hasIndustry){
535
                ps.setString(index++,industry);
536 536
            }
537
            if(!_m5){
538
            	ps.setString(_m_3++,province);
537
            if(hsaProvince){
538
            	ps.setString(index++,province);
539 539
            }
540
            if(!_m6){
541
            	ps.setString(_m_3++,address);
540
            if(hasAddress){
541
            	ps.setString(index++,address);
542 542
            }
543
            if(!_m7){
544
            	ps.setInt(_m_3++,authType);
543
            if(hasAuthType){
544
            	ps.setInt(index++,authType);
545 545
            }
546
            _result.setPageSize(pageSize);
547
            ResultSet _pageRs = ps.executeQuery();
546
            queryResult.setPageSize(pageSize);
547
            ResultSet rs = ps.executeQuery();
548 548
            try{
549
                _pageRs.next();
550
                _m_1 = _pageRs.getInt(1);
549
                rs.next();
550
                total = rs.getInt(1);
551 551
            }finally{
552
                try{_pageRs.close();}catch(Exception _m_8){}
552
                try{rs.close();}catch(Exception e1){}
553 553
            }
554 554
        }finally{
555
            try{ps.close();}catch(Exception _m_9){}
555
            try{ps.close();}catch(Exception e2){}
556 556
        }
557
        _result.setTotal(_m_1);
558
        if(0== _m_1){
559
            _result.setPageNo(1);
560
            _result.setData(Collections.<Resource>emptyList());
561
            return _result;
557
        queryResult.setTotal(total);
558
        if(0== total){
559
        	queryResult.setPageNo(1);
560
        	queryResult.setData(Collections.<Resource>emptyList());
561
            return queryResult;
562 562
        }
563
        _m_3 = 1;
564
        boolean _m_10 = (1 == pageNo);
565
        if(_m_10){
566
            _result.setPageNo(1);
563
        index = 1;
564
        boolean firstPage = (1 == pageNo);
565
        if(firstPage){
566
        	queryResult.setPageNo(1);
567 567
            sql = new StringBuilder();
568 568
            sql.append("SELECT RESOURCE_ID,RESOURCE_NAME,SUBJECT,INDUSTRY,SUPPORTED_SERVICES,DESCP,PROFESSOR_ID,"
569 569
            		+ " ASCRIPTION,HOPE_PAY_METHOD,COOPERATION_NOTES,CREATE_TIME,MODIFY_TIME FROM RESOURCE ");
570
            if(_m_6.length()>0){
571
                sql.append(_m_6);
570
            if(whereSql.length()>0){
571
                sql.append(whereSql);
572 572
            }
573 573
            sql.append(" ORDER BY RESOURCE_NAME");
574 574
            sql.append(" LIMIT ").append(pageSize);
575 575
        }else{
576
            int _m_11 = _m_1 / pageSize;
577
            if(_m_1 % pageSize != 0){
578
                ++_m_11;
576
            int pageNum = total / pageSize;
577
            if(total % pageSize != 0){
578
                ++pageNum;
579 579
            }
580
            if(pageNo > _m_11){
581
                pageNo = _m_11;
580
            if(pageNo > pageNum){
581
                pageNo = pageNum;
582 582
            }
583
            _result.setPageNo(pageNo);
583
            queryResult.setPageNo(pageNo);
584 584
            --pageNo;
585
            int _m_12 = (pageNo * pageSize);
585
            int offset = (pageNo * pageSize);
586 586
            sql = new StringBuilder();
587 587
            sql.append("SELECT RESOURCE_ID,RESOURCE_NAME,SUBJECT,INDUSTRY,SUPPORTED_SERVICES,DESCP,PROFESSOR_ID,"
588 588
            		+ " ASCRIPTION,HOPE_PAY_METHOD,COOPERATION_NOTES,CREATE_TIME,MODIFY_TIME FROM RESOURCE ");
589
            if(_m_6.length()>0){
590
                sql.append(_m_6);
589
            if(whereSql.length()>0){
590
                sql.append(whereSql);
591 591
            }
592 592
            sql.append(" ORDER BY RESOURCE_NAME");
593
            sql.append(" LIMIT ").append(pageSize).append(" OFFSET ").append(_m_12);
593
            sql.append(" LIMIT ").append(pageSize).append(" OFFSET ").append(offset);
594 594
        }
595 595
        ps = con.prepareStatement(sql.toString());
596 596
        try{
597
            if(!_m_2){
598
                ps.setString(_m_3++,key);
599
                ps.setString(_m_3++,key);
600
                ps.setString(_m_3++,key);
601
                ps.setString(_m_3++,key);
602
                ps.setString(_m_3++,key);
603
                ps.setString(_m_3++,key);
604
                ps.setString(_m_3++,key);
605
                ps.setString(_m_3++,key);
597
            if(hasKey){
598
                ps.setString(index++,key);
599
                ps.setString(index++,key);
600
                ps.setString(index++,key);
601
                ps.setString(index++,key);
602
                ps.setString(index++,key);
603
                ps.setString(index++,key);
604
                ps.setString(index++,key);
605
                ps.setString(index++,key);
606 606
            }
607
            if(!_m_4){
608
                ps.setString(_m_3++,subject);
607
            if(hasSubject){
608
                ps.setString(index++,subject);
609 609
            }
610
            if(!_m_5){
611
                ps.setString(_m_3++,industry);
610
            if(hasIndustry){
611
                ps.setString(index++,industry);
612 612
            }
613
            if(!_m5){
614
            	ps.setString(_m_3++,province);
613
            if(hsaProvince){
614
            	ps.setString(index++,province);
615 615
            }
616
            if(!_m6){
617
            	ps.setString(_m_3++,address);
616
            if(hasAddress){
617
            	ps.setString(index++,address);
618 618
            }
619
            if(!_m7){
620
            	ps.setInt(_m_3++,authType);
619
            if(hasAuthType){
620
            	ps.setInt(index++,authType);
621 621
            }
622 622
            ResultSet rs = ps.executeQuery();
623 623
            try{
624
                List<Resource> _m_13 = new ArrayList<Resource>();
625
                _result.setData(_m_13);
626
                int _m_14 = 0;
627
                while((_m_14<pageSize) && rs.next()){
628
                    ++_m_14;
629
                    Resource _obj =  new Resource();
630
                    _obj.setResourceId(rs.getString(1));
631
                    _obj.setResourceName(rs.getString(2));
632
                    String _m_15 = rs.getString(3);
624
                List<Resource> resources = new ArrayList<Resource>();
625
                queryResult.setData(resources);
626
                int size = 0;
627
                while((size<pageSize) && rs.next()){
628
                    ++size;
629
                    Resource resource =  new Resource();
630
                    resource.setResourceId(rs.getString(1));
631
                    resource.setResourceName(rs.getString(2));
632
                    String subj = rs.getString(3);
633 633
                    if(rs.wasNull()){
634
                        _m_15 = null;
634
                    	subj = null;
635 635
                    }
636
                    _obj.setSubject(_m_15);
637
                    String _m_16 = rs.getString(4);
636
                    resource.setSubject(subj);
637
                    String indust = rs.getString(4);
638 638
                    if(rs.wasNull()){
639
                        _m_16 = null;
639
                    	indust = null;
640 640
                    }
641
                    _obj.setIndustry(_m_16);
642
                    _obj.setSupportedServices(rs.getString(5));
643
                    String _m_17 = rs.getString(6);
641
                    resource.setIndustry(indust);
642
                    resource.setSupportedServices(rs.getString(5));
643
                    String descp = rs.getString(6);
644 644
                    if(rs.wasNull()){
645
                        _m_17 = null;
645
                    	descp = null;
646 646
                    }
647
                    _obj.setDescp(_m_17);
648
                    _obj.setProfessorId(rs.getString(7));
649
                    _obj.setAscription(rs.getString(8));
650
                    _obj.setHopePayMethod(rs.getString(9));
651
                    String _m_18 = rs.getString(10);
647
                    resource.setDescp(descp);
648
                    resource.setProfessorId(rs.getString(7));
649
                    resource.setAscription(rs.getString(8));
650
                    resource.setHopePayMethod(rs.getString(9));
651
                    String cooperationNotes = rs.getString(10);
652 652
                    if(rs.wasNull()){
653
                        _m_18 = null;
653
                    	cooperationNotes = null;
654 654
                    }
655
                    _obj.setCooperationNotes(_m_18);
656
                    _obj.setCreateTime(rs.getString(11));
657
                    _obj.setModifyTime(rs.getString(12));
658
                    _m_13.add(_obj);
655
                    resource.setCooperationNotes(cooperationNotes);
656
                    resource.setCreateTime(rs.getString(11));
657
                    resource.setModifyTime(rs.getString(12));
658
                    resources.add(resource);
659 659
                }
660
                return _result;
660
                return queryResult;
661 661
            }finally{
662
                try{rs.close();}catch(Exception _m_19){}
662
                try{rs.close();}catch(Exception e3){}
663 663
            }
664 664
        }finally{
665
            try{ps.close();}catch(Exception _m_20){}
665
            try{ps.close();}catch(Exception e4){}
666 666
        }
667 667
    }
668 668
	
@ -679,198 +679,198 @@ public abstract class ResourceDao {
679 679
	 */
680 680
	public PageQueryResult<Resource> queryPage(Connection con,String key,String subject,String industry,
681 681
			String address,Integer authType,int pageSize,int pageNo) throws SQLException{
682
        int _m_1 = 0;
683
        PageQueryResult<Resource> _result = new PageQueryResult<Resource>();
684
        int _m_3 = 1;
685
        boolean _m_2 = null == key;
686
        boolean _m_4 = null == subject;
687
        boolean _m_5 = null == industry;
688
        boolean _m6 = null == address;
689
        boolean _m7 = null == authType;
682
        int total = 0;
683
        PageQueryResult<Resource> queryResult = new PageQueryResult<Resource>();
684
        int index = 1;
685
        boolean hasKey = null != key;
686
        boolean hasSubject = null != subject;
687
        boolean hasIndustry = null != industry;
688
        boolean hasAddress = null != address;
689
        boolean hasAuthType = null != authType;
690 690
        StringBuilder sql = new StringBuilder();
691
        boolean _m_7 = true;
692
        if(!_m_2){
693
            _m_7 =  false;
691
        boolean state = true;
692
        if(hasKey){
693
            state =  false;
694 694
            sql.append(" WHERE ((RESOURCE_NAME LIKE ?) OR (SUPPORTED_SERVICES LIKE ?) OR (R.SUBJECT LIKE ?) OR (R.INDUSTRY LIKE ?) "
695 695
            		+ " OR (R.PROFESSOR_ID IN (SELECT ID FROM PROFESSOR WHERE ADDRESS LIKE ? OR NAME LIKE ?))"
696 696
            		+ " OR (R.PROFESSOR_ID IN (SELECT ID FROM PROFESSOR WHERE ORG_ID IN(SELECT ID FROM ORGANIZATION WHERE NAME LIKE ?) )) ) ");
697 697
        }
698
        if(!_m_4){
699
            if(_m_7){
700
                _m_7 =  false;
698
        if(hasSubject){
699
            if(state){
700
                state =  false;
701 701
                sql.append(" WHERE (RESOURCE.SUBJECT LIKE ?) ");
702 702
            }else{
703 703
                sql.append(" AND (RESOURCE.SUBJECT LIKE ?) ");
704 704
            }
705 705
        }
706
        if(!_m_5){
707
            if(_m_7){
708
                _m_7 =  false;
706
        if(hasIndustry){
707
            if(state){
708
                state =  false;
709 709
                sql.append(" WHERE (RESOURCE.INDUSTRY LIKE ?) ");
710 710
            }else{
711 711
                sql.append(" AND (RESOURCE.INDUSTRY LIKE ?) ");
712 712
            }
713 713
        }
714
        if(!_m6){
715
        	if(_m_7){
716
        		_m_7 =  false;
714
        if(hasAddress){
715
        	if(state){
716
        		state =  false;
717 717
        		sql.append(" WHERE (RESOURCE.PROFESSOR_ID IN (SELECT PROFESSOR.ID FROM PROFESSOR WHERE PROFESSOR.ADDRESS LIKE ?)) ");
718 718
        	}else{
719 719
        		sql.append(" AND (RESOURCE.PROFESSOR_ID IN (SELECT PROFESSOR.ID FROM PROFESSOR WHERE PROFESSOR.ADDRESS LIKE ?)) ");
720 720
        	}
721 721
        }
722
        if(!_m7){
723
        	if(_m_7){
724
                _m_7 =  false;
722
        if(hasAuthType){
723
        	if(state){
724
                state =  false;
725 725
                sql.append(" WHERE (RESOURCE.PROFESSOR_ID IN (SELECT PROFESSOR.ID FROM PROFESSOR WHERE PROFESSOR.AUTH_TYPE = ?)) ");
726 726
            }else{
727 727
                sql.append(" AND (RESOURCE.PROFESSOR_ID IN (SELECT PROFESSOR.ID FROM PROFESSOR WHERE PROFESSOR.AUTH_TYPE = ?)) ");
728 728
            }
729 729
		}
730
        StringBuilder _m_6 = sql;
730
        StringBuilder whereSql = sql;
731 731
        sql = new StringBuilder();
732 732
        sql.append(" SELECT COUNT(1) FROM RESOURCE R ");
733
        if(_m_6.length()>0){
734
            sql.append(_m_6);
733
        if(whereSql.length()>0){
734
            sql.append(whereSql);
735 735
        }
736 736
        PreparedStatement ps = con.prepareStatement(sql.toString());
737 737
        try{
738
            if(!_m_2){
739
                ps.setString(_m_3++,key);
740
                ps.setString(_m_3++,key);
741
                ps.setString(_m_3++,key);
742
                ps.setString(_m_3++,key);
743
                ps.setString(_m_3++,key);
744
                ps.setString(_m_3++,key);
745
                ps.setString(_m_3++,key);
738
            if(hasKey){
739
                ps.setString(index++,key);
740
                ps.setString(index++,key);
741
                ps.setString(index++,key);
742
                ps.setString(index++,key);
743
                ps.setString(index++,key);
744
                ps.setString(index++,key);
745
                ps.setString(index++,key);
746 746
            }
747
            if(!_m_4){
748
                ps.setString(_m_3++,subject);
747
            if(hasSubject){
748
                ps.setString(index++,subject);
749 749
            }
750
            if(!_m_5){
751
                ps.setString(_m_3++,industry);
750
            if(hasIndustry){
751
                ps.setString(index++,industry);
752 752
            }
753
            if(!_m6){
754
            	ps.setString(_m_3++,address);
753
            if(hasAddress){
754
            	ps.setString(index++,address);
755 755
            }
756
            if(!_m7){
757
            	ps.setInt(_m_3++, authType);
756
            if(hasAuthType){
757
            	ps.setInt(index++, authType);
758 758
            }
759
            _result.setPageSize(pageSize);
760
            ResultSet _pageRs = ps.executeQuery();
759
            queryResult.setPageSize(pageSize);
760
            ResultSet rs = ps.executeQuery();
761 761
            try{
762
                _pageRs.next();
763
                _m_1 = _pageRs.getInt(1);
762
                rs.next();
763
                total = rs.getInt(1);
764 764
            }finally{
765
                try{_pageRs.close();}catch(Exception _m_8){}
765
                try{rs.close();}catch(Exception e1){}
766 766
            }
767 767
        }finally{
768
            try{ps.close();}catch(Exception _m_9){}
768
            try{ps.close();}catch(Exception e2){}
769 769
        }
770
        _result.setTotal(_m_1);
771
        if(0== _m_1){
772
            _result.setPageNo(1);
773
            _result.setData(Collections.<Resource>emptyList());
774
            return _result;
770
        queryResult.setTotal(total);
771
        if(0== total){
772
        	queryResult.setPageNo(1);
773
        	queryResult.setData(Collections.<Resource>emptyList());
774
            return queryResult;
775 775
        }
776
        _m_3 = 1;
777
        boolean _m_10 = (1 == pageNo);
778
        if(_m_10){
779
            _result.setPageNo(1);
776
        index = 1;
777
        boolean firstPage = (1 == pageNo);
778
        if(firstPage){
779
        	queryResult.setPageNo(1);
780 780
            sql = new StringBuilder();
781 781
            sql.append("SELECT RESOURCE_ID,RESOURCE_NAME,R.SUBJECT,R.INDUSTRY,SUPPORTED_SERVICES,R.DESCP,PROFESSOR_ID,"
782 782
            		+ " ASCRIPTION,HOPE_PAY_METHOD,COOPERATION_NOTES,R.CREATE_TIME,R.MODIFY_TIME,P.NAME,P.TITLE,"
783 783
            		+ " P.DEPARTMENT,P.ADDRESS,P.OFFICE,AUTHENTICATION,P.AUTH_TYPE,P.AUTH_STATUS,O.NAME "
784 784
            		+ " FROM RESOURCE R LEFT JOIN PROFESSOR P ON PROFESSOR_ID = P.ID "
785 785
            		+ " LEFT JOIN ORGANIZATION O ON P.ORG_ID = O.ID");
786
            if(_m_6.length()>0){
787
                sql.append(_m_6);
786
            if(whereSql.length()>0){
787
                sql.append(whereSql);
788 788
            }
789 789
            sql.append(" ORDER BY RESOURCE_NAME");
790 790
            sql.append(" LIMIT ").append(pageSize);
791 791
        }else{
792
            int _m_11 = _m_1 / pageSize;
793
            if(_m_1 % pageSize != 0){
794
                ++_m_11;
792
            int pageNum = total / pageSize;
793
            if(total % pageSize != 0){
794
                ++pageNum;
795 795
            }
796
            if(pageNo > _m_11){
797
                pageNo = _m_11;
796
            if(pageNo > pageNum){
797
                pageNo = pageNum;
798 798
            }
799
            _result.setPageNo(pageNo);
799
            queryResult.setPageNo(pageNo);
800 800
            --pageNo;
801
            int _m_12 = (pageNo * pageSize);
801
            int offset = (pageNo * pageSize);
802 802
            sql = new StringBuilder();
803 803
            sql.append("SELECT RESOURCE_ID,RESOURCE_NAME,R.SUBJECT,R.INDUSTRY,SUPPORTED_SERVICES,R.DESCP,PROFESSOR_ID,"
804 804
            		+ " ASCRIPTION,HOPE_PAY_METHOD,COOPERATION_NOTES,R.CREATE_TIME,R.MODIFY_TIME,P.NAME,P.TITLE,"
805 805
            		+ " P.DEPARTMENT,P.ADDRESS,P.OFFICE,AUTHENTICATION,P.AUTH_TYPE,P.AUTH_STATUS,O.NAME "
806 806
            		+ " FROM RESOURCE R LEFT JOIN PROFESSOR P ON PROFESSOR_ID = P.ID "
807 807
            		+ " LEFT JOIN ORGANIZATION O ON P.ORG_ID = O.ID");
808
            if(_m_6.length()>0){
809
                sql.append(_m_6);
808
            if(whereSql.length()>0){
809
                sql.append(whereSql);
810 810
            }
811 811
            sql.append(" ORDER BY RESOURCE_NAME");
812
            sql.append(" LIMIT ").append(pageSize).append(" OFFSET ").append(_m_12);
812
            sql.append(" LIMIT ").append(pageSize).append(" OFFSET ").append(offset);
813 813
        }
814 814
        ps = con.prepareStatement(sql.toString());
815 815
        try{
816
            if(!_m_2){
817
                ps.setString(_m_3++,key);
818
                ps.setString(_m_3++,key);
819
                ps.setString(_m_3++,key);
820
                ps.setString(_m_3++,key);
821
                ps.setString(_m_3++,key);
822
                ps.setString(_m_3++,key);
823
                ps.setString(_m_3++,key);
816
            if(hasKey){
817
                ps.setString(index++,key);
818
                ps.setString(index++,key);
819
                ps.setString(index++,key);
820
                ps.setString(index++,key);
821
                ps.setString(index++,key);
822
                ps.setString(index++,key);
823
                ps.setString(index++,key);
824 824
            }
825
            if(!_m_4){
826
                ps.setString(_m_3++,subject);
825
            if(hasSubject){
826
                ps.setString(index++,subject);
827 827
            }
828
            if(!_m_5){
829
                ps.setString(_m_3++,industry);
828
            if(hasIndustry){
829
                ps.setString(index++,industry);
830 830
            }
831
            if(!_m6){
832
            	ps.setString(_m_3++,address);
831
            if(hasAddress){
832
            	ps.setString(index++,address);
833 833
            }
834
            if(!_m7){
835
            	ps.setInt(_m_3++, authType);
834
            if(hasAuthType){
835
            	ps.setInt(index++, authType);
836 836
            }
837 837
            ResultSet rs = ps.executeQuery();
838 838
            try{
839
                List<Resource> _m_13 = new ArrayList<Resource>();
840
                _result.setData(_m_13);
841
                int _m_14 = 0;
842
                while((_m_14<pageSize) && rs.next()){
843
                    ++_m_14;
844
                    Resource _obj =  new Resource();
845
                    _obj.setResourceId(rs.getString(1));
846
                    _obj.setResourceName(rs.getString(2));
847
                    String _m_15 = rs.getString(3);
839
                List<Resource> resources = new ArrayList<Resource>();
840
                queryResult.setData(resources);
841
                int size = 0;
842
                while((size<pageSize) && rs.next()){
843
                    ++size;
844
                    Resource resource =  new Resource();
845
                    resource.setResourceId(rs.getString(1));
846
                    resource.setResourceName(rs.getString(2));
847
                    String subj = rs.getString(3);
848 848
                    if(rs.wasNull()){
849
                        _m_15 = null;
849
                    	subj = null;
850 850
                    }
851
                    _obj.setSubject(_m_15);
852
                    String _m_16 = rs.getString(4);
851
                    resource.setSubject(subj);
852
                    String indust = rs.getString(4);
853 853
                    if(rs.wasNull()){
854
                        _m_16 = null;
854
                    	indust = null;
855 855
                    }
856
                    _obj.setIndustry(_m_16);
857
                    _obj.setSupportedServices(rs.getString(5));
858
                    String _m_17 = rs.getString(6);
856
                    resource.setIndustry(indust);
857
                    resource.setSupportedServices(rs.getString(5));
858
                    String descp = rs.getString(6);
859 859
                    if(rs.wasNull()){
860
                        _m_17 = null;
860
                    	descp = null;
861 861
                    }
862
                    _obj.setDescp(_m_17);
862
                    resource.setDescp(descp);
863 863
                    EditProfessor professor = new EditProfessor();
864 864
                    professor.setId(rs.getString(7));
865
                    _obj.setAscription(rs.getString(8));
866
                    _obj.setHopePayMethod(rs.getString(9));
867
                    String _m_18 = rs.getString(10);
865
                    resource.setAscription(rs.getString(8));
866
                    resource.setHopePayMethod(rs.getString(9));
867
                    String notes = rs.getString(10);
868 868
                    if(rs.wasNull()){
869
                        _m_18 = null;
869
                    	notes = null;
870 870
                    }
871
                    _obj.setCooperationNotes(_m_18);
872
                    _obj.setCreateTime(rs.getString(11));
873
                    _obj.setModifyTime(rs.getString(12));
871
                    resource.setCooperationNotes(notes);
872
                    resource.setCreateTime(rs.getString(11));
873
                    resource.setModifyTime(rs.getString(12));
874 874
                    professor.setName(rs.getString(13));
875 875
                    String title = rs.getString(14);
876 876
                    if(rs.wasNull()){
@ -900,15 +900,15 @@ public abstract class ResourceDao {
900 900
                    	orgName = null;
901 901
                    }
902 902
                    professor.setOrgName(orgName);
903
                    _obj.setEditProfessor(professor);
904
                    _m_13.add(_obj);
903
                    resource.setEditProfessor(professor);
904
                    resources.add(resource);
905 905
                }
906
                return _result;
906
                return queryResult;
907 907
            }finally{
908
                try{rs.close();}catch(Exception _m_19){}
908
                try{rs.close();}catch(Exception e3){}
909 909
            }
910 910
        }finally{
911
            try{ps.close();}catch(Exception _m_20){}
911
            try{ps.close();}catch(Exception e4){}
912 912
        }
913 913
    }
914 914