<?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.admin.biz.dao.TsaPosDao">

	<!--매장로그인 정보 조회 -->
	<select id="getStoreLoginInfo" parameterType="Pos" resultType="Pos">
		/* Pos.getStoreLoginInfo */
		SELECT DELV_LOC_CD
		     , DELV_LOC_NM
		     , DELV_LOC_CLSF
		     , SUPPLY_COMP_CD
		     , DELV_FEE_RATE
		FROM   TB_DELIVERY_LOC
		WHERE  DELV_LOC_CD   = #{delvLocCd}
		-- AND    DELV_LOC_CLSF = '21' --직송매장
		AND    USE_YN        = 'Y'
	</select>

	<!--출고대기목록-->
	<select id="getPosDeliveryList" parameterType="Pos" resultType="Pos">
		/* Pos.getPosDeliveryList */
		SELECT '1' FROM DUAL
	</select>

	<!--정산내역-->
	<select id="getPosUsacList" parameterType="Pos" resultType="Pos">
		/* Pos.getPosUsacList */
        SELECT '1' FROM DUAL
	</select>

	<!--배송정보-->
	<select id="getOrderExcelList" parameterType="Pos" resultType="paramMap">
		/* Pos.getOrderExcelList */
        SELECT ' '                                   AS RSRVT_GB     -- 예약구분: ( 일반/ 반품) 공란이면 선택한 형식적용
             , ' '                                   AS SCHDL_CLDT   -- 집하예정일 (공란이면 자동 적용)
             , C.RECIP_NM                                           -- 받는분 성명
             , C.RECIP_PHNNO                                        -- 받는분 전화번호 
             , C.RECIP_TELNO                                        -- 받는분기타연락처 
             , C.RECIP_POST_NO                                      -- 받는분 우편번호 
             , C.RECIP_BASE_ADDR||C.RECIP_DTL_ADDR  AS RECIP_ADDR   -- 받는분 주소(전체)
             , ' ' AS INVOICE_NO                                         -- 운송장번호 
             , A.ORD_NO                                             -- 고객주문번호 
             , D.GOODS_NM||'/'|| G.SIZE_CD ||'x'|| (B.ORD_QTY * G.ITEM_QTY)  AS GOODS_NM  -- 품목명 
             , ' '                                   AS BOX_QTY      -- 박스수량 (공란이면 1로인식)
             , ' '                                   AS BOX_TYPE     -- 박스타입 (공란이면 화면기준적용) 
             , ' '                                   AS FEE          -- 기본운임 (운임합계) 
             , C.DELV_MEMO                          AS DELV_MEMO    -- 배달메시지1
             , ' '                                   AS DELV_MEMO2   -- 배달메시지2 
             , D.GOODS_CD||'/'|| G.SIZE_CD ||'x'|| (B.ORD_QTY * G.ITEM_QTY) AS GOODS_CD
        FROM  TB_ORDER A
            , TB_ORDER_DETAIL B
            , TB_ORDER_DETAIL_ITEM G
            , TB_DELIVERY_ADDR C
            , TB_GOODS D
        WHERE A.ORD_NO       = B.ORD_NO
          AND B.ORD_NO       = G.ORD_NO
          AND B.ORD_DTL_NO   = G.ORD_DTL_NO
          AND B.DELV_ADDR_SQ = C.DELV_ADDR_SQ
          AND G.ITEM_CD      = D.GOODS_CD
          AND B.ORD_DTL_NO IN
		<foreach collection="ordDtlNoArr" item="item" index="index"  open="(" close=")" separator=",">
		      #{item}
		</foreach>
	</select>
	
	<!-- 매장pos r/t여부 체크 20200925 -->
    <select id="getShopRtCheck"  parameterType="Pos" resultType="int">
        /*Pos.getShopRtCheck*/
        SELECT '1' FROM DUAL
    </select>

</mapper>