# SortJobMapper.java

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

    import com.mycim.valueobject.wip.responseModel.SortJobResponse;
    import org.springframework.jdbc.core.RowMapper;

    import java.sql.ResultSet;
    import java.sql.SQLException;
    import java.util.Date;

    /**
     * @author kang.zhang
     * @date 2019年3月7日下午1:49:13
     * @description
     */
    public class SortJobMapper implements RowMapper<SortJobResponse> {

        private SortJobResponse response;

        public SortJobMapper(SortJobResponse sortJobResponse) {
            this.response = sortJobResponse;
        }

        @Override
        public SortJobResponse mapRow(ResultSet rs, int rowNum) throws SQLException {
            response.setCompletedTime((Date) rs.getObject("COMPLETED_TIME"));
            response.setCreateTime((Date) rs.getObject("CREATE_TIME"));
            response.setCreateUser(rs.getString("CREATE_USER"));
            response.setExchangeTotalQty(rs.getInt("EXCHANGE_TOTAL_QTY"));
            response.setFacilityRrn(rs.getLong("FACILITY_RRN"));
            response.setJobRrn(rs.getLong("JOB_RRN"));
            response.setJobType(rs.getString("JOB_TYPE"));
            response.setLotId(rs.getString("LOT_ID"));
            response.setLotRrn(rs.getLong("LOT_RRN"));
            response.setSourceCarrierId(rs.getString("SOURCE_CARRIER_ID"));
            response.setSourceCarrierRrn(rs.getLong("SOURCE_CARRIER_RRN"));
            response.setStatus(rs.getString("STATUS"));
            response.setTargetCarrierId(rs.getString("TARGET_CARRIER_ID"));
            response.setTargetCarrierRrn(rs.getLong("TARGET_CARRIER_RRN"));
            response.setSourceLotStatus(rs.getString("SOURCE_LOT_STATUS"));
            response.setTargetLotId(rs.getString("TARGET_LOT_ID"));
            response.setTargetLotStatus(rs.getString("TARGET_LOT_STATUS"));
            response.setTargetCarrierId2(rs.getString("TARGET_CARRIER_ID_2"));
            response.setTargetCarrierRrn2(rs.getLong("TARGET_CARRIER_RRN_2"));
            response.setSplitSeq(rs.getInt("SPLIT_SEQ"));
            return response;
        }

    }