我是靠谱客的博主 专注发箍,这篇文章主要介绍mybatis 查询参数为集合list、数组、map的情况,现在分享给大家,希望可以做个参考。

 

【记录一下,list情况】

 

<select id="getEmployeesListParams" resultType="Employees">
        select *
        from EMPLOYEES e
        where e.EMPLOYEE_ID in
        <foreach collection="employeeIds" item="employeeId" index="index"
            open="(" close=")" separator=",">
            #{employeeId}
        </foreach>
    </select>

 

 

集合循环查询结果,union all(着重separator属性)

 

 

 

<select id="getProductEnableNumberInfos" resultMap="productMap" >
		  SELECT * from (
			  <foreach collection="conditions.list" item="item" index="index" separator="union all">
				SELECT XXX 
		      </foreach>
		     ) alias WHERE alias.WMST_ENABLED_NUMBER>0;
	</select>

 

 

 

 

 

 

感谢:http://blog.csdn.net/small____fish/article/details/8029030/

最后

以上就是专注发箍最近收集整理的关于mybatis 查询参数为集合list、数组、map的情况的全部内容,更多相关mybatis内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(120)

评论列表共有 0 条评论

立即
投稿
返回
顶部