tangzy
2021-08-23 6234ef30e315d6518401926c2eae0267c4742dfd
src/main/java/org/springblade/modules/information/mapper/InformationMapper.xml
@@ -1163,8 +1163,7 @@
            and J.enterpriseName like concat('%', #{enterpriseName},'%')
        </if>
        GROUP BY J.enterpriseName,
        J.departmentid, J.cznum, J.ghnum, J.ghnum, J.pcnum, J.sbnum, J.zcnum, J.znum, J.jurname,J.jurisdiction limit
        #{current},#{size};
        J.departmentid, J.cznum, J.ghnum, J.ghnum, J.pcnum, J.sbnum, J.zcnum, J.znum, J.jurname,J.jurisdiction
    </select>
    <!--公司经济情况进入图表-->
@@ -1218,7 +1217,6 @@
            and J.enterpriseName like concat('%', #{enterpriseName},'%')
        </if>
        GROUP BY J.departmentid, J.enterpriseName, J.jurisdiction, J.jurname, J.pcnum, J.sbcount, J.sbnum, J.zb, J.znum
        limit #{current},#{size};
    </select>
@@ -1234,6 +1232,7 @@
        SELECT
        i.enterpriseName,
        i.departmentid,
        i.jurisdiction,
        j.dept_name
        FROM
        sys_information i
@@ -1252,7 +1251,6 @@
        <if test="deptid!=null and deptid!=''">
            and A.departmentid=#{deptid}
        </if>
        limit #{current},#{size};
    </select>
    <!--保安人员详情-->
@@ -1300,7 +1298,6 @@
        <if test="fid!=null and fid!=''">
            and di.dispatcher_unit_id=#{fid}
        </if>
        limit #{current},#{size};
    </select>
    <!--服务单位下拉-->
    <select id="selectFw" resultType="java.util.HashMap">
@@ -1338,4 +1335,83 @@
        GROUP BY
        i.enterpriseName,j.dept_name
    </select>
    <!--违规经营-->
    <select id="selectWg" resultType="java.util.HashMap">
        SELECT A.enterpriseName,
               A.representative,
               A.establishTime,
               A.registeredCapital,
               A.capital,
               A.representativecell,
               A.contacts,
               A.contactscell,
               A.deptname,
               A.jurname,
               IFNULL(B.cznum, 0) AS cznum,
               IFNULL(C.sbnum, 0) AS sbnum,
               IFNULL(D.znum, 0)  AS znum
        FROM (
                 SELECT u.enterpriseName,
                        u.representative,
                        u.establishTime,
                        u.registeredCapital,
                        u.capital,
                        u.representativecell,
                        u.contacts,
                        u.contactscell,
                        u.departmentid,
                        u.jurisdiction,
                        d.dept_name AS deptname,
                        j.dept_name AS jurname
                 FROM sys_information u
                          LEFT JOIN blade_dept d ON d.id = u.departmentid
                          LEFT JOIN sys_jurisdiction j ON j.id = u.jurisdiction
                 GROUP BY u.enterpriseName,
                          u.representative,
                          u.establishTime,
                          u.registeredCapital,
                          u.capital,
                          u.representativecell,
                          u.contacts,
                          u.contactscell,
                          u.departmentid,
                          u.jurisdiction,
                          d.dept_name,
                          j.dept_name
             ) A
                 LEFT JOIN (
            SELECT COUNT(*) AS cznum,
                   dept_id
            FROM blade_user
            WHERE hold = 1
              AND role_id = '1412226235153731586'
              AND is_deleted = 0
            GROUP BY dept_id
        ) B ON B.dept_id = A.departmentid
                 LEFT JOIN (
            SELECT COUNT(*) AS sbnum,
                   dept_id
            FROM blade_user
            WHERE soil = 0
              AND role_id = '1412226235153731586'
              AND is_deleted = 0
            GROUP BY dept_id
        ) C ON C.dept_id = A.departmentid
                 LEFT JOIN (SELECT COUNT(*) AS znum, dept_id
                            FROM blade_user
                            WHERE role_id = '1412226235153731586'
                              AND is_deleted = 0
                            GROUP BY dept_id) D ON D.dept_id = A.departmentid
    </select>
    <!--经营不善-->
    <select id="selectJy" resultType="java.util.HashMap">
        SELECT i.*,
               IFNULL(d.num, 0) as num
        FROM sys_information i
                 LEFT JOIN (SELECT COUNT(*) num, dept_id FROM sys_dispatcher_unit GROUP BY dept_id) d
                           ON i.departmentid = d.dept_id
    </select>
</mapper>