/**
  * 更新数据表plan_train中字段daylyplan_flag,的值,然后向mq发消息
  *
  * @param base_train_id
  * @return
  * @throws Exception
  */
 public Result updatePlanTrainDaylyPlanFlagSendMessage(
     Map<String, Object> reqMap, DwrMessageData dwrMessageData) throws Exception {
   Result result = new Result();
   baseDao.updateBySql(Constants.TRAINPLANDAO_UPDATE_PLANFLAG, reqMap);
   String params = JSONObject.fromObject(dwrMessageData).toString();
   amqpDwrTemplate.convertAndSend(params);
   return result;
 }
  /** runDate :格式:yyyyMMdd */
  public List<ParamDto> getTotalTrains(String runDate, String startBureauFull, String trainNbr) {
    List<ParamDto> list = new ArrayList<ParamDto>();
    Map<String, String> paramMap = new HashMap<String, String>();
    paramMap.put("runDate", runDate);
    paramMap.put("startBureauFull", startBureauFull);
    if (trainNbr != null && !"".equals(trainNbr.trim())) {
      paramMap.put("trainNbr", trainNbr);
    }

    List<Map<String, Object>> mapList =
        baseDao.selectListBySql(Constants.TRAINPLANDAO_GET_TOTALTRAINS, paramMap);
    if (mapList != null && mapList.size() > 0) {
      // System.err.println("mapList.size===" + mapList.size());
      for (Map<String, Object> map : mapList) {
        ParamDto dto = new ParamDto();
        dto.setSourceEntityId(StringUtil.objToStr(map.get("BASE_TRAIN_ID")));
        dto.setPlanTrainId(StringUtil.objToStr(map.get("PLAN_TRAIN_ID")));
        String time = StringUtil.objToStr(map.get("RUN_DATE"));
        dto.setTime(DateUtil.formateDate(time));
        list.add(dto);
      }
    }
    return list;
  }
 /**
  * 查询车次的始发站和终点站等信息
  *
  * @param runDate 开行日期
  * @param trainNbr 车次
  * @param count 返回的条数
  */
 public List<PlanTrainDto> getTrainShortInfo(String runDate, String trainNbr, int count) {
   List<PlanTrainDto> returnList = new ArrayList<PlanTrainDto>();
   Map<String, Object> paramMap = new HashMap<String, Object>();
   paramMap.put("runDate", runDate);
   paramMap.put("rownum", count);
   if (trainNbr != null && !"".equals(trainNbr)) {
     paramMap.put("trainNbr", trainNbr);
   }
   // 调用dao获取数据  TRAINPLANDAO_GET_TRAIN_SHORTINFO
   List<Map<String, Object>> listMap =
       baseDao.selectListBySql(Constants.TRAINPLANDAO_GET_TRAIN_SHORTINFO, paramMap);
   if (listMap != null && listMap.size() > 0) {
     for (Map<String, Object> map : listMap) {
       PlanTrainDto dto = new PlanTrainDto();
       dto.setPlanTrainId(StringUtil.objToStr(map.get("PLAN_TRAIN_ID")));
       dto.setEndStn(StringUtil.objToStr(map.get("END_STN")));
       dto.setRunDate(StringUtil.objToStr(map.get("RUN_DATE")));
       dto.setStartStn(StringUtil.objToStr(map.get("START_STN")));
       dto.setTrainNbr(StringUtil.objToStr(map.get("TRAIN_NBR")));
       returnList.add(dto);
     }
   }
   return returnList;
 }
 /** 更新表plan_train中字段check_state的值 */
 public Result updatePlanTrainCheckStats(String base_train_id) throws Exception {
   Result result = new Result();
   // 更新数据库
   baseDao.updateBySql(Constants.TRAINPLANDAO_UPDATE_CHECKSTATE, base_train_id);
   return result;
 }
 /**
  * 更新数据表plan_train中字段daylyplan_flag,的值
  *
  * @param base_train_id
  * @return
  * @throws Exception
  */
 public Result updatePlanTrainDaylyPlanFlag(Map<String, Object> reqMap) throws Exception {
   Result result = new Result();
   baseDao.updateBySql(Constants.TRAINPLANDAO_UPDATE_PLANFLAG, reqMap);
   return result;
 }