<?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.MessageMapper">
	
		<!-- 해당 부분의 id는 MapperClass의 함수 이름과 유사하여야 합니다. -->
		<select id="selectList" parameterType="com.elt.ems.vo.MessageVo"  resultType="com.elt.ems.vo.MessageVo">
		      select 
		        a.*
		      from t_message a
		      where a.groupCode = #{groupCode} 
		      <if test="fault != null and fault > 0 "> and a.fault = #{fault} </if>
		      <if test="idx != null and idx > 0 "> and a.idx = #{idx} </if>
		      <if test="orderby == null">order by a.idx asc, a.fault asc</if>  
		      <if test="orderby != null">order by a.fault asc, a.idx asc</if>		      
		</select>
		
    <select id="select" parameterType="com.elt.ems.vo.MessageVo" resultType="com.elt.ems.vo.MessageVo">
      select 
        a.*
      from t_message a
      where a.groupCode = #{groupCode} and a.fault = #{fault} and a.idx = #{idx}
    </select>		    
  
		
	</mapper>