mirror of
https://github.com/PlayEdu/PlayEdu
synced 2025-12-25 20:35:35 +08:00
返回资源分类的资源数量
This commit is contained in:
@@ -17,8 +17,14 @@
|
||||
</resultMap>
|
||||
|
||||
<sql id="Base_Column_List">
|
||||
id,title,thumb,
|
||||
charge,class_hour,is_show,
|
||||
id,title,thumb,
|
||||
charge,class_hour,is_show,
|
||||
created_at,updated_at,deleted_at
|
||||
</sql>
|
||||
|
||||
<select id="getCategoryCount" resultType="xyz.playedu.api.types.mapper.CourseCategoryCountMapper">
|
||||
SELECT `resource_course_category`.`cid` as `cid`, count(*) as `total`
|
||||
FROM `resource_course_category`
|
||||
GROUP BY `resource_course_category`.`category_id`;
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
@@ -21,10 +21,19 @@
|
||||
</resultMap>
|
||||
|
||||
<sql id="Base_Column_List">
|
||||
id,admin_id,type,
|
||||
name,extension,size,
|
||||
disk,file_id,path,
|
||||
url,created_at,parent_id,
|
||||
id,admin_id,type,
|
||||
name,extension,size,
|
||||
disk,file_id,path,
|
||||
url,created_at,parent_id,
|
||||
is_hidden
|
||||
</sql>
|
||||
|
||||
<select id="getCategoryCount" resultType="xyz.playedu.api.types.mapper.ResourceCategoryCountMapper">
|
||||
SELECT `resource_category`.`cid` as `cid`, count(*) as `total`
|
||||
FROM `resources`
|
||||
INNER JOIN `resource_category` ON `resource_category`.`rid` = `resources`.`id`
|
||||
WHERE `resources`.`type` = #{type}
|
||||
GROUP BY `resource_category`.`cid`;
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
||||
Reference in New Issue
Block a user