智慧保安后台管理-外网项目备份
tangzy
2021-08-28 f6abb1756eb209c072285b113ba1b79068a85fe2
1.统计
6 files modified
113 ■■■■■ changed files
src/main/java/org/springblade/modules/information/mapper/InformationMapper.xml 95 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/social/controller/SocialController.java 1 ●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/social/mapper/SocialMapper.java 2 ●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/social/mapper/SocialMapper.xml 4 ●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/social/service/ISocialService.java 1 ●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/social/service/impl/SocialServiceImpl.java 10 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/information/mapper/InformationMapper.xml
@@ -142,49 +142,68 @@
    <!--资格审查异常数量-->
    <select id="selectExtype" resultType="java.util.HashMap">
        SELECT IFNULL(A.num,0) AS zc,IFNULL(B.num ,0) AS bzc
        FROM (
        SELECT COUNT(*) AS num,
        u.dept_id,u.jurisdiction
        FROM blade_user u
        WHERE u.examination_type = 0
        GROUP BY u.dept_id,u.jurisdiction
        ) A
        LEFT JOIN (
        SELECT COUNT(*) AS num,
        u.dept_id,u.jurisdiction
        FROM blade_user u
        WHERE u.examination_type = 1
        GROUP BY u.dept_id,u.jurisdiction
        ) B ON A.dept_id = B.dept_id
        <if test="jurisdiction!=null and jurisdiction=='' and jurisdiction!='1123598813738675201'">
            WHERE A.jurisdiction = #{jurisdiction}
        SELECT
        IFNULL( A.num, 0 ) AS zc,
        IFNULL( B.num, 0 ) AS bzc
        FROM
        (
        SELECT departmentid, jurisdiction FROM sys_information GROUP BY departmentid, jurisdiction ) H
        LEFT JOIN ( SELECT COUNT(*) AS num, u.dept_id FROM blade_user u WHERE u.examination_type = 0 GROUP BY u.dept_id
        ) A ON H.departmentid = A.dept_id
        LEFT JOIN ( SELECT COUNT(*) AS num, u.dept_id FROM blade_user u WHERE u.examination_type = 1 GROUP BY u.dept_id
        ) B ON H.departmentid = B.dept_id where 1=1
        <if test="jurisdiction!=null and jurisdiction!='' and jurisdiction!='1123598813738675201'">
            and H.jurisdiction = #{jurisdiction}
        </if>
        <if test="deptid!=null and deptid!=''">
            WHERE A.dept_id = #{deptid}
            and H.departmentid = #{deptid}
        </if>
    </select>
    <!--保安员持证和未持证数量-->
    <select id="selectHold" resultType="java.util.HashMap">
        SELECT IFNULL(A.thisnum, 0) AS cz,
        IFNULL(B.lastnum, 0) AS wcz
        FROM (SELECT COUNT(*) AS thisnum, dept_id,jurisdiction
        FROM blade_user
        WHERE role_id = '1412226235153731586' AND `status`=1 AND is_deleted=0
        SELECT
        IFNULL( A.thisnum, 0 ) AS cz,
        IFNULL( B.lastnum, 0 ) AS wcz
        FROM
        (
        SELECT departmentid,jurisdiction FROM sys_information GROUP BY departmentid,jurisdiction
        ) H
        LEFT JOIN(
        SELECT
        COUNT( * ) AS thisnum,
        dept_id
        FROM
        blade_user
        WHERE
        ( role_id = '1412226235153731586' OR role_id = '1416733602219110402' )
        AND `status` = 1
        AND is_deleted = 0
        AND hold = 1
        GROUP BY dept_id,jurisdiction) A
        LEFT JOIN (SELECT COUNT(*) AS lastnum, dept_id,jurisdiction
        FROM blade_user
        WHERE role_id = '1412226235153731586' AND `status`=1 AND is_deleted=0
        GROUP BY
        dept_id
        ) A ON A.dept_id=H.departmentid
        LEFT JOIN (
        SELECT
        COUNT(*) AS lastnum,
        dept_id
        FROM
        blade_user
        WHERE
        ( role_id = '1412226235153731586' OR role_id = '1416733602219110402' )
        AND `status` = 1
        AND is_deleted = 0
        AND hold = 2
        GROUP BY dept_id,jurisdiction) B ON A.dept_id = B.dept_id
        <if test="jurisdiction!=null and jurisdiction=='' and jurisdiction!='1123598813738675201'">
            WHERE A.jurisdiction = #{jurisdiction}
        </if>
        GROUP BY
        dept_id
        ) B ON B.dept_id=H.departmentid
        where 1=1
        <if test="deptid!=null and deptid!=''">
            WHERE A.dept_id = #{deptid}
            and H.departmentid = #{deptid}
        </if>
        <if test="jurisdiction!=null and jurisdiction!='' and jurisdiction!='1123598813738675201'">
            and H.jurisdiction = #{jurisdiction}
        </if>
    </select>
    <!--派遣服务单位统计-->
@@ -209,12 +228,12 @@
        FROM blade_user
        WHERE role_id = '1412226235153731586' AND `status`=1 AND is_deleted=0
        AND dispatch = 0
        GROUP BY dept_id,jurisdiction) B ON A.dept_id = B.dept_id
        GROUP BY dept_id,jurisdiction) B ON A.dept_id = B.dept_id where 1=1
        <if test="jurisdiction!=null and jurisdiction!='' and jurisdiction!='1123598813738675201'">
            WHERE A.jurisdiction = #{jurisdiction}
            and A.jurisdiction = #{jurisdiction}
        </if>
        <if test="deptid!=null and deptid!=''">
            WHERE A.dept_id = #{deptid}
            and A.dept_id = #{deptid}
        </if>
    </select>
@@ -228,12 +247,12 @@
        GROUP BY dept_id) A ON A.dept_id = H.departmentid
        LEFT JOIN (SELECT COUNT(*) AS numz, dept_id FROM blade_user WHERE `status` = 1 AND is_deleted = 0 GROUP BY
        dept_id) B
        ON H.departmentid = B.dept_id
        ON H.departmentid = B.dept_id where 1=1
        <if test="jurisdiction!=null and jurisdiction!='' and jurisdiction!='1123598813738675201'">
            WHERE H.jurisdiction = #{jurisdiction}
            and H.jurisdiction = #{jurisdiction}
        </if>
        <if test="deptid!=null and deptid!=''">
            WHERE H.departmentid = #{deptid}
            and H.departmentid = #{deptid}
        </if>
    </select>
src/main/java/org/springblade/modules/social/controller/SocialController.java
@@ -95,6 +95,7 @@
    @ApiOperationSupport(order = 4)
    @ApiOperation(value = "新增", notes = "传入social")
    public R save(@Valid @RequestBody Social social) {
        socialService.upSoil(social.getCardid());
        return R.status(socialService.save(social));
    }
src/main/java/org/springblade/modules/social/mapper/SocialMapper.java
@@ -39,5 +39,5 @@
     * @return
     */
    List<SocialVO> selectSocialPage(IPage page, SocialVO social);
  void upSoil(String cardid);
}
src/main/java/org/springblade/modules/social/mapper/SocialMapper.xml
@@ -24,4 +24,8 @@
        select * from sys_social
    </select>
    <update id="upSoil">
        update blade_use set soil=0 where cardid=#{cardid}
    </update>
</mapper>
src/main/java/org/springblade/modules/social/service/ISocialService.java
@@ -48,4 +48,5 @@
     * @return
     */
    void importUser(List<SocialExcel> data, Boolean isCovered,String deptid);
    void upSoil(String cardid);
}
src/main/java/org/springblade/modules/social/service/impl/SocialServiceImpl.java
@@ -18,6 +18,7 @@
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import lombok.AllArgsConstructor;
import org.springblade.core.tool.utils.BeanUtil;
import org.springblade.modules.social.entity.Social;
import org.springblade.modules.social.excel.SocialExcel;
@@ -36,7 +37,10 @@
 * @since 2021-07-16
 */
@Service
@AllArgsConstructor
public class SocialServiceImpl extends ServiceImpl<SocialMapper, Social> implements ISocialService {
    private final ISocialService iSocialService;
    @Override
    public IPage<SocialVO> selectSocialPage(IPage<SocialVO> page, SocialVO social) {
@@ -48,8 +52,14 @@
        data.forEach(SocialExcel -> {
            Social social = Objects.requireNonNull(BeanUtil.copy(SocialExcel, Social.class));
            social.setDeptid(deptid);
            iSocialService.upSoil(social.getCardid());
            this.save(social);
        });
    }
    @Override
    public void upSoil(String cardid) {
        baseMapper.upSoil(cardid);
    }
}