# SeasonRowMapper.java

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

    import com.mycim.framework.jdbc.mapper.RowMapper;
    import com.mycim.framework.utils.lang.StringUtils;
    import com.mycim.framework.utils.lang.time.DateUtils;
    import com.mycim.valueobject.ems.Season;
    import com.mycim.valueobject.ems.SeasonHistory;

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

    public class SeasonRowMapper implements RowMapper<Season> {

        @Override
        public Season mapRow(ResultSet rs, int rowNum) throws SQLException {
            Season seasonInfo = new Season();
            seasonInfo.setSeasonId(rs.getString("season_id"));
            seasonInfo.setEqptId(rs.getString("eqpt_id"));
            seasonInfo.setEqptRrn(rs.getLong("eqpt_rrn"));
            seasonInfo.setStatus(rs.getString("status"));
            seasonInfo.setSeasonType(rs.getString("season_type"));
            seasonInfo.setSubType(rs.getString("subtype"));
            seasonInfo.setConstraintRecipeId(rs.getString("constraint_recipe_id"));
            seasonInfo.setIdleTime(rs.getDouble("idle_hour_time"));
            seasonInfo.setFromRecipeGroupId(rs.getString("from_recipe_group_id"));
            seasonInfo.setToRecipeGroupId(rs.getString("to_recipe_group_id"));
            seasonInfo.setSeasonProdId(rs.getString("season_prod_id"));
            seasonInfo.setSeasonRecipeId(rs.getString("season_recipe_id"));
            seasonInfo.setSeasonWaferCnt(rs.getLong("season_wafer_count"));
            seasonInfo.setLastCompleteTime(rs.getTimestamp("last_complete_time"));
            String lastUpdateTime = DateUtils.formatDate(rs.getTimestamp("update_time"));
            String createTime = DateUtils.formatDate(rs.getTimestamp("create_time"));
            seasonInfo.setCreatedTime(createTime);
            seasonInfo.setLastUpdateTime(StringUtils.isNotBlank(lastUpdateTime) ? lastUpdateTime : createTime);
            seasonInfo.setUserId(rs.getString("create_user_id"));
            seasonInfo.setLastUpdateUserId(rs.getString("update_user_id"));
            seasonInfo.setSeasonRrn(rs.getLong("season_rrn"));
            seasonInfo.setResetComment(rs.getString("reset_comment"));
            seasonInfo.setMaxRunTime(rs.getDouble("MAX_RUN_TIME"));
            seasonInfo.setRealIdleTime(rs.getDouble("real_idle_time"));
            return seasonInfo;
        }

    }