增加资源无分类查询

This commit is contained in:
none
2023-03-15 11:41:37 +08:00
parent b95cd7fbab
commit 06bc8c639c
8 changed files with 24 additions and 4 deletions

View File

@@ -27,4 +27,11 @@
FROM `resource_course_category`
GROUP BY `resource_course_category`.`category_id`;
</select>
<select id="getNoneCategoryCount" resultType="java.lang.Integer">
SELECT count(DISTINCT `courses`.`id`) AS `total`
FROM `courses`
LEFT JOIN `resource_course_category` ON `resource_course_category`.`course_id` = `courses`.`id`
WHERE `resource_course_category`.`course_id` IS NULL;
</select>
</mapper>

View File

@@ -36,4 +36,12 @@
GROUP BY `resource_category`.`cid`;
</select>
<select id="getNoneCategoryCount" resultType="java.lang.Integer">
SELECT count(DISTINCT `resources`.`id`) AS `total`
FROM `resources`
LEFT JOIN `resource_category` ON `resource_category`.`rid` = `resources`.`id`
WHERE `resources`.`type` = #{type}
AND `resource_category`.`cid` IS NULL;
</select>
</mapper>