MyBatis parameter from HashMap

半腔热情 提交于 2019-11-29 16:02:46

I found the answer:

 <select id="select" parameterType="map" resultMap="RM">
        SELECT ... 
        FROM ....
        WHERE id=#{filterData.id}
    </select>
Rajesh

If you have pure java class you can map in the parameterType as input to the query and return as different custom pojo class like this.

<select id="getCustomMember" parameterType="com.custom.member" resultMap="custDocMap">
        select
        customer_id, cust_start_dt, cust_type, src_sys_doc_id, 
        legal_backer_id, eenv_create_dt
        from
        web_data..wd_edoc
        where
        eenv_create_dt = #{member.date}
    </select>
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!