# UnitTimeLimitStatusMapper.java

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

    import com.mycim.framework.jdbc.mapper.RowMapper;
    import com.mycim.framework.utils.lang.time.DateUtils;
    import com.mycim.valueobject.wip.UnitTimelimitStatus;

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

    /**
     * @author Johnson.Wang
     * @version 6.0.0
     * @date 2019/10/12
     **/
    public class UnitTimeLimitStatusMapper implements RowMapper<UnitTimelimitStatus> {

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

            unitTimelimitStatus.setLotRrn(rs.getLong("LOT_RRN"));
            unitTimelimitStatus.setUnitRrn(rs.getLong("UNIT_RRN"));
            unitTimelimitStatus.setUnitId(rs.getString("UNIT_ID"));
            unitTimelimitStatus.setStepSequence(rs.getLong("STEP_SEQUENCE"));

            unitTimelimitStatus.setTimeLimitId(rs.getString("TIMELIMIT_ID"));
            unitTimelimitStatus.setTimeLimitRrn(rs.getLong("TIMELIMIT_RRN"));
            unitTimelimitStatus.setTimeLimitType(rs.getString("TIMELIMIT_TYPE"));

            unitTimelimitStatus.setStartProductRrn(rs.getLong("START_PRODUCT_RRN"));
            unitTimelimitStatus.setStartProcessRrn(rs.getLong("START_PROCESS_RRN"));
            unitTimelimitStatus.setStartProcessVersion(rs.getInt("start_process_version"));
            unitTimelimitStatus.setStartRouteRrn(rs.getLong("START_ROUTE_RRN"));
            unitTimelimitStatus.setStartOperationRrn(rs.getLong("START_OPERATION_RRN"));

            unitTimelimitStatus.setEndProductRrn(rs.getLong("END_PRODUCT_RRN"));
            unitTimelimitStatus.setEndRouteRrn(rs.getLong("END_ROUTE_RRN"));
            unitTimelimitStatus.setEndProcessRrn(rs.getLong("END_PROCESS_RRN"));
            unitTimelimitStatus.setEndOperationRrn(rs.getLong("END_OPERATION_RRN"));

            unitTimelimitStatus.setTimeLimit(DateUtils.formatDateForSeconds(rs.getLong("TIMELIMIT")));
            unitTimelimitStatus.setTimeLimitSec(rs.getLong("TIMELIMIT"));

            unitTimelimitStatus.setStartTime(rs.getTimestamp("START_TIME"));
            unitTimelimitStatus.setStatus(rs.getString("STATUS"));
            unitTimelimitStatus.setAdditionalTimeLimit(rs.getLong("ADDITIONAL_TIMELIMIT"));

            unitTimelimitStatus.setTimeType(rs.getString("TIME_TYPE"));
            unitTimelimitStatus.setLimitType(rs.getString("LIMIT_TYPE"));

            unitTimelimitStatus.setStartRouteSeq(rs.getString("START_ROUTE_SEQ"));
            unitTimelimitStatus.setStartOperationSeq(rs.getString("START_OPERATION_SEQ"));

            unitTimelimitStatus.setEndRouteSeq(rs.getString("END_ROUTE_SEQ"));
            unitTimelimitStatus.setEndOperationSeq(rs.getString("END_OPERATION_SEQ"));
            unitTimelimitStatus.setModule(rs.getString("MODULE"));

            return unitTimelimitStatus;
        }

    }