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