diff --git a/mall-shop/src/main/resources/mapper/product/ShopProductImageMapper.xml b/mall-shop/src/main/resources/mapper/product/ShopProductImageMapper.xml index 10d0e652..67b3ca2a 100644 --- a/mall-shop/src/main/resources/mapper/product/ShopProductImageMapper.xml +++ b/mall-shop/src/main/resources/mapper/product/ShopProductImageMapper.xml @@ -42,13 +42,14 @@ from ( SELECT - ROW_NUMBER() over(partition by t.product_name order by t.id) rn,t.* + ROW_NUMBER() over(partition by t.product_number order by t.id) rn,t.* from ( SELECT spi.product_image_id, spi.product_id, spi.product_name, + spi.product_number, spi.store_id, lpi. merged_image_url, lp.thumb, @@ -74,11 +75,12 @@ lp.id = lpi.product_id WHERE spi.product_from = '1005' + AND spi.store_id=#{storeId} AND spi.item_image_default = '1' '' ]]>)t )temp where - temp.rn = 1 and temp.store_id=#{storeId} + temp.rn = 1 )tt @@ -93,13 +95,14 @@ from ( SELECT - ROW_NUMBER() over(partition by t.product_name order by t.id) rn,t.* + ROW_NUMBER() over(partition by t.product_number order by t.id) rn,t.* from ( SELECT spi.product_image_id, spi.product_id, spi.product_name, + spi.product_number, spi.store_id, lpi. merged_image_url, lp.thumb, @@ -125,11 +128,12 @@ lp.id = lpi.product_id WHERE spi.product_from = '1005' + AND spi.store_id=#{storeId} AND spi.item_image_default = '1' '' ]]>)t )temp where - temp.rn = 1 and temp.store_id=#{storeId} limit #{offset},#{limit} + temp.rn = 1 limit #{offset},#{limit}