/** * 功能:仪器仪表的送修返还头文件的生成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; }
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; }