|
@ -1,7 +1,13 @@
|
1
|
1
|
package com.ekexiu.portal.dao;
|
2
|
2
|
|
|
3
|
import java.math.BigDecimal;
|
3
|
4
|
import java.sql.Connection;
|
|
5
|
import java.sql.PreparedStatement;
|
|
6
|
import java.sql.ResultSet;
|
4
|
7
|
import java.sql.SQLException;
|
|
8
|
import java.util.ArrayList;
|
|
9
|
import java.util.Collections;
|
|
10
|
import java.util.List;
|
5
|
11
|
|
6
|
12
|
import org.jfw.apt.orm.annotation.dao.DAO;
|
7
|
13
|
import org.jfw.apt.orm.annotation.dao.method.From;
|
|
@ -10,6 +16,7 @@ import org.jfw.apt.orm.annotation.dao.method.operator.Insert;
|
10
|
16
|
import org.jfw.apt.orm.annotation.dao.method.operator.Update;
|
11
|
17
|
import org.jfw.apt.orm.annotation.dao.method.operator.UpdateWith;
|
12
|
18
|
import org.jfw.apt.orm.annotation.dao.param.Set;
|
|
19
|
import org.jfw.util.PageQueryResult;
|
13
|
20
|
|
14
|
21
|
import com.ekexiu.portal.po.Operation;
|
15
|
22
|
import com.ekexiu.portal.po.Professor;
|
|
@ -125,158 +132,359 @@ public abstract class OperationDao {
|
125
|
132
|
}
|
126
|
133
|
}
|
127
|
134
|
|
|
135
|
// /**
|
|
136
|
// * 按资源请求者ID查资源申请
|
|
137
|
// * @param con
|
|
138
|
// * @param demandId 请求者ID
|
|
139
|
// * @return
|
|
140
|
// * @throws java.sql.SQLException
|
|
141
|
// */
|
|
142
|
// public java.util.List<com.ekexiu.portal.po.Operation> queryDem(java.sql.Connection con,java.lang.String demandId) throws java.sql.SQLException{
|
|
143
|
// int _m_1 = 1;
|
|
144
|
// String sql = "SELECT REPLY_NOTES,OPERATION.CREATE_TIME,OPERATION_ID,OPERATION_STATUS,DEMAND_ID,DETAIL_DEMAND,DELIVER_TIME,OPERATION.RESOURCE_ID,DEAL_PRICE,DEAL_TIME,PAY_METHOD,P1.NAME,RESOURCE_NAME,RESOURCE.PROFESSOR_ID,P2.NAME,APPLYSQUARE FROM OPERATION INNER JOIN PROFESSOR P1 ON DEMAND_ID = P1.ID INNER JOIN RESOURCE ON OPERATION.RESOURCE_ID = RESOURCE.RESOURCE_ID INNER JOIN PROFESSOR P2 ON RESOURCE.PROFESSOR_ID = P2.ID WHERE DEMAND_ID = ?";
|
|
145
|
// java.sql.PreparedStatement ps = con.prepareStatement(sql);
|
|
146
|
// try{
|
|
147
|
// ps.setString(_m_1++,demandId);
|
|
148
|
// java.sql.ResultSet rs = ps.executeQuery();
|
|
149
|
// try{
|
|
150
|
// java.util.List<com.ekexiu.portal.po.Operation> _result = new java.util.ArrayList<com.ekexiu.portal.po.Operation>();
|
|
151
|
// while(rs.next()){
|
|
152
|
// com.ekexiu.portal.po.Operation _obj = new com.ekexiu.portal.po.Operation();
|
|
153
|
// _obj.setReplyNotes(rs.getString(1));
|
|
154
|
// _obj.setCreateTime(rs.getString(2));
|
|
155
|
// _obj.setOperationId(rs.getString(3));
|
|
156
|
// _obj.setOperationStatus(rs.getInt(4));
|
|
157
|
// Professor professor = new Professor();
|
|
158
|
// professor.setId(rs.getString(5));
|
|
159
|
// _obj.setDetailDemand(rs.getString(6));
|
|
160
|
// _obj.setDeliverTime(rs.getString(7));
|
|
161
|
// Resource resource = new Resource();
|
|
162
|
// resource.setResourceId(rs.getString(8));
|
|
163
|
// _obj.setDealPrice(rs.getBigDecimal(9));
|
|
164
|
// _obj.setDealTime(rs.getString(10));
|
|
165
|
// _obj.setPayMethod(rs.getString(11));
|
|
166
|
// professor.setName(rs.getString(12));
|
|
167
|
// _obj.setProfessor(professor);
|
|
168
|
// resource.setResourceName(rs.getString(13));
|
|
169
|
// Professor professor2 = new Professor();
|
|
170
|
// professor2.setId(rs.getString(14));
|
|
171
|
// professor2.setName(rs.getString(15));
|
|
172
|
// resource.setProfessor(professor2);
|
|
173
|
// _obj.setResource(resource);
|
|
174
|
// _obj.setApplysquare(rs.getString(16));
|
|
175
|
// _result.add(_obj);
|
|
176
|
// }
|
|
177
|
// return _result;
|
|
178
|
// }finally{
|
|
179
|
// try{rs.close();}catch(Exception _m_2){}
|
|
180
|
// }
|
|
181
|
// }finally{
|
|
182
|
// try{ps.close();}catch(Exception _m_3){}
|
|
183
|
// }
|
|
184
|
// }
|
|
185
|
|
128
|
186
|
/**
|
129
|
|
* 按资源请求者ID查资源申请
|
|
187
|
* 分页按资源申请者ID查资源申请
|
130
|
188
|
* @param con
|
131
|
|
* @param demandId 请求者ID
|
132
|
|
* @return
|
133
|
|
* @throws java.sql.SQLException
|
|
189
|
* @param demandId 资源申源申请者ID
|
|
190
|
* @param pageSize 每页记录数
|
|
191
|
* @param pageNo 当前页码
|
|
192
|
* @return 返回该用户ID申请的所有资源
|
|
193
|
* @throws SQLException
|
134
|
194
|
*/
|
135
|
|
public java.util.List<com.ekexiu.portal.po.Operation> queryPro(java.sql.Connection con,java.lang.String demandId) throws java.sql.SQLException{
|
136
|
|
int _m_1 = 1;
|
137
|
|
String sql = "SELECT REPLY_NOTES,OPERATION.CREATE_TIME,OPERATION_ID,OPERATION_STATUS,DEMAND_ID,DETAIL_DEMAND,DELIVER_TIME,OPERATION.RESOURCE_ID,DEAL_PRICE,DEAL_TIME,PAY_METHOD,P1.NAME,RESOURCE_NAME,RESOURCE.PROFESSOR_ID,P2.NAME,APPLYSQUARE FROM OPERATION INNER JOIN PROFESSOR P1 ON DEMAND_ID = P1.ID INNER JOIN RESOURCE ON OPERATION.RESOURCE_ID = RESOURCE.RESOURCE_ID INNER JOIN PROFESSOR P2 ON RESOURCE.PROFESSOR_ID = P2.ID WHERE DEMAND_ID = ?";
|
138
|
|
java.sql.PreparedStatement ps = con.prepareStatement(sql);
|
|
195
|
public PageQueryResult<Operation> queryDemPage(Connection con,String demandId,int pageSize,int pageNoSize,int pageNo) throws SQLException{
|
|
196
|
int _m_1 = 0;
|
|
197
|
PageQueryResult<Operation> _result = new PageQueryResult<Operation>();
|
|
198
|
int _m_2 = 1;
|
|
199
|
String sql = null;
|
|
200
|
sql = " WHERE OPERATION.DEMAND_ID = ? ";
|
|
201
|
String _m_3 = sql;
|
|
202
|
sql = "SELECT COUNT(1) FROM OPERATION";
|
|
203
|
sql = sql + _m_3;
|
|
204
|
PreparedStatement ps = con.prepareStatement(sql);
|
139
|
205
|
try{
|
140
|
|
ps.setString(_m_1++,demandId);
|
141
|
|
java.sql.ResultSet rs = ps.executeQuery();
|
|
206
|
ps.setString(_m_2++,demandId);
|
|
207
|
_result.setPageSize(pageSize);
|
|
208
|
ResultSet _pageRs = ps.executeQuery();
|
142
|
209
|
try{
|
143
|
|
java.util.List<com.ekexiu.portal.po.Operation> _result = new java.util.ArrayList<com.ekexiu.portal.po.Operation>();
|
144
|
|
while(rs.next()){
|
145
|
|
com.ekexiu.portal.po.Operation _obj = new com.ekexiu.portal.po.Operation();
|
146
|
|
_obj.setReplyNotes(rs.getString(1));
|
|
210
|
_pageRs.next();
|
|
211
|
_m_1 = _pageRs.getInt(1);
|
|
212
|
}finally{
|
|
213
|
try{_pageRs.close();}catch(Exception _m_4){}
|
|
214
|
}
|
|
215
|
}finally{
|
|
216
|
try{ps.close();}catch(Exception _m_5){}
|
|
217
|
}
|
|
218
|
_result.setTotal(_m_1);
|
|
219
|
if(0== _m_1){
|
|
220
|
_result.setPageNo(1);
|
|
221
|
_result.setData(Collections.<Operation>emptyList());
|
|
222
|
return _result;
|
|
223
|
}
|
|
224
|
_m_2 = 1;
|
|
225
|
boolean _m_6 = (1 == pageNo);
|
|
226
|
if(_m_6){
|
|
227
|
_result.setPageNo(1);
|
|
228
|
sql = "SELECT REPLY_NOTES,OPERATION.CREATE_TIME,APPLYSQUARE,OPERATION_ID,OPERATION_STATUS,DEMAND_ID,DETAIL_DEMAND,DELIVER_TIME,OPERATION.RESOURCE_ID,DEAL_PRICE,DEAL_TIME,PAY_METHOD,P1.NAME,RESOURCE_NAME,RESOURCE.PROFESSOR_ID,P2.NAME FROM OPERATION INNER JOIN PROFESSOR P1 ON DEMAND_ID = P1.ID INNER JOIN RESOURCE ON OPERATION.RESOURCE_ID = RESOURCE.RESOURCE_ID INNER JOIN PROFESSOR P2 ON RESOURCE.PROFESSOR_ID = P2.ID";
|
|
229
|
sql = sql + _m_3;
|
|
230
|
sql = sql + "ORDER BY OPERATION.CREATE_TIME DESC";
|
|
231
|
sql = sql + " LIMIT " + pageSize;
|
|
232
|
}else{
|
|
233
|
int _m_7 = _m_1 / pageSize;
|
|
234
|
if(_m_1 % pageSize != 0){
|
|
235
|
++_m_7;
|
|
236
|
}
|
|
237
|
if(pageNo > _m_7){
|
|
238
|
pageNo = _m_7;
|
|
239
|
}
|
|
240
|
_result.setPageNo(pageNo);
|
|
241
|
--pageNo;
|
|
242
|
int _m_8 = (pageNo * pageSize);
|
|
243
|
sql = "SELECT REPLY_NOTES,OPERATION.CREATE_TIME,APPLYSQUARE,OPERATION_ID,OPERATION_STATUS,DEMAND_ID,DETAIL_DEMAND,DELIVER_TIME,OPERATION.RESOURCE_ID,DEAL_PRICE,DEAL_TIME,PAY_METHOD,P1.NAME,RESOURCE_NAME,RESOURCE.PROFESSOR_ID,P2.NAME FROM OPERATION INNER JOIN PROFESSOR P1 ON DEMAND_ID = P1.ID INNER JOIN RESOURCE ON OPERATION.RESOURCE_ID = RESOURCE.RESOURCE_ID INNER JOIN PROFESSOR P2 ON RESOURCE.PROFESSOR_ID = P2.ID";
|
|
244
|
sql = sql + _m_3;
|
|
245
|
sql = sql + "ORDER BY OPERATION.CREATE_TIME DESC";
|
|
246
|
sql = sql + " LIMIT " + pageSize+ " OFFSET "+_m_8;
|
|
247
|
}
|
|
248
|
ps = con.prepareStatement(sql);
|
|
249
|
try{
|
|
250
|
ps.setString(_m_2++,demandId);
|
|
251
|
ResultSet rs = ps.executeQuery();
|
|
252
|
try{
|
|
253
|
List<Operation> _m_9 = new ArrayList<Operation>();
|
|
254
|
_result.setData(_m_9);
|
|
255
|
int _m_10 = 0;
|
|
256
|
while((_m_10<pageSize) && rs.next()){
|
|
257
|
++_m_10;
|
|
258
|
Operation _obj = new Operation();
|
|
259
|
String _m_11 = rs.getString(1);
|
|
260
|
if(rs.wasNull()){
|
|
261
|
_m_11 = null;
|
|
262
|
}
|
|
263
|
_obj.setReplyNotes(_m_11);
|
147
|
264
|
_obj.setCreateTime(rs.getString(2));
|
148
|
|
_obj.setOperationId(rs.getString(3));
|
149
|
|
_obj.setOperationStatus(rs.getInt(4));
|
|
265
|
String _m_12 = rs.getString(3);
|
|
266
|
if(rs.wasNull()){
|
|
267
|
_m_12 = null;
|
|
268
|
}
|
|
269
|
_obj.setApplysquare(_m_12);
|
|
270
|
_obj.setOperationId(rs.getString(4));
|
|
271
|
_obj.setOperationStatus(rs.getInt(5));
|
150
|
272
|
Professor professor = new Professor();
|
151
|
|
professor.setId(rs.getString(5));
|
152
|
|
_obj.setDetailDemand(rs.getString(6));
|
153
|
|
_obj.setDeliverTime(rs.getString(7));
|
|
273
|
professor.setId(rs.getString(6));
|
|
274
|
_obj.setDetailDemand(rs.getString(7));
|
|
275
|
_obj.setDeliverTime(rs.getString(8));
|
154
|
276
|
Resource resource = new Resource();
|
155
|
|
resource.setResourceId(rs.getString(8));
|
156
|
|
_obj.setDealPrice(rs.getBigDecimal(9));
|
157
|
|
_obj.setDealTime(rs.getString(10));
|
158
|
|
_obj.setPayMethod(rs.getString(11));
|
159
|
|
professor.setName(rs.getString(12));
|
|
277
|
resource.setResourceId(rs.getString(9));
|
|
278
|
BigDecimal _m_13 = rs.getBigDecimal(10);
|
|
279
|
if(rs.wasNull()){
|
|
280
|
_m_13 = null;
|
|
281
|
}
|
|
282
|
_obj.setDealPrice(_m_13);
|
|
283
|
String _m_14 = rs.getString(11);
|
|
284
|
if(rs.wasNull()){
|
|
285
|
_m_14 = null;
|
|
286
|
}
|
|
287
|
_obj.setDealTime(_m_14);
|
|
288
|
String _m_15 = rs.getString(12);
|
|
289
|
if(rs.wasNull()){
|
|
290
|
_m_15 = null;
|
|
291
|
}
|
|
292
|
_obj.setPayMethod(_m_15);
|
|
293
|
professor.setName(rs.getString(13));
|
160
|
294
|
_obj.setProfessor(professor);
|
161
|
|
resource.setResourceName(rs.getString(13));
|
162
|
|
Professor professor2 = new Professor();
|
163
|
|
professor2.setId(rs.getString(14));
|
164
|
|
professor2.setName(rs.getString(15));
|
|
295
|
resource.setResourceName(rs.getString(14));
|
|
296
|
Professor professor2 = new Professor();
|
|
297
|
professor2.setId(rs.getString(15));
|
|
298
|
professor2.setName(rs.getString(16));
|
165
|
299
|
resource.setProfessor(professor2);
|
166
|
|
_obj.setResource(resource);
|
167
|
|
_obj.setApplysquare(rs.getString(16));
|
168
|
|
_result.add(_obj);
|
|
300
|
_obj.setResource(resource);
|
|
301
|
_m_9.add(_obj);
|
169
|
302
|
}
|
170
|
303
|
return _result;
|
171
|
304
|
}finally{
|
172
|
|
try{rs.close();}catch(Exception _m_2){}
|
|
305
|
try{rs.close();}catch(Exception _m_16){}
|
173
|
306
|
}
|
174
|
307
|
}finally{
|
175
|
|
try{ps.close();}catch(Exception _m_3){}
|
|
308
|
try{ps.close();}catch(Exception _m_17){}
|
176
|
309
|
}
|
177
|
310
|
}
|
178
|
311
|
|
179
|
312
|
/**
|
180
|
|
* 按资源所有者ID查资源申请
|
181
|
|
* @param con
|
182
|
|
* @param professorId 资源拥有者ID
|
183
|
|
* @return
|
184
|
|
* @throws java.sql.SQLException
|
185
|
|
*/
|
186
|
|
public java.util.List<com.ekexiu.portal.po.Operation> queryDem(java.sql.Connection con,java.lang.String professorId) throws java.sql.SQLException{
|
187
|
|
int _m_1 = 1;
|
188
|
|
String sql = "SELECT REPLY_NOTES,OPERATION.CREATE_TIME,OPERATION_ID,OPERATION_STATUS,DEMAND_ID,DETAIL_DEMAND,DELIVER_TIME,OPERATION.RESOURCE_ID,DEAL_PRICE,DEAL_TIME,PAY_METHOD,P1.NAME,RESOURCE_NAME,RESOURCE.PROFESSOR_ID,P2.NAME,APPLYSQUARE FROM OPERATION INNER JOIN PROFESSOR P1 ON DEMAND_ID = P1.ID INNER JOIN RESOURCE ON OPERATION.RESOURCE_ID = RESOURCE.RESOURCE_ID INNER JOIN PROFESSOR P2 ON RESOURCE.PROFESSOR_ID = P2.ID WHERE RESOURCE.PROFESSOR_ID = ?";
|
189
|
|
java.sql.PreparedStatement ps = con.prepareStatement(sql);
|
190
|
|
try{
|
191
|
|
ps.setString(_m_1++,professorId);
|
192
|
|
java.sql.ResultSet rs = ps.executeQuery();
|
193
|
|
try{
|
194
|
|
java.util.List<com.ekexiu.portal.po.Operation> _result = new java.util.ArrayList<com.ekexiu.portal.po.Operation>();
|
195
|
|
while(rs.next()){
|
196
|
|
com.ekexiu.portal.po.Operation _obj = new com.ekexiu.portal.po.Operation();
|
197
|
|
_obj.setReplyNotes(rs.getString(1));
|
198
|
|
_obj.setCreateTime(rs.getString(2));
|
199
|
|
_obj.setOperationId(rs.getString(3));
|
200
|
|
_obj.setOperationStatus(rs.getInt(4));
|
201
|
|
Professor professor = new Professor();
|
202
|
|
professor.setId(rs.getString(5));
|
203
|
|
_obj.setDetailDemand(rs.getString(6));
|
204
|
|
_obj.setDeliverTime(rs.getString(7));
|
205
|
|
Resource resource = new Resource();
|
206
|
|
resource.setResourceId(rs.getString(8));
|
207
|
|
_obj.setDealPrice(rs.getBigDecimal(9));
|
208
|
|
_obj.setDealTime(rs.getString(10));
|
209
|
|
_obj.setPayMethod(rs.getString(11));
|
210
|
|
professor.setName(rs.getString(12));
|
211
|
|
_obj.setProfessor(professor);
|
212
|
|
resource.setResourceName(rs.getString(13));
|
213
|
|
Professor professor2 = new Professor();
|
214
|
|
professor2.setId(rs.getString(14));
|
215
|
|
professor2.setName(rs.getString(15));
|
216
|
|
resource.setProfessor(professor2);
|
217
|
|
_obj.setResource(resource);
|
218
|
|
_obj.setApplysquare(rs.getString(16));
|
219
|
|
_result.add(_obj);
|
220
|
|
}
|
221
|
|
return _result;
|
222
|
|
}finally{
|
223
|
|
try{rs.close();}catch(Exception _m_2){}
|
224
|
|
}
|
225
|
|
}finally{
|
226
|
|
try{ps.close();}catch(Exception _m_3){}
|
227
|
|
}
|
228
|
|
}
|
229
|
|
|
230
|
|
/**
|
231
|
|
* 按资源ID查资源申请,返回资申请人姓名和资源名称
|
|
313
|
* 分页按资源ID查资源申请,返回资申请人姓名和资源名称
|
232
|
314
|
* @param con
|
233
|
315
|
* @param resourceId 资源ID
|
234
|
|
* @return
|
235
|
|
* @throws java.sql.SQLException
|
|
316
|
* @param pageSize 每页记录数
|
|
317
|
* @param pageNo 当前页码
|
|
318
|
* @return 返回当前资源ID下的所有资源申请记录
|
|
319
|
* @throws SQLException
|
236
|
320
|
*/
|
237
|
|
public java.util.List<com.ekexiu.portal.po.Operation> queryRes(java.sql.Connection con,java.lang.String resourceId) throws java.sql.SQLException{
|
238
|
|
int _m_1 = 1;
|
239
|
|
String sql = "SELECT REPLY_NOTES,OPERATION.CREATE_TIME,OPERATION_ID,OPERATION_STATUS,DEMAND_ID,DETAIL_DEMAND,DELIVER_TIME,OPERATION.RESOURCE_ID,DEAL_PRICE,DEAL_TIME,PAY_METHOD,P1.NAME,RESOURCE_NAME,RESOURCE.PROFESSOR_ID,P2.NAME,APPLYSQUARE FROM OPERATION INNER JOIN PROFESSOR P1 ON DEMAND_ID = P1.ID INNER JOIN RESOURCE ON OPERATION.RESOURCE_ID = RESOURCE.RESOURCE_ID INNER JOIN PROFESSOR P2 ON RESOURCE.PROFESSOR_ID = P2.ID WHERE OPERATION.RESOURCE_ID = ?";
|
240
|
|
java.sql.PreparedStatement ps = con.prepareStatement(sql);
|
241
|
|
try{
|
242
|
|
ps.setString(_m_1++,resourceId);
|
243
|
|
java.sql.ResultSet rs = ps.executeQuery();
|
244
|
|
try{
|
245
|
|
java.util.List<com.ekexiu.portal.po.Operation> _result = new java.util.ArrayList<com.ekexiu.portal.po.Operation>();
|
246
|
|
while(rs.next()){
|
247
|
|
com.ekexiu.portal.po.Operation _obj = new com.ekexiu.portal.po.Operation();
|
248
|
|
_obj.setReplyNotes(rs.getString(1));
|
249
|
|
_obj.setCreateTime(rs.getString(2));
|
250
|
|
_obj.setOperationId(rs.getString(3));
|
251
|
|
_obj.setOperationStatus(rs.getInt(4));
|
252
|
|
Professor professor = new Professor();
|
253
|
|
professor.setId(rs.getString(5));
|
254
|
|
_obj.setDetailDemand(rs.getString(6));
|
255
|
|
_obj.setDeliverTime(rs.getString(7));
|
256
|
|
Resource resource = new Resource();
|
257
|
|
resource.setResourceId(rs.getString(8));
|
258
|
|
_obj.setDealPrice(rs.getBigDecimal(9));
|
259
|
|
_obj.setDealTime(rs.getString(10));
|
260
|
|
_obj.setPayMethod(rs.getString(11));
|
261
|
|
professor.setName(rs.getString(12));
|
262
|
|
_obj.setProfessor(professor);
|
263
|
|
resource.setResourceName(rs.getString(13));
|
|
321
|
public PageQueryResult<Operation> queryResPage(Connection con,String resourceId,int pageSize,int pageNo) throws SQLException{
|
|
322
|
int _m_1 = 0;
|
|
323
|
PageQueryResult<Operation> _result = new PageQueryResult<Operation>();
|
|
324
|
int _m_2 = 1;
|
|
325
|
String sql = null;
|
|
326
|
sql = " WHERE OPERATION.RESOURCE_ID = ? ";
|
|
327
|
String _m_3 = sql;
|
|
328
|
sql = "SELECT COUNT(1) FROM OPERATION";
|
|
329
|
sql = sql + _m_3;
|
|
330
|
PreparedStatement ps = con.prepareStatement(sql);
|
|
331
|
try{
|
|
332
|
ps.setString(_m_2++,resourceId);
|
|
333
|
_result.setPageSize(pageSize);
|
|
334
|
ResultSet _pageRs = ps.executeQuery();
|
|
335
|
try{
|
|
336
|
_pageRs.next();
|
|
337
|
_m_1 = _pageRs.getInt(1);
|
|
338
|
}finally{
|
|
339
|
try{_pageRs.close();}catch(Exception _m_4){}
|
|
340
|
}
|
|
341
|
}finally{
|
|
342
|
try{ps.close();}catch(Exception _m_5){}
|
|
343
|
}
|
|
344
|
_result.setTotal(_m_1);
|
|
345
|
if(0== _m_1){
|
|
346
|
_result.setPageNo(1);
|
|
347
|
_result.setData(Collections.<Operation>emptyList());
|
|
348
|
return _result;
|
|
349
|
}
|
|
350
|
_m_2 = 1;
|
|
351
|
boolean _m_6 = (1 == pageNo);
|
|
352
|
if(_m_6){
|
|
353
|
_result.setPageNo(1);
|
|
354
|
sql = "SELECT REPLY_NOTES,OPERATION.CREATE_TIME,APPLYSQUARE,OPERATION.OPERATION_ID,OPERATION_STATUS,DEMAND_ID,DETAIL_DEMAND,DELIVER_TIME,OPERATION.RESOURCE_ID,DEAL_PRICE,DEAL_TIME,PAY_METHOD,P1.NAME,RESOURCE_NAME,RESOURCE.PROFESSOR_ID,P2.NAME FROM OPERATION INNER JOIN PROFESSOR P1 ON DEMAND_ID = P1.ID INNER JOIN RESOURCE ON OPERATION.RESOURCE_ID = RESOURCE.RESOURCE_ID INNER JOIN PROFESSOR P2 ON RESOURCE.PROFESSOR_ID = P2.ID ";
|
|
355
|
sql = sql + _m_3;
|
|
356
|
sql = sql + "ORDER BY OPERATION.CREATE_TIME DESC";
|
|
357
|
sql = sql + " LIMIT " + pageSize;
|
|
358
|
}else{
|
|
359
|
int _m_7 = _m_1 / pageSize;
|
|
360
|
if(_m_1 % pageSize != 0){
|
|
361
|
++_m_7;
|
|
362
|
}
|
|
363
|
if(pageNo > _m_7){
|
|
364
|
pageNo = _m_7;
|
|
365
|
}
|
|
366
|
_result.setPageNo(pageNo);
|
|
367
|
--pageNo;
|
|
368
|
int _m_8 = (pageNo * pageSize);
|
|
369
|
sql = "SELECT REPLY_NOTES,OPERATION.CREATE_TIME,APPLYSQUARE,OPERATION.OPERATION_ID,OPERATION_STATUS,DEMAND_ID,DETAIL_DEMAND,DELIVER_TIME,OPERATION.RESOURCE_ID,DEAL_PRICE,DEAL_TIME,PAY_METHOD,P1.NAME,RESOURCE_NAME,RESOURCE.PROFESSOR_ID,P2.NAME FROM OPERATION INNER JOIN PROFESSOR P1 ON DEMAND_ID = P1.ID INNER JOIN RESOURCE ON OPERATION.RESOURCE_ID = RESOURCE.RESOURCE_ID INNER JOIN PROFESSOR P2 ON RESOURCE.PROFESSOR_ID = P2.ID";
|
|
370
|
sql = sql + _m_3;
|
|
371
|
sql = sql + "ORDER BY OPERATION.CREATE_TIME DESC";
|
|
372
|
sql = sql + " LIMIT " + pageSize+ " OFFSET "+_m_8;
|
|
373
|
}
|
|
374
|
ps = con.prepareStatement(sql);
|
|
375
|
try{
|
|
376
|
ps.setString(_m_2++,resourceId);
|
|
377
|
ResultSet rs = ps.executeQuery();
|
|
378
|
try{
|
|
379
|
List<Operation> _m_9 = new ArrayList<Operation>();
|
|
380
|
_result.setData(_m_9);
|
|
381
|
int _m_10 = 0;
|
|
382
|
while((_m_10<pageSize) && rs.next()){
|
|
383
|
++_m_10;
|
|
384
|
Operation _obj = new Operation();
|
|
385
|
String _m_11 = rs.getString(1);
|
|
386
|
if(rs.wasNull()){
|
|
387
|
_m_11 = null;
|
|
388
|
}
|
|
389
|
_obj.setReplyNotes(_m_11);
|
|
390
|
_obj.setCreateTime(rs.getString(2));
|
|
391
|
String _m_12 = rs.getString(3);
|
|
392
|
if(rs.wasNull()){
|
|
393
|
_m_12 = null;
|
|
394
|
}
|
|
395
|
_obj.setApplysquare(_m_12);
|
|
396
|
_obj.setOperationId(rs.getString(4));
|
|
397
|
_obj.setOperationStatus(rs.getInt(5));
|
|
398
|
Professor professor = new Professor();
|
|
399
|
professor.setId(rs.getString(6));
|
|
400
|
_obj.setDetailDemand(rs.getString(7));
|
|
401
|
_obj.setDeliverTime(rs.getString(8));
|
|
402
|
Resource resource = new Resource();
|
|
403
|
resource.setResourceId(rs.getString(9));
|
|
404
|
BigDecimal _m_13 = rs.getBigDecimal(10);
|
|
405
|
if(rs.wasNull()){
|
|
406
|
_m_13 = null;
|
|
407
|
}
|
|
408
|
_obj.setDealPrice(_m_13);
|
|
409
|
String _m_14 = rs.getString(11);
|
|
410
|
if(rs.wasNull()){
|
|
411
|
_m_14 = null;
|
|
412
|
}
|
|
413
|
_obj.setDealTime(_m_14);
|
|
414
|
String _m_15 = rs.getString(12);
|
|
415
|
if(rs.wasNull()){
|
|
416
|
_m_15 = null;
|
|
417
|
}
|
|
418
|
_obj.setPayMethod(_m_15);
|
|
419
|
professor.setName(rs.getString(13));
|
|
420
|
_obj.setProfessor(professor);
|
|
421
|
resource.setResourceName(rs.getString(14));
|
264
|
422
|
Professor professor2 = new Professor();
|
265
|
|
professor2.setId(rs.getString(14));
|
266
|
|
professor2.setName(rs.getString(15));
|
|
423
|
professor2.setId(rs.getString(15));
|
|
424
|
professor2.setName(rs.getString(16));
|
267
|
425
|
resource.setProfessor(professor2);
|
268
|
426
|
_obj.setResource(resource);
|
269
|
|
_obj.setApplysquare(rs.getString(16));
|
270
|
|
_result.add(_obj);
|
271
|
|
}
|
272
|
|
return _result;
|
273
|
|
}finally{
|
274
|
|
try{rs.close();}catch(Exception _m_2){}
|
275
|
|
}
|
276
|
|
}finally{
|
277
|
|
try{ps.close();}catch(Exception _m_3){}
|
278
|
|
}
|
279
|
|
}
|
|
427
|
_m_9.add(_obj);
|
|
428
|
}
|
|
429
|
return _result;
|
|
430
|
}finally{
|
|
431
|
try{rs.close();}catch(Exception _m_16){}
|
|
432
|
}
|
|
433
|
}finally{
|
|
434
|
try{ps.close();}catch(Exception _m_17){}
|
|
435
|
}
|
|
436
|
}
|
|
437
|
|
|
438
|
// /**
|
|
439
|
// * 按资源ID查资源申请,返回资申请人姓名和资源名称
|
|
440
|
// * @param con
|
|
441
|
// * @param resourceId 资源ID
|
|
442
|
// * @return
|
|
443
|
// * @throws java.sql.SQLException
|
|
444
|
// */
|
|
445
|
// public java.util.List<com.ekexiu.portal.po.Operation> queryRes(java.sql.Connection con,java.lang.String resourceId) throws java.sql.SQLException{
|
|
446
|
// int _m_1 = 1;
|
|
447
|
// String sql = "SELECT REPLY_NOTES,OPERATION.CREATE_TIME,OPERATION_ID,OPERATION_STATUS,DEMAND_ID,DETAIL_DEMAND,DELIVER_TIME,OPERATION.RESOURCE_ID,DEAL_PRICE,DEAL_TIME,PAY_METHOD,P1.NAME,RESOURCE_NAME,RESOURCE.PROFESSOR_ID,P2.NAME,APPLYSQUARE FROM OPERATION INNER JOIN PROFESSOR P1 ON DEMAND_ID = P1.ID INNER JOIN RESOURCE ON OPERATION.RESOURCE_ID = RESOURCE.RESOURCE_ID INNER JOIN PROFESSOR P2 ON RESOURCE.PROFESSOR_ID = P2.ID WHERE OPERATION.RESOURCE_ID = ?";
|
|
448
|
// java.sql.PreparedStatement ps = con.prepareStatement(sql);
|
|
449
|
// try{
|
|
450
|
// ps.setString(_m_1++,resourceId);
|
|
451
|
// java.sql.ResultSet rs = ps.executeQuery();
|
|
452
|
// try{
|
|
453
|
// java.util.List<com.ekexiu.portal.po.Operation> _result = new java.util.ArrayList<com.ekexiu.portal.po.Operation>();
|
|
454
|
// while(rs.next()){
|
|
455
|
// com.ekexiu.portal.po.Operation _obj = new com.ekexiu.portal.po.Operation();
|
|
456
|
// _obj.setReplyNotes(rs.getString(1));
|
|
457
|
// _obj.setCreateTime(rs.getString(2));
|
|
458
|
// _obj.setOperationId(rs.getString(3));
|
|
459
|
// _obj.setOperationStatus(rs.getInt(4));
|
|
460
|
// Professor professor = new Professor();
|
|
461
|
// professor.setId(rs.getString(5));
|
|
462
|
// _obj.setDetailDemand(rs.getString(6));
|
|
463
|
// _obj.setDeliverTime(rs.getString(7));
|
|
464
|
// Resource resource = new Resource();
|
|
465
|
// resource.setResourceId(rs.getString(8));
|
|
466
|
// _obj.setDealPrice(rs.getBigDecimal(9));
|
|
467
|
// _obj.setDealTime(rs.getString(10));
|
|
468
|
// _obj.setPayMethod(rs.getString(11));
|
|
469
|
// professor.setName(rs.getString(12));
|
|
470
|
// _obj.setProfessor(professor);
|
|
471
|
// resource.setResourceName(rs.getString(13));
|
|
472
|
// Professor professor2 = new Professor();
|
|
473
|
// professor2.setId(rs.getString(14));
|
|
474
|
// professor2.setName(rs.getString(15));
|
|
475
|
// resource.setProfessor(professor2);
|
|
476
|
// _obj.setResource(resource);
|
|
477
|
// _obj.setApplysquare(rs.getString(16));
|
|
478
|
// _result.add(_obj);
|
|
479
|
// }
|
|
480
|
// return _result;
|
|
481
|
// }finally{
|
|
482
|
// try{rs.close();}catch(Exception _m_2){}
|
|
483
|
// }
|
|
484
|
// }finally{
|
|
485
|
// try{ps.close();}catch(Exception _m_3){}
|
|
486
|
// }
|
|
487
|
// }
|
280
|
488
|
|
281
|
489
|
@DeleteWith
|
282
|
490
|
@From(Operation.class)
|