电商项目之搜索传过去为集合(超级重点)

1、

  <select id="selectByNameAndCategoryIds" resultMap="BaseResultMap" parameterType="map">
    select
    <include refid="Base_Column_List"></include>
    from mmall_product
    where status=1
    <if test="productName!=null">
      and name like #{productName}
    </if>
    <if test="categoryIdList!=null">
      and category_id in
      <foreach item="item" index="index" open="(" separator="," close=")" collection="categoryIdList">
        #{item}
      </foreach>
    </if>
  </select>

猜你喜欢

转载自blog.csdn.net/Richard_666/article/details/86015429