<?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.yeejoin.amos.fas.business.dao.mapper.PollPointMapper">
    <select id="queryInitAlarm" resultType="com.yeejoin.amos.fas.business.vo.PollPointVo">
        SELECT
        p.`name`,
        p.point_no AS `code`,
        p.`status`
        FROM
        `p_point` p
        <where>
            <if test="list != null and list.length > 0">
                AND
                <foreach collection="list" item="item" index="index" open="(" close=")" separator="OR">
                    p.`status` = #{item}
                </foreach>
            </if>
        </where>
    </select>

    <select id="getInitAlarm" resultType="com.yeejoin.amos.fas.business.vo.EquipmentSpecificIndexVo">
        SELECT
        concat(p.id) as id,
        p.`name`,
        p.point_no AS `code`,
        'patrol' AS type,
        'patrol' AS nameKey,
        CASE
        WHEN p.`status` = '2' THEN
        'true'
        WHEN p.`status` = '3' THEN
        'true' ELSE 'false'
        END AS `value`
        FROM
        `p_point` p
        <where>
        	is_delete = 0
            <if test="list != null and list.length > 0">
                AND
                <foreach collection="list" item="item" index="index" open="(" close=")" separator="OR">
                    p.`status` = #{item}
                </foreach>
            </if>
        </where>
    </select>
</mapper>