|
@@ -1442,8 +1442,8 @@
|
|
|
</select>
|
|
</select>
|
|
|
|
|
|
|
|
<!-- 컨텐츠카테고리상품 목록 -->
|
|
<!-- 컨텐츠카테고리상품 목록 -->
|
|
|
- <select id="getContentsCategoryGoodsList" parameterType="Cate4Srch" resultType="Goods">
|
|
|
|
|
- /* TsfGoods.getContentsCategoryGoodsList */
|
|
|
|
|
|
|
+ <select id="getContentsCategoryGoodsList_old" parameterType="Cate4Srch" resultType="Goods">
|
|
|
|
|
+ /* TsfGoods.getContentsCategoryGoodsList_old */
|
|
|
WITH TAB_GOODS AS (
|
|
WITH TAB_GOODS AS (
|
|
|
SELECT
|
|
SELECT
|
|
|
<if test="contentsLoc == 'SMM003' or contentsLoc == 'SBM007' or contentsLoc == 'SBM008' or contentsLoc == 'SBM009' or contentsLoc == 'SBM017' or contentsLoc == 'SBM018' or contentsLoc == 'SBM019' or contentsLoc == 'SOM003' or contentsLoc == 'SOM002'">
|
|
<if test="contentsLoc == 'SMM003' or contentsLoc == 'SBM007' or contentsLoc == 'SBM008' or contentsLoc == 'SBM009' or contentsLoc == 'SBM017' or contentsLoc == 'SBM018' or contentsLoc == 'SBM019' or contentsLoc == 'SOM003' or contentsLoc == 'SOM002'">
|
|
@@ -1705,6 +1705,212 @@
|
|
|
AND W.CUST_NO = #{custNo}
|
|
AND W.CUST_NO = #{custNo}
|
|
|
</if>
|
|
</if>
|
|
|
</select>
|
|
</select>
|
|
|
|
|
+
|
|
|
|
|
+ <!-- 컨텐츠카테고리상품 목록 -->
|
|
|
|
|
+ <select id="getContentsCategoryGoodsList" parameterType="Cate4Srch" resultType="Goods">
|
|
|
|
|
+ /* TsfGoods.getContentsCategoryGoodsList */
|
|
|
|
|
+ SELECT
|
|
|
|
|
+ <if test="contentsLoc == 'SMM003' or contentsLoc == 'SBM007' or contentsLoc == 'SBM008' or contentsLoc == 'SBM009' or contentsLoc == 'SBM017' or contentsLoc == 'SBM018' or contentsLoc == 'SBM019' or contentsLoc == 'SOM003' or contentsLoc == 'SOM002'">
|
|
|
|
|
+ DISTINCT
|
|
|
|
|
+ </if>
|
|
|
|
|
+ G.BRAND_GROUP_NM /*브랜드그룹명*/
|
|
|
|
|
+ , G.GOODS_CD /*상품코드*/
|
|
|
|
|
+ , G.GOODS_NM /*상품명*/
|
|
|
|
|
+ , G.GOODS_GB /*상품구분*/
|
|
|
|
|
+ , G.SELF_GOODS_YN /*자사상품여부*/
|
|
|
|
|
+ , G.FOREIGN_BUY_YN /*해외구매대행여부*/
|
|
|
|
|
+ , G.PARALLEL_IMPORT_YN /*병행수입여부*/
|
|
|
|
|
+ , G.ORDER_MADE_YN /*주문제작여부*/
|
|
|
|
|
+ , G.GOODS_TNM /*상품타이틀명*/
|
|
|
|
|
+ , G.MAIN_COLOR_CD /*대표색상코드*/
|
|
|
|
|
+ , G.LIST_PRICE /*정상가(최초판매가)*/
|
|
|
|
|
+ , FN_GET_BENEFIT_PRICE(#{frontGb},G.GOODS_CD,G.CURR_PRICE,#{custGb}) AS CURR_PRICE /*현재판매가*/
|
|
|
|
|
+ , G.REG_DT /*등록일시*/
|
|
|
|
|
+ , G.DISP_ORD
|
|
|
|
|
+ , G.SYS_IMG_NM
|
|
|
|
|
+ , G.SYS_IMG_NM2
|
|
|
|
|
+ , G.VIDEOS
|
|
|
|
|
+ <if test="contentsLoc == 'SCM003' and pageGb != null and pageGb == 'BEST'">
|
|
|
|
|
+ , G.SELL_WEEK_QTY
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <choose>
|
|
|
|
|
+ <when test="custNo != null and custNo > 0"> <!-- 로그인 했으면 -->
|
|
|
|
|
+ , IF(W.GOODS_CD IS NULL,'','likeit') AS LIKE_IT /*위시리스트담긴상품*/
|
|
|
|
|
+ </when>
|
|
|
|
|
+ <otherwise>
|
|
|
|
|
+ , '' AS LIKE_IT /*위시리스트담긴상품*/
|
|
|
|
|
+ </otherwise>
|
|
|
|
|
+ </choose>
|
|
|
|
|
+ FROM (
|
|
|
|
|
+ SELECT
|
|
|
|
|
+ <if test="contentsLoc == 'SCM003' and pageGb != null and pageGb == 'BEST'">
|
|
|
|
|
+ DISTINCT
|
|
|
|
|
+ </if>
|
|
|
|
|
+ TT.BRAND_GROUP_NM /*브랜드그룹명*/
|
|
|
|
|
+ , TT.GOODS_CD /*상품코드*/
|
|
|
|
|
+ , TT.GOODS_NM /*상품명*/
|
|
|
|
|
+ , TT.GOODS_GB /*상품구분*/
|
|
|
|
|
+ , TT.SELF_GOODS_YN /*자사상품여부*/
|
|
|
|
|
+ , TT.FOREIGN_BUY_YN /*해외구매대행여부*/
|
|
|
|
|
+ , TT.PARALLEL_IMPORT_YN /*병행수입여부*/
|
|
|
|
|
+ , TT.ORDER_MADE_YN /*주문제작여부*/
|
|
|
|
|
+ , TT.GOODS_TNM /*상품타이틀명*/
|
|
|
|
|
+ , TT.MAIN_COLOR_CD /*대표색상코드*/
|
|
|
|
|
+ , TT.LIST_PRICE /*정상가(최초판매가)*/
|
|
|
|
|
+ , TT.CURR_PRICE /*현재판매가*/
|
|
|
|
|
+ , TT.REG_DT /*등록일시*/
|
|
|
|
|
+ , TT.UPD_DT
|
|
|
|
|
+ , TT.SYS_IMG_NM
|
|
|
|
|
+ , TT.SYS_IMG_NM2
|
|
|
|
|
+ , TT.VIDEOS
|
|
|
|
|
+ <choose>
|
|
|
|
|
+ <when test="contentsLoc == 'SMM009' or contentsLoc == 'SMM007' or contentsLoc == 'SMM012'">
|
|
|
|
|
+ , CT.DISP_ORD
|
|
|
|
|
+ </when>
|
|
|
|
|
+ <when test="contentsLoc == 'SMM003' or contentsLoc == 'SBM007' or contentsLoc == 'SBM008' or contentsLoc == 'SBM009' or contentsLoc == 'SBM017' or contentsLoc == 'SBM018' or contentsLoc == 'SBM019' or contentsLoc == 'SOM003' or contentsLoc == 'SCM002' or contentsLoc == 'SCM003' or contentsLoc == 'SOM002'">
|
|
|
|
|
+ , CTG.DISP_ORD
|
|
|
|
|
+ </when>
|
|
|
|
|
+ <otherwise>
|
|
|
|
|
+ , CG.DISP_ORD
|
|
|
|
|
+ </otherwise>
|
|
|
|
|
+ </choose>
|
|
|
|
|
+ <if test="contentsLoc == 'SCM003' and pageGb != null and pageGb == 'BEST'">
|
|
|
|
|
+ , GS.SELL_WEEK_QTY
|
|
|
|
|
+ , CT.CATE_NO AS CATE1_NO
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <choose>
|
|
|
|
|
+ <when test="contentsLoc == 'SMM009' or contentsLoc == 'SMM007' or contentsLoc == 'SMM012' or contentsLoc == 'SMM003' or contentsLoc == 'SBM007' or contentsLoc == 'SBM008' or contentsLoc == 'SBM009' or contentsLoc == 'SBM017' or contentsLoc == 'SBM018' or contentsLoc == 'SBM019' or contentsLoc == 'SOM003' or contentsLoc == 'SCM002' or contentsLoc == 'SCM003' or contentsLoc == 'SOM002'"> <!-- md추천 -->
|
|
|
|
|
+ FROM TB_CONTENTS CT
|
|
|
|
|
+ , TB_CONTENTS_GOODS CTG
|
|
|
|
|
+ , TB_CONTENTS_GOODS_MAIN TT
|
|
|
|
|
+
|
|
|
|
|
+ <if test="contentsLoc == 'SCM003' and pageGb != null and pageGb == 'BEST'">
|
|
|
|
|
+ , TB_GOODS_SUMMARY GS
|
|
|
|
|
+ </if>
|
|
|
|
|
+ WHERE 1=1
|
|
|
|
|
+ AND CT.CONTENTS_LOC = CTG.CONTENTS_LOC
|
|
|
|
|
+ AND CT.DISP_ORD = CTG.CONTENTS_SQ
|
|
|
|
|
+ <if test="contentsLoc == 'SCM003' or contentsLoc == 'SCM002'">
|
|
|
|
|
+ AND CT.CATE_NO = CTG.CATE_NO
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="contentsLoc == 'SCM003' and pageGb != null and pageGb == 'BEST'"> <!-- 베스트 -->
|
|
|
|
|
+ AND CTG.GOODS_CD = GS.GOODS_CD
|
|
|
|
|
+ </if>
|
|
|
|
|
+ AND CTG.GOODS_CD = TT.GOODS_CD
|
|
|
|
|
+ -- AND CTG.GOODS_CD = S.GOODS_CD
|
|
|
|
|
+ -- AND G.BRAND_CD = B.BRAND_CD
|
|
|
|
|
+ -- AND B.BRAND_GROUP_NO = BG.BRAND_GROUP_NO
|
|
|
|
|
+ AND CT.CONTENTS_LOC = #{contentsLoc}
|
|
|
|
|
+ <if test="contentsLoc == 'SMM009' or contentsLoc == 'SMM012'">
|
|
|
|
|
+ AND CTG.CONTENTS_SQ = #{dispOrd}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="contentsLoc == 'SMM007'">
|
|
|
|
|
+ AND CT.BRAND_GROUP_NO = #{brandGroupNo}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="contentsLoc == 'SMM003' or contentsLoc == 'SBM007' or contentsLoc == 'SBM008' or contentsLoc == 'SBM009' or contentsLoc == 'SBM017' or contentsLoc == 'SBM018' or contentsLoc == 'SBM019' or contentsLoc == 'SOM003' or contentsLoc == 'SCM002' or contentsLoc == 'SCM003' or contentsLoc == 'SOM002'">
|
|
|
|
|
+ <if test="brandGroupNo != null and brandGroupNo != ''">
|
|
|
|
|
+ AND CTG.BRAND_GROUP_NO = #{brandGroupNo}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ AND CT.CONTENTS_SQ IN ( SELECT TMP.CONTENTS_SQ FROM (SELECT A.CONTENTS_SQ FROM TB_CONTENTS A WHERE 1=1 AND A.CONTENTS_LOC = #{contentsLoc} AND NOW() BETWEEN A.DISP_STDT AND A.DISP_EDDT
|
|
|
|
|
+ <if test="brandGroupNo != null and brandGroupNo != ''">
|
|
|
|
|
+ AND A.BRAND_GROUP_NO = #{brandGroupNo}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="contentsLoc=='SCM003'">
|
|
|
|
|
+ <if test="cateNo != null and cateNo != ''">
|
|
|
|
|
+ AND A.CATE_NO = #{cateNo}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="contentsLoc=='SCM002'">
|
|
|
|
|
+ <if test="cate1No != null and cate1No != ''">
|
|
|
|
|
+ AND A.CATE_NO = #{cate1No}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="pageGb != null and pageGb == 'BEST'">
|
|
|
|
|
+ <if test="cate1No != null and cate1No != ''">
|
|
|
|
|
+ AND A.CATE_NO = #{cate1No}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ </if>
|
|
|
|
|
+ AND A.USE_YN = 'Y' ORDER BY A.DISP_ORD
|
|
|
|
|
+ LIMIT 1
|
|
|
|
|
+ ) AS TMP
|
|
|
|
|
+ )
|
|
|
|
|
+ </if>
|
|
|
|
|
+ AND NOW() BETWEEN CT.DISP_STDT AND CT.DISP_EDDT
|
|
|
|
|
+ </when>
|
|
|
|
|
+ <otherwise>
|
|
|
|
|
+ FROM TB_CATE_4SRCH C4
|
|
|
|
|
+ , TB_CATE_GOODS CG
|
|
|
|
|
+ , TB_CONTENTS_GOODS_MAIN TT
|
|
|
|
|
+
|
|
|
|
|
+ <if test="contentsLoc == 'SCM003'"> <!-- 베스트 -->
|
|
|
|
|
+ , TB_GOODS_SUMMARY GS
|
|
|
|
|
+ </if>
|
|
|
|
|
+ WHERE C4.LEAF_CATE_NO = CG.CATE_NO
|
|
|
|
|
+ <choose>
|
|
|
|
|
+ <when test="brandGroupNo != null and brandGroupNo != ''">
|
|
|
|
|
+ AND CG.BRAND_GROUP_NO = #{brandGroupNo}
|
|
|
|
|
+ </when>
|
|
|
|
|
+ <otherwise>
|
|
|
|
|
+ AND CG.BRAND_GROUP_NO = 0 /*브랜드메인에서 접근한 것이 아니면*/
|
|
|
|
|
+ </otherwise>
|
|
|
|
|
+ </choose>
|
|
|
|
|
+ AND CG.GOODS_CD = TT.GOODS_CD
|
|
|
|
|
+
|
|
|
|
|
+ <if test="contentsLoc == 'SCM003'"> <!-- 베스트 -->
|
|
|
|
|
+ AND CG.GOODS_CD = GS.GOODS_CD
|
|
|
|
|
+ </if>
|
|
|
|
|
+ AND C4.SITE_CD = #{siteCd}
|
|
|
|
|
+ AND C4.CATE_GB = #{cateGb}
|
|
|
|
|
+ AND C4.CATE_TYPE = 'G031_20' /*컨텐츠카테고리*/
|
|
|
|
|
+ <choose>
|
|
|
|
|
+ <when test="pageGb != null and pageGb == 'BEST'">
|
|
|
|
|
+ <if test="cate1No != null and cate1No != ''">
|
|
|
|
|
+ AND C4.CATE1_NO = #{cate1No}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ </when>
|
|
|
|
|
+ <otherwise>
|
|
|
|
|
+ AND C4.CATE1_NO = #{cate1No}
|
|
|
|
|
+ </otherwise>
|
|
|
|
|
+ </choose>
|
|
|
|
|
+ AND C4.CONTENTS_LOC = #{contentsLoc}
|
|
|
|
|
+ </otherwise>
|
|
|
|
|
+ </choose>
|
|
|
|
|
+
|
|
|
|
|
+ <if test="pageGb != null and pageGb == 'BEST'">
|
|
|
|
|
+ ORDER BY CT.CATE_NO
|
|
|
|
|
+ LIMIT 100
|
|
|
|
|
+ </if>
|
|
|
|
|
+ ) G
|
|
|
|
|
+ <if test="custNo != null and custNo > 0"> <!-- 로그인 했으면 -->
|
|
|
|
|
+ LEFT OUTER JOIN TB_WISHLIST W ON G.GOODS_CD = W.GOODS_CD
|
|
|
|
|
+ AND W.CUST_NO = #{custNo}
|
|
|
|
|
+ </if>
|
|
|
|
|
+
|
|
|
|
|
+ WHERE 1=1
|
|
|
|
|
+ <choose>
|
|
|
|
|
+ <when test="contentsLoc == 'SCM013'"><!-- 베스트 -->
|
|
|
|
|
+ ORDER BY G.SELL_WEEK_QTY DESC , G.GOODS_CD
|
|
|
|
|
+ </when>
|
|
|
|
|
+ <when test="contentsLoc == 'SMM009' or contentsLoc == 'SMM007' or contentsLoc == 'SMM012'"> <!-- md추천 -->
|
|
|
|
|
+ </when>
|
|
|
|
|
+ <when test="contentsLoc == 'SCM002' or (contentsLoc == 'SCM003' and pageGb == null)"> <!-- md추천 -->
|
|
|
|
|
+ ORDER BY G.DISP_ORD ,G.UPD_DT DESC, G.CURR_PRICE DESC, G.GOODS_CD ASC
|
|
|
|
|
+ </when>
|
|
|
|
|
+ <when test="contentsLoc == 'SCM003' and pageGb != null and pageGb == 'BEST'">
|
|
|
|
|
+ ORDER BY G.CATE1_NO, G.DISP_ORD ,G.UPD_DT DESC, G.CURR_PRICE DESC, G.GOODS_CD ASC
|
|
|
|
|
+ </when>
|
|
|
|
|
+ <otherwise>
|
|
|
|
|
+ ORDER BY G.DISP_ORD , G.REG_DT DESC , G.GOODS_CD
|
|
|
|
|
+ </otherwise>
|
|
|
|
|
+ </choose>
|
|
|
|
|
+ <if test="pageable != null and pageable.endRow != null and pageable.endRow > 0">
|
|
|
|
|
+ LIMIT #{pageable.limitStartRow} , #{pageable.pageSize}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="maxRow != null and maxRow !=''">
|
|
|
|
|
+ LIMIT #{maxRow}
|
|
|
|
|
+ </if>
|
|
|
|
|
+
|
|
|
|
|
+ </select>
|
|
|
|
|
|
|
|
<!-- 컨텐츠카테고리상품 건수 -->
|
|
<!-- 컨텐츠카테고리상품 건수 -->
|
|
|
<select id="getContentsCategoryGoodsCount" parameterType="Cate4Srch" resultType="int">
|
|
<select id="getContentsCategoryGoodsCount" parameterType="Cate4Srch" resultType="int">
|
|
@@ -3833,445 +4039,5 @@
|
|
|
AND OPT_CD1 <![CDATA[<>]]> #{colorCd}
|
|
AND OPT_CD1 <![CDATA[<>]]> #{colorCd}
|
|
|
AND PRODUCT_NO IS NOT NULL
|
|
AND PRODUCT_NO IS NOT NULL
|
|
|
</select>
|
|
</select>
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
- <!-- 컨텐츠카테고리상품 목록 (JMH 이선미매니저 테스트 요청) -->
|
|
|
|
|
- <select id="getContentsCategoryGoodsList_TEST_old" parameterType="Cate4Srch" resultType="Goods">
|
|
|
|
|
- /* TsfGoods.getContentsCategoryGoodsList_TEST_old */
|
|
|
|
|
- WITH TAB_GOODS AS (
|
|
|
|
|
- SELECT
|
|
|
|
|
- <if test="contentsLoc == 'SMM003' or contentsLoc == 'SBM007' or contentsLoc == 'SBM008' or contentsLoc == 'SBM009' or contentsLoc == 'SBM017' or contentsLoc == 'SBM018' or contentsLoc == 'SBM019' or contentsLoc == 'SOM003' or contentsLoc == 'SOM002'">
|
|
|
|
|
- DISTINCT
|
|
|
|
|
- </if>
|
|
|
|
|
- G.BRAND_GROUP_NM /*브랜드그룹명*/
|
|
|
|
|
- , G.GOODS_CD /*상품코드*/
|
|
|
|
|
- , G.GOODS_NM /*상품명*/
|
|
|
|
|
- , G.GOODS_GB /*상품구분*/
|
|
|
|
|
- , G.SELF_GOODS_YN /*자사상품여부*/
|
|
|
|
|
- , G.FOREIGN_BUY_YN /*해외구매대행여부*/
|
|
|
|
|
- , G.PARALLEL_IMPORT_YN /*병행수입여부*/
|
|
|
|
|
- , G.ORDER_MADE_YN /*주문제작여부*/
|
|
|
|
|
- , G.GOODS_TNM /*상품타이틀명*/
|
|
|
|
|
- , G.MAIN_COLOR_CD /*대표색상코드*/
|
|
|
|
|
- , G.LIST_PRICE /*정상가(최초판매가)*/
|
|
|
|
|
- , G.CURR_PRICE /*현재판매가*/
|
|
|
|
|
- , G.REG_DT /*등록일시*/
|
|
|
|
|
- , G.DISP_ORD
|
|
|
|
|
- <if test="contentsLoc == 'SCM003' and pageGb != null and pageGb == 'BEST'">
|
|
|
|
|
- , G.SELL_WEEK_QTY
|
|
|
|
|
- </if>
|
|
|
|
|
- FROM (
|
|
|
|
|
- SELECT
|
|
|
|
|
- <if test="contentsLoc == 'SCM003' and pageGb != null and pageGb == 'BEST'">
|
|
|
|
|
- DISTINCT
|
|
|
|
|
- </if>
|
|
|
|
|
- TT.BRAND_GROUP_NM /*브랜드그룹명*/
|
|
|
|
|
- , TT.GOODS_CD /*상품코드*/
|
|
|
|
|
- , TT.GOODS_NM /*상품명*/
|
|
|
|
|
- , TT.GOODS_GB /*상품구분*/
|
|
|
|
|
- , TT.SELF_GOODS_YN /*자사상품여부*/
|
|
|
|
|
- , TT.FOREIGN_BUY_YN /*해외구매대행여부*/
|
|
|
|
|
- , TT.PARALLEL_IMPORT_YN /*병행수입여부*/
|
|
|
|
|
- , TT.ORDER_MADE_YN /*주문제작여부*/
|
|
|
|
|
- , TT.GOODS_TNM /*상품타이틀명*/
|
|
|
|
|
- , TT.MAIN_COLOR_CD /*대표색상코드*/
|
|
|
|
|
- , TT.LIST_PRICE /*정상가(최초판매가)*/
|
|
|
|
|
- , TT.CURR_PRICE /*현재판매가*/
|
|
|
|
|
- , TT.REG_DT /*등록일시*/
|
|
|
|
|
- , TT.UPD_DT
|
|
|
|
|
- <choose>
|
|
|
|
|
- <when test="contentsLoc == 'SMM009' or contentsLoc == 'SMM007' or contentsLoc == 'SMM012'">
|
|
|
|
|
- , CT.DISP_ORD
|
|
|
|
|
- </when>
|
|
|
|
|
- <when test="contentsLoc == 'SMM003' or contentsLoc == 'SBM007' or contentsLoc == 'SBM008' or contentsLoc == 'SBM009' or contentsLoc == 'SBM017' or contentsLoc == 'SBM018' or contentsLoc == 'SBM019' or contentsLoc == 'SOM003' or contentsLoc == 'SCM002' or contentsLoc == 'SCM003' or contentsLoc == 'SOM002'">
|
|
|
|
|
- , CTG.DISP_ORD
|
|
|
|
|
- </when>
|
|
|
|
|
- <otherwise>
|
|
|
|
|
- , CG.DISP_ORD
|
|
|
|
|
- </otherwise>
|
|
|
|
|
- </choose>
|
|
|
|
|
- <if test="contentsLoc == 'SCM003' and pageGb != null and pageGb == 'BEST'">
|
|
|
|
|
- , GS.SELL_WEEK_QTY
|
|
|
|
|
- , CT.CATE_NO AS CATE1_NO
|
|
|
|
|
- </if>
|
|
|
|
|
- <choose>
|
|
|
|
|
- <when test="contentsLoc == 'SMM009' or contentsLoc == 'SMM007' or contentsLoc == 'SMM012' or contentsLoc == 'SMM003' or contentsLoc == 'SBM007' or contentsLoc == 'SBM008' or contentsLoc == 'SBM009' or contentsLoc == 'SBM017' or contentsLoc == 'SBM018' or contentsLoc == 'SBM019' or contentsLoc == 'SOM003' or contentsLoc == 'SCM002' or contentsLoc == 'SCM003' or contentsLoc == 'SOM002'"> <!-- md추천 -->
|
|
|
|
|
- FROM TB_CONTENTS CT
|
|
|
|
|
- , TB_CONTENTS_GOODS CTG
|
|
|
|
|
- , TB_CONTENTS_GOODS_MAIN TT
|
|
|
|
|
- , TB_GOODS_STOCK S
|
|
|
|
|
-
|
|
|
|
|
- <if test="contentsLoc == 'SCM003' and pageGb != null and pageGb == 'BEST'">
|
|
|
|
|
- , TB_GOODS_SUMMARY GS
|
|
|
|
|
- </if>
|
|
|
|
|
- WHERE 1=1
|
|
|
|
|
- AND CT.CONTENTS_LOC = CTG.CONTENTS_LOC
|
|
|
|
|
- AND CT.DISP_ORD = CTG.CONTENTS_SQ
|
|
|
|
|
- <if test="contentsLoc == 'SCM003' or contentsLoc == 'SCM002'">
|
|
|
|
|
- AND CT.CATE_NO = CTG.CATE_NO
|
|
|
|
|
- </if>
|
|
|
|
|
- <if test="contentsLoc == 'SCM003' and pageGb != null and pageGb == 'BEST'"> <!-- 베스트 -->
|
|
|
|
|
- AND CTG.GOODS_CD = GS.GOODS_CD
|
|
|
|
|
- </if>
|
|
|
|
|
- AND CTG.GOODS_CD = TT.GOODS_CD
|
|
|
|
|
- AND CTG.GOODS_CD = S.GOODS_CD
|
|
|
|
|
- -- AND G.BRAND_CD = B.BRAND_CD
|
|
|
|
|
- -- AND B.BRAND_GROUP_NO = BG.BRAND_GROUP_NO
|
|
|
|
|
- AND CT.CONTENTS_LOC = #{contentsLoc}
|
|
|
|
|
- <if test="contentsLoc == 'SMM009' or contentsLoc == 'SMM012'">
|
|
|
|
|
- AND CTG.CONTENTS_SQ = #{dispOrd}
|
|
|
|
|
- </if>
|
|
|
|
|
- <if test="contentsLoc == 'SMM007'">
|
|
|
|
|
- AND CT.BRAND_GROUP_NO = #{brandGroupNo}
|
|
|
|
|
- </if>
|
|
|
|
|
- <if test="contentsLoc == 'SMM003' or contentsLoc == 'SBM007' or contentsLoc == 'SBM008' or contentsLoc == 'SBM009' or contentsLoc == 'SBM017' or contentsLoc == 'SBM018' or contentsLoc == 'SBM019' or contentsLoc == 'SOM003' or contentsLoc == 'SCM002' or contentsLoc == 'SCM003' or contentsLoc == 'SOM002'">
|
|
|
|
|
- <if test="brandGroupNo != null and brandGroupNo != ''">
|
|
|
|
|
- AND CTG.BRAND_GROUP_NO = #{brandGroupNo}
|
|
|
|
|
- </if>
|
|
|
|
|
- AND CT.CONTENTS_SQ IN ( SELECT TMP.CONTENTS_SQ FROM (SELECT A.CONTENTS_SQ FROM TB_CONTENTS A WHERE 1=1 AND A.CONTENTS_LOC = #{contentsLoc} AND NOW() BETWEEN A.DISP_STDT AND A.DISP_EDDT
|
|
|
|
|
- <if test="brandGroupNo != null and brandGroupNo != ''">
|
|
|
|
|
- AND A.BRAND_GROUP_NO = #{brandGroupNo}
|
|
|
|
|
- </if>
|
|
|
|
|
- <if test="contentsLoc=='SCM003'">
|
|
|
|
|
- <if test="cateNo != null and cateNo != ''">
|
|
|
|
|
- AND A.CATE_NO = #{cateNo}
|
|
|
|
|
- </if>
|
|
|
|
|
- </if>
|
|
|
|
|
- <if test="contentsLoc=='SCM002'">
|
|
|
|
|
- <if test="cate1No != null and cate1No != ''">
|
|
|
|
|
- AND A.CATE_NO = #{cate1No}
|
|
|
|
|
- </if>
|
|
|
|
|
- </if>
|
|
|
|
|
- <if test="pageGb != null and pageGb == 'BEST'">
|
|
|
|
|
- <if test="cate1No != null and cate1No != ''">
|
|
|
|
|
- AND A.CATE_NO = #{cate1No}
|
|
|
|
|
- </if>
|
|
|
|
|
- </if>
|
|
|
|
|
- AND A.USE_YN = 'Y' ORDER BY A.DISP_ORD
|
|
|
|
|
- LIMIT 1
|
|
|
|
|
- ) AS TMP
|
|
|
|
|
- )
|
|
|
|
|
- </if>
|
|
|
|
|
- AND NOW() BETWEEN CT.DISP_STDT AND CT.DISP_EDDT
|
|
|
|
|
- </when>
|
|
|
|
|
- <otherwise>
|
|
|
|
|
- FROM TB_CATE_4SRCH C4
|
|
|
|
|
- , TB_CATE_GOODS CG
|
|
|
|
|
- , TB_CONTENTS_GOODS_MAIN TT
|
|
|
|
|
- , TB_GOODS_STOCK S
|
|
|
|
|
-
|
|
|
|
|
- <if test="contentsLoc == 'SCM003'"> <!-- 베스트 -->
|
|
|
|
|
- , TB_GOODS_SUMMARY GS
|
|
|
|
|
- </if>
|
|
|
|
|
- WHERE C4.LEAF_CATE_NO = CG.CATE_NO
|
|
|
|
|
- <choose>
|
|
|
|
|
- <when test="brandGroupNo != null and brandGroupNo != ''">
|
|
|
|
|
- AND CG.BRAND_GROUP_NO = #{brandGroupNo}
|
|
|
|
|
- </when>
|
|
|
|
|
- <otherwise>
|
|
|
|
|
- AND CG.BRAND_GROUP_NO = 0 /*브랜드메인에서 접근한 것이 아니면*/
|
|
|
|
|
- </otherwise>
|
|
|
|
|
- </choose>
|
|
|
|
|
- AND CG.GOODS_CD = TT.GOODS_CD
|
|
|
|
|
- AND CG.GOODS_CD = S.GOODS_CD
|
|
|
|
|
-
|
|
|
|
|
- <if test="contentsLoc == 'SCM003'"> <!-- 베스트 -->
|
|
|
|
|
- AND CG.GOODS_CD = GS.GOODS_CD
|
|
|
|
|
- </if>
|
|
|
|
|
- AND C4.SITE_CD = #{siteCd}
|
|
|
|
|
- AND C4.CATE_GB = #{cateGb}
|
|
|
|
|
- AND C4.CATE_TYPE = 'G031_20' /*컨텐츠카테고리*/
|
|
|
|
|
- <choose>
|
|
|
|
|
- <when test="pageGb != null and pageGb == 'BEST'">
|
|
|
|
|
- <if test="cate1No != null and cate1No != ''">
|
|
|
|
|
- AND C4.CATE1_NO = #{cate1No}
|
|
|
|
|
- </if>
|
|
|
|
|
- </when>
|
|
|
|
|
- <otherwise>
|
|
|
|
|
- AND C4.CATE1_NO = #{cate1No}
|
|
|
|
|
- </otherwise>
|
|
|
|
|
- </choose>
|
|
|
|
|
- AND C4.CONTENTS_LOC = #{contentsLoc}
|
|
|
|
|
- </otherwise>
|
|
|
|
|
- </choose>
|
|
|
|
|
- -- AND G.GOODS_STAT = 'G008_90' /*승인완료상품*/
|
|
|
|
|
- -- AND G.SELF_MALL_YN = 'Y' /*몰노출상품*/
|
|
|
|
|
- -- AND NOW() BETWEEN G.SELL_STDT AND G.SELL_EDDT /*판매기간*/
|
|
|
|
|
- AND S.STOCK_QTY <![CDATA[>]]> 0 /*재고있는상품*/
|
|
|
|
|
- -- AND B.USE_YN = 'Y'
|
|
|
|
|
- -- AND BG.USE_YN = 'Y'
|
|
|
|
|
- <if test="pageGb != null and pageGb == 'BEST'">
|
|
|
|
|
- ORDER BY CT.CATE_NO
|
|
|
|
|
- LIMIT 100
|
|
|
|
|
- </if>
|
|
|
|
|
- ) G
|
|
|
|
|
- WHERE 1=1
|
|
|
|
|
- <choose>
|
|
|
|
|
- <when test="contentsLoc == 'SCM013'"><!-- 베스트 -->
|
|
|
|
|
- ORDER BY G.SELL_WEEK_QTY DESC , G.GOODS_CD
|
|
|
|
|
- </when>
|
|
|
|
|
- <when test="contentsLoc == 'SMM009' or contentsLoc == 'SMM007' or contentsLoc == 'SMM012'"> <!-- md추천 -->
|
|
|
|
|
- </when>
|
|
|
|
|
- <when test="contentsLoc == 'SCM002' or (contentsLoc == 'SCM003' and pageGb == null)"> <!-- md추천 -->
|
|
|
|
|
- ORDER BY G.DISP_ORD ,G.UPD_DT DESC, G.CURR_PRICE DESC, G.GOODS_CD ASC
|
|
|
|
|
- </when>
|
|
|
|
|
- <when test="contentsLoc == 'SCM003' and pageGb != null and pageGb == 'BEST'">
|
|
|
|
|
- ORDER BY G.CATE1_NO, G.DISP_ORD ,G.UPD_DT DESC, G.CURR_PRICE DESC, G.GOODS_CD ASC
|
|
|
|
|
- </when>
|
|
|
|
|
- <otherwise>
|
|
|
|
|
- ORDER BY G.DISP_ORD , G.REG_DT DESC , G.GOODS_CD
|
|
|
|
|
- </otherwise>
|
|
|
|
|
- </choose>
|
|
|
|
|
- <if test="pageable != null and pageable.endRow != null and pageable.endRow > 0">
|
|
|
|
|
- LIMIT #{pageable.limitStartRow} , #{pageable.pageSize}
|
|
|
|
|
- </if>
|
|
|
|
|
- <if test="maxRow != null and maxRow !=''">
|
|
|
|
|
- LIMIT #{maxRow}
|
|
|
|
|
- </if>
|
|
|
|
|
- )
|
|
|
|
|
- SELECT G.BRAND_GROUP_NM
|
|
|
|
|
- , G.GOODS_CD
|
|
|
|
|
- , FN_GET_GOODS_NM(G.GOODS_NM,G.GOODS_GB,G.FOREIGN_BUY_YN,G.PARALLEL_IMPORT_YN,G.ORDER_MADE_YN) AS GOODS_FULL_NM /*상품FULL명*/
|
|
|
|
|
- , G.GOODS_TNM
|
|
|
|
|
- , G.MAIN_COLOR_CD
|
|
|
|
|
- , G.LIST_PRICE
|
|
|
|
|
- , FN_GET_BENEFIT_PRICE(#{frontGb},G.GOODS_CD,G.CURR_PRICE,#{custGb}) AS CURR_PRICE /*현재판매가*/
|
|
|
|
|
- , (SELECT SYS_IMG_NM FROM TB_GOODS_IMG X WHERE X.GOODS_CD = G.GOODS_CD AND IF(G.SELF_GOODS_YN= 'N', 'XX', G.MAIN_COLOR_CD) = X.COLOR_CD AND DEFAULT_IMG_YN = 'Y' LIMIT 1) AS SYS_IMG_NM
|
|
|
|
|
- , (SELECT SYS_IMG_NM FROM TB_GOODS_IMG X WHERE X.GOODS_CD = G.GOODS_CD AND IF(G.SELF_GOODS_YN= 'N', 'XX', G.MAIN_COLOR_CD) = X.COLOR_CD AND MOUSEOVER_IMG_YN = 'Y' LIMIT 1) AS SYS_IMG_NM2
|
|
|
|
|
- , (
|
|
|
|
|
- SELECT GROUP_CONCAT(CONCAT(VIDEO_GB,':',KMC_KEY) ORDER BY NUMB SEPARATOR ',')
|
|
|
|
|
- FROM (
|
|
|
|
|
- SELECT GV.VIDEO_GB
|
|
|
|
|
- , GV.KMC_KEY
|
|
|
|
|
- , GV.REG_DT
|
|
|
|
|
- , RANK() OVER(ORDER BY GV.REG_DT, GV.KMC_KEY) AS NUMB
|
|
|
|
|
- FROM TB_GOODS_VIDEO GV
|
|
|
|
|
- WHERE GV.GOODS_CD = G.GOODS_CD
|
|
|
|
|
- AND GV.DISP_YN = 'Y'
|
|
|
|
|
- AND GV.KMC_KEY IS NOT NULL
|
|
|
|
|
- ) Z
|
|
|
|
|
- WHERE NUMB <![CDATA[<=]]> 2
|
|
|
|
|
- ) AS VIDEOS
|
|
|
|
|
-
|
|
|
|
|
- <choose>
|
|
|
|
|
- <when test="custNo != null and custNo > 0"> <!-- 로그인 했으면 -->
|
|
|
|
|
- , IF(W.GOODS_CD IS NULL,'','likeit') AS LIKE_IT /*위시리스트담긴상품*/
|
|
|
|
|
- </when>
|
|
|
|
|
- <otherwise>
|
|
|
|
|
- , '' AS LIKE_IT /*위시리스트담긴상품*/
|
|
|
|
|
- </otherwise>
|
|
|
|
|
- </choose>
|
|
|
|
|
- FROM TAB_GOODS G
|
|
|
|
|
- <if test="custNo != null and custNo > 0"> <!-- 로그인 했으면 -->
|
|
|
|
|
- LEFT OUTER JOIN TB_WISHLIST W ON G.GOODS_CD = W.GOODS_CD
|
|
|
|
|
- AND W.CUST_NO = #{custNo}
|
|
|
|
|
- </if>
|
|
|
|
|
- </select>
|
|
|
|
|
-
|
|
|
|
|
- <!-- 컨텐츠카테고리상품 목록 (JMH 이선미매니저 테스트 요청) -->
|
|
|
|
|
- <select id="getContentsCategoryGoodsList_TEST" parameterType="Cate4Srch" resultType="Goods">
|
|
|
|
|
- /* TsfGoods.getContentsCategoryGoodsList_TEST2 */
|
|
|
|
|
- SELECT
|
|
|
|
|
- <if test="contentsLoc == 'SMM003' or contentsLoc == 'SBM007' or contentsLoc == 'SBM008' or contentsLoc == 'SBM009' or contentsLoc == 'SBM017' or contentsLoc == 'SBM018' or contentsLoc == 'SBM019' or contentsLoc == 'SOM003' or contentsLoc == 'SOM002'">
|
|
|
|
|
- DISTINCT
|
|
|
|
|
- </if>
|
|
|
|
|
- G.BRAND_GROUP_NM /*브랜드그룹명*/
|
|
|
|
|
- , G.GOODS_CD /*상품코드*/
|
|
|
|
|
- , G.GOODS_NM /*상품명*/
|
|
|
|
|
- , G.GOODS_GB /*상품구분*/
|
|
|
|
|
- , G.SELF_GOODS_YN /*자사상품여부*/
|
|
|
|
|
- , G.FOREIGN_BUY_YN /*해외구매대행여부*/
|
|
|
|
|
- , G.PARALLEL_IMPORT_YN /*병행수입여부*/
|
|
|
|
|
- , G.ORDER_MADE_YN /*주문제작여부*/
|
|
|
|
|
- , G.GOODS_TNM /*상품타이틀명*/
|
|
|
|
|
- , G.MAIN_COLOR_CD /*대표색상코드*/
|
|
|
|
|
- , G.LIST_PRICE /*정상가(최초판매가)*/
|
|
|
|
|
- , FN_GET_BENEFIT_PRICE(#{frontGb},G.GOODS_CD,G.CURR_PRICE,#{custGb}) AS CURR_PRICE /*현재판매가*/
|
|
|
|
|
- , G.REG_DT /*등록일시*/
|
|
|
|
|
- , G.DISP_ORD
|
|
|
|
|
- , G.SYS_IMG_NM
|
|
|
|
|
- , G.SYS_IMG_NM2
|
|
|
|
|
- , G.VIDEOS
|
|
|
|
|
- <if test="contentsLoc == 'SCM003' and pageGb != null and pageGb == 'BEST'">
|
|
|
|
|
- , G.SELL_WEEK_QTY
|
|
|
|
|
- </if>
|
|
|
|
|
- <choose>
|
|
|
|
|
- <when test="custNo != null and custNo > 0"> <!-- 로그인 했으면 -->
|
|
|
|
|
- , IF(W.GOODS_CD IS NULL,'','likeit') AS LIKE_IT /*위시리스트담긴상품*/
|
|
|
|
|
- </when>
|
|
|
|
|
- <otherwise>
|
|
|
|
|
- , '' AS LIKE_IT /*위시리스트담긴상품*/
|
|
|
|
|
- </otherwise>
|
|
|
|
|
- </choose>
|
|
|
|
|
- FROM (
|
|
|
|
|
- SELECT
|
|
|
|
|
- <if test="contentsLoc == 'SCM003' and pageGb != null and pageGb == 'BEST'">
|
|
|
|
|
- DISTINCT
|
|
|
|
|
- </if>
|
|
|
|
|
- TT.BRAND_GROUP_NM /*브랜드그룹명*/
|
|
|
|
|
- , TT.GOODS_CD /*상품코드*/
|
|
|
|
|
- , TT.GOODS_NM /*상품명*/
|
|
|
|
|
- , TT.GOODS_GB /*상품구분*/
|
|
|
|
|
- , TT.SELF_GOODS_YN /*자사상품여부*/
|
|
|
|
|
- , TT.FOREIGN_BUY_YN /*해외구매대행여부*/
|
|
|
|
|
- , TT.PARALLEL_IMPORT_YN /*병행수입여부*/
|
|
|
|
|
- , TT.ORDER_MADE_YN /*주문제작여부*/
|
|
|
|
|
- , TT.GOODS_TNM /*상품타이틀명*/
|
|
|
|
|
- , TT.MAIN_COLOR_CD /*대표색상코드*/
|
|
|
|
|
- , TT.LIST_PRICE /*정상가(최초판매가)*/
|
|
|
|
|
- , TT.CURR_PRICE /*현재판매가*/
|
|
|
|
|
- , TT.REG_DT /*등록일시*/
|
|
|
|
|
- , TT.UPD_DT
|
|
|
|
|
- , TT.SYS_IMG_NM
|
|
|
|
|
- , TT.SYS_IMG_NM2
|
|
|
|
|
- , TT.VIDEOS
|
|
|
|
|
- <choose>
|
|
|
|
|
- <when test="contentsLoc == 'SMM009' or contentsLoc == 'SMM007' or contentsLoc == 'SMM012'">
|
|
|
|
|
- , CT.DISP_ORD
|
|
|
|
|
- </when>
|
|
|
|
|
- <when test="contentsLoc == 'SMM003' or contentsLoc == 'SBM007' or contentsLoc == 'SBM008' or contentsLoc == 'SBM009' or contentsLoc == 'SBM017' or contentsLoc == 'SBM018' or contentsLoc == 'SBM019' or contentsLoc == 'SOM003' or contentsLoc == 'SCM002' or contentsLoc == 'SCM003' or contentsLoc == 'SOM002'">
|
|
|
|
|
- , CTG.DISP_ORD
|
|
|
|
|
- </when>
|
|
|
|
|
- <otherwise>
|
|
|
|
|
- , CG.DISP_ORD
|
|
|
|
|
- </otherwise>
|
|
|
|
|
- </choose>
|
|
|
|
|
- <if test="contentsLoc == 'SCM003' and pageGb != null and pageGb == 'BEST'">
|
|
|
|
|
- , GS.SELL_WEEK_QTY
|
|
|
|
|
- , CT.CATE_NO AS CATE1_NO
|
|
|
|
|
- </if>
|
|
|
|
|
- <choose>
|
|
|
|
|
- <when test="contentsLoc == 'SMM009' or contentsLoc == 'SMM007' or contentsLoc == 'SMM012' or contentsLoc == 'SMM003' or contentsLoc == 'SBM007' or contentsLoc == 'SBM008' or contentsLoc == 'SBM009' or contentsLoc == 'SBM017' or contentsLoc == 'SBM018' or contentsLoc == 'SBM019' or contentsLoc == 'SOM003' or contentsLoc == 'SCM002' or contentsLoc == 'SCM003' or contentsLoc == 'SOM002'"> <!-- md추천 -->
|
|
|
|
|
- FROM TB_CONTENTS CT
|
|
|
|
|
- , TB_CONTENTS_GOODS CTG
|
|
|
|
|
- , TB_CONTENTS_GOODS_MAIN TT
|
|
|
|
|
-
|
|
|
|
|
- <if test="contentsLoc == 'SCM003' and pageGb != null and pageGb == 'BEST'">
|
|
|
|
|
- , TB_GOODS_SUMMARY GS
|
|
|
|
|
- </if>
|
|
|
|
|
- WHERE 1=1
|
|
|
|
|
- AND CT.CONTENTS_LOC = CTG.CONTENTS_LOC
|
|
|
|
|
- AND CT.DISP_ORD = CTG.CONTENTS_SQ
|
|
|
|
|
- <if test="contentsLoc == 'SCM003' or contentsLoc == 'SCM002'">
|
|
|
|
|
- AND CT.CATE_NO = CTG.CATE_NO
|
|
|
|
|
- </if>
|
|
|
|
|
- <if test="contentsLoc == 'SCM003' and pageGb != null and pageGb == 'BEST'"> <!-- 베스트 -->
|
|
|
|
|
- AND CTG.GOODS_CD = GS.GOODS_CD
|
|
|
|
|
- </if>
|
|
|
|
|
- AND CTG.GOODS_CD = TT.GOODS_CD
|
|
|
|
|
- -- AND CTG.GOODS_CD = S.GOODS_CD
|
|
|
|
|
- -- AND G.BRAND_CD = B.BRAND_CD
|
|
|
|
|
- -- AND B.BRAND_GROUP_NO = BG.BRAND_GROUP_NO
|
|
|
|
|
- AND CT.CONTENTS_LOC = #{contentsLoc}
|
|
|
|
|
- <if test="contentsLoc == 'SMM009' or contentsLoc == 'SMM012'">
|
|
|
|
|
- AND CTG.CONTENTS_SQ = #{dispOrd}
|
|
|
|
|
- </if>
|
|
|
|
|
- <if test="contentsLoc == 'SMM007'">
|
|
|
|
|
- AND CT.BRAND_GROUP_NO = #{brandGroupNo}
|
|
|
|
|
- </if>
|
|
|
|
|
- <if test="contentsLoc == 'SMM003' or contentsLoc == 'SBM007' or contentsLoc == 'SBM008' or contentsLoc == 'SBM009' or contentsLoc == 'SBM017' or contentsLoc == 'SBM018' or contentsLoc == 'SBM019' or contentsLoc == 'SOM003' or contentsLoc == 'SCM002' or contentsLoc == 'SCM003' or contentsLoc == 'SOM002'">
|
|
|
|
|
- <if test="brandGroupNo != null and brandGroupNo != ''">
|
|
|
|
|
- AND CTG.BRAND_GROUP_NO = #{brandGroupNo}
|
|
|
|
|
- </if>
|
|
|
|
|
- AND CT.CONTENTS_SQ IN ( SELECT TMP.CONTENTS_SQ FROM (SELECT A.CONTENTS_SQ FROM TB_CONTENTS A WHERE 1=1 AND A.CONTENTS_LOC = #{contentsLoc} AND NOW() BETWEEN A.DISP_STDT AND A.DISP_EDDT
|
|
|
|
|
- <if test="brandGroupNo != null and brandGroupNo != ''">
|
|
|
|
|
- AND A.BRAND_GROUP_NO = #{brandGroupNo}
|
|
|
|
|
- </if>
|
|
|
|
|
- <if test="contentsLoc=='SCM003'">
|
|
|
|
|
- <if test="cateNo != null and cateNo != ''">
|
|
|
|
|
- AND A.CATE_NO = #{cateNo}
|
|
|
|
|
- </if>
|
|
|
|
|
- </if>
|
|
|
|
|
- <if test="contentsLoc=='SCM002'">
|
|
|
|
|
- <if test="cate1No != null and cate1No != ''">
|
|
|
|
|
- AND A.CATE_NO = #{cate1No}
|
|
|
|
|
- </if>
|
|
|
|
|
- </if>
|
|
|
|
|
- <if test="pageGb != null and pageGb == 'BEST'">
|
|
|
|
|
- <if test="cate1No != null and cate1No != ''">
|
|
|
|
|
- AND A.CATE_NO = #{cate1No}
|
|
|
|
|
- </if>
|
|
|
|
|
- </if>
|
|
|
|
|
- AND A.USE_YN = 'Y' ORDER BY A.DISP_ORD
|
|
|
|
|
- LIMIT 1
|
|
|
|
|
- ) AS TMP
|
|
|
|
|
- )
|
|
|
|
|
- </if>
|
|
|
|
|
- AND NOW() BETWEEN CT.DISP_STDT AND CT.DISP_EDDT
|
|
|
|
|
- </when>
|
|
|
|
|
- <otherwise>
|
|
|
|
|
- FROM TB_CATE_4SRCH C4
|
|
|
|
|
- , TB_CATE_GOODS CG
|
|
|
|
|
- , TB_CONTENTS_GOODS_MAIN TT
|
|
|
|
|
-
|
|
|
|
|
- <if test="contentsLoc == 'SCM003'"> <!-- 베스트 -->
|
|
|
|
|
- , TB_GOODS_SUMMARY GS
|
|
|
|
|
- </if>
|
|
|
|
|
- WHERE C4.LEAF_CATE_NO = CG.CATE_NO
|
|
|
|
|
- <choose>
|
|
|
|
|
- <when test="brandGroupNo != null and brandGroupNo != ''">
|
|
|
|
|
- AND CG.BRAND_GROUP_NO = #{brandGroupNo}
|
|
|
|
|
- </when>
|
|
|
|
|
- <otherwise>
|
|
|
|
|
- AND CG.BRAND_GROUP_NO = 0 /*브랜드메인에서 접근한 것이 아니면*/
|
|
|
|
|
- </otherwise>
|
|
|
|
|
- </choose>
|
|
|
|
|
- AND CG.GOODS_CD = TT.GOODS_CD
|
|
|
|
|
-
|
|
|
|
|
- <if test="contentsLoc == 'SCM003'"> <!-- 베스트 -->
|
|
|
|
|
- AND CG.GOODS_CD = GS.GOODS_CD
|
|
|
|
|
- </if>
|
|
|
|
|
- AND C4.SITE_CD = #{siteCd}
|
|
|
|
|
- AND C4.CATE_GB = #{cateGb}
|
|
|
|
|
- AND C4.CATE_TYPE = 'G031_20' /*컨텐츠카테고리*/
|
|
|
|
|
- <choose>
|
|
|
|
|
- <when test="pageGb != null and pageGb == 'BEST'">
|
|
|
|
|
- <if test="cate1No != null and cate1No != ''">
|
|
|
|
|
- AND C4.CATE1_NO = #{cate1No}
|
|
|
|
|
- </if>
|
|
|
|
|
- </when>
|
|
|
|
|
- <otherwise>
|
|
|
|
|
- AND C4.CATE1_NO = #{cate1No}
|
|
|
|
|
- </otherwise>
|
|
|
|
|
- </choose>
|
|
|
|
|
- AND C4.CONTENTS_LOC = #{contentsLoc}
|
|
|
|
|
- </otherwise>
|
|
|
|
|
- </choose>
|
|
|
|
|
-
|
|
|
|
|
- <if test="pageGb != null and pageGb == 'BEST'">
|
|
|
|
|
- ORDER BY CT.CATE_NO
|
|
|
|
|
- LIMIT 100
|
|
|
|
|
- </if>
|
|
|
|
|
- ) G
|
|
|
|
|
- <if test="custNo != null and custNo > 0"> <!-- 로그인 했으면 -->
|
|
|
|
|
- LEFT OUTER JOIN TB_WISHLIST W ON G.GOODS_CD = W.GOODS_CD
|
|
|
|
|
- AND W.CUST_NO = #{custNo}
|
|
|
|
|
- </if>
|
|
|
|
|
-
|
|
|
|
|
- WHERE 1=1
|
|
|
|
|
- <choose>
|
|
|
|
|
- <when test="contentsLoc == 'SCM013'"><!-- 베스트 -->
|
|
|
|
|
- ORDER BY G.SELL_WEEK_QTY DESC , G.GOODS_CD
|
|
|
|
|
- </when>
|
|
|
|
|
- <when test="contentsLoc == 'SMM009' or contentsLoc == 'SMM007' or contentsLoc == 'SMM012'"> <!-- md추천 -->
|
|
|
|
|
- </when>
|
|
|
|
|
- <when test="contentsLoc == 'SCM002' or (contentsLoc == 'SCM003' and pageGb == null)"> <!-- md추천 -->
|
|
|
|
|
- ORDER BY G.DISP_ORD ,G.UPD_DT DESC, G.CURR_PRICE DESC, G.GOODS_CD ASC
|
|
|
|
|
- </when>
|
|
|
|
|
- <when test="contentsLoc == 'SCM003' and pageGb != null and pageGb == 'BEST'">
|
|
|
|
|
- ORDER BY G.CATE1_NO, G.DISP_ORD ,G.UPD_DT DESC, G.CURR_PRICE DESC, G.GOODS_CD ASC
|
|
|
|
|
- </when>
|
|
|
|
|
- <otherwise>
|
|
|
|
|
- ORDER BY G.DISP_ORD , G.REG_DT DESC , G.GOODS_CD
|
|
|
|
|
- </otherwise>
|
|
|
|
|
- </choose>
|
|
|
|
|
- <if test="pageable != null and pageable.endRow != null and pageable.endRow > 0">
|
|
|
|
|
- LIMIT #{pageable.limitStartRow} , #{pageable.pageSize}
|
|
|
|
|
- </if>
|
|
|
|
|
- <if test="maxRow != null and maxRow !=''">
|
|
|
|
|
- LIMIT #{maxRow}
|
|
|
|
|
- </if>
|
|
|
|
|
-
|
|
|
|
|
- </select>
|
|
|
|
|
|
|
|
|
|
</mapper>
|
|
</mapper>
|