ソースを参照

--update queryInvite();

zzy.zhiyuan.foxmail 8 年 前
コミット
26508de4e7
共有2 個のファイルを変更した5 個の追加4 個の削除を含む
  1. 3 2
      src/main/java/com/ekexiu/portal/dao/GrowthLogDao.java
  2. 2 2
      src/main/java/com/ekexiu/portal/service/GrowthLogService.java

+ 3 - 2
src/main/java/com/ekexiu/portal/dao/GrowthLogDao.java

@ -38,12 +38,13 @@ public abstract class GrowthLogDao {
38 38
	@Where("INVITE_PRO IS NULL")
39 39
	public abstract List<GrowthLog> queryList(Connection con,String professorId,@LessThan String createTime,int rows)throws SQLException;
40 40
	
41
	public List<InviteUserScore> queryInvite(Connection con,String professorId) throws SQLException{
41
	public List<InviteUserScore> queryInvite(Connection con,String professorId,String createTime,int rows) throws SQLException{
42 42
        int index = 1;
43
        String sql = "SELECT INVITE_PRO,SUM(SCORE) S FROM GROWTH_LOG WHERE PROFESSOR_ID = ? AND INVITE_PRO IS NOT NULL GROUP BY INVITE_PRO ORDER BY S DESC";
43
        String sql = "SELECT INVITE_PRO,SUM(SCORE) S FROM GROWTH_LOG WHERE PROFESSOR_ID = ? AND CREATE_TIME < ? AND INVITE_PRO IS NOT NULL GROUP BY INVITE_PRO ORDER BY S DESC LIMIT "+rows;
44 44
        PreparedStatement ps = con.prepareStatement(sql);
45 45
        try{
46 46
            ps.setString(index++,professorId);
47
            ps.setString(index++,createTime);
47 48
            ResultSet rs = ps.executeQuery();
48 49
            try{
49 50
                List<InviteUserScore> inviteUserScores = new ArrayList<InviteUserScore>();

+ 2 - 2
src/main/java/com/ekexiu/portal/service/GrowthLogService.java

@ -88,8 +88,8 @@ public class GrowthLogService {
88 88
	
89 89
	@Get
90 90
	@Path("/queryInvite")
91
	public List<InviteUserScore> queryInvite(@JdbcConn Connection con,String professorId)throws SQLException{
92
		return this.growthLogDao.queryInvite(con, professorId);
91
	public List<InviteUserScore> queryInvite(@JdbcConn Connection con,String professorId,@DefaultValue("com.ekexiu.portal.service.GrowthLogService.MAX_CREATE_TIME") String createTime,@DefaultValue("20") int rows)throws SQLException{
92
		return this.growthLogDao.queryInvite(con, professorId, createTime, rows);
93 93
	}
94 94
	
95 95
	@Get