<?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.canvasSetting.CanvasSettingMapper">

	<select id="getCanvasSettingCnt" parameterType="string"
            resultType="com.interplug.qcast.biz.canvasSetting.dto.CanvasSettingInfo">
        /* sqlid : com.interplug.qcast.canvasSetting.getCanvasSettingCnt Canvas Setting 유무 */
        SELECT COUNT(1) AS cnt
        FROM TB_CANVAS_SETTING
         WHERE object_no = #{objectNo}
    </select>
    
    <select id="selectCanvasSetting" parameterType="string"
            resultType="com.interplug.qcast.biz.canvasSetting.dto.CanvasSettingInfo">
        /* sqlid : com.interplug.qcast.canvasSetting.selectCanvasSetting Canvas Setting 조회 */
        SELECT object_no
             , alloc_display
             , outline_display
             , grid_display
             , line_display
             , word_display
             , circuit_num_display
             , flow_display
             , trestle_display
             , image_display
             , total_display
             , corridor_dimension
             , real_dimension
             , none_dimension
			 , only_border
			 , line_hatch
			 , all_painted
			 , adsorp_range_small
			 , adsorp_range_small_semi
			 , adsorp_range_medium
			 , adsorp_range_large
			 , adsorp_point
			 , dot_grid_display
			 , line_grid_display
			 , grid_type
			 , grid_horizon
			 , grid_vertical
			 , grid_ratio
			 , grid_dimen
			 , grid_color
			 , word_font
			 , word_font_style
			 , word_font_size
			 , word_font_color
			 , flow_font
			 , flow_font_style
			 , flow_font_size
			 , flow_font_color
			 , dimensio_font
			 , dimensio_font_style
			 , dimensio_font_size
			 , dimensio_font_color
			 , circuit_num_font
			 , circuit_num_font_style
			 , circuit_num_font_size
			 , circuit_num_font_color
			 , length_font
			 , length_font_style
			 , length_font_size
			 , length_font_color
			 , origin_pixel
			 , origin_color
			 , origin_horizon
			 , origin_vertical
             , regist_datetime
             , last_edit_datetime
          FROM TB_CANVAS_SETTING
         WHERE object_no = #{objectNo}
    </select>    
    
    <insert id="insertCanvasSetting" parameterType="com.interplug.qcast.biz.canvasSetting.dto.CanvasSettingInfo">
        /* sqlid : com.interplug.qcast.canvasSetting.insertCanvasSetting Canvas Setting 등록 */	     
	       INSERT INTO TB_CANVAS_SETTING
	              ( 
					object_no
			 	  , alloc_display
	              , outline_display
	              , grid_display
	              , line_display
	              , word_display
	              , circuit_num_display
	              , flow_display
	              , trestle_display
	              , image_display
	              , total_display
	              , corridor_dimension
	              , real_dimension
	              , none_dimension
				  , only_border
				  , line_hatch
				  , all_painted
				  , adsorp_range_small
				  , adsorp_range_small_semi
				  , adsorp_range_medium
				  , adsorp_range_large
				  , adsorp_point
				  , dot_grid_display
				  , line_grid_display
				  , grid_type
				  , grid_horizon
				  , grid_vertical
				  , grid_ratio
				  , grid_dimen
				  , grid_color
				  , word_font
				  , word_font_style
				  , word_font_size
				  , word_font_color
				  , flow_font
				  , flow_font_style
				  , flow_font_size
				  , flow_font_color
				  , dimensio_font
				  , dimensio_font_style
				  , dimensio_font_size
				  , dimensio_font_color
				  , circuit_num_font
				  , circuit_num_font_style
				  , circuit_num_font_size
				  , circuit_num_font_color
				  , length_font
				  , length_font_style
				  , length_font_size
				  , length_font_color
				  , origin_pixel
				  , origin_color
				  , origin_horizon
				  , origin_vertical
	              , regist_datetime
	    ) VALUES ( 
					#{objectNo}
				  , #{allocDisplay}	
	              , #{outlineDisplay}
	              , #{gridDisplay}
	              , #{lineDisplay}
	              , #{wordDisplay}
	              , #{circuitNumDisplay}
	              , #{flowDisplay}
	              , #{trestleDisplay}
	              , #{imageDisplay}
	              , #{totalDisplay}
	              , #{corridorDimension}
	              , #{realDimension}
	              , #{noneDimension}
	              , #{onlyBorder}
	              , #{lineHatch}
	              , #{allPainted}
	              , #{adsorpRangeSmall}
	         	  , #{adsorpRangeSmallSemi}
	         	  , #{adsorpRangeMedium}
	         	  , #{adsorpRangeLarge}
	         	  , #{adsorpPoint}
	         	  , #{dotGridDisplay}
				  , #{lineGridDisplay}
				  , #{gridType}
				  , #{gridHorizon}
				  , #{gridVertical}
				  , #{gridRatio}
				  , #{gridDimen}
				  , #{gridColor}
				  , #{wordFont}
				  , #{wordFontStyle}
				  , #{wordFontSize}
				  , #{wordFontColor}
				  , #{flowFont}
				  , #{flowFontStyle}
				  , #{flowFontSize}
				  , #{flowFontColor}
				  , #{dimensioFont}
				  , #{dimensioFontStyle}
				  , #{dimensioFontSize}
				  , #{dimensioFontColor}
				  , #{circuitNumFont}
				  , #{circuitNumFontStyle}
				  , #{circuitNumFontSize}
				  , #{circuitNumFontColor}
				  , #{lengthFont}
				  , #{lengthFontStyle}
				  , #{lengthFontSize}
				  , #{lengthFontColor}
				  , #{originPixel}
				  , #{originColor}
				  , #{originHorizon}
				  , #{originVertical}
	              , GETDATE()
	              );
    </insert>
        
    <update id="updateCanvasSetting" parameterType="com.interplug.qcast.biz.canvasSetting.dto.CanvasSettingInfo">
        /* sqlid : com.interplug.qcast.canvasSetting.updateCanvasSetting Canvas Setting 수정 */
        UPDATE TB_CANVAS_SETTING
           SET alloc_display = #{allocDisplay}
	         , outline_display = #{outlineDisplay}
	         , grid_display = #{gridDisplay}
	         , line_display = #{lineDisplay}
	         , word_display = #{wordDisplay}
	         , circuit_num_display = #{circuitNumDisplay}
	         , flow_display = #{flowDisplay}
	         , trestle_display = #{trestleDisplay}
	         , image_display = #{imageDisplay}
	         , total_display = #{totalDisplay}
	         , corridor_dimension = #{corridorDimension}
	         , real_dimension = #{realDimension}
	         , none_dimension = #{noneDimension}
	         , only_border = #{onlyBorder}
	         , line_hatch = #{lineHatch}
	         , all_painted = #{allPainted}
	         , adsorp_range_small = #{adsorpRangeSmall}
	         , adsorp_range_small_semi = #{adsorpRangeSmallSemi}
	         , adsorp_range_medium = #{adsorpRangeMedium}
	         , adsorp_range_large = #{adsorpRangeLarge}
	         , adsorp_point = #{adsorpPoint}
	         , dot_grid_display = #{dotGridDisplay}
			 , line_grid_display = #{lineGridDisplay}
			 , grid_type = #{gridType}
			 , grid_horizon = #{gridHorizon}
			 , grid_vertical = #{gridVertical}
			 , grid_ratio = #{gridRatio}
			 , grid_dimen = #{gridDimen}
			 , grid_color = #{gridColor}
			 , word_font = #{wordFont}
			 , word_font_style = #{wordFontStyle}
			 , word_font_size = #{wordFontSize}
			 , word_font_color = #{wordFontColor}
			 , flow_font = #{flowFont}
			 , flow_font_style = #{flowFontStyle}
			 , flow_font_size = #{flowFontSize}
			 , flow_font_color = #{flowFontColor}
			 , dimensio_font = #{dimensioFont}
			 , dimensio_font_style = #{dimensioFontStyle}
			 , dimensio_font_size = #{dimensioFontSize}
			 , dimensio_font_color = #{dimensioFontColor}
			 , circuit_num_font = #{circuitNumFont}
			 , circuit_num_font_style = #{circuitNumFontStyle}
			 , circuit_num_font_size = #{circuitNumFontSize}
			 , circuit_num_font_color = #{circuitNumFontColor}
			 , length_font = #{lengthFont}
			 , length_font_style = #{lengthFontStyle}
			 , length_font_size = #{lengthFontSize}
			 , length_font_color = #{lengthFontColor}
			 , origin_pixel = #{originPixel}
			 , origin_color = #{originColor}
			 , origin_horizon = #{originHorizon}
			 , origin_vertical = #{originVertical}
	         , last_edit_datetime = GETDATE()
         WHERE object_no = #{objectNo}
    </update>
    
</mapper>