mirror of
https://github.com/didi/KnowStreaming.git
synced 2026-01-02 02:02:13 +08:00
init
This commit is contained in:
35
dao/src/main/resources/mapper/TopicFavoriteDao.xml
Normal file
35
dao/src/main/resources/mapper/TopicFavoriteDao.xml
Normal file
@@ -0,0 +1,35 @@
|
||||
<?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="TopicFavoriteDao">
|
||||
<resultMap id="TopicFavoriteMap" type="TopicFavoriteDO">
|
||||
<id column="id" jdbcType="BIGINT" property="id" />
|
||||
<result column="status" jdbcType="INTEGER" property="status" />
|
||||
<result column="gmt_modify" jdbcType="TIMESTAMP" property="gmtModify" />
|
||||
<result column="gmt_create" jdbcType="TIMESTAMP" property="gmtCreate" />
|
||||
|
||||
<result column="cluster_id" jdbcType="BIGINT" property="clusterId" />
|
||||
<result column="topic_name" jdbcType="VARCHAR" property="topicName" />
|
||||
<result column="username" jdbcType="VARCHAR" property="username" />
|
||||
</resultMap>
|
||||
|
||||
<insert id="batchAdd" parameterType="java.util.List">
|
||||
REPLACE topic_favorite (cluster_id, topic_name, username)
|
||||
VALUES
|
||||
<foreach item="TopicFavoriteDO" index="index" collection="list" separator=",">
|
||||
(#{TopicFavoriteDO.clusterId}, #{TopicFavoriteDO.topicName}, #{TopicFavoriteDO.username})
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
<delete id="deleteById" parameterType="java.lang.Long">
|
||||
DELETE FROM topic_favorite WHERE id=#{id}
|
||||
</delete>
|
||||
|
||||
<select id="getByUserName" parameterType="java.lang.String" resultMap="TopicFavoriteMap">
|
||||
SELECT * FROM topic_favorite WHERE username=#{username}
|
||||
</select>
|
||||
|
||||
<select id="getByUserNameAndClusterId" parameterType="java.util.Map" resultMap="TopicFavoriteMap">
|
||||
SELECT * FROM topic_favorite WHERE username=#{username} AND cluster_id=#{clusterId}
|
||||
</select>
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user