前端thymeleaf
<th:block th:with="doctorInfo=${appMemberBL.getDoctorInfo(item.id)}" >
<td th:text="${doctorInfo.department}"></td>
<td th:text="${doctorInfo.title}"></td>
</th:block>
后端controller
@RequestMapping("/doctor/")
@Controller
public class DoctorManagerController {
@Resource
AppMemberFLService appMemberFLService;
@Resource
AppMemberBL appMemberBL;
@RequestMapping("list")
public String list(ModelMap modelMap, AppMemberSearchModel searchModel){
searchModel.setRole(1);
BaseResponse<Page<AppMemberResponse>> response = appMemberFLService.selectDoctorMemberList(searchModel);
modelMap.addAttribute("list", response.getData().getRecords());
modelMap.addAttribute("model", searchModel);
modelMap.addAttribute("appMemberBL", appMemberBL);
return "appmember/doctor/doctorList";
}
}
AppMemberBL
@Component
public class AppMemberBL {
@Resource
AppDoctorInfoFLService appDoctorInfoFLService;
public AppDoctorInfoResponse getDoctorInfo(Integer appMemberId){
BaseResponse<AppDoctorInfoResponse> response = appDoctorInfoFLService.getByMemberId(new GetByIdRequest(appMemberId));
return response.getData();
}
}