# LotInventoryDORowMapper.java

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

    import com.mycim.framework.jdbc.mapper.RowMapper;
    import com.mycim.valueobject.inv.LotInventoryDO;

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

    /**
     * @author shijie.deng
     * @date 2019/8/30
     **/
    public class LotInventoryDORowMapper implements RowMapper<LotInventoryDO> {

        private LotInventoryDO lotInventoryDO;

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

            // From LOT_INVENTORY
            lotInventoryDO.setLotNumber(rs.getString("LOT_NUMBER"));
            lotInventoryDO.setItemRrn(rs.getLong("ITEM_RRN"));

            lotInventoryDO.setMaterialType(rs.getString("material_type"));

            lotInventoryDO.setWarehouseRrn(rs.getLong("WAREHOUSE_RRN"));
            lotInventoryDO.setWarehouseId(rs.getString("WAREHOUSE_ID"));

            lotInventoryDO.setLocationRrn(rs.getLong("location_rrn"));

            lotInventoryDO.setReceiptQty(new Double(rs.getDouble("RECEIPT_QTY")));
            lotInventoryDO.setIssueQty(new Double(rs.getDouble("ISSUE_QTY")));
            lotInventoryDO.setAdjustQty(new Double(rs.getDouble("ADJUST_QTY")));

            lotInventoryDO.setReceiptDate(rs.getTimestamp("RECEIPT_DATE"));
            lotInventoryDO.setExpirationDate(rs.getTimestamp("EXPIRATION_DATE"));
            lotInventoryDO.setReTestDate(rs.getTimestamp("RE_TEST_DATE"));
            lotInventoryDO.setQaApprovalDate(rs.getTimestamp("QA_APPROVAL_DATE"));
            lotInventoryDO.setStatus(rs.getString("STATUS"));
            lotInventoryDO.setAvailabilityDays(new Double(rs.getDouble("AVAILABILITY_DAYS")));

            lotInventoryDO.setWaferPNType(rs.getString("WAFERPNTYPE"));
            lotInventoryDO.setWaferLatticeOrientation(rs.getString("WAFERLATTICEORIENTATION"));
            lotInventoryDO.setWaferResistance(rs.getString("WAFERRESISTANCE"));
            lotInventoryDO.setWaferExtension(rs.getString("WAFEREXTENSION"));
            lotInventoryDO.setWaferSupplier(rs.getString("WAFERSUPPLIER"));

            // From LOT_INVENTORY_EXT
            lotInventoryDO.setCustomerId(rs.getString("CUSTOMER_ID"));
            lotInventoryDO.setOffOrientation(rs.getString("OFF_ORIENTATION"));
            lotInventoryDO.setTypeDopant(rs.getString("TYPE_DOPANT"));
            lotInventoryDO.setThickness(rs.getString("THICKNESS"));
            lotInventoryDO.setProductionDate(rs.getTimestamp("PRODUCTION_DATE"));
            lotInventoryDO.setValidTerm(rs.getString("CUSTOMER_ID"));

            lotInventoryDO.setIncomingDate(rs.getTimestamp("INCOMING_DATE"));
            lotInventoryDO.setCheckDate(rs.getTimestamp("CHECK_DATE"));
            lotInventoryDO.setCheckUser(rs.getString("CHECK_USER"));
            lotInventoryDO.setCheckResult(rs.getString("CHECK_RESULT"));

            lotInventoryDO.setAttributeData1(rs.getString("ATTRIBUTE_DATA1"));
            lotInventoryDO.setAttributeData2(rs.getString("ATTRIBUTE_DATA2"));
            lotInventoryDO.setAttributeData3(rs.getString("ATTRIBUTE_DATA3"));
            lotInventoryDO.setAttributeData4(rs.getString("ATTRIBUTE_DATA4"));
            lotInventoryDO.setAttributeData5(rs.getString("ATTRIBUTE_DATA5"));

            return lotInventoryDO;
        }

    }