首页 > 其他 > 详细

myhabits where in foreach

时间:2019-04-13 10:05:07      阅读:208      评论:0      收藏:0      [点我收藏+]

myhabits传入参数:类,其中类中包含字符串数组String[]

当查询where in String[]时

<select id="selectData" parameterType="DataDay"<!-- 类名 -->
        resultMap="DataResult">
       select * from
        data_day
        <where>
            <if test="selectStringName != null  and selectStringName!= ‘‘ and selectStringName.length!=0 ">
                and selectName in
                <foreach collection="selectStringName" <!-- 注意此处要写这个字符串数组的名称 -->

item="selectStringName"
                    open="(" separator="," close=")">
                    #{selectStringName}
                </foreach>
            </if>
        </where>
    </select>

如果写成 collecton=“array”,会报错There is no getter for property named ‘array‘ in ‘class ...

myhabits where in foreach

原文:https://www.cnblogs.com/webttt/p/10699807.html

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