OptionTypeList.java
/*
* @ Copyright 2001 FA Software;
* All right reserved. No part of this program may be reproduced or
* transmitted in any form or by any means, electronic or
* mechanical, including photocopying, recording, or by any
* information storage or retrieval system without written
* permission from FA Software, except for inclusion of brief
* quotations in a review.
*/
package com.mycim.valueobject;
import com.fa.sesa.threadlocal.LocalContext;
import com.mycim.framework.utils.lang.StringUtils;
import com.mycim.valueobject.consts.DataBaseNames;
import com.mycim.valueobject.consts.ReferenceDetailNames;
public class OptionTypeList {
private static final String DEFAULT_VALUE = "key_1_value";
private static final String DEFAULT_TEXT = "data_1_value";
// hints: in most case, we inquiry reference data that defined in EJB tier;
// but we set the default value as NAMED_OBJECT table, since it is another
// table inquired by mostly secondly.
private String value = DEFAULT_VALUE;
private String text = DEFAULT_TEXT;
private String table = DataBaseNames.NAMEDOBJECT;
private String refFile = null;
private String where = null;
public OptionTypeList(String type) {
if (type.equalsIgnoreCase("COMMCATE")) {
this.refFile = "$HISTORY_COMMENT_CATE";
} else if (type.equalsIgnoreCase("RESIST_STATUS")) {
this.refFile = "$RESIST_STATUS";
} else if (type.equalsIgnoreCase("PROCESSINGBATCHTYPE")) {
this.refFile = "$PROCESS_BATCH_TYPE";
} else if (type.equalsIgnoreCase("pmsPMType")) {
this.refFile = "$$PMS_CYCLE_TIME";
} else if (type.equalsIgnoreCase("versionobjecttype")) {
this.refFile = "$$VERSION_OBJECT";
} else if (type.equalsIgnoreCase("EQPTCAPABILITY")) {
this.refFile = "$EQPT_CAPABILITY";
} else if (type.equalsIgnoreCase("securityclassType")) {
this.refFile = "$SECURITYCLASS_TYPE";
} else if ("MATERIALTYPE".equalsIgnoreCase(type)) {
this.refFile = "$$MATERIAL_TYPE";
} else if ("MATERIALSUBTYPE".equalsIgnoreCase(type)) {
this.refFile = "$$MATERIAL_SUB_TYPE";
} else if (type.equalsIgnoreCase("productfamilytype")) {
this.refFile = "$PRODUCT_FAMILY_TYPE";
} else if (type.equalsIgnoreCase("producttype")) {
this.refFile = "$PRODUCT_TYPE";
} else if (type.equalsIgnoreCase("attributeGroup")) {
this.refFile = "$ATTRIBUTE_GROUP";
} else if (type.equalsIgnoreCase("equipmentType")) {
this.refFile = "$MAINEQPT_TYPE";
} else if (type.equalsIgnoreCase("subproductStatus")) {
this.refFile = "$SUB_PRODUCT_STATUS";
} else if (type.equalsIgnoreCase("shipstatus")) {
this.refFile = "$$SHIPSTATUS";
} else if (type.equalsIgnoreCase("serialPort")) {
this.refFile = "$$EQPT_SERIALPORT";
this.value = "key_1_value a";
this.text = "key_1_value b";
this.where = "1=1 order by to_number(a) ";
} else if (type.equalsIgnoreCase("eqptPortType")) {
this.refFile = "$$EQPT_PORT_TYPE";
this.value = "key_1_value";
this.text = "key_1_value";
} else if (type.equalsIgnoreCase("baudRate")) {
this.refFile = "$$EQPT_BAUDRATE";
this.value = "key_1_value";
this.text = "key_1_value";
} else if (type.equalsIgnoreCase("carrierType")) {
this.refFile = "$CARRIER_TYPE";
} else if (type.equalsIgnoreCase("labelType")) {
this.refFile = "$$LABEL_TYPE";
} else if (type.equalsIgnoreCase("reticletype")) {
this.refFile = "$RETICLE_TYPE";
} else if (type.equalsIgnoreCase("maskInspectionId")) {
this.refFile = "$RETICLE_MASKINSPECTIONID";
} else if (type.equalsIgnoreCase("magnification")) {
this.refFile = "$RETICLE_MAGNIFICATION";
} else if (type.equalsIgnoreCase("maskSize")) {
this.refFile = "$RETICLE_MASKSIZE";
} else if (type.equalsIgnoreCase("reticleMaterial")) {
this.refFile = "$RETICLE_MATERIAL";
} else if (type.equalsIgnoreCase("recipeparameterFormat")) {
this.refFile = "$RECIPE_PARAMETER_FORMAT";
} else if (type.equalsIgnoreCase("ruleType")) {
this.refFile = "$$SPC_RULE_TYPE";
} else if (type.equalsIgnoreCase("reticlefamilytype")) {
this.refFile = "$RETICLEFAMILY_TYPE";
} else if (type.equalsIgnoreCase("actionpointedc")) {
this.refFile = "$$ACTION_POINT_EDC";
} else if (type.equalsIgnoreCase("LAYER")) {
this.refFile = "$$LAYERID";
} else if (type.equalsIgnoreCase("LOTTRANSID")) {
this.refFile = "$$LOTTRANSID";
} else if (type.equalsIgnoreCase("ITEMCLASS")) {
this.refFile = "$$ITEM_CLASS";
} else if (type.equalsIgnoreCase("GROUPNUM")) {
this.refFile = "$RULE_GROUP";
} else if (type.equalsIgnoreCase("DISPATCHINGRULE")) {
this.refFile = "$DISPATCHING_RULE";
} else if (type.equalsIgnoreCase("REASONCODE")) {
this.refFile = "$REASON_CODE";
} else if (type.equalsIgnoreCase("TESTTYPE")) {
this.refFile = "$TEST_TYPE";
} else if (type.equalsIgnoreCase("TERMINATEREASONCODE")) {
this.refFile = "$TERMINATEREASONCODE";
} else if (type.equalsIgnoreCase("UNTERMINATEREASONCODE")) {
this.refFile = "$UNTERMINATEREASONCODE";
} else if (type.equalsIgnoreCase("BATCHINGRULE")) {
this.refFile = "$BATCHING_RULE";
} else if (type.equalsIgnoreCase("FREQUENCY")) {
this.refFile = "$FREQUENCY";
} else if (type.equalsIgnoreCase("OPERATIONMODE")) {
this.refFile = "$$MODE";
} else if (type.equalsIgnoreCase("UOM")) {
this.refFile = "$$UNIT_OF_MEASURE";
} else if (type.equalsIgnoreCase("UOMFORBANK")) {
this.refFile = "$$UNIT_OF_MEASURE_FOR_BANK";
} else if (type.equalsIgnoreCase("ALARMSTATUS")) {
this.refFile = "$$ALARM_STATUS";
} else if (type.equalsIgnoreCase("SEVERITY")) {
this.refFile = "$$SEVERITY";
} else if (type.equalsIgnoreCase("spcDataType")) {
this.refFile = "$$SPC_DATA_TYPE";
} else if (type.equalsIgnoreCase("CERTIFICATION_LEVEL")) {
this.refFile = "$CERTIFICATION_LEVEL";
} else if (type.equalsIgnoreCase("calendarType")) {
this.refFile = "$CALENDAR";
} else if (type.equalsIgnoreCase("channelOption")) {
this.refFile = "$CHHANNEL_OPTION";
} else if (type.equalsIgnoreCase("combinationtype")) {
this.refFile = "$$SPC_COMBINATION_TYPE";
} else if (type.equalsIgnoreCase("ALARMPRIORITY")) {
this.refFile = "$$ALARM_PRIORITY";
} else if (type.equalsIgnoreCase("CONSTRAINTTYPE")) {
this.refFile = "$CONSTRAINT_TYPE";
} else if (type.equalsIgnoreCase("COUNTERTYPE")) {
this.refFile = "$COUNTER_TYPE";
} else if (type.equalsIgnoreCase("COUNTERUNIT")) {
this.refFile = "$COUNTER_UNIT";
} else if (type.equalsIgnoreCase("LOCATIONTYPE")) {
this.refFile = "$$LOCATION_TYPE"; // ADD BY HEBO
} else if (type.equalsIgnoreCase("MCSTYPE")) {
this.refFile = "$MCS_LOCATION_TYPE";
} else if (type.equalsIgnoreCase("CARRIERCOLOR")) {
this.refFile = "$CARRIER_COLOR";
} else if (type.equalsIgnoreCase("PCDSTATUS")) {
this.refFile = "$PCD_STATUS";
} else if (type.equalsIgnoreCase("DBDATATYPE")) {
this.refFile = "$$DATA_TYPE";
} else if (type.equalsIgnoreCase("chamberType")) {
this.refFile = "$CHAMBER_TYPE";
} else if (type.equalsIgnoreCase("PRO_STATUS")) {
this.refFile = "$$PROGRAM_STATUS";
} else if (type.equalsIgnoreCase("validAvailability")) {
this.refFile = "$$VALID_AVAILABILITY";
} else if (type.equalsIgnoreCase("targetAvailability")) {
this.refFile = "$$TARGET_AVAILABILITY";
} else if (type.equalsIgnoreCase("LANGUAGE")) {
this.refFile = "$$LANGUAGE";
} else if (type.equalsIgnoreCase("checkrule")) {
this.refFile = "$$CHECK_RULE";
} else if (type.equalsIgnoreCase("basiscode")) {
this.refFile = "$$BASIS_CODE";
} else if (type.equalsIgnoreCase("lossType")) {
this.refFile = "$$BOM_LOSS_TYPE";
} else if (type.equalsIgnoreCase("REWORKCATEGORY")) {
this.refFile = "$$REWORK_CODE";
} else if (type.equalsIgnoreCase("collectionlevel")) {
this.refFile = "$$COLLECTION_LEVEL";
} else if (type.equalsIgnoreCase("lotstepcommenttype")) {
this.refFile = "$$LOT_STEP_COMMENT_TYPE";
} else if (type.equalsIgnoreCase("commentCategory")) {
this.refFile = "$$COMMENT_CATEGORY";
} else if (type.equalsIgnoreCase("measurementtype")) {
this.refFile = "$$MEASUREMENT_TYPE";
} else if (type.equalsIgnoreCase("CHECKLISTDATATYPE")) {
this.refFile = ReferenceDetailNames.CHECKLIST_DATA_TYPE;
} else if (type.equalsIgnoreCase("CHECKLISTDATATYPEUNIT")) {
this.refFile = ReferenceDetailNames.CHECKLIST_DATA_TYPE_UNIT;
} else if (type.equalsIgnoreCase("FLDSTATUS")) {
this.refFile = "$$FLD_STATUS";
} else if (type.equalsIgnoreCase("shift")) {
this.refFile = "$$SHIFT";
} else if (type.equalsIgnoreCase("unitofmeasure")) {
this.refFile = "$$UNIT_OF_MEASURE";
} else if (type.equalsIgnoreCase("batchingrule")) {
this.refFile = "$BATCHING_RULE";
} else if (type.equalsIgnoreCase("dispatchingrule")) {
this.refFile = "$DISPATCHING_RULE";
} else if (type.equalsIgnoreCase("layerId")) {
this.refFile = "$$LAYERID";
} else if (type.equalsIgnoreCase("STAGEID")) {
this.refFile = "$$STAGEID";
} else if (type.equalsIgnoreCase("PROCESSLOCATION")) {
this.refFile = "$$PROCESS_LOCARION_CARRIER_TYPE";
} else if (type.equalsIgnoreCase("LOTPLANTYPE")) {
this.refFile = "$$SPECIAL_LOT_PLAN_TYPE";
} else if (type.equalsIgnoreCase("LOTPLANTYPE4MUTILPATH")) {
this.refFile = "$$MUTILPATH_LOT_PLAN_TYPE";
} else if (type.equalsIgnoreCase("unitofmeasure")) {
this.refFile = "$$UNIT_OF_MEASURE";
} else if (type.equalsIgnoreCase("losstable")) {
this.refFile = "$$LOSS_TABLE";
} else if (type.equalsIgnoreCase("bonustable")) {
this.refFile = "$$BONUS_TABLE";
} else if (type.equalsIgnoreCase("defecttable")) {
this.refFile = "$$DEFECT_TABLE";
} else if (type.equalsIgnoreCase("reworktable")) {
this.refFile = "$$REWORK_TABLE";
} else if (type.equalsIgnoreCase("losscode")) {
this.refFile = "$$LOSS_CODE";
} else if (type.equalsIgnoreCase("bonuscode")) {
this.refFile = "$$BONUS_CODE";
} else if (type.equalsIgnoreCase("graphType")) {
this.refFile = "$$GRAPH_TYPE";
} else if (type.equalsIgnoreCase("parametersetType")) {
this.refFile = "$PARAMETERSET_TYPE";
} else if (type.equalsIgnoreCase("color")) {
this.refFile = "$COLOR";
} else if (type.equalsIgnoreCase("lotType")) {
this.refFile = "$LOT_TYPE";
} else if (type.equalsIgnoreCase("lotStatus")) {
this.refFile = "$$LOT_STATUS";
this.where = " KEY_1_VALUE IS NOT NULL ";
} else if (type.equalsIgnoreCase("priority")) {
this.refFile = "$$LOT_PRIORITY";
this.where = "1=1 order by data_4_value ";
} else if (type.equalsIgnoreCase("hotflag")) {
this.refFile = "$$LOT_HOTFLAG";
this.where = "1=1 order by data_4_value ";
} else if (type.equalsIgnoreCase("customerId")) {
this.refFile = "$$LOT_PRIORITY";
} else if (type.equalsIgnoreCase("calculationmethod")) {
this.refFile = "$$CALCULATION_METHOD";
} else if (type.toUpperCase().indexOf("CREATECATEGORY|") != -1) {
this.refFile = "$LOT_CREATE_CATEGORY";
if (type.length() > type.indexOf("|") + 1) {
String workGroup = type.substring(type.indexOf("|") + 1);
String[] workGroups = workGroup.split(",");
this.where = "(";
for (int i = 0; i < workGroups.length; i++) {
this.where += " INSTR(data_3_value,'" + workGroups[i] + "' ) > 0 OR";
}
where = where.substring(0, where.length() - 2);
where += ")";
}
} else if (type.toUpperCase().indexOf("CATEGORY") != -1) {
this.refFile = "$LOT_CATEGORY";
} else if (type.toUpperCase().indexOf("CREATECATEGORY") != -1) {
this.refFile = "$LOT_CREATE_CATEGORY";
} else if (type.equalsIgnoreCase("createCategoryDetail")) {
this.refFile = "$LOT_CREATE_CATEGORY_DETAIL";
} else if (type.equalsIgnoreCase("lotPurpose")) {
this.refFile = "$LOT_PURPOSE";
} else if (type.equalsIgnoreCase("usedModuleCode")) {
this.refFile = "$USED_MODULE_CODE";
} else if (type.equalsIgnoreCase("moduleCode")) {
this.refFile = "$MODULE_CODE";
} else if (type.equalsIgnoreCase("processFunction")) {
this.refFile = "$PROCESS_FUNCTION";
} else if (type.equalsIgnoreCase("lotOwner")) {
this.refFile = "$LOT_OWNER";
} else if (type.equalsIgnoreCase("defectcode")) {
this.refFile = "$$DEFECT_CODE";
} else if (type.equalsIgnoreCase("dateformat")) {
this.refFile = "$$DATE_FORMAT";
} else if (type.equalsIgnoreCase("currencyCode")) {
this.refFile = "$$CURRENCY_CODE";
} else if (type.equalsIgnoreCase("decimalPoint")) {
this.refFile = "$$DECIMAL_POINT";
} else if (type.equalsIgnoreCase("reworkcode")) {
this.refFile = "$$REWORK_CODE";
} else if (type.equalsIgnoreCase("pointShape")) {
this.refFile = "$$CHANNEL_POINT_SHAPE";
} else if (type.equalsIgnoreCase("lineStyle")) {
this.refFile = "$$CHANNEL_LINE_STYLE";
} else if (type.equalsIgnoreCase("whenToDisplay")) {
this.refFile = "$$WHEN_TO_DISPLAY";
} else if (type.equalsIgnoreCase("ALARMTYPE")) {
this.refFile = "$ALARM_TYPE";
} else if (type.equalsIgnoreCase("TRIGGERALARMTYPE")) {
this.refFile = "$TRIGGER_ALARM_TYPE";
} else if (type.equalsIgnoreCase("recipeparametertype")) {
this.refFile = "$RECIPEPARAMETER";
} else if (type.equalsIgnoreCase("parameterType")) {
this.refFile = "$PARAMETER_TYPE";
} else if (type.equalsIgnoreCase("ENTITYGROUPTYPE")) {
this.refFile = "$ENTITYGROUP_TYPE";
} else if (type.equalsIgnoreCase("ALLOWABLEEVENTTYPE")) {
this.refFile = "$ALLOWABLEEVENTS_TYPE";
} else if (type.equalsIgnoreCase("EVENTTYPE")) {
this.refFile = "$EVENT_TYPE";
} else if (type.equalsIgnoreCase("holdGroup")) {
this.refFile = "$HOLD_GROUP";
} else if (type.equalsIgnoreCase("reasonGroup")) {
this.refFile = "$RELEASE_GROUP";
} else if (type.equalsIgnoreCase("pcdHoldGroup")) {
this.refFile = "$PCD_HOLD_GROUP";
} else if (type.equalsIgnoreCase("pcdReasonGroup")) {
this.refFile = "$PCD_RELEASE_GROUP";
} else if (type.equalsIgnoreCase("RECIPESETTYPE")) {
this.refFile = "$RECIPES_TYPE";
} else if (type.equalsIgnoreCase("ITEMTYPE")) {
this.refFile = "$ITEM_TYPE";
} else if (type.equalsIgnoreCase("holdGroup")) {
this.refFile = "$HOLD_GROUP";
} else if (type.equalsIgnoreCase("reasonGroup")) {
this.refFile = "$RELEASE_GROUP";
} else if (type.equalsIgnoreCase("storage")) {// add by holly 20080528
this.refFile = "$STORAGE";
} else if (type.toUpperCase().indexOf("HOLDCODE|") != -1) {
this.refFile = "$HOLD_CODE";
this.where = "data_2_value='" + type.substring(type.indexOf("|") + 1) + "'";
} else if (type.equalsIgnoreCase("accountCode")) {
this.refFile = "$ACCOUNT_CODE";
} else if (type.equalsIgnoreCase("wipcombinationtype")) {
this.refFile = "$$WIP_COMBINATION_TYPE";
this.value = "key_1_value";
this.text = "data_1_value";
} else if (type.equalsIgnoreCase("dataType")) {
this.refFile = "$$DATA_TYPE";
this.value = "key_1_value";
this.text = "data_1_value";
// } else if (type.equalsIgnoreCase("operationStep")) {
// this.refFile = "$$OPERATION_STEP";
// this.value = "key_1_value";
// this.text = "data_1_value";
} else if (type.equalsIgnoreCase("parameterDataType")) {
this.refFile = "$$PARAMETER_DATA_TYPE";
this.value = "key_1_value";
this.text = "data_1_value";
} else if (type.equalsIgnoreCase("itemhold")) {
this.refFile = "$ITEM_HOLD_REASON";
this.value = "key_1_value";
this.text = "data_1_value";
} else if (type.equalsIgnoreCase("department")) {
this.refFile = "$DEPARTMENT";
this.value = "key_1_value";
this.text = "data_1_value";
} else if (type.equalsIgnoreCase("actionpointinstruction")) {
this.refFile = "$$ACTION_POINT_INSTRUCTION";
this.value = "key_1_value";
this.text = "data_1_value";
} else if (type.equalsIgnoreCase("itemrelease")) {
this.refFile = "$ITEM_RELEASE_REASON";
this.value = "key_1_value";
this.text = "data_1_value";
} else if (type.equalsIgnoreCase("material_type")) {
this.refFile = "$$MATERIAL_TYPE";
this.value = "key_1_value";
this.text = "data_1_value";
} else if (type.toUpperCase().indexOf("OBJECTATTRIBUTEGROUP") >= 0) {
String temp = type.substring(type.indexOf("|") + 1);
String object = temp.substring(0, temp.indexOf("&"));
String namedSpace = temp.substring(temp.indexOf("&") + 1);
this.value = " attribute_group";
this.text = "attribute_group";
this.table = " object_attribute ";
this.where = " object = '" + object + "' and named_space='" + namedSpace + "' and attribute_group is not " +
"null ";
} else if (type.equalsIgnoreCase("fileFormat")) {
this.refFile = "$$FILE_FORMAT";
this.value = "key_1_value";
this.text = "key_1_value";
} else if (type.equalsIgnoreCase("validateAgainst")) {
this.refFile = "$$VALIDATE_AGAINST";
this.value = "key_1_value";
this.text = "key_1_value";
} else if (type.equalsIgnoreCase("limitCheckValidateAgainst")) {
this.refFile = "$$LIMIT_CHECK_VALIDATE_AGAINST";
this.value = "key_1_value";
this.text = "key_1_value";
} else if (type.equalsIgnoreCase("applyCalculationToReading")) {
this.refFile = "$$APPLY_CALCULATION_TO_READING";
this.value = "key_1_value";
this.text = "key_1_value";
} else if (type.equalsIgnoreCase("futureactiontype")) {
this.refFile = "$$FUTURE_ACTION_TYPE";
this.value = "key_1_value";
this.text = "key_1_value";
} else if (type.equalsIgnoreCase("ECNTYPE")) {
this.refFile = "$ECN_TYPE";
this.value = "key_1_value";
this.text = "key_1_value";
} else if (type.equalsIgnoreCase("equipmentLocation")) {
this.refFile = "$EQPT_LOCATION";
this.value = "key_1_value";
this.text = "data_1_value";
} else if (type.equalsIgnoreCase("reworkFlowId")) {
this.refFile = "$REWORKFLOW_ID";
this.value = "key_1_value";
this.text = "data_1_value";
} else if (type.equalsIgnoreCase("operationSubType")) {
this.refFile = "$$WAREHOUSE_TYPE";
this.value = "key_1_value";
this.text = "data_1_value";
} else if (type.equalsIgnoreCase("customerCode")) {
this.refFile = "$CUSTOMER_CODE";
this.value = "key_1_value";
this.text = "data_1_value";
} else if (type.equalsIgnoreCase("equipmentOwner")) {
this.refFile = "$EQPT_OWNER";
this.value = "key_1_value";
this.text = "data_1_value";
} else if (type.equalsIgnoreCase("OBJECTTYPE")) {
this.refFile = "$$OBJECT";
this.where = "data_5_value='ROOT'";
} else if (type.equalsIgnoreCase("BORTYPE")) {
this.refFile = "$BOR_TYPE";
} else if (type.equalsIgnoreCase("RECIPETYPE")) {
this.refFile = "$RECIPE_TYPE";
} else if (type.equalsIgnoreCase("WIRINGTYPE")) {
this.refFile = "$WIRING_TYPE";
} else if (type.equalsIgnoreCase("resourceType")) {
this.refFile = "$$RESOURCE_TYPE";
} else if (type.equalsIgnoreCase("processtype")) {
this.refFile = "$PROCESS_TYPE";
} else if (type.equalsIgnoreCase("channelType")) {
this.refFile = "$CHANNEL_TYPE";
} else if (type.equalsIgnoreCase("chartType")) {
this.refFile = "$CHART_TYPE";
} else if (type.equalsIgnoreCase("OPERATIONTYPE")) {
this.refFile = "$OPERATION_TYPE";
} else if (type.equalsIgnoreCase("VIDClass")) {
this.refFile = "$$EQPT_VID_CLASS";
this.value = "key_1_value";
this.text = "key_1_value";
} else if (type.equalsIgnoreCase("VariableFormat")) {
this.refFile = "$VARIABLE_FORMAT";
this.value = "key_1_value";
this.text = "key_1_value";
} else if (type.equalsIgnoreCase("unitMapType")) {
this.refFile = "$UNITMAP_TYPE";
} else if (type.equalsIgnoreCase("BOE")) {
this.value = "instance_rrn";
this.text = "instance_id";
this.where = "OBJECT = 'BOR' AND OBJECT_TYPE='BOE'";
} else if (type.equalsIgnoreCase("BOM")) {
this.value = "instance_rrn";
this.text = "instance_id";
this.where = "OBJECT = 'BOR' AND OBJECT_TYPE='BOM'";
} else if (type.equalsIgnoreCase("ACTIONPOINT")) {
this.refFile = "$$ACTION_POINT";
} else if (type.equalsIgnoreCase("ACTIONTYPE")) {
this.refFile = "$$ACTION_TYPE";
} else if (type.equalsIgnoreCase("ACTIONPOINT4EQPT")) {
this.refFile = "$$ACTION_POINT_EQPT";
} else if (type.equalsIgnoreCase("ACTIONTYPE4EQPT")) {
this.refFile = "$$ACTION_TYPE_EQPT";
} else if (type.equalsIgnoreCase("issuepriority")) {
this.refFile = "$ISSUE_PRIORITY";
this.value = "key_1_value";
this.text = "key_1_value";
} else if (type.equalsIgnoreCase("wafersize")) {
this.refFile = "$WAFER_SIZE";
} else if (type.indexOf("REFERENCEFILE|") != -1) {
int i = type.indexOf("|");
String referenceTable = type.substring(i + 1);
this.refFile = referenceTable;
} else if (type.equalsIgnoreCase("operationStep")) {
this.value = " R.key_1_value";
this.text = "R.data_1_value";
this.table = " REFERENCE_FILE_DETAIL R ";
this.where = " R.REFERENCE_FILE_RRN = ( " + " SELECT N.INSTANCE_RRN FROM NAMED_OBJECT N WHERE N" +
".INSTANCE_ID = " + "'$$OPERATION_STEP' ) " + " ORDER BY TO_NUMBER(R.KEY_1_VALUE)";
} else if (type.indexOf("ENTITYGROUPRRN") != -1) {
Long facilityRrn = LocalContext.getFacilityRrn();
// Debug.print("-----facilityRrn:" + facilityRrn);
this.value = "instance_rrn";
this.text = "instance_id";
this.where = "OBJECT = 'ENTITYGROUP' AND NAMED_SPACE = " + " (SELECT named_space FROM " +
"NAMED_SPACE_DEFINITION " + " WHERE facility_rrn= " + facilityRrn + " AND object ='ENTITYGROUP' )" +
" and instance_id not like 'EU_%' ORDER BY " + "instance_id";
} else if (type.indexOf("spareproduct|") != -1) {
int i = type.indexOf("|");
String temp = type.substring(i + 1);
int j = temp.indexOf("|");
String sapareGroup = temp.substring(0, j);
String facilityRrn = temp.substring(j + 1);
this.table = "NAMED_OBJECT o, ITEM i ,NAMED_SPACE_DEFINITION S";
this.value = "instance_rrn";
this.text = "INSTANCE_DESC";
this.where = "o.instance_rrn=i.item_rrn and i.item_class='" + sapareGroup + "' AND i.sap_flag='Y' AND S" +
".NAMED_SPACE=o.NAMED_SPACE AND S.OBJECT='PRODUCT' " + "AND S.FACILITY_RRN=" + facilityRrn + " " +
"ORDER BY INSTANCE_DESC";
} else if (type.equalsIgnoreCase("PRODUCTSPAREGROUP")) {// spareproduct
this.value = "instance_id";
this.text = " instance_id";
this.where = "OBJECT = 'PRODUCTSPAREGROUP' AND NAMED_SPACE ='MIMOS' ";
} else if (type.equalsIgnoreCase("PRODUCTFAMILY")) {
this.value = "instance_rrn";
this.text = "instance_id";
this.where = "OBJECT = 'PRODUCTFAMILY'";
} else if (type.equalsIgnoreCase("PROCESSPERMISSIONSGROUP")) {
this.value = "instance_rrn";
this.text = "instance_id";
this.where = "OBJECT='USERGROUP' Order by INSTANCE_ID";
} else if (type.indexOf("FAMILYID|") != -1) {
int i = type.indexOf("|");
String facility = type.substring(i + 1);
this.value = "instance_id";
this.text = "instance_id";
this.table = "NAMED_OBJECT o, named_space_definition f ";
// this.where ="OBJECT = 'PRODUCTFAMILY' and NAMED_SPACE =
// '"+facility+"'";
this.where = "o.object='PRODUCTFAMILY' and o.object=f.object and o.named_space=f.named_space and f" +
".facility_rrn = " + facility;
} else if (type.equalsIgnoreCase("subproduct")) {
this.value = "N.instance_rrn";
this.text = "N.instance_id";
this.table = "item P,named_object N";
this.where = "object = 'PRODUCT' AND N.instance_rrn = P.item_rrn AND P.subproduct_flag='1' ";
} else if (type.equalsIgnoreCase("FACILITY")) {
this.value = "instance_rrn";
this.text = "instance_id";
this.where = "OBJECT = 'FACILITY'";
} else if (type.equalsIgnoreCase("FACILITYID")) {
this.value = "instance_id";
this.text = "instance_id";
this.where = "OBJECT = 'FACILITY'";
} else if (type.equalsIgnoreCase("warehouse")) {
this.value = "N.instance_rrn";
this.text = "N.instance_id";
this.table = "OPERATION O,NAMED_OBJECT N";
this.where = "N.OBJECT = 'OPERATION' AND N.INSTANCE_RRN = O.OPERATION_RRN AND O.STORE_FLAG='1'";
} else if (type.indexOf("warehouseNotEmpty|") != -1) {
int i = type.indexOf('|');
String facility = type.substring(i + 1);
this.value = "O.operation_rrn";
this.text = "N.instance_id";
this.table = "OPERATION O,NAMED_OBJECT N,lot_inventory,NAMED_SPACE_DEFINITION NS";
this.where = "N.OBJECT = 'OPERATION' AND N.object_subtype = 'RAW_WAREHOUSE' AND N.INSTANCE_RRN = O" +
".OPERATION_RRN AND O.STORE_FLAG='1' AND O.operation_rrn IN(SELECT DISTINCT " + "WAREHOUSE_RRN " +
"FROM lot_inventory) AND NS.OBJECT='OPERATION' AND NS.NAMED_SPACE=N" + ".NAMED_SPACE AND NS" +
".FACILITY_RRN=" + Long.parseLong(facility);
} else if (type.equalsIgnoreCase("warehouseNotEmpty")) {
this.value = "O.operation_rrn";
this.text = "N.instance_id";
this.table = "OPERATION O,NAMED_OBJECT N,lot_inventory";
this.where = "OBJECT = 'OPERATION' AND N.INSTANCE_RRN = O.OPERATION_RRN AND O.STORE_FLAG='1' " + "AND O" +
".operation_rrn IN(SELECT DISTINCT WAREHOUSE_RRN FROM lot_inventory)";
} else if (type.equalsIgnoreCase("planlotWarehouse")) {
this.value = "N.instance_rrn";
this.text = "N.instance_id";
this.table = "NAMED_OBJECT N";
this.where = "OBJECT = 'OPERATION' AND N.INSTANCE_ID ='CL01' ";
} else if (type.indexOf("planlotWarehouse|") != -1) {
int i, j;
String planLotRrn = "";
String flag = "";
try {
i = type.indexOf("|");
j = type.indexOf("|", i + 1);
planLotRrn = type.substring(i + 1, j);
flag = type.substring(j + 1);
} catch (Exception ex) {
}
try {
this.value = "L.LOT_NUMBER";
this.text = "L.LOT_NUMBER";
this.table = "LOT_INVENTORY L,NAMED_OBJECT N,PLAN_LOT_MATERIAL P ";
if (flag != null && flag.equalsIgnoreCase("CP")) {
this.where =
"L.MATERIAL_TYPE='C' AND L.ITEM_RRN= P.COMPONENT_RRN AND PLAN_LOT_RRN=" + planLotRrn + " " +
"AND N.INSTANCE_RRN=L.ITEM_RRN AND N.OBJECT='PRODUCT' AND N" + ".OBJECT_TYPE" +
"='RAW' AND N.OBJECT_SUBTYPE='WFR-PRIME'";
} else if (flag != null && flag.equalsIgnoreCase("EP")) {
this.where =
"L.MATERIAL_TYPE='E' AND L.ITEM_RRN= P.COMPONENT_RRN AND PLAN_LOT_RRN=" + planLotRrn + " " +
"AND N.INSTANCE_RRN=L.ITEM_RRN AND N.OBJECT='PRODUCT' AND N" + ".OBJECT_TYPE" +
"='RAW' AND N.OBJECT_SUBTYPE='WFR-PRIME'";
} else if (flag != null && flag.equalsIgnoreCase("CD")) {
this.where =
"L.MATERIAL_TYPE='C' AND L.ITEM_RRN= P.COMPONENT_RRN AND PLAN_LOT_RRN=" + planLotRrn + " " +
"AND N.INSTANCE_RRN=L.ITEM_RRN AND N.OBJECT='PRODUCT' AND N" + ".OBJECT_TYPE" +
"='RAW' AND N.OBJECT_SUBTYPE='WFR-DUMMY'";
} else if (flag != null && flag.equalsIgnoreCase("ED")) {
this.where =
"L.MATERIAL_TYPE='E' AND L.ITEM_RRN= P.COMPONENT_RRN AND PLAN_LOT_RRN=" + planLotRrn + " " +
"AND N.INSTANCE_RRN=L.ITEM_RRN AND N.OBJECT='PRODUCT' AND N" + ".OBJECT_TYPE" +
"='RAW' AND N.OBJECT_SUBTYPE='WFR-DUMMY'";
} else {
this.where = "L.MATERIAL_TYPE is NULL AND L.ITEM_RRN= P.COMPONENT_RRN AND " + "PLAN_LOT_RRN=" +
planLotRrn + " AND N.INSTANCE_RRN=L.ITEM_RRN AND N.OBJECT='PRODUCT' AND N" +
".OBJECT_TYPE='RAW' AND (N.OBJECT_SUBTYPE='WFR-DUMMY' OR N" +
".OBJECT_SUBTYPE='WFR-PRIME')";
}
} catch (Exception ex) {
}
} else if (type.equalsIgnoreCase("PRODUCT")) {
this.value = "instance_rrn";
this.text = "instance_id";
this.where =
"OBJECT = 'PRODUCT' AND (OBJECT_TYPE ='FG' OR OBJECT_TYPE IS NULL) " + "order by " + "instance_id";
} else if (type.indexOf("INDUCEEVENT|") != -1) {
int i = type.indexOf("|");
long facilityRrn = Long.parseLong(type.substring(i + 1));
this.value = "instance_rrn";
this.text = "instance_id";
this.table = "NAMED_OBJECT o, named_space_definition f ";
this.where = "o.object='EVENT' and o.object=f.object and o.named_space=f.named_space and f" +
".facility_rrn = " + facilityRrn;
} else if (type.equalsIgnoreCase("route")) {
this.value = "instance_rrn";
this.text = "instance_id";
this.where = "object='ROUTE'";
} else if (type.equalsIgnoreCase("WFL")) {
this.value = "instance_rrn";
this.text = "instance_id";
this.where = "OBJECT = 'WFL' AND OBJECT_TYPE='WFL_EVENT'";
} else if (type.equalsIgnoreCase("SYSTEMALARM")) {
this.value = "alarm_id";
this.text = "alarm_id";
this.table = " ALARM ";
this.where = " ALARM_TYPE = 'SYSTEM'";
} else if (type.equalsIgnoreCase("role")) {
this.value = "instance_rrn";
this.text = "instance_id";
this.where = "OBJECT = 'ROLE'";
} else if (type.indexOf("PROCESSID|") != -1) {
int i = type.indexOf("|");
long productrrn = Long.parseLong(type.substring(i + 1));
this.value = "PROCESS_RRN";
this.text = "INSTANCE_ID";
this.table = "PRODUCT_PROCESS,NAMED_OBJECT";
this.where = "PRODUCT_RRN = " + productrrn + " AND INSTANCE_RRN = PROCESS_RRN"; // ADD BY HEBO
} else if (type.indexOf("carriers|") != -1) {
long jobRrn = Long.parseLong(type.substring(type.indexOf("|") + 1));
this.value = "N.INSTANCE_RRN";
this.text = "N.INSTANCE_ID";
this.table = "LOT L,NAMED_OBJECT N";
this.where = "L.CARRIER_RRN = N.INSTANCE_RRN AND L.JOB_RRN =" + jobRrn;
} else if (type.equalsIgnoreCase("rootroute")) {
this.value = "instance_rrn";
this.text = "instance_id";
this.where = "object='WFL'";
} else if (type.equalsIgnoreCase("bor")) {
this.value = "instance_rrn";
this.text = "instance_id";
this.where = "object='BOR'";
} else if (type.indexOf("BOR|") != -1) {
int i = type.indexOf("|");
long facilityRrn = Long.parseLong(type.substring(i + 1));
this.value = "instance_rrn";
this.text = "instance_id";
this.table = "NAMED_OBJECT o, named_space_definition f ";
this.where =
"o.object='BOR' and o.object=f.object and o.named_space=f.named_space and f" + ".facility_rrn = " +
facilityRrn;
} else if (type.indexOf("OBJECT4ECN|") != -1) {
int i = type.indexOf("|");
long facilityRrn = Long.parseLong(type.substring(i + 1));
this.value = "object";
this.text = "object";
this.table = "named_space_definition";
this.where = "substr(control_flag,3,1) = '1' and facility_rrn = " + facilityRrn;
} else if (type.indexOf("PROCESS4PRODUCT|") != -1) {
int i = type.indexOf("|");
long productRrn = Long.parseLong(type.substring(i + 1));
this.value = "instance_rrn,instance_id";
this.text = "default_flag";
this.table = "NAMED_OBJECT ,PRODUCT_PROCESS ";
this.where = "INSTANCE_RRN = PROCESS_RRN AND PRODUCT_RRN= " + productRrn;
} else if (type.indexOf("PROCESSVERSION|") != -1) {
int i = type.indexOf("|");
long instanceRrn = Long.parseLong(type.substring(i + 1));
this.value = "instance_version";
this.text = "version_id";
this.table = DataBaseNames.OBJECTVERSION;
this.where = "instance_rrn = " + instanceRrn;
} else if (type.indexOf("UNFROZENECN|") != -1) {
int i = type.indexOf("|");
String user = type.substring(i + 1);
this.value = "ecn_rrn";
this.text = "instance_id";
this.table = " NAMED_OBJECT, ECN ";
this.where = /*
* "request_by=" + user + " and
*/" ecn_status='UNFROZEN' AND ECN_RRN=INSTANCE_RRN";
} else if (type.indexOf("PRP|") != -1) {
int i = type.indexOf("|");
String temp = type.substring(i + 1);
int j = temp.indexOf("|");
String user = temp.substring(0, j);
String facilityRrn = temp.substring(j + 1);
// Debug.print("user:" + user+"facility:"+facilityRrn);
this.value = "E.ecn_rrn";
this.text = "N.instance_id";
this.table = " NAMED_OBJECT N, ECN E,NAMED_SPACE_DEFINITION NS";
this.where = /*
* "E.request_by=" + user + " and
*/" E.ecn_status='UNFROZEN' AND upper(N.OBJECT_TYPE)='PROCESSPLAN' AND E.ECN_RRN=N" + ".INSTANCE_RRN " +
"AND N.NAMED_SPACE = NS.NAMED_SPACE AND NS.OBJECT='ECN' AND NS.FACILITY_RRN=" +
Long.parseLong(facilityRrn);
} else if (type.indexOf("event_reason|") != -1) {
int i = type.indexOf("|");
String temp = type.substring(i + 1);
int j = temp.indexOf("|");
String eventId = temp.substring(0, j);
String entityId = temp.substring(j + 1);
this.value = "D.DATA_2_VALUE";
this.text = "D.DATA_2_VALUE";
this.table = " NAMED_OBJECT N, REFERENCE_FILE_DETAIL D ";
this.where = "N.INSTANCE_RRN=D.REFERENCE_FILE_RRN AND N.INSTANCE_ID='$ENTITY_EVENT_REASON' AND D" +
".KEY_1_VALUE='" + eventId + "' AND D.DATA_1_VALUE='" + entityId + "'";
} else if (type.indexOf("FACILITY4SHIP|") != -1) {
int i = type.indexOf("|");
String facilityRrn = type.substring(i + 1);
// Debug.print("facilityRrn:" + facilityRrn);
this.value = "instance_rrn";
this.text = "instance_id";
this.where = " instance_id in(" + " select v.key_2_value from (SELECT N.NAMED_SPACE,N" + ".INSTANCE_ID " +
"REF_FILE_ID,\n" + "D.KEY_1_VALUE,D.KEY_2_VALUE,\n" + "D.DATA_1_VALUE,D.DATA_2_VALUE,D" +
".DATA_3_VALUE,D.DATA_4_VALUE,D.DATA_5_VALUE\n" + "FROM NAMED_OBJECT N, REFERENCE_FILE_DETAIL " +
"D\n" + "WHERE N.INSTANCE_RRN = D.REFERENCE_FILE_RRN) v where v" + ".ref_file_id" +
"='$SHIPFACILITYLIST'" + " and v.key_1_value in (select t.instance_id from named_object t where " +
"t" + ".instance_rrn=" + facilityRrn + "))" + " and object='FACILITY'";
/*
* this.where = "OBJECT = 'FACILITY' AND INSTANCE_RRN != " + Long.parseLong(facilityRrn);
*/
} else if (type.indexOf("CONTEXT|") != -1) {
int i = type.indexOf("|");
String temp = type.substring(i + 1);
int j = temp.indexOf("|");
String user = temp.substring(0, j);
String facilityRrn = temp.substring(j + 1);
this.value = "E.ecn_rrn";
this.text = "N.instance_id";
this.table = " NAMED_OBJECT N, ECN E,NAMED_SPACE_DEFINITION NS";
this.where = /*
* "E.request_by=" + user + " and
*/
" E.ecn_status='UNFROZEN' AND upper(N.OBJECT_TYPE)='CONTEXT' AND E.ECN_RRN=N" + ".INSTANCE_RRN " +
"AND N.NAMED_SPACE = NS.NAMED_SPACE AND NS.OBJECT='ECN' AND NS" + ".FACILITY_RRN=" +
Long.parseLong(facilityRrn);
} else if (type.indexOf("status") != -1) {
int i = type.indexOf("|");
int j = type.indexOf("|", i + 1);
String entityType = type.substring(i + 1, j);
String entityGroup = type.substring(j + 1);
this.value = "key_2_value";
this.text = "data_1_value";
;
this.table = DataBaseNames.REFERENCE_VIEW;
String ref_id = "";
// sub type
if (entityType.equals("CARRIER")) {
ref_id = "$CARRIER_STATUS";
} else if (entityType.equals("CHAMBER")) {
ref_id = "$CHAMBER_STATUS";
} else if (entityType.equals("RETICLE")) {
ref_id = "$RETICLE_STATUS";
} else if (entityType.equals("MAINEQPT")) {
ref_id = "$MAINEQPT_STATUS";
}
this.where = "key_1_value='" + entityGroup + "'" + " and ref_file_id='" + ref_id + "'";
} else if (type.equals("EVENT")) {
this.value = "instance_rrn";
this.text = "instance_id";
this.where = "object = 'EVENT'";
} else if (type.equalsIgnoreCase("menu")) {
this.value = "instance_rrn";
this.text = "instance_id";
this.where = "object='MENU'" + "AND OBJECT_TYPE='ROOTMENU'";
}
// added by mycim refactor
else if (type.equalsIgnoreCase("warehousetype")) {
this.refFile = "$WAREHOUSE_TYPE";
} else if (type.equalsIgnoreCase("profitlossReasonCode")) {
this.refFile = "$PROFITLOSS_REASON_CODE";
} else if (type.equalsIgnoreCase("transferreasoncode")) {
this.refFile = "$TRANSFER_REASON_CODE";
} else if (type.equalsIgnoreCase("adjustreasoncode")) {
this.refFile = "$ADJUST_REASON_CODE";
} else if (type.equalsIgnoreCase("discardreasoncode")) {
this.refFile = "$DISCARD_REASON_CODE";
} else if (type.equalsIgnoreCase("projectType")) {
this.refFile = "$$PROJECT_TYPE";
} else if (type.equalsIgnoreCase("locationSetupType")) {
this.refFile = "$LOCATION_SETUP_TYPE";
} else if (type.equalsIgnoreCase("contactType")) {
this.refFile = "$CONTACT_TYPE";
} else if (type.equalsIgnoreCase("itemmaintaintype")) {
this.refFile = "$ITEM_MAINTAIN_TYPE";
} else if (type.equalsIgnoreCase("planType")) {
this.refFile = "$PLAN_TYPE";
} else if (type.equalsIgnoreCase("normalExperiment")) {
this.refFile = "$NORMAL_EXPERIMENT";
} else if (type.equalsIgnoreCase("annualPlanRequirement")) {
this.refFile = "$ANNUAL_PLAN_REQUIREMENT";
} else if (type.equalsIgnoreCase("purchasepolicytype")) {
this.refFile = "$PURCHASE_POLICY_TYPE";
} else if (type.equalsIgnoreCase("unittype")) {
this.refFile = "$UNIT_TYPE";
} else if (type.equalsIgnoreCase("shipreasontype")) {
this.refFile = "$SHIP_REASON_TYPE";
} else if (type.equalsIgnoreCase("waferPNType")) {
this.refFile = "$RAW_WAFER_PN";
} else if (type.equalsIgnoreCase("waferLatticeOrientation")) {
this.refFile = "$RAW_WAFER_LATTICE_ORIENTATION";
} else if (type.equalsIgnoreCase("waferResistance")) {
this.refFile = "$RAW_WAFER_RESISTANCE";
} else if (type.equalsIgnoreCase("waferExtension")) {
this.refFile = "$RAW_WAFER_EXTENSION";
} else if (type.equalsIgnoreCase("waferSupplierID")) {
this.refFile = "$RAW_WAFER_SUPPLIER";
} else if (type.startsWith("$")) {
this.refFile = type;
} else if (type.equalsIgnoreCase("defectCategory")) {
this.refFile = "$$DEFECT_CATEGORY_TABLE";
} else if (type.equalsIgnoreCase("edcCategory")) {
this.refFile = "$$EDC_COMPARE";
this.text = "key_1_value";
} else if (type.equalsIgnoreCase("defectCode")) {
this.value = " code_id";
this.text = "code_id";
this.table = " edc_defecttion_code ";
this.where = "1=1";
} else if (type.equalsIgnoreCase("FROMPART")) {
this.value = " part_id";
this.text = " part_id";
this.table = " wat_itemselection ";
this.where = "copy_flg=1";
}
// ADD BY FRANKYLEE AT 2008-06-24
else if (type.equalsIgnoreCase("PRODUCTORTYPE")) {
this.refFile = "$$REF_PRODUCTORTYPE";
} else if (type.equalsIgnoreCase("lotType2")) {
this.refFile = "$LOT_TYPE2";
} else if (type.equalsIgnoreCase("lotType3")) {
this.refFile = "$LOT_TYPE3";
} else if (type.equalsIgnoreCase("workAreaType")) {
this.refFile = "$$WORK_AREA";
} else if (type.equalsIgnoreCase("parameterDataFormat")) {
this.refFile = "$$DATA_FORMAT";
} else if (type.equalsIgnoreCase("EntityGroupCapability")) {
this.refFile = "$ENTITYGROUP_CAPABILITY";
} else if (type.equalsIgnoreCase("EntityGroupCapaGroup")) {
this.refFile = "$ENTITYGROUP_CAPAGROUP";
} else if (type.startsWith("#")) {
this.refFile = type.substring(1);
this.value = DEFAULT_TEXT;
} else if (type.equalsIgnoreCase("LOTFUTURESTEPS")) {
this.refFile = "$$LOT_FUTURE_STEPS";
} else if ("timeRange".equalsIgnoreCase(type)) {
this.refFile = "$TIME_RANGE";
} else if ("timeType".equalsIgnoreCase(type)) {
this.refFile = "$$TIME_TYPE";
} else if ("limitType".equalsIgnoreCase(type)) {
this.refFile = "$$LIMIT_TYPE";
} else if ("EDC_COLLECTION_RULE".equalsIgnoreCase(type)) {
this.refFile = "$$EDC_COLLECTION_RULE";
} else if ("EDC_COLLECTION_RULE_TYPE".equalsIgnoreCase(type)) {
this.refFile = "$$EDC_COLLECTION_RULE_TYPE";
} else if ("EDC_PARAMETER_UNIT".equalsIgnoreCase(type)) {
this.refFile = "$$EDC_PARAMETER_UNIT";
} else if (StringUtils.equalsIgnoreCase("pollutionLevel", type)) {
this.refFile = "$$POLLUTION_LEVEL";
} else if (StringUtils.indexOf(type, "reticleGroup") > -1) {
String[] types = type.split("\\|");
String productRrn = types.length > 1 ? types[1] : StringUtils.EMPTY;
this.table = "SELECT A.INSTANCE_RRN,A.INSTANCE_ID,FROM NAMED_OBJECT A,PRODUCT_RETICLE_GROUP B WHERE " +
"A.INSTANCE_RRN =B.RETICLE_GROUP_RRNAND B.PRODUCT_RRN=" + productRrn;
this.value = "INSTANCE_RRN";
this.text = "INSTANCE_ID";
} else if (type.equalsIgnoreCase("SRCHOLDCODE")) {
this.refFile = "$HOLD_CODE";
this.where = " KEY_1_VALUE LIKE '%_SRCHOLD' ";
} else if (type.equalsIgnoreCase("RRCHOLDCODE")) {
this.refFile = "$HOLD_CODE";
this.where = " KEY_1_VALUE LIKE '%_RRCHOLD' ";
} else if (type.equalsIgnoreCase("SPCHOLDCODE")) {
this.refFile = "$HOLD_CODE";
this.where = " KEY_1_VALUE LIKE '%_SPCHOLD' ";
} else if (type.contains("EQT_EVENTS")) {
String[] params = type.split(",", -1);
long userRrn = StringUtils.isNotBlank(params[1]) ? Long.parseLong(params[1].trim()) : -1L;
String entityId = StringUtils.isNotBlank(params[2]) ? params[2].trim().toUpperCase() : "";
this.table = "(SELECT DISTINCT v.from_rrn user_rrn, v.key_2_value instance_id, v.instance_desc," + "T" +
".entity_rrn,T.valid_status,T.target_status,T.entity_id FROM(" + "SELECT e.entity_rrn, e" +
".allowable_events_rrn, r.to_rrn, M.valid_status, " + "M.target_status, n.instance_id entity_id " +
"FROM relation r, named_object n, " + "event_model M,entity e LEFT OUTER JOIN entity_status s ON " +
"(e.entity_rrn = " + "s.entity_rrn) WHERE e.allowable_events_rrn = r.from_rrn AND r.link_type = " +
"'ALLOWABLEEVENT_TO_EVENT' AND r.to_rrn = M.event_rrn AND e.entity_rrn = " +
"n.instance_rrn and N.instance_id='" + entityId + "' AND (M.valid_status " +
"IS NULL OR M.valid_status = s.current_status OR s.current_status = " +
"(CASE WHEN M.valid_status = '$EQPT_RUN_STATUS' THEN 'RUN' ELSE " +
"M.valid_status END) OR s.current_status = (CASE WHEN M.valid_status = " +
"'$EQPT_RUN_STATUS' THEN 'IDLE' ELSE M.valid_status END))) T ,(SELECT " +
"s.from_rrn,T.key_2_value,n2.instance_desc,n2.instance_rrn FROM (SELECT " +
"D.KEY_1_VALUE,D.KEY_2_VALUE FROM NAMED_OBJECT N, REFERENCE_FILE_DETAIL D " +
"WHERE N.INSTANCE_RRN = D.REFERENCE_FILE_RRN AND N.INSTANCE_ID = '$$USER_EVENT')" + " T, " +
"(SELECT from_rrn, instance_id FROM relation T, named_object n WHERE " +
"link_type = 'USER_TO_USER_GROUP' AND n.instance_rrn = T.to_rrn and " + "from_rrn = " + userRrn +
" ) s, named_object n2 WHERE T.key_1_value = " +
"s.instance_id AND n2.instance_id = T.key_2_value AND n2.OBJECT = 'EVENT') v " +
"WHERE v.instance_rrn = T.to_rrn) ct ";
this.value = "INSTANCE_ID";
this.text = "INSTANCE_ID";
} else if (type.contains("RETICLE_EVENTS")) {
String[] params = type.split(",");
long userRrn = StringUtils.isNotBlank(params[1]) ? Long.parseLong(params[1].trim()) : -1L;
String entityId = StringUtils.isNotBlank(params[2]) ? params[2].trim().toUpperCase() : "";
this.table = " (SELECT DISTINCT v.from_rrn user_rrn, v.key_2_value instance_id, v" + ".instance_desc, T" +
".entity_rrn, T.valid_status, T.target_status, T.entity_id FROM" + "(SELECT DISTINCT s.from_rrn, " +
"T.key_2_value, n2.instance_desc, n2.instance_rrn " + "FROM (SELECT N.NAMED_SPACE, N.INSTANCE_ID " +
"REF_FILE_ID, D.KEY_1_VALUE, D" + ".KEY_2_VALUE, D.DATA_1_VALUE, D.DATA_2_VALUE, D.DATA_3_VALUE, " +
"D.DATA_4_VALUE, D" + ".DATA_5_VALUE FROM NAMED_OBJECT N, REFERENCE_FILE_DETAIL D WHERE N" +
".INSTANCE_RRN" + " = D.REFERENCE_FILE_RRN) T, (SELECT * FROM relation T, named_object n WHERE " +
"link_type = 'USER_TO_USER_GROUP' AND n.instance_rrn = T.to_rrn ) s, " +
"named_object n2 WHERE T.ref_file_id = '$$USER_EVENT_RTL' AND T.key_1_value = s" +
".instance_id AND n2.instance_id = T.key_2_value AND n2.OBJECT = 'EVENT' ) v, " +
"(SELECT e.entity_rrn, e.allowable_events_rrn, r.to_rrn, M.valid_status, M" +
".target_status, n.instance_id entity_id FROM relation r, event_model M, " +
"named_object n, entity e LEFT JOIN entity_status s ON e.entity_rrn = s" +
".entity_rrn WHERE e.allowable_events_rrn = r.from_rrn AND r.link_type = " +
"'ALLOWABLEEVENT_TO_EVENT' AND r.to_rrn = M.event_rrn AND e.entity_rrn = n" +
".instance_rrn AND ( M.valid_status IS NULL OR M.valid_status = s.current_status" +
" ) ) T WHERE v.instance_rrn = T.to_rrn) v_table";
this.where = "USER_RRN = " + userRrn + "AND ENTITY_ID='" + entityId + "'";
this.value = "INSTANCE_ID";
this.text = "INSTANCE_ID";
} else if (type.equalsIgnoreCase("checkResult")) {
this.refFile = "$$CHECK_RESULT";
} else if (type.equalsIgnoreCase("SCRAPCODE")) {
this.refFile = "$SCRAP_CODE";
} else if (type.equalsIgnoreCase("UNSCRAPCODE")) {
this.refFile = "$UNSCRAP_CODE";
} else if (type.equalsIgnoreCase("userStatus")) {
this.refFile = "$$USER_STATUS";
} else if (type.equalsIgnoreCase("startHold")) {
this.refFile = "$$YES_OR_NO";
} else if (type.equalsIgnoreCase("RC_E1_MANAGER")) {
this.refFile = "$$RC_E1_MANAGER";
} else if (type.equals("RELATED_MODULE_GROUP")) {
this.refFile = "$$RELATED_MODULE_MANAGER";
} else if (type.equals("RELATED_MODULE_MANAGER")) {
this.refFile = "$$RELATED_MODULE_MANAGER";
this.text = "data_2_value";
} else if (type.equalsIgnoreCase("RC_SUPERVISOR")) {
this.refFile = "$$RC_SUPERVISOR";
} else if (type.equalsIgnoreCase("RC_MFG_MANAGER")) {
this.refFile = "$$RC_MFG_MANAGER";
} else if (type.equalsIgnoreCase("RETICLEPDEVENT")) {
this.refFile = "$$RETICLE_PD_EVENT";
} else if (type.equalsIgnoreCase("ACCEPTCONTAMINATION")) {
this.refFile = "$$ACCEPT_CONTAMINATION";
} else if (type.equalsIgnoreCase("PROCESSLOCATIONCARRIERTYPE")) {
this.refFile = "$$PROCESS_LOCARION_CARRIER_TYPE";
this.value = "key_1_value";
this.text = "key_1_value";
} else if (type.equalsIgnoreCase("areaDepartment")) {
this.refFile = "$AREA_DEPARTMENT";
this.value = "key_1_value";
this.text = "data_1_value";
} else if (type.equalsIgnoreCase("NA")) {
this.refFile = "";
this.value = "key_1_value";
this.text = "data_1_value";
} else if (type.equalsIgnoreCase("radComment")) {
this.refFile = "$$RAD_COMMENT";
} else if (type.equalsIgnoreCase("bankFlag")) {
this.refFile = "$BANK_FLAG";
} else if (StringUtils.equalsIgnoreCase("SORTERFLIPTYPE", type)) {
this.refFile = "$$SORTER_FLIP_TYPE";
// this.value = "data_1_value";
// this.text = "key_1_value";
} else if (StringUtils.equalsIgnoreCase("EQPTSTATUSCHANGECOMMENTS", type)) {
this.refFile = "$$EQPT_STATUS_CHANGE_COMMENTS";
}
}
public String getValue() {
return this.value;
}
public String getText() {
return this.text;
}
public String getTable() {
return this.table;
}
public String getRefFile() {
return this.refFile;
}
public String getWhere() {
return this.where;
}
}
/*
* Modification Log Log No : 01 Name : Wind Modified Date: 2001/12/20 Description : more friendly and speedly.
*/