病友圈对应评论数
parent
00a34fc36a
commit
2e1b7d996e
|
@ -49,6 +49,8 @@ public interface PatientMapper {
|
||||||
|
|
||||||
void disTaunt(@Param("reviewId") Integer reviewId);
|
void disTaunt(@Param("reviewId") Integer reviewId);
|
||||||
|
|
||||||
|
Integer findReviewNum(@Param("patientCircleId") Integer patientCircleId);
|
||||||
|
|
||||||
|
|
||||||
// List<PatientCircle> patientCircleList(@Param("diseaseId") Integer diseaseId);
|
// List<PatientCircle> patientCircleList(@Param("diseaseId") Integer diseaseId);
|
||||||
//
|
//
|
||||||
|
|
|
@ -95,6 +95,11 @@ public class PatientServiceImpl implements PatientService {
|
||||||
@Override
|
@Override
|
||||||
public Result<List<PatientCircle>> patientCircleList() {
|
public Result<List<PatientCircle>> patientCircleList() {
|
||||||
List<PatientCircle> list=patientMapper.patientCircleList();
|
List<PatientCircle> list=patientMapper.patientCircleList();
|
||||||
|
list.forEach(l->{
|
||||||
|
Integer patientCircleId = l.getPatientCircleId();
|
||||||
|
Integer i=patientMapper.findReviewNum(patientCircleId);
|
||||||
|
l.setReviewNum(i);
|
||||||
|
});
|
||||||
return Result.success(list);
|
return Result.success(list);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -84,5 +84,8 @@
|
||||||
<select id="findByReviewId" resultType="com.february.patient.circle.domain.Review">
|
<select id="findByReviewId" resultType="com.february.patient.circle.domain.Review">
|
||||||
select * from tb_review where review_id=#{reviewId}
|
select * from tb_review where review_id=#{reviewId}
|
||||||
</select>
|
</select>
|
||||||
|
<select id="findReviewNum" resultType="java.lang.Integer">
|
||||||
|
SELECT COUNT(*) from tb_review WHERE patient_circle_id=#{patientCircleId}
|
||||||
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue