消息队列存储数据
This commit is contained in:
226
src/main/resources/mapper/NewHostsMapper.xml
Normal file
226
src/main/resources/mapper/NewHostsMapper.xml
Normal file
@@ -0,0 +1,226 @@
|
||||
<?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.yupi.springbootinit.mapper.NewHostsMapper">
|
||||
<resultMap id="BaseResultMap" type="com.yupi.springbootinit.model.entity.NewHosts">
|
||||
<!--@mbg.generated-->
|
||||
<!--@Table new_hosts-->
|
||||
<id column="id" jdbcType="BIGINT" property="id" />
|
||||
<result column="hosts_id" jdbcType="VARCHAR" property="hostsId" />
|
||||
<result column="hosts_level" jdbcType="VARCHAR" property="hostsLevel" />
|
||||
<result column="hosts_coins" jdbcType="INTEGER" property="hostsCoins" />
|
||||
<result column="Invitation_type" jdbcType="INTEGER" property="invitationType" />
|
||||
<result column="fans" jdbcType="INTEGER" property="fans" />
|
||||
<result column="fllowernum" jdbcType="INTEGER" property="fllowernum" />
|
||||
<result column="yesterday_coins" jdbcType="INTEGER" property="yesterdayCoins" />
|
||||
<result column="country" jdbcType="VARCHAR" property="country" />
|
||||
<result column="hosts_kind" jdbcType="VARCHAR" property="hostsKind" />
|
||||
<result column="tenant_id" jdbcType="BIGINT" property="tenantId" />
|
||||
<result column="creator" jdbcType="INTEGER" property="creator" />
|
||||
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
|
||||
<result column="updater" jdbcType="VARCHAR" property="updater" />
|
||||
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
|
||||
</resultMap>
|
||||
<sql id="Base_Column_List">
|
||||
<!--@mbg.generated-->
|
||||
id, hosts_id, hosts_level, hosts_coins, Invitation_type, fans, fllowernum, yesterday_coins,
|
||||
country, hosts_kind, tenant_id, creator, create_time, updater, update_time
|
||||
</sql>
|
||||
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
|
||||
<!--@mbg.generated-->
|
||||
select
|
||||
<include refid="Base_Column_List" />
|
||||
from new_hosts
|
||||
where id = #{id,jdbcType=BIGINT}
|
||||
</select>
|
||||
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
|
||||
<!--@mbg.generated-->
|
||||
delete from new_hosts
|
||||
where id = #{id,jdbcType=BIGINT}
|
||||
</delete>
|
||||
<insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.yupi.springbootinit.model.entity.NewHosts" useGeneratedKeys="true">
|
||||
<!--@mbg.generated-->
|
||||
insert into new_hosts (hosts_id, hosts_level, hosts_coins,
|
||||
Invitation_type, fans, fllowernum,
|
||||
yesterday_coins, country, hosts_kind,
|
||||
tenant_id, creator, create_time,
|
||||
updater, update_time)
|
||||
values (#{hostsId,jdbcType=VARCHAR}, #{hostsLevel,jdbcType=VARCHAR}, #{hostsCoins,jdbcType=INTEGER},
|
||||
#{invitationType,jdbcType=INTEGER}, #{fans,jdbcType=INTEGER}, #{fllowernum,jdbcType=INTEGER},
|
||||
#{yesterdayCoins,jdbcType=INTEGER}, #{country,jdbcType=VARCHAR}, #{hostsKind,jdbcType=VARCHAR},
|
||||
#{tenantId,jdbcType=BIGINT}, #{creator,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP},
|
||||
#{updater,jdbcType=VARCHAR}, #{updateTime,jdbcType=TIMESTAMP})
|
||||
</insert>
|
||||
<insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.yupi.springbootinit.model.entity.NewHosts" useGeneratedKeys="true">
|
||||
<!--@mbg.generated-->
|
||||
insert into new_hosts
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="hostsId != null">
|
||||
hosts_id,
|
||||
</if>
|
||||
<if test="hostsLevel != null">
|
||||
hosts_level,
|
||||
</if>
|
||||
<if test="hostsCoins != null">
|
||||
hosts_coins,
|
||||
</if>
|
||||
<if test="invitationType != null">
|
||||
Invitation_type,
|
||||
</if>
|
||||
<if test="fans != null">
|
||||
fans,
|
||||
</if>
|
||||
<if test="fllowernum != null">
|
||||
fllowernum,
|
||||
</if>
|
||||
<if test="yesterdayCoins != null">
|
||||
yesterday_coins,
|
||||
</if>
|
||||
<if test="country != null">
|
||||
country,
|
||||
</if>
|
||||
<if test="hostsKind != null">
|
||||
hosts_kind,
|
||||
</if>
|
||||
<if test="tenantId != null">
|
||||
tenant_id,
|
||||
</if>
|
||||
<if test="creator != null">
|
||||
creator,
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
create_time,
|
||||
</if>
|
||||
<if test="updater != null">
|
||||
updater,
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
update_time,
|
||||
</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="hostsId != null">
|
||||
#{hostsId,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="hostsLevel != null">
|
||||
#{hostsLevel,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="hostsCoins != null">
|
||||
#{hostsCoins,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="invitationType != null">
|
||||
#{invitationType,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="fans != null">
|
||||
#{fans,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="fllowernum != null">
|
||||
#{fllowernum,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="yesterdayCoins != null">
|
||||
#{yesterdayCoins,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="country != null">
|
||||
#{country,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="hostsKind != null">
|
||||
#{hostsKind,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="tenantId != null">
|
||||
#{tenantId,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="creator != null">
|
||||
#{creator,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
#{createTime,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="updater != null">
|
||||
#{updater,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
#{updateTime,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
</trim>
|
||||
</insert>
|
||||
<update id="updateByPrimaryKeySelective" parameterType="com.yupi.springbootinit.model.entity.NewHosts">
|
||||
<!--@mbg.generated-->
|
||||
update new_hosts
|
||||
<set>
|
||||
<if test="hostsId != null">
|
||||
hosts_id = #{hostsId,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="hostsLevel != null">
|
||||
hosts_level = #{hostsLevel,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="hostsCoins != null">
|
||||
hosts_coins = #{hostsCoins,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="invitationType != null">
|
||||
Invitation_type = #{invitationType,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="fans != null">
|
||||
fans = #{fans,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="fllowernum != null">
|
||||
fllowernum = #{fllowernum,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="yesterdayCoins != null">
|
||||
yesterday_coins = #{yesterdayCoins,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="country != null">
|
||||
country = #{country,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="hostsKind != null">
|
||||
hosts_kind = #{hostsKind,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="tenantId != null">
|
||||
tenant_id = #{tenantId,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="creator != null">
|
||||
creator = #{creator,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
create_time = #{createTime,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="updater != null">
|
||||
updater = #{updater,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
update_time = #{updateTime,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
</set>
|
||||
where id = #{id,jdbcType=BIGINT}
|
||||
</update>
|
||||
<update id="updateByPrimaryKey" parameterType="com.yupi.springbootinit.model.entity.NewHosts">
|
||||
<!--@mbg.generated-->
|
||||
update new_hosts
|
||||
set hosts_id = #{hostsId,jdbcType=VARCHAR},
|
||||
hosts_level = #{hostsLevel,jdbcType=VARCHAR},
|
||||
hosts_coins = #{hostsCoins,jdbcType=INTEGER},
|
||||
Invitation_type = #{invitationType,jdbcType=INTEGER},
|
||||
fans = #{fans,jdbcType=INTEGER},
|
||||
fllowernum = #{fllowernum,jdbcType=INTEGER},
|
||||
yesterday_coins = #{yesterdayCoins,jdbcType=INTEGER},
|
||||
country = #{country,jdbcType=VARCHAR},
|
||||
hosts_kind = #{hostsKind,jdbcType=VARCHAR},
|
||||
tenant_id = #{tenantId,jdbcType=BIGINT},
|
||||
creator = #{creator,jdbcType=INTEGER},
|
||||
create_time = #{createTime,jdbcType=TIMESTAMP},
|
||||
updater = #{updater,jdbcType=VARCHAR},
|
||||
update_time = #{updateTime,jdbcType=TIMESTAMP}
|
||||
where id = #{id,jdbcType=BIGINT}
|
||||
</update>
|
||||
<insert id="batchInsert" keyColumn="id" keyProperty="id" parameterType="map">
|
||||
<!--@mbg.generated-->
|
||||
insert into new_hosts
|
||||
(hosts_id, hosts_level, hosts_coins, Invitation_type, fans, fllowernum, yesterday_coins,
|
||||
country, hosts_kind, tenant_id, creator)
|
||||
values
|
||||
<foreach collection="list" item="item" separator=",">
|
||||
(#{item.hostsId,jdbcType=VARCHAR}, #{item.hostsLevel,jdbcType=VARCHAR}, #{item.hostsCoins,jdbcType=INTEGER},
|
||||
#{item.invitationType,jdbcType=INTEGER}, #{item.fans,jdbcType=INTEGER}, #{item.fllowernum,jdbcType=INTEGER},
|
||||
#{item.yesterdayCoins,jdbcType=INTEGER}, #{item.country,jdbcType=VARCHAR}, #{item.hostsKind,jdbcType=VARCHAR},
|
||||
#{item.tenantId,jdbcType=BIGINT}, #{item.creator,jdbcType=INTEGER})
|
||||
</foreach>
|
||||
</insert>
|
||||
</mapper>
|
||||
29
src/main/resources/mapper/PostFavourMapper.xml
Normal file
29
src/main/resources/mapper/PostFavourMapper.xml
Normal file
@@ -0,0 +1,29 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- @author <a href="https://github.com/liyupi">程序员鱼皮</a> -->
|
||||
<!-- @from <a href="https://yupi.icu">编程导航知识星球</a> -->
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.yupi.springbootinit.mapper.PostFavourMapper">
|
||||
|
||||
<resultMap id="BaseResultMap" type="com.yupi.springbootinit.model.entity.PostFavour">
|
||||
<id property="id" column="id" jdbcType="BIGINT"/>
|
||||
<result property="postId" column="postId" jdbcType="BIGINT"/>
|
||||
<result property="userId" column="userId" jdbcType="BIGINT"/>
|
||||
<result property="createTime" column="createTime" jdbcType="TIMESTAMP"/>
|
||||
<result property="updateTime" column="updateTime" jdbcType="TIMESTAMP"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="Base_Column_List">
|
||||
id,postId,userId,
|
||||
createTime,updateTime
|
||||
</sql>
|
||||
|
||||
<select id="listFavourPostByPage"
|
||||
resultType="com.yupi.springbootinit.model.entity.Post">
|
||||
select p.*
|
||||
from post p
|
||||
join (select postId from post_favour where userId = #{favourUserId}) pf
|
||||
on p.id = pf.postId ${ew.customSqlSegment}
|
||||
</select>
|
||||
</mapper>
|
||||
33
src/main/resources/mapper/PostMapper.xml
Normal file
33
src/main/resources/mapper/PostMapper.xml
Normal file
@@ -0,0 +1,33 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- @author <a href="https://github.com/liyupi">程序员鱼皮</a> -->
|
||||
<!-- @from <a href="https://yupi.icu">编程导航知识星球</a> -->
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.yupi.springbootinit.mapper.PostMapper">
|
||||
|
||||
<resultMap id="BaseResultMap" type="com.yupi.springbootinit.model.entity.Post">
|
||||
<id property="id" column="id" jdbcType="BIGINT"/>
|
||||
<result property="title" column="title" jdbcType="VARCHAR"/>
|
||||
<result property="content" column="content" jdbcType="VARCHAR"/>
|
||||
<result property="tags" column="tags" jdbcType="VARCHAR"/>
|
||||
<result property="thumbNum" column="thumbNum" jdbcType="BIGINT"/>
|
||||
<result property="favourNum" column="favourNum" jdbcType="BIGINT"/>
|
||||
<result property="userId" column="userId" jdbcType="BIGINT"/>
|
||||
<result property="createTime" column="createTime" jdbcType="TIMESTAMP"/>
|
||||
<result property="updateTime" column="updateTime" jdbcType="TIMESTAMP"/>
|
||||
<result property="isDelete" column="isDelete" jdbcType="TINYINT"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="Base_Column_List">
|
||||
id,title,content,tags,
|
||||
thumbNum,favourNum,userId,
|
||||
createTime,updateTime,isDelete
|
||||
</sql>
|
||||
|
||||
<select id="listPostWithDelete" resultType="com.yupi.springbootinit.model.entity.Post">
|
||||
select *
|
||||
from post
|
||||
where updateTime >= #{minUpdateTime}
|
||||
</select>
|
||||
</mapper>
|
||||
21
src/main/resources/mapper/PostThumbMapper.xml
Normal file
21
src/main/resources/mapper/PostThumbMapper.xml
Normal file
@@ -0,0 +1,21 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- @author <a href="https://github.com/liyupi">程序员鱼皮</a> -->
|
||||
<!-- @from <a href="https://yupi.icu">编程导航知识星球</a> -->
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.yupi.springbootinit.mapper.PostThumbMapper">
|
||||
|
||||
<resultMap id="BaseResultMap" type="com.yupi.springbootinit.model.entity.PostThumb">
|
||||
<id property="id" column="id" jdbcType="BIGINT"/>
|
||||
<result property="postId" column="postId" jdbcType="BIGINT"/>
|
||||
<result property="userId" column="userId" jdbcType="BIGINT"/>
|
||||
<result property="createTime" column="createTime" jdbcType="TIMESTAMP"/>
|
||||
<result property="updateTime" column="updateTime" jdbcType="TIMESTAMP"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="Base_Column_List">
|
||||
id,postId,
|
||||
userId,createTime,updateTime
|
||||
</sql>
|
||||
</mapper>
|
||||
26
src/main/resources/mapper/UserMapper.xml
Normal file
26
src/main/resources/mapper/UserMapper.xml
Normal file
@@ -0,0 +1,26 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- @author <a href="https://github.com/liyupi">程序员鱼皮</a> -->
|
||||
<!-- @from <a href="https://yupi.icu">编程导航知识星球</a> -->
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.yupi.springbootinit.mapper.UserMapper">
|
||||
<resultMap id="BaseResultMap" type="com.yupi.springbootinit.model.entity.User">
|
||||
<id property="id" column="id" jdbcType="BIGINT"/>
|
||||
<result property="unionId" column="unionId" jdbcType="VARCHAR"/>
|
||||
<result property="mpOpenId" column="mpOpenId" jdbcType="VARCHAR"/>
|
||||
<result property="userName" column="userName" jdbcType="VARCHAR"/>
|
||||
<result property="userAvatar" column="userAvatar" jdbcType="VARCHAR"/>
|
||||
<result property="userProfile" column="userProfile" jdbcType="VARCHAR"/>
|
||||
<result property="userRole" column="userRole" jdbcType="VARCHAR"/>
|
||||
<result property="createTime" column="createTime" jdbcType="TIMESTAMP"/>
|
||||
<result property="updateTime" column="updateTime" jdbcType="TIMESTAMP"/>
|
||||
<result property="isDelete" column="isDelete" jdbcType="TINYINT"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="Base_Column_List">
|
||||
id,unionId,mpOpenId,
|
||||
userName,userAvatar,userProfile,
|
||||
userRole,createTime,updateTime,isDelete
|
||||
</sql>
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user