feat: redis点赞数据同步数据库
This commit is contained in:
@@ -13,5 +13,35 @@
|
||||
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime"/>
|
||||
<result column="is_deleted" jdbcType="INTEGER" property="isDeleted"/>
|
||||
</resultMap>
|
||||
<insert id="insertBatch">
|
||||
insert into subject_liked(id, subject_id, like_user_id, status, created_by, created_time, update_by,
|
||||
update_time, is_deleted)
|
||||
values
|
||||
<foreach collection="entities" item="entity" separator=",">
|
||||
(#{entity.id},
|
||||
#{entity.subjectId},
|
||||
#{entity.likeUserId},
|
||||
#{entity.status},
|
||||
#{entity.createdBy},
|
||||
#{entity.createdTime},
|
||||
#{entity.updateBy}, #{entity.updateTime}, #{entity.isDeleted})
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
<select id="countByCondition" resultType="java.lang.Integer">
|
||||
select count(1)
|
||||
from subject_liked
|
||||
where like_user_id = #{likeUserId} and status = 1
|
||||
and is_deleted = 0
|
||||
</select>
|
||||
|
||||
<select id="queryPage" resultType="com.landaiqing.subject.infra.basic.entity.SubjectLiked">
|
||||
select *
|
||||
from subject_liked
|
||||
where like_user_id = #{entity.likeUserId}
|
||||
and is_deleted = 0 and status = 1
|
||||
limit #{start}
|
||||
, #{pageSize}
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
Reference in New Issue
Block a user