Selaa lähdekoodia

调整sql结构,方便查询。

zzy.zhiyuan.foxmail 8 vuotta sitten
vanhempi
commit
f57e14c4a0

+ 8 - 2
src/main/java/com/ekexiu/portal/dao/AccessoryDao.java

23
	
23
	
24
	public List<Accessory> queryOper(Connection con, String operationId) throws SQLException {
24
	public List<Accessory> queryOper(Connection con, String operationId) throws SQLException {
25
        int _m_1 = 1;
25
        int _m_1 = 1;
26
        String sql = "SELECT ACCESSORY_ID,ACCESSORY_SRC,ACCESSORY.OPERATION_ID,ACCESSORY.PROFESSOR_ID,ACCESSORY_NAME,ACCESSORY.CREATE_TIME,PROFESSOR.NAME FROM ACCESSORY LEFT JOIN PROFESSOR ON ACCESSORY.PROFESSOR_ID = PROFESSOR.ID WHERE ACCESSORY.OPERATION_ID = ? ORDER BY ACCESSORY.CREATE_TIME";
26
        String sql = "SELECT ACCESSORY_ID,ACCESSORY_SRC,ACCESSORY.OPERATION_ID,"
27
        		+ " ACCESSORY.PROFESSOR_ID,ACCESSORY_NAME,ACCESSORY.CREATE_TIME,PROFESSOR.NAME "
28
        		+ " FROM ACCESSORY LEFT JOIN PROFESSOR ON ACCESSORY.PROFESSOR_ID = PROFESSOR.ID "
29
        		+ " WHERE ACCESSORY.OPERATION_ID = ? ORDER BY ACCESSORY.CREATE_TIME";
27
        PreparedStatement ps = con.prepareStatement(sql);
30
        PreparedStatement ps = con.prepareStatement(sql);
28
        try{
31
        try{
29
            ps.setString(_m_1++,operationId);
32
            ps.setString(_m_1++,operationId);
58
	
61
	
59
	public List<Accessory> queryPro(Connection con, String professorId) throws SQLException {
62
	public List<Accessory> queryPro(Connection con, String professorId) throws SQLException {
60
        int _m_1 = 1;
63
        int _m_1 = 1;
61
        String sql = "SELECT ACCESSORY_ID,ACCESSORY_SRC,ACCESSORY.OPERATION_ID,ACCESSORY.PROFESSOR_ID,ACCESSORY_NAME,ACCESSORY.CREATE_TIME,PROFESSOR.NAME FROM ACCESSORY LEFT JOIN PROFESSOR ON ACCESSORY.PROFESSOR_ID = PROFESSOR.ID WHERE ACCESSORY.PROFESSOR_ID = ? ORDER BY ACCESSORY.CREATE_TIME";
64
        String sql = "SELECT ACCESSORY_ID,ACCESSORY_SRC,ACCESSORY.OPERATION_ID,"
65
        		+ " ACCESSORY.PROFESSOR_ID,ACCESSORY_NAME,ACCESSORY.CREATE_TIME,PROFESSOR.NAME "
66
        		+ " FROM ACCESSORY LEFT JOIN PROFESSOR ON ACCESSORY.PROFESSOR_ID = PROFESSOR.ID "
67
        		+ " WHERE ACCESSORY.PROFESSOR_ID = ? ORDER BY ACCESSORY.CREATE_TIME";
62
        PreparedStatement ps = con.prepareStatement(sql);
68
        PreparedStatement ps = con.prepareStatement(sql);
63
        try{
69
        try{
64
            ps.setString(_m_1++,professorId);
70
            ps.setString(_m_1++,professorId);

+ 20 - 4
src/main/java/com/ekexiu/portal/dao/AssessDao.java

23
	
23
	
24
	public com.ekexiu.portal.po.Assess query(java.sql.Connection con,java.lang.String assessId) throws java.sql.SQLException{
24
	public com.ekexiu.portal.po.Assess query(java.sql.Connection con,java.lang.String assessId) throws java.sql.SQLException{
25
        int _m_1 = 1;
25
        int _m_1 = 1;
26
        String sql = "SELECT ASSESS_ID,STAR_LEVEL,ASSESS.DESCP,ASSESS.OPERATION_ID,ASSESS.RESOURCE_ID,ASSESS.PROFESSOR_ID,RESOURCE_NAME,PROFESSOR.NAME,ASSESS.CREATE_TIME FROM ASSESS INNER JOIN RESOURCE ON ASSESS.RESOURCE_ID = RESOURCE.RESOURCE_ID INNER JOIN PROFESSOR ON ASSESS.PROFESSOR_ID = PROFESSOR.ID WHERE ASSESS_ID = ?";
26
        String sql = "SELECT ASSESS_ID,STAR_LEVEL,ASSESS.DESCP,ASSESS.OPERATION_ID,ASSESS.RESOURCE_ID,"
27
        		+ " ASSESS.PROFESSOR_ID,RESOURCE_NAME,PROFESSOR.NAME,ASSESS.CREATE_TIME "
28
        		+ " FROM ASSESS INNER JOIN RESOURCE ON ASSESS.RESOURCE_ID = RESOURCE.RESOURCE_ID "
29
        		+ " INNER JOIN PROFESSOR ON ASSESS.PROFESSOR_ID = PROFESSOR.ID "
30
        		+ " WHERE ASSESS_ID = ?";
27
        java.sql.PreparedStatement ps = con.prepareStatement(sql);
31
        java.sql.PreparedStatement ps = con.prepareStatement(sql);
28
        try{
32
        try{
29
            ps.setString(_m_1++,assessId);
33
            ps.setString(_m_1++,assessId);
62
	
66
	
63
	public java.util.List<com.ekexiu.portal.po.Assess> queryOper(java.sql.Connection con,java.lang.String operationId) throws java.sql.SQLException{
67
	public java.util.List<com.ekexiu.portal.po.Assess> queryOper(java.sql.Connection con,java.lang.String operationId) throws java.sql.SQLException{
64
        int _m_1 = 1;
68
        int _m_1 = 1;
65
        String sql = "SELECT ASSESS_ID,STAR_LEVEL,ASSESS.DESCP,ASSESS.OPERATION_ID,ASSESS.RESOURCE_ID,ASSESS.PROFESSOR_ID,RESOURCE_NAME,PROFESSOR.NAME,ASSESS.CREATE_TIME FROM ASSESS INNER JOIN RESOURCE ON ASSESS.RESOURCE_ID = RESOURCE.RESOURCE_ID INNER JOIN PROFESSOR ON ASSESS.PROFESSOR_ID = PROFESSOR.ID WHERE ASSESS.OPERATION_ID = ?";
69
        String sql = "SELECT ASSESS_ID,STAR_LEVEL,ASSESS.DESCP,ASSESS.OPERATION_ID,ASSESS.RESOURCE_ID,"
70
        		+ " ASSESS.PROFESSOR_ID,RESOURCE_NAME,PROFESSOR.NAME,ASSESS.CREATE_TIME "
71
        		+ " FROM ASSESS INNER JOIN RESOURCE ON ASSESS.RESOURCE_ID = RESOURCE.RESOURCE_ID "
72
        		+ " INNER JOIN PROFESSOR ON ASSESS.PROFESSOR_ID = PROFESSOR.ID "
73
        		+ " WHERE ASSESS.OPERATION_ID = ?";
66
        java.sql.PreparedStatement ps = con.prepareStatement(sql);
74
        java.sql.PreparedStatement ps = con.prepareStatement(sql);
67
        try{
75
        try{
68
            ps.setString(_m_1++,operationId);
76
            ps.setString(_m_1++,operationId);
101
	
109
	
102
	public java.util.List<com.ekexiu.portal.po.Assess> queryRes(java.sql.Connection con,java.lang.String resourceId) throws java.sql.SQLException{
110
	public java.util.List<com.ekexiu.portal.po.Assess> queryRes(java.sql.Connection con,java.lang.String resourceId) throws java.sql.SQLException{
103
        int _m_1 = 1;
111
        int _m_1 = 1;
104
        String sql = "SELECT ASSESS_ID,STAR_LEVEL,ASSESS.DESCP,ASSESS.OPERATION_ID,ASSESS.RESOURCE_ID,ASSESS.PROFESSOR_ID,RESOURCE_NAME,PROFESSOR.NAME,ASSESS.CREATE_TIME FROM ASSESS INNER JOIN RESOURCE ON ASSESS.RESOURCE_ID = RESOURCE.RESOURCE_ID INNER JOIN PROFESSOR ON ASSESS.PROFESSOR_ID = PROFESSOR.ID WHERE ASSESS.RESOURCE_ID = ?";
112
        String sql = "SELECT ASSESS_ID,STAR_LEVEL,ASSESS.DESCP,ASSESS.OPERATION_ID,ASSESS.RESOURCE_ID,"
113
        		+ " ASSESS.PROFESSOR_ID,RESOURCE_NAME,PROFESSOR.NAME,ASSESS.CREATE_TIME "
114
        		+ " FROM ASSESS INNER JOIN RESOURCE ON ASSESS.RESOURCE_ID = RESOURCE.RESOURCE_ID "
115
        		+ " INNER JOIN PROFESSOR ON ASSESS.PROFESSOR_ID = PROFESSOR.ID "
116
        		+ " WHERE ASSESS.RESOURCE_ID = ?";
105
        java.sql.PreparedStatement ps = con.prepareStatement(sql);
117
        java.sql.PreparedStatement ps = con.prepareStatement(sql);
106
        try{
118
        try{
107
            ps.setString(_m_1++,resourceId);
119
            ps.setString(_m_1++,resourceId);
140
	
152
	
141
	public java.util.List<com.ekexiu.portal.po.Assess> queryPro(java.sql.Connection con,java.lang.String professorId) throws java.sql.SQLException{
153
	public java.util.List<com.ekexiu.portal.po.Assess> queryPro(java.sql.Connection con,java.lang.String professorId) throws java.sql.SQLException{
142
        int _m_1 = 1;
154
        int _m_1 = 1;
143
        String sql = "SELECT ASSESS_ID,STAR_LEVEL,ASSESS.DESCP,ASSESS.OPERATION_ID,ASSESS.RESOURCE_ID,ASSESS.PROFESSOR_ID,RESOURCE_NAME,PROFESSOR.NAME,ASSESS.CREATE_TIME FROM ASSESS INNER JOIN RESOURCE ON ASSESS.RESOURCE_ID = RESOURCE.RESOURCE_ID INNER JOIN PROFESSOR ON ASSESS.PROFESSOR_ID = PROFESSOR.ID WHERE ASSESS.PROFESSOR_ID = ?";
155
        String sql = "SELECT ASSESS_ID,STAR_LEVEL,ASSESS.DESCP,ASSESS.OPERATION_ID,ASSESS.RESOURCE_ID,"
156
        		+ " ASSESS.PROFESSOR_ID,RESOURCE_NAME,PROFESSOR.NAME,ASSESS.CREATE_TIME "
157
        		+ " FROM ASSESS INNER JOIN RESOURCE ON ASSESS.RESOURCE_ID = RESOURCE.RESOURCE_ID "
158
        		+ " INNER JOIN PROFESSOR ON ASSESS.PROFESSOR_ID = PROFESSOR.ID "
159
        		+ " WHERE ASSESS.PROFESSOR_ID = ?";
144
        java.sql.PreparedStatement ps = con.prepareStatement(sql);
160
        java.sql.PreparedStatement ps = con.prepareStatement(sql);
145
        try{
161
        try{
146
            ps.setString(_m_1++,professorId);
162
            ps.setString(_m_1++,professorId);

+ 12 - 3
src/main/java/com/ekexiu/portal/dao/MessagesDao.java

22
	
22
	
23
	public Messages query(Connection con, String messageId) throws SQLException{
23
	public Messages query(Connection con, String messageId) throws SQLException{
24
        int _m_1 = 1;
24
        int _m_1 = 1;
25
        String sql = "SELECT MESSAGE_ID,MESSAGES.OPERATION_ID,MESSAGES.PROFESSOR_ID,LEAVE_WORD,MESSAGES.CREATE_TIME,PROFESSOR.NAME FROM MESSAGES LEFT JOIN PROFESSOR ON MESSAGES.PROFESSOR_ID = PROFESSOR.ID WHERE MESSAGE_ID = ?";
25
        String sql = "SELECT MESSAGE_ID,MESSAGES.OPERATION_ID,MESSAGES.PROFESSOR_ID,"
26
        		+ " LEAVE_WORD,MESSAGES.CREATE_TIME,PROFESSOR.NAME "
27
        		+ " FROM MESSAGES LEFT JOIN PROFESSOR ON MESSAGES.PROFESSOR_ID = PROFESSOR.ID "
28
        		+ " WHERE MESSAGE_ID = ?";
26
        PreparedStatement ps = con.prepareStatement(sql);
29
        PreparedStatement ps = con.prepareStatement(sql);
27
        try{
30
        try{
28
            ps.setString(_m_1++,messageId);
31
            ps.setString(_m_1++,messageId);
52
	
55
	
53
	public List<Messages> queryOper(Connection con, String operationId) throws SQLException{
56
	public List<Messages> queryOper(Connection con, String operationId) throws SQLException{
54
        int _m_1 = 1;
57
        int _m_1 = 1;
55
        String sql = "SELECT MESSAGE_ID,MESSAGES.OPERATION_ID,MESSAGES.PROFESSOR_ID,LEAVE_WORD,MESSAGES.CREATE_TIME,PROFESSOR.NAME FROM MESSAGES LEFT JOIN PROFESSOR ON MESSAGES.PROFESSOR_ID = PROFESSOR.ID WHERE MESSAGES.OPERATION_ID = ?";
58
        String sql = "SELECT MESSAGE_ID,MESSAGES.OPERATION_ID,MESSAGES.PROFESSOR_ID,"
59
        		+ " LEAVE_WORD,MESSAGES.CREATE_TIME,PROFESSOR.NAME "
60
        		+ " FROM MESSAGES LEFT JOIN PROFESSOR ON MESSAGES.PROFESSOR_ID = PROFESSOR.ID "
61
        		+ " WHERE MESSAGES.OPERATION_ID = ?";
56
        PreparedStatement ps = con.prepareStatement(sql);
62
        PreparedStatement ps = con.prepareStatement(sql);
57
        try{
63
        try{
58
            ps.setString(_m_1++,operationId);
64
            ps.setString(_m_1++,operationId);
82
	
88
	
83
	public List<Messages> quetyPro(Connection con,String operationId, String professorId) throws SQLException{
89
	public List<Messages> quetyPro(Connection con,String operationId, String professorId) throws SQLException{
84
        int _m_1 = 1;
90
        int _m_1 = 1;
85
        String sql = "SELECT MESSAGE_ID,MESSAGES.OPERATION_ID,MESSAGES.PROFESSOR_ID,LEAVE_WORD,MESSAGES.CREATE_TIME,PROFESSOR.NAME FROM MESSAGES LEFT JOIN PROFESSOR ON MESSAGES.PROFESSOR_ID = PROFESSOR.ID WHERE MESSAGES.OPERATION_ID = ? AND MESSAGES.PROFESSOR_ID = ?";
91
        String sql = "SELECT MESSAGE_ID,MESSAGES.OPERATION_ID,MESSAGES.PROFESSOR_ID,"
92
        		+ " LEAVE_WORD,MESSAGES.CREATE_TIME,PROFESSOR.NAME "
93
        		+ " FROM MESSAGES LEFT JOIN PROFESSOR ON MESSAGES.PROFESSOR_ID = PROFESSOR.ID "
94
        		+ " WHERE MESSAGES.OPERATION_ID = ? AND MESSAGES.PROFESSOR_ID = ?";
86
        PreparedStatement ps = con.prepareStatement(sql);
95
        PreparedStatement ps = con.prepareStatement(sql);
87
        try{
96
        try{
88
        	ps.setString(_m_1++, operationId);
97
        	ps.setString(_m_1++, operationId);

+ 64 - 11
src/main/java/com/ekexiu/portal/dao/OperationDao.java

73
	 * @throws SQLException
73
	 * @throws SQLException
74
	 */
74
	 */
75
	public int queryOnGoingOper(Connection con, @Nullable String professorId) throws SQLException {
75
	public int queryOnGoingOper(Connection con, @Nullable String professorId) throws SQLException {
76
		String sql = " SELECT COUNT(1) FROM OPERATION O WHERE (OPERATION_STATUS IN (1,2,3,7)) AND (O.RESOURCE_ID IN (SELECT R.RESOURCE_ID FROM RESOURCE R WHERE R.PROFESSOR_ID = ?) OR O.DEMAND_ID = ?) ";
76
		String sql = " SELECT COUNT(1) FROM OPERATION O WHERE (OPERATION_STATUS IN (1,2,3,7)) "
77
				+ " AND (O.RESOURCE_ID IN (SELECT R.RESOURCE_ID FROM RESOURCE R WHERE R.PROFESSOR_ID = ?) "
78
				+ " OR O.DEMAND_ID = ?) ";
77
		PreparedStatement ps = con.prepareStatement(sql);
79
		PreparedStatement ps = con.prepareStatement(sql);
78
		ps.setString(1, professorId);
80
		ps.setString(1, professorId);
79
		ps.setString(2, professorId);
81
		ps.setString(2, professorId);
85
	
87
	
86
	public Operation query(Connection con,String operationId) throws SQLException{
88
	public Operation query(Connection con,String operationId) throws SQLException{
87
        int _m_1 = 1;
89
        int _m_1 = 1;
88
        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 = ?";
90
        String sql = "SELECT REPLY_NOTES,OPERATION.CREATE_TIME,OPERATION_ID,OPERATION_STATUS,"
91
        		+ " DEMAND_ID,DETAIL_DEMAND,DELIVER_TIME,OPERATION.RESOURCE_ID,DEAL_PRICE,DEAL_TIME,"
92
        		+ " PAY_METHOD,P1.NAME,RESOURCE_NAME,RESOURCE.PROFESSOR_ID,P2.NAME,APPLYSQUARE "
93
        		+ " FROM OPERATION INNER JOIN PROFESSOR P1 ON DEMAND_ID = P1.ID "
94
        		+ " INNER JOIN RESOURCE ON OPERATION.RESOURCE_ID = RESOURCE.RESOURCE_ID "
95
        		+ " INNER JOIN PROFESSOR P2 ON RESOURCE.PROFESSOR_ID = P2.ID "
96
        		+ " WHERE OPERATION_ID = ?";
89
        PreparedStatement ps = con.prepareStatement(sql);
97
        PreparedStatement ps = con.prepareStatement(sql);
90
        try{
98
        try{
91
            ps.setString(_m_1++,operationId);
99
            ps.setString(_m_1++,operationId);
128
    }
136
    }
129
	
137
	
130
	public List<Operation> query(Connection con) throws SQLException{
138
	public List<Operation> query(Connection con) throws SQLException{
131
        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";
139
        String sql = "SELECT REPLY_NOTES,OPERATION.CREATE_TIME,OPERATION_ID,OPERATION_STATUS,"
140
        		+ " DEMAND_ID,DETAIL_DEMAND,DELIVER_TIME,OPERATION.RESOURCE_ID,DEAL_PRICE,DEAL_TIME,"
141
        		+ " PAY_METHOD,P1.NAME,RESOURCE_NAME,RESOURCE.PROFESSOR_ID,P2.NAME,APPLYSQUARE "
142
        		+ " FROM OPERATION INNER JOIN PROFESSOR P1 ON DEMAND_ID = P1.ID "
143
        		+ " INNER JOIN RESOURCE ON OPERATION.RESOURCE_ID = RESOURCE.RESOURCE_ID "
144
        		+ " INNER JOIN PROFESSOR P2 ON RESOURCE.PROFESSOR_ID = P2.ID";
132
        PreparedStatement ps = con.prepareStatement(sql);
145
        PreparedStatement ps = con.prepareStatement(sql);
133
        try{
146
        try{
134
            ResultSet rs = ps.executeQuery();
147
            ResultSet rs = ps.executeQuery();
275
        if(_m_8){
288
        if(_m_8){
276
            _result.setPageNo(1);
289
            _result.setPageNo(1);
277
            sql = new StringBuilder();
290
            sql = new StringBuilder();
278
            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");
291
            sql.append("SELECT REPLY_NOTES,APPLYSQUARE,OPERATION_ID,OPERATION_STATUS,DEMAND_ID,"
292
            		+ " DETAIL_DEMAND,DELIVER_TIME,O.RESOURCE_ID,DEAL_PRICE,DEAL_TIME,PAY_METHOD,"
293
            		+ " O.CREATE_TIME,R.RESOURCE_NAME,SUPPORTED_SERVICES,R.DESCP,R.PROFESSOR_ID,P1.NAME,P2.NAME "
294
            		+ " FROM OPERATION O LEFT JOIN RESOURCE R ON O.RESOURCE_ID = R.RESOURCE_ID "
295
            		+ " LEFT JOIN PROFESSOR P1 ON DEMAND_ID = P1.ID "
296
            		+ " LEFT JOIN PROFESSOR P2 ON R.PROFESSOR_ID = P2.ID");
279
            if(_m_4.length()>0){
297
            if(_m_4.length()>0){
280
                sql.append(_m_4);
298
                sql.append(_m_4);
281
            }
299
            }
293
            --pageNo;
311
            --pageNo;
294
            int _m_10 = (pageNo * pageSize);
312
            int _m_10 = (pageNo * pageSize);
295
            sql = new StringBuilder();
313
            sql = new StringBuilder();
296
            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");
314
            sql.append("SELECT REPLY_NOTES,APPLYSQUARE,OPERATION_ID,OPERATION_STATUS,DEMAND_ID,"
315
            		+ " DETAIL_DEMAND,DELIVER_TIME,O.RESOURCE_ID,DEAL_PRICE,DEAL_TIME,PAY_METHOD,"
316
            		+ " O.CREATE_TIME,R.RESOURCE_NAME,SUPPORTED_SERVICES,R.DESCP,R.PROFESSOR_ID,P1.NAME,P2.NAME "
317
            		+ " FROM OPERATION O LEFT JOIN RESOURCE R ON O.RESOURCE_ID = R.RESOURCE_ID "
318
            		+ " LEFT JOIN PROFESSOR P1 ON DEMAND_ID = P1.ID "
319
            		+ " LEFT JOIN PROFESSOR P2 ON R.PROFESSOR_ID = P2.ID");
297
            if(_m_4.length()>0){
320
            if(_m_4.length()>0){
298
                sql.append(_m_4);
321
                sql.append(_m_4);
299
            }
322
            }
415
        boolean _m_6 = (1 == pageNo);
438
        boolean _m_6 = (1 == pageNo);
416
        if(_m_6){
439
        if(_m_6){
417
            _result.setPageNo(1);
440
            _result.setPageNo(1);
418
            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";
441
            sql = "SELECT REPLY_NOTES,OPERATION.CREATE_TIME,APPLYSQUARE,OPERATION_ID,OPERATION_STATUS,"
442
            		+ " DEMAND_ID,DETAIL_DEMAND,DELIVER_TIME,OPERATION.RESOURCE_ID,DEAL_PRICE,DEAL_TIME,"
443
            		+ " PAY_METHOD,P1.NAME,RESOURCE_NAME,RESOURCE.PROFESSOR_ID,P2.NAME "
444
            		+ " FROM OPERATION INNER JOIN PROFESSOR P1 ON DEMAND_ID = P1.ID "
445
            		+ " INNER JOIN RESOURCE ON OPERATION.RESOURCE_ID = RESOURCE.RESOURCE_ID "
446
            		+ " INNER JOIN PROFESSOR P2 ON RESOURCE.PROFESSOR_ID = P2.ID";
419
            sql = sql + _m_3;
447
            sql = sql + _m_3;
420
            sql = sql + "ORDER BY OPERATION.CREATE_TIME DESC";
448
            sql = sql + "ORDER BY OPERATION.CREATE_TIME DESC";
421
            sql = sql + " LIMIT " + pageSize;
449
            sql = sql + " LIMIT " + pageSize;
430
            _result.setPageNo(pageNo);
458
            _result.setPageNo(pageNo);
431
            --pageNo;
459
            --pageNo;
432
            int _m_8 = (pageNo * pageSize);
460
            int _m_8 = (pageNo * pageSize);
433
            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";
461
            sql = "SELECT REPLY_NOTES,OPERATION.CREATE_TIME,APPLYSQUARE,OPERATION_ID,OPERATION_STATUS,"
462
            		+ " DEMAND_ID,DETAIL_DEMAND,DELIVER_TIME,OPERATION.RESOURCE_ID,DEAL_PRICE,DEAL_TIME,"
463
            		+ " PAY_METHOD,P1.NAME,RESOURCE_NAME,RESOURCE.PROFESSOR_ID,P2.NAME "
464
            		+ " FROM OPERATION INNER JOIN PROFESSOR P1 ON DEMAND_ID = P1.ID "
465
            		+ " INNER JOIN RESOURCE ON OPERATION.RESOURCE_ID = RESOURCE.RESOURCE_ID "
466
            		+ " INNER JOIN PROFESSOR P2 ON RESOURCE.PROFESSOR_ID = P2.ID";
434
            sql = sql + _m_3;
467
            sql = sql + _m_3;
435
            sql = sql + "ORDER BY OPERATION.CREATE_TIME DESC";
468
            sql = sql + "ORDER BY OPERATION.CREATE_TIME DESC";
436
            sql = sql + " LIMIT " + pageSize+ " OFFSET "+_m_8;
469
            sql = sql + " LIMIT " + pageSize+ " OFFSET "+_m_8;
541
        boolean _m_6 = (1 == pageNo);
574
        boolean _m_6 = (1 == pageNo);
542
        if(_m_6){
575
        if(_m_6){
543
            _result.setPageNo(1);
576
            _result.setPageNo(1);
544
            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 ";
577
            sql = "SELECT REPLY_NOTES,OPERATION.CREATE_TIME,APPLYSQUARE,OPERATION.OPERATION_ID,OPERATION_STATUS,"
578
            		+ " DEMAND_ID,DETAIL_DEMAND,DELIVER_TIME,OPERATION.RESOURCE_ID,DEAL_PRICE,DEAL_TIME,"
579
            		+ " PAY_METHOD,P1.NAME,RESOURCE_NAME,RESOURCE.PROFESSOR_ID,P2.NAME "
580
            		+ " FROM OPERATION INNER JOIN PROFESSOR P1 ON DEMAND_ID = P1.ID "
581
            		+ " INNER JOIN RESOURCE ON OPERATION.RESOURCE_ID = RESOURCE.RESOURCE_ID "
582
            		+ " INNER JOIN PROFESSOR P2 ON RESOURCE.PROFESSOR_ID = P2.ID ";
545
            sql = sql + _m_3;
583
            sql = sql + _m_3;
546
            sql = sql + "ORDER BY OPERATION.CREATE_TIME DESC";
584
            sql = sql + "ORDER BY OPERATION.CREATE_TIME DESC";
547
            sql = sql + " LIMIT " + pageSize;
585
            sql = sql + " LIMIT " + pageSize;
556
            _result.setPageNo(pageNo);
594
            _result.setPageNo(pageNo);
557
            --pageNo;
595
            --pageNo;
558
            int _m_8 = (pageNo * pageSize);
596
            int _m_8 = (pageNo * pageSize);
559
            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";
597
            sql = "SELECT REPLY_NOTES,OPERATION.CREATE_TIME,APPLYSQUARE,OPERATION.OPERATION_ID,OPERATION_STATUS,"
598
            		+ " DEMAND_ID,DETAIL_DEMAND,DELIVER_TIME,OPERATION.RESOURCE_ID,DEAL_PRICE,DEAL_TIME,"
599
            		+ " PAY_METHOD,P1.NAME,RESOURCE_NAME,RESOURCE.PROFESSOR_ID,P2.NAME "
600
            		+ " FROM OPERATION INNER JOIN PROFESSOR P1 ON DEMAND_ID = P1.ID "
601
            		+ " INNER JOIN RESOURCE ON OPERATION.RESOURCE_ID = RESOURCE.RESOURCE_ID "
602
            		+ " INNER JOIN PROFESSOR P2 ON RESOURCE.PROFESSOR_ID = P2.ID";
560
            sql = sql + _m_3;
603
            sql = sql + _m_3;
561
            sql = sql + "ORDER BY OPERATION.CREATE_TIME DESC";
604
            sql = sql + "ORDER BY OPERATION.CREATE_TIME DESC";
562
            sql = sql + " LIMIT " + pageSize+ " OFFSET "+_m_8;
605
            sql = sql + " LIMIT " + pageSize+ " OFFSET "+_m_8;
838
        if(_m_8){
881
        if(_m_8){
839
            _result.setPageNo(1);
882
            _result.setPageNo(1);
840
            sql = new StringBuilder();
883
            sql = new StringBuilder();
841
            sql.append("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 LEFT JOIN PROFESSOR P1 ON DEMAND_ID = P1.ID LEFT JOIN RESOURCE ON OPERATION.RESOURCE_ID = RESOURCE.RESOURCE_ID LEFT JOIN PROFESSOR P2 ON RESOURCE.PROFESSOR_ID = P2.ID");
884
            sql.append("SELECT REPLY_NOTES,OPERATION.CREATE_TIME,OPERATION_ID,OPERATION_STATUS,DEMAND_ID,"
885
            		+ " DETAIL_DEMAND,DELIVER_TIME,OPERATION.RESOURCE_ID,DEAL_PRICE,DEAL_TIME,PAY_METHOD,"
886
            		+ " P1.NAME,RESOURCE_NAME,RESOURCE.PROFESSOR_ID,P2.NAME,APPLYSQUARE "
887
            		+ " FROM OPERATION LEFT JOIN PROFESSOR P1 ON DEMAND_ID = P1.ID "
888
            		+ " LEFT JOIN RESOURCE ON OPERATION.RESOURCE_ID = RESOURCE.RESOURCE_ID "
889
            		+ " LEFT JOIN PROFESSOR P2 ON RESOURCE.PROFESSOR_ID = P2.ID");
842
            if(_m_4.length()>0){
890
            if(_m_4.length()>0){
843
                sql.append(_m_4);
891
                sql.append(_m_4);
844
            }
892
            }
856
            --pageNo;
904
            --pageNo;
857
            int _m_10 = (pageNo * pageSize);
905
            int _m_10 = (pageNo * pageSize);
858
            sql = new StringBuilder();
906
            sql = new StringBuilder();
859
            sql.append("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 LEFT JOIN PROFESSOR P1 ON DEMAND_ID = P1.ID LEFT JOIN RESOURCE ON OPERATION.RESOURCE_ID = RESOURCE.RESOURCE_ID LEFT JOIN PROFESSOR P2 ON RESOURCE.PROFESSOR_ID = P2.ID");
907
            sql.append("SELECT REPLY_NOTES,OPERATION.CREATE_TIME,OPERATION_ID,OPERATION_STATUS,DEMAND_ID,"
908
            		+ " DETAIL_DEMAND,DELIVER_TIME,OPERATION.RESOURCE_ID,DEAL_PRICE,DEAL_TIME,PAY_METHOD,"
909
            		+ " P1.NAME,RESOURCE_NAME,RESOURCE.PROFESSOR_ID,P2.NAME,APPLYSQUARE "
910
            		+ " FROM OPERATION LEFT JOIN PROFESSOR P1 ON DEMAND_ID = P1.ID "
911
            		+ " LEFT JOIN RESOURCE ON OPERATION.RESOURCE_ID = RESOURCE.RESOURCE_ID "
912
            		+ " LEFT JOIN PROFESSOR P2 ON RESOURCE.PROFESSOR_ID = P2.ID");
860
            if(_m_4.length()>0){
913
            if(_m_4.length()>0){
861
                sql.append(_m_4);
914
                sql.append(_m_4);
862
            }
915
            }

+ 10 - 2
src/main/java/com/ekexiu/portal/dao/PayHistoryDao.java

29
	
29
	
30
	public PayHistory query(Connection con,String payHistoryId) throws SQLException, JfwBaseException{
30
	public PayHistory query(Connection con,String payHistoryId) throws SQLException, JfwBaseException{
31
        int _m_1 = 1;
31
        int _m_1 = 1;
32
        String sql = "SELECT PAY_HISTORY_ID,OPERATION_ID,PAID_MONEY,RETURN_MONEY,REMARK,ISONLINE,PAY_TYPE,PAY_STATUS,PAY_HISTORY.PROFESSOR_ID,PAY_HISTORY.CREATE_TIME,PROFESSOR.NAME FROM PAY_HISTORY LEFT JOIN PROFESSOR ON PAY_HISTORY.PROFESSOR_ID = PROFESSOR.ID WHERE PAY_HISTORY_ID = ?";
32
        String sql = "SELECT PAY_HISTORY_ID,OPERATION_ID,PAID_MONEY,RETURN_MONEY,REMARK,ISONLINE,PAY_TYPE,"
33
        		+ " PAY_STATUS,PAY_HISTORY.PROFESSOR_ID,PAY_HISTORY.CREATE_TIME,PROFESSOR.NAME "
34
        		+ " FROM PAY_HISTORY LEFT JOIN PROFESSOR ON PAY_HISTORY.PROFESSOR_ID = PROFESSOR.ID "
35
        		+ " WHERE PAY_HISTORY_ID = ?";
33
        PreparedStatement ps = con.prepareStatement(sql);
36
        PreparedStatement ps = con.prepareStatement(sql);
34
        try{
37
        try{
35
            ps.setString(_m_1++,payHistoryId);
38
            ps.setString(_m_1++,payHistoryId);
68
	
71
	
69
	public List<PayHistory> queryDetail(Connection con,String operationId) throws SQLException{
72
	public List<PayHistory> queryDetail(Connection con,String operationId) throws SQLException{
70
        int _m_1 = 1;
73
        int _m_1 = 1;
71
        String sql = "SELECT PAY_HISTORY_ID,PAY_HISTORY.OPERATION_ID,PAID_MONEY,RETURN_MONEY,REMARK,ISONLINE,PAY_TYPE,PAY_STATUS,PAY_HISTORY.CREATE_TIME,OPERATION.DEAL_PRICE,OPERATION.CREATE_TIME,PAY_HISTORY.PROFESSOR_ID,PROFESSOR.NAME FROM PAY_HISTORY LEFT JOIN OPERATION ON PAY_HISTORY.OPERATION_ID = OPERATION.OPERATION_ID LEFT JOIN PROFESSOR ON PAY_HISTORY.PROFESSOR_ID = PROFESSOR.ID WHERE PAY_HISTORY.OPERATION_ID = ?";
74
        String sql = "SELECT PAY_HISTORY_ID,PAY_HISTORY.OPERATION_ID,PAID_MONEY,RETURN_MONEY,REMARK,ISONLINE,"
75
        		+ " PAY_TYPE,PAY_STATUS,PAY_HISTORY.CREATE_TIME,OPERATION.DEAL_PRICE,OPERATION.CREATE_TIME,"
76
        		+ " PAY_HISTORY.PROFESSOR_ID,PROFESSOR.NAME "
77
        		+ " FROM PAY_HISTORY LEFT JOIN OPERATION ON PAY_HISTORY.OPERATION_ID = OPERATION.OPERATION_ID "
78
        		+ " LEFT JOIN PROFESSOR ON PAY_HISTORY.PROFESSOR_ID = PROFESSOR.ID "
79
        		+ " WHERE PAY_HISTORY.OPERATION_ID = ?";
72
        PreparedStatement ps = con.prepareStatement(sql);
80
        PreparedStatement ps = con.prepareStatement(sql);
73
        try{
81
        try{
74
            ps.setString(_m_1++,operationId);
82
            ps.setString(_m_1++,operationId);

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

65
	public Resource query(Connection con,String resourceId) throws SQLException{
65
	public Resource query(Connection con,String resourceId) throws SQLException{
66
        List<Image> images = this.imageDao.queryRes(con, resourceId);
66
        List<Image> images = this.imageDao.queryRes(con, resourceId);
67
		int _m_1 = 1;
67
		int _m_1 = 1;
68
        String sql = "SELECT RESOURCE_ID,RESOURCE_NAME,RESOURCE.SUBJECT,RESOURCE.INDUSTRY,SUPPORTED_SERVICES,RESOURCE.DESCP,PROFESSOR_ID,ASCRIPTION,HOPE_PAY_METHOD,COOPERATION_NOTES,RESOURCE.CREATE_TIME,RESOURCE.MODIFY_TIME,PROFESSOR.NAME FROM RESOURCE LEFT JOIN PROFESSOR ON PROFESSOR_ID = PROFESSOR.ID WHERE RESOURCE_ID = ?";
68
        String sql = "SELECT RESOURCE_ID,RESOURCE_NAME,RESOURCE.SUBJECT,RESOURCE.INDUSTRY,"
69
        		+ " SUPPORTED_SERVICES,RESOURCE.DESCP,PROFESSOR_ID,ASCRIPTION,HOPE_PAY_METHOD,"
70
        		+ " COOPERATION_NOTES,RESOURCE.CREATE_TIME,RESOURCE.MODIFY_TIME,PROFESSOR.NAME "
71
        		+ " FROM RESOURCE LEFT JOIN PROFESSOR ON PROFESSOR_ID = PROFESSOR.ID WHERE RESOURCE_ID = ?";
69
        PreparedStatement ps = con.prepareStatement(sql);
72
        PreparedStatement ps = con.prepareStatement(sql);
70
        try{
73
        try{
71
            ps.setString(_m_1++,resourceId);
74
            ps.setString(_m_1++,resourceId);
144
        boolean _m_5 = (1 == pageNo);
147
        boolean _m_5 = (1 == pageNo);
145
        if(_m_5){
148
        if(_m_5){
146
            _result.setPageNo(1);
149
            _result.setPageNo(1);
147
            sql = " SELECT RESOURCE_ID,RESOURCE_NAME,RESOURCE.SUBJECT,RESOURCE.INDUSTRY,SUPPORTED_SERVICES,RESOURCE.DESCP,PROFESSOR_ID,ASCRIPTION,HOPE_PAY_METHOD,COOPERATION_NOTES,RESOURCE.CREATE_TIME,RESOURCE.MODIFY_TIME,PROFESSOR.NAME FROM RESOURCE LEFT JOIN PROFESSOR ON PROFESSOR_ID = PROFESSOR.ID ";
150
            sql = " SELECT RESOURCE_ID,RESOURCE_NAME,RESOURCE.SUBJECT,RESOURCE.INDUSTRY,"
151
            		+ " SUPPORTED_SERVICES,RESOURCE.DESCP,PROFESSOR_ID,ASCRIPTION,HOPE_PAY_METHOD,"
152
            		+ " COOPERATION_NOTES,RESOURCE.CREATE_TIME,RESOURCE.MODIFY_TIME,PROFESSOR.NAME "
153
            		+ " FROM RESOURCE LEFT JOIN PROFESSOR ON PROFESSOR_ID = PROFESSOR.ID ";
148
            sql = sql + " ORDER BY RESOURCE_NAME ";
154
            sql = sql + " ORDER BY RESOURCE_NAME ";
149
            sql = sql + " LIMIT " + pageSize;
155
            sql = sql + " LIMIT " + pageSize;
150
        }else{
156
        }else{
158
            _result.setPageNo(pageNo);
164
            _result.setPageNo(pageNo);
159
            --pageNo;
165
            --pageNo;
160
            int _m_7 = (pageNo * pageSize);
166
            int _m_7 = (pageNo * pageSize);
161
            sql = " SELECT RESOURCE_ID,RESOURCE_NAME,RESOURCE.SUBJECT,RESOURCE.INDUSTRY,SUPPORTED_SERVICES,RESOURCE.DESCP,PROFESSOR_ID,ASCRIPTION,HOPE_PAY_METHOD,COOPERATION_NOTES,RESOURCE.CREATE_TIME,RESOURCE.MODIFY_TIME,PROFESSOR.NAME FROM RESOURCE LEFT JOIN PROFESSOR ON PROFESSOR_ID = PROFESSOR.ID ";
167
            sql = " SELECT RESOURCE_ID,RESOURCE_NAME,RESOURCE.SUBJECT,RESOURCE.INDUSTRY,"
168
            		+ " SUPPORTED_SERVICES,RESOURCE.DESCP,PROFESSOR_ID,ASCRIPTION,HOPE_PAY_METHOD,"
169
            		+ " COOPERATION_NOTES,RESOURCE.CREATE_TIME,RESOURCE.MODIFY_TIME,PROFESSOR.NAME "
170
            		+ " FROM RESOURCE LEFT JOIN PROFESSOR ON PROFESSOR_ID = PROFESSOR.ID ";
162
            sql = sql + " ORDER BY RESOURCE_NAME ";
171
            sql = sql + " ORDER BY RESOURCE_NAME ";
163
            sql = sql + " LIMIT " + pageSize+ " OFFSET "+_m_7;
172
            sql = sql + " LIMIT " + pageSize+ " OFFSET "+_m_7;
164
        }
173
        }
279
	
288
	
280
	public List<Resource> queryPro(Connection con,String professorId) throws SQLException{
289
	public List<Resource> queryPro(Connection con,String professorId) throws SQLException{
281
        int _m_1 = 1;
290
        int _m_1 = 1;
282
        String sql = "SELECT RESOURCE_ID,RESOURCE_NAME,SUBJECT,INDUSTRY,SUPPORTED_SERVICES,DESCP,PROFESSOR_ID,ASCRIPTION,HOPE_PAY_METHOD,COOPERATION_NOTES,CREATE_TIME,MODIFY_TIME FROM RESOURCE WHERE PROFESSOR_ID = ? ORDER BY CREATE_TIME DESC";
291
        String sql = "SELECT RESOURCE_ID,RESOURCE_NAME,SUBJECT,INDUSTRY,SUPPORTED_SERVICES,DESCP,"
292
        		+ " PROFESSOR_ID,ASCRIPTION,HOPE_PAY_METHOD,COOPERATION_NOTES,CREATE_TIME,MODIFY_TIME "
293
        		+ " FROM RESOURCE WHERE PROFESSOR_ID = ? ORDER BY CREATE_TIME DESC";
283
        PreparedStatement ps = con.prepareStatement(sql);
294
        PreparedStatement ps = con.prepareStatement(sql);
284
        try{
295
        try{
285
            ps.setString(_m_1++,professorId);
296
            ps.setString(_m_1++,professorId);
364
        boolean _m_7 = true;
375
        boolean _m_7 = true;
365
        if(!_m_2){
376
        if(!_m_2){
366
            _m_7 =  false;
377
            _m_7 =  false;
367
            sql.append(" WHERE ((RESOURCE_NAME LIKE ?) OR (SUPPORTED_SERVICES LIKE ?) OR (RESOURCE.SUBJECT LIKE ?) OR (RESOURCE.INDUSTRY LIKE ?) OR (RESOURCE.PROFESSOR_ID IN (SELECT PROFESSOR.ID FROM PROFESSOR WHERE PROFESSOR.ADDRESS LIKE ?))) ");
378
            sql.append(" WHERE ((RESOURCE_NAME LIKE ?) OR (SUPPORTED_SERVICES LIKE ?) "
379
            		+ " OR (RESOURCE.SUBJECT LIKE ?) OR (RESOURCE.INDUSTRY LIKE ?) "
380
            		+ " OR (RESOURCE.PROFESSOR_ID IN (SELECT PROFESSOR.ID FROM PROFESSOR WHERE PROFESSOR.ADDRESS LIKE ?))) ");
368
        }
381
        }
369
        if(!_m_4){
382
        if(!_m_4){
370
            if(_m_7){
383
            if(_m_7){
436
        if(_m_10){
449
        if(_m_10){
437
            _result.setPageNo(1);
450
            _result.setPageNo(1);
438
            sql = new StringBuilder();
451
            sql = new StringBuilder();
439
            sql.append("SELECT RESOURCE_ID,RESOURCE_NAME,RESOURCE.SUBJECT,RESOURCE.INDUSTRY,SUPPORTED_SERVICES,RESOURCE.DESCP,PROFESSOR_ID,ASCRIPTION,HOPE_PAY_METHOD,COOPERATION_NOTES,RESOURCE.CREATE_TIME,RESOURCE.MODIFY_TIME,PROFESSOR.NAME,PROFESSOR.TITLE,PROFESSOR.DEPARTMENT,PROFESSOR.ADDRESS,ORGANIZATION.NAME FROM RESOURCE LEFT JOIN PROFESSOR ON PROFESSOR_ID = PROFESSOR.ID LEFT JOIN ORGANIZATION ON PROFESSOR.ORG_ID = ORGANIZATION.ID");
452
            sql.append("SELECT RESOURCE_ID,RESOURCE_NAME,RESOURCE.SUBJECT,RESOURCE.INDUSTRY,SUPPORTED_SERVICES,"
453
            		+ " RESOURCE.DESCP,PROFESSOR_ID,ASCRIPTION,HOPE_PAY_METHOD,COOPERATION_NOTES,"
454
            		+ " RESOURCE.CREATE_TIME,RESOURCE.MODIFY_TIME,PROFESSOR.NAME,PROFESSOR.TITLE,"
455
            		+ " PROFESSOR.DEPARTMENT,PROFESSOR.ADDRESS,PROFESSOR.OFFICE,ORGANIZATION.NAME "
456
            		+ " FROM RESOURCE LEFT JOIN PROFESSOR ON PROFESSOR_ID = PROFESSOR.ID "
457
            		+ " LEFT JOIN ORGANIZATION ON PROFESSOR.ORG_ID = ORGANIZATION.ID");
440
            if(_m_6.length()>0){
458
            if(_m_6.length()>0){
441
                sql.append(_m_6);
459
                sql.append(_m_6);
442
            }
460
            }
454
            --pageNo;
472
            --pageNo;
455
            int _m_12 = (pageNo * pageSize);
473
            int _m_12 = (pageNo * pageSize);
456
            sql = new StringBuilder();
474
            sql = new StringBuilder();
457
            sql.append("SELECT RESOURCE_ID,RESOURCE_NAME,RESOURCE.SUBJECT,RESOURCE.INDUSTRY,SUPPORTED_SERVICES,RESOURCE.DESCP,PROFESSOR_ID,ASCRIPTION,HOPE_PAY_METHOD,COOPERATION_NOTES,RESOURCE.CREATE_TIME,RESOURCE.MODIFY_TIME,PROFESSOR.NAME,PROFESSOR.TITLE,PROFESSOR.DEPARTMENT,PROFESSOR.ADDRESS,ORGANIZATION.NAME FROM RESOURCE LEFT JOIN PROFESSOR ON PROFESSOR_ID = PROFESSOR.ID LEFT JOIN ORGANIZATION ON PROFESSOR.ORG_ID = ORGANIZATION.ID");
475
            sql.append("SELECT RESOURCE_ID,RESOURCE_NAME,RESOURCE.SUBJECT,RESOURCE.INDUSTRY,SUPPORTED_SERVICES,"
476
            		+ " RESOURCE.DESCP,PROFESSOR_ID,ASCRIPTION,HOPE_PAY_METHOD,COOPERATION_NOTES,"
477
            		+ " RESOURCE.CREATE_TIME,RESOURCE.MODIFY_TIME,PROFESSOR.NAME,PROFESSOR.TITLE,"
478
            		+ " PROFESSOR.DEPARTMENT,PROFESSOR.ADDRESS,PROFESSOR.OFFICE,ORGANIZATION.NAME "
479
            		+ " FROM RESOURCE LEFT JOIN PROFESSOR ON PROFESSOR_ID = PROFESSOR.ID "
480
            		+ " LEFT JOIN ORGANIZATION ON PROFESSOR.ORG_ID = ORGANIZATION.ID");
458
            if(_m_6.length()>0){
481
            if(_m_6.length()>0){
459
                sql.append(_m_6);
482
                sql.append(_m_6);
460
            }
483
            }
520
                    professor.setTitle(rs.getString(14));
543
                    professor.setTitle(rs.getString(14));
521
                    professor.setDepartment(rs.getString(15));
544
                    professor.setDepartment(rs.getString(15));
522
                    professor.setAddress(rs.getString(16));
545
                    professor.setAddress(rs.getString(16));
523
                    professor.setOrgName(rs.getString(17));
546
                    professor.setOffice(rs.getString(17));
547
                    professor.setOrgName(rs.getString(18));
524
                    _obj.setProfessor(professor);
548
                    _obj.setProfessor(professor);
525
                    List<Image> images = this.imageDao.queryRes(con, _obj.getResourceId());
549
                    List<Image> images = this.imageDao.queryRes(con, _obj.getResourceId());
526
                    _obj.setImages(images);
550
                    _obj.setImages(images);