VideoAlarmMapper.xml 3.73 KB
Newer Older
Rensq's avatar
Rensq committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112
<?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.testor.module.video.dao.VideoAlarmDao">

    <select id="selectVideoInfoBySpaceType" resultType="com.testor.module.video.model.domain.VideoEquipmentInfo">
        SELECT
        *
        FROM
        t_video_equipment_info
        WHERE
        status = 0
        <if test="param.markList!= null ">
            AND is_eye in
            <foreach item="item" collection="param.markList" open="(" separator="," close=")" >
               #{item}
            </foreach>
        </if>
        <if test="param.orgId !=null and param.orgId !=''">
            AND org_id=#{param.orgId}
        </if>
        <if test="param.enterpiseId!=null and param.enterpiseId.size>0 ">
            and
            <foreach item="item" collection="param.enterpiseId" open="(" close=")" separator="or">
                find_in_set(#{item},space_type_id)
            </foreach>
        </if>
    </select>
    <select id="selectVideoInfoBySpace" resultType="com.testor.module.video.model.domain.VideoEquipmentInfo">
        SELECT
        *
        FROM
        t_video_equipment_info
        WHERE
        status = 0
        <if test="param.markList!=null">
            AND is_eye in
            <foreach item="item" collection="param.markList" open="(" separator="," close=")" >
                #{item}
            </foreach>
        </if>
        <if test="param.orgId !=null and param.orgId !=''">
            AND org_id=#{param.orgId}
        </if>
        <if test="param.enterpiseId!=null and param.enterpiseId.size>0 ">
            and
            <foreach item="item" collection="param.enterpiseId" open="(" close=")" separator="or">
                find_in_set(#{item},space_id)
            </foreach>
        </if>
    </select>

    <select id="selectVideoInfoByMonitor" resultType="com.testor.module.video.model.domain.VideoEquipmentInfo">
        SELECT
            *
        FROM
        t_video_equipment_info
        WHERE
        status = 0
        <if test="param.markList!=null ">
            AND is_eye in
            <foreach item="item" collection="param.markList" open="(" separator="," close=")" >
                #{item}
            </foreach>
        </if>
        <if test="param.orgId !=null and param.orgId !=''">
            AND org_id=#{param.orgId}
        </if>
        <if test="param.enterpiseId!=null and param.enterpiseId.size>0 ">
            and
            <foreach item="item" collection="param.enterpiseId" open="(" close=")" separator="or">
                find_in_set(#{item},monitor_location)
            </foreach>
        </if>
    </select>


    <select id="selectBySpaceList" resultType="com.testor.module.video.model.domain.VideoEquipmentInfo">
        SELECT
        *
        FROM
        t_video_equipment_info
        WHERE
        status = 0

            AND is_eye in
            <foreach item="item" collection="markList" open="(" separator="," close=")" >
                #{item}
            </foreach>
        <if test="param.orgId !=null and param.orgId !=''">
            AND org_id=#{param.orgId}
        </if>
        <if test="param.enterpiseId!=null and param.enterpiseId.size>0 ">
            and device_id in
            <foreach item="item" collection="param.enterpiseId" open="(" separator="," close=")" >
                #{item}
            </foreach>
        </if>
    </select>
    <select id="selectListSpace" resultType="com.testor.module.video.model.domain.VideoEquipmentInfo">
        SELECT
        *
        FROM
        t_video_equipment_info
        WHERE
        status = 0
        AND is_eye = #{mark}
        AND org_id=#{orgId}
        limit 24
    </select>
</mapper>