问答中心增加校验,如果是提问人或回答人可看全部数据,如不是只能看归档数据
This commit is contained in:
+2
-2
@@ -157,8 +157,8 @@ public class AskQuestionsController extends BaseController<AskQuestions> {
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@GetMapping("/getAskQuestionsByakId")
|
@GetMapping("/getAskQuestionsByakId")
|
||||||
public ResponseMessage getAskQuestionsByakId(String id,String state){
|
public ResponseMessage getAskQuestionsByakId(String id,String state,String userId){
|
||||||
List<Reply> askQuestionsList = askQuestionsService.getAskQuestionsByakId(id,state);
|
List<Reply> askQuestionsList = askQuestionsService.getAskQuestionsByakId(id,state,userId);
|
||||||
return Result.success(askQuestionsList);
|
return Result.success(askQuestionsList);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -39,4 +39,10 @@ public interface AskQuestionsDao extends BaseMapper<AskQuestions> {
|
|||||||
List<Reply> getAskQuestionsByakId (@Param("id") String id,@Param("state") String state);
|
List<Reply> getAskQuestionsByakId (@Param("id") String id,@Param("state") String state);
|
||||||
|
|
||||||
List<String> getUId();
|
List<String> getUId();
|
||||||
|
|
||||||
|
String selectByRId(@Param("id") String id);
|
||||||
|
|
||||||
|
String selectBYAQId(@Param("id") String id);
|
||||||
|
|
||||||
|
List<Reply> getAskQuestionsById(@Param("id") String id);
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -29,7 +29,7 @@ public interface AskQuestionsService extends IService<AskQuestions> {
|
|||||||
|
|
||||||
List<AskQuestions> getAskQuestionsByStandardId(String standardId);
|
List<AskQuestions> getAskQuestionsByStandardId(String standardId);
|
||||||
List<AskQuestions> getArchiveAskQuestions(String id);
|
List<AskQuestions> getArchiveAskQuestions(String id);
|
||||||
List<Reply> getAskQuestionsByakId(String id,String state);
|
List<Reply> getAskQuestionsByakId(String id,String state,String userId);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -266,5 +266,41 @@
|
|||||||
order by QUESTION_TIME desc
|
order by QUESTION_TIME desc
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<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>
|
||||||
|
</where>
|
||||||
|
</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>
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="getAskQuestionsById" resultType="com.adc.da.slrs.StandardQA.entity.Reply">
|
||||||
|
SELECT reply.ID, reply.REPLY,reply.REPLY_TIME,t2.UNAME ANSWERER,reply.APPENDIX_ID,APPENDIX_NAME,reply.state
|
||||||
|
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>
|
||||||
|
AND reply.state = '1'
|
||||||
|
</where>
|
||||||
|
order by reply.REPLY_TIME
|
||||||
|
</select>
|
||||||
|
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|||||||
Reference in New Issue
Block a user