|
|
@ -61,13 +61,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
<select id="getSecondCategory" resultType="com.jingcheng.cms.model.Category" parameterType="Long">
|
|
|
|
<select id="getSecondCategory" resultType="com.jingcheng.cms.model.Category" parameterType="Long">
|
|
|
|
select c.`id`,c.`name`,c.`level`,c.`type_name`,c.`sort_num`
|
|
|
|
select c.`id`,c.`name`,c.`level`,c.`type_name`,c.`sort_num`
|
|
|
|
|
|
|
|
from
|
|
|
|
|
|
|
|
(select ar.`second_category`, ac.`category_id`,ar.`state`
|
|
|
|
from article ar
|
|
|
|
from article ar
|
|
|
|
|
|
|
|
left join article_category ac on ar.`id` = ac.`article_id`
|
|
|
|
|
|
|
|
WHERE ac.state = 1 and ar.state = 1)ar
|
|
|
|
left join category c
|
|
|
|
left join category c
|
|
|
|
on ar.`second_category` = c.`id`
|
|
|
|
on ar.`second_category` = c.`id`
|
|
|
|
where
|
|
|
|
where
|
|
|
|
1=1
|
|
|
|
1=1
|
|
|
|
<if test="firstCategory != null ">
|
|
|
|
<if test="firstCategory != null ">
|
|
|
|
and ar.first_category = #{firstCategory}
|
|
|
|
and ar.category_id = #{firstCategory}
|
|
|
|
</if>
|
|
|
|
</if>
|
|
|
|
and c.level = 2 and ar.state = 1
|
|
|
|
and c.level = 2 and ar.state = 1
|
|
|
|
group by c.name
|
|
|
|
group by c.name
|
|
|
|