Jelajahi Sumber

상품리스트 및 검색상품리스트에 혜택필터 조건 추가

gagamel 5 tahun lalu
induk
melakukan
9aaa7725e0

+ 40 - 0
src/main/java/com/style24/persistence/mybatis/shop/TsfGoods.xml

@@ -1694,6 +1694,16 @@
 		    AND    BENEFIT_GB = #{newGoods}
 		    )
 		</if>
+		<if test='benefitArr != null and benefitArr.length > 0'>
+		            AND    EXISTS (SELECT 1
+		                           FROM   TB_GOODS_BENEFIT
+		                           WHERE  GOODS_CD = G.GOODS_CD
+		                           AND    BENEFIT_GB IN
+		                           <foreach collection="benefitArr" item="item" index="index"  open="(" close=")" separator=",">
+		                               #{item}
+		                           </foreach>
+		                        )
+		        </if>
 		) G
 		WHERE  1 = 1
 		<if test="priceFrom != null and priceFrom != ''">
@@ -1841,6 +1851,16 @@
 		                           AND    BENEFIT_GB = #{newGoods}
 		                         )
 		        </if>
+		        <if test='benefitArr != null and benefitArr.length > 0'>
+		            AND    EXISTS (SELECT 1
+		                           FROM   TB_GOODS_BENEFIT
+		                           WHERE  GOODS_CD = G.GOODS_CD
+		                           AND    BENEFIT_GB IN
+		                           <foreach collection="benefitArr" item="item" index="index"  open="(" close=")" separator=",">
+		                               #{item}
+		                           </foreach>
+		                        )
+		        </if>
 		      ) G
 		      WHERE  1 = 1
 		      <if test="priceFrom != null and priceFrom != ''">
@@ -2136,6 +2156,16 @@
 		                       AND    BENEFIT_GB = #{newGoods}
 		                      )
 		        </if>
+		        <if test='benefitArr != null and benefitArr.length > 0'>
+		        AND    EXISTS (SELECT 1
+		                       FROM   TB_GOODS_BENEFIT
+		                       WHERE  GOODS_CD = G.GOODS_CD
+		                       AND    BENEFIT_GB IN
+		                       <foreach collection="benefitArr" item="item" index="index"  open="(" close=")" separator=",">
+		                       #{item}
+		                       </foreach>
+		                      )
+		        </if>
 		       ) G
 		WHERE  1 = 1
 		<if test="priceFrom != null and priceFrom != ''">
@@ -2263,6 +2293,16 @@
 		                           AND    BENEFIT_GB = #{newGoods}
 		                         )
 		            </if>
+		            <if test='benefitArr != null and benefitArr.length > 0'>
+		            AND    EXISTS (SELECT 1
+		                           FROM   TB_GOODS_BENEFIT
+		                           WHERE  GOODS_CD = G.GOODS_CD
+		                           AND    BENEFIT_GB IN
+		                           <foreach collection="benefitArr" item="item" index="index"  open="(" close=")" separator=",">
+		                           #{item}
+		                           </foreach>
+		                          )
+		            </if>
 		           ) G
 		    WHERE  1 = 1
 		    <if test="priceFrom != null and priceFrom != ''">