|
|
@@ -1,67 +0,0 @@
|
|
|
-<?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="cn.reghao.tnb.content.app.data.db.mapper.MblogStatusMapper">
|
|
|
- <insert id="save" useGeneratedKeys="true" keyProperty="id">
|
|
|
- insert into mblog_status
|
|
|
- (`user_id`,`status_id`,`text`,`source`,`created_at`,`thumbs_up_count`,`comment_count`,`reposts_count`,`id`,`deleted`,`create_time`,`update_time`)
|
|
|
- values
|
|
|
- (#{userId},#{statusId},#{text},#{source},#{createdAt},#{thumbsUpCount},#{commentCount},#{repostsCount},#{id},#{deleted},#{createTime},#{updateTime})
|
|
|
- </insert>
|
|
|
-
|
|
|
- <select id="countStatusCard" resultType="java.lang.Integer">
|
|
|
- select count(*)
|
|
|
- from mblog_status status
|
|
|
- <!--where status.user_id in
|
|
|
- <foreach collection="list" item="id" index="index" open="(" close=")" separator=",">
|
|
|
- #{id}
|
|
|
- </foreach>-->
|
|
|
- </select>
|
|
|
-
|
|
|
- <resultMap id="statusCards" type="cn.reghao.tnb.content.app.data.model.vo.StatusCard">
|
|
|
- <result property="userId" column="user_id"/>
|
|
|
- <result property="statusId" column="status_id"/>
|
|
|
- <result property="text" column="text"/>
|
|
|
- <result property="createdAt" column="created_at"/>
|
|
|
- <collection property="imageUrls" ofType="cn.reghao.oss.sdk.model.dto.media.ImageUrlDto" select="getImageUrls" column="status_id"/>
|
|
|
- </resultMap>
|
|
|
- <select id="findStatusCardByPage" resultMap="statusCards">
|
|
|
- select *
|
|
|
- from mblog_status
|
|
|
- where user_id in
|
|
|
- <foreach collection="userIds" item="id" index="index" open="(" close=")" separator=",">
|
|
|
- #{id}
|
|
|
- </foreach>
|
|
|
- order by created_at desc
|
|
|
- </select>
|
|
|
- <select id="getImageUrls" resultType="cn.reghao.oss.sdk.model.dto.media.ImageUrlDto">
|
|
|
- select original_url,thumbnail_url
|
|
|
- from mblog_image
|
|
|
- where status_id=#{status_id}
|
|
|
- </select>
|
|
|
-
|
|
|
- <select id="countUserStatusCard" resultType="java.lang.Integer">
|
|
|
- select count(*)
|
|
|
- from mblog_status
|
|
|
- where user_id=#{userId}
|
|
|
- </select>
|
|
|
-
|
|
|
- <resultMap id="userStatusCards" type="cn.reghao.tnb.content.app.data.model.vo.StatusCard">
|
|
|
- <result property="statusId" column="status_id"/>
|
|
|
- <result property="text" column="text"/>
|
|
|
- <result property="createdAt" column="created_at"/>
|
|
|
- <collection property="imageUrls" ofType="cn.reghao.oss.sdk.model.dto.media.ImageUrlDto" select="getImageUrls" column="status_id"/>
|
|
|
- </resultMap>
|
|
|
- <select id="findUserStatusCardByPage" resultMap="userStatusCards">
|
|
|
- select status.*
|
|
|
- from mblog_status status
|
|
|
- where `status`.user_id=#{userId}
|
|
|
- order by created_at desc
|
|
|
- </select>
|
|
|
-
|
|
|
- <select id="findByStatusId" resultMap="userStatusCards">
|
|
|
- select *
|
|
|
- from mblog_status
|
|
|
- where status_id=#{statusId}
|
|
|
- </select>
|
|
|
-</mapper>
|