mysql获取分类数量

1.sql

<select id="getTypeNum" resultType="TypeNum" >
    select  
        count(*) as allNum,
        count(patenttype='1' or null) as num1, 
        count(patenttype='2'  or null) as num2, 
        count(patenttype='3'  or null) as num3, 
        count(patenttype='4'  or null) as num4,
        count(patenttype='5'  or null) as num4
    from supplier_patent a 
</select>

2,对象

3,显示

原文地址:https://www.cnblogs.com/excellencesy/p/9754103.html