<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">

<mapper namespace="com.xxfc.platform.tour.mapper.TourGoodBannerMapper">

	<!-- 可根据自己的需求，是否要使用 -->
    <resultMap type="com.xxfc.platform.tour.entity.TourGoodBanner" id="tourGoodBannerMap">
        <result property="id" column="id"/>
        <result property="title" column="title"/>
        <result property="cover" column="cover"/>
        <result property="crtName" column="crt_name"/>
        <result property="crtTime" column="crt_time"/>
        <result property="updName" column="upd_name"/>
        <result property="updTime" column="upd_time"/>
        <result property="url" column="url"/>
        <result property="isDel" column="is_del"/>
    </resultMap>

    <select id="getBannerList"  resultType="com.xxfc.platform.tour.dto.GoodBannerDTO">
        select * FROM tour_good_banner where  good_id=#{goodId} and is_del=0
  </select>

    <update id="delBanner">
        update  tour_good_banner set  is_del=1
        where 1=1
        <if test="goodId !=null and  goodId >0 ">
             and good_id=#{goodId}

        </if>
         <if test="list!=null ">
             and id not in (
           <trim suffixOverrides=",">
            <foreach collection="list" item="id">
                 #{id},
           </foreach>
         </trim>
             )
        </if>
    </update>

</mapper>