Commit e6f6c5f7 authored by KeYong's avatar KeYong

提交管理人员接口

parent 9494d921
...@@ -163,4 +163,10 @@ public interface OrgUsrMapper extends BaseMapper<OrgUsr> { ...@@ -163,4 +163,10 @@ public interface OrgUsrMapper extends BaseMapper<OrgUsr> {
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);
List<Map<String, Object>> getManagePersonList(@Param("bizOrgCode") String bizOrgCode);
int getManagePersonCount(@Param("map") Map<String, Object> map);
List<Map<String, Object>> getManagePersonPage(@Param("map") Map<String, Object> map);
} }
...@@ -404,4 +404,8 @@ public interface IOrgUsrService { ...@@ -404,4 +404,8 @@ public interface IOrgUsrService {
String reportResult(String startTime, String endTime, String bizOrgCode); String reportResult(String startTime, String endTime, String bizOrgCode);
List<Map<String, Object>> getManagePersonList(String bizOrgCode);
IPage<Map<String, Object>> getManagePersonPage(String pageNum, String pageSize, String bizOrgCode, String code, String personStatus);
} }
...@@ -1472,4 +1472,187 @@ LEFT JOIN ( ...@@ -1472,4 +1472,187 @@ LEFT JOIN (
GROUP BY GROUP BY
parentId parentId
</select> </select>
<select id="getManagePersonList" resultType="Map">
SELECT
postName AS `name`,
count( postName ) AS `value`,
'人' AS unit,
`code`
FROM
(
SELECT
a.*,
b.NAME AS postName,
b.`code`
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 IN ('1601', '1602', '1603')
AND u.is_delete = 0
<if test="bizOrgCode != null and bizOrgCode != ''">
AND u.biz_org_code LIKE CONCAT(#{bizOrgCode}, '%')
</if>
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 AND b.`name` IS NOT NULL
) a
GROUP BY
postName
</select>
<select id="getManagePersonCount" resultType="integer">
SELECT
count(1)
FROM(
SELECT
a.sequenceNbr,
a.bizOrgName,
a.`name`,
a.fireManagementPostName,
a.personStatus
FROM
(
SELECT DISTINCT
u.sequence_nbr AS sequenceNbr,
u.person_status AS personStatus,
cf.biz_org_Name AS bizOrgName,
cf.`name` AS `name`,
g.*
FROM
cb_org_usr u
LEFT JOIN cb_firefighters cf ON cf.org_usr_id = u.sequence_nbr
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 IN ('1601', '1602', '1603')
AND u.is_delete = 0
<if test="map.bizOrgCode != null and map.bizOrgCode != ''">
AND u.biz_org_code LIKE CONCAT(#{map.bizOrgCode}, '%')
</if>
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 AND b.`name` IS NOT NULL
<if test="map.code != null and map.code != ''">
AND FIND_IN_SET(#{map.code},a.fireManagementPost) > 0
</if>
<if test="map.personStatus != null and map.personStatus != ''">
AND a.personStatus = #{map.personStatus}
</if>
GROUP BY
a.sequenceNbr ) c
</select>
<select id="getManagePersonPage" resultType="Map">
SELECT
a.sequenceNbr,
a.bizOrgName,
a.`name`,
a.fireManagementPostName,
a.personStatus
FROM
(
SELECT DISTINCT
u.sequence_nbr AS sequenceNbr,
u.person_status AS personStatus,
cf.biz_org_Name AS bizOrgName,
cf.`name` AS `name`,
g.*
FROM
cb_org_usr u
LEFT JOIN cb_firefighters cf ON cf.org_usr_id = u.sequence_nbr
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 IN ('1601', '1602', '1603')
AND u.is_delete = 0
<if test="map.bizOrgCode != null and map.bizOrgCode != ''">
AND u.biz_org_code LIKE CONCAT(#{map.bizOrgCode}, '%')
</if>
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 AND b.`name` IS NOT NULL
<if test="map.code != null and map.code != ''">
AND FIND_IN_SET(#{map.code},a.fireManagementPost) > 0
</if>
<if test="map.personStatus != null and map.personStatus != ''">
AND a.personStatus = #{map.personStatus}
</if>
GROUP BY
a.sequenceNbr
LIMIT #{map.pageNum}, #{map.pageSize}
</select>
</mapper> </mapper>
...@@ -571,4 +571,29 @@ public class OrgPersonController extends BaseController { ...@@ -571,4 +571,29 @@ public class OrgPersonController extends BaseController {
public ResponseModel getPersonImage(@PathVariable String id) { public ResponseModel getPersonImage(@PathVariable String id) {
return ResponseHelper.buildResponse(iOrgUsrService.getPersonImg(id)); return ResponseHelper.buildResponse(iOrgUsrService.getPersonImg(id));
} }
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@RequestMapping(value = "/manage/statistic", method = RequestMethod.GET)
@ApiOperation(httpMethod = "GET", value = "设备平台管理人员统计", notes = "设备平台管理人员统计")
public ResponseModel getManagePersonList() {
ReginParams reginParams = getSelectedOrgInfo();
String bizOrgCode = reginParams.getPersonIdentity().getCompanyBizOrgCode();
return ResponseHelper.buildResponse(iOrgUsrService.getManagePersonList(bizOrgCode));
}
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@RequestMapping(value = "/manage/page", method = RequestMethod.GET)
@ApiOperation(httpMethod = "GET", value = "设备平台管理人员分页列表", notes = "设备平台管理人员分页列表")
public ResponseModel<Object> getManagePersonPage(@RequestParam(value = "code") String code,
@RequestParam(value = "personStatus") String personStatus,
@RequestParam(value = "bizOrgCode") String bizOrgCode,
@RequestParam(value = "pageNum") String pageNum,
@RequestParam(value = "pageSize") String pageSize) {
if (StringUtils.isEmpty(bizOrgCode)) {
ReginParams reginParams = getSelectedOrgInfo();
bizOrgCode = reginParams.getPersonIdentity().getCompanyBizOrgCode();
}
IPage<Map<String, Object>> mapIPage = iOrgUsrService.getManagePersonPage(bizOrgCode, code, personStatus, pageNum, pageSize);
return ResponseHelper.buildResponse(mapIPage);
}
} }
...@@ -817,6 +817,32 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp ...@@ -817,6 +817,32 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
return orgUsr.getPersonImg(); return orgUsr.getPersonImg();
} }
@Override
public List<Map<String, Object>> getManagePersonList(String bizOrgCode) {
return this.baseMapper.getManagePersonList(bizOrgCode);
}
@Override
public IPage<Map<String, Object>> getManagePersonPage(String bizOrgCode, String code, String personStatus, String pageNum, String pageSize) {
Map<String, Object> map = new HashMap<>();
map.put("bizOrgCode", bizOrgCode);
map.put("code", code);
map.put("personStatus", personStatus);
IPage<Map<String, Object>> pageBean = null;
if (StringUtils.isBlank(pageNum) || StringUtils.isBlank(pageSize)) {
pageBean = new Page<>(0, Long.MAX_VALUE);
} else {
pageBean = new Page<>(Integer.parseInt(pageNum), Integer.parseInt(pageSize));
}
pageBean.setTotal(orgUsrMapper.getManagePersonCount(map));
map.put("pageNum", (pageBean.getCurrent() - 1) * pageBean.getSize());
map.put("pageSize", pageBean.getSize());
List<Map<String, Object>> list = orgUsrMapper.getManagePersonPage(map);
pageBean.setRecords(list);
return pageBean;
}
public List<FormValue> getFormValueDetail(Long id) throws Exception { public List<FormValue> getFormValueDetail(Long id) throws Exception {
// 动态表单数据 // 动态表单数据
List<DynamicFormInstanceDto> list = alertFormValueServiceImpl.listByCalledId(id); List<DynamicFormInstanceDto> list = alertFormValueServiceImpl.listByCalledId(id);
......
...@@ -118,7 +118,7 @@ ...@@ -118,7 +118,7 @@
'消防车' AS `name`, '消防车' AS `name`,
count( 1 ) AS `value`, count( 1 ) AS `value`,
'辆' AS unit, '辆' AS unit,
IFNULL(( SELECT IFNULL( img, shbz_img ) AS img FROM wl_equipment WHERE `code` LIKE CONCAT( '21010000', '%' ) LIMIT 1 ), '') AS icon, IFNULL(( SELECT IFNULL( shbz_img, img ) AS img FROM wl_equipment WHERE `code` LIKE CONCAT( '21010000', '%' ) LIMIT 1 ), '') AS icon,
'2101' as code '2101' as code
FROM FROM
`wl_car` wc `wl_car` wc
......
...@@ -2907,7 +2907,7 @@ ...@@ -2907,7 +2907,7 @@
wes.equipment_code AS `code`, wes.equipment_code AS `code`,
COUNT(1) AS `value`, COUNT(1) AS `value`,
IFNULL(wu.`name`, '') AS unit, IFNULL(wu.`name`, '') AS unit,
IFNULL(IF(a.img IS NOT NULL, a.img, a.shbz_img), '') AS icon IFNULL(IF(a.shbz_img IS NOT NULL, a.shbz_img, a.img), '') AS icon
FROM FROM
wl_equipment_specific wes wl_equipment_specific wes
LEFT JOIN (SELECT id, `code`, `name`, img, shbz_img, unit_id FROM wl_equipment WHERE LEFT(`code`, 1) IN (1, 3, 4, 5, 6, 7, 8)) a ON a.`code` = wes.equipment_code LEFT JOIN (SELECT id, `code`, `name`, img, shbz_img, unit_id FROM wl_equipment WHERE LEFT(`code`, 1) IN (1, 3, 4, 5, 6, 7, 8)) a ON a.`code` = wes.equipment_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