XMTT vor 7 Jahren
Ursprung
Commit
876bc695a5
1 geänderte Dateien mit 9 neuen und 6 gelöschten Zeilen
  1. 9 6
      src/main/java/com/ekexiu/portal/question/Service.java

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

@ -157,6 +157,8 @@ public class Service {
157 157
	 * @param con
158 158
	 * @param id
159 159
	 *            提问ID
160
	 * @param uid
161
	 * 			  本人ID
160 162
	 * @param count
161 163
	 *            limit 查询 返回最后一条的 kws ,首次不传
162 164
	 * @param pid
@ -168,17 +170,18 @@ public class Service {
168 170
	 */
169 171
	@Get
170 172
	@Path("/commendatoryPro")
171
	public List<Map<String, Object>> professor(@JdbcConn Connection con, final String id, final @DefaultValue("Integer.MAX_VALUE") int count,
173
	public List<Map<String, Object>> professor(@JdbcConn Connection con, final String id,final String uid, final @DefaultValue("Integer.MAX_VALUE") int count,
172 174
			final @DefaultValue("\"0\"") String pid, final @DefaultValue("Integer.MAX_VALUE") int rows) throws SQLException {
173 175
		return JdbcUtil.queryMaps(con,
174
				"select id, kws from(select id,count(1) kws from pro_key_word where kw in (select kw from qet_key_word where id =?) group by id ) t where kws<= ? and id >? order by kws desc,id asc limit ?",
176
				"select id, kws from(select id,count(1) kws from pro_key_word where id <>? kw in (select kw from qet_key_word where id =?) group by id ) t where kws<= ? and id >? order by kws desc,id asc limit ?",
175 177
				new PreparedStatementConfig() {
176 178
					@Override
177 179
					public void config(PreparedStatement ps) throws SQLException {
178
						ps.setString(1, id);
179
						ps.setInt(2, count);
180
						ps.setString(3, pid);
181
						ps.setInt(4, rows);
180
					    ps.setString(1,uid);
181
						ps.setString(2, id);
182
						ps.setInt(3, count);
183
						ps.setString(4, pid);
184
						ps.setInt(5, rows);
182 185
					}
183 186
				});
184 187
	}