<?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.njcn.energy.mapper.EleMdMapper">
    <select id="getEleMdNoList" resultType="com.njcn.energy.pojo.po.EleMd">
        SELECT *
        FROM ele_md md
        WHERE md.id
            NOT IN (
                  SELECT sta.con_id
                  FROM ele_statistical_set sta
                  WHERE sta.id = #{conId}
              )
          AND md.Class_Id = "power_quality_data"
          AND md.unit in("W","Var")
        order by md.idx
    </select>

    <select id="getEleMdList" resultType="com.njcn.energy.pojo.po.EleMd">
        SELECT *
        FROM ele_md md
        WHERE md.id
            IN (
                  SELECT sta.con_id
                  FROM ele_statistical_set sta
                  WHERE sta.id = #{conId}
              )
          AND md.Class_Id = "power_quality_data"
          AND md.unit in("W","Var")
        order by md.idx
    </select>
</mapper>