master:电商卖家进货车列表查询优化;

pull/1121/head
liujiang 2025-08-27 22:59:56 +08:00
parent 3536002b04
commit a120039b22
1 changed files with 4 additions and 5 deletions

View File

@ -4,7 +4,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.xkt.mapper.ShoppingCartMapper">
<select id="selectDetailList" parameterType="Long" resultType="com.ruoyi.xkt.dto.userShoppingCart.ShopCartPageDetailResDTO">
SELECT
scd.id AS shopping_cart_detail_id,
@ -46,8 +45,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
END AS prod_status
FROM
shopping_cart sc
LEFT JOIN store s ON sc.store_id = s.id
LEFT JOIN store_product sp ON sc.store_prod_id = sp.id
JOIN store s ON sc.store_id = s.id
JOIN store_product sp ON sc.store_prod_id = sp.id
WHERE
sc.del_flag = 0
AND sc.user_id = #{userId}
@ -56,7 +55,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
#{status}
</foreach>
<if test="prodArtNum != null and prodArtNum != ''">
AND sp.prod_art_num = #{prodArtNum}
AND sp.prod_art_num like concat('%', #{prodArtNum}, '%')
</if>
<if test="storeName != null and storeName != ''">
AND s.store_name like concat('%', #{storeName}, '%')
@ -72,7 +71,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
IFNULL( SUM( CASE WHEN sp.prod_status IN ( 4, 5 ) THEN 1 ELSE 0 END ), 0 ) AS expiredNum
FROM
shopping_cart sc
LEFT JOIN store_product sp ON sc.store_prod_id = sp.id
JOIN store_product sp ON sc.store_prod_id = sp.id
WHERE
sc.del_flag = 0
AND sc.user_id = #{userId}