<?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.fdkankan.ucenter.mapper.ICameraSpaceMapper">

    <select id="getVoListByCameraId" resultType="com.fdkankan.ucenter.vo.response.CameraSpaceVo">
        select s.id, s.space_end_time, c.child_name, s.space from t_camera_space s
            LEFT JOIN t_camera c on s.camera_id = c.id
            where s.rec_status = 'A' and s.space_type = 2 and s.camera_id = #{cameraId}
              and TIMESTAMPDIFF(MINUTE, NOW(), s.space_end_time) &gt; -1
            ORDER BY s.space_end_time
    </select>
    <select id="getVoListByCameraIds" resultType="com.fdkankan.ucenter.vo.response.CameraSpaceVo">
        select s.id, s.space_end_time, c.child_name, s.space,s.camera_id from t_camera_space s
            LEFT JOIN t_camera c on s.camera_id = c.id
            where s.rec_status = 'A' and s.space_type = 2 and s.camera_id in
            <foreach item="cameraId" collection="cameraIds" open="(" separator="," close=")">
                #{cameraId}
            </foreach>
            and TIMESTAMPDIFF(MINUTE, NOW(), s.space_end_time) &gt; -1
            ORDER BY s.space_end_time
    </select>
</mapper>
