jiapeng 7 years ago
parent
commit
be4c8629b9

+ 2 - 2
src/main/java/com/ekexiu/portal/question/QuestionDao.java

@ -89,8 +89,8 @@ public interface QuestionDao {
89 89
	@OrderBy("ORDER BY TIME_DESC DESC")
90 90
	List<Answer> byQes(Connection con, String qid, @LessThan String timeDesc, int rows) throws SQLException;
91 91
	@LimitQuery
92
	@OrderBy("ORDER BY SCORE DESC,ID ASC")
93
	List<SortedAnswwer> byQesScore(Connection con, String qid, @SqlColumn(handlerClass = StringHandler.class, value = { "(TO_CHAR((10000 * (AGREE+1)) / (BALLOT+1),'00009')+ID) < ?  " })  String score, int rows) throws SQLException;
92
	@OrderBy("ORDER BY SCORE_DESC ASC")
93
	List<SortedAnswwer> byQesScore(Connection con, String qid, @SqlColumn(handlerClass = StringHandler.class, value = { "(TO_CHAR((10000 * (AGREE+1)) / (BALLOT+1),'00009')||ID) < ?  " })  String score, int rows) throws SQLException;
94 94

95 95
	@Insert
96 96
	int insert(Connection con,AnswerAgreeRec aar)throws SQLException;

+ 1 - 1
src/main/java/com/ekexiu/portal/question/Service.java

@ -487,7 +487,7 @@ public class Service {
487 487
	 */
488 488
	@Get
489 489
	@Path("/answer/qes/byScore")
490
	public List<SortedAnswwer> byQes(@JdbcConn Connection con, String qid, @DefaultValue("100000") int score, @DefaultValue("\"0\"") String id,
490
	public List<SortedAnswwer> byQes(@JdbcConn Connection con, String qid, @DefaultValue("99999") int score, @DefaultValue("\"Z\"") String id,
491 491
			@DefaultValue("10000000") int rows) throws SQLException {
492 492
		String p = "000000"+score;
493 493
		p = p.substring(p.length()-5)+id;

+ 11 - 0
src/main/java/com/ekexiu/portal/question/SortedAnswwer.java

@ -7,6 +7,17 @@ import org.jfw.apt.orm.core.defaultImpl.LongHandler;
7 7
@ExtendTable
8 8
public class SortedAnswwer extends Answer {
9 9
	private long score ;
10
	private transient String scoreDesc;
11
	
12
	
13
	@CalcColumn(nullable=false,handlerClass=LongHandler.class,column="TO_CHAR((10000 *(AGREE + 1)) / (BALLOT + 1),'00009') || ID SCORE_DESC")
14
	public String getScoreDesc() {
15
		return scoreDesc;
16
	}
17

18
	public void setScoreDesc(String scoreDesc) {
19
		this.scoreDesc = scoreDesc;
20
	}
10 21

11 22
	@CalcColumn(nullable=false,handlerClass=LongHandler.class,column="(10000 * (agree+1)) / (ballot+1) SCORE")
12 23
	public long getScore() {