示例#1
0
 /* (non-Javadoc)
  * @see com.mg.framework.generic.ui.DefaultPlainBrowseForm#createQueryText()
  */
 @Override
 protected String createQueryText() {
   Set<TableEJBQLFieldDef> fieldDefs =
       ((DefaultMaintenanceEJBQLTableModel) table.getModel()).getFieldDefsSet();
   String fieldsList = DatabaseUtils.generateEJBQLSelectClause(fieldDefs);
   String fromList = DatabaseUtils.generateEJBQLFromClause(fieldDefs);
   return String.format(INIT_QUERY_TEXT, fieldsList, fromList);
 }
  /* (non-Javadoc)
   * @see com.mg.framework.generic.ui.DefaultPlainBrowseForm#createQueryText()
   */
  @Override
  protected String createQueryText() {
    super.createQueryText();
    fieldDefs = ((WarehouseDocModelMaintenanceEJBQLTableModel) table.getModel()).getFieldDefsSet();
    String fieldsList = DatabaseUtils.generateEJBQLSelectClause(fieldDefs);
    String fromList = DatabaseUtils.generateEJBQLFromClause(fieldDefs);

    return String.format(INIT_QUERY_TEXT, fieldsList, fromList, whereText);
  }
 /* (non-Javadoc)
  * @see com.mg.framework.generic.ui.AbstractTableModel#doLoad()
  */
 @Override
 protected Set<TableEJBQLFieldDef> getDefaultFieldDefsSet() {
   Set<TableEJBQLFieldDef> result = super.getDefaultFieldDefsSet();
   result.add(new TableEJBQLFieldDef(ContractorCardHist.class, "Id", "ccp.Id", true));
   result.add(
       new TableEJBQLFieldDef(ContractorCardHist.class, "ProcessDate", "ccp.ProcessDate", false));
   result.add(
       new TableEJBQLFieldDef(
           ContractorCardHist.class,
           "DocHead.DocNumber",
           "d.DocNumber",
           "left join ccp.DocHead as d",
           true));
   result.add(
       new TableEJBQLFieldDef(
           ContractorCardHist.class,
           "DocHead.DocType",
           "dt.Code",
           "left join d.DocType as dt",
           true));
   result.add(
       new TableEJBQLFieldDef(
           ContractorCardHist.class, "DocHead.DocNumber", "d.DocNumber", false));
   result.add(
       new TableEJBQLFieldDef(
           ContractorCardHist.class,
           "DocHead.DocType",
           "bdt.Code",
           "left join d.BaseDocType as bdt",
           true));
   result.add(
       new TableEJBQLFieldDef(
           ContractorCardHist.class, "DocHead.BaseDocDate", "d.BaseDocDate", false));
   result.add(
       new TableEJBQLFieldDef(
           ContractorCardHist.class, "DocHead.BaseDocNumber", "d.BaseDocNumber", false));
   result.add(
       new TableEJBQLFieldDef(
           ContractorCardHist.class,
           "DocHead.DocType",
           "cdt.Code",
           "left join d.ContractType as cdt",
           true));
   result.add(
       new TableEJBQLFieldDef(
           ContractorCardHist.class, "DocHead.ContractDate", "d.ContractDate", false));
   result.add(
       new TableEJBQLFieldDef(
           ContractorCardHist.class, "DocHead.ContractNumber", "d.ContractNumber", false));
   result.add(new TableEJBQLFieldDef(ContractorCardHist.class, "SumNat", "ccp.SumNat", false));
   result.add(new TableEJBQLFieldDef(ContractorCardHist.class, "SumCur", "ccp.SumCur", false));
   result.add(
       new TableEJBQLFieldDef(
           ContractorCardHist.class,
           "DocHead.Currency",
           "cur.Code",
           "left join d.Currency as cur",
           false));
   return DatabaseUtils.embedAddinFieldsDefaultEJBQLFieldDefs(result, docService);
 }
示例#4
0
 @Override
 protected Set<String> getDefaultFieldsSet() {
   Set<String> result = super.getDefaultFieldsSet();
   result.addAll(
       StringUtils.split(
           "Id,CCode,CName,InsuredPercent,EmployerPercent", ",")); // $NON-NLS-1$ //$NON-NLS-2$
   return DatabaseUtils.embedAddinFieldsDefaultFieldsSet(result, service);
 }
示例#5
0
 @Override
 protected String createQueryText() {
   return DatabaseUtils.embedAddinFieldsBrowseEJBQL(
       INIT_QUERY_TEXT.concat(fieldsList).concat(" from InsuredClass inclass order by inclass.Id"),
       service,
       "inclass.Id",
       getFieldsSet()); //$NON-NLS-1$ //$NON-NLS-2$
 }
示例#6
0
 @Override
 protected String createQueryText() {
   return DatabaseUtils.embedAddinFieldsBrowseEJBQL(
       INIT_QUERY_TEXT
           .concat(fieldsList)
           .concat(" from ProblemType problemtype order by problemtype.Id"),
       service,
       "problemtype.Id",
       getFieldsSet()); //$NON-NLS-1$ //$NON-NLS-2$
 }
 /* (non-Javadoc)
  * @see com.mg.framework.generic.ui.DefaultPlainBrowseForm#createQueryText()
  */
 @Override
 protected String createQueryText() {
   super.createQueryText();
   whereText
       .append(
           DatabaseUtils.formatEJBQLObjectRestriction(
               "d.SrcStock",
               restGoodDocument.getSrcStockCode(),
               "srcStockCode",
               paramsName,
               paramsValue,
               false))
       .append(
           DatabaseUtils.formatEJBQLObjectRestriction(
               "d.SrcMol",
               restGoodDocument.getSrcMolCode(),
               "srcMolCode",
               paramsName,
               paramsValue,
               false));
   return String.format(INIT_QUERY_TEXT, fieldsList, fromList, whereText);
 }
示例#8
0
 /* (non-Javadoc)
  * @see com.mg.framework.generic.ui.DefaultLegacyTreeBrowseForm#loadFolders()
  */
 @Override
 protected TreeNode loadFolders() {
   List<StaffListUnit> list =
       MiscUtils.convertUncheckedList(
           StaffListUnit.class,
           OrmTemplate.getInstance()
               .findByNamedParam(
                   String.format(
                       "from StaffListUnit slu where %s and slu.StaffList.Id = :staffListId order by slu.Parent.Id, slu.UName",
                       DatabaseUtils.generateFlatBrowseWhereEJBQL("slu.Id", 6)),
                   "staffListId",
                   getStaffListId())); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
   return StaffListUnitTreeNode.createTree(list);
 }
 /* (non-Javadoc)
  * @see com.mg.framework.generic.ui.DefaultPlainBrowseForm#createQueryText()
  */
 @Override
 protected String createQueryText() {
   super.createQueryText();
   Set<TableEJBQLFieldDef> fieldDefs =
       ((ManufactureDocumentMaintenanceEJBQLTableModel) table.getModel()).getFieldDefsSet();
   fieldsList = DatabaseUtils.generateEJBQLSelectClause(fieldDefs);
   fromList = DatabaseUtils.generateEJBQLFromClause(fieldDefs);
   restDocument = (VarianceDocumentHeadRest) getRestrictionForm();
   whereText
       .append(
           DatabaseUtils.formatEJBQLObjectRestriction(
               "d.SrcMol",
               restDocument.getSrcMolCode(),
               "srcdstMolCode",
               paramsName,
               paramsValue,
               false))
       .append(
           DatabaseUtils.formatEJBQLObjectRestriction(
               "d.SrcStock",
               restDocument.getSrcStockCode(),
               "srcStockCode",
               paramsName,
               paramsValue,
               false))
       .append(
           DatabaseUtils.formatEJBQLObjectRestriction(
               "d.From", restDocument.getFromCode(), "fromCode", paramsName, paramsValue, false))
       .append(
           DatabaseUtils.formatEJBQLObjectRestriction(
               "d.To", restDocument.getToCode(), "toCode", paramsName, paramsValue, false))
       .append(
           DatabaseUtils.formatEJBQLObjectRestriction(
               "d.Job", restDocument.getJob(), "job", paramsName, paramsValue, false))
       .append(
           DatabaseUtils.formatEJBQLObjectRestriction(
               "d.WC", restDocument.getWorkCenter(), "wcCode", paramsName, paramsValue, false));
   if (whereText.indexOf("Catalog") != -1) {
     fromList = (", VarianceDocumentSpec as ds ").concat(fromList);
   }
   return String.format(INIT_QUERY_TEXT, fieldsList, fromList, whereText.toString());
 }
示例#10
0
  /* (non-Javadoc)
   * @see com.mg.framework.generic.ui.DefaultPlainBrowseForm#createQueryText()
   */
  @Override
  protected String createQueryText() {
    String whereText = ""; // $NON-NLS-1$
    Set<TableEJBQLFieldDef> fieldDefs =
        ((DefaultMaintenanceEJBQLTableModel) table.getModel()).getFieldDefsSet();
    String fieldsList = DatabaseUtils.generateEJBQLSelectClause(fieldDefs);
    String fromList = DatabaseUtils.generateEJBQLFromClause(fieldDefs);
    paramsName.clear();
    paramsValue.clear();
    StaffListPositionRest restForm = (StaffListPositionRest) getRestrictionForm();
    whereText =
        " where "
            .concat(
                DatabaseUtils.formatEJBQLHierarchyRestriction(
                    ((HierarchyRestrictionSupport) restForm).isUseHierarchy(),
                    "sp.StaffListUnit",
                    6,
                    "folder",
                    folderEntity,
                    paramsName,
                    paramsValue,
                    true))
            . //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
            concat(
                DatabaseUtils.formatEJBQLObjectRestriction(
                    "sp.Position",
                    restForm.getPositionName(),
                    "positionName",
                    paramsName,
                    paramsValue,
                    false))
            . //$NON-NLS-1$ //$NON-NLS-2$
            concat(
                DatabaseUtils.formatEJBQLObjectRestriction(
                    "sp.StaffCategory",
                    restForm.getStaffCategoryCode(),
                    "staffCategoryCode",
                    paramsName,
                    paramsValue,
                    false))
            . //$NON-NLS-1$ //$NON-NLS-2$
            concat(
                DatabaseUtils.formatEJBQLObjectRangeRestriction(
                    "sp.BeginDate",
                    restForm.getBeginDate(),
                    restForm.getEndDate(),
                    "beginDate",
                    "endDate",
                    paramsName,
                    paramsValue,
                    false))
            . //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
            concat(
                DatabaseUtils.formatEJBQLObjectRangeRestriction(
                    "sp.EndDate",
                    restForm.getBeginDate(),
                    restForm.getEndDate(),
                    "beginDate",
                    "endDate",
                    paramsName,
                    paramsValue,
                    false))
            . //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
            concat(
                DatabaseUtils.formatEJBQLObjectRestriction(
                    "sp.WorkSchedule",
                    restForm.getWorkScheduleCode(),
                    "workScheduleCode",
                    paramsName,
                    paramsValue,
                    false))
            . //$NON-NLS-1$ //$NON-NLS-2$
            concat(
                DatabaseUtils.formatEJBQLObjectRestriction(
                    "sp.WorkCondition",
                    restForm.getWorkConditionCode(),
                    "workConditionCode",
                    paramsName,
                    paramsValue,
                    false))
            . //$NON-NLS-1$ //$NON-NLS-2$
            concat(
                DatabaseUtils.formatEJBQLObjectRestriction(
                    "sp.TaxCalcKind",
                    restForm.getTaxCalcKindCode(),
                    "taxCalcKindCode",
                    paramsName,
                    paramsValue,
                    false))
            . //$NON-NLS-1$ //$NON-NLS-2$
            concat(
                DatabaseUtils.formatEJBQLObjectRestriction(
                    "sp.CostsAnl1",
                    restForm.getAnlCode1(),
                    "anlCode1",
                    paramsName,
                    paramsValue,
                    false))
            . //$NON-NLS-1$ //$NON-NLS-2$
            concat(
                DatabaseUtils.formatEJBQLObjectRestriction(
                    "sp.CostsAnl2",
                    restForm.getAnlCode2(),
                    "anlCode2",
                    paramsName,
                    paramsValue,
                    false))
            . //$NON-NLS-1$ //$NON-NLS-2$
            concat(
                DatabaseUtils.formatEJBQLObjectRestriction(
                    "sp.CostsAnl3",
                    restForm.getAnlCode3(),
                    "anlCode3",
                    paramsName,
                    paramsValue,
                    false))
            . //$NON-NLS-1$ //$NON-NLS-2$
            concat(
                DatabaseUtils.formatEJBQLObjectRestriction(
                    "sp.CostsAnl4",
                    restForm.getAnlCode4(),
                    "anlCode4",
                    paramsName,
                    paramsValue,
                    false))
            . //$NON-NLS-1$ //$NON-NLS-2$
            concat(
                DatabaseUtils.formatEJBQLObjectRestriction(
                    "sp.CostsAnl5",
                    restForm.getAnlCode5(),
                    "anlCode5",
                    paramsName,
                    paramsValue,
                    false))
            . //$NON-NLS-1$ //$NON-NLS-2$
            concat(
                DatabaseUtils.formatEJBQLObjectRestriction(
                    "tar.Category",
                    restForm.getTariffingCategoryCode(),
                    "tariffingCategoryCode",
                    paramsName,
                    paramsValue,
                    false))
            . //$NON-NLS-1$ //$NON-NLS-2$
            concat(
                DatabaseUtils.formatEJBQLObjectRangeRestriction(
                    "tar.BeginDate",
                    restForm.getBeginDateTC(),
                    restForm.getEndDateTC(),
                    "beginDateTC",
                    "endDateTC",
                    paramsName,
                    paramsValue,
                    false))
            . //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
            concat(
                DatabaseUtils.formatEJBQLObjectRangeRestriction(
                    "tar.EndDate",
                    restForm.getBeginDateTC(),
                    restForm.getEndDateTC(),
                    "beginDateTC",
                    "endDateTC",
                    paramsName,
                    paramsValue,
                    false))
            . //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
            concat(
                DatabaseUtils.formatEJBQLObjectRangeRestriction(
                    "tar.RateOfSalary",
                    restForm.getMinSalaryFrom(),
                    restForm.getMinSalaryTill(),
                    "minSalaryFrom",
                    "minSalaryTill",
                    paramsName,
                    paramsValue,
                    false))
            . //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
            concat(
                DatabaseUtils.formatEJBQLAddinFieldsRestriction(
                    service, "sp.Id", restForm.getAddinFieldsRestriction(), false)); // $NON-NLS-1$

    if (whereText.contains("tar.")) { // $NON-NLS-1$
      whereText =
          whereText.concat(
              " and tar.StaffList = sp.StaffListUnit.StaffList and tar.SlPositionUniqueId = sp.SlPositionUniqueId"); //$NON-NLS-1$
      fromList = (", Tariffing tar ").concat(fromList); // $NON-NLS-1$
    }
    return String.format(INIT_QUERY_TEXT, fieldsList, fromList, whereText);
  }