Exemple #1
0
 /**
  * 功能:框架自动生成应急保障设备名称字典表 AMS_YJ_ITEM页面翻页查询SQLModel,请根据实际需要修改。
  *
  * @return SQLModel 返回页面翻页查询SQLModel
  * @throws SQLModelException 发生日历异常时转化为该异常抛出
  */
 public SQLModel getPageQueryModel() throws SQLModelException {
   SQLModel sqlModel = new SQLModel();
   List sqlArgs = new ArrayList();
   AmsYjItemDTO amsYjItem = (AmsYjItemDTO) dtoParameter;
   String sqlStr =
       "SELECT "
           + " CONVERT(VARCHAR,ITEM_CODE) ITEM_CODE,"
           + " ITEM_NAME,"
           + " ITEM_CATEGORY,"
           + " CREATION_DATE,"
           + " dbo.APP_GET_USER_NAME(CREATE_USER) CREATE_USER,"
           + " LAST_UPDATE_DATE,"
           + " dbo.APP_GET_USER_NAME(LAST_UPDATE_USER) LAST_UPDATE_USER,"
           + " DISABLE_DATE"
           + " FROM"
           + " AMS_YJ_ITEM"
           + " WHERE"
           + " ("
           + SyBaseSQLUtil.isNull()
           + " OR ITEM_NAME LIKE ?)";
   if (!amsYjItem.getItemCode().equals("")) {
     sqlStr += " AND ITEM_CODE = CONVERT(FLOAT,?)";
   } else {
     sqlStr += " AND CONVERT(FLOAT,?) =0 ";
   }
   sqlArgs.add(amsYjItem.getItemName());
   sqlArgs.add(amsYjItem.getItemName());
   sqlArgs.add(amsYjItem.getItemCode());
   sqlModel.setSqlStr(sqlStr);
   sqlModel.setArgs(sqlArgs);
   return sqlModel;
 }
Exemple #2
0
 public SQLModel doVerify(String itemName) {
   SQLModel sqlModel = new SQLModel();
   List strArg = new ArrayList();
   String strSql = "SELECT 1 FROM AMS_YJ_ITEM AYI WHERE AYI.ITEM_NAME = ?";
   strArg.add(itemName);
   sqlModel.setSqlStr(strSql);
   sqlModel.setArgs(strArg);
   return sqlModel;
 }
  /**
   * 功能:框架自动生成资产拓展信息表-ETS_ITEM_INFO_EX ETS_ITEM_INFO_EX页面翻页查询SQLModel,请根据实际需要修改。
   *
   * @return SQLModel 返回页面翻页查询SQLModel
   * @throws SQLModelException 发生日历异常时转化为该异常抛出
   */
  public SQLModel getPageQueryModel() throws SQLModelException {
    SQLModel sqlModel = new SQLModel();
    List sqlArgs = new ArrayList();
    EtsItemInfoExSearchDTO dto = (EtsItemInfoExSearchDTO) dtoParameter;
    String sqlStr =
        "SELECT "
            + " EIIE.ITEM_INFO_EX_ID,"
            + " EII.BARCODE,"
            + " ESI.ITEM_NAME,"
            + " ESI.ITEM_SPEC,"
            + " EII.RESPONSIBILITY_DEPT,"
            + " EIIE.ATTRIBUTE1,"
            + " EIIE.ATTRIBUTE2,"
            + " EIIE.ATTRIBUTE3,"
            + " EIIE.ATTRIBUTE4,"
            + " EIIE.ATTRIBUTE5,"
            + " dbo.APP_GET_DEPT_NAME(EII.RESPONSIBILITY_DEPT) DEPT_NAME,"
            + " EII.RESPONSIBILITY_USER,"
            + " dbo.EAM_MAINTAIN_GET_EMPLOYEE_NAME(EII.RESPONSIBILITY_USER) EMPLOYEE_NAME,"
            + " EII.FINANCE_PROP,"
            + " dbo.APP_GET_FLEX_VALUE(EII.FINANCE_PROP,'FINANCE_PROP') FINANCE_PROP_NAME,"
            + " EFA.DATE_PLACED_IN_SERVICE"
            + " FROM"
            + " ETS_ITEM_INFO    EII,"
            + " ETS_SYSTEM_ITEM  ESI,"
            + " ETS_ITEM_INFO_EX EIIE,"
            + " ETS_ITEM_MATCH   EIM,"
            + " ETS_FA_ASSETS    EFA"
            + " WHERE"
            + " EII.ITEM_CODE = ESI.ITEM_CODE"
            + " AND EII.SYSTEMID = EIIE.SYSTEM_ID"
            + " AND EII.SYSTEMID = EIM.SYSTEMID"
            + " AND EIM.ASSET_ID = EFA.ASSET_ID"
            + " AND EIIE.ITEM_TYPE='IT'"
            + " AND EII.ORGANIZATION_ID=?"
            + " AND (LTRIM(?) IS NULL OR EII.BARCODE LIKE '%' || ? || '%')"
            + " AND (LTRIM(?) IS NULL OR ESI.ITEM_NAME LIKE '%' || ? || '%')"
            + " AND (LTRIM(?) IS NULL OR ESI.ITEM_SPEC LIKE '%' || ? || '%')"
            + " AND (LTRIM(?) IS NULL OR EII.RESPONSIBILITY_DEPT LIKE '%' || ? || '%')"
            + " AND (LTRIM(?) IS NULL OR EII.RESPONSIBILITY_USER LIKE '%' || ? || '%')"
            + " AND EII.FINANCE_PROP = dbo.NVL(LTRIM(?), EII.FINANCE_PROP)";
    sqlArgs.add(userAccount.getOrganizationId());
    sqlArgs.add(dto.getBarcode());
    sqlArgs.add(dto.getBarcode());
    sqlArgs.add(dto.getItemName());
    sqlArgs.add(dto.getItemName());
    sqlArgs.add(dto.getItemSpec());
    sqlArgs.add(dto.getItemSpec());
    sqlArgs.add(dto.getResponsibilityDept());
    sqlArgs.add(dto.getResponsibilityDept());
    sqlArgs.add(dto.getResponsibilityUser());
    sqlArgs.add(dto.getResponsibilityUser());
    sqlArgs.add(dto.getFinanceProp());

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

    return sqlModel;
  }
Exemple #4
0
 /**
  * 功能:失效
  *
  * @return SQLModel 返回数据删除用SQLModel
  */
 public SQLModel getDataDeleteModel() {
   SQLModel sqlModel = new SQLModel();
   List sqlArgs = new ArrayList();
   AmsYjItemDTO amsYjItem = (AmsYjItemDTO) dtoParameter;
   String sqlStr =
       "UPDATE AMS_YJ_ITEM\n"
           + "SET DISABLE_DATE=GETDATE(),"
           + " LAST_UPDATE_DATE = GETDATE(),"
           + " LAST_UPDATE_USER = ?"
           + " WHERE"
           + " ITEM_CODE = CONVERT(FLOAT,?)";
   sqlArgs.add(sfUser.getUserId());
   sqlArgs.add(amsYjItem.getItemCode());
   sqlModel.setSqlStr(sqlStr);
   sqlModel.setArgs(sqlArgs);
   return sqlModel;
 }
Exemple #5
0
  /**
   * 功能:框架自动生成应急保障设备名称字典表 AMS_YJ_ITEM数据插入SQLModel,请根据实际需要修改。
   *
   * @return SQLModel 返回数据插入用SQLModel
   * @throws SQLModelException 发生日历异常时转化为该异常抛出
   */
  public SQLModel getDataCreateModel() throws SQLModelException {
    SQLModel sqlModel = new SQLModel();
    List sqlArgs = new ArrayList();
    AmsYjItemDTO amsYjItem = (AmsYjItemDTO) dtoParameter;
    String sqlStr =
        "INSERT INTO "
            + " AMS_YJ_ITEM("
            + " ITEM_CODE,"
            + " ITEM_NAME,"
            + " ITEM_CATEGORY,"
            + " CREATION_DATE,"
            + " CREATE_USER"
            + ") VALUES ("
            + " CONVERT(FLOAT,?), ?, '装备', GETDATE(), ?)";

    sqlArgs.add(amsYjItem.getItemCode());
    sqlArgs.add(amsYjItem.getItemName());
    sqlArgs.add(sfUser.getUserId());

    sqlModel.setSqlStr(sqlStr);
    sqlModel.setArgs(sqlArgs);
    return sqlModel;
  }
Exemple #6
0
  /**
   * 功能:框架自动生成应急保障设备名称字典表 AMS_YJ_ITEM数据详细信息查询SQLModel,请根据实际需要修改。
   *
   * @return SQLModel 返回数据详细信息查询用SQLModel
   */
  public SQLModel getPrimaryKeyDataModel() {
    SQLModel sqlModel = new SQLModel();
    List sqlArgs = new ArrayList();
    AmsYjItemDTO amsYjItem = (AmsYjItemDTO) dtoParameter;
    String sqlStr =
        "SELECT "
            + " ITEM_CODE,"
            + " ITEM_NAME,"
            + " ITEM_CATEGORY,"
            + " CREATION_DATE,"
            + " CREATE_USER,"
            + " LAST_UPDATE_DATE,"
            + " LAST_UPDATE_USER"
            + " FROM"
            + " AMS_YJ_ITEM"
            + " WHERE"
            + " ITEM_CODE = CONVERT(FLOAT,?)";
    sqlArgs.add(amsYjItem.getItemCode());

    sqlModel.setSqlStr(sqlStr);
    sqlModel.setArgs(sqlArgs);
    return sqlModel;
  }
Exemple #7
0
  /**
   * 功能:框架自动生成应急保障设备名称字典表 AMS_YJ_ITEM多条数据信息查询SQLModel,请根据实际需要修改。
   *
   * @return SQLModel 返回多条数据信息查询用SQLModel
   * @throws SQLModelException 发生日历异常时转化为该异常抛出
   */
  public SQLModel getMuxDataModel() throws SQLModelException {
    SQLModel sqlModel = new SQLModel();
    try {
      List sqlArgs = new ArrayList();
      AmsYjItemDTO amsYjItem = (AmsYjItemDTO) dtoParameter;
      String sqlStr =
          "SELECT "
              + " ITEM_CODE,"
              + " ITEM_NAME,"
              + " ITEM_CATEGORY,"
              + " CREATION_DATE,"
              + " CREATE_USER,"
              + " LAST_UPDATE_DATE,"
              + " LAST_UPDATE_USER"
              + " FROM"
              + " AMS_YJ_ITEM"
              + " WHERE"
              + " (? IS NULL OR ITEM_CODE LIKE ?)"
              + " AND (? IS NULL OR ITEM_NAME LIKE ?)"
              + " AND (? IS NULL OR ITEM_CATEGORY LIKE ?)"
              + " AND (? IS NULL OR CREATION_DATE LIKE ?)"
              + " AND (? IS NULL OR CREATE_USER LIKE ?)"
              + " AND (? IS NULL OR LAST_UPDATE_DATE LIKE ?)"
              + " AND (? IS NULL OR LAST_UPDATE_USER LIKE ?)";
      sqlArgs.add(amsYjItem.getItemCode());
      sqlArgs.add(amsYjItem.getItemCode());
      sqlArgs.add(amsYjItem.getItemName());
      sqlArgs.add(amsYjItem.getItemName());
      sqlArgs.add(amsYjItem.getItemCategory());
      sqlArgs.add(amsYjItem.getItemCategory());
      sqlArgs.add(amsYjItem.getCreationDate());
      sqlArgs.add(amsYjItem.getCreationDate());
      sqlArgs.add(amsYjItem.getCreateUser());
      sqlArgs.add(amsYjItem.getCreateUser());
      sqlArgs.add(amsYjItem.getLastUpdateDate());
      sqlArgs.add(amsYjItem.getLastUpdateDate());
      sqlArgs.add(amsYjItem.getLastUpdateUser());
      sqlArgs.add(amsYjItem.getLastUpdateUser());

      sqlModel.setSqlStr(sqlStr);
      sqlModel.setArgs(sqlArgs);
    } catch (CalendarException ex) {
      ex.printLog();
      throw new SQLModelException(ex);
    }
    return sqlModel;
  }