Helius
2021-01-22 f81300462deff06ab6c90b24ecb9f0ba5031a766
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
68
69
70
71
72
73
74
75
<?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.matrix.system.hive.dao.SysVipLabelDao">
    <insert id="insert" parameterType="com.matrix.system.hive.bean.SysVipLabel" useGeneratedKeys="true"
            keyProperty="id">
        insert sys_vip_label (
            create_time,
            create_by,
            id,
            vip_id,
            label,
            shop_id,
            company_id,
            is_all,
            user_id,
            color
        ) values (
            #{createTime},
            #{createBy},
            #{id},
            #{vipId},
            #{label},
            #{shopId},
            #{companyId},
            #{isAll},
            #{userId},
            #{color}
        )
    </insert>
 
    <update id="update">
        update sys_vip_label
        <set>
            <if test="label != null and label !='' ">
                label = #{label},
            </if>
            <if test="color != null and color !='' ">
                color = #{color},
            </if>
        </set>
        WHERE ID=#{id}
    </update>
 
    <delete id="deleteById">
        delete from sys_vip_label
        where id=#{id}
    </delete>
 
 
    <select id="selectByVipId" resultType="com.matrix.system.hive.bean.SysVipLabel">
        select *
        from sys_vip_label
        where vip_id=#{vipId}
    </select>
 
    <select id="selectByModel" resultType="com.matrix.system.hive.bean.SysVipLabel">
        select * from sys_vip_label
        where 1=1
        <if test="record!=null">
            <if test="record.label!=null  and record.label!=''">
                and label=#{record.label}
            </if>
            <if test="record.vipId!=null">
                and vip_id=#{record.vipId}
            </if>
        </if>
    </select>
 
    <delete id="deleteByVipId">
        delete from sys_vip_label
        where vip_id=#{vipId}
    </delete>
</mapper>