mitao
2024-07-08 022a7ff7abf82cd2546e18071ade5228b4e2339f
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
<?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.sinata.modular.mall.dao.MallGoodsSkuMapper">
 
    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="com.sinata.modular.mall.model.MallGoodsSku">
        <id column="id" property="id"/>
        <result column="merchant_id" property="merchantId"/>
        <result column="goods_id" property="goodsId"/>
        <result column="grep_name" property="grepName"/>
        <result column="spec_grep" property="specGrep"/>
        <result column="group_spec_name" property="groupSpecName"/>
        <result column="group_spec_grep" property="groupSpecGrep"/>
        <result column="stock" property="stock"/>
        <result column="img_url" property="imgUrl"/>
        <result column="update_time" property="updateTime"/>
        <result column="create_time" property="createTime"/>
        <result column="spec_ids" property="specIds"/>
        <result column="group_spec_ids" property="groupSpecIds"/>
        <result column="price" property="price"/>
        <result column="price_sale" property="priceSale"/>
        <result column="price_member" property="priceMember"/>
        <result column="price_merchant" property="priceMerchant"/>
    </resultMap>
 
    <!-- 通用查询结果列 -->
    <sql id="Base_Column_List">
        id, merchant_id, goods_id, grep_name, spec_grep, group_spec_name, group_spec_grep, stock, img_url, update_time, create_time, spec_ids, group_spec_ids, price, price_sale, price_member, price_merchant
    </sql>
 
    <select id="queryMerchantGoodsList" resultType="java.util.HashMap">
        SELECT md.id
             , md.goods_name
             , mu.grep_name
             , mu.price
             ,mu.spec_ids
             , mu.price_sale
             , mu.price_member
             , mu.price_merchant
             , mu.stock
             , md.buy_count
             , mu.id goodsSkuId
             , mu.state
             , md.goods_no
        FROM `mall_goods_sku` mu
                 join mall_goods md on md.id = mu.goods_id
        WHERE mu.merchant_id = #{merchantId}
    </select>
</mapper>