inleft
2022-03-02 42b7d05dfdf60ee67c876084a3240ff48a3bf3a5
commit | author | age
91dc6c 1 <?xml version="1.0" encoding="UTF-8"?>
I 2 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
3 <mapper namespace="vip.xiaonuo.modular.blogarticletype.mapper.BlogArticleTypeMapper">
4
88f419 5     <select id="listCount" resultType="vip.xiaonuo.modular.blogarticletype.entity.BlogArticleTypeVo">
c5e66a 6         SELECT
I 7             t1.id,
8             t1.type_name AS typeName,
9             t2.count
10         FROM
e99de8 11             blog_article_type t1 left join
c5e66a 12             (
I 13                 SELECT
14                     t.id,
15                     count(t.id) count
16                 FROM
17                     blog_article a,
18                     blog_article_type t
19                 WHERE
20                     a.article_type_id = t.id
21                 AND a.is_enable = 1
22                 AND a.editor_status = 1
23                 AND t.is_enable = 1
24                 GROUP BY
25                     t.id
26             ) t2
e99de8 27         on
c5e66a 28             t1.id = t2.id
I 29         ORDER BY
30             t1.top_value ASC,
31             t1.create_date DESC
32     </select>
33
91dc6c 34 </mapper>