lidongdong
2022-11-15 0067d58468227069251c3f23c20ed7196137166a
flower_city/src/main/resources/mapper/HomeStatisticsMapper.xml
@@ -8,7 +8,17 @@
            user_name as userName,
            (SELECT organization_name FROM automessage_organization_chart WHERE  automessage_organization_chart.id=department_id) as departmentNmae,
            (select count(id) from automessage_guide_repair_order WHERE automessage_guide_repair_order.guide_user_id=automessage_sys_user.user_id) as num
        FROM automessage_sys_user WHERE user_type=2 ORDER BY
        FROM automessage_sys_user
        <where>
            user_type=2
            <if test="ids != null">
                and department_id IN
                <foreach collection="ids" item="param"  open="(" close=")" separator=",">
                    #{param}
                </foreach>
            </if>
        </where>
        ORDER BY
            num DESC
        LIMIT 10
    </select>
@@ -19,7 +29,17 @@
            user_name,
            (SELECT organization_name FROM automessage_organization_chart WHERE  automessage_organization_chart.id=department_id) as departmentNmae,
            ((select sum(IF(evaluate_state='1',10,IF(evaluate_state='2',5,0))) from automessage_guide_repair_order WHERE automessage_guide_repair_order.guide_user_id=automessage_sys_user.user_id)/(select count(id) from automessage_guide_repair_order WHERE automessage_guide_repair_order.guide_user_id=automessage_sys_user.user_id)) as num
        FROM automessage_sys_user WHERE user_type=2 ORDER BY
        FROM automessage_sys_user
        <where>
            user_type=2
            <if test="ids != null">
                and department_id IN
                <foreach collection="ids" item="param"  open="(" close=")" separator=",">
                    #{param}
                </foreach>
            </if>
        </where>
        ORDER BY
            num DESC
        LIMIT 10
    </select>
@@ -31,8 +51,62 @@
            (SELECT organization_name FROM automessage_organization_chart WHERE  automessage_organization_chart.id=department_id) as departmentNmae,
            (select count(id) from automessage_guide_repair_order WHERE automessage_guide_repair_order.guide_user_id=automessage_sys_user.user_id and automessage_guide_repair_order.is_timeout=2
            ) as num
        FROM automessage_sys_user WHERE user_type=2 ORDER BY
        FROM automessage_sys_user
        <where>
            user_type=2
            <if test="ids != null">
                and department_id IN
                <foreach collection="ids" item="param"  open="(" close=")" separator=",">
                    #{param}
                </foreach>
            </if>
        </where>
        ORDER BY
            num DESC
        LIMIT 10
    </select>
    <!--  按未办结  -->
    <select id="tosettled" resultType="com.dg.core.db.gen.entity.GuidePlate">
        SELECT
        user_name as userName,
        (SELECT organization_name FROM automessage_organization_chart WHERE  automessage_organization_chart.id=department_id) as departmentNmae,
        (select count(id) from automessage_guide_repair_order WHERE automessage_guide_repair_order.guide_user_id=automessage_sys_user.user_id and automessage_guide_repair_order.state=2
        ) as num
        FROM automessage_sys_user
        <where>
            user_type=2
            <if test="ids != null">
                and department_id IN
                <foreach collection="ids" item="param"  open="(" close=")" separator=",">
                    #{param}
                </foreach>
            </if>
        </where>
        ORDER BY
        num DESC
        LIMIT 10
    </select>
    <!--  按未办结  -->
    <select id="workunit" resultType="com.dg.core.db.gen.entity.GuidePlate">
        SELECT
        user_name as userName,
        (SELECT organization_name FROM automessage_organization_chart WHERE  automessage_organization_chart.id=department_id) as departmentNmae,
        (select count(id) from automessage_guide_repair_order WHERE automessage_guide_repair_order.guide_user_id=automessage_sys_user.user_id) as num
        FROM automessage_sys_user
        <where>
            user_type=2
            <if test="ids != null">
                and department_id IN
                <foreach collection="ids" item="param"  open="(" close=")" separator=",">
                    #{param}
                </foreach>
            </if>
        </where>
        ORDER BY
        num DESC
        LIMIT 10
    </select>
@@ -40,7 +114,16 @@
    <!--  导办人员统计数  -->
    <select id="staffNum" resultType="int">
        SELECT count(id)
        FROM automessage_sys_user WHERE user_type=2
        FROM automessage_sys_user
        <where>
            user_type=2
            <if test="ids != null">
                and department_id IN
                <foreach collection="ids" item="param"  open="(" close=")" separator=",">
                    #{param}
                </foreach>
            </if>
        </where>
    </select>
<!--  获取一级组织  -->
@@ -76,16 +159,32 @@
    <!--  办事指南 根据导办数量排序 -->
    <select id="guidanceTransaction" resultType="com.dg.core.db.gen.entity.Guidance">
        SELECT matter_name as name ,transaction_num as num from
        automessage_transaction_event ORDER BY
            num DESC
        automessage_transaction_event
        <where>
            <if test="ids != null">
                and department_id IN
                <foreach collection="ids" item="param"  open="(" close=")" separator=",">
                    #{param}
                </foreach>
            </if>
        </where>
        ORDER BY num DESC
        LIMIT 10
    </select>
    <!-- 办事指南 根据导办数量排序 -->
    <select id="guidanceBrowse"  resultType="com.dg.core.db.gen.entity.Guidance">
        SELECT matter_name as name ,browse_num as num from
            automessage_transaction_event ORDER BY
            num DESC
            automessage_transaction_event
        <where>
            <if test="ids != null">
                and department_id IN
                <foreach collection="ids" item="param"  open="(" close=")" separator=",">
                    #{param}
                </foreach>
            </if>
        </where>
        ORDER BY num DESC
            LIMIT 10
    </select>
@@ -93,6 +192,14 @@
    <!-- 办事指南 统计数量 -->
    <select id="countWork"  resultType="int">
        SELECT count(id) from automessage_transaction_event
        <where>
            <if test="ids != null">
                and department_id IN
                <foreach collection="ids" item="param"  open="(" close=")" separator=",">
                    #{param}
                </foreach>
            </if>
        </where>
    </select>
@@ -107,6 +214,12 @@
                    #{param}
                </foreach>
            </if>
            <if test="ids != null">
                and department_id IN
                <foreach collection="ids" item="param"  open="(" close=")" separator=",">
                    #{param}
                </foreach>
            </if>
        </where>
    </select>