Newer
Older
huludao / src / main / resources / mapper / CameraGroupRelationMapper.xml
<?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.newfiber.api.pc.dao.CameraGroupRelationMapper">

     <!-- 通用映射列 -->
    <resultMap id="BaseResultMap" type="com.newfiber.api.pc.model.entity.CameraGroupRelation">
                    <result column="id" property="id"/>
                    <result column="group_id" property="groupId"/>
                    <result column="camera_id" property="cameraId"/>
                    <result column="create_time" property="createTime"/>
                    <result column="update_time" property="updateTime"/>
            </resultMap>

    <!-- 通用数据库列 -->
    <sql id="Base_Column_List">
              id,
              group_id,
              camera_id,
              create_time,
              update_time
          </sql>

    <select id="selectCameraInfoList" resultType="long" >
        select camera_id
        from camera_group_relation
        where group_id in
        <foreach collection="groupIds" index="index" item="item"
                 open="("  separator="," close=")">
            #{item}
        </foreach>
    </select>

    <delete id="deleteByIds">
        delete from camera_group_relation
        where group_id in
        <foreach collection="groupIds" index="index" item="item"
                 open="("  separator="," close=")">
            #{item}
        </foreach>
    </delete>
</mapper>