# CarrierInqMapper.java

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

    import com.mycim.framework.jdbc.mapper.RowMapper;
    import com.mycim.valueobject.ems.Carrier;

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

    /**
     * @author finatice.yang
     * @date 2021/12/23
     **/
    public class CarrierInqMapper implements RowMapper<Carrier> {

        @Override
        public Carrier mapRow(ResultSet rs, int rowNum) throws SQLException {
            Carrier carrier = new Carrier();
            // construct the value object
            carrier.setInstanceRrn(rs.getLong("CARRIER_RRN"));
            carrier.setInstanceId(rs.getString("CARRIER_ID"));
            carrier.setInstanceDesc(rs.getString("DESCRIPTION"));
            carrier.setCarrierPollutionLevel(rs.getString("pollution_level"));
            carrier.setCarrierCode(rs.getString("carrier_code"));
            carrier.setAllowableEventsRrn(rs.getLong("allowable_events_rrn"));
            carrier.setObjectSubtype(rs.getString("obj_subtype"));

            carrier.setSlotCount(rs.getLong("SLOT_COUNT"));
            carrier.setAvailableSlotCount(rs.getLong("AVAILABLE_SLOT_COUNT"));
            carrier.setCarrierCode(rs.getString("CARRIER_CODE"));
            carrier.setMcsMoveStatus(rs.getString("MCS_MOVE_STATUS"));

            Timestamp timestampTemp = rs.getDate("MCS_LAST_MOVE_TIME") != null ? new Timestamp(
                    rs.getDate("MCS_LAST_MOVE_TIME").getTime()) : null;

            carrier.setMcsLastMoveTime(timestampTemp);
            carrier.setMcsLastOperatorRrn(new Long(rs.getLong("MCS_LAST_OPERATOR_RRN")));
            carrier.setEqptRrn(new Long(rs.getLong("EQPT_RRN")));
            carrier.setJobRrn(new Long(rs.getLong("JOB_RRN")));
            carrier.setRunRrn(new Long(rs.getLong("RUN_RRN")));
            carrier.setCarrierMapRrn(new Long(rs.getLong("CARRIER_MAP_RRN")));
            carrier.setLoadPosition(new Short(rs.getShort("LOAD_POSITION")));
            carrier.setPollutionLevel(rs.getString("POLLUTION_LEVEL"));
            carrier.setCarrierStatus(rs.getString("CURRENT_STATUS"));
            carrier.setFlagType(rs.getString("FLAG_TYPE"));
            carrier.setDmmType(rs.getString("DMM_TYPE"));
            return carrier;
        }
    }