|
@ -64,6 +64,24 @@ public abstract class OperationDao {
|
64
|
64
|
@From(Operation.class)
|
65
|
65
|
public abstract int updatePayMethod(Connection con, String operationId, @Set String payMethod) throws SQLException;
|
66
|
66
|
|
|
67
|
/**
|
|
68
|
* 查询有多少资源合作正在进行
|
|
69
|
* @param con
|
|
70
|
* @param professorId 登陆者ID
|
|
71
|
* @return 返回正在合作的资源申请数量
|
|
72
|
* @throws SQLException
|
|
73
|
*/
|
|
74
|
public int queryOnGoingOper(Connection con, @Nullable String professorId) throws SQLException {
|
|
75
|
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
|
PreparedStatement ps = con.prepareStatement(sql);
|
|
77
|
ps.setString(1, professorId);
|
|
78
|
ps.setString(2, professorId);
|
|
79
|
ResultSet rs = ps.executeQuery();
|
|
80
|
rs.next();
|
|
81
|
int count = rs.getInt(1);
|
|
82
|
return count;
|
|
83
|
}
|
|
84
|
|
67
|
85
|
public Operation query(Connection con,String operationId) throws SQLException{
|
68
|
86
|
int _m_1 = 1;
|
69
|
87
|
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 = ?";
|