首页 > 代码库 > mybatis 之resultType="Map"

mybatis 之resultType="Map"

Map map = new HashMap();            map.put("productTypeID", productTypeId);                        List<HashMap> productAttributeList = productsListService.getAttrByTypeID(map);    
public List<HashMap> getAttrByTypeID(Map map) {        return commonDao.queryForList("ProductAttribute.getAttrByTypeID", map);    }
 <select id="getAttrByTypeID" parameterType="Map" resultType="Map">            select distinct a.attribute_id as ATTR_GROUP_ID,a.attribute_name as ATTR_GROUP_NAME,‘‘ IS_DISPLAY from PRODUCT_ATTRIBUTE a ,ATTR_GROUP_DEF c,ATTR_GROUP_TYPE_DEF k            where k.attr_group_id= c.attr_group_id            and c.attribute_id = a.attribute_id             and k.product_type_id = #{productTypeID}    </select>

 

mybatis 之resultType="Map"