Sfoglia il codice sorgente

Merge branch 'develop' of http://112.172.147.34:4936/style24/style24.front.git into develop

eskim 5 anni fa
parent
commit
de098a35ac

+ 41 - 27
src/main/java/com/style24/persistence/mybatis/shop/TsfGoods.xml

@@ -1411,7 +1411,10 @@
 		         , G.LIST_PRICE         /*정상가(최초판매가)*/
 		         , G.CURR_PRICE         /*현재판매가*/
 		         , G.REG_DT             /*등록일시*/
-		         , G.NUMB
+		         , G.DISP_ORD
+		         <if test="contentsLoc == 'SCM002'">
+		         , G.SELL_WEEK_QTY
+		         </if>
 		    FROM   (
 		            SELECT CASE WHEN BG.DISP_NM_LANG = 'EN' THEN
 		                            BG.BRAND_GROUP_ENM
@@ -1430,28 +1433,21 @@
 		                 , G.LIST_PRICE                                             /*정상가(최초판매가)*/
 		                 , G.CURR_PRICE                                             /*현재판매가*/
 		                 , G.REG_DT                                                 /*등록일시*/
-		                 <choose>
-		                     <when test="contentsLoc == 'SCM113'"> <!-- 베스트 -->
-		                 , ROW_NUMBER() OVER(ORDER BY GS.SELL_WEEK_QTY DESC
-		                                            , G.GOODS_CD) AS NUMB
-		                     </when>
-		                     <when test="contentsLoc == 'SMM009' or contentsLoc == 'SMM007' or contentsLoc == 'SMM012'"> <!-- md추천 -->
-		                 , ROW_NUMBER() OVER(ORDER BY CTG.DISP_ORD
-		                 , G.REG_DT DESC
-		                 , G.GOODS_CD) AS NUMB
-		                     </when>
-		                     <when test="contentsLoc == 'SCM002' or (contentsLoc == 'SCM003' and pageGb == null)"> <!-- md추천 -->
-		                  , ROW_NUMBER() OVER(ORDER BY CG.DISP_ORD ,G.UPD_DT DESC, G.CURR_PRICE DESC, G.GOODS_CD ASC) AS NUMB
-		                     </when>
-		                     <when test="contentsLoc == 'SCM003' and pageGb != null and pageGb == 'BEST'">
-		                  , ROW_NUMBER() OVER(ORDER BY C4.CATE1_NO, CG.DISP_ORD ,G.UPD_DT DESC, G.CURR_PRICE DESC, G.GOODS_CD ASC) AS NUMB
-		                     </when>
-		                     <otherwise>
-		                 , ROW_NUMBER() OVER(ORDER BY CG.DISP_ORD
-		                                            , G.REG_DT DESC
-		                                            , G.GOODS_CD) AS NUMB
-		                     </otherwise>
-		                 </choose>
+		                 , G.UPD_DT
+		            <choose>
+		                <when test="contentsLoc == 'SMM009' or contentsLoc == 'SMM007' or contentsLoc == 'SMM012'">
+		                 , CT.DISP_ORD
+		                 </when>
+		                 <otherwise>
+		                 , CG.DISP_ORD
+		                 </otherwise>
+		            </choose>
+		            <if test="contentsLoc == 'SCM002'">
+		                , GS.SELL_WEEK_QTY
+		            </if>
+		            <if test="contentsLoc == 'SCM003' and pageGb != null and pageGb == 'BEST'">
+		                , C4.CATE1_NO
+		            </if>
 		            <choose>
 		                <when test="contentsLoc == 'SMM009' or contentsLoc == 'SMM007' or contentsLoc == 'SMM012'"> <!-- md추천 -->
 		                    FROM	TB_CONTENTS CT
@@ -1473,7 +1469,7 @@
 		                <otherwise>
 		                    FROM   TB_CATE_4SRCH C4
 		                    , TB_CATE_GOODS CG
-		                    , TB_GOODS G USE INDEX (IX_GOODS_11)
+		                    , TB_GOODS G 
 		                    , TB_GOODS_STOCK S
 		                    , TB_BRAND B
 		                    , TB_BRAND_GROUP BG
@@ -1520,21 +1516,39 @@
 		            AND    BG.USE_YN = 'Y'
 		            <if test="pageGb != null and pageGb == 'BEST'">
 		            ORDER BY C4.CATE1_NO
+		            LIMIT 100
 		            </if>
 		           ) G
 		    WHERE  1=1
+		<choose>
+		    <when test="contentsLoc == 'SCM113'"> <!-- 베스트 -->
+		     ORDER BY G.SELL_WEEK_QTY DESC , G.GOODS_CD
+		    </when>
+		    <when test="contentsLoc == 'SMM009' or contentsLoc == 'SMM007' or contentsLoc == 'SMM012'"> <!-- md추천 -->
+		     ORDER BY G.DISP_ORD , G.REG_DT DESC , G.GOODS_CD
+		    </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">
 		    <choose>
 		        <when test="pageGb == 'BEST' and pageable.endRow >= 100">
-		    AND  G.NUMB BETWEEN #{pageable.startRow} AND 100
+		    LIMIT 100
 		        </when>
 		        <otherwise>
-		    AND  G.NUMB BETWEEN #{pageable.startRow} AND #{pageable.endRow}
+		    LIMIT #{pageable.limitStartRow} , #{pageable.pageSize}
 		        </otherwise>
 		    </choose>
 		</if>
 		<if test="maxRow != null and maxRow !=''">
-			AND  G.NUMB <![CDATA[<=]]> #{maxRow}
+		    LIMIT #{maxRow}
 		</if>
 		)
 		SELECT G.BRAND_GROUP_NM