Mybatis传入Map集合,根据key来获取实体类中的值
public List<PbPartyOrg> getPartyOrgList(String userId,String userFlag, String orgType)
{
Map<String,Object> param = new HashMap<String,Object>(1);
param.put("userId", userId);
param.put("userFlag", userFlag);
param.put("orgType", orgType);
return pbPartyOrgMapper.getPartyOrgList(param);
}
<select id="getPartyOrgList" resultMap="BaseResultMap"
parameterType="java.util.Map">
select * from(
select
org.PARTY_ORG_ID,
org.ORG_NAME,
org.ORG_PROFILE,
org.PARTY_ORG_NO,
org.LAST_ORG,
org.OWE_RELATION,
org.ORG_TYPE,
org.PLACE_ORGANIZAITON,
org.MEMBER_INF_INTEGRITY,
org.STATE,
org.PARTY_ORDER,
org.PARTY_CREATETIME,
org.PARTY_EST_NUM
from pb_party_org org
where 1=1
<if test="orgType != null and orgType != ''">
and org.ORG_TYPE != #{orgType}
</if>
<if test='userFlag == "1"'>
START WITH
org.party_org_id in
(select auth.data_id from pb_data_authority auth where
auth.user_id =
#{userId,jdbcType=VARCHAR})
CONNECT BY PRIOR org.party_org_id =
org.last_org
</if>
)t
where t.state = '1'
order by t.PARTY_ORDER
</select>