<?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="cn.com.ctop.manage.modules.actor.mapper.ActorCommentMapper">
    <insert id="addTag">
        insert into actor_tag_info (actor_id, tag_id, tag_name)
        values (#{actorId}, #{tagId}, #{tagName})

    </insert>
    <delete id="deleteTagByActorId" parameterType="java.lang.Long">
        delete from actor_tag_info where actor_id =#{actorId}
    </delete>


    <select id="getCityList" resultType="com.alibaba.fastjson.JSONObject">
        select city_id  as 'cityId', city_name as 'cityName'
        from city_tag order by city_id asc

    </select>
    <select id="getTagList" resultType="com.alibaba.fastjson.JSONObject">
        select tag_id as 'tagId',tag_name as 'tagName'
        from actor_tag
        order by tag_id asc
    </select>
    <select id="getCityName" resultType="java.lang.String" parameterType="java.lang.Integer">
        select  city_name   from city_tag where city_id = #{actorCityId}
    </select>
    <select id="geTagName" resultType="java.lang.String" parameterType="java.lang.Long">
        select  tag_name  from  actor_tag where tag_id = #{tagId}
    </select>
    <select id="getTagListBy" resultType="java.lang.Long" parameterType="java.lang.Long">
        select tag_id   from actor_tag_info where actor_id = #{actorId}
    </select>
    <select id="getTagsId" resultType="java.lang.String" parameterType="java.lang.Long">
        select tag_Name
        from actor_tag_info
        where actor_id = #{actorId}
    </select>
    <select id="getActorIds" resultType="java.lang.Long" >
        select actor_id from actor_tag_info where tag_id in

        <foreach collection="tagIds" item="item" separator=","
                 open="(" close=")">
            #{item}
        </foreach>
        group by
        actor_id


    </select>
</mapper>
