# Mybatis 封装成 Map 结果

# Dao

1
2
@MapKey("cityCode")
Map<String,InvoiceSubjectRuleCity> bulkSelectRuleCityByRuleIdList(@Param("ruleIdList") List<Long> ruleIdList);
1
2
3
4
5
6
7
8
9
10
11
<select id="bulkSelectRuleCityByRuleIdList" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>
from t_invoice_subject_rule_city
<where>
rule_id in
<foreach collection="ruleIdList" item="ruleId" open="(" close=")" separator=",">
#{ruleId}
</foreach>
</where>
</select>

返回结果即为 Map 类型

Edited on Views times