ZQN
2024-06-24 4172b0bdc098d4a8055bdb0b1bfb4cbf866e47a0
project-report/src/main/resources/mapper/report/ReportMapper.xml
@@ -47,16 +47,19 @@
    <select id="getCompanyCount"
            parameterType="com.project.report.domain.bo.query.ReportQueryBo"
            resultType="com.project.common.vo.KeyVal">
        select
        company_id AS k,
        IFNULL(count(order_id),0) as v
        from enforce_order
            sc.company_name AS k,
            IFNULL(count(eo.order_id),0) as v
        from sys_company sc
        left join enforce_order eo on sc.company_id=eo.company_id
        where 1=1
        and sc.check_status=2
        <if test="beginTime!=null and beginTime!=''">
            AND apply_time &gt;= #{beginTime}
            AND eo.apply_time &gt;= #{beginTime}
        </if>
        <if test="endTime!=null and endTime!=''">
            AND apply_time &lt;= #{endTime}
            AND eo.apply_time &lt;= #{endTime}
        </if>
        GROUP BY k order by v desc
    </select>