|
@@ -295,94 +295,255 @@
|
|
|
AND A.NUM=E.NUM
|
|
|
</select>
|
|
|
|
|
|
- <select id="getListRem" resultType="easyHashMap"><![CDATA[
|
|
|
- SELECT A.RESERVATION_ID RESERVATION_ID
|
|
|
- , A.MEETINGROOM_ID MEETINGROOM_ID
|
|
|
- , B.BUNHO BUNHO
|
|
|
- , A.MEETING_NAME MEETING_NAME
|
|
|
- , A.MEETING_CON MEETING_CON
|
|
|
- , A.START_YYYYMMDD START_YYYYMMDD
|
|
|
- , DECODE(A.START_YYYYMMDD, A.END_YYYYMMDD, TO_CHAR(TO_DATE(A.START_YYYYMMDD, 'YYYYMMDD'), 'YYYY-MM-DD'),TO_CHAR(TO_DATE(A.START_YYYYMMDD, 'YYYYMMDD'),'YYYY-MM-DD')||' ~ '||TO_CHAR(TO_DATE(A.END_YYYYMMDD, 'YYYYMMDD'),'YYYY-MM-DD')) PYMD
|
|
|
- , SUBSTR(A.START_HHMM, 1, 2)||':'||SUBSTR(A.START_HHMM, 3, 2)||' ~ '||SUBSTR(A.END_HHMM, 1, 2)||':'||SUBSTR(A.END_HHMM, 3, 2) PHM
|
|
|
- , A.END_YYYYMMDD END_YYYYMMDD
|
|
|
- , A.START_HHMM START_HHMM
|
|
|
- , A.END_HHMM END_HHMM
|
|
|
- , (SELECT CMPN_NM FROM SM_COM_CMPN WHERE CMPN_CD = A.SUBSC_CMPN_CD) AS CMPN_NM
|
|
|
- , A.SUBSC_SABUN SUBSC_SABUN
|
|
|
- , A.SUBSC_NAME SUBSC_NAME
|
|
|
- , A.DEPT_CD DEPT_CD
|
|
|
- , A.DEPT_NAME DEPT_NAME
|
|
|
- , A.ATTEND_NUM ATTEND_NUM
|
|
|
- , A.USE_PDEPT_CD USE_PDEPT_CD
|
|
|
- , ZEHR_CODE_NAME_FNC(A.SUBSC_CMPN_CD, 'RE009', A.USE_PDEPT_CD) AS USE_PDEPT_NM
|
|
|
- , A.STATUS STATUS
|
|
|
- , ZEHR_CODE_NAME_FNC(A.SUBSC_CMPN_CD, 'RE002',A.STATUS) AS STATUS_NM
|
|
|
- , A.KEY_YN KEY_YN
|
|
|
- , A.KEYSEND_YN KEYSEND_YN
|
|
|
- , A.GUBUN GUBUN
|
|
|
- , ZEHR_CODE_NAME_FNC(A.SUBSC_CMPN_CD, 'RE003',A.GUBUN) AS GUBUN_NM
|
|
|
- , A.WEEK_MU WEEK_MU
|
|
|
- , A.WEEK_TU WEEK_TU
|
|
|
- , A.WEEK_WE WEEK_WE
|
|
|
- , A.WEEK_TH WEEK_TH
|
|
|
- , A.WEEK_FR WEEK_FR
|
|
|
- , A.REMARK REMARK
|
|
|
- , F_MASK_FUN(C.PHONE,9,#{psnlinfoIqryn}) PHONE
|
|
|
- , D.MR_LOCATION LOCATION_NM
|
|
|
- , CASE
|
|
|
- WHEN STATUS = '20' THEN '[승인요청]중인 예약은 사용후기 작성이 안됩니다.'
|
|
|
- WHEN STATUS = '40' THEN '[반려]된 예약은 사용후기 작성이 안됩니다.'
|
|
|
- WHEN STATUS = '50' THEN '이미 종료한 예약입니다.'
|
|
|
- WHEN STATUS = '60' THEN '[취소]된 예약은 사용후기 작성이 안됩니다.'
|
|
|
- WHEN TO_CHAR(SYSDATE,'YYYYMMDD') < START_YYYYMMDD THEN '지난 예약과 진행중인 예약만 종료 가능합니다.'
|
|
|
- WHEN TO_CHAR(SYSDATE,'YYYYMMDD') = START_YYYYMMDD AND TO_CHAR(SYSDATE,'HHmm') < START_HHMM THEN '지난 예약과 진행중인 예약만 종료 가능합니다.'
|
|
|
- ELSE '예약종료 가능.'
|
|
|
- END AS CLOSE_CN
|
|
|
- , CASE
|
|
|
- WHEN STATUS = '20' THEN 'N'
|
|
|
- WHEN STATUS = '40' THEN 'N'
|
|
|
- WHEN STATUS = '50' THEN 'N'
|
|
|
- WHEN STATUS = '60' THEN 'N'
|
|
|
- WHEN TO_CHAR(SYSDATE,'YYYYMMDD') < START_YYYYMMDD THEN 'N'
|
|
|
- WHEN TO_CHAR(SYSDATE,'YYYYMMDD') = START_YYYYMMDD AND TO_CHAR(SYSDATE,'HHmm') < START_HHMM THEN 'N'
|
|
|
- ELSE 'Y'
|
|
|
- END AS CLOSE_YN
|
|
|
- , CASE
|
|
|
- WHEN STATUS = '40' THEN '[반려]된 예약은 취소가 안됩니다.'
|
|
|
- WHEN STATUS = '50' THEN '[종료]된 예약은 취소가 안됩니다.'
|
|
|
- WHEN STATUS = '60' THEN '이미 취소한 예약입니다.'
|
|
|
- WHEN TO_CHAR(SYSDATE,'YYYYMMDD') > START_YYYYMMDD THEN '지난 예약과 진행중인 예약은 취소가 안됩니다.'
|
|
|
- WHEN TO_CHAR(SYSDATE,'YYYYMMDD') = START_YYYYMMDD AND TO_CHAR(SYSDATE,'HHmm') > START_HHMM THEN '지난 예약과 진행중인 예약은 취소가 안됩니다.'
|
|
|
- ELSE '예약취소 가능.'
|
|
|
- END AS CANCEL_CN
|
|
|
- , CASE
|
|
|
- WHEN STATUS = '40' THEN 'N'
|
|
|
- WHEN STATUS = '50' THEN 'N'
|
|
|
- WHEN STATUS = '60' THEN 'N'
|
|
|
- WHEN TO_CHAR(SYSDATE,'YYYYMMDD') > START_YYYYMMDD THEN 'N'
|
|
|
- WHEN TO_CHAR(SYSDATE,'YYYYMMDD') = START_YYYYMMDD AND TO_CHAR(SYSDATE,'HHmm') > START_HHMM THEN 'N'
|
|
|
- ELSE 'Y'
|
|
|
- END AS CANCEL_YN
|
|
|
- FROM ZEHR_ROM_RESRVTN A
|
|
|
+ <select id="getListRem" resultType="easyHashMap">
|
|
|
+ WITH TimeRanges AS (
|
|
|
+ SELECT
|
|
|
+ A.RESERVATION_ID
|
|
|
+ , A.MEETINGROOM_ID
|
|
|
+ , A.MEETING_NAME
|
|
|
+ , A.MEETING_CON
|
|
|
+ , A.START_YYYYMMDD
|
|
|
+ , A.END_YYYYMMDD
|
|
|
+ , A.START_HHMM
|
|
|
+ , A.END_HHMM
|
|
|
+ , CASE
|
|
|
+ WHEN TO_TIMESTAMP(A.START_YYYYMMDD || A.START_HHMM, 'YYYYMMDDHH24MI') <![CDATA[<]]> TO_TIMESTAMP(A.START_YYYYMMDD || '0830', 'YYYYMMDDHH24MI')
|
|
|
+ THEN TO_TIMESTAMP(A.START_YYYYMMDD || '0830', 'YYYYMMDDHH24MI')
|
|
|
+ ELSE TO_TIMESTAMP(A.START_YYYYMMDD || A.START_HHMM, 'YYYYMMDDHH24MI')
|
|
|
+ END AS EffectiveStart,
|
|
|
+ CASE
|
|
|
+ WHEN TO_TIMESTAMP(A.END_YYYYMMDD || A.END_HHMM, 'YYYYMMDDHH24MI') <![CDATA[>]]> TO_TIMESTAMP(A.END_YYYYMMDD || '1730', 'YYYYMMDDHH24MI')
|
|
|
+ THEN TO_TIMESTAMP(A.END_YYYYMMDD || '1730', 'YYYYMMDDHH24MI')
|
|
|
+ ELSE TO_TIMESTAMP(A.END_YYYYMMDD || A.END_HHMM, 'YYYYMMDDHH24MI')
|
|
|
+ END AS EffectiveEnd
|
|
|
+ , A.SUBSC_CMPN_CD
|
|
|
+ , A.SUBSC_SABUN
|
|
|
+ , A.SUBSC_NAME
|
|
|
+ , A.DEPT_CD
|
|
|
+ , A.DEPT_NAME
|
|
|
+ , A.ATTEND_NUM
|
|
|
+ , A.USE_PDEPT_CD
|
|
|
+ , A.STATUS
|
|
|
+ , A.GUBUN
|
|
|
+ FROM ZEHR_ROM_RESRVTN A
|
|
|
+ WHERE ((A.START_YYYYMMDD <![CDATA[<=]]> #{reYyyymmddF} AND A.END_YYYYMMDD <![CDATA[>=]]> #{reYyyymmddT}) OR A.START_YYYYMMDD BETWEEN #{reYyyymmddF} AND #{reYyyymmddT})
|
|
|
+ <if test="meetingroomId != '' and meetingroomId != null and meetingroomId != 'all'">
|
|
|
+ AND A.MEETINGROOM_ID = #{meetingroomId}
|
|
|
+ </if>
|
|
|
+ <if test="status != '' and status != null and status != 'all'">
|
|
|
+ AND A.STATUS = #{status}
|
|
|
+ </if>
|
|
|
+ <if test="cmpnCd != '' and cmpnCd != null and cmpnCd != 'all'">
|
|
|
+ AND A.SUBSC_CMPN_CD = #{cmpnCd}
|
|
|
+ </if>
|
|
|
+ <if test="usePdeptCd != '' and usePdeptCd != null and usePdeptCd != 'all'">
|
|
|
+ AND A.USE_PDEPT_CD = #{usePdeptCd}
|
|
|
+ </if>
|
|
|
+ ),
|
|
|
+ DateRanges AS (
|
|
|
+ SELECT
|
|
|
+ RESERVATION_ID
|
|
|
+ , MEETINGROOM_ID
|
|
|
+ , MEETING_NAME
|
|
|
+ , MEETING_CON
|
|
|
+ , START_YYYYMMDD
|
|
|
+ , END_YYYYMMDD
|
|
|
+ , START_HHMM
|
|
|
+ , END_HHMM
|
|
|
+ , EffectiveStart
|
|
|
+ , EffectiveEnd
|
|
|
+ , SUBSC_CMPN_CD
|
|
|
+ , SUBSC_SABUN
|
|
|
+ , SUBSC_NAME
|
|
|
+ , DEPT_CD
|
|
|
+ , DEPT_NAME
|
|
|
+ , ATTEND_NUM
|
|
|
+ , USE_PDEPT_CD
|
|
|
+ , STATUS
|
|
|
+ , GUBUN
|
|
|
+ , TO_DATE(START_YYYYMMDD, 'YYYYMMDD') + LEVEL - 1 AS CurrentDate
|
|
|
+ FROM TimeRanges
|
|
|
+ WHERE GUBUN = '30'
|
|
|
+ AND STATUS NOT IN ('40', '60')
|
|
|
+ CONNECT BY LEVEL <![CDATA[<=]]> (TO_DATE(END_YYYYMMDD, 'YYYYMMDD') - TO_DATE(START_YYYYMMDD, 'YYYYMMDD')) + 1
|
|
|
+ START WITH GUBUN = '30' AND STATUS NOT IN ('40', '60')
|
|
|
+ UNION ALL
|
|
|
+ SELECT
|
|
|
+ RESERVATION_ID
|
|
|
+ , MEETINGROOM_ID
|
|
|
+ , MEETING_NAME
|
|
|
+ , MEETING_CON
|
|
|
+ , START_YYYYMMDD
|
|
|
+ , END_YYYYMMDD
|
|
|
+ , START_HHMM
|
|
|
+ , END_HHMM
|
|
|
+ , EffectiveStart
|
|
|
+ , EffectiveEnd
|
|
|
+ , SUBSC_CMPN_CD
|
|
|
+ , SUBSC_SABUN
|
|
|
+ , SUBSC_NAME
|
|
|
+ , DEPT_CD
|
|
|
+ , DEPT_NAME
|
|
|
+ , ATTEND_NUM
|
|
|
+ , USE_PDEPT_CD
|
|
|
+ , STATUS
|
|
|
+ , GUBUN
|
|
|
+ , TO_DATE(START_YYYYMMDD, 'YYYYMMDD') AS CurrentDate
|
|
|
+ FROM TimeRanges
|
|
|
+ WHERE STATUS IN ('40', '60')
|
|
|
+ UNION ALL
|
|
|
+ SELECT
|
|
|
+ RESERVATION_ID
|
|
|
+ , MEETINGROOM_ID
|
|
|
+ , MEETING_NAME
|
|
|
+ , MEETING_CON
|
|
|
+ , START_YYYYMMDD
|
|
|
+ , END_YYYYMMDD
|
|
|
+ , START_HHMM
|
|
|
+ , END_HHMM
|
|
|
+ , EffectiveStart
|
|
|
+ , EffectiveEnd
|
|
|
+ , SUBSC_CMPN_CD
|
|
|
+ , SUBSC_SABUN
|
|
|
+ , SUBSC_NAME
|
|
|
+ , DEPT_CD
|
|
|
+ , DEPT_NAME
|
|
|
+ , ATTEND_NUM
|
|
|
+ , USE_PDEPT_CD
|
|
|
+ , STATUS
|
|
|
+ , GUBUN
|
|
|
+ , TO_DATE(START_YYYYMMDD, 'YYYYMMDD') AS CurrentDate
|
|
|
+ FROM TimeRanges
|
|
|
+ WHERE GUBUN IN ('10', '20')
|
|
|
+ AND STATUS NOT IN ('40', '60')
|
|
|
+ )
|
|
|
+ SELECT A.RESERVATION_ID
|
|
|
+ , A.MEETINGROOM_ID
|
|
|
+ , B.BUNHO
|
|
|
+ , A.MEETING_NAME
|
|
|
+ , A.MEETING_CON
|
|
|
+ , A.START_YYYYMMDD
|
|
|
+ , A.END_YYYYMMDD
|
|
|
+ , A.START_HHMM
|
|
|
+ , A.END_HHMM
|
|
|
+ , DECODE(A.START_YYYYMMDD, A.END_YYYYMMDD, TO_CHAR(TO_DATE(A.START_YYYYMMDD, 'YYYYMMDD'), 'YYYY-MM-DD'),TO_CHAR(TO_DATE(A.START_YYYYMMDD, 'YYYYMMDD'),'YYYY-MM-DD')||'~'||TO_CHAR(TO_DATE(A.END_YYYYMMDD, 'YYYYMMDD'),'YYYY-MM-DD')) PYMD
|
|
|
+ , SUBSTR(A.START_HHMM, 1, 2)||':'||SUBSTR(A.START_HHMM, 3, 2)||' ~ '||SUBSTR(A.END_HHMM, 1, 2)||':'||SUBSTR(A.END_HHMM, 3, 2) PHM
|
|
|
+ , (SELECT CMPN_NM FROM SM_COM_CMPN WHERE CMPN_CD = A.SUBSC_CMPN_CD) AS CMPN_NM
|
|
|
+ , A.SUBSC_SABUN
|
|
|
+ , A.SUBSC_NAME
|
|
|
+ , A.DEPT_CD
|
|
|
+ , A.DEPT_NAME
|
|
|
+ , A.ATTEND_NUM
|
|
|
+ , A.USE_PDEPT_CD
|
|
|
+ , ZEHR_CODE_NAME_FNC(A.SUBSC_CMPN_CD, 'RE009', A.USE_PDEPT_CD) AS USE_PDEPT_NM
|
|
|
+ , A.STATUS
|
|
|
+ , ZEHR_CODE_NAME_FNC(A.SUBSC_CMPN_CD, 'RE002', A.STATUS) AS STATUS_NM
|
|
|
+ , A.GUBUN
|
|
|
+ , ZEHR_CODE_NAME_FNC(A.SUBSC_CMPN_CD, 'RE003', A.GUBUN) AS GUBUN_NM
|
|
|
+ , C.MR_LOCATION AS LOCATION_NM
|
|
|
+ <!-- , EffectiveStart
|
|
|
+ , EffectiveEnd
|
|
|
+ , TO_CHAR(CurrentDate, 'd') as ddd
|
|
|
+ , TO_CHAR(CurrentDate, 'dy') as ddd -->
|
|
|
+ , E.AMT_H
|
|
|
+ , DECODE(A.STATUS, '40', 0, '60', 0, E.AMT_H * SUM(CASE
|
|
|
+ WHEN TO_CHAR(CurrentDate, 'd') NOT IN (1, 7) THEN
|
|
|
+ CASE
|
|
|
+ WHEN TO_DATE(START_YYYYMMDD, 'YYYYMMDD')+1 <![CDATA[<]]> TO_DATE(END_YYYYMMDD, 'YYYYMMDD') THEN
|
|
|
+ -- 여러일인 경우
|
|
|
+ (CASE
|
|
|
+ WHEN CurrentDate = TO_DATE(START_YYYYMMDD, 'YYYYMMDD') THEN
|
|
|
+ GREATEST(EXTRACT(HOUR FROM TO_TIMESTAMP(START_YYYYMMDD || '1730', 'YYYYMMDDHH24MI') - GREATEST(EffectiveStart, TO_TIMESTAMP(START_YYYYMMDD || '0830', 'YYYYMMDDHH24MI'))) +
|
|
|
+ (EXTRACT(MINUTE FROM TO_TIMESTAMP(START_YYYYMMDD || '1730', 'YYYYMMDDHH24MI') - GREATEST(EffectiveStart, TO_TIMESTAMP(START_YYYYMMDD || '0830', 'YYYYMMDDHH24MI'))) / 60), 0) -
|
|
|
+ CASE WHEN EffectiveStart <![CDATA[<=]]> TO_TIMESTAMP(START_YYYYMMDD || '1200', 'YYYYMMDDHH24MI') THEN 1
|
|
|
+ WHEN EffectiveStart <![CDATA[<]]> TO_TIMESTAMP(START_YYYYMMDD || '1300', 'YYYYMMDDHH24MI') THEN 0.5
|
|
|
+ ELSE 0
|
|
|
+ END
|
|
|
+ WHEN CurrentDate = TO_DATE(END_YYYYMMDD, 'YYYYMMDD') THEN
|
|
|
+ GREATEST(EXTRACT(HOUR FROM LEAST(EffectiveEnd, TO_TIMESTAMP(END_YYYYMMDD || '1730', 'YYYYMMDDHH24MI')) - TO_TIMESTAMP(END_YYYYMMDD || '0830', 'YYYYMMDDHH24MI')) +
|
|
|
+ (EXTRACT(MINUTE FROM LEAST(EffectiveEnd, TO_TIMESTAMP(END_YYYYMMDD || '1730', 'YYYYMMDDHH24MI')) - TO_TIMESTAMP(END_YYYYMMDD || '0830', 'YYYYMMDDHH24MI')) / 60), 0) -
|
|
|
+ CASE WHEN EffectiveEnd <![CDATA[>=]]> TO_TIMESTAMP(END_YYYYMMDD || '1300', 'YYYYMMDDHH24MI') THEN 1
|
|
|
+ WHEN EffectiveStart <![CDATA[>]]> TO_TIMESTAMP(END_YYYYMMDD || '1200', 'YYYYMMDDHH24MI') THEN 0.5
|
|
|
+ ELSE 0
|
|
|
+ END
|
|
|
+ ELSE 8 -- 중간일의 기본 근무 시간
|
|
|
+ END)
|
|
|
+ WHEN TO_DATE(START_YYYYMMDD, 'YYYYMMDD')+1 = TO_DATE(END_YYYYMMDD, 'YYYYMMDD') THEN
|
|
|
+ -- 이틀인 경우
|
|
|
+ (CASE
|
|
|
+ WHEN CurrentDate = TO_DATE(START_YYYYMMDD, 'YYYYMMDD') THEN
|
|
|
+ GREATEST(EXTRACT(HOUR FROM TO_TIMESTAMP(START_YYYYMMDD || '1730', 'YYYYMMDDHH24MI') - GREATEST(EffectiveStart, TO_TIMESTAMP(START_YYYYMMDD || '0830', 'YYYYMMDDHH24MI'))) +
|
|
|
+ (EXTRACT(MINUTE FROM TO_TIMESTAMP(START_YYYYMMDD || '1730', 'YYYYMMDDHH24MI') - GREATEST(EffectiveStart, TO_TIMESTAMP(START_YYYYMMDD || '0830', 'YYYYMMDDHH24MI'))) / 60), 0) -
|
|
|
+ CASE WHEN EffectiveStart <![CDATA[<=]]> TO_TIMESTAMP(START_YYYYMMDD || '1200', 'YYYYMMDDHH24MI') THEN 1
|
|
|
+ WHEN EffectiveStart <![CDATA[<]]> TO_TIMESTAMP(START_YYYYMMDD || '1300', 'YYYYMMDDHH24MI') THEN 0.5
|
|
|
+ ELSE 0
|
|
|
+ END
|
|
|
+ WHEN CurrentDate = TO_DATE(END_YYYYMMDD, 'YYYYMMDD') THEN
|
|
|
+ GREATEST(EXTRACT(HOUR FROM LEAST(EffectiveEnd, TO_TIMESTAMP(END_YYYYMMDD || '1730', 'YYYYMMDDHH24MI')) - TO_TIMESTAMP(END_YYYYMMDD || '0830', 'YYYYMMDDHH24MI')) +
|
|
|
+ (EXTRACT(MINUTE FROM LEAST(EffectiveEnd, TO_TIMESTAMP(END_YYYYMMDD || '1730', 'YYYYMMDDHH24MI')) - TO_TIMESTAMP(END_YYYYMMDD || '0830', 'YYYYMMDDHH24MI')) / 60), 0) -
|
|
|
+ CASE WHEN EffectiveEnd <![CDATA[>=]]> TO_TIMESTAMP(END_YYYYMMDD || '1300', 'YYYYMMDDHH24MI') THEN 1
|
|
|
+ WHEN EffectiveStart <![CDATA[>]]> TO_TIMESTAMP(END_YYYYMMDD || '1200', 'YYYYMMDDHH24MI') THEN 0.5
|
|
|
+ ELSE 0
|
|
|
+ END
|
|
|
+ ELSE 0
|
|
|
+ END)
|
|
|
+ WHEN TO_DATE(START_YYYYMMDD, 'YYYYMMDD') = TO_DATE(END_YYYYMMDD, 'YYYYMMDD') THEN
|
|
|
+ -- 시작일과 종료일이 같은 경우
|
|
|
+ EXTRACT(HOUR FROM TO_TIMESTAMP(START_YYYYMMDD || END_HHMM, 'YYYYMMDDHH24MI') - TO_TIMESTAMP(START_YYYYMMDD || START_HHMM, 'YYYYMMDDHH24MI'))
|
|
|
+ + (EXTRACT(MINUTE FROM TO_TIMESTAMP(START_YYYYMMDD || END_HHMM, 'YYYYMMDDHH24MI') - TO_TIMESTAMP(START_YYYYMMDD || START_HHMM, 'YYYYMMDDHH24MI')) / 60 )
|
|
|
+<!-- GREATEST(EXTRACT(HOUR FROM LEAST(EffectiveEnd, TO_TIMESTAMP(START_YYYYMMDD || '1730', 'YYYYMMDDHH24MI')) - GREATEST(EffectiveStart, TO_TIMESTAMP(START_YYYYMMDD || '0830', 'YYYYMMDDHH24MI'))) +
|
|
|
+ (EXTRACT(MINUTE FROM LEAST(EffectiveEnd, TO_TIMESTAMP(START_YYYYMMDD || '1730', 'YYYYMMDDHH24MI')) - GREATEST(EffectiveStart, TO_TIMESTAMP(START_YYYYMMDD || '0830', 'YYYYMMDDHH24MI'))) / 60), 0) -
|
|
|
+ (CASE
|
|
|
+ WHEN EffectiveStart <![CDATA[<=]]> TO_TIMESTAMP(START_YYYYMMDD || '1200', 'YYYYMMDDHH24MI') THEN
|
|
|
+ CASE WHEN EffectiveEnd <![CDATA[>=]]> TO_TIMESTAMP(START_YYYYMMDD || '1300', 'YYYYMMDDHH24MI') THEN 1
|
|
|
+ WHEN EffectiveEnd = TO_TIMESTAMP(START_YYYYMMDD || '1230', 'YYYYMMDDHH24MI') THEN 0.5
|
|
|
+ ELSE 0
|
|
|
+ END
|
|
|
+ WHEN EffectiveStart = TO_TIMESTAMP(START_YYYYMMDD || '1230', 'YYYYMMDDHH24MI') THEN
|
|
|
+ CASE WHEN EffectiveEnd <![CDATA[>=]]> TO_TIMESTAMP(START_YYYYMMDD || '1300', 'YYYYMMDDHH24MI') THEN 0.5
|
|
|
+ ELSE 0
|
|
|
+ END
|
|
|
+ ELSE 0
|
|
|
+ END) -->
|
|
|
+ END
|
|
|
+ ELSE 0
|
|
|
+ END)) AS USE_AMT
|
|
|
+ FROM DateRanges A
|
|
|
, ZEHR_ROM_INFO B
|
|
|
- , ZEHR_PHM_INFO_R C
|
|
|
- , ZEHR_ROM_LOCTN D
|
|
|
- ]]>
|
|
|
- WHERE B.MEETINGROOM_ID = A.MEETINGROOM_ID
|
|
|
- AND A.SUBSC_SABUN = C.EMP_NO
|
|
|
- AND B.LOCATION_ID = D.LOCATION_ID
|
|
|
- AND B.VISIBLE_YN = 'Y'
|
|
|
- <if test="meetingroomId != '' and meetingroomId != null and meetingroomId != 'all'">
|
|
|
- AND A.MEETINGROOM_ID = #{meetingroomId}
|
|
|
- </if>
|
|
|
- <if test="status != '' and status != null and status != 'all'">
|
|
|
- AND A.STATUS = #{status}
|
|
|
- </if>
|
|
|
- <if test="cmpnCd != '' and cmpnCd != null and cmpnCd != 'all'">
|
|
|
- AND A.SUBSC_CMPN_CD = #{cmpnCd}
|
|
|
- </if>
|
|
|
- AND ((A.START_YYYYMMDD <![CDATA[<=]]> #{reYyyymmddF} AND A.END_YYYYMMDD <![CDATA[>=]]> #{reYyyymmddT}) OR A.START_YYYYMMDD BETWEEN #{reYyyymmddF} AND #{reYyyymmddT})
|
|
|
- ORDER BY D.MR_LOCATION, B.BUNHO, A.MEETING_NAME
|
|
|
+ , ZEHR_ROM_LOCTN C
|
|
|
+ , ZEHR_ROM_RENT_PERIOD D
|
|
|
+ , ZEHR_ROM_RENTAL E
|
|
|
+ WHERE B.MEETINGROOM_ID = A.MEETINGROOM_ID
|
|
|
+ AND B.LOCATION_ID = C.LOCATION_ID
|
|
|
+ AND D.SEQ = E.SEQ
|
|
|
+ AND E.MEETINGROOM_ID = A.MEETINGROOM_ID
|
|
|
+ AND D.USE_YN = 'Y'
|
|
|
+ AND B.VISIBLE_YN = 'Y'
|
|
|
+ GROUP BY RESERVATION_ID
|
|
|
+ , A.MEETINGROOM_ID
|
|
|
+ , B.BUNHO
|
|
|
+ , A.MEETING_NAME
|
|
|
+ , A.MEETING_CON
|
|
|
+ , A.START_YYYYMMDD
|
|
|
+ , A.END_YYYYMMDD
|
|
|
+ , A.START_HHMM
|
|
|
+ , A.END_HHMM
|
|
|
+ , A.EffectiveStart
|
|
|
+ , A.EffectiveEnd
|
|
|
+ , A.SUBSC_CMPN_CD
|
|
|
+ , A.SUBSC_SABUN
|
|
|
+ , A.SUBSC_NAME
|
|
|
+ , A.DEPT_CD
|
|
|
+ , A.DEPT_NAME
|
|
|
+ , A.ATTEND_NUM
|
|
|
+ , A.USE_PDEPT_CD
|
|
|
+ , A.STATUS
|
|
|
+ , A.GUBUN
|
|
|
+ , C.MR_LOCATION
|
|
|
+ , E.AMT_H
|
|
|
+ ORDER BY C.MR_LOCATION
|
|
|
+ , B.BUNHO
|
|
|
+ , A.MEETING_NAME
|
|
|
</select>
|
|
|
|
|
|
<select id="getViewRem" resultType="easyHashMap"><![CDATA[
|