<?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">
	 
	<!-- 해당 부분의 namespace는 project package + Mapper Package + Mapper Interface 이름입니다. -->
	<mapper namespace="com.elt.ems.mapper.StatisticDataMapper">
	
	    <select id="selectListHour"  parameterType="com.elt.ems.vo.PmsStatisticDataVo" resultType="com.elt.ems.vo.PmsStatisticDataVo">
	
	       select * 
	       from t_pmsdata_statistic_hour d
	       where 1=1 
	       <if test="plantSeq > 0"> and d.plantSeq = #{plantSeq}</if>
	       <if test="inputDate != null and inputDate != ''"> and d.inputDate = #{inputDate}</if>
	       order by inputHour desc
	  
	    </select>
	    
	    <select id="selectListDay"  parameterType="com.elt.ems.vo.PmsStatisticDataVo" resultType="com.elt.ems.vo.PmsStatisticDataVo">
	
	       select * 
	       from t_pmsdata_statistic_day d
	       where 1=1 
	       <if test="plantSeq > 0"> and d.plantSeq = #{plantSeq}</if>
	       <if test="inputYear != null and inputYear != ''"> and d.inputYear = #{inputYear}</if>
	       <if test="inputMonth != null and inputMonth != ''"> and d.inputMonth = #{inputMonth}</if>
	       <if test="inputDay != null and inputDay != ''"> and d.inputDay = #{inputDay}</if>
	       order by inputYear asc, inputMonth asc, inputDay asc
	  
	    </select>	    
	    

	    
    						
		
	</mapper>