Selaa lähdekoodia

资源申请的查询接口(待测试)

zzy.zhiyuan.foxmail 8 vuotta sitten
vanhempi
commit
991b347382

+ 197 - 30
src/main/java/com/ekexiu/portal/dao/OperationDao.java

9
import java.util.Collections;
9
import java.util.Collections;
10
import java.util.List;
10
import java.util.List;
11

11

12
import org.jfw.apt.annotation.Autowrie;
13
import org.jfw.apt.annotation.Nullable;
12
import org.jfw.apt.orm.annotation.dao.DAO;
14
import org.jfw.apt.orm.annotation.dao.DAO;
13
import org.jfw.apt.orm.annotation.dao.method.From;
15
import org.jfw.apt.orm.annotation.dao.method.From;
14
import org.jfw.apt.orm.annotation.dao.method.operator.DeleteWith;
16
import org.jfw.apt.orm.annotation.dao.method.operator.DeleteWith;
18
import org.jfw.apt.orm.annotation.dao.param.Set;
20
import org.jfw.apt.orm.annotation.dao.param.Set;
19
import org.jfw.util.PageQueryResult;
21
import org.jfw.util.PageQueryResult;
20

22

23
import com.ekexiu.portal.po.Image;
21
import com.ekexiu.portal.po.Operation;
24
import com.ekexiu.portal.po.Operation;
22
import com.ekexiu.portal.po.Professor;
25
import com.ekexiu.portal.po.Professor;
23
import com.ekexiu.portal.po.Resource;
26
import com.ekexiu.portal.po.Resource;
24

27

25
@DAO
28
@DAO
26
public abstract class OperationDao {
29
public abstract class OperationDao {
30
	@Autowrie
31
	private ImageDao imageDao;
32
	
33
	public ImageDao getImageDao() {
34
		return imageDao;
35
	}
36

37
	public void setImageDao(ImageDao imageDao) {
38
		this.imageDao = imageDao;
39
	}
40

27
	@Insert
41
	@Insert
28
	public abstract int insert(Connection con, Operation operation) throws SQLException;
42
	public abstract int insert(Connection con, Operation operation) throws SQLException;
29
	
43
	
50
	@From(Operation.class)
64
	@From(Operation.class)
51
	public abstract int updatePayMethod(Connection con, String operationId, @Set String payMethod) throws SQLException;
65
	public abstract int updatePayMethod(Connection con, String operationId, @Set String payMethod) throws SQLException;
52
	
66
	
53
	public com.ekexiu.portal.po.Operation query(java.sql.Connection con,java.lang.String operationId) throws java.sql.SQLException{
67
	public Operation query(Connection con,String operationId) throws SQLException{
54
        int _m_1 = 1;
68
        int _m_1 = 1;
55
        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_ID = ?";
69
        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_ID = ?";
56
        java.sql.PreparedStatement ps = con.prepareStatement(sql);
70
        PreparedStatement ps = con.prepareStatement(sql);
57
        try{
71
        try{
58
            ps.setString(_m_1++,operationId);
72
            ps.setString(_m_1++,operationId);
59
            java.sql.ResultSet rs = ps.executeQuery();
73
            ResultSet rs = ps.executeQuery();
60
            try{
74
            try{
61
                if(rs.next()){
75
                if(rs.next()){
62
                    com.ekexiu.portal.po.Operation _result = new com.ekexiu.portal.po.Operation();
76
                    Operation _result = new Operation();
63
                    _result.setReplyNotes(rs.getString(1));
77
                    _result.setReplyNotes(rs.getString(1));
64
                    _result.setCreateTime(rs.getString(2));
78
                    _result.setCreateTime(rs.getString(2));
65
                    _result.setOperationId(rs.getString(3));
79
                    _result.setOperationId(rs.getString(3));
94
        }
108
        }
95
    }
109
    }
96
	
110
	
97
	public java.util.List<com.ekexiu.portal.po.Operation> query(java.sql.Connection con) throws java.sql.SQLException{
111
	public List<Operation> query(Connection con) throws SQLException{
98
        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";
112
        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";
99
        java.sql.PreparedStatement ps = con.prepareStatement(sql);
113
        PreparedStatement ps = con.prepareStatement(sql);
100
        try{
114
        try{
101
            java.sql.ResultSet rs = ps.executeQuery();
115
            ResultSet rs = ps.executeQuery();
102
            try{
116
            try{
103
                java.util.List<com.ekexiu.portal.po.Operation> _result = new java.util.ArrayList<com.ekexiu.portal.po.Operation>();
117
                List<Operation> _result = new ArrayList<Operation>();
104
                while(rs.next()){
118
                while(rs.next()){
105
                    com.ekexiu.portal.po.Operation _obj =  new com.ekexiu.portal.po.Operation();
119
                    Operation _obj =  new Operation();
106
                    _obj.setReplyNotes(rs.getString(1));
120
                    _obj.setReplyNotes(rs.getString(1));
107
                    _obj.setCreateTime(rs.getString(2));
121
                    _obj.setCreateTime(rs.getString(2));
108
                    _obj.setOperationId(rs.getString(3));
122
                    _obj.setOperationId(rs.getString(3));
141
//	 * @param con
155
//	 * @param con
142
//	 * @param demandId 请求者ID
156
//	 * @param demandId 请求者ID
143
//	 * @return
157
//	 * @return
144
//	 * @throws java.sql.SQLException
158
//	 * @throws SQLException
145
//	 */
159
//	 */
146
//	public java.util.List<com.ekexiu.portal.po.Operation> queryDem(java.sql.Connection con,java.lang.String demandId) throws java.sql.SQLException{
160
//	public List<Operation> queryDem(Connection con,String demandId) throws SQLException{
147
//        int _m_1 = 1;
161
//        int _m_1 = 1;
148
//        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 = ?";
162
//        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 = ?";
149
//        java.sql.PreparedStatement ps = con.prepareStatement(sql);
163
//        PreparedStatement ps = con.prepareStatement(sql);
150
//        try{
164
//        try{
151
//            ps.setString(_m_1++,demandId);
165
//            ps.setString(_m_1++,demandId);
152
//            java.sql.ResultSet rs = ps.executeQuery();
166
//            ResultSet rs = ps.executeQuery();
153
//            try{
167
//            try{
154
//                java.util.List<com.ekexiu.portal.po.Operation> _result = new java.util.ArrayList<com.ekexiu.portal.po.Operation>();
168
//                List<Operation> _result = new ArrayList<Operation>();
155
//                while(rs.next()){
169
//                while(rs.next()){
156
//                    com.ekexiu.portal.po.Operation _obj =  new com.ekexiu.portal.po.Operation();
170
//                    Operation _obj =  new Operation();
157
//                    _obj.setReplyNotes(rs.getString(1));
171
//                    _obj.setReplyNotes(rs.getString(1));
158
//                    _obj.setCreateTime(rs.getString(2));
172
//                    _obj.setCreateTime(rs.getString(2));
159
//                    _obj.setOperationId(rs.getString(3));
173
//                    _obj.setOperationId(rs.getString(3));
187
//        }
201
//        }
188
//    }
202
//    }
189
	
203
	
204
	public PageQueryResult<Operation> queryPro(Connection con, @Nullable String id,int pageSize,int pageNo) throws SQLException{
205
        int _m_1 = 0;
206
        PageQueryResult<Operation> _result = new PageQueryResult<Operation>();
207
        int _m_3 = 1;
208
        boolean _m_2 = null == id;
209
        StringBuilder sql = new StringBuilder();
210
        boolean _m_5 = true;
211
        if(!_m_2){
212
            _m_5 =  false;
213
            sql.append(" WHERE O.RESOURCE_ID IN (SELECT R.RESOURCE_ID FROM RESOURCE WHERE R.PROFESSOR_ID = ?)");
214
        }
215
        if(!_m_2){
216
            if(_m_5){
217
                _m_5 =  false;
218
                sql.append(" WHERE (O.DEMAND_ID = ?) ");
219
            }else{
220
                sql.append(" OR (O.DEMAND_ID = ?) ");
221
            }
222
        }
223
        StringBuilder _m_4 = sql;
224
        sql = new StringBuilder();
225
        sql.append("SELECT COUNT(1) FROM OPERATION");
226
        if(_m_4.length()>0){
227
            sql.append(_m_4);
228
        }
229
        PreparedStatement ps = con.prepareStatement(sql.toString());
230
        try{
231
            if(!_m_2){
232
                ps.setString(_m_3++,id);
233
            }
234
            if(!_m_2){
235
                ps.setString(_m_3++,id);
236
            }
237
            _result.setPageSize(pageSize);
238
            ResultSet _pageRs = ps.executeQuery();
239
            try{
240
                _pageRs.next();
241
                _m_1 = _pageRs.getInt(1);
242
            }finally{
243
                try{_pageRs.close();}catch(Exception _m_6){}
244
            }
245
        }finally{
246
            try{ps.close();}catch(Exception _m_7){}
247
        }
248
        _result.setTotal(_m_1);
249
        if(0== _m_1){
250
            _result.setPageNo(1);
251
            _result.setData(Collections.<Operation>emptyList());
252
            return _result;
253
        }
254
        _m_3 = 1;
255
        boolean _m_8 = (1 == pageNo);
256
        if(_m_8){
257
            _result.setPageNo(1);
258
            sql = new StringBuilder();
259
            sql.append("SELECT REPLY_NOTES,APPLYSQUARE,OPERATION_ID,OPERATION_STATUS,DEMAND_ID,DETAIL_DEMAND,DELIVER_TIME,O.RESOURCE_ID,DEAL_PRICE,DEAL_TIME,PAY_METHOD,O.CREATE_TIME,R.RESOURCE_NAME,SUPPORTED_SERVICES,R.DESCP,R.PROFESSOR_ID,P1.NAME,P2.NAME FROM OPERATION O LEFT JOIN RESOURCE R ON O.RESOURCE_ID = R.RESOURCE_ID LEFT JOIN PROFESSOR P1 ON DEMAND_ID = P1.ID LEFT JOIN PROFESSOR P2 ON R.PROFESSOR_ID = P2.ID");
260
            if(_m_4.length()>0){
261
                sql.append(_m_4);
262
            }
263
            sql.append(" ORDER BY O.CREATE_TIME DESC ");
264
            sql.append(" LIMIT ").append(pageSize);
265
        }else{
266
            int _m_9 = _m_1 / pageSize;
267
            if(_m_1 % pageSize != 0){
268
                ++_m_9;
269
            }
270
            if(pageNo > _m_9){
271
                pageNo = _m_9;
272
            }
273
            _result.setPageNo(pageNo);
274
            --pageNo;
275
            int _m_10 = (pageNo * pageSize);
276
            sql = new StringBuilder();
277
            sql.append("SELECT REPLY_NOTES,APPLYSQUARE,OPERATION_ID,OPERATION_STATUS,DEMAND_ID,DETAIL_DEMAND,DELIVER_TIME,O.RESOURCE_ID,DEAL_PRICE,DEAL_TIME,PAY_METHOD,O.CREATE_TIME,R.RESOURCE_NAME,SUPPORTED_SERVICES,R.DESCP,R.PROFESSOR_ID,P1.NAME,P2.NAME FROM OPERATION O LEFT JOIN RESOURCE R ON O.RESOURCE_ID = R.RESOURCE_ID LEFT JOIN PROFESSOR P1 ON DEMAND_ID = P1.ID LEFT JOIN PROFESSOR P2 ON R.PROFESSOR_ID = P2.ID");
278
            if(_m_4.length()>0){
279
                sql.append(_m_4);
280
            }
281
            sql.append(" ORDER BY O.CREATE_TIME DESC ");
282
            sql.append(" LIMIT ").append(pageSize).append(" OFFSET ").append(_m_10);
283
        }
284
        ps = con.prepareStatement(sql.toString());
285
        try{
286
            if(!_m_2){
287
                ps.setString(_m_3++,id);
288
            }
289
            if(!_m_2){
290
                ps.setString(_m_3++,id);
291
            }
292
            ResultSet rs = ps.executeQuery();
293
            try{
294
                List<Operation> _m_11 = new ArrayList<Operation>();
295
                _result.setData(_m_11);
296
                int _m_12 = 0;
297
                while((_m_12<pageSize) && rs.next()){
298
                    ++_m_12;
299
                    Operation _obj =  new Operation();
300
                    String _m_13 = rs.getString(1);
301
                    if(rs.wasNull()){
302
                        _m_13 = null;
303
                    }
304
                    _obj.setReplyNotes(_m_13);
305
                    String _m_14 = rs.getString(2);
306
                    if(rs.wasNull()){
307
                        _m_14 = null;
308
                    }
309
                    _obj.setApplysquare(_m_14);
310
                    _obj.setOperationId(rs.getString(3));
311
                    _obj.setOperationStatus(rs.getInt(4));
312
                    Professor professor = new Professor();
313
                    professor.setId(rs.getString(5));
314
                    _obj.setDetailDemand(rs.getString(6));
315
                    _obj.setDeliverTime(rs.getString(7));
316
                    Resource resource = new Resource();
317
                    resource.setResourceId(rs.getString(8));
318
                    java.math.BigDecimal _m_15 = rs.getBigDecimal(9);
319
                    if(rs.wasNull()){
320
                        _m_15 = null;
321
                    }
322
                    _obj.setDealPrice(_m_15);
323
                    String _m_16 = rs.getString(10);
324
                    if(rs.wasNull()){
325
                        _m_16 = null;
326
                    }
327
                    _obj.setDealTime(_m_16);
328
                    String _m_17 = rs.getString(11);
329
                    if(rs.wasNull()){
330
                        _m_17 = null;
331
                    }
332
                    _obj.setPayMethod(_m_17);
333
                    _obj.setCreateTime(rs.getString(12));
334
                    resource.setResourceName(rs.getString(13));
335
                    resource.setSupportedServices(rs.getString(14));
336
                    resource.setDescp(rs.getString(15));
337
                    Professor professor2 = new Professor();
338
                    professor2.setId(rs.getString(16));
339
                    List<Image> images = this.imageDao.queryRes(con, _obj.getResourceId());
340
                    resource.setImages(images);
341
                    professor.setName(rs.getString(17));
342
                    _obj.setProfessor(professor);
343
                    professor2.setName(rs.getString(18));
344
                    resource.setProfessor(professor2);
345
                    _obj.setResource(resource);
346
                    _m_11.add(_obj);
347
                }
348
                return _result;
349
            }finally{
350
                try{rs.close();}catch(Exception _m_18){}
351
            }
352
        }finally{
353
            try{ps.close();}catch(Exception _m_19){}
354
        }
355
    }
356
	
190
	/**
357
	/**
191
	 * 分页按资源申请者ID查资源申请
358
	 * 分页按资源申请者ID查资源申请
192
	 * @param con
359
	 * @param con
444
//	 * @param con
611
//	 * @param con
445
//	 * @param resourceId 资源ID
612
//	 * @param resourceId 资源ID
446
//	 * @return
613
//	 * @return
447
//	 * @throws java.sql.SQLException
614
//	 * @throws SQLException
448
//	 */
615
//	 */
449
//	public java.util.List<com.ekexiu.portal.po.Operation> queryRes(java.sql.Connection con,java.lang.String resourceId) throws java.sql.SQLException{
616
//	public List<Operation> queryRes(Connection con,String resourceId) throws SQLException{
450
//		int _m_1 = 1;
617
//		int _m_1 = 1;
451
//		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 = ?";
618
//		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 = ?";
452
//		java.sql.PreparedStatement ps = con.prepareStatement(sql);
619
//		PreparedStatement ps = con.prepareStatement(sql);
453
//		try{
620
//		try{
454
//			ps.setString(_m_1++,resourceId);
621
//			ps.setString(_m_1++,resourceId);
455
//			java.sql.ResultSet rs = ps.executeQuery();
622
//			ResultSet rs = ps.executeQuery();
456
//			try{
623
//			try{
457
//				java.util.List<com.ekexiu.portal.po.Operation> _result = new java.util.ArrayList<com.ekexiu.portal.po.Operation>();
624
//				List<Operation> _result = new ArrayList<Operation>();
458
//				while(rs.next()){
625
//				while(rs.next()){
459
//					com.ekexiu.portal.po.Operation _obj =  new com.ekexiu.portal.po.Operation();
626
//					Operation _obj =  new Operation();
460
//					_obj.setReplyNotes(rs.getString(1));
627
//					_obj.setReplyNotes(rs.getString(1));
461
//					_obj.setCreateTime(rs.getString(2));
628
//					_obj.setCreateTime(rs.getString(2));
462
//					_obj.setOperationId(rs.getString(3));
629
//					_obj.setOperationId(rs.getString(3));
510
	 * @param pageSize 每页记录数
677
	 * @param pageSize 每页记录数
511
	 * @param pageNo 当前页码
678
	 * @param pageNo 当前页码
512
	 * @return
679
	 * @return
513
	 * @throws java.sql.SQLException
680
	 * @throws SQLException
514
	 */
681
	 */
515
	public org.jfw.util.PageQueryResult<com.ekexiu.portal.po.Operation> queryPage(java.sql.Connection con,java.lang.String professorName,java.lang.String resourceName,java.lang.String firstTime,java.lang.String lastTime,java.math.BigDecimal lowPrice,java.math.BigDecimal highPrice,int pageSize,int pageNo) throws java.sql.SQLException{
682
	public PageQueryResult<Operation> queryPage(Connection con,String professorName,String resourceName,String firstTime,String lastTime,java.math.BigDecimal lowPrice,java.math.BigDecimal highPrice,int pageSize,int pageNo) throws SQLException{
516
        int _m_1 = 0;
683
        int _m_1 = 0;
517
        org.jfw.util.PageQueryResult<com.ekexiu.portal.po.Operation> _result = new org.jfw.util.PageQueryResult<com.ekexiu.portal.po.Operation>();
684
        PageQueryResult<Operation> _result = new PageQueryResult<Operation>();
518
        int _m_3 = 1;
685
        int _m_3 = 1;
519
        boolean _m1 = null == professorName;
686
        boolean _m1 = null == professorName;
520
        boolean _m2 = null == resourceName;
687
        boolean _m2 = null == resourceName;
574
        if(_m_4.length()>0){
741
        if(_m_4.length()>0){
575
            sql.append(_m_4);
742
            sql.append(_m_4);
576
        }
743
        }
577
        java.sql.PreparedStatement ps = con.prepareStatement(sql.toString());
744
        PreparedStatement ps = con.prepareStatement(sql.toString());
578
        try{
745
        try{
579
            if(!_m1){
746
            if(!_m1){
580
                ps.setString(_m_3++,professorName);
747
                ps.setString(_m_3++,professorName);
595
                ps.setBigDecimal(_m_3++,highPrice);
762
                ps.setBigDecimal(_m_3++,highPrice);
596
            }
763
            }
597
            _result.setPageSize(pageSize);
764
            _result.setPageSize(pageSize);
598
            java.sql.ResultSet _pageRs = ps.executeQuery();
765
            ResultSet _pageRs = ps.executeQuery();
599
            try{
766
            try{
600
                _pageRs.next();
767
                _pageRs.next();
601
                _m_1 = _pageRs.getInt(1);
768
                _m_1 = _pageRs.getInt(1);
608
        _result.setTotal(_m_1);
775
        _result.setTotal(_m_1);
609
        if(0== _m_1){
776
        if(0== _m_1){
610
            _result.setPageNo(1);
777
            _result.setPageNo(1);
611
            _result.setData(java.util.Collections.<com.ekexiu.portal.po.Operation>emptyList());
778
            _result.setData(Collections.<Operation>emptyList());
612
            return _result;
779
            return _result;
613
        }
780
        }
614
        _m_3 = 1;
781
        _m_3 = 1;
661
            if(!_m6){
828
            if(!_m6){
662
                ps.setBigDecimal(_m_3++,highPrice);
829
                ps.setBigDecimal(_m_3++,highPrice);
663
            }
830
            }
664
            java.sql.ResultSet rs = ps.executeQuery();
831
            ResultSet rs = ps.executeQuery();
665
            try{
832
            try{
666
                java.util.List<com.ekexiu.portal.po.Operation> _m_11 = new java.util.ArrayList<com.ekexiu.portal.po.Operation>();
833
                List<Operation> _m_11 = new ArrayList<Operation>();
667
                _result.setData(_m_11);
834
                _result.setData(_m_11);
668
                int _m_12 = 0;
835
                int _m_12 = 0;
669
                while((_m_12<pageSize) && rs.next()){
836
                while((_m_12<pageSize) && rs.next()){
670
                    ++_m_12;
837
                    ++_m_12;
671
                    com.ekexiu.portal.po.Operation _obj =  new com.ekexiu.portal.po.Operation();
838
                    Operation _obj =  new Operation();
672
                    _obj.setReplyNotes(rs.getString(1));
839
                    _obj.setReplyNotes(rs.getString(1));
673
                    _obj.setCreateTime(rs.getString(2));
840
                    _obj.setCreateTime(rs.getString(2));
674
                    _obj.setOperationId(rs.getString(3));
841
                    _obj.setOperationId(rs.getString(3));

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

362
        boolean _m_7 = true;
362
        boolean _m_7 = true;
363
        if(!_m_2){
363
        if(!_m_2){
364
            _m_7 =  false;
364
            _m_7 =  false;
365
            sql.append(" WHERE RESOURCE_NAME LIKE ?");
365
            sql.append(" WHERE (RESOURCE_NAME LIKE ?) ");
366
        }
366
        }
367
        if(!_m_2){
367
        if(!_m_2){
368
            if(_m_7){
368
            if(_m_7){
369
                _m_7 =  false;
369
                _m_7 =  false;
370
                sql.append(" WHERE SUPPORTED_SERVICES LIKE ?");
370
                sql.append(" WHERE (SUPPORTED_SERVICES LIKE ?) ");
371
            }else{
371
            }else{
372
                sql.append(" OR SUPPORTED_SERVICES LIKE ?");
372
                sql.append(" OR (SUPPORTED_SERVICES LIKE ?) ");
373
            }
373
            }
374
        }
374
        }
375
        if(!_m_2){
375
        if(!_m_2){
376
            if(_m_7){
376
            if(_m_7){
377
                _m_7 =  false;
377
                _m_7 =  false;
378
                sql.append(" WHERE RESOURCE.DESCP LIKE ?");
378
                sql.append(" WHERE (RESOURCE.DESCP LIKE ?) ");
379
            }else{
379
            }else{
380
                sql.append(" OR RESOURCE.DESCP LIKE ?");
380
                sql.append(" OR (RESOURCE.DESCP LIKE ?) ");
381
            }
381
            }
382
        }
382
        }
383
        if(!_m_2){
383
        if(!_m_2){
384
            if(_m_7){
384
            if(_m_7){
385
                _m_7 =  false;
385
                _m_7 =  false;
386
                sql.append(" WHERE COOPERATION_NOTES LIKE ?");
386
                sql.append(" (WHERE COOPERATION_NOTES LIKE ?) ");
387
            }else{
387
            }else{
388
                sql.append(" OR COOPERATION_NOTES LIKE ?");
388
                sql.append(" OR (COOPERATION_NOTES LIKE ?) ");
389
            }
389
            }
390
        }
390
        }
391
        if(!_m_2){
392
            if(_m_7){
393
                _m_7 =  false;
394
                sql.append(" WHERE RESOURCE.SUBJECT LIKE ?");
395
            }else{
396
                sql.append(" OR RESOURCE.SUBJECT LIKE ?");
397
            }
398
        }
399
        if(!_m_2){
400
        	if(_m_7){
401
        		_m_7 =  false;
402
        		sql.append(" WHERE RESOURCE.INDUSTRY LIKE ?");
403
        	}else{
404
        		sql.append(" OR RESOURCE.INDUSTRY LIKE ?");
405
        	}
406
        }
407
        if(!_m_4){
391
        if(!_m_4){
408
            if(_m_7){
392
            if(_m_7){
409
                _m_7 =  false;
393
                _m_7 =  false;
410
                sql.append(" WHERE RESOURCE.SUBJECT = ?");
394
                sql.append(" WHERE (RESOURCE.SUBJECT LIKE ?) ");
411
            }else{
395
            }else{
412
                sql.append(" OR RESOURCE.SUBJECT = ?");
396
                sql.append(" AND (RESOURCE.SUBJECT LIKE ?) ");
413
            }
397
            }
414
        }
398
        }
415
        if(!_m_5){
399
        if(!_m_5){
416
            if(_m_7){
400
            if(_m_7){
417
                _m_7 =  false;
401
                _m_7 =  false;
418
                sql.append(" WHERE RESOURCE.INDUSTRY = ?");
402
                sql.append(" WHERE (RESOURCE.INDUSTRY LIKE ?) ");
419
            }else{
403
            }else{
420
                sql.append(" OR RESOURCE.INDUSTRY = ?");
404
                sql.append(" AND (RESOURCE.INDUSTRY LIKE ?) ");
421
            }
405
            }
422
        }
406
        }
423
        StringBuilder _m_6 = sql;
407
        StringBuilder _m_6 = sql;
440
            if(!_m_2){
424
            if(!_m_2){
441
                ps.setString(_m_3++,key);
425
                ps.setString(_m_3++,key);
442
            }
426
            }
443
            if(!_m_2){
444
            	ps.setString(_m_3++,key);
445
            }
446
            if(!_m_2){
447
            	ps.setString(_m_3++,key);
448
            }
449
            if(!_m_4){
427
            if(!_m_4){
450
                ps.setString(_m_3++,subject);
428
                ps.setString(_m_3++,subject);
451
            }
429
            }
513
            if(!_m_2){
491
            if(!_m_2){
514
                ps.setString(_m_3++,key);
492
                ps.setString(_m_3++,key);
515
            }
493
            }
516
            if(!_m_2){
517
            	ps.setString(_m_3++,key);
518
            }
519
            if(!_m_2){
520
            	ps.setString(_m_3++,key);
521
            }
522
            if(!_m_4){
494
            if(!_m_4){
523
                ps.setString(_m_3++,subject);
495
                ps.setString(_m_3++,subject);
524
            }
496
            }

+ 7 - 0
src/main/java/com/ekexiu/portal/service/OperationService.java

67
//		return this.operationDao.queryDem(con, demandId);
67
//		return this.operationDao.queryDem(con, demandId);
68
//	}
68
//	}
69
	
69
	
70
	@Get
71
	@Path("/pqpro")
72
	public PageQueryResult<Operation> quetyPro(@JdbcConn(false) Connection con, @Nullable String id, 
73
			@DefaultValue("3") int pageSize, @DefaultValue("1") int pageNo) throws SQLException {
74
		return this.operationDao.queryPro(con, id, pageSize, pageNo);
75
	}
76
	
70
	@Get
77
	@Get
71
	@Path("/pqdem")
78
	@Path("/pqdem")
72
	public PageQueryResult<Operation> queryDemPage(@JdbcConn Connection con, String demandId, 
79
	public PageQueryResult<Operation> queryDemPage(@JdbcConn Connection con, String demandId,