jiapeng 7 vuotta sitten
vanhempi
commit
be4c8629b9

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

89
	@OrderBy("ORDER BY TIME_DESC DESC")
89
	@OrderBy("ORDER BY TIME_DESC DESC")
90
	List<Answer> byQes(Connection con, String qid, @LessThan String timeDesc, int rows) throws SQLException;
90
	List<Answer> byQes(Connection con, String qid, @LessThan String timeDesc, int rows) throws SQLException;
91
	@LimitQuery
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
	@Insert
95
	@Insert
96
	int insert(Connection con,AnswerAgreeRec aar)throws SQLException;
96
	int insert(Connection con,AnswerAgreeRec aar)throws SQLException;

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

487
	 */
487
	 */
488
	@Get
488
	@Get
489
	@Path("/answer/qes/byScore")
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
			@DefaultValue("10000000") int rows) throws SQLException {
491
			@DefaultValue("10000000") int rows) throws SQLException {
492
		String p = "000000"+score;
492
		String p = "000000"+score;
493
		p = p.substring(p.length()-5)+id;
493
		p = p.substring(p.length()-5)+id;

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

7
@ExtendTable
7
@ExtendTable
8
public class SortedAnswwer extends Answer {
8
public class SortedAnswwer extends Answer {
9
	private long score ;
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
	@CalcColumn(nullable=false,handlerClass=LongHandler.class,column="(10000 * (agree+1)) / (ballot+1) SCORE")
22
	@CalcColumn(nullable=false,handlerClass=LongHandler.class,column="(10000 * (agree+1)) / (ballot+1) SCORE")
12
	public long getScore() {
23
	public long getScore() {