首页
学习
活动
专区
工具
TVP
发布
社区首页 >问答首页 >mybatis-plus查询语句中集合column传入多个参数引发的问题??

mybatis-plus查询语句中集合column传入多个参数引发的问题??

提问于 2019-10-15 17:20:32
回答 0关注 0查看 2.2K
代码语言:javascript
复制

<resultMap id="testVo" type="com.test.vo.TestVo">
    <collection property="testInfos" javaType="java.util.List"
         select="com.test.mapper.TestInfoMapper.innerSelectByMap" column="{id=id,title=title}" ofType="java.util.Map"/>

<!-- 外部接口 -->
<select id="queryList" resultMap="testVo">
    select id, title from test where uid=#{uid}
</select>
代码语言:javascript
复制
<!-- innerXXX: 内部操作方法,不对外提供接口 -->
<select id="innerSelectByMap" resultType="com.test.entity.TestInfo" parameterType="java.util.Map">
    select * from test_info where 1=1
    <foreach collection="_parameter" separator="" index="key" item="value" open="" close="">
        and `${key}` = #{value}
    </foreach>

</select>

当调用queryList时,如果获得的结果中title为null,则传入到innerSelectByMap的参数只有一个,如果id、title不为null,则可以正常的传入两个参数。

这个bug如何解决????

回答

和开发者交流更多问题细节吧,去 写回答
相关文章

相似问题

相关问答用户
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档