<?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.interplug.qcast.biz.canvaspopupstatus.CanvasPopupStatusMapper">

  <select id="selectCanvasPopupStatus"
    parameterType="com.interplug.qcast.biz.canvaspopupstatus.dto.CanvasPopupStatus"
    resultType="com.interplug.qcast.biz.canvaspopupstatus.dto.CanvasPopupStatus">
    SELECT TOP 1
           object_no,
           plan_no,
           popup_type,
           popup_status
    FROM T_CANVAS_POPUP_STATUS
    WHERE object_no = #{objectNo}
      AND plan_no = #{planNo}
      AND popup_type = #{popupType}

  </select>

  <insert id="insertCanvasPopupStatus"
    parameterType="com.interplug.qcast.biz.canvaspopupstatus.dto.CanvasPopupStatus">
    INSERT INTO T_CANVAS_POPUP_STATUS
    (object_no,
     plan_no,
     popup_type,
     popup_status)
    VALUES (#{objectNo},
            #{planNo},
            #{popupType},
            #{popupStatus})
  </insert>

  <update id="updateCanvasPopupStatus"
    parameterType="com.interplug.qcast.biz.canvaspopupstatus.dto.CanvasPopupStatus">
    UPDATE T_CANVAS_POPUP_STATUS
    SET popup_status = #{popupStatus}
    WHERE object_no = #{objectNo}
      AND plan_no = #{planNo}
      AND popup_type = #{popupType}
  </update>

  <delete id="deleteCanvasPopupStatus"
    parameterType="com.interplug.qcast.biz.canvaspopupstatus.dto.CanvasPopupStatus">
    DELETE
    FROM T_CANVAS_POPUP_STATUS
    WHERE object_no = #{objectNo}
      AND plan_no = #{planNo}
      AND popup_type = #{popupType}
  </delete>

</mapper>