/**
* 根据id查询预约信息,包括套餐信息和会员信息
* @param id
* @return
*/
@RequestMapping("/findById")
public Result findById(Integer id){
try{
Map map = orderService.findById(id);
//查询预约信息成功
return new Result(true,MessageConstant.QUERY_ORDER_SUCCESS,map);
}catch (Exception e){
e.printStackTrace();
//查询预约信息失败
return new Result(false,MessageConstant.QUERY_ORDER_FAIL);
}
}
//根据id查询预约信息,包括体检人信息、套餐信息
public Map findById(Integer id) throws Exception;
//根据id查询预约信息,包括体检人信息、套餐信息
public Map findById(Integer id) throws Exception {
Map map = orderDao.findById4Detail(id);
if(map != null){
//处理日期格式
Date orderDate = (Date) map.get("orderDate");
map.put("orderDate",DateUtils.parseDate2String(orderDate));
}
return map;
}
public Map findById4Detail(Integer id);
<!‐‐根据预约id查询预约信息,包括体检人信息、套餐信息‐‐>
<select id="findById4Detail" parameterType="int" resultType="map">
select m.name member ,s.name setmeal,o.orderDate orderDate,o.orderType
orderType
from
t_order o,
t_member m,
t_setmeal s
where o.member_id=m.id and o.setmeal_id=s.id and o.id=#{id}
</select>
欢迎光临 黑马程序员技术交流社区 (http://bbs.itheima.com/) | 黑马程序员IT技术论坛 X3.2 |