add
yj
2024-12-05 b9900893177c78fc559223521fe839aa21000017
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
<?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.iotechn.unimall.data.mapper.GroupShopMapper">
 
    <select id="getGroupShopPage" resultType="com.iotechn.unimall.data.dto.product.GroupShopDTO">
        SELECT
            g.id,
            g.spu_id as spuId,
            g.gmt_start as gmtStart,
            g.gmt_end as gmtEnd,
            g.min_price as minPrice,
            g.max_price as maxPrice,
            g.min_num as minNum,
            g.buyer_num as buyerNum,
            g.automatic_refund as automaticRefund,
            g.`status`,
            g.gmt_update as gmtUpdate,
            g.gmt_create as gmtCreate,
            s.original_price as originalPrice,
            s.price as price,
            s.vip_price as vipPrice,
            s.title,
            s.sales,
            s.img,
            s.unit
        FROM
            unimall_group_shop AS g
        LEFT JOIN
            unimall_spu as s on s.id = g.spu_id
        WHERE
            g.`status` = 1
        ORDER BY id DESC
    </select>
 
    <select id="detail" resultType="com.iotechn.unimall.data.dto.product.GroupShopDTO">
        SELECT
            g.id,
            g.spu_id as spuId,
            g.gmt_start as gmtStart,
            g.gmt_end as gmtEnd,
            g.min_price as minPrice,
            g.max_price as maxPrice,
            g.min_num as minNum,
            g.buyer_num as buyerNum,
            g.automatic_refund as automaticRefund,
            g.`status`,
            g.gmt_update as gmtUpdate,
            g.gmt_create as gmtCreate,
            s.original_price as originalPrice,
            s.price as price,
            s.vip_price as vipPrice,
            s.title,
            s.sales,
            s.img,
            s.unit
        FROM
            unimall_group_shop AS g
        LEFT JOIN
            unimall_spu as s on s.id = g.spu_id
        WHERE g.id = #{id}
    </select>
 
    <update id="incCurrentNum">
        UPDATE unimall_group_shop SET buyer_num = buyer_num + #{num} WHERE id = #{id}
    </update>
 
</mapper>