# OcapCardRowMapper.java

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

    import com.mycim.framework.jdbc.mapper.RowMapper;
    import com.mycim.valueobject.ocap.OcapCard;

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

    /**
     * @author Qiansheng.Wang
     * @since 2020-01-07
     */
    public class OcapCardRowMapper implements RowMapper<OcapCard> {

        @Override
        public OcapCard mapRow(ResultSet rs, int rowNum) throws SQLException {
            OcapCard ocapCard = new OcapCard();

            ocapCard.setOcapRrn(rs.getLong("OCAP_RRN"));
            ocapCard.setOcapId(rs.getString("OCAP_ID"));
            ocapCard.setFacilityRrn(rs.getLong("FACILITY_RRN"));
            ocapCard.setOcapType(rs.getString("OCAP_TYPE"));
            ocapCard.setStatus(rs.getString("STATUS"));

            ocapCard.setCreateUserRrn(rs.getLong("CREATE_USER_RRN"));
            ocapCard.setCreateUserId(rs.getString("CREATE_USER_ID"));
            ocapCard.setCreateTime(rs.getTimestamp("CREATE_TIME"));

            ocapCard.setLotRrn(rs.getLong("LOT_RRN"));
            ocapCard.setLotId(rs.getString("LOT_ID"));
            ocapCard.setLotStepSequence(rs.getLong("LOT_STEP_SEQUENCE"));

            ocapCard.setParameterSetRrn(rs.getLong("PARAMETER_SET_RRN"));
            ocapCard.setParameterSetId(rs.getString("PARAMETER_SET_ID"));
            ocapCard.setParameterSetVersion(rs.getInt("PARAMETER_SET_VERSION"));

            ocapCard.setProcessEquipmentRrn(rs.getLong("PROCESS_EQUIPMENT_RRN"));
            ocapCard.setProcessEquipmentId(rs.getString("PROCESS_EQUIPMENT_ID"));

            ocapCard.setMeasuringEquipmentRrn(rs.getLong("MEASURING_EQUIPMENT_RRN"));
            ocapCard.setMeasuringEquipmentId(rs.getString("MEASURING_EQUIPMENT_ID"));

            ocapCard.setProcessStationRrn(rs.getLong("PROCESS_STATION_RRN"));
            ocapCard.setProcessStationId(rs.getString("PROCESS_STATION_ID"));

            ocapCard.setMeasuringStationRrn(rs.getLong("MEASURING_STATION_RRN"));
            ocapCard.setMeasuringStationId(rs.getString("MEASURING_STATION_ID"));

            ocapCard.setAreaId(rs.getString("AREA_ID"));
            ocapCard.setStageId(rs.getString("STAGE_ID"));

            ocapCard.setChartId(rs.getString("CHART_ID"));
            ocapCard.setChartName(rs.getString("CHART_NAME"));

            ocapCard.setStartTime(rs.getTimestamp("START_TIME"));
            ocapCard.setCloseTime(rs.getTimestamp("CLOSE_TIME"));

            ocapCard.setDcolRrn(rs.getLong("DCOL_RRN"));
            ocapCard.setWorkflowId(rs.getString("WORKFLOW_ID"));
            ocapCard.setWorkflowRrn(rs.getLong("WORKFLOW_RRN"));
            ocapCard.setExecutionRrn(rs.getLong("EXECUTION_RRN"));
            ocapCard.setOcapBatchId(rs.getString("OCAP_BATCH_ID"));
            ocapCard.setOcapMainLotId(rs.getString("OCAP_MAIN_LOT_ID"));
            ocapCard.setOcapMainLotRrn(rs.getLong("OCAP_MAIN_LOT_RRN"));

            ocapCard.setSignerId(rs.getString("SIGNER_ID"));
            ocapCard.setSignerRrn(rs.getLong("SIGNER_RRN"));

            ocapCard.setStepOwnerType(rs.getString("STEP_OWNER_TYPE"));
            ocapCard.setStepOwnerId(rs.getString("STEP_OWNER_ID"));
            ocapCard.setStepOwnerRrn(rs.getLong("STEP_OWNER_RRN"));

            ocapCard.setCurrentStepId(rs.getString("CURRENT_STEP_ID"));

            return ocapCard;
        }

    }