我们可以把view类转换成map,然后可以这样设置mybatis
<resultMap id="data_result" type="com.kitsmart.common.view.data.KitData">
<id column="_id" property="_id" />
<result column="data" property="data" />
</resultMap>
<select id="getData" parameterType="java.util.Map"
resultMap="data_result">
select * from data
<where>
<foreach collection="_parameter.keys" item="k" separator="and" index="key">
<if test="_parameter[k] != null">
${k}=#{${k}, jdbcType=VARCHAR}
</if>
</foreach>
</where>
</select>