问答中心 跳转回填提问和回答问题
This commit is contained in:
@@ -40,7 +40,7 @@ public interface AskQuestionsDao extends BaseMapper<AskQuestions> {
|
||||
|
||||
List<String> getUId();
|
||||
|
||||
String selectByRId(@Param("id") String id);
|
||||
String selectByRId(@Param("id") String id,@Param("userId") String userId);
|
||||
|
||||
String selectBYAQId(@Param("id") String id);
|
||||
|
||||
|
||||
+1
-1
@@ -120,7 +120,7 @@ public class AskQuestionsServiceImpl extends ServiceImpl<AskQuestionsDao, AskQue
|
||||
@Override
|
||||
public List<Reply> getAskQuestionsByakId(String id,String state,String userId) {
|
||||
String questioner = askQuestionsDao.selectBYAQId(id);
|
||||
String answerer = askQuestionsDao.selectByRId(id);
|
||||
String answerer = askQuestionsDao.selectByRId(id,userId);
|
||||
if (userId.equals(questioner)||userId.equals(answerer)){
|
||||
return askQuestionsDao.getAskQuestionsByakId(id,state);
|
||||
}
|
||||
|
||||
@@ -269,26 +269,13 @@
|
||||
<select id="selectByRId" resultType="java.lang.String">
|
||||
SELECT reply.ANSWERER
|
||||
FROM reply
|
||||
LEFT JOIN ts_user t2 ON t2.USID = reply.ANSWERER
|
||||
<where>
|
||||
<if test="id != null and id !=''">
|
||||
AND reply.ASK_ID = #{id}
|
||||
</if>
|
||||
limit 1
|
||||
</where>
|
||||
where ASK_ID = #{id} and answerer = #{userId};
|
||||
</select>
|
||||
|
||||
<select id="selectBYAQId" resultType="java.lang.String">
|
||||
SELECT ask_questions.QUESTIONER
|
||||
FROM ask_questions
|
||||
LEFT JOIN ts_user t2 ON t2.USID = ask_questions.QUESTIONER
|
||||
left join reply on reply.ASK_ID = ask_questions.ID
|
||||
<where>
|
||||
<if test="id != null and id !=''">
|
||||
AND reply.ASK_ID = #{id}
|
||||
</if>
|
||||
limit 1
|
||||
</where>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<select id="getAskQuestionsById" resultType="com.adc.da.slrs.StandardQA.entity.Reply">
|
||||
|
||||
Reference in New Issue
Block a user