Commit d62af3b9 by zhiwj

咨询建议

parent 2e2e4547
......@@ -93,6 +93,7 @@ public class ProblemOutApiServiceImpl implements ProblemOutApiService {
List<Integer> problemIdList = problemList.stream().map(ProblemDTO::getProblemId).collect(Collectors.toList());
Map<Integer, String> firstReply = problemReplyService.firstReplyByProblemId(problemIdList);
for (ProblemDTO problemDTO : problemList) {
problemDTO.setProblemCount(problemDTO.getProblemCount() == null ? 1 : (problemDTO.getProblemCount() + 1));
problemDTO.setReplyContent(firstReply.get(problemDTO.getProblemId()));
}
}
......
......@@ -265,6 +265,7 @@
t1.malicious_status maliciousStatus,
t1.show_status showStatus,
t1.status status,
t1.create_time createTime,
t3.problemCount
from tab_problem t1
left join ( select problem_id, count(*) problemCount from tab_problem_reply where status &lt;&gt; 0 GROUP BY problem_id ) t3 on t1.problem_id = t3.problem_id
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment