243 lines
4.3 KiB
Java
243 lines
4.3 KiB
Java
package com.nbclass.activity.mapper;
|
|
|
|
import java.util.List;
|
|
import java.util.Map;
|
|
|
|
import com.nbclass.activity.model.*;
|
|
import org.apache.ibatis.annotations.Param;
|
|
|
|
import com.nbclass.util.MyMapper;
|
|
|
|
public interface ContentMapper extends MyMapper<Content> {
|
|
|
|
/**
|
|
* 根据id查找记录
|
|
* @param id
|
|
* @return
|
|
*/
|
|
public Content findById(long id);
|
|
|
|
/**
|
|
* 根据条件查询列表
|
|
* @param entity
|
|
* @return
|
|
*/
|
|
public List<Content> getList(Content entity);
|
|
|
|
/**
|
|
* 根据条件查询列表 - 前端页面查询
|
|
* @param entity
|
|
* @return
|
|
*/
|
|
public List<Content> getListByFront(Content entity);
|
|
|
|
/**
|
|
* 根据id批量删除记录
|
|
* @param list
|
|
*/
|
|
public void deleteByIds(List<Long> list);
|
|
|
|
|
|
/**
|
|
* 删除关联的标签
|
|
* @param cid
|
|
*/
|
|
public void deleteTags(long cid);
|
|
|
|
/**
|
|
* 批量添加标签
|
|
* @param list
|
|
*/
|
|
public void insertContentTags(List<ContentTags> list);
|
|
|
|
/**
|
|
* 通过内容ID删除图片集
|
|
* @param cid
|
|
*/
|
|
public void deleteImages(long cid);
|
|
|
|
/**
|
|
* 批量添加图片
|
|
* @param list
|
|
*/
|
|
public void insertContentImages(List<ContentImages> list);
|
|
|
|
/**
|
|
* 添加点赞数阅读数
|
|
* @param type [view, like]
|
|
* @param id
|
|
*/
|
|
public void updateContentNum(@Param("type")String type, @Param("id")Long id);
|
|
|
|
/**
|
|
* 查询案例标题和评论数和点赞数
|
|
* @return
|
|
*/
|
|
List<Content> getCaseTitle();
|
|
|
|
/**
|
|
* 标签关联案例
|
|
* @param contentTags
|
|
*/
|
|
void addContentTags(ContentTags contentTags);
|
|
|
|
/**
|
|
* 获取自定义标签列表
|
|
* @return
|
|
*/
|
|
List<DataDictItem> getOtherLabels();
|
|
|
|
/**
|
|
* 取消案例关联标签的关系
|
|
* @param idList
|
|
*/
|
|
void deleteContentTags(List<Long> idList);
|
|
|
|
/**
|
|
* 案例索引标签反馈次数+1
|
|
* @param contentId
|
|
*/
|
|
void updateLabelFeedback(Long contentId);
|
|
|
|
/**
|
|
* 根据条件查询列表
|
|
* @param entity
|
|
* @return
|
|
*/
|
|
List<Content> getList2(Content entity);
|
|
|
|
/**
|
|
* 更新案例总评论数
|
|
* @param contentId
|
|
*/
|
|
void updateComments(Long contentId);
|
|
|
|
/**
|
|
* 添加案例评分
|
|
* @param userId
|
|
* @param contentId
|
|
* @param score
|
|
*/
|
|
void saveScore(@Param("userId") Long userId,
|
|
@Param("contentId") Long contentId,
|
|
@Param("score") Double score);
|
|
|
|
/**
|
|
* 查看用户是否已经打过分
|
|
* @param userId
|
|
* @param contentId
|
|
* @return
|
|
*/
|
|
int getScore(@Param("userId") Long userId,
|
|
@Param("contentId") Long contentId);
|
|
|
|
/**
|
|
* 根据案例id查询案例详情
|
|
* @param contentId
|
|
* @return
|
|
*/
|
|
Content getEditContent(Long contentId);
|
|
|
|
/**
|
|
* 提交审核申请单
|
|
* @param application
|
|
*/
|
|
void saveApplication(Application application);
|
|
|
|
/**
|
|
* 添加审核人信息
|
|
* @param check
|
|
*/
|
|
void saveCheck(Check check);
|
|
|
|
/**
|
|
*查询案例是否已提交过审核
|
|
* @param contentId
|
|
* @return
|
|
*/
|
|
int getApplicationCount(Long contentId);
|
|
|
|
/**
|
|
* 删除案例审核申请
|
|
* @param applicationId
|
|
*/
|
|
void deleteApplication(Long applicationId);
|
|
|
|
/**
|
|
* 删除审核人信息
|
|
* @param applicationId
|
|
*/
|
|
void deleteCheck(Long applicationId);
|
|
|
|
/**
|
|
* 更新审核申请单状态
|
|
* @param applicationId
|
|
*/
|
|
void updateApplicationStatus(Long applicationId);
|
|
|
|
/**
|
|
* 更新审核人状态
|
|
* @param applicationId
|
|
*/
|
|
void updateCheckStatus(Long applicationId);
|
|
|
|
/**
|
|
* 获取审核列表
|
|
* @param entity
|
|
* @return
|
|
*/
|
|
List<Content> getContentApplication(Content entity);
|
|
|
|
/**
|
|
* 更新审核表状态
|
|
* @param check
|
|
*/
|
|
void updateCheck(Check check);
|
|
|
|
/**
|
|
* 更新申请单状态
|
|
* @param application
|
|
*/
|
|
void updateApplication(Application application);
|
|
|
|
/**
|
|
* 查询案例id
|
|
* @return
|
|
*/
|
|
Long getContentId(Long applicationId);
|
|
|
|
/**
|
|
* 更新案例状态
|
|
* @param contentId
|
|
*/
|
|
void updateContentRelease(@Param("contentId") Long contentId,
|
|
@Param("release") Integer release,
|
|
@Param("visibility") Integer visibility);
|
|
|
|
/**
|
|
* 根据案例id查询申请单信息
|
|
* @param contentId
|
|
* @return
|
|
*/
|
|
Application getApplication(Long contentId);
|
|
|
|
/**
|
|
* 本周统计案例数量
|
|
* @return
|
|
*/
|
|
List<Census> getCensus(Integer type);
|
|
|
|
/**
|
|
* 获取今年的案例统计信息
|
|
* @return
|
|
*/
|
|
List<Integer> getCensusLine();
|
|
|
|
/**
|
|
* 获取前年的案例统计信息
|
|
* @return
|
|
*/
|
|
List<Integer> getCencusLineLastYear();
|
|
|
|
}
|