# PiLotSetupHRowMapper.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.ems.pilot.dto.PiLotSetupHDTO;

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

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

        @Override
        public PiLotSetupHDTO mapRow(ResultSet rs, int rowNum) throws SQLException {
            PiLotSetupHDTO hdto = new PiLotSetupHDTO();
            hdto.setPiLotRrn(rs.getLong("PI_LOT_RRN"));
            hdto.setPiLotId(rs.getString("PI_LOT_ID"));
            hdto.setType(rs.getString("PI_LOT_TYPE"));
            hdto.setStatus(rs.getString("STATUS"));
            hdto.setEnableFlag(rs.getString("ENABLE_FLAG"));
            hdto.setEqptId(rs.getString("EQPT_ID"));
            hdto.setEqptRrn(rs.getLong("EQPT_RRN"));
            hdto.setQty(rs.getInt("WAFER_QTY"));
            hdto.setRuleId(rs.getString("WAFER_RULE_ID"));
            hdto.setRetryCount(rs.getInt("RETRY_COUNT"));
            hdto.setTransId(rs.getString("trans_id"));
            hdto.setTransRrn(rs.getLong("trans_rrn"));
            hdto.setTransUserRrn(rs.getLong("trans_user_rrn"));
            hdto.setTransUserId(rs.getString("trans_user_id"));
            hdto.setTransTime(rs.getTimestamp("trans_time"));
            hdto.setTransTimeStr(DateUtils.formatDate(hdto.getTransTime()));
            hdto.setParallelRunType(rs.getString("PARALLEL_RUN_TYPE"));

            //idle
            hdto.setIdleTime(rs.getInt("IDLE_TIME"));
            hdto.setMaxRunTime(rs.getInt("MAX_RUN_TIME"));
            hdto.setResetComment(rs.getString("RESET_COMMENT"));
            hdto.setSubType(rs.getString("SUB_TYPE"));

            //pm
            hdto.setBufferTime(rs.getInt("BUFFER_TIME"));
            hdto.setPmConstraintRecipe(rs.getString("PM_CONSTRAINT_RECIPE_ID"));

            //rcp grp
            hdto.setFromRecipeGroup(rs.getString("FROM_RCP_GRP_ID"));
            hdto.setToRecipeGroup(rs.getString("TO_RCP_GRP_ID"));

            //count
            hdto.setCountType(rs.getString("COUNT_TYPE"));
            hdto.setCountSpec(rs.getInt("COUNT_SPEC"));
            hdto.setCountTriggerRecipe("TRIGGER_RECIPE_ID");
            hdto.setCountConstraintRecipe("CONSTRAINT_RECIPE_ID");
            hdto.setTimePointDate(DateUtils.formatDate(rs.getTimestamp("TIME_POINT")));

            return hdto;
        }

    }