Compare commits
2 Commits
073f5af70a
...
d405d84dfe
| Author | SHA1 | Date | |
|---|---|---|---|
| d405d84dfe | |||
| 120d784345 |
@@ -24,7 +24,7 @@ public interface StoryItemMapper {
|
||||
|
||||
List<String> selectImagesByItemId(String itemId);
|
||||
|
||||
List<StoryItem> selectStoryItemByStoryInstanceId(Map map);
|
||||
List<StoryItemVo> selectStoryItemByStoryInstanceId(Map map);
|
||||
|
||||
int countByStoryId(String storyInstanceId);
|
||||
|
||||
|
||||
@@ -9,13 +9,17 @@ public class StoryItem {
|
||||
private Long id;
|
||||
private String instanceId;
|
||||
private String storyInstanceId;
|
||||
private String content;
|
||||
private String masterItemId;
|
||||
private String title;
|
||||
private String description;
|
||||
private String location;
|
||||
private LocalDateTime storyItemTime;
|
||||
private String type;
|
||||
private String status;
|
||||
private String cover;
|
||||
private String createId;
|
||||
private String updateId;
|
||||
private String shareId;
|
||||
private LocalDateTime createTime;
|
||||
private LocalDateTime updateTime;
|
||||
private Integer isDelete;
|
||||
|
||||
@@ -35,9 +35,12 @@ public class StoryItemServiceImpl implements StoryItemService {
|
||||
storyItemVo.getPageSize() != null ? storyItemVo.getPageSize() : 10);
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put("storyInstanceId", storyItemVo.getStoryInstanceId());
|
||||
if (storyItemVo.getAfterTime() != null) {
|
||||
params.put("afterTime", storyItemVo.getAfterTime());
|
||||
}
|
||||
|
||||
List<StoryItem> list = storyItemMapper.selectStoryItemByStoryInstanceId(params);
|
||||
PageInfo<StoryItem> pageInfo = new PageInfo<>(list);
|
||||
List<StoryItemVo> list = storyItemMapper.selectStoryItemByStoryInstanceId(params);
|
||||
PageInfo<StoryItemVo> pageInfo = new PageInfo<>(list);
|
||||
|
||||
Map<String, Object> result = new HashMap<>();
|
||||
result.put("list", pageInfo.getList());
|
||||
|
||||
@@ -4,9 +4,18 @@ import com.timeline.story.entity.StoryItem;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class StoryItemVo extends StoryItem {
|
||||
private Integer current;
|
||||
private Integer pageSize;
|
||||
private String createName;
|
||||
private String updateName;
|
||||
private List<String> images;
|
||||
|
||||
// 查询参数
|
||||
private String afterTime;
|
||||
private String beforeTime;
|
||||
}
|
||||
|
||||
@@ -5,14 +5,16 @@
|
||||
<mapper namespace="com.timeline.story.dao.StoryItemMapper">
|
||||
|
||||
<insert id="insert">
|
||||
INSERT INTO story_item (instance_id, master_item_id, description, location, title, create_id, story_instance_id, is_delete, story_item_time, update_id)
|
||||
VALUES (#{instanceId}, #{masterItemId}, #{description}, #{location}, #{title},#{createId}, #{storyInstanceId}, #{isDelete}, #{storyItemTime}, #{updateId})
|
||||
INSERT INTO story_item (instance_id, master_item_id, description, location, title, create_id, story_instance_id, is_delete, story_item_time, update_id, share_id, cover)
|
||||
VALUES (#{instanceId}, #{masterItemId}, #{description}, #{location}, #{title},#{createId}, #{storyInstanceId}, #{isDelete}, #{storyItemTime}, #{updateId}, #{shareId}, #{cover})
|
||||
</insert>
|
||||
|
||||
<update id="update">
|
||||
UPDATE story_item
|
||||
SET description = #{description},
|
||||
location = #{location},
|
||||
title = #{title},
|
||||
cover = #{cover},
|
||||
create_id = #{createId},
|
||||
update_time = NOW(),
|
||||
update_id = #{updateId},
|
||||
@@ -39,13 +41,19 @@
|
||||
</select>
|
||||
<select id="selectStoryItemByStoryInstanceId" resultType="com.timeline.story.vo.StoryItemVo">
|
||||
SELECT
|
||||
instance_id,
|
||||
si.id,
|
||||
si.instance_id,
|
||||
si.description,
|
||||
si.location,
|
||||
title,
|
||||
story_instance_id,
|
||||
si.title,
|
||||
si.story_instance_id,
|
||||
si.master_item_id,
|
||||
si.share_id,
|
||||
si.cover,
|
||||
si.type,
|
||||
si.status,
|
||||
si.is_delete,
|
||||
si.story_item_time as story_item_time,
|
||||
si.update_time,
|
||||
si.create_id AS create_id,
|
||||
si.create_time AS create_time,
|
||||
u1.username AS create_name,
|
||||
@@ -92,15 +100,14 @@
|
||||
si.id,
|
||||
si.story_instance_id,
|
||||
si.title,
|
||||
si.content,
|
||||
si.description,
|
||||
si.story_item_time,
|
||||
si.cover,
|
||||
si.is_milestone
|
||||
si.cover
|
||||
FROM
|
||||
story_item si
|
||||
WHERE
|
||||
si.is_delete = 0
|
||||
AND (si.title LIKE CONCAT('%', #{keyword}, '%') OR si.content LIKE CONCAT('%', #{keyword}, '%'))
|
||||
AND (si.title LIKE CONCAT('%', #{keyword}, '%') OR si.description LIKE CONCAT('%', #{keyword}, '%'))
|
||||
ORDER BY
|
||||
si.story_item_time DESC
|
||||
</select>
|
||||
|
||||
Reference in New Issue
Block a user