首页 > 其他 > 详细

mybaties中在xml中map添加一个list中的判断

时间:2016-08-05 17:50:56      阅读:423      评论:0      收藏:0      [点我收藏+]
 if (uIds.size() > 0) {
            map.put("uIds", uIds);
        } else {
            map.put("uIds", null);
        }
 <select id="queryCourseEvaluationPeopleByUIds" resultType="map" resultMap="BaseResultMap">
        select * from t_se_course_comment
        <where>
            <if test="map.kid!=null and map.kid!=‘‘">
                and course_id = #{map.kid}
            </if>
            <if test="map.uIds!=null">
                and evaluation_teacher in
                <foreach collection="map.uIds" item="item" index="index" open="(" close=")" separator=",">
                    #{item}
                </foreach>
            </if>

        </where>
        order by id ASC
    </select>

 

mybaties中在xml中map添加一个list中的判断

原文:http://www.cnblogs.com/Eddyer/p/5742072.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!