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

当查询where in String[]时

SRE实战 互联网时代守护先锋,助力企业售后服务体系运筹帷幄!一键直达领取阿里云限量特价优惠。
<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 ...

扫码关注我们
微信号:SRE实战
拒绝背锅 运筹帷幄