<?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.TVideoEquipmentInfoDao">
    <!-- 开启二级缓存 -->
    <!-- <cache type="org.mybatis.caches.ehcache.LoggingEhcache"/> -->
    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="com.testor.module.video.model.domain.TVideoEquipmentInfo">
        <id column="id" property="id"/>
        <id column="ref_id" property="refId"/>
        <id column="parent_id" property="parentId"/>
        <id column="tenant_id" property="tenantId"/>
        <id column="process_id" property="processId"/>
        <id column="process_status" property="processStatus"/>
        <id column="org_id" property="orgId"/>
        <id column="org_name" property="orgName"/>
        <id column="equipment_name" property="equipmentName"/>
        <id column="installation_location" property="installationLocation"/>
        <id column="device_id" property="deviceId"/>
        <id column="monitor_location" property="monitorLocation"/>
        <id column="is_eye" property="isEye"/>
    </resultMap>
    <select id="myList" resultType="com.testor.module.video.model.domain.TVideoEquipmentInfo">
        SELECT
        *
        FROM
        t_video_equipment_info
        WHERE
        status = 0
        <if test="param.orgId !=null and param.orgId !=''">
            AND org_id=#{param.orgId}
        </if>
        <if test="param.monitorLocation !=null and param.monitorLocation !=''">
            and find_in_set(#{param.monitorLocation},monitor_location)
        </if>
        <if test="param.equipmentName !=null and param.equipmentName !=''">
            and equipment_name like concat('%',#{param.equipmentName},'%')
        </if>
        order by  create_date desc
    </select>
</mapper>