# UnitMapRowMapper.java

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

    import com.mycim.framework.jdbc.mapper.RowMapper;
    import com.mycim.framework.utils.lang.StringUtils;

    import java.sql.ResultSet;
    import java.sql.SQLException;
    import java.util.HashMap;
    import java.util.Map;

    public class UnitMapRowMapper implements RowMapper<Map<String, Object>> {

        private Map<String, Object> unit;

        @Override
        public Map<String, Object> mapRow(ResultSet rs, int rowNum) throws SQLException {
            unit = new HashMap<>();
            unit.put("lotRrn", rs.getString(1));
            unit.put("unitRrn", rs.getString(2));
            unit.put("unitId", rs.getString(3));
            unit.put("position", rs.getString(4));
            // unit.put("available", rs.getString(5));
            // unit.put("dummyflag", rs.getString(6));
            unit.put("unitstatus", rs.getString(7));
            unit.put("lotid", rs.getString(8));
            if (StringUtils.isNotEmpty(rs.getString("T7CODE"))) {
                unit.put("t7code", rs.getString("T7CODE"));
            } else {
                unit.put("t7code", "");
            }

            if (StringUtils.isNotEmpty(rs.getString(9))) {
                // unit.put("productRrn", rs.getString(9));
            }
            if (StringUtils.isNotEmpty(rs.getString("recipe_id"))) {
                unit.put("ppid", rs.getString("recipe_id"));
                unit.put("recipeId", rs.getString("recipe_id"));
            } else {
                unit.put("ppid", "");
                unit.put("recipeId", "");
            }
            if (StringUtils.isNotEmpty(rs.getString("UNIT_ALIAS_1"))) {
                unit.put("unitAlias1", rs.getString("UNIT_ALIAS_1"));
            } else {
                unit.put("unitAlias1", "");
            }
            if (StringUtils.isNotEmpty(rs.getString("UNIT_ALIAS_2"))) {
                unit.put("unitAlias2", rs.getString("UNIT_ALIAS_2"));
            } else {
                unit.put("unitAlias2", "");
            }

            if (StringUtils.isNotEmpty(rs.getString("ITEM_ID"))) {
                unit.put("itemId", rs.getString("ITEM_ID"));
            } else {
                unit.put("itemId", "");
            }

            return unit;
        }

    }