admin
2025-02-25 30d8e227e8d823b6c38c3b9c90ac2df03b63befe
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
<?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.yeshi.fanli.lijin.dao.MsgLijinVIPDetailMapper">
    <resultMap id="BaseResultMap" type="com.yeshi.fanli.lijin.entity.MsgLijinVIPDetail">
        <id column="mlv_id" property="id" jdbcType="BIGINT"/>
        <result column="mlv_type" property="type"
                typeHandler="com.yeshi.fanli.util.mybatishandler.msg.MsgTypeLijinVIPTypeEnumHandler"/>
        <result column="mlv_remark" property="remark" jdbcType="VARCHAR"/>
        <result column="mlv_read" property="read" jdbcType="BOOLEAN"/>
        <result column="mlv_create_time" property="createTime" jdbcType="TIMESTAMP"/>
        <result column="mlv_update_time" property="updateTime" jdbcType="TIMESTAMP"/>
        <result column="extraInfo" property="extraInfo" jdbcType="VARCHAR"/>
        <association property="user" column="mlv_uid"
                     javaType="com.yeshi.fanli.entity.bus.user.UserInfo">
            <id column="mlv_uid" property="id" jdbcType="BIGINT"/>
        </association>
    </resultMap>
    <sql id="Base_Column_List">mlv_id,mlv_uid,mlv_type,mlv_remark,mlv_read,mlv_create_time,mlv_update_time</sql>
 
    <select id="listByPrimaryKeys" resultMap="BaseResultMap">
        SELECT d.*, t.`mea_content` AS extraInfo FROM yeshi_ec_msg_lijin_vip d
        LEFT JOIN `yeshi_ec_msg_extra` t ON (t.`mea_rid` = d.`mlv_id` AND t.`mea_type` = 'lijinVip')
        WHERE
        <foreach collection="ids" separator=" or " open="(" close=")" item="id">
            mlv_id=#{id}
        </foreach>
    </select>
 
    <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long">select
        <include refid="Base_Column_List"/>from yeshi_ec_msg_lijin_vip where mlv_id = #{id,jdbcType=BIGINT}
    </select>
    <delete id="deleteByPrimaryKey"
            parameterType="java.lang.Long">delete from yeshi_ec_msg_lijin_vip where mlv_id = #{id,jdbcType=BIGINT}</delete>
    <insert id="insert" parameterType="com.yeshi.fanli.lijin.entity.MsgLijinVIPDetail" useGeneratedKeys="true"
            keyProperty="id">insert into yeshi_ec_msg_lijin_vip (mlv_id,mlv_uid,mlv_type,mlv_remark,mlv_read,mlv_create_time,mlv_update_time) values (#{id,jdbcType=BIGINT},#{user.id,jdbcType=BIGINT},#{type,jdbcType=VARCHAR},#{remark,jdbcType=VARCHAR},#{read,jdbcType=BOOLEAN},#{createTime,jdbcType=TIMESTAMP},#{updateTime,jdbcType=TIMESTAMP})</insert>
    <insert id="insertSelective" parameterType="com.yeshi.fanli.lijin.entity.MsgLijinVIPDetail" useGeneratedKeys="true"
            keyProperty="id">insert into yeshi_ec_msg_lijin_vip
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="id != null">mlv_id,</if>
            <if test="user != null">mlv_uid,</if>
            <if test="type != null">mlv_type,</if>
            <if test="remark != null">mlv_remark,</if>
            <if test="read != null">mlv_read,</if>
            <if test="createTime != null">mlv_create_time,</if>
            <if test="updateTime != null">mlv_update_time,</if>
        </trim>
        values
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="id != null">#{id,jdbcType=BIGINT},</if>
            <if test="user != null">#{user.id,jdbcType=BIGINT},</if>
            <if test="type != null">#{type,jdbcType=VARCHAR},</if>
            <if test="remark != null">#{remark,jdbcType=VARCHAR},</if>
            <if test="read != null">#{read,jdbcType=BOOLEAN},</if>
            <if test="createTime != null">#{createTime,jdbcType=TIMESTAMP},</if>
            <if test="updateTime != null">#{updateTime,jdbcType=TIMESTAMP},</if>
        </trim>
    </insert>
    <update id="updateByPrimaryKey"
            parameterType="com.yeshi.fanli.lijin.entity.MsgLijinVIPDetail">update yeshi_ec_msg_lijin_vip set mlv_uid = #{user.id,jdbcType=BIGINT},mlv_type = #{type,jdbcType=VARCHAR},mlv_remark = #{remark,jdbcType=VARCHAR},mlv_read = #{read,jdbcType=BOOLEAN},mlv_create_time = #{createTime,jdbcType=TIMESTAMP},mlv_update_time = #{updateTime,jdbcType=TIMESTAMP} where mlv_id = #{id,jdbcType=BIGINT}</update>
    <update id="updateByPrimaryKeySelective" parameterType="com.yeshi.fanli.lijin.entity.MsgLijinVIPDetail">update
        yeshi_ec_msg_lijin_vip
        <set>
            <if test="user != null">mlv_uid=#{user.id,jdbcType=BIGINT},</if>
            <if test="type != null">mlv_type=#{type,jdbcType=VARCHAR},</if>
            <if test="remark != null">mlv_remark=#{remark,jdbcType=VARCHAR},</if>
            <if test="read != null">mlv_read=#{read,jdbcType=BOOLEAN},</if>
            <if test="createTime != null">mlv_create_time=#{createTime,jdbcType=TIMESTAMP},</if>
            <if test="updateTime != null">mlv_update_time=#{updateTime,jdbcType=TIMESTAMP},</if>
        </set>
        where mlv_id = #{id,jdbcType=BIGINT}
    </update>
</mapper>