Commit 46c92a02 authored by 李秀明's avatar 李秀明

Merge remote-tracking branch 'origin/develop_dl' into develop_dl

parents e9dac5b3 b7e2f19a
......@@ -36,6 +36,10 @@ public interface OrgUsrMapper extends BaseMapper<OrgUsr> {
List<OrgUsr> selectCompanyDepartmentMsg();
List<Map<String, Object>> selectStaticFire(String bizOrgCode);
List<Map<String, Object>> selectStaticYw(String bizOrgCode);
List<Map<String, Object>> selectPersonAllList(Map<String, Object> map);
List<OrgUsr> queryOrgUsrListByBizOrgCode(String bizOrgCode);
......
......@@ -115,6 +115,10 @@ public interface IOrgUsrService {
void updateDynamicFormInstance(Long instanceId, List<DynamicFormInstance> fromValueList) throws Exception;
/**
* @throws Exception
*/
List<Map<String, Object>> selectStatic(String bizOrgCode, String type);
/**
* @param id
* @throws Exception
*/
......
......@@ -42,6 +42,7 @@
max(case v.field_code when 'administrativePositionCode' then IFNULL(v.field_value_label,v.field_value) end) administrativePositionCode,
max(case v.field_code when 'internalPositionCode' then IFNULL(v.field_value_label,v.field_value) end) internalPositionCode,
max(case v.field_code when 'fireManagementPostCode' then IFNULL(v.field_value_label,v.field_value) end) fireManagementPostCode,
max(case v.field_code when 'fireManagementPostCode' then v.field_value end) fireManagementPost,
max(case v.field_code when 'positionType' then IFNULL(v.field_value,v.field_value_label) end) positionType,
max(case v.field_code when 'certificateType' then IFNULL(v.field_value_label,v.field_value) end) certificateType,
max(case v.field_code when 'holdingTime' then IFNULL(v.field_value_label,v.field_value) end) holdingTime,
......@@ -84,6 +85,12 @@
<if test="map.peopleType != null and map.peopleType != ''">
AND g.peopleType = #{map.peopleType}
</if>
<if test="map.fireManagementPost != null">
AND g.fireManagementPost IN
<foreach item="item" index="index" collection="map.fireManagementPost" open="(" separator="," close=")">
#{item}
</foreach>
</if>
GROUP BY
u.sequence_nbr ,
u.biz_org_name ,
......@@ -112,6 +119,7 @@
u.amos_org_id amosOrgId,
u.biz_org_code bizOrgCode,
u.parent_id parentId,
(select bizOrgName from cb_org_usr where sequence_nbr = u.parent_id) as companyName,
g.*
FROM
cb_org_usr u
......@@ -130,7 +138,9 @@
max(case v.field_code when 'internalPositionCode' then IFNULL(v.field_value_label,v.field_value) end) internalPositionCode,
max(case v.field_code when 'fireManagementPostCode' then IFNULL(v.field_value_label,v.field_value) end) fireManagementPostCode,
max(case v.field_code when 'fireManagementPostCode' then v.field_value end) fireManagementPost,
max(case v.field_code when 'fireManagementPostCode' then IFNULL(v.field_value_label,'其他') end) fireManagementPostName,
max(case v.field_code when 'positionType' then IFNULL(v.field_value,v.field_value_label) end) positionType,
max(case v.field_code when 'positionType' then IFNULL(v.field_value_label,'其他') end) positionTypeName,
max(case v.field_code when 'certificateType' then IFNULL(v.field_value_label,v.field_value) end) certificateType,
max(case v.field_code when 'holdingTime' then IFNULL(v.field_value_label,v.field_value) end) holdingTime,
max(case v.field_code when 'auditCycle' then IFNULL(v.field_value_label,v.field_value) end) auditCycle,
......@@ -170,12 +180,9 @@
AND FIND_IN_SET(#{map.positionType},g.positionType)
</if>
<if test="map.peopleType != null and map.peopleType != ''">
AND g.peopleType IN
<foreach item="item" index="index" collection="map.peopleType" open="(" separator="," close=")">
#{item}
</foreach>
AND g.peopleType = #{map.peopleType}
</if>
<if test="map.fireManagementPost != null and map.fireManagementPost != ''">
<if test="map.fireManagementPost != null">
AND g.fireManagementPost IN
<foreach item="item" index="index" collection="map.fireManagementPost" open="(" separator="," close=")">
#{item}
......@@ -1307,5 +1314,104 @@ LEFT JOIN (
)a where a.sequenceNbr is not null
LIMIT #{map.pageNum}, #{map.pageSize}
</select>
<select id="selectStaticFire" resultType="java.util.Map">
SELECT count( postName ) as num,( count( postName )/( SELECT count(*) AS count FROM cb_org_usr a WHERE is_delete = 0 AND biz_org_type = 'PERSON'
AND biz_org_code like concat(#{bizOrgCode}, '%')
))* 100 AS percent, postName
FROM
(
SELECT
a.*,
IFNULL( b.NAME, '其他' ) AS postName
FROM
(
SELECT DISTINCT
u.sequence_nbr sequenceNbr,
g.*
FROM
cb_org_usr u
LEFT JOIN (
SELECT
v.`instance_id`,
max( CASE v.field_code WHEN 'fireManagementPostCode' THEN IFNULL( v.field_value_label, v.field_value ) END ) fireManagementPostCode,
max( CASE v.field_code WHEN 'fireManagementPostCode' THEN v.field_value END ) fireManagementPost,
max( CASE v.field_code WHEN 'fireManagementPostCode' THEN v.field_value_label END ) fireManagementPostName,
max( CASE v.field_code WHEN 'positionType' THEN IFNULL( v.field_value, v.field_value_label ) END ) positionType,
max( CASE v.field_code WHEN 'positionType' THEN v.field_value_label END ) positionTypeName,
max( CASE v.field_code WHEN 'peopleType' THEN v.field_value END ) peopleType
FROM
`cb_dynamic_form_instance` v
WHERE
v.group_code = 246
GROUP BY
v.`instance_id`
) g ON u.sequence_nbr = g.instance_id
WHERE
u.biz_org_type = 'person'
AND g.peopleType = '1601'
AND u.is_delete = 0
AND u.biz_org_code like concat(#{bizOrgCode}, '%')
GROUP BY
u.sequence_nbr,
u.biz_org_name,
u.biz_org_code
ORDER BY
u.rec_date DESC
) a
LEFT JOIN ( SELECT * FROM cb_data_dictionary WHERE type = 'XFGLGW' ) b ON LOCATE( b.CODE, a.fireManagementPost ) != 0
WHERE
a.sequenceNbr IS NOT NULL
) a
GROUP BY
postName
</select>
<select id="selectStaticYw" resultType="java.util.Map">
SELECT count( postName ) as num, (count( postName )/( SELECT count(*) AS count FROM cb_org_usr a WHERE is_delete = 0 AND biz_org_type = 'PERSON'
AND biz_org_code like concat(#{bizOrgCode}, '%')
))* 100 AS percent, postName
FROM
(
SELECT
a.*,
IFNULL( b.NAME, '其他' ) AS postName
FROM
(
SELECT DISTINCT
u.sequence_nbr sequenceNbr,
g.*
FROM
cb_org_usr u
LEFT JOIN (
SELECT
v.`instance_id`,
max( CASE v.field_code WHEN 'positionType' THEN v.field_value END ) positionType,
max( CASE v.field_code WHEN 'positionType' THEN v.field_value_label END ) positionTypeName,
max( CASE v.field_code WHEN 'peopleType' THEN v.field_value END ) peopleType
FROM
`cb_dynamic_form_instance` v
WHERE
v.group_code = 246
GROUP BY
v.`instance_id`
) g ON u.sequence_nbr = g.instance_id
WHERE
u.biz_org_type = 'PERSON'
AND g.peopleType = '1602'
AND u.biz_org_code like concat(#{bizOrgCode}, '%')
AND u.is_delete = 0
GROUP BY
u.sequence_nbr,
u.biz_org_name,
u.biz_org_code
ORDER BY
u.rec_date DESC
) a
LEFT JOIN ( SELECT * FROM cb_data_dictionary WHERE type = 'GWMC' ) b ON LOCATE( b.CODE, a.positionType ) != 0
WHERE
a.sequenceNbr IS NOT NULL
) a
GROUP BY
postName
</select>
</mapper>
......@@ -179,6 +179,20 @@ public class OrgPersonController extends BaseController {
return ResponseHelper.buildResponse(result);
}
/**
* 消防资源监管,驻站消防员,运维人员环状态图统计接口
*
* @param bizOrgCode type
* @return
*/
@TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY)
@RequestMapping(value = "/getStaticByFire", method = RequestMethod.GET)
@ApiOperation(httpMethod = "GET", value = "消防资源监管,驻站消防员,运维人员环状态图统计接口", notes = "消防资源监管,驻站消防员,运维人员环状态图统计接口")
public ResponseModel<List<Map<String, Object>>> selectStatic(String bizOrgCode, String type) throws Exception {
List<Map<String, Object>> result = iOrgUsrService.selectStatic(bizOrgCode, type);
return ResponseHelper.buildResponse(result);
}
/**
* 获取人员树
......
......@@ -600,11 +600,13 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
map.put("positionType", positionType);
}
String fireManagementPost = "";
List<String> fireManagementPost;
if(req.containsKey("fireManagementPost")) {
fireManagementPost = req.get("fireManagementPost").toString();
if(StringUtils.isNotEmpty(req.get("fireManagementPost").toString())) {
fireManagementPost = Arrays.asList(req.get("fireManagementPost").toString().split(","));
map.put("fireManagementPost", fireManagementPost);
}
}
String peopleType = "";
if(req.containsKey("peopleType")) {
......@@ -915,6 +917,17 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
}
@Override
public List<Map<String, Object>> selectStatic(String bizOrgCode, String type) {
List<Map<String,Object>> listMap;
if("1601".equals(type)) {
listMap = this.baseMapper.selectStaticFire(bizOrgCode);
} else {
listMap = this.baseMapper.selectStaticYw(bizOrgCode);
}
return listMap;
}
@Override
public Map<String, Object> selectForShowById(OrgUsr orgUsr, Long id) throws Exception {
QueryWrapper<DynamicFormColumn> queryWrapper = new QueryWrapper<DynamicFormColumn>();
queryWrapper.eq("group_code", OrgPersonEnum.人员.getCode());
......
......@@ -67,7 +67,7 @@ public class EquipmentManageController extends AbstractBaseController{
companyId = result.get("sequenceNbr").toString();
}
}
return equipmentManageService.queryEquipmenInfoAndCount(equipmentName,equipmentCode,construction,maintenance,bizOrgCode,formGroupId,current,pageSize,controBoxBuildId,companyId, nameOrCode);
return equipmentManageService.queryEquipmenInfoAndCount(equipmentName,equipmentCode,construction,maintenance,bizOrgCode,formGroupId,current,pageSize,controBoxBuildId,companyId, nameOrCode, null);
}
@GetMapping(value = "/getUtils")
......
......@@ -596,6 +596,7 @@ public class FireFightingSystemController extends AbstractBaseController {
@RequestParam(value = "construction", required = false) String construction,
@RequestParam(value = "maintenance", required = false) String maintenance,
@RequestParam(value = "bizOrgCode", required = false) String bizOrgCode,
@RequestParam(value = "systemStatus", required = false) String systemStatus,
@RequestParam(value = "formGroupId", required = false) String formGroupId,
@RequestParam(value = "controBoxBuildId", required = false) String controBoxBuildId,
@RequestParam(value = "current") int current,
......@@ -626,7 +627,7 @@ public class FireFightingSystemController extends AbstractBaseController {
}
}
return fireFightingSystemService.queryEquipmenInfoAndCount(equipmentName, equipmentCode, construction, maintenance, bizOrgCode, formGroupId, current, pageSize,controBoxBuildId, companyId, nameOrCode);
return fireFightingSystemService.queryEquipmenInfoAndCount(equipmentName, equipmentCode, construction, maintenance, bizOrgCode, formGroupId, current, pageSize,controBoxBuildId, companyId, nameOrCode, systemStatus);
}
/**
......
......@@ -26,7 +26,7 @@ public interface EquipmentManageService extends IService<EquipmentManageEntity>
* @param pageSize
* @return
*/
Map<String, Object> queryEquipmenInfoAndCount(String equimentName, String equimentCode, String construction, String maintenance, String bizOrgCode, String formGroupId , int spage, int pageSize, String controBoxBuildId,String companyId, String nameOrCode);
Map<String, Object> queryEquipmenInfoAndCount(String equimentName, String equimentCode, String construction, String maintenance, String bizOrgCode, String formGroupId , int spage, int pageSize, String controBoxBuildId,String companyId, String nameOrCode,String systemStatus);
/**
* 获取下拉菜单数据
......
......@@ -45,7 +45,7 @@ public interface IFireFightingSystemService extends IService<FireFightingSystemE
* @param pageSize
* @return
*/
Map<String, Object> queryEquipmenInfoAndCount(String equimentName, String equimentCode, String construction, String maintenance, String bizOrgCode, String formGroupId, int current, int pageSize,String controBoxBuildId,String companyId, String nameOrCode);
Map<String, Object> queryEquipmenInfoAndCount(String equimentName, String equimentCode, String construction, String maintenance, String bizOrgCode, String formGroupId, int current, int pageSize,String controBoxBuildId,String companyId, String nameOrCode, String systemStatus);
FireFightingSystemEntity getOneById(Long id);
......
......@@ -53,7 +53,7 @@ public class EquipmentManageServiceImpl extends ServiceImpl<EquipmentManageMappe
@Override
public Map<String, Object> queryEquipmenInfoAndCount(String equimentName, String equimentCode, String construction, String maintenance,
String bizOrgCode, String formGroupId, int current, int pageSize,String controBoxBuildId,String companyCode, String nameOrCode) {
String bizOrgCode, String formGroupId, int current, int pageSize,String controBoxBuildId,String companyCode, String nameOrCode, String systemStatus) {
HttpServletRequest request = null;
Map map = new HashMap<String, Object>();
map.put("equimentName", equimentName);
......@@ -67,6 +67,7 @@ public class EquipmentManageServiceImpl extends ServiceImpl<EquipmentManageMappe
map.put("formGroupId", formGroupId);
map.put("controBoxBuildId",controBoxBuildId);
map.put("nameOrCode", nameOrCode);
map.put("systemStatus", systemStatus);
List<EquipmentManageVo> dataList = equipmentManageMapper.queryEquipmenInfo(map);
Long count = equipmentManageMapper.queryEquipmenCount(map);
map.clear();
......
......@@ -191,9 +191,9 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste
@Override
public Map<String, Object> queryEquipmenInfoAndCount(String equimentName, String equimentCode, String construction,
String maintenance, String bizOrgCode, String formGroupId, int current, int pageSize, String controBoxBuildId, String companyId, String nameOrCode) {
String maintenance, String bizOrgCode, String formGroupId, int current, int pageSize, String controBoxBuildId, String companyId, String nameOrCode,String systemStatus) {
Map<String, Object> map = equipmentManageService.queryEquipmenInfoAndCount(equimentName, equimentCode,
construction, maintenance, bizOrgCode, formGroupId, current, pageSize, controBoxBuildId, companyId, nameOrCode);
construction, maintenance, bizOrgCode, formGroupId, current, pageSize, controBoxBuildId, companyId, nameOrCode, systemStatus);
List<EquipmentManageVo> dataList = (List<EquipmentManageVo>) map.get("dataList");
StringBuilder stb = new StringBuilder();
dataList.forEach(y -> {
......
......@@ -51,6 +51,9 @@
<if test="bizOrgCode != null and bizOrgCode != ''">
AND sys.biz_org_code like CONCAT(#{bizOrgCode},'%')
</if>
<if test="systemStatus != null and systemStatus != ''">
AND sys.system_status = #{systemStatus}
</if>
<if test="companyCode != null and companyCode != ''">
AND sys.biz_org_code = #{companyCode}
</if>
......
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