|
@ -9,15 +9,19 @@ import java.util.Collections;
|
9
|
9
|
import java.util.List;
|
10
|
10
|
|
11
|
11
|
import org.jfw.apt.annotation.Nullable;
|
|
12
|
import org.jfw.apt.orm.annotation.dao.Column;
|
12
|
13
|
import org.jfw.apt.orm.annotation.dao.DAO;
|
13
|
14
|
import org.jfw.apt.orm.annotation.dao.method.From;
|
14
|
15
|
import org.jfw.apt.orm.annotation.dao.method.OrderBy;
|
15
|
16
|
import org.jfw.apt.orm.annotation.dao.method.operator.Insert;
|
|
17
|
import org.jfw.apt.orm.annotation.dao.method.operator.QueryVal;
|
16
|
18
|
import org.jfw.apt.orm.annotation.dao.method.operator.SelectList;
|
17
|
19
|
import org.jfw.apt.orm.annotation.dao.method.operator.SelectOne;
|
18
|
20
|
import org.jfw.apt.orm.annotation.dao.method.operator.UpdateWith;
|
19
|
21
|
import org.jfw.apt.orm.annotation.dao.param.Set;
|
|
22
|
import org.jfw.apt.orm.core.defaultImpl.IntHandler;
|
20
|
23
|
import org.jfw.util.PageQueryResult;
|
|
24
|
import org.jfw.util.exception.JfwBaseException;
|
21
|
25
|
|
22
|
26
|
import com.ekexiu.portal.po.Demand;
|
23
|
27
|
|
|
@ -34,24 +38,10 @@ public abstract class DemandDao {
|
34
|
38
|
@Nullable
|
35
|
39
|
public abstract Demand queryOne(Connection con,String demandId)throws SQLException;
|
36
|
40
|
|
37
|
|
public int queryCountByStatus(Connection con,String demander,String demandStatus)throws SQLException{
|
38
|
|
String sql = " SELECT COUNT(1) FROM DEMAND WHERE DEMANDER = ? AND DEMAND_STATUS = ? ";
|
39
|
|
PreparedStatement ps = con.prepareStatement(sql);
|
40
|
|
int index = 1;
|
41
|
|
try {
|
42
|
|
ps.setString(index++, demander);
|
43
|
|
ps.setString(index++, demandStatus);
|
44
|
|
ResultSet rs = ps.executeQuery();
|
45
|
|
try {
|
46
|
|
rs.next();
|
47
|
|
return rs.getInt(1);
|
48
|
|
} finally {
|
49
|
|
try{rs.close();}catch(Exception e1){}
|
50
|
|
}
|
51
|
|
} finally {
|
52
|
|
try{ps.close();}catch(Exception e2){}
|
53
|
|
}
|
54
|
|
}
|
|
41
|
@QueryVal
|
|
42
|
@Column(handlerClass=IntHandler.class,value="COUNT(1)")
|
|
43
|
@From(Demand.class)
|
|
44
|
public abstract int queryCountByStatus(Connection con,String demander,String demandStatus)throws SQLException, JfwBaseException;
|
55
|
45
|
|
56
|
46
|
@SelectList
|
57
|
47
|
@OrderBy("ORDER BY CREATE_TIME DESC")
|