调整数据库字段,优化部分接口 #1
@@ -37,4 +37,6 @@ public interface CommentMapper {
|
|||||||
List<Comment> findAllByPagePathAndPid(String pagePath, long pid);
|
List<Comment> findAllByPagePathAndPid(String pagePath, long pid);
|
||||||
|
|
||||||
long countByPagePath(String pagePath);
|
long countByPagePath(String pagePath);
|
||||||
|
|
||||||
|
long count();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -36,13 +36,6 @@ public interface CountService {
|
|||||||
*/
|
*/
|
||||||
long getTagsCount();
|
long getTagsCount();
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取留言数量
|
|
||||||
*
|
|
||||||
* @return 留言数量
|
|
||||||
*/
|
|
||||||
long getLeaveMessageCount();
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取用户量
|
* 获取用户量
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ public class CountServiceImpl implements CountService {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public long getCommentCount() {
|
public long getCommentCount() {
|
||||||
return commentMapper.countByType(true);
|
return commentMapper.count();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -47,11 +47,6 @@ public class CountServiceImpl implements CountService {
|
|||||||
return tagMapper.count();
|
return tagMapper.count();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public long getLeaveMessageCount() {
|
|
||||||
return commentMapper.countByType(false);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public long getUserCount() {
|
public long getUserCount() {
|
||||||
return userMapper.count();
|
return userMapper.count();
|
||||||
|
|||||||
@@ -108,7 +108,7 @@
|
|||||||
limit 1
|
limit 1
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="count">
|
<select id="count" resultType="long">
|
||||||
select count(*)
|
select count(*)
|
||||||
from article where is_delete = false;
|
from article where is_delete = false;
|
||||||
</select>
|
</select>
|
||||||
|
|||||||
Reference in New Issue
Block a user