<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.business.mapper.VisualizationMapper">


    <resultMap id="deptInNumbersBean" type="com.business.domain.deptInNumbersBean"></resultMap>
    <select id="getDeptInNumbers" resultMap="deptInNumbersBean">
select a.dept_id dept_id,a.dept_name dept_name,b.int_numbers int_numbers from sys_dept a,
(select apply_dept_id ,sum(int_numbers) int_numbers from int_record a group by apply_dept_id order by  int_numbers desc) b
where a.dept_id=b.apply_dept_id
    </select>

</mapper>
