<?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.TourGoodSiteMapper">

	<!-- 可根据自己的需求，是否要使用 -->
    <resultMap type="com.xxfc.platform.tour.entity.TourGoodSite" id="tourGoodSiteMap">
        <result property="id" column="id"/>
        <result property="goodId" column="good_id"/>
        <result property="name" column="name"/>
        <result property="address" column="address"/>
        <result property="departTime" column="depart_time"/>
        <result property="longitude" column="longitude"/>
        <result property="latitude" column="latitude"/>
        <result property="type" column="type"/>
        <result property="rank" column="rank"/>
        <result property="status" column="status"/>
        <result property="crtTime" column="crt_time"/>
        <result property="updTime" column="upd_time"/>
        <result property="intro" column="intro"/>
        <result property="isDel" column="is_del"/>
    </resultMap>
    <resultMap type="com.xxfc.platform.tour.vo.TourDepartVo" id="tourDepartVoMap">
        <result property="id" column="id"/>
        <result property="goodId" column="good_id"/>
        <result property="name" column="name"/>
        <result property="address" column="address"/>
        <result property="companyId" column="company_id"/>
        <result property="province" column="province"/>
        <result property="provinceName" column="province_name"/>
        <result property="city" column="city"/>
        <result property="cityName" column="city_name"/>
        <result property="departTime" column="depart_time"/>
        <result property="longitude" column="longitude"/>
        <result property="latitude" column="latitude"/>
        <result property="type" column="type"/>
        <result property="intro" column="intro"/>
        <result property="rank" column="rank"/>
    </resultMap>

    <!-- 获取出行时间 -->
    <select id="getlistByGoodId"  resultMap="tourDepartVoMap">
        SELECT *  FROM tour_good_site
        WHERE good_id=#{goodId} and is_del=0
    </select>
    <update id="delSite">
        update  tour_good_site 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>