예제 #1
0
 /**
  * 功能:仪器仪表的送修返还头文件的生成model
  *
  * @return
  * @throws SQLModelException
  */
 public SQLModel getDataCreateModel() throws SQLModelException {
   SQLModel sqlModel = new SQLModel();
   try {
     List sqlArgs = new ArrayList();
     AmsInstrumentHDTO amsInstrumentHInfo = (AmsInstrumentHDTO) dtoParameter;
     String sqlStr =
         "INSERT INTO AMS_INSTRU_TRANS_H\n"
             + "  (TRANS_ID, TRANS_NO, TRANS_TYPE, TRANS_STATUS,CONFIRM_USER,CONFIRM_DATE, RETURN_USER, RETURN_DATE,REPARI_FACTORY,ORGANIZATION_ID)\n"
             + "VALUES\n"
             + "  (?, ?, ?, ?, ?,GETDATE(), ?, ?,?,?)";
     sqlArgs.add(amsInstrumentHInfo.getTransId());
     sqlArgs.add(amsInstrumentHInfo.getTransNo());
     sqlArgs.add(amsInstrumentHInfo.getTransType());
     sqlArgs.add(amsInstrumentHInfo.getTransStatus());
     sqlArgs.add(userAccount.getUserId());
     //            sqlArgs.add(amsInstrumentHInfo.getReturnUser());
     sqlArgs.add(amsInstrumentHInfo.getReturnUser());
     sqlArgs.add(amsInstrumentHInfo.getReturnDate());
     sqlArgs.add(amsInstrumentHInfo.getVendorName()); // 取供应商编号
     sqlArgs.add(userAccount.getOrganizationId());
     sqlModel.setSqlStr(sqlStr);
     sqlModel.setArgs(sqlArgs);
   } catch (CalendarException e) {
     e.printLog();
     throw new SQLModelException(e);
   }
   return sqlModel;
 }
예제 #2
0
 public SQLModel getDataUpdateModel() throws SQLModelException {
   SQLModel sqlModel = new SQLModel();
   try {
     List sqlArgs = new ArrayList();
     AmsInstrumentHDTO amsInstrumentHInfo = (AmsInstrumentHDTO) dtoParameter;
     String sqlStr =
         "UPDATE AMS_INSTRU_TRANS_H\n"
             + "   SET TRANS_ID      = ?,\n"
             + "       TRANS_NO      = ?,\n"
             + "       TRANS_TYPE    = ?,\n"
             + "       TRANS_STATUS  = ?,\n"
             + "       BORROW_USER   = ?,\n"
             + "       BORROW_DATE   = ?,\n"
             +
             //                    "       CONFIRM_USER  = ?,\n" +
             //                    "       CONFIRM_DATE  = ?,\n" +
             "       CANCEL_DATE   = ?,\n"
             + "       CANCEL_REASON = ?\n"
             + " WHERE TRANS_ID = ?";
     sqlArgs.add(amsInstrumentHInfo.getTransId());
     sqlArgs.add(amsInstrumentHInfo.getTransNo());
     sqlArgs.add(amsInstrumentHInfo.getTransType());
     sqlArgs.add(amsInstrumentHInfo.getTransStatus());
     sqlArgs.add(amsInstrumentHInfo.getBorrowUser());
     sqlArgs.add(amsInstrumentHInfo.getBorrowDate());
     //            sqlArgs.add(amsInstrumentHInfo.getConfirmUser());
     //            sqlArgs.add(amsInstrumentHInfo.getConfirmDate());
     sqlArgs.add(amsInstrumentHInfo.getCancelDate());
     sqlArgs.add(amsInstrumentHInfo.getCalPattern());
     sqlArgs.add(amsInstrumentHInfo.getTransId());
     sqlModel.setSqlStr(sqlStr);
     sqlModel.setArgs(sqlArgs);
   } catch (CalendarException e) {
     e.printLog();
     throw new SQLModelException(e);
   }
   return sqlModel;
 }
예제 #3
0
  public SQLModel getPrimaryKeyDataModel() { // 明细找头表
    SQLModel sqlModel = new SQLModel();
    List sqlArgs = new ArrayList();
    AmsInstrumentHDTO amsInstrumentHInfo = (AmsInstrumentHDTO) dtoParameter;
    String sqlStr =
        "SELECT AITH.TRANS_NO,\n"
            + " AITH.TRANS_STATUS,\n"
            + " AMS_PUB_PKG.GET_USER_NAME(AITH.RETURN_USER) RETURN_NAME,\n"
            + " AITH.RETURN_DATE,\n"
            + " AITH.TRANS_TYPE,\n"
            + " AITH.CHECK_USER,\n"
            + " AITH.REPARI_FACTORY VENDOR_NAME,\n"
            + " AITH.TRANS_ID,\n"
            + " AMS_PUB_PKG.GET_STATUS_NAME(AITH.TRANS_STATUS) TRANS_STATUS_NAME\n"
            + " FROM "
            + " AMS_INSTRU_TRANS_H AITH\n"
            + " WHERE AITH.TRANS_ID = ?";
    sqlArgs.add(amsInstrumentHInfo.getTransId());

    sqlModel.setSqlStr(sqlStr);
    sqlModel.setArgs(sqlArgs);
    return sqlModel;
  }