gongzuming
2024-09-08 1f2140b4eeeadef7b139bd3ab7fdf1ce57fa9a12
src/main/resources/mapper/flower/FlowerMapper.xml
@@ -234,6 +234,10 @@
    <select id="myCollect" resultType="com.mzl.flower.dto.response.flower.FlowerShowListDTO">
        SELECT f.*, s.name supplierName, st.name supplierType, fc.name categoryStr
        , (select sum(num) from t_cart ccc
        where ccc.flower_id = f.id
        and ccc.create_by = #{condition.userId}
        ) shopnum
        FROM t_collect_flower c
        left join t_flower f on c.flower_id = f.id
        left join t_supplier_info s on s.id = f.supplier_id
@@ -275,6 +279,10 @@
    <select id="myBrowseHistory" resultType="com.mzl.flower.dto.response.flower.FlowerShowListDTO">
        SELECT f.*, s.name supplierName, st.name supplierType, fc.name categoryStr
        , (select sum(num) from t_cart ccc
        where ccc.flower_id = f.id
        and ccc.create_by = #{condition.userId}
        ) shopnum
        FROM t_browse_his c
        left join t_flower f on c.flower_id = f.id
        left join t_supplier_info s on s.id = f.supplier_id
@@ -373,4 +381,10 @@
        </if>
        ORDER BY fzp.rank asc
    </select>
    <update id="updateFlowerCategoryInfo">
        update t_flower f, t_flower_category fc
        set f.unit = fc.unit, f.color = fc.color
        where f.category = fc.id and fc.id = #{category}
    </update>
</mapper>