<?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.CsMapper">
	
		<!-- 해당 부분의 id는 MapperClass의 함수 이름과 유사하여야 합니다. -->
		<select id="selectList" parameterType="com.elt.ems.vo.CsVo"  resultType="com.elt.ems.vo.CsVo">
			select c.*, p.name as plantName
			from t_cs c, t_plant p where c.plantSeq = p.seq		
			<if test="csType != null and csType != '-1' ">and c.csType = #{csType} </if>
			<if test="procStatus != null and procStatus != '-1' ">and c.procStatus = #{procStatus} </if>
			<if test="procType != null and procType != '-1' ">and c.procType = #{procType} </if>
      		order by c.seq desc      
		</select>
		
	    <select id="select" parameterType="int"  resultType="com.elt.ems.vo.CsVo">
				select *
				from t_cs c
	      where c.seq = #{seq}       
	    </select>		    
    
    <update id="update"  parameterType="com.elt.ems.vo.CsVo">
      update t_cs set 
        procStatus=#{procStatus},
        updateDatetime=now()
      where seq=#{seq}
    </update>     
		
	</mapper>