|
@ -9,6 +9,7 @@ import java.util.ArrayList;
|
9
|
9
|
import java.util.Collections;
|
10
|
10
|
import java.util.List;
|
11
|
11
|
|
|
12
|
import org.jfw.apt.annotation.DefaultValue;
|
12
|
13
|
import org.jfw.apt.annotation.Nullable;
|
13
|
14
|
import org.jfw.apt.orm.annotation.dao.Column;
|
14
|
15
|
import org.jfw.apt.orm.annotation.dao.DAO;
|
|
@ -21,12 +22,15 @@ import org.jfw.apt.orm.annotation.dao.method.operator.Insert;
|
21
|
22
|
import org.jfw.apt.orm.annotation.dao.method.operator.PageSelect;
|
22
|
23
|
import org.jfw.apt.orm.annotation.dao.method.operator.QueryOne;
|
23
|
24
|
import org.jfw.apt.orm.annotation.dao.method.operator.QueryVal;
|
|
25
|
import org.jfw.apt.orm.annotation.dao.method.operator.SelectList;
|
24
|
26
|
import org.jfw.apt.orm.annotation.dao.method.operator.SelectOne;
|
25
|
27
|
import org.jfw.apt.orm.annotation.dao.method.operator.Update;
|
26
|
28
|
import org.jfw.apt.orm.annotation.dao.method.operator.UpdateWith;
|
|
29
|
import org.jfw.apt.orm.annotation.dao.param.LessThan;
|
27
|
30
|
import org.jfw.apt.orm.annotation.dao.param.Set;
|
28
|
31
|
import org.jfw.apt.orm.annotation.dao.param.SqlColumn;
|
29
|
32
|
import org.jfw.apt.orm.core.defaultImpl.BigDecimalHandler;
|
|
33
|
import org.jfw.apt.orm.core.defaultImpl.IntHandler;
|
30
|
34
|
import org.jfw.apt.orm.core.defaultImpl.StringHandler;
|
31
|
35
|
import org.jfw.util.PageQueryResult;
|
32
|
36
|
import org.jfw.util.exception.JfwBaseException;
|
|
@ -134,6 +138,38 @@ public abstract class ProfessorDao {
|
134
|
138
|
@From(Professor.class)
|
135
|
139
|
public abstract int updateStarAvg(Connection con, String id, @Set BigDecimal starAvg) throws SQLException;
|
136
|
140
|
|
|
141
|
@UpdateWith
|
|
142
|
@From(Professor.class)
|
|
143
|
public abstract int updateScorePercent(Connection con,String id,@Set String scorePercent)throws SQLException;
|
|
144
|
|
|
145
|
/**
|
|
146
|
* 查用户总数
|
|
147
|
* @param con
|
|
148
|
* @return
|
|
149
|
* @throws SQLException
|
|
150
|
*/
|
|
151
|
@QueryVal
|
|
152
|
@Column(handlerClass=IntHandler.class,value={"COUNT(1)"})
|
|
153
|
@From(Professor.class)
|
|
154
|
@DefaultValue("0")
|
|
155
|
public abstract int queryCount(Connection con)throws SQLException;
|
|
156
|
|
|
157
|
/**
|
|
158
|
* 查询积分值低于scoreValue的用户总数
|
|
159
|
* @param con
|
|
160
|
* @param scoreValue 积分值
|
|
161
|
* @return
|
|
162
|
* @throws SQLException
|
|
163
|
*/
|
|
164
|
@QueryVal
|
|
165
|
@Column(handlerClass=IntHandler.class,value={"COUNT(1)"})
|
|
166
|
@From(Professor.class)
|
|
167
|
@DefaultValue("0")
|
|
168
|
public abstract int queryCountLessThan(Connection con,@LessThan int scoreValue)throws SQLException;
|
|
169
|
|
|
170
|
@SelectList
|
|
171
|
public abstract List<Professor> queryList(Connection con)throws SQLException;
|
|
172
|
|
137
|
173
|
public List<EditProfessor> queryInvite(Connection con, String id) throws SQLException{
|
138
|
174
|
int index = 1;
|
139
|
175
|
String sql = "SELECT OFFICE,ADDRESS,ORG_ID,O.NAME,TITLE,AUTHENTICATION,AUTH_TYPE,AUTH_STATUS,P.ID,P.NAME,ORG_AUTH "
|
|
@ -230,7 +266,7 @@ public abstract class ProfessorDao {
|
230
|
266
|
*/
|
231
|
267
|
public EditProfessor queryBaseInfo(Connection con, String id) throws SQLException {
|
232
|
268
|
int index = 1;
|
233
|
|
String sql = "SELECT P.OFFICE,P.DEPARTMENT,P.TITLE,AUTHENTICATION,AUTH_TYPE,P.AUTH_STATUS,P.ID,P.NAME,P.ADDRESS,P.ORG_AUTH,ORGANIZATION.NAME "
|
|
269
|
String sql = "SELECT P.OFFICE,P.DEPARTMENT,P.TITLE,AUTHENTICATION,AUTH_TYPE,P.AUTH_STATUS,P.ID,P.NAME,P.ADDRESS,P.ORG_AUTH,ORGANIZATION.NAME,P.ORG_ID "
|
234
|
270
|
+ " FROM PROFESSOR P LEFT JOIN ORGANIZATION ON P.ORG_ID = ORGANIZATION.ID WHERE P.ID = ?";
|
235
|
271
|
PreparedStatement ps = con.prepareStatement(sql);
|
236
|
272
|
try{
|
|
@ -270,6 +306,11 @@ public abstract class ProfessorDao {
|
270
|
306
|
orgName = null;
|
271
|
307
|
}
|
272
|
308
|
professor.setOrgName(orgName);
|
|
309
|
String orgId = rs.getString(12);
|
|
310
|
if(rs.wasNull()){
|
|
311
|
orgId = null;
|
|
312
|
}
|
|
313
|
professor.setOrgId(orgId);
|
273
|
314
|
return professor;
|
274
|
315
|
}else{
|
275
|
316
|
return null;
|