<?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.style24.batch.biz.dao.TsbDeliveryDao">
	
	<!-- 총알배송 권역정보 등록  -->
	<insert id="mergeDailyDeliveryZone" parameterType="Delivery" >
		/*TsbDelivery.mergeDailyDeliveryZone*/
		
			INSERT INTO TB_DAILY_DELIVERY_ZONE
			(
				  ZIP_NO
				, PND_BRAN
				, PND_BRAN_NM
				, OPER_ABOVE_BRAN
				, TR_BRAN_NM
				, CITY_DO
				, GU_GUN
				, DONG_YUP_MEUN
				, DELIVERY_TIME
				, DELIVERY_PROBABILITY
				, DELIVERYCLASSCD
				, ISUSE
                , DATELASTUPDATE
			)
			VALUES
			(
			 	  #{zipNo}
				, #{pndBran}
				, #{pndBranNm}
				, #{operAboveBran}
				, #{trBranNm}
				, #{cityDo}
				, #{guGun}
				, #{dongYupMeun}
				, #{deliveryTime}
				, #{deliveryProbability}
				, #{deliveryclasscd}
				, #{isuse}
                , NOW()
			)
			ON 
			DUPLICATE KEY
			UPDATE
			  PND_BRAN	            = #{pndBran}
			, PND_BRAN_NM	        = #{pndBranNm}
			, OPER_ABOVE_BRAN	    = #{operAboveBran}
			, TR_BRAN_NM	        = #{trBranNm}
			, CITY_DO	            = #{cityDo}
			, GU_GUN	            = #{guGun}
			, DONG_YUP_MEUN	        = #{dongYupMeun}
			, DELIVERY_TIME	        = #{deliveryTime}
			, DELIVERY_PROBABILITY	= #{deliveryProbability}
			, DELIVERYCLASSCD	    = #{deliveryclasscd}
			, ISUSE	                = #{isuse}
            , DATELASTUPDATE        = NOW()
	</insert>

</mapper>