Fancy
2024-12-25 cf510b3a38f20d5dba5b7a0b71f097753b3ca409
add mp table
3个文件已添加
211 ■■■■■ 已修改文件
pms-parent/pms-global/src/main/java/com/dy/pmsGlobal/daoMp/MpOpenIdMapper.java 25 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pms-parent/pms-global/src/main/java/com/dy/pmsGlobal/pojoMp/MpOpenId.java 71 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pms-parent/pms-global/src/main/resources/mapper/MpOpenIdMapper.xml 115 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pms-parent/pms-global/src/main/java/com/dy/pmsGlobal/daoMp/MpOpenIdMapper.java
New file
@@ -0,0 +1,25 @@
package com.dy.pmsGlobal.daoMp;
import com.dy.pmsGlobal.pojoMp.MpOpenId;
/**
* @author User
* @description 针对表【mp_open_id】的数据库操作Mapper
* @createDate 2024-12-25 17:22:43
* @Entity com.dy.pmsGlobal.pojoMp.MpOpenId
*/
public interface MpOpenIdMapper {
    int deleteByPrimaryKey(Long id);
    int insert(MpOpenId record);
    int insertSelective(MpOpenId record);
    MpOpenId selectByPrimaryKey(Long id);
    int updateByPrimaryKeySelective(MpOpenId record);
    int updateByPrimaryKey(MpOpenId record);
}
pms-parent/pms-global/src/main/java/com/dy/pmsGlobal/pojoMp/MpOpenId.java
New file
@@ -0,0 +1,71 @@
package com.dy.pmsGlobal.pojoMp;
import com.alibaba.fastjson2.annotation.JSONField;
import com.alibaba.fastjson2.writer.ObjectWriterImplToString;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.util.Date;
import com.dy.common.po.BaseEntity;
import lombok.*;
/**
 *
 * @TableName mp_open_id
 */
@TableName(value ="mp_open_id", autoResultMap = true)
@Builder
@ToString
@NoArgsConstructor
@AllArgsConstructor
public class MpOpenId implements BaseEntity {
    /**
     * 主键
     */
    @JSONField(serializeUsing= ObjectWriterImplToString.class)
    @TableId(value = "id", type = IdType.INPUT)
    public Long id;
    /**
     * 用户唯一标识
     */
    public String openId;
    /**
     * 会话密钥
     */
    public String sessionKey;
    /**
     * 微信昵称
     */
    public String nickName;
    /**
     * 微信头像
     */
    public String headImgUrl;
    /**
     * 手机号
     */
    public String phone;
    /**
     * 性别
     */
    public String gender;
    /**
     * 省份
     */
    public String province;
    /**
     * 创建时间
     */
    public Date createTime;
}
pms-parent/pms-global/src/main/resources/mapper/MpOpenIdMapper.xml
New file
@@ -0,0 +1,115 @@
<?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.dy.pmsGlobal.daoMp.MpOpenIdMapper">
    <resultMap id="BaseResultMap" type="com.dy.pmsGlobal.pojoMp.MpOpenId">
            <id property="id" column="id" jdbcType="BIGINT"/>
            <result property="openId" column="open_id" jdbcType="VARCHAR"/>
            <result property="sessionKey" column="session_key" jdbcType="VARCHAR"/>
            <result property="nickName" column="nick_name" jdbcType="VARCHAR"/>
            <result property="headImgUrl" column="head_img_url" jdbcType="VARCHAR"/>
            <result property="phone" column="phone" jdbcType="VARCHAR"/>
            <result property="gender" column="gender" jdbcType="VARCHAR"/>
            <result property="province" column="province" jdbcType="VARCHAR"/>
            <result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
    </resultMap>
    <sql id="Base_Column_List">
        id,open_id,session_key,
        nick_name,head_img_url,phone,
        gender,province,create_time
    </sql>
    <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
        select
        <include refid="Base_Column_List" />
        from mp_open_id
        where  id = #{id,jdbcType=BIGINT}
    </select>
    <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
        delete from mp_open_id
        where  id = #{id,jdbcType=BIGINT}
    </delete>
    <insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.dy.pmsGlobal.pojoMp.MpOpenId" useGeneratedKeys="true">
        insert into mp_open_id
        ( id,open_id,session_key
        ,nick_name,head_img_url,phone
        ,gender,province,create_time
        )
        values (#{id,jdbcType=BIGINT},#{openId,jdbcType=VARCHAR},#{sessionKey,jdbcType=VARCHAR}
        ,#{nickName,jdbcType=VARCHAR},#{headImgUrl,jdbcType=VARCHAR},#{phone,jdbcType=VARCHAR}
        ,#{gender,jdbcType=VARCHAR},#{province,jdbcType=VARCHAR},#{createTime,jdbcType=TIMESTAMP}
        )
    </insert>
    <insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.dy.pmsGlobal.pojoMp.MpOpenId" useGeneratedKeys="true">
        insert into mp_open_id
        <trim prefix="(" suffix=")" suffixOverrides=",">
                <if test="id != null">id,</if>
                <if test="openId != null">open_id,</if>
                <if test="sessionKey != null">session_key,</if>
                <if test="nickName != null">nick_name,</if>
                <if test="headImgUrl != null">head_img_url,</if>
                <if test="phone != null">phone,</if>
                <if test="gender != null">gender,</if>
                <if test="province != null">province,</if>
                <if test="createTime != null">create_time,</if>
        </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
                <if test="id != null">#{id,jdbcType=BIGINT},</if>
                <if test="openId != null">#{openId,jdbcType=VARCHAR},</if>
                <if test="sessionKey != null">#{sessionKey,jdbcType=VARCHAR},</if>
                <if test="nickName != null">#{nickName,jdbcType=VARCHAR},</if>
                <if test="headImgUrl != null">#{headImgUrl,jdbcType=VARCHAR},</if>
                <if test="phone != null">#{phone,jdbcType=VARCHAR},</if>
                <if test="gender != null">#{gender,jdbcType=VARCHAR},</if>
                <if test="province != null">#{province,jdbcType=VARCHAR},</if>
                <if test="createTime != null">#{createTime,jdbcType=TIMESTAMP},</if>
        </trim>
    </insert>
    <update id="updateByPrimaryKeySelective" parameterType="com.dy.pmsGlobal.pojoMp.MpOpenId">
        update mp_open_id
        <set>
                <if test="openId != null">
                    open_id = #{openId,jdbcType=VARCHAR},
                </if>
                <if test="sessionKey != null">
                    session_key = #{sessionKey,jdbcType=VARCHAR},
                </if>
                <if test="nickName != null">
                    nick_name = #{nickName,jdbcType=VARCHAR},
                </if>
                <if test="headImgUrl != null">
                    head_img_url = #{headImgUrl,jdbcType=VARCHAR},
                </if>
                <if test="phone != null">
                    phone = #{phone,jdbcType=VARCHAR},
                </if>
                <if test="gender != null">
                    gender = #{gender,jdbcType=VARCHAR},
                </if>
                <if test="province != null">
                    province = #{province,jdbcType=VARCHAR},
                </if>
                <if test="createTime != null">
                    create_time = #{createTime,jdbcType=TIMESTAMP},
                </if>
        </set>
        where   id = #{id,jdbcType=BIGINT}
    </update>
    <update id="updateByPrimaryKey" parameterType="com.dy.pmsGlobal.pojoMp.MpOpenId">
        update mp_open_id
        set
            open_id =  #{openId,jdbcType=VARCHAR},
            session_key =  #{sessionKey,jdbcType=VARCHAR},
            nick_name =  #{nickName,jdbcType=VARCHAR},
            head_img_url =  #{headImgUrl,jdbcType=VARCHAR},
            phone =  #{phone,jdbcType=VARCHAR},
            gender =  #{gender,jdbcType=VARCHAR},
            province =  #{province,jdbcType=VARCHAR},
            create_time =  #{createTime,jdbcType=TIMESTAMP}
        where   id = #{id,jdbcType=BIGINT}
    </update>
</mapper>