tangzy
2021-07-21 3604c7d101c8c3fc89e67574116610be792fc833
1.导入
1 files modified
1 files added
219 ■■■■ changed files
src/main/java/org/springblade/modules/information/mapper/InformationMapper.xml 175 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/social/excel/SocialImporter.java 44 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/information/mapper/InformationMapper.xml
@@ -260,76 +260,97 @@
    <!--总保安数量-->
    <select id="queryCountB" resultType="java.util.HashMap">
        SELECT ISNULL(A.thisnum, 0) as thisnum,
        ISNULL(B.lastnum, 0) as lastnum
        SELECT C.thisnum,
               C.lastnum,
               d.dept_name as deptname,
               j.dept_name as jurname
        FROM (
        SELECT COUNT
        (*) AS thisnum,
        dept_id
        FROM blade_user
        WHERE dept_id IN (SELECT i.departmentid
        FROM sys_information i
        LEFT JOIN sys_jurisdiction j ON j.id = i.jurisdiction where 1=1
                 SELECT ISNULL(A.thisnum, 0) AS thisnum,
                        ISNULL(B.lastnum, 0) AS lastnum,
                        A.dept_id,
                        A.jurisdiction
                 FROM (
                          SELECT COUNT
                                     (*) AS thisnum,
                                 dept_id,
                                 jurisdiction
                          FROM blade_user
                          WHERE dept_id IN (
                              SELECT i.departmentid
                              FROM sys_information i
                                       INNER JOIN sys_jurisdiction j ON j.id = i.jurisdiction
                              GROUP BY i.departmentid
                          )
                            AND role_id = '1413323482159321089'
                            AND datediff(
                                    MONTH, create_time,
                                           getdate()) = 0
                          GROUP BY dept_id,
                                   jurisdiction
                      ) A
                          FULL JOIN (
                     SELECT COUNT
                                (*) AS lastnum,
                            dept_id,
                            jurisdiction
                     FROM blade_user
                     WHERE dept_id IN (SELECT i.departmentid
                                       FROM sys_information i
                                                LEFT JOIN sys_jurisdiction j ON j.id = i.jurisdiction
                                       GROUP BY i.departmentid)
                       AND role_id = '1413323482159321089'
                       AND datediff(
                               MONTH, create_time,
                                      getdate()) = 1
                     GROUP BY dept_id,
                              jurisdiction
                 ) B ON A.dept_id = B.dept_id) C
                 LEFT JOIN blade_dept d ON C.dept_id = d.id
                 LEFT JOIN sys_jurisdiction j ON j.id = C.jurisdiction where 1=1
        <if test="jurisdiction!=null and jurisdiction!=''">
            and i.jurisdiction =#{jurisdiction}
        and C.jurisdiction =#{jurisdiction}
        </if>
        GROUP BY i.departmentid)
        AND role_id = '1413323482159321089'
        <if test="deptid!=null and deptid!=''">
            and deptid =#{deptid}
            and C.dept_id =#{deptid}
        </if>
        AND datediff(
        MONTH, create_time,
        getdate()) = 0
        GROUP BY dept_id
        ) A
        FULL JOIN (
        SELECT COUNT
        (*) AS lastnum,
        dept_id
        FROM blade_user
        WHERE dept_id IN (SELECT i.departmentid
        FROM sys_information i
        LEFT JOIN sys_jurisdiction j ON j.id = i.jurisdiction
        GROUP BY i.departmentid)
        AND role_id = '1413323482159321089'
        AND datediff(
        MONTH, create_time,
        getdate()) = 1
        GROUP BY dept_id
        ) B ON A.dept_id = B.dept_id
    </select>
    <!--正常保安数量-->
    <select id="queryCountZc" resultType="java.util.HashMap">
        SELECT ISNULL(A.thisnum, 0) as thisnum,
        ISNULL(B.lastnum, 0) as lastnum
        SELECT C.thisnum,
        C.lastnum,
        d.dept_name as deptname,
        j.dept_name as jurname
        FROM (
        SELECT ISNULL(A.thisnum, 0) AS thisnum,
        ISNULL(B.lastnum, 0) AS lastnum,
        A.dept_id,
        A.jurisdiction
        FROM (
        SELECT COUNT
        (*) AS thisnum,
        dept_id
        dept_id,
        jurisdiction
        FROM blade_user
        WHERE dept_id IN (SELECT i.departmentid
        WHERE dept_id IN (
        SELECT i.departmentid
        FROM sys_information i
        LEFT JOIN sys_jurisdiction j ON j.id = i.jurisdiction where 1=1
        <if test="jurisdiction!=null and jurisdiction!=''">
            and i.jurisdiction =#{jurisdiction}
        </if>
        GROUP BY i.departmentid)
        INNER JOIN sys_jurisdiction j ON j.id = i.jurisdiction
        GROUP BY i.departmentid
        )
        AND role_id = '1413323482159321089'
        AND examination = 0
        <if test="deptid!=null and deptid!=''">
            and deptid =#{deptid}
        </if>
        AND datediff(
        MONTH, create_time,
        getdate()) = 0
        GROUP BY dept_id
        GROUP BY dept_id,
        jurisdiction
        ) A
        FULL JOIN (
        SELECT COUNT
        (*) AS lastnum,
        dept_id
        dept_id,
        jurisdiction
        FROM blade_user
        WHERE dept_id IN (SELECT i.departmentid
        FROM sys_information i
@@ -340,40 +361,55 @@
        AND datediff(
        MONTH, create_time,
        getdate()) = 1
        GROUP BY dept_id
        ) B ON A.dept_id = B.dept_id
        GROUP BY dept_id,
        jurisdiction
        ) B ON A.dept_id = B.dept_id) C
        LEFT JOIN blade_dept d ON C.dept_id = d.id
        LEFT JOIN sys_jurisdiction j ON j.id = C.jurisdiction where 1=1
        <if test="jurisdiction!=null and jurisdiction!=''">
            and C.jurisdiction =#{jurisdiction}
        </if>
        <if test="deptid!=null and deptid!=''">
            and C.dept_id =#{deptid}
        </if>
    </select>
    <!--持证保安数量-->
    <select id="queryCountCz" resultType="java.util.HashMap">
        SELECT ISNULL(A.thisnum, 0) as thisnum,
        ISNULL(B.lastnum, 0) as lastnum
        SELECT C.thisnum,
        C.lastnum,
        d.dept_name as deptname,
        j.dept_name as jurname
        FROM (
        SELECT ISNULL(A.thisnum, 0) AS thisnum,
        ISNULL(B.lastnum, 0) AS lastnum,
        A.dept_id,
        A.jurisdiction
        FROM (
        SELECT COUNT
        (*) AS thisnum,
        dept_id
        dept_id,
        jurisdiction
        FROM blade_user
        WHERE dept_id IN (SELECT i.departmentid
        WHERE dept_id IN (
        SELECT i.departmentid
        FROM sys_information i
        LEFT JOIN sys_jurisdiction j ON j.id = i.jurisdiction where 1=1
        <if test="jurisdiction!=null and jurisdiction!=''">
            and i.jurisdiction =#{jurisdiction}
        </if>
        GROUP BY i.departmentid)
        INNER JOIN sys_jurisdiction j ON j.id = i.jurisdiction
        GROUP BY i.departmentid
        )
        AND role_id = '1413323482159321089'
        AND hold = 0
        <if test="deptid!=null and deptid!=''">
            and deptid =#{deptid}
        </if>
        AND datediff(
        MONTH, create_time,
        getdate()) = 0
        GROUP BY dept_id
        GROUP BY dept_id,
        jurisdiction
        ) A
        FULL JOIN (
        SELECT COUNT
        (*) AS lastnum,
        dept_id
        dept_id,
        jurisdiction
        FROM blade_user
        WHERE dept_id IN (SELECT i.departmentid
        FROM sys_information i
@@ -384,8 +420,17 @@
        AND datediff(
        MONTH, create_time,
        getdate()) = 1
        GROUP BY dept_id
        ) B ON A.dept_id = B.dept_id
        GROUP BY dept_id,
        jurisdiction
        ) B ON A.dept_id = B.dept_id) C
        LEFT JOIN blade_dept d ON C.dept_id = d.id
        LEFT JOIN sys_jurisdiction j ON j.id = C.jurisdiction where 1=1
        <if test="jurisdiction!=null and jurisdiction!=''">
            and C.jurisdiction =#{jurisdiction}
        </if>
        <if test="deptid!=null and deptid!=''">
            and C.dept_id =#{deptid}
        </if>
    </select>
    <!--缴纳社保数量-->
src/main/java/org/springblade/modules/social/excel/SocialImporter.java
New file
@@ -0,0 +1,44 @@
/*
 *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
 *
 *  Redistribution and use in source and binary forms, with or without
 *  modification, are permitted provided that the following conditions are met:
 *
 *  Redistributions of source code must retain the above copyright notice,
 *  this list of conditions and the following disclaimer.
 *  Redistributions in binary form must reproduce the above copyright
 *  notice, this list of conditions and the following disclaimer in the
 *  documentation and/or other materials provided with the distribution.
 *  Neither the name of the dreamlu.net developer nor the names of its
 *  contributors may be used to endorse or promote products derived from
 *  this software without specific prior written permission.
 *  Author: Chill 庄骞 (smallchill@163.com)
 */
package org.springblade.modules.social.excel;
import lombok.RequiredArgsConstructor;
import org.springblade.core.excel.support.ExcelImporter;
import org.springblade.modules.social.service.ISocialService;
import org.springblade.modules.system.excel.UserExcel;
import org.springblade.modules.system.service.IUserService;
import java.util.List;
/**
 * 用户数据导入类
 *
 * @author Chill
 */
@RequiredArgsConstructor
public class SocialImporter implements ExcelImporter<SocialExcel> {
    private final ISocialService iSocialService;
    private final Boolean isCovered;
    private final String deptid;
    @Override
    public void save(List<SocialExcel> data) {
        iSocialService.importUser(data, isCovered,deptid);
    }
}