1.控制层
@GetMapping("/findYiDuiYiMap") public Result findYiDuiYiMap(int id){ // 调用服务添加 Map<String,Object> map= studnetService.findYiDuiYiMap(id); return new Result(true, MessageConstant.ADD_CHECKITEM_SUCCESS,map); }
2.业务层
@Override public Map<String, Object> findYiDuiYiMap(int id) { return studentDao.findYiDuiYiMap(id); }
3.xml
<select id="findYiDuiYiMap" resultType="map"> select s.*,t.* from student s inner join teacher t on s.id=t.id and s.id=#{id} </select>
4.postman