package com.infoepoch.pms.dispatchassistant.infractructure.basic.permission;


import com.infoepoch.pms.dispatchassistant.domain.basic.menu.Menu;
import org.springframework.jdbc.core.RowMapper;

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

/**
 * @author xuyj
 * @description 菜单实体映射（JdbcTemplate）
 * @date 2019-11-15 10:34
 */
public class MenuRowMapper implements RowMapper<Menu> {

    @Override
    public Menu mapRow(ResultSet resultSet, int i) throws SQLException {
        return new Menu(resultSet.getString("ME_ID"),
                resultSet.getString("ME_NAME"),
                resultSet.getString("ME_URL"),
                resultSet.getString("ME_ICON"),
                resultSet.getBoolean("ME_COLLAPSE"),
                resultSet.getBoolean("ME_DISABLED"),
                resultSet.getString("ME_DESCRIPTION"),
                resultSet.getString("ME_PARENT_ID"),
                resultSet.getInt("ME_ELEMENT"),
                resultSet.getInt("ME_SORTING"),
                resultSet.getDate("ME_CREATE_TIME"),
                resultSet.getDate("ME_MODIFY_TIME"),
                resultSet.getInt("ME_TYPE"),
                resultSet.getBoolean("ME_CONTROLDATA")
        );
    }
}
