<?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.fastbee.iot.mapper.SceneTagPointsMapper">

    <resultMap type="SceneTagPoints" id="SceneTagPointsResult">
        <result property="id"    column="id"    />
        <result property="name"    column="name"    />
        <result property="alias"    column="alias"    />
        <result property="tagId"    column="tag_id"    />
        <result property="operation"    column="operation"    />
        <result property="variableType"    column="variable_type"    />
        <result property="sceneModelDataId"    column="scene_model_data_id"    />
        <result property="delFlag"    column="del_flag"    />
        <result property="createBy"    column="create_by"    />
        <result property="createTime"    column="create_time"    />
        <result property="updateBy"    column="update_by"    />
        <result property="updateTime"    column="update_time"    />
        <result property="remark"    column="remark"    />
    </resultMap>

    <sql id="selectSceneTagPointsVo">
        select id, name, alias, tag_id, operation, variable_type, scene_model_data_id, del_flag, create_by, create_time, update_by, update_time, remark from scene_tag_points
    </sql>

    <update id="deleteBySceneModelIds">
        update scene_tag_points
        set del_flag = '1'
        where tag_id in (select id from scene_model_tag where scene_model_id in
                <foreach collection="array" item="sceneModelId" open="(" separator="," close=")">
                    #{sceneModelId}
                </foreach>
            )
    </update>
</mapper>
