# LotAutoMonitorInfoMapper.java

    package com.mycim.server.automonitor.dao.mapper;

    import com.mycim.framework.jdbc.mapper.RowMapper;
    import com.mycim.valueobject.automonitor.entity.LotAutoMonitorInfo;
    import com.mycim.valueobject.wip.LotStatus;

    import java.sql.ResultSet;
    import java.sql.SQLException;

    public class LotAutoMonitorInfoMapper implements RowMapper<LotAutoMonitorInfo> {

        LotAutoMonitorInfo lotAutoMonitorInfo;

        @Override
        public LotAutoMonitorInfo mapRow(ResultSet rs, int rowNum) throws SQLException {
            lotAutoMonitorInfo = new LotAutoMonitorInfo();
            lotAutoMonitorInfo.setLotId(rs.getString("LOT_ID"));
            lotAutoMonitorInfo.setLotRrn(rs.getLong("LOT_RRN"));
            lotAutoMonitorInfo.setBaseLotId(rs.getString("BASE_LOT_ID"));
            lotAutoMonitorInfo.setBaseLotRrn(rs.getLong("BASE_LOT_RRN"));
            lotAutoMonitorInfo.setCarrierId(rs.getString("CARRIER_ID"));
            lotAutoMonitorInfo.setCarrierRrn(rs.getLong("CARRIER_RRN"));
            lotAutoMonitorInfo.setProductId(rs.getString("PRODUCT_ID"));
            lotAutoMonitorInfo.setQty1(rs.getDouble("QTY1"));
            lotAutoMonitorInfo.setMonitorCarrierId(rs.getString("MONITOR_CARRIER_ID"));
            lotAutoMonitorInfo.setMonitorCarrierRrn(rs.getLong("MONITOR_CARRIER_RRN"));
            lotAutoMonitorInfo.setMainEqptId(rs.getString("MAIN_EQUIPMENT_ID"));
            lotAutoMonitorInfo.setMainEqptRrn(rs.getLong("MAIN_EQUIPMENT_RRN"));
            lotAutoMonitorInfo.setItemType(rs.getString("ITEM_TYPE"));
            lotAutoMonitorInfo.setEqptLocation(rs.getString("EQUIPMENT_LOCATION"));
            lotAutoMonitorInfo.setOpeartionDesc(rs.getString("OPERATION_DESC"));
            lotAutoMonitorInfo.setRecipeId(rs.getString("RECIPE_ID"));

            String lotStatus = rs.getString("LOT_STATUS");
            lotAutoMonitorInfo.setLotStatus(lotStatus);

            if(LotStatus.isAutoMonitorMerge(lotStatus)) {
                lotAutoMonitorInfo.setFlowSeq(rs.getString("LOT_FLOW_SEQ"));
                lotAutoMonitorInfo.setStageId(rs.getString("LOT_STAGE_ID"));
            } else {
                lotAutoMonitorInfo.setFlowSeq(rs.getString("FLOW_SEQ"));
                lotAutoMonitorInfo.setStageId(rs.getString("STAGE_ID"));
            }

            lotAutoMonitorInfo.setEqptType(rs.getString("EQUIPMENT_TYPE"));
            lotAutoMonitorInfo.setEqptRrn(rs.getLong("EQUIPMENT_RRN"));
            lotAutoMonitorInfo.setEqptId(rs.getString("EQUIPMENT_ID"));
            lotAutoMonitorInfo.setEqptGroupId(rs.getString("EQUIPMENT_GROUP_ID"));
            lotAutoMonitorInfo.setEqptGroupRrn(rs.getLong("EQUIPMENT_GROUP_RRN"));
            lotAutoMonitorInfo.setReticleId(rs.getString("RETICLE_ID"));
            lotAutoMonitorInfo.setReticleRrn(rs.getLong("RETICLE_RRN"));
            lotAutoMonitorInfo.setReticleGroupId(rs.getString("RETICLE_GROUP_ID"));
            lotAutoMonitorInfo.setReticleGroupRrn(rs.getLong("RETICLE_GROUP_RRN"));

            lotAutoMonitorInfo.setJobStatus(rs.getString("JOB_STATUS"));
            lotAutoMonitorInfo.setNonRTSlotType(rs.getString("NONRT_SLOT_TYPE"));

            lotAutoMonitorInfo.setWorkflowRrn(rs.getLong("WORKFLOW_RRN"));
            lotAutoMonitorInfo.setWorkflowVersion(rs.getInt("WORKFLOW_VERSION"));
            lotAutoMonitorInfo.setWorkflowStepSequence(rs.getLong("STEP_SEQUENCE"));
            lotAutoMonitorInfo.setStartSplitFlag(rs.getBoolean("START_SPLIT_FLAG"));

            lotAutoMonitorInfo.setMainEqptType(rs.getString("MAIN_EQUIPMENT_TYPE"));
            return lotAutoMonitorInfo;
        }

    }