<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.web.modules.home.mapper.GoodsAppMapper">

    <select id="selectDetailBase" resultType="com.ruoyi.web.modules.home.dto.GoodsDetailBaseDTO">
        select g.goods_id as goodsId,
               g.goods_sn as goodsSn,
               g.goods_name as goodsName,
               g.main_pic as mainPic,
               g.detail_content as detailContent,
               g.sale_price as salePrice,
               g.stock as stock,
               g.sales_count as salesCount,
               g.goods_status as goodsStatus,
               g.category_id as categoryId,
               s.shop_id as shopId,
               s.shop_name as shopName,
               s.shop_avatar as shopAvatar,
               s.shop_status as shopStatus,
               s.shop_phone as shopPhone,
               st.rating as shopRating,
               st.fans_count as shopFansCount
        from biz_goods g
        inner join biz_shop s on g.shop_id = s.shop_id and s.del_flag = '0'
        left join biz_shop_stats st on s.shop_id = st.shop_id
        where g.goods_id = #{goodsId}
          and g.del_flag = '0'
    </select>

</mapper>
