mirror of
https://github.com/PlayEdu/PlayEdu
synced 2025-12-31 15:43:12 +08:00
后管-线上课、资源:选择分类、部门递归查询该子类、子部门数据
This commit is contained in:
@@ -33,9 +33,9 @@
|
||||
SELECT `resources`.*
|
||||
FROM `resources`
|
||||
<choose>
|
||||
<when test="categoryIds != null and categoryIds != ''">
|
||||
<when test="categoryIds != null and !categoryIds.isEmpty()">
|
||||
<choose>
|
||||
<when test="categoryIds.indexOf('0') == 0">
|
||||
<when test="categoryIds.get(0) == 0">
|
||||
LEFT JOIN `resource_category` ON `resource_category`.`rid` = `resources`.`id`
|
||||
WHERE `resources`.`is_hidden` = 0
|
||||
AND `resource_category`.`cid` IS NULL
|
||||
@@ -43,7 +43,8 @@
|
||||
<otherwise>
|
||||
INNER JOIN `resource_category` ON `resource_category`.`rid` = `resources`.`id`
|
||||
WHERE `resources`.`is_hidden` = 0
|
||||
AND `resource_category`.`cid` IN (#{categoryIds})
|
||||
AND `resource_category`.`cid` IN (<foreach collection="categoryIds" item="tmpId" separator=",">
|
||||
#{tmpId}</foreach>)
|
||||
</otherwise>
|
||||
</choose>
|
||||
</when>
|
||||
@@ -102,9 +103,9 @@
|
||||
SELECT count(1)
|
||||
FROM `resources`
|
||||
<choose>
|
||||
<when test="categoryIds != null and categoryIds != ''">
|
||||
<when test="categoryIds != null and !categoryIds.isEmpty()">
|
||||
<choose>
|
||||
<when test="categoryIds.indexOf('0') == 0">
|
||||
<when test="categoryIds.get(0) == 0">
|
||||
LEFT JOIN `resource_category` ON `resource_category`.`rid` = `resources`.`id`
|
||||
WHERE `resources`.`is_hidden` = 0
|
||||
AND `resource_category`.`cid` IS NULL
|
||||
@@ -112,7 +113,8 @@
|
||||
<otherwise>
|
||||
INNER JOIN `resource_category` ON `resource_category`.`rid` = `resources`.`id`
|
||||
WHERE `resources`.`is_hidden` = 0
|
||||
AND `resource_category`.`cid` IN (#{categoryIds})
|
||||
AND `resource_category`.`cid` IN (<foreach collection="categoryIds" item="tmpId" separator=",">
|
||||
#{tmpId}</foreach>)
|
||||
</otherwise>
|
||||
</choose>
|
||||
</when>
|
||||
|
||||
Reference in New Issue
Block a user