<?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="WebHospital">

	<select id="selectHospital" parameterType="hashmap" resultType="hashmap">
		SELECT MH.MU_HOSPITAL_ID                                   AS "muHospitalId"
			  ,MH.HOSPITAL_NAME                                    AS "hospitalName"
			  ,MH.CENTER_DIV_CD                                    AS "centerDivCd"
			  ,MH.MON_OPEN_YN                                      AS "monOpenYn"
			  ,DATE_FORMAT(MH.MON_OPEN_START_TIME , '%H:%i')       AS "monOpenStartTime"
			  ,DATE_FORMAT(MH.MON_OPEN_END_TIME   , '%H:%i')       AS "monOpenEndTime"
			  ,DATE_FORMAT(MH.MON_BREAK_START_TIME, '%H:%i')       AS "monBreakStartTime"
			  ,DATE_FORMAT(MH.MON_BREAK_END_TIME  , '%H:%i')       AS "monBreakEndTime"
			  ,MH.TUE_OPEN_YN                                      AS "tueOpenYn"
			  ,DATE_FORMAT(MH.TUE_OPEN_START_TIME , '%H:%i')       AS "tueOpenStartTime"
			  ,DATE_FORMAT(MH.TUE_OPEN_END_TIME   , '%H:%i')       AS "tueOpenEndTime"
			  ,DATE_FORMAT(MH.TUE_BREAK_START_TIME, '%H:%i')       AS "tueBreakStartTime"
			  ,DATE_FORMAT(MH.TUE_BREAK_END_TIME  , '%H:%i')       AS "tueBreakEndTime"
			  ,MH.WED_OPEN_YN                                      AS "wedOpenYn"
			  ,DATE_FORMAT(MH.WED_OPEN_START_TIME , '%H:%i')       AS "wedOpenStartTime"
			  ,DATE_FORMAT(MH.WED_OPEN_END_TIME   , '%H:%i')       AS "wedOpenEndTime"
			  ,DATE_FORMAT(MH.WED_BREAK_START_TIME, '%H:%i')       AS "wedBreakStartTime"
			  ,DATE_FORMAT(MH.WED_BREAK_END_TIME  , '%H:%i')       AS "wedBreakEndTime"
			  ,MH.THU_OPEN_YN                                      AS "thuOpenYn"
			  ,DATE_FORMAT(MH.THU_OPEN_START_TIME , '%H:%i')       AS "thuOpenStartTime"
			  ,DATE_FORMAT(MH.THU_OPEN_END_TIME   , '%H:%i')       AS "thuOpenEndTime"
			  ,DATE_FORMAT(MH.THU_BREAK_START_TIME, '%H:%i')       AS "thuBreakStartTime"
			  ,DATE_FORMAT(MH.THU_BREAK_END_TIME  , '%H:%i')       AS "thuBreakEndTime"
			  ,MH.FRI_OPEN_YN                                      AS "friOpenYn"
			  ,DATE_FORMAT(MH.FRI_OPEN_START_TIME , '%H:%i')       AS "friOpenStartTime"
			  ,DATE_FORMAT(MH.FRI_OPEN_END_TIME   , '%H:%i')       AS "friOpenEndTime"
			  ,DATE_FORMAT(MH.FRI_BREAK_START_TIME, '%H:%i')       AS "friBreakStartTime"
			  ,DATE_FORMAT(MH.FRI_BREAK_END_TIME  , '%H:%i')       AS "friBreakEndTime"
			  ,MH.SAT_OPEN_YN                                      AS "satOpenYn"
			  ,DATE_FORMAT(MH.SAT_OPEN_START_TIME , '%H:%i')       AS "satOpenStartTime"
			  ,DATE_FORMAT(MH.SAT_OPEN_END_TIME   , '%H:%i')       AS "satOpenEndTime"
			  ,DATE_FORMAT(MH.SAT_BREAK_START_TIME, '%H:%i')       AS "satBreakStartTime"
			  ,DATE_FORMAT(MH.SAT_BREAK_END_TIME  , '%H:%i')       AS "satBreakEndTime"
			  ,MH.SUN_OPEN_YN                                      AS "sunOpenYn"
			  ,DATE_FORMAT(MH.SUN_OPEN_START_TIME , '%H:%i')       AS "sunOpenStartTime"
			  ,DATE_FORMAT(MH.SUN_OPEN_END_TIME   , '%H:%i')       AS "sunOpenEndTime"
			  ,DATE_FORMAT(MH.SUN_BREAK_START_TIME, '%H:%i')       AS "sunBreakStartTime"
			  ,DATE_FORMAT(MH.SUN_BREAK_END_TIME  , '%H:%i')       AS "sunBreakEndTime"
			  ,MH.PUBLIC_HOLIDAY_USE_YN                            AS "publicHolidayUseYn"
			  ,IFNULL((SELECT CONCAT(MM.NAME,'(',MM.LOGIN_ID,')')  AS MEMBER_NAME
						 FROM MU_MEMBER AS MM
						WHERE MM.USE_YN = 'Y'
						  AND MM.MU_MEMBER_ID = MH.MU_MEMBER_ID
						LIMIT 0, 1
			   ),'')                                               AS "memberName"
		  FROM MU_HOSPITAL AS MH
		 WHERE MH.USE_YN        = 'Y'
		   <if test="centerDivCd != null and centerDivCd != ''">
		   AND MH.CENTER_DIV_CD = #{centerDivCd}
		   </if>
		 LIMIT 0, 1
	</select>

	<select id="selectHospitalWeek" parameterType="hashmap" resultType="hashmap">
		SELECT MH.MU_HOSPITAL_ID                                   AS "muHospitalId"
			  ,MH.HOSPITAL_NAME                                    AS "hospitalName"
			  ,CASE 
			        WHEN MHS.MU_HOSPITAL_SCHEDULE_ID IS NOT NULL THEN MHS.OPEN_YN
			        ELSE
					   CASE DAYOFWEEK(DATE_FORMAT(#{searchDate}, '%Y-%m-%d'))
							WHEN '2' THEN MH.MON_OPEN_YN
							WHEN '3' THEN MH.TUE_OPEN_YN
							WHEN '4' THEN MH.WED_OPEN_YN
							WHEN '5' THEN MH.THU_OPEN_YN
							WHEN '6' THEN MH.FRI_OPEN_YN
							WHEN '7' THEN MH.SAT_OPEN_YN
							WHEN '1' THEN MH.SUN_OPEN_YN
					   END
			   END                                                 AS "openYn"
		      ,CASE
				   WHEN EXISTS (
					   SELECT 1
					     FROM MU_HOSPITAL_HOLIDAY MHH
					    WHERE MHH.USE_YN = 'Y'
						  AND MHH.MU_HOSPITAL_ID = MH.MU_HOSPITAL_ID
						  AND (
						   (MHH.REPEAT_YN = 'Y' AND DATE_FORMAT(MHH.LOC_DATE, '%m-%d') = DATE_FORMAT(#{searchDate}, '%m-%d'))
							   OR
						   (MHH.REPEAT_YN = 'N' AND MHH.LOC_DATE = #{searchDate})
						   )) OR
				        (MH.PUBLIC_HOLIDAY_USE_YN = 'Y' AND EXISTS (
					   SELECT 1
						 FROM MU_PUBLIC_HOLIDAY MPH
						WHERE MPH.USE_YN = 'Y'
						  AND MPH.LOC_DATE = #{searchDate}
                               ))
				   THEN 'Y'
				   ELSE 'N'
			   END 												  AS "holidayYn"
			  ,CASE 
			        WHEN MHS.MU_HOSPITAL_SCHEDULE_ID IS NOT NULL THEN MHS.OPEN_START_TIME
			        ELSE
					   CASE DAYOFWEEK(DATE_FORMAT(#{searchDate}, '%Y-%m-%d'))
							WHEN '2' THEN MH.MON_OPEN_START_TIME
							WHEN '3' THEN MH.TUE_OPEN_START_TIME
							WHEN '4' THEN MH.WED_OPEN_START_TIME
							WHEN '5' THEN MH.THU_OPEN_START_TIME
							WHEN '6' THEN MH.FRI_OPEN_START_TIME
							WHEN '7' THEN MH.SAT_OPEN_START_TIME
							WHEN '1' THEN MH.SUN_OPEN_START_TIME
					   END
			   END                                                 AS "openStartTime"
			  ,CASE 
			        WHEN MHS.MU_HOSPITAL_SCHEDULE_ID IS NOT NULL THEN MHS.OPEN_END_TIME
			        ELSE
					   CASE DAYOFWEEK(DATE_FORMAT(#{searchDate}, '%Y-%m-%d'))
							WHEN '2' THEN MH.MON_OPEN_END_TIME
							WHEN '3' THEN MH.TUE_OPEN_END_TIME
							WHEN '4' THEN MH.WED_OPEN_END_TIME
							WHEN '5' THEN MH.THU_OPEN_END_TIME
							WHEN '6' THEN MH.FRI_OPEN_END_TIME
							WHEN '7' THEN MH.SAT_OPEN_END_TIME
							WHEN '1' THEN MH.SUN_OPEN_END_TIME
					   END
			   END                                                 AS "openEndTime"
			  ,CASE 
			        WHEN MHS.MU_HOSPITAL_SCHEDULE_ID IS NOT NULL THEN MHS.BREAK_START_TIME
			        ELSE
					   CASE DAYOFWEEK(DATE_FORMAT(#{searchDate}, '%Y-%m-%d'))
							WHEN '2' THEN MH.MON_BREAK_START_TIME
							WHEN '3' THEN MH.TUE_BREAK_START_TIME
							WHEN '4' THEN MH.WED_BREAK_START_TIME
							WHEN '5' THEN MH.THU_BREAK_START_TIME
							WHEN '6' THEN MH.FRI_BREAK_START_TIME
							WHEN '7' THEN MH.SAT_BREAK_START_TIME
							WHEN '1' THEN MH.SUN_BREAK_START_TIME
					   END
			   END                                                 AS "breakStartTime"
			  ,CASE 
			        WHEN MHS.MU_HOSPITAL_SCHEDULE_ID IS NOT NULL THEN MHS.BREAK_END_TIME
			        ELSE
					   CASE DAYOFWEEK(DATE_FORMAT(#{searchDate}, '%Y-%m-%d'))
							WHEN '2' THEN MH.MON_BREAK_END_TIME
							WHEN '3' THEN MH.TUE_BREAK_END_TIME
							WHEN '4' THEN MH.WED_BREAK_END_TIME
							WHEN '5' THEN MH.THU_BREAK_END_TIME
							WHEN '6' THEN MH.FRI_BREAK_END_TIME
							WHEN '7' THEN MH.SAT_BREAK_END_TIME
							WHEN '1' THEN MH.SUN_BREAK_END_TIME
					   END
			   END                                                 AS "breakEndTime"
		  FROM MU_HOSPITAL AS MH
		  LEFT JOIN MU_HOSPITAL_SCHEDULE MHS
		    ON MH.MU_HOSPITAL_ID = MHS.MU_HOSPITAL_ID
		   AND MHS.SCHEDULE_DATE = #{searchDate}
		   AND MHS.USE_YN = 'Y'
		 WHERE MH.USE_YN        = 'Y'
		   <if test="centerDivCd != null and centerDivCd != ''">
		   AND MH.CENTER_DIV_CD = #{centerDivCd}
		   </if>
		 LIMIT 0, 1
	</select>

	<select id="selectHospitalWeek2" parameterType="hashmap" resultType="hashmap">
        WITH RECURSIVE T_TEMP_DATES AS (
            SELECT #{startDate} AS RESULT_DATE

            UNION ALL

            SELECT DATE_ADD(RESULT_DATE, INTERVAL 1 DAY)
              FROM T_TEMP_DATES
             WHERE RESULT_DATE &lt; #{endDate}
        )
        SELECT 
              CASE 
                   WHEN MHS.OPEN_YN IS NOT NULL THEN MHS.OPEN_YN
                   ELSE TTD.OPEN_YN 
              END       AS "openYn"
              ,TTD.HOLIDAY_YN   AS "holidayYn"
          FROM (
                SELECT TTD.RESULT_DATE                    AS RESULT_DATE
                      ,TTD.DAY_OF_WEEK                    AS DAY_OF_WEEK
                      ,CASE
                       WHEN TTD.DAY_OF_WEEK = '1'
                       THEN MH.SUN_OPEN_YN
                       WHEN TTD.DAY_OF_WEEK = '2'
                       THEN MH.MON_OPEN_YN
                       WHEN TTD.DAY_OF_WEEK = '3'
                       THEN MH.TUE_OPEN_YN
                       WHEN TTD.DAY_OF_WEEK = '4'
                       THEN MH.WED_OPEN_YN
                       WHEN TTD.DAY_OF_WEEK = '5'
                       THEN MH.THU_OPEN_YN
                       WHEN TTD.DAY_OF_WEEK = '6'
                       THEN MH.FRI_OPEN_YN
                       WHEN TTD.DAY_OF_WEEK = '7'
                       THEN MH.SAT_OPEN_YN
                       ELSE 'N'
                       END                                AS OPEN_YN
                      ,CASE
                       WHEN EXISTS(
                                    SELECT 1
                                      FROM MU_HOSPITAL_HOLIDAY AS MHH
                                     WHERE MHH.USE_YN = 'Y'
                                       AND MHH.MU_HOSPITAL_ID = MH.MU_HOSPITAL_ID
                                       AND ((MHH.REPEAT_YN = 'Y' AND DATE_FORMAT(MHH.LOC_DATE, '%m-%d') = DATE_FORMAT(TTD.RESULT_DATE, '%m-%d'))
                                             OR
                                            (MHH.REPEAT_YN = 'N' AND MHH.LOC_DATE = TTD.RESULT_DATE))
                            )
                         OR (MH.PUBLIC_HOLIDAY_USE_YN = 'Y' AND EXISTS(
                                    SELECT 1
                                      FROM MU_PUBLIC_HOLIDAY AS MPH
                                     WHERE MPH.USE_YN = 'Y'
                                       AND MPH.LOC_DATE = TTD.RESULT_DATE
                            ))
                       THEN 'Y'
                       ELSE 'N'
                       END                                AS HOLIDAY_YN
                  FROM (
                        SELECT TTD.RESULT_DATE            AS RESULT_DATE
                              ,DAYOFWEEK(TTD.RESULT_DATE) AS DAY_OF_WEEK
                          FROM T_TEMP_DATES AS TTD
                      ORDER BY TTD.RESULT_DATE ASC
                  ) AS TTD
             LEFT JOIN MU_HOSPITAL AS MH
                    ON MH.USE_YN = 'Y'
                   <if test="centerDivCd != null and centerDivCd != ''">
                   AND MH.CENTER_DIV_CD = #{centerDivCd}
                   </if>
          ) AS TTD
          LEFT JOIN MU_HOSPITAL_SCHEDULE MHS
            ON MHS.SCHEDULE_DATE = TTD.RESULT_DATE
           AND MHS.USE_YN = 'Y'
	</select>

	<select id="selectHospitalHoliday" parameterType="hashmap" resultType="hashmap">
		SELECT 'hospitalHoliday'                 AS "dateType"
			 , HOSPITAL_HOLIDAY_NAME             AS "hospitalHolidayName"
			 , DATE_FORMAT(LOC_DATE, '%Y-%m-%d') AS "locDate"
		  FROM MU_HOSPITAL_HOLIDAY MH
		 WHERE MH.USE_YN = 'Y'
		   AND MH.MU_HOSPITAL_ID = #{muHospitalId}
		   AND (
			 (MH.REPEAT_YN = 'Y')
				 OR
			 (MH.REPEAT_YN = 'N' AND DATE_FORMAT( MH.LOC_DATE, '%Y' ) >= DATE_FORMAT( CURDATE( ), '%Y' ))
			 )
		 UNION ALL
		(
			SELECT 'publicHoliday'                   AS "dateType"
				 , MPH.PUBLIC_HOLIDAY_NAME           AS "publicHolidayName"
				 , DATE_FORMAT(MPH.LOC_DATE, '%Y-%m-%d') AS "locDate"
			  FROM MU_PUBLIC_HOLIDAY MPH
			  JOIN MU_HOSPITAL MH
                ON MH.MU_HOSPITAL_ID = #{muHospitalId}
               AND MH.PUBLIC_HOLIDAY_USE_YN = 'Y'
			 WHERE MPH.USE_YN = 'Y'
			   AND DATE_FORMAT( MPH.LOC_DATE, '%Y' ) >= DATE_FORMAT( CURDATE( ), '%Y' )
		)
		UNION ALL
		(
			SELECT 'hospitalSchedule'                AS "dateType"
			     , CASE WHEN OPEN_YN = 'Y' THEN '운영' ELSE '휴무' END AS "hospitalHolidayName"
			     , DATE_FORMAT(SCHEDULE_DATE, '%Y-%m-%d') AS "locDate"
			  FROM MU_HOSPITAL_SCHEDULE
			 WHERE MU_HOSPITAL_ID = #{muHospitalId}
			   AND USE_YN = 'Y'
			   AND DATE_FORMAT( SCHEDULE_DATE, '%Y' ) >= DATE_FORMAT( CURDATE( ), '%Y' )
		)
	</select>
	
	<select id="selectHospitalScheduleDetail" parameterType="hashmap" resultType="hashmap">
		SELECT MU_HOSPITAL_SCHEDULE_ID             AS "muHospitalScheduleId"
		     , MU_HOSPITAL_ID                      AS "muHospitalId"
		     , DATE_FORMAT(SCHEDULE_DATE, '%Y-%m-%d') AS "scheduleDate"
		     , OPEN_YN                             AS "openYn"
		     , OPEN_START_TIME                     AS "openStartTime"
		     , OPEN_END_TIME                       AS "openEndTime"
		     , BREAK_START_TIME                    AS "breakStartTime"
		     , BREAK_END_TIME                      AS "breakEndTime"
		  FROM MU_HOSPITAL_SCHEDULE
		 WHERE MU_HOSPITAL_ID = #{muHospitalId}
		   AND SCHEDULE_DATE  = #{searchDate}
		   AND USE_YN         = 'Y'
		 LIMIT 1
	</select>

	<select id="selectHospitalScheduleCheck" parameterType="hashmap" resultType="hashmap">
		SELECT MU_HOSPITAL_SCHEDULE_ID             AS "muHospitalScheduleId"
		  FROM MU_HOSPITAL_SCHEDULE
		 WHERE MU_HOSPITAL_ID = #{muHospitalId}
		   AND SCHEDULE_DATE  = #{scheduleDate}
		 LIMIT 1
	</select>

	<select id="selectHospitalHolidayCheck" parameterType="hashmap" resultType="hashmap">
		SELECT 1 AS "isHoliday"
		  FROM DUAL
		 WHERE EXISTS (
			SELECT 1
			  FROM MU_HOSPITAL_HOLIDAY
			 WHERE MU_HOSPITAL_ID = #{muHospitalId}
			   AND USE_YN = 'Y'
			   AND (
				   (REPEAT_YN = 'Y' AND DATE_FORMAT(LOC_DATE, '%m-%d') = DATE_FORMAT(#{searchDate}, '%m-%d'))
				   OR
				   (REPEAT_YN = 'N' AND LOC_DATE = #{searchDate})
			   )
		 ) OR EXISTS (
			SELECT 1
			  FROM MU_PUBLIC_HOLIDAY MPH
			  JOIN MU_HOSPITAL MH
				ON MH.MU_HOSPITAL_ID = #{muHospitalId}
			   AND MH.PUBLIC_HOLIDAY_USE_YN = 'Y'
			 WHERE MPH.USE_YN = 'Y'
			   AND MPH.LOC_DATE = #{searchDate}
		 )
	</select>

	<insert id="insertHospitalSchedule" parameterType="hashmap">
		INSERT INTO MU_HOSPITAL_SCHEDULE (
			MU_HOSPITAL_SCHEDULE_ID, MU_HOSPITAL_ID, SCHEDULE_DATE, OPEN_YN,
			OPEN_START_TIME, OPEN_END_TIME, BREAK_START_TIME, BREAK_END_TIME,
			WRITE_DATE, WRITE_TIME, CUD_FLAG, USE_YN, REG_ID, MOD_ID,
			REG_DATE, MOD_DATE
		) VALUES (
			(SELECT CONCAT('S', DATE_FORMAT(NOw(), '%y%m%d%H%i%s%f'), LPAD(NEXT_NOT_CACHED_VALUE, 9, '0')) 
			   FROM MU_HOSPITAL_SCHEDULE_SEQ),
			#{muHospitalId}, #{scheduleDate}, #{openYn},
			#{openStartTime}, #{openEndTime}, #{breakStartTime}, #{breakEndTime},
			CURDATE(), CURTIME(), 'C', 'Y', #{regId}, #{modId},
			NOW(),NOW()
		)
	</insert>

	<update id="updateHospitalSchedule" parameterType="hashmap">
		UPDATE MU_HOSPITAL_SCHEDULE
		   SET OPEN_YN          = #{openYn},
		       OPEN_START_TIME  = #{openStartTime},
		       OPEN_END_TIME    = #{openEndTime},
		       BREAK_START_TIME = #{breakStartTime},
		       BREAK_END_TIME   = #{breakEndTime},
		       USE_YN           = 'Y',
		       MOD_ID           = #{modId},
		       MOD_DATE         = NOW(),
		       CUD_FLAG         = 'U'
		 WHERE MU_HOSPITAL_SCHEDULE_ID = #{muHospitalScheduleId}
	</update>

	<delete id="deleteHospitalSchedule" parameterType="hashmap">
		UPDATE MU_HOSPITAL_SCHEDULE
		   SET USE_YN = 'N',
		       CUD_FLAG = 'D',
		       MOD_ID = #{modId},
		       MOD_DATE = NOW()
		 WHERE MU_HOSPITAL_SCHEDULE_ID = #{muHospitalScheduleId}
	</delete>
	
	<update id="updateHospital" parameterType="hashmap">
		UPDATE MU_HOSPITAL
		   SET MOD_ID              = #{modId}
			  ,MOD_DATE            = NOW()
			  ,CUD_FLAG            = 'U'
			  ,MON_OPEN_YN             = #{monOpenYn}
			  ,MON_OPEN_START_TIME     = #{monOpenStartTime}
			  ,MON_OPEN_END_TIME       = #{monOpenEndTime}
			  ,MON_BREAK_START_TIME    = #{monBreakStartTime}
			  ,MON_BREAK_END_TIME      = #{monBreakEndTime}
			  ,TUE_OPEN_YN             = #{tueOpenYn}
			  ,TUE_OPEN_START_TIME     = #{tueOpenStartTime}
			  ,TUE_OPEN_END_TIME       = #{tueOpenEndTime}
			  ,TUE_BREAK_START_TIME    = #{tueBreakStartTime}
			  ,TUE_BREAK_END_TIME      = #{tueBreakEndTime}
			  ,WED_OPEN_YN             = #{wedOpenYn}
			  ,WED_OPEN_START_TIME     = #{wedOpenStartTime}
			  ,WED_OPEN_END_TIME       = #{wedOpenEndTime}
			  ,WED_BREAK_START_TIME    = #{wedBreakStartTime}
			  ,WED_BREAK_END_TIME      = #{wedBreakEndTime}
			  ,THU_OPEN_YN             = #{thuOpenYn}
			  ,THU_OPEN_START_TIME     = #{thuOpenStartTime}
			  ,THU_OPEN_END_TIME       = #{thuOpenEndTime}
			  ,THU_BREAK_START_TIME    = #{thuBreakStartTime}
			  ,THU_BREAK_END_TIME      = #{thuBreakEndTime}
			  ,FRI_OPEN_YN             = #{friOpenYn}
			  ,FRI_OPEN_START_TIME     = #{friOpenStartTime}
			  ,FRI_OPEN_END_TIME       = #{friOpenEndTime}
			  ,FRI_BREAK_START_TIME    = #{friBreakStartTime}
			  ,FRI_BREAK_END_TIME      = #{friBreakEndTime}
			  ,SAT_OPEN_YN             = #{satOpenYn}
			  ,SAT_OPEN_START_TIME     = #{satOpenStartTime}
			  ,SAT_OPEN_END_TIME       = #{satOpenEndTime}
			  ,SAT_BREAK_START_TIME    = #{satBreakStartTime}
			  ,SAT_BREAK_END_TIME      = #{satBreakEndTime}
			  ,SUN_OPEN_YN             = #{sunOpenYn}
			  ,SUN_OPEN_START_TIME     = #{sunOpenStartTime}
			  ,SUN_OPEN_END_TIME       = #{sunOpenEndTime}
			  ,SUN_BREAK_START_TIME    = #{sunBreakStartTime}
			  ,SUN_BREAK_END_TIME      = #{sunBreakEndTime}
			  ,PUBLIC_HOLIDAY_USE_YN   = #{publicHolidayUseYn}
		 WHERE USE_YN        = 'Y'
		   AND MU_HOSPITAL_ID  = #{muHospitalId}
	</update>

</mapper>