Commit 7074f2be authored by KeYong's avatar KeYong

提交人员联调

parent 387fa00f
...@@ -172,4 +172,8 @@ WHERE ...@@ -172,4 +172,8 @@ WHERE
GROUP BY b.`code` GROUP BY b.`code`
ORDER BY b.`code` ORDER BY b.`code`
</select> </select>
<select id="getYWPersonInfo" resultType="Map">
</select>
</mapper> </mapper>
...@@ -2,6 +2,9 @@ package com.yeejoin.amos.boot.module.common.api.mapper; ...@@ -2,6 +2,9 @@ package com.yeejoin.amos.boot.module.common.api.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yeejoin.amos.boot.module.common.api.entity.FirefightersPost; import com.yeejoin.amos.boot.module.common.api.entity.FirefightersPost;
import org.apache.ibatis.annotations.Param;
import java.util.Map;
/** /**
* 岗位信息 Mapper 接口 * 岗位信息 Mapper 接口
...@@ -11,4 +14,11 @@ import com.yeejoin.amos.boot.module.common.api.entity.FirefightersPost; ...@@ -11,4 +14,11 @@ import com.yeejoin.amos.boot.module.common.api.entity.FirefightersPost;
*/ */
public interface FirefightersPostMapper extends BaseMapper<FirefightersPost> { public interface FirefightersPostMapper extends BaseMapper<FirefightersPost> {
Map<String, Object> getFirePersonJobInfo(@Param("bizOrgCode") String bizOrgCode);
Map<String, Object> getYWPersonJobInfo(@Param("bizOrgCode") String bizOrgCode);
Map<String, Object> getZZPersonInfo(@Param("bizOrgCode") String bizOrgCode);
Map<String, Object> getYWPersonInfo(@Param("bizOrgCode") String bizOrgCode);
} }
package com.yeejoin.amos.boot.module.common.api.mapper; package com.yeejoin.amos.boot.module.common.api.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.yeejoin.amos.boot.module.common.api.dto.*; import com.yeejoin.amos.boot.module.common.api.dto.*;
import com.yeejoin.amos.boot.module.common.api.entity.DynamicFormInstance; import com.yeejoin.amos.boot.module.common.api.entity.DynamicFormInstance;
import com.yeejoin.amos.boot.module.common.api.entity.OrgUsr; import com.yeejoin.amos.boot.module.common.api.entity.OrgUsr;
...@@ -158,8 +159,6 @@ public interface OrgUsrMapper extends BaseMapper<OrgUsr> { ...@@ -158,8 +159,6 @@ public interface OrgUsrMapper extends BaseMapper<OrgUsr> {
void updatePersonStatus(String status, String id); void updatePersonStatus(String status, String id);
List<Map<String, Object>> getFireProtectionAndMaintenance();
Map<String, Object> getPersonType(@Param("typeCode") String typeCode); Map<String, Object> getPersonType(@Param("typeCode") String typeCode);
List<Map<String, Object>> reportResult(String startTime, String endTime, String bizOrgCode); List<Map<String, Object>> reportResult(String startTime, String endTime, String bizOrgCode);
...@@ -169,4 +168,8 @@ public interface OrgUsrMapper extends BaseMapper<OrgUsr> { ...@@ -169,4 +168,8 @@ public interface OrgUsrMapper extends BaseMapper<OrgUsr> {
int getManagePersonCount(@Param("map") Map<String, Object> map); int getManagePersonCount(@Param("map") Map<String, Object> map);
List<Map<String, Object>> getManagePersonPage(@Param("map") Map<String, Object> map); List<Map<String, Object>> getManagePersonPage(@Param("map") Map<String, Object> map);
IPage<Map<String, Object>> getPage(IPage<?> page, @Param("bizOrgCode") String bizOrgCode, @Param("peopleTypeCode") String peopleTypeCode);
IPage<Map<String, Object>> getCenterPersonInfoPage(IPage<?> page, @Param("bizOrgCode") String bizOrgCode, @Param("stationType") String stationType);
} }
...@@ -409,4 +409,8 @@ public interface IOrgUsrService { ...@@ -409,4 +409,8 @@ public interface IOrgUsrService {
IPage<Map<String, Object>> getManagePersonPage(String pageNum, String pageSize, String bizOrgCode, String code, String personStatus); IPage<Map<String, Object>> getManagePersonPage(String pageNum, String pageSize, String bizOrgCode, String code, String personStatus);
OrgUsr getUnitByOrgCode(String bizOrgCode); OrgUsr getUnitByOrgCode(String bizOrgCode);
IPage<Map<String, Object>> queryPersonPage(IPage<Map<String, Object>> page, String bizOrgCode, String peopleTypeCode);
IPage<Map<String, Object>> getCenterPersonInfoPage(IPage<Map<String, Object>> page, String bizOrgCode, String stationType);
} }
...@@ -2,4 +2,373 @@ ...@@ -2,4 +2,373 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yeejoin.amos.boot.module.common.api.mapper.FirefightersPostMapper"> <mapper namespace="com.yeejoin.amos.boot.module.common.api.mapper.FirefightersPostMapper">
<select id="getFirePersonJobInfo" resultType="Map">
SELECT * FROM (
(SELECT
COUNT(1) AS xfNum
FROM
cb_org_usr c
LEFT JOIN cb_firefighters cf ON CONCAT(c.sequence_nbr, '') = cf.org_usr_id AND cf.is_delete = 0
LEFT JOIN cb_firefighters_post cfp ON cfp.org_usr_id = c.sequence_nbr AND cfp.is_delete = 0
WHERE
c.sequence_nbr IS NOT NULL AND cfp.firefighters_id IS NOT NULL AND concat(cfp.post_qualification_code, ',') regexp concat(replace('1421,1422,1423,1424,1425',',',',|'),',') > 0
<if test='bizOrgCode!=null and bizOrgCode!=""'>and cf.biz_org_code like concat (#{bizOrgCode},'%')</if>) AS xfNum,
(SELECT
COUNT(1) AS ssczyNum
FROM
cb_org_usr c
LEFT JOIN cb_firefighters cf ON CONCAT(c.sequence_nbr, '') = cf.org_usr_id AND cf.is_delete = 0
LEFT JOIN cb_firefighters_post cfp ON cfp.org_usr_id = c.sequence_nbr AND cfp.is_delete = 0
WHERE
c.sequence_nbr IS NOT NULL AND cfp.firefighters_id IS NOT NULL AND concat(cfp.post_qualification_code, ',') regexp concat(replace('1427,1428,1429,1430,1431',',',',|'),',') > 0
<if test='bizOrgCode!=null and bizOrgCode!=""'>and cf.biz_org_code like concat (#{bizOrgCode},'%')</if>) AS ssczyNum,
(SELECT
COUNT(1) AS yjjyNum
FROM
cb_org_usr c
LEFT JOIN cb_firefighters cf ON CONCAT(c.sequence_nbr, '') = cf.org_usr_id AND cf.is_delete = 0
LEFT JOIN cb_firefighters_post cfp ON cfp.org_usr_id = c.sequence_nbr AND cfp.is_delete = 0
WHERE
c.sequence_nbr IS NOT NULL AND cfp.firefighters_id IS NOT NULL AND concat(cfp.post_qualification_code, ',') regexp concat(replace('1823,1824,1825,1826,1827',',',',|'),',') > 0
<if test='bizOrgCode!=null and bizOrgCode!=""'>and cf.biz_org_code like concat (#{bizOrgCode},'%')</if>) AS yjjyNum,
(SELECT
COUNT(1) AS total
FROM
cb_org_usr c
LEFT JOIN cb_firefighters cf ON CONCAT(c.sequence_nbr, '') = cf.org_usr_id AND cf.is_delete = 0
LEFT JOIN cb_firefighters_post cfp ON cfp.org_usr_id = c.sequence_nbr AND cfp.is_delete = 0
WHERE
c.sequence_nbr IS NOT NULL AND cfp.firefighters_id IS NOT NULL
<if test='bizOrgCode!=null and bizOrgCode!=""'>and cf.biz_org_code like concat (#{bizOrgCode},'%')</if>) AS total,
(SELECT
COUNT(1) AS firePersonHasCard
FROM
cb_org_usr c
LEFT JOIN cb_firefighters cf ON CONCAT(c.sequence_nbr, '') = cf.org_usr_id AND cf.is_delete = 0
LEFT JOIN cb_firefighters_post cfp ON cfp.org_usr_id = c.sequence_nbr AND cfp.is_delete = 0
WHERE
c.sequence_nbr IS NOT NULL AND cfp.firefighters_id IS NOT NULL AND concat(cfp.post_qualification_code, ',') regexp concat(replace('1421,1422,1423,1424,1425,1823,1824,1825,1826,1827',',',',|'),',') > 0
<if test='bizOrgCode!=null and bizOrgCode!=""'>and cf.biz_org_code like concat (#{bizOrgCode},'%')</if>) AS firePersonHasCard
)
</select>
<select id="getYWPersonJobInfo" resultType="Map">
SELECT
*
FROM
(
(
SELECT
count( 1 ) AS total
FROM
(
SELECT
*
FROM
(
SELECT
ou.sequence_nbr,
ou.biz_org_type,
ou.biz_org_name,
ou.biz_org_code,
IFNULL( MAX( CASE WHEN cfi.field_code = 'peopleType' THEN field_value END ), '' ) AS peopleType,
ou.is_delete
FROM
cb_org_usr ou
LEFT JOIN cb_dynamic_form_instance cfi ON ou.sequence_nbr = cfi.instance_id
WHERE
ou.is_delete = '0'
GROUP BY
ou.sequence_nbr
) c
WHERE
c.peopleType = '1602'
) a
LEFT JOIN cb_firefighters_post fp ON a.sequence_nbr = fp.org_usr_id
WHERE
a.biz_org_name IS NOT NULL
AND a.is_delete = 0
AND a.biz_org_type = 'PERSON'
<if test='bizOrgCode!=null and bizOrgCode!=""'>and LEFT(a.biz_org_code,18) like concat (#{bizOrgCode},'%')</if>
) AS total,
(
SELECT
count( 1 ) AS cjssczyNum
FROM
(
SELECT
*
FROM
(
SELECT
ou.sequence_nbr,
ou.biz_org_type,
ou.biz_org_name,
ou.biz_org_code,
IFNULL( MAX( CASE WHEN cfi.field_code = 'peopleType' THEN field_value END ), '' ) AS peopleType,
ou.is_delete
FROM
cb_org_usr ou
LEFT JOIN cb_dynamic_form_instance cfi ON ou.sequence_nbr = cfi.instance_id
WHERE
ou.is_delete = '0'
GROUP BY
ou.sequence_nbr
) c
WHERE
c.peopleType = '1602'
) a
LEFT JOIN cb_firefighters_post fp ON a.sequence_nbr = fp.org_usr_id
WHERE
a.biz_org_name IS NOT NULL
AND a.is_delete = 0
AND a.biz_org_type = 'PERSON'
AND concat( fp.post_qualification_code, ',' ) REGEXP concat( REPLACE ( '1427', ',', ',|' ), ',' ) > 0
<if test='bizOrgCode!=null and bizOrgCode!=""'>and LEFT(a.biz_org_code,18) like concat (#{bizOrgCode},'%')</if>
) AS cjssczyNum,
(
SELECT
count( 1 ) AS zjssczyNum
FROM
(
SELECT
*
FROM
(
SELECT
ou.sequence_nbr,
ou.biz_org_type,
ou.biz_org_name,
ou.biz_org_code,
IFNULL( MAX( CASE WHEN cfi.field_code = 'peopleType' THEN field_value END ), '' ) AS peopleType,
ou.is_delete
FROM
cb_org_usr ou
LEFT JOIN cb_dynamic_form_instance cfi ON ou.sequence_nbr = cfi.instance_id
WHERE
ou.is_delete = '0'
GROUP BY
ou.sequence_nbr
) c
WHERE
c.peopleType = '1602'
) a
LEFT JOIN cb_firefighters_post fp ON a.sequence_nbr = fp.org_usr_id
WHERE
a.biz_org_name IS NOT NULL
AND a.is_delete = 0
AND a.biz_org_type = 'PERSON'
AND concat( fp.post_qualification_code, ',' ) REGEXP concat( REPLACE ( '1428', ',', ',|' ), ',' ) > 0
<if test='bizOrgCode!=null and bizOrgCode!=""'>and LEFT(a.biz_org_code,18) like concat (#{bizOrgCode},'%')</if>
) AS zjssczyNum,
(
SELECT
count( 1 ) AS gjssczyNum
FROM
(
SELECT
*
FROM
(
SELECT
ou.sequence_nbr,
ou.biz_org_type,
ou.biz_org_name,
ou.biz_org_code,
IFNULL( MAX( CASE WHEN cfi.field_code = 'peopleType' THEN field_value END ), '' ) AS peopleType,
ou.is_delete
FROM
cb_org_usr ou
LEFT JOIN cb_dynamic_form_instance cfi ON ou.sequence_nbr = cfi.instance_id
WHERE
ou.is_delete = '0'
GROUP BY
ou.sequence_nbr
) c
WHERE
c.peopleType = '1602'
) a
LEFT JOIN cb_firefighters_post fp ON a.sequence_nbr = fp.org_usr_id
WHERE
a.biz_org_name IS NOT NULL
AND a.is_delete = 0
AND a.biz_org_type = 'PERSON'
AND concat( fp.post_qualification_code, ',' ) REGEXP concat( REPLACE ( '1429', ',', ',|' ), ',' ) > 0
<if test='bizOrgCode!=null and bizOrgCode!=""'>and LEFT(a.biz_org_code,18) like concat (#{bizOrgCode},'%')</if>
) AS gjssczyNum,
(
SELECT
count( 1 ) AS yjjzjgxfjsNum
FROM
(
SELECT
*
FROM
(
SELECT
ou.sequence_nbr,
ou.biz_org_type,
ou.biz_org_name,
ou.biz_org_code,
IFNULL( MAX( CASE WHEN cfi.field_code = 'peopleType' THEN field_value END ), '' ) AS peopleType,
ou.is_delete
FROM
cb_org_usr ou
LEFT JOIN cb_dynamic_form_instance cfi ON ou.sequence_nbr = cfi.instance_id
WHERE
ou.is_delete = '0'
GROUP BY
ou.sequence_nbr
) c
WHERE
c.peopleType = '1602'
) a
LEFT JOIN cb_firefighters_post fp ON a.sequence_nbr = fp.org_usr_id
WHERE
a.biz_org_name IS NOT NULL
AND a.is_delete = 0
AND a.biz_org_type = 'PERSON'
AND concat( fp.post_qualification_code, ',' ) REGEXP concat( REPLACE ( '1430', ',', ',|' ), ',' ) > 0
<if test='bizOrgCode!=null and bizOrgCode!=""'>and LEFT(a.biz_org_code,18) like concat (#{bizOrgCode},'%')</if>
) AS yjjzjgxfjsNum,
(
SELECT
count( 1 ) AS ejjzjgxfjsNum
FROM
(
SELECT
*
FROM
(
SELECT
ou.sequence_nbr,
ou.biz_org_type,
ou.biz_org_name,
ou.biz_org_code,
IFNULL( MAX( CASE WHEN cfi.field_code = 'peopleType' THEN field_value END ), '' ) AS peopleType,
ou.is_delete
FROM
cb_org_usr ou
LEFT JOIN cb_dynamic_form_instance cfi ON ou.sequence_nbr = cfi.instance_id
WHERE
ou.is_delete = '0'
GROUP BY
ou.sequence_nbr
) c
WHERE
c.peopleType = '1602'
) a
LEFT JOIN cb_firefighters_post fp ON a.sequence_nbr = fp.org_usr_id
WHERE
a.biz_org_name IS NOT NULL
AND a.is_delete = 0
AND a.biz_org_type = 'PERSON'
AND concat( fp.post_qualification_code, ',' ) REGEXP concat( REPLACE ( '1431', ',', ',|' ), ',' ) > 0
<if test='bizOrgCode!=null and bizOrgCode!=""'>and LEFT(a.biz_org_code,18) like concat (#{bizOrgCode},'%')</if>
) AS ejjzjgxfjsNum
)
</select>
<select id="getZZPersonInfo" resultType="Map">
SELECT
d.zzTotal,
d.zzHasCard,
ABS(d.zzTotal - d.zzHasCard) AS hasNoCard,
ROUND( d.zzHasCard / d.zzTotal * 100, 2 ) AS percentageHas,
ROUND( ABS(d.zzTotal - d.zzHasCard) / d.zzTotal * 100, 2 ) AS percentageNo
FROM
(
SELECT
count( 1 ) AS zzTotal,
SUM(
IF
((
SELECT
concat( fp.post_qualification_code, ',' ) REGEXP concat( REPLACE ( '1421,1422,1423,1424,1425,1823,1824,1825,1826,1827', ',', ',|' ), ',' )) > 0,
1,
0
)) AS zzHasCard
FROM
(
SELECT
*
FROM
(
SELECT
ou.sequence_nbr,
ou.biz_org_type,
ou.biz_org_name,
ou.biz_org_code,
IFNULL( MAX( CASE WHEN cfi.field_code = 'peopleType' THEN field_value END ), '' ) AS peopleType,
ou.is_delete
FROM
cb_org_usr ou
LEFT JOIN cb_dynamic_form_instance cfi ON ou.sequence_nbr = cfi.instance_id
WHERE
ou.is_delete = '0'
GROUP BY
ou.sequence_nbr
) c
WHERE
c.peopleType = '1601'
) a
LEFT JOIN cb_firefighters_post fp ON a.sequence_nbr = fp.org_usr_id
WHERE
a.biz_org_name IS NOT NULL
AND a.is_delete = 0
AND a.biz_org_type = 'PERSON'
<if test='bizOrgCode!=null and bizOrgCode!=""'>and LEFT(a.biz_org_code,18) like concat (#{bizOrgCode},'%')</if>
) d
</select>
<select id="getYWPersonInfo" resultType="Map">
SELECT
d.ywTotal,
d.ywHasCard,
ABS(d.ywTotal - d.ywHasCard) AS hasNoCard,
ROUND( d.ywHasCard / d.ywTotal * 100, 2 ) AS percentageHas,
ROUND( ABS(d.ywTotal - d.ywHasCard) / d.ywTotal * 100, 2 ) AS percentageNo
FROM
(
SELECT
count( 1 ) AS ywTotal,
SUM(
IF
((
SELECT
concat( fp.post_qualification_code, ',' ) REGEXP concat( REPLACE ( '1427,1428,1429,1430,1431', ',', ',|' ), ',' )) > 0,
1,
0
)) AS ywHasCard
FROM
(
SELECT
*
FROM
(
SELECT
ou.sequence_nbr,
ou.biz_org_type,
ou.biz_org_name,
ou.biz_org_code,
IFNULL( MAX( CASE WHEN cfi.field_code = 'peopleType' THEN field_value END ), '' ) AS peopleType,
ou.is_delete
FROM
cb_org_usr ou
LEFT JOIN cb_dynamic_form_instance cfi ON ou.sequence_nbr = cfi.instance_id
WHERE
ou.is_delete = '0'
GROUP BY
ou.sequence_nbr
) c
WHERE
c.peopleType = '1602'
) a
LEFT JOIN cb_firefighters_post fp ON a.sequence_nbr = fp.org_usr_id
WHERE
a.biz_org_name IS NOT NULL
AND a.is_delete = 0
AND a.biz_org_type = 'PERSON'
<if test='bizOrgCode!=null and bizOrgCode!=""'>and LEFT(a.biz_org_code,18) like concat (#{bizOrgCode},'%')</if>
) d
</select>
</mapper> </mapper>
...@@ -1666,4 +1666,175 @@ ...@@ -1666,4 +1666,175 @@
ORDER BY a.personStatus DESC ORDER BY a.personStatus DESC
LIMIT #{map.pageNum}, #{map.pageSize} LIMIT #{map.pageNum}, #{map.pageSize}
</select> </select>
<select id="getPage" resultType="Map">
SELECT
a.sequence_nbr AS id,
a.biz_org_code AS bizOrgCode,
(
CASE
WHEN LENGTH( a.biz_org_code ) > 18 THEN
( SELECT cou.biz_org_name FROM cb_org_usr cou WHERE cou.biz_org_code = LEFT ( a.biz_org_code, 18 ) AND cou.biz_org_type = 'COMPANY' ) ELSE ( SELECT cou.biz_org_name FROM cb_org_usr cou WHERE cou.biz_org_code = LEFT ( a.biz_org_code, 6 ) AND cou.biz_org_type = 'COMPANY' )
END
) AS bizOrgName,
a.biz_org_name AS personName,
( CASE a.peopleType WHEN '1601' THEN '驻站消防员' WHEN '1602' THEN '运维人员' END ) AS peopleType,
(
CASE
WHEN a.peopleType = '1601' THEN
IFNULL((
SELECT
concat( fp.post_qualification_code, ',' ) REGEXP concat( REPLACE ( '1421,1422,1423,1424,1425,1823,1824,1825,1826,1827', ',', ',|' ), ',' )), 0)
WHEN a.peopleType = '1602' THEN
IFNULL((SELECT concat( fp.post_qualification_code, ',' ) REGEXP concat( REPLACE ( '1427,1428,1429,1430,1431', ',', ',|' ), ',' )), 0) END
) AS isOk,
fp.post_qualification_code AS qualificationCode
FROM
(
SELECT
*
FROM
(
SELECT
ou.sequence_nbr,
ou.biz_org_type,
ou.biz_org_name,
ou.biz_org_code,
IFNULL( MAX( CASE WHEN cfi.field_code = 'peopleType' THEN field_value END ), '' ) AS peopleType,
ou.is_delete
FROM
cb_org_usr ou
LEFT JOIN cb_dynamic_form_instance cfi ON ou.sequence_nbr = cfi.instance_id
WHERE
ou.is_delete = '0'
GROUP BY
ou.sequence_nbr
) c
WHERE
c.peopleType IN ( '1601', '1602' )
) a
LEFT JOIN cb_firefighters_post fp ON a.sequence_nbr = fp.org_usr_id
WHERE
a.biz_org_name IS NOT NULL
AND a.is_delete = 0
AND a.biz_org_type = 'PERSON'
<if test='bizOrgCode!=null and bizOrgCode!=""'>and LEFT(a.biz_org_code,18) like concat (#{bizOrgCode},'%')</if>
<if test='peopleTypeCode != null and peopleTypeCode != ""'>and a.peopleType like concat ('%', #{peopleTypeCode},'%')</if>
</select>
<select id="getCenterPersonInfoPage" resultType="Map">
SELECT
a.biz_org_code AS bizOrgCode,
(
CASE
WHEN LENGTH( a.biz_org_code ) > 18 THEN
( SELECT cou.biz_org_name FROM cb_org_usr cou WHERE cou.biz_org_code = LEFT ( a.biz_org_code, 18 ) AND cou.biz_org_type = 'COMPANY' ) ELSE ( SELECT cou.biz_org_name FROM cb_org_usr cou WHERE cou.biz_org_code = LEFT ( a.biz_org_code, 6 ) AND cou.biz_org_type = 'COMPANY' )
END
) AS bizOrgName,
SUM(
IF
( a.peopleType = '1601', 1, 0 )) AS fireNum,
SUM(
IF
( a.peopleType = '1602', 1, 0 )) AS ywNum,
ibsi.station_type AS stationType,
SUM(
IF
((
a.peopleType = '1601'
AND (
SELECT
concat( fp.post_qualification_code, ',' ) REGEXP concat( REPLACE ( '1421,1422,1423,1424,1425,1823,1824,1825,1826,1827', ',', ',|' ), ',' )) > 0
),
1,
0
)) AS fireIsOk,
SUM(
IF
((
a.peopleType = '1601'
AND (
SELECT
concat( fp.post_qualification_code, ',' ) REGEXP concat( REPLACE ( '1421,1422,1423,1424,1425,1823,1824,1825,1826,1827', ',', ',|' ), ',' )) = 0
OR (
SELECT
concat( fp.post_qualification_code, ',' ) REGEXP concat( REPLACE ( '1421,1422,1423,1424,1425,1823,1824,1825,1826,1827', ',', ',|' ), ',' ) IS NULL
AND a.peopleType = '1601'
)),
1,
0
)) AS fireNoCard,
SUM(
IF
((
a.peopleType = '1602'
AND (
SELECT
concat( fp.post_qualification_code, ',' ) REGEXP concat( REPLACE ( '1427,1428,1429,1430,1431', ',', ',|' ), ',' )) = 0
OR (
SELECT
concat( fp.post_qualification_code, ',' ) REGEXP concat( REPLACE ( '1427,1428,1429,1430,1431', ',', ',|' ), ',' ) IS NULL
AND a.peopleType = '1602'
)),
1,
0
)) AS ywNotOk,
SUM(
IF
((
a.peopleType = '1602'
AND (
SELECT
concat( fp.post_qualification_code, ',' ) REGEXP concat( REPLACE ( '1427', ',', ',|' ), ',' )) = 0
),
1,
0
)) AS ywCJ,
SUM(
IF
((
a.peopleType = '1602'
AND (
SELECT
concat( fp.post_qualification_code, ',' ) REGEXP concat( REPLACE ( '1428', ',', ',|' ), ',' )) = 0
),
1,
0
)) AS ywZJ
FROM
(
SELECT
*
FROM
(
SELECT
ou.sequence_nbr,
ou.biz_org_type,
ou.biz_org_name,
ou.biz_org_code,
IFNULL( MAX( CASE WHEN cfi.field_code = 'peopleType' THEN field_value END ), '' ) AS peopleType,
ou.is_delete
FROM
cb_org_usr ou
LEFT JOIN cb_dynamic_form_instance cfi ON ou.sequence_nbr = cfi.instance_id
WHERE
ou.is_delete = '0'
GROUP BY
ou.sequence_nbr
) c
WHERE
c.peopleType IN ( '1601', '1602' )
) a
LEFT JOIN cb_firefighters_post fp ON a.sequence_nbr = fp.org_usr_id
LEFT JOIN idx_biz_station_info ibsi ON LEFT ( a.biz_org_code, 18 ) = ibsi.biz_org_code
WHERE
a.biz_org_name IS NOT NULL
AND a.is_delete = 0
AND a.biz_org_type = 'PERSON'
<if test='bizOrgCode!=null and bizOrgCode!=""'>and LEFT(a.biz_org_code,18) like concat (#{bizOrgCode},'%')</if>
<if test='stationType != null and stationType != ""'>and ibsi.station_type like concat ('%', #{stationType},'%')</if>
GROUP BY
LEFT(a.biz_org_code,18)
</select>
</mapper> </mapper>
...@@ -63,6 +63,7 @@ import javax.annotation.Resource; ...@@ -63,6 +63,7 @@ import javax.annotation.Resource;
import java.io.Serializable; import java.io.Serializable;
import java.lang.reflect.Field; import java.lang.reflect.Field;
import java.lang.reflect.Method; import java.lang.reflect.Method;
import java.text.NumberFormat;
import java.text.ParseException; import java.text.ParseException;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.*; import java.util.*;
...@@ -91,6 +92,14 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp ...@@ -91,6 +92,14 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
private static final String FIREFIGHTERSID ="firefighters_id"; private static final String FIREFIGHTERSID ="firefighters_id";
private static final List<String> YJJYY = Arrays.asList("1823", "1824", "1825", "1826", "1827");
private static final List<String> ZCXFGCS = Arrays.asList("1433", "1434");
private static final List<String> XFY = Arrays.asList("1421", "1422", "1423", "1424", "1425");
private static final List<String> XFSSCZY = Arrays.asList("1427", "1428", "1429", "1430", "1431");
@Value("${logic}") @Value("${logic}")
Boolean logic; Boolean logic;
...@@ -3822,4 +3831,44 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp ...@@ -3822,4 +3831,44 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
wrapper.eq(OrgUsr::getBizOrgType, CommonConstant.BIZ_ORG_TYPE_COMPANY); wrapper.eq(OrgUsr::getBizOrgType, CommonConstant.BIZ_ORG_TYPE_COMPANY);
return this.baseMapper.selectOne(wrapper); return this.baseMapper.selectOne(wrapper);
} }
@Override
public IPage<Map<String, Object>> queryPersonPage(IPage<Map<String, Object>> page, String bizOrgCode, String peopleTypeCode) {
if (StringUtils.isNotEmpty(peopleTypeCode)) {
peopleTypeCode = "ZZXFY".equalsIgnoreCase(peopleTypeCode) ? "1601" : "YWRY".equalsIgnoreCase(peopleTypeCode) ? "1602" : "";
}
IPage<Map<String, Object>> iPage = this.baseMapper.getPage(page, bizOrgCode, peopleTypeCode);
iPage.getRecords().stream().forEach(e->{
StringBuilder cardNames = new StringBuilder("");
List<String> codes = Arrays.asList(String.valueOf(e.get("qualificationCode")).split(","));
if (CollectionUtils.isNotEmpty(codes)) {
for (String code : codes) {
if (YJJYY.contains(code)) {
cardNames.append("应急救援员证");
cardNames.append(",");
} else if (ZCXFGCS.contains(code)) {
cardNames.append("注册消防工程师证");
cardNames.append(",");
} else if (XFY.contains(code)) {
cardNames.append("消防员证");
cardNames.append(",");
} else if (XFSSCZY.contains(code)) {
cardNames.append("消防设施操作员证");
cardNames.append(",");
}
}
}
e.put("qualificationName", cardNames.length() > 0 ? cardNames.substring(0, cardNames.length() - 1) : "");
});
return iPage;
}
@Override
public IPage<Map<String, Object>> getCenterPersonInfoPage(IPage<Map<String, Object>> page, String bizOrgCode, String stationType) {
if (StringUtils.isNotEmpty(stationType)) {
stationType = "TA".equalsIgnoreCase(stationType) ? "常规换流站" : "TB".equalsIgnoreCase(stationType) ? "特高压换流站" : "";
}
IPage<Map<String, Object>> iPage = this.baseMapper.getCenterPersonInfoPage(page, bizOrgCode, stationType);
return iPage;
}
} }
\ No newline at end of file
package com.yeejoin.amos.boot.module.jcs.biz.controller;
import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import com.yeejoin.amos.boot.biz.common.utils.RedisKey;
import com.yeejoin.amos.boot.biz.common.utils.RedisUtils;
import com.yeejoin.amos.boot.module.common.api.mapper.FirefightersPostMapper;
import com.yeejoin.amos.boot.module.common.api.service.IOrgUsrService;
import com.yeejoin.amos.boot.module.common.biz.utils.CommonResponseUtil;
import com.yeejoin.amos.boot.module.jcs.api.dto.SinStaticDto;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.typroject.tyboot.core.foundation.context.RequestContext;
import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import java.util.Map;
/**
* @author keyong
* @title: PersonManageController
* <pre>
* @description: TODO
* </pre>
* @date 2024/8/1 11:40
*/
@RestController
@Api(tags = "消防队员Api")
@RequestMapping(value = "/center/person")
public class PersonManageController extends BaseController {
@Autowired
private RedisUtils redisUtils;
@Autowired
FirefightersPostMapper firefightersPostMapper;
@Autowired
IOrgUsrService orgUsrService;
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@GetMapping(value = "/fire/info")
@ApiOperation(value = "获取消防员取证信息")
public ResponseModel getFirePersonJobInfo(@RequestParam(value = "bizOrgCode" , required = false)String bizOrgCode) {
ReginParams reginParam = JSON.parseObject(redisUtils.get(RedisKey.buildReginKey(RequestContext.getExeUserId(), RequestContext.getToken())).toString(), ReginParams.class);
if (StringUtils.isEmpty(bizOrgCode)) {
if(null != reginParam) {
bizOrgCode = reginParam.getPersonIdentity().getCompanyBizOrgCode();
} else {
return CommonResponseUtil.success(null);
}
}
return ResponseHelper.buildResponse(firefightersPostMapper.getFirePersonJobInfo(bizOrgCode));
}
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@GetMapping(value = "/yunwei/info")
@ApiOperation(value = "获取运维人员取证信息")
public ResponseModel getYWPersonJobInfo(@RequestParam(value = "bizOrgCode" , required = false)String bizOrgCode) {
ReginParams reginParam = JSON.parseObject(redisUtils.get(RedisKey.buildReginKey(RequestContext.getExeUserId(), RequestContext.getToken())).toString(), ReginParams.class);
if (StringUtils.isEmpty(bizOrgCode)) {
if(null != reginParam) {
bizOrgCode = reginParam.getPersonIdentity().getCompanyBizOrgCode();
} else {
return CommonResponseUtil.success(null);
}
}
return ResponseHelper.buildResponse(firefightersPostMapper.getYWPersonJobInfo(bizOrgCode));
}
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@GetMapping(value = "/station/fire")
@ApiOperation(value = "获取消防员信息")
public ResponseModel getZZPersonInfo(@RequestParam(value = "bizOrgCode" , required = false)String bizOrgCode) {
ReginParams reginParam = JSON.parseObject(redisUtils.get(RedisKey.buildReginKey(RequestContext.getExeUserId(), RequestContext.getToken())).toString(), ReginParams.class);
if (StringUtils.isEmpty(bizOrgCode)) {
if(null != reginParam) {
bizOrgCode = reginParam.getPersonIdentity().getCompanyBizOrgCode();
} else {
return CommonResponseUtil.success(null);
}
}
return ResponseHelper.buildResponse(firefightersPostMapper.getZZPersonInfo(bizOrgCode));
}
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@GetMapping(value = "/station/yunwei")
@ApiOperation(value = "获取运维人员信息")
public ResponseModel getYWPersonInfo(@RequestParam(value = "bizOrgCode" , required = false)String bizOrgCode) {
ReginParams reginParam = JSON.parseObject(redisUtils.get(RedisKey.buildReginKey(RequestContext.getExeUserId(), RequestContext.getToken())).toString(), ReginParams.class);
if (StringUtils.isEmpty(bizOrgCode)) {
if(null != reginParam) {
bizOrgCode = reginParam.getPersonIdentity().getCompanyBizOrgCode();
} else {
return CommonResponseUtil.success(null);
}
}
return ResponseHelper.buildResponse(firefightersPostMapper.getYWPersonInfo(bizOrgCode));
}
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@RequestMapping(value = "/station/page", method = RequestMethod.GET)
@ApiOperation(httpMethod = "GET", value = "获取站端人员信息", notes = "获取站端人员信息")
public ResponseModel getStationPersonPage(@RequestParam(value = "pageNumber") int pageNumber,
@RequestParam(value = "pageSize") int pageSize, @RequestParam(required = false) String bizOrgCode,
@RequestParam(required = false) String type) {
Page<Map<String, Object>> page = new Page<>();
page.setCurrent(pageNumber);
page.setSize(pageSize);
return CommonResponseUtil.success(orgUsrService.queryPersonPage(page, bizOrgCode, type));
}
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@RequestMapping(value = "/page", method = RequestMethod.GET)
@ApiOperation(httpMethod = "GET", value = "获取中心人员信息", notes = "获取中心人员信息")
public ResponseModel getCenterPersonInfoPage(@RequestParam(value = "pageNumber") int pageNumber,
@RequestParam(value = "pageSize") int pageSize, @RequestParam(required = false) String bizOrgCode,
@RequestParam(required = false) String stationType) {
Page<Map<String, Object>> page = new Page<>();
page.setCurrent(pageNumber);
page.setSize(pageSize);
return CommonResponseUtil.success(orgUsrService.getCenterPersonInfoPage(page, bizOrgCode, stationType));
}
}
...@@ -3971,7 +3971,7 @@ ...@@ -3971,7 +3971,7 @@
</sql> </sql>
</changeSet> </changeSet>
<changeSet author="ky" id="20240801"> <changeSet author="ky" id="20240801-1">
<preConditions onFail="MARK_RAN"> <preConditions onFail="MARK_RAN">
<not> <not>
<columnExists tableName="idx_biz_station_info" columnName="station_type"/> <columnExists tableName="idx_biz_station_info" columnName="station_type"/>
...@@ -3983,7 +3983,7 @@ ...@@ -3983,7 +3983,7 @@
</sql> </sql>
</changeSet> </changeSet>
<changeSet author="lixm" id="20240801"> <changeSet author="lixm" id="20240801-2">
<preConditions onFail="MARK_RAN"> <preConditions onFail="MARK_RAN">
<not> <not>
<columnExists tableName="idx_biz_station_info" columnName="biz_org_code"/> <columnExists tableName="idx_biz_station_info" columnName="biz_org_code"/>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment