Commit c8659138 authored by 李秀明's avatar 李秀明

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

# Conflicts: # amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/mapper/FireFightingSystemMapper.java # amos-boot-system-equip/src/main/resources/mapper/FireFightingSystemMapper.xml
parents d7414bf9 10f0735a
package com.yeejoin.equip.service;
import java.util.Map;
/**
* @author LiuLin
* @date 2023年07月12日 10:44
*/
public interface KafkaMessageService {
void handlerMessage(String message, Map<Object, Object> equipmentIndexVOMap);
}
package com.yeejoin.amos.boot.module.common.api.dto;
import lombok.AllArgsConstructor;
import lombok.Getter;
/**
* @author
* @title: EquipQrcodeColorEnum
* <pre>
* @description: TODO
* </pre>
* @date 2020/12/12 14:23
*/
@Getter
@AllArgsConstructor
public enum DynamicLabelEnum {
NAME("name","姓名"),
CODE("personNumber","员工编码"),
BIZORGNAME("bizOrgName","所属单位"),
PERSONTYPE("peopleType","人员类型"),
TELPHONE("mobilePhone","联系电话"),
SEX("gender", "性别"),
CARDTYPE("certificatesType","证件类型"),
CARDNUM("certificatesNumber","证件号码"),
GWLX("jobTitle","岗位类型"),
GWZZ("postQualification","岗位资质"),
XFGLGW("fireManagementPost","消防管理岗位"),
GLZH("amosName","关联账户"),
GWZT("state","岗位状态"),
DISPDATE("birthdayTime","出生日期");
private String code;
private String describe;
public static DynamicLabelEnum getEnumByKey(String key) {
DynamicLabelEnum colorEnum = null;
for (DynamicLabelEnum u : DynamicLabelEnum.values()) {
if (u.getCode().equals(key)) {
colorEnum = u;
break;
}
}
return colorEnum;
}
}
...@@ -166,4 +166,7 @@ public class PeopleBasicInfoDto { ...@@ -166,4 +166,7 @@ public class PeopleBasicInfoDto {
@ApiModelProperty(value = "单位人员id") @ApiModelProperty(value = "单位人员id")
private String orgUsrId; private String orgUsrId;
@ApiModelProperty(value = "人员码状态")
private String personStatus;
} }
package com.yeejoin.amos.boot.module.common.api.dto;
import lombok.Data;
import java.util.List;
/**
* @author keyong
* @title: RiskBizInfoVo
* <pre>
* @description: TODO
* </pre>
* @date 2023/5/17 11:22
*/
@Data
public class RiskBizInfoVo {
private String warningObjectName;
private String warningObjectCode;
private String warningTime;
private String sourceAttribution;
private String sourceAttributionDesc;
private List<RiskDynamicDetailsVo> dynamicDetails;
}
package com.yeejoin.amos.boot.module.common.api.dto;
import lombok.Data;
import java.util.List;
/**
* @author keyong
* @title: RiskDynamicDetailsVo
* <pre>
* @description: TODO
* </pre>
* @date 2023/5/17 11:36
*/
@Data
public class RiskDynamicDetailsVo {
private String tabName;
private List<TableContentVo> tabContent;
}
package com.yeejoin.amos.boot.module.common.api.dto;
import lombok.Data;
/**
* @author keyong
* @title: TableContentVo
* <pre>
* @description: TODO
* </pre>
* @date 2023/5/17 11:20
*/
@Data
public class TableContentVo {
private String key;
private String label;
private Object value;
private String type;
}
...@@ -93,4 +93,7 @@ public class OrgUsr extends BaseEntity { ...@@ -93,4 +93,7 @@ public class OrgUsr extends BaseEntity {
@ApiModelProperty(value = "人员照片") @ApiModelProperty(value = "人员照片")
private String personImg; private String personImg;
@ApiModelProperty(value = "人员码状态")
private String personStatus;
} }
...@@ -152,5 +152,7 @@ public interface OrgUsrMapper extends BaseMapper<OrgUsr> { ...@@ -152,5 +152,7 @@ public interface OrgUsrMapper extends BaseMapper<OrgUsr> {
List<OrgUsr> companyUserTreeByUserAndTypeALL(@Param("bizorgcode") String bizorgcode); List<OrgUsr> companyUserTreeByUserAndTypeALL(@Param("bizorgcode") String bizorgcode);
void updatePersonStatus(String status, String id);
List<Map<String, Object>> getFireProtectionAndMaintenance(); List<Map<String, Object>> getFireProtectionAndMaintenance();
} }
...@@ -353,6 +353,15 @@ public interface IOrgUsrService { ...@@ -353,6 +353,15 @@ public interface IOrgUsrService {
PeopleInfoDto selectPeopleById(Long id); PeopleInfoDto selectPeopleById(Long id);
/** /**
* 获取人员详情 不要权限
* @param id 人员id
* @return 人员
*/
PeopleInfoDto selectPeopleByIdNoAuth(Long id);
/**
* 根据id,type删除 * 根据id,type删除
* @param id 主键 * @param id 主键
* @param type 类型 * @param type 类型
...@@ -383,4 +392,10 @@ public interface IOrgUsrService { ...@@ -383,4 +392,10 @@ public interface IOrgUsrService {
List<FirefightersPost> selectPostById(List<String> ids); List<FirefightersPost> selectPostById(List<String> ids);
RiskBizInfoVo getPersonInfo(String id,String type);
OrgUsr getPersonOne(String id);
void updatePersonStatus(String status, String id);
} }
...@@ -858,8 +858,11 @@ GROUP BY ...@@ -858,8 +858,11 @@ GROUP BY
WHERE biz_org_code like concat(#{code}, '%'); WHERE biz_org_code like concat(#{code}, '%');
</update> </update>
<update id="updatePersonStatus">
update cb_org_usr set person_status = #{status} where sequence_nbr = #{id}
</update>
<select id ='getPersonSimpleDetail' resultType='Map'> <select id ='getPersonSimpleDetail' resultType='Map'>
SELECT SELECT
person.biz_org_name as name, person.biz_org_name as name,
cdf.field_value as phone cdf.field_value as phone
......
...@@ -141,4 +141,7 @@ public class FireFightingSystemEntity { ...@@ -141,4 +141,7 @@ public class FireFightingSystemEntity {
@ApiModelProperty(value = "主要设计人员") @ApiModelProperty(value = "主要设计人员")
private String leadDesigner; private String leadDesigner;
@ApiModelProperty(value = "系统状态")
private String systemStatus;
} }
...@@ -3,6 +3,7 @@ package com.yeejoin.equipmanage.controller; ...@@ -3,6 +3,7 @@ package com.yeejoin.equipmanage.controller;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams; import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import com.yeejoin.equipmanage.common.entity.dto.OrgUsrDto; import com.yeejoin.equipmanage.common.entity.dto.OrgUsrDto;
import com.yeejoin.equipmanage.common.entity.publics.CommonResponse;
import com.yeejoin.equipmanage.common.utils.*; import com.yeejoin.equipmanage.common.utils.*;
import com.yeejoin.equipmanage.config.PersonIdentify; import com.yeejoin.equipmanage.config.PersonIdentify;
import com.yeejoin.equipmanage.mapper.FireFightingSystemMapper; import com.yeejoin.equipmanage.mapper.FireFightingSystemMapper;
...@@ -204,4 +205,13 @@ public class DCenterController extends AbstractBaseController { ...@@ -204,4 +205,13 @@ public class DCenterController extends AbstractBaseController {
return CommonResponseUtil.success(menus); return CommonResponseUtil.success(menus);
} }
@GetMapping("/water/statics")
@ApiOperation(value = "消防水源信息")
@TycloudOperation(ApiLevel = UserType.AGENCY)
public ResponseModel getFireWaterStatics() {
ReginParams reginParams = getSelectedOrgInfo();
String bizOrgCode = !ValidationUtil.isEmpty(reginParams.getPersonIdentity()) && StringUtil.isNotEmpty(reginParams.getPersonIdentity().getBizOrgCode()) ? reginParams.getPersonIdentity().getBizOrgCode() : null;
return CommonResponseUtil.success(fireFightingSystemService.getFireWaterStatics(bizOrgCode));
}
} }
...@@ -264,7 +264,15 @@ public interface EquipmentSpecificMapper extends BaseMapper<EquipmentSpecific> { ...@@ -264,7 +264,15 @@ public interface EquipmentSpecificMapper extends BaseMapper<EquipmentSpecific> {
EquipmentSpecific getEquipSpecificEntityByCode(@Param("code") String code); EquipmentSpecific getEquipSpecificEntityByCode(@Param("code") String code);
void updateEquipSpecificStatus(String status,String id); Integer updateEquipSpecificStatus(String status,String id);
String getEquipStatusList(@Param("id") String id);
List<Long> countEquipStatusListByEquipId(@Param("id") Long id);
String getSpecificStatusByEquipmentCode(@Param("equipCode") String equipCode);
void updateWaterResourceStatus(@Param("id") Long id, @Param("status") String status);
String updateEquipSpecificStatusByCheckInput(String id); String updateEquipSpecificStatusByCheckInput(String id);
......
...@@ -679,6 +679,10 @@ public interface FireFightingSystemMapper extends BaseMapper<FireFightingSystemE ...@@ -679,6 +679,10 @@ public interface FireFightingSystemMapper extends BaseMapper<FireFightingSystemE
Map<String, Object> selectEquipmentSpecificById(@Param("id") String id); Map<String, Object> selectEquipmentSpecificById(@Param("id") String id);
void updateStatusById(@Param("id") String id, @Param("status") String status);
Map<String, Object> getFireWaterStatics(@Param("bizOrgCode") String bizOrgCode);
Map<String, Object> selectFireFightingSystemStats(@Param("bizOrgCode") String bizOrgCode); Map<String, Object> selectFireFightingSystemStats(@Param("bizOrgCode") String bizOrgCode);
Map<String, Object> selectEquipmentSpecificStats(@Param("bizOrgCode") String bizOrgCode); Map<String, Object> selectEquipmentSpecificStats(@Param("bizOrgCode") String bizOrgCode);
......
...@@ -317,4 +317,6 @@ public interface IFireFightingSystemService extends IService<FireFightingSystemE ...@@ -317,4 +317,6 @@ public interface IFireFightingSystemService extends IService<FireFightingSystemE
*/ */
void resetMorphic(); void resetMorphic();
Map<String, Object> getFireWaterStatics(String bizOrgCode);
} }
...@@ -10,6 +10,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage; ...@@ -10,6 +10,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Sequence; import com.baomidou.mybatisplus.core.toolkit.Sequence;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.google.common.base.Joiner;
import com.google.common.collect.Lists; import com.google.common.collect.Lists;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams; import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import com.yeejoin.amos.boot.biz.common.utils.RedisUtils; import com.yeejoin.amos.boot.biz.common.utils.RedisUtils;
...@@ -2113,7 +2114,30 @@ public class EquipmentSpecificSerivceImpl extends ServiceImpl<EquipmentSpecificM ...@@ -2113,7 +2114,30 @@ public class EquipmentSpecificSerivceImpl extends ServiceImpl<EquipmentSpecificM
@Override @Override
public void updateEquipSpecificStatus(String status, String id){ public void updateEquipSpecificStatus(String status, String id){
equipmentSpecificMapper.updateEquipSpecificStatus(status,id); Integer num = equipmentSpecificMapper.updateEquipSpecificStatus(status, id);
if (0 < num) {
EquipmentSpecific equipmentSpecific = equipmentSpecificMapper.selectById(id);
if (StringUtil.isNotEmpty(equipmentSpecific.getSystemId())) {
List<String> ids = new ArrayList<>();
ids = Arrays.asList(equipmentSpecific.getSystemId().split(","));
ids.forEach(x -> {
// 系统赋码
String equipStatus = equipmentSpecificMapper.getEquipStatusList(x);
fireFightingSystemMapper.updateStatusById(x, equipStatus);
});
}
// 水源赋码
QueryWrapper<Equipment> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("code", equipmentSpecific.getEquipmentCode());
Equipment equipment = equipmentService.getOne(queryWrapper);
List<Long> ids = equipmentSpecificMapper.countEquipStatusListByEquipId(equipment.getId());
if (0 < ids.size()) {
String equipStatus = equipmentSpecificMapper.getSpecificStatusByEquipmentCode(equipment.getCode());
equipmentSpecificMapper.updateWaterResourceStatus(equipment.getId(), equipStatus);
}
}
} }
@Override @Override
......
...@@ -2456,4 +2456,20 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste ...@@ -2456,4 +2456,20 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste
} }
} }
@Override
public Map<String, Object> getFireWaterStatics(String bizOrgCode) {
Map<String, Object> map = new HashMap<>();
Map<String, Object> resultMap = fireFightingSystemMapper.getFireWaterStatics(bizOrgCode);
map.put("total", resultMap.get("total"));
map.put("redCode", resultMap.get("redCode"));
map.put("yellowCode", resultMap.get("yellowCode"));
BigDecimal total = new BigDecimal(String.valueOf(resultMap.get("total")));
BigDecimal redNum = new BigDecimal(String.valueOf(resultMap.get("redCode")));
BigDecimal yellowNum = new BigDecimal(String.valueOf(resultMap.get("yellowCode")));
BigDecimal errorNum = redNum.add(yellowNum);
BigDecimal ratePercent = errorNum.divide(total, 2, BigDecimal.ROUND_HALF_UP);
map.put("ratePercent", ratePercent + "%");
return map;
}
} }
...@@ -47,6 +47,7 @@ import org.typroject.tyboot.component.emq.EmqKeeper; ...@@ -47,6 +47,7 @@ import org.typroject.tyboot.component.emq.EmqKeeper;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil; import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import org.typroject.tyboot.core.restful.exception.instance.BadRequest; import org.typroject.tyboot.core.restful.exception.instance.BadRequest;
import org.typroject.tyboot.core.restful.utils.ResponseModel; import org.typroject.tyboot.core.restful.utils.ResponseModel;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.math.BigInteger; import java.math.BigInteger;
import java.math.RoundingMode; import java.math.RoundingMode;
...@@ -177,9 +178,6 @@ public class MqttReceiveServiceImpl implements MqttReceiveService { ...@@ -177,9 +178,6 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
CarMapper carMapper; CarMapper carMapper;
@Autowired @Autowired
IMainIotMonitorSerivce iMainIotMonitorSerivce;
@Autowired
private ISyncDataService syncDataService; private ISyncDataService syncDataService;
@Autowired @Autowired
......
package com.yeejoin.amos.boot.module.jcs.biz.controller;
import com.yeejoin.amos.boot.module.common.api.service.IOrgUsrService;
import com.yeejoin.amos.boot.module.common.biz.utils.CommonResponseUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
@Api(tags = "风险相关")
@RestController
@RequestMapping("/riskSource")
public class RiskController {
@Autowired
private IOrgUsrService orgUsrService;
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@ApiOperation(value = "获取人员信息详情发送至风险", notes = "获取人员信息详情发送至风险")
@RequestMapping(value = "/risk/person/detail", produces = "application/json;charset=UTF-8", method = RequestMethod.GET)
public ResponseModel getPersonDetailById(@RequestParam(value = "source") String source,
@RequestParam(value = "id") String id
) {
return CommonResponseUtil.success(orgUsrService.getPersonInfo(id,source));
}
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@ApiOperation(value = "人员附码状态回显", notes = "人员附码状态回显")
@RequestMapping(value = "/update/person/status", produces = "application/json;charset=UTF-8", method = RequestMethod.GET)
public ResponseModel updatePersonStatus(@RequestParam(value = "status") String status,
@RequestParam(value = "id") String id
) {
orgUsrService.updatePersonStatus(status,id);
return CommonResponseUtil.success();
}
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@ApiOperation(value = "人员信息", notes = "人员信息")
@RequestMapping(value = "/person/info", produces = "application/json;charset=UTF-8", method = RequestMethod.GET)
public ResponseModel getPersonInfo(@RequestParam(value = "id") String id
) {
return CommonResponseUtil.success(orgUsrService.getPersonOne(id));
}
}
...@@ -34,4 +34,12 @@ public class ControlScreenController extends AbstractBaseController { ...@@ -34,4 +34,12 @@ public class ControlScreenController extends AbstractBaseController {
} }
return CommonResponseUtil.success(iPlanTaskService.firePatrolStatics(bizOrgCode)); return CommonResponseUtil.success(iPlanTaskService.firePatrolStatics(bizOrgCode));
} }
@GetMapping("/statics")
@ApiOperation(value = "消防运维信息")
@TycloudOperation(ApiLevel = UserType.AGENCY)
public CommonResponse getStatics(@RequestParam(required = false) String companyCode) {
return CommonResponseUtil.success(iPlanTaskService.getStatics(companyCode));
}
} }
...@@ -216,4 +216,9 @@ public interface PlanTaskMapper extends BaseMapper { ...@@ -216,4 +216,9 @@ public interface PlanTaskMapper extends BaseMapper {
List<Map<String, Object>> getCheckNotQualifiedEquipInfo(@Param(value="taskDetailId") String taskDetailId); List<Map<String, Object>> getCheckNotQualifiedEquipInfo(@Param(value="taskDetailId") String taskDetailId);
String getCheckIdByDetailId(@Param(value="taskDetailId") String taskDetailId); String getCheckIdByDetailId(@Param(value="taskDetailId") String taskDetailId);
String queryByCompanyCode(@Param("companyCode") String companyCode);
List<Map<String, Object>> getStatics(@Param("bizOrgCode") String bizOrgCode);
} }
...@@ -2028,6 +2028,16 @@ public class PlanTaskServiceImpl implements IPlanTaskService { ...@@ -2028,6 +2028,16 @@ public class PlanTaskServiceImpl implements IPlanTaskService {
return map; return map;
} }
@Override
public List<Map<String, Object>> getStatics(String companyCode) {
String bizOrgCode = null;
if (StringUtil.isNotEmpty(companyCode)) {
bizOrgCode = planTaskMapper.queryByCompanyCode(companyCode);
}
return planTaskMapper.getStatics(bizOrgCode);
}
public static byte[] file2byte(File file) { public static byte[] file2byte(File file) {
try { try {
FileInputStream in = new FileInputStream(file); FileInputStream in = new FileInputStream(file);
......
...@@ -187,6 +187,8 @@ public interface IPlanTaskService { ...@@ -187,6 +187,8 @@ public interface IPlanTaskService {
*/ */
List<Map<String,Object>> firePatrolStatics(String bizOrgCode); List<Map<String,Object>> firePatrolStatics(String bizOrgCode);
List<Map<String,Object>> getStatics(String companyCode);
/** /**
* 计划执行查询 * 计划执行查询
*/ */
......
...@@ -975,6 +975,17 @@ ...@@ -975,6 +975,17 @@
</sql> </sql>
</changeSet> </changeSet>
<changeSet author="ky" id="20230808">
<preConditions onFail="MARK_RAN">
<not>
<columnExists tableName="f_fire_fighting_system" columnName="system_status"/>
</not>
</preConditions>
<comment>f_fire_fighting_system新增属性字段 system_status</comment>
<sql>
ALTER TABLE `f_fire_fighting_system` ADD COLUMN `system_status` varchar(20) NULL DEFAULT 0 COMMENT '消防系统状态,默认0表示正常(绿色),1为故障类(黄色),2为火警类(红色)';
ALTER TABLE `cb_water_resource` ADD COLUMN `water_status` varchar(20) NULL DEFAULT 0 COMMENT '水源状态,默认0表示正常(绿色),1为故障类(黄色),2为火警类(红色)';
</sql>
</changeSet>
</databaseChangeLog> </databaseChangeLog>
\ No newline at end of file
...@@ -2337,10 +2337,46 @@ ...@@ -2337,10 +2337,46 @@
FROM FROM
`f_equipment` a `f_equipment` a
</select> </select>
<update id="updateEquipSpecificStatus"> <update id="updateEquipSpecificStatus">
update wl_equipment_specific set equip_status = #{status} where id = #{id} update wl_equipment_specific set equip_status = #{status} where id = #{id}
</update> </update>
<update id="updateWaterResourceStatus">
update cb_water_resource set water_status = #{status} where equip_id = #{id}
</update>
<select id="getEquipStatusList" resultType="java.lang.String">
SELECT
wles.equip_status AS equipStatus
FROM
`wl_equipment_specific` `wles`
LEFT JOIN f_fire_fighting_system fs ON FIND_IN_SET(fs.id, wles.system_id)
WHERE
fs.id = #{id}
ORDER BY wles.equip_status DESC
limit 1
</select>
<select id="getSpecificStatusByEquipmentCode" resultType="java.lang.String">
SELECT
wles.equip_status AS equipStatus
FROM
`wl_equipment_specific` `wles`
WHERE
wles.equipment_code = #{equipCode}
ORDER BY wles.equip_status DESC
limit 1
</select>
<select id="countEquipStatusListByEquipId" resultType="java.lang.Long">
SELECT
cwr.sequence_nbr AS id
FROM
cb_water_resource cwr
where
cwr.equip_id = #{id}
</select>
<select id="updateEquipSpecificStatusByCheckInput" resultType="java.lang.String"> <select id="updateEquipSpecificStatusByCheckInput" resultType="java.lang.String">
SELECT SELECT
......
...@@ -5888,6 +5888,46 @@ ...@@ -5888,6 +5888,46 @@
dat.updateDate DESC dat.updateDate DESC
</select> </select>
<update id="updateStatusById">
update f_fire_fighting_system set system_status = #{status} where id = #{id}
</update>
<select id="getFireWaterStatics" resultType="java.util.Map">
select
(select
count(sequence_nbr)
from
cb_water_resource
<where>
<if test="bizOrgCode != null and bizOrgCode != ''">
biz_org_code like concat(#{bizOrgCode}, '%')
</if>
</where>
) AS total,
(select
count(sequence_nbr)
from
cb_water_resource
<where>
water_status = '2'
<if test="bizOrgCode != null and bizOrgCode != ''">
AND biz_org_code like concat(#{bizOrgCode}, '%')
</if>
</where>
) AS redCode,
(select
count(sequence_nbr)
from
cb_water_resource
<where>
water_status = '1'
<if test="bizOrgCode != null and bizOrgCode != ''">
AND biz_org_code like concat(#{bizOrgCode}, '%')
</if>
</where>
) AS yellowCode
</select>
<select id="selectFireFightingSystemStats" resultType="java.util.Map"> <select id="selectFireFightingSystemStats" resultType="java.util.Map">
SELECT SELECT
COUNT(*) AS totalCount, COUNT(*) AS totalCount,
......
...@@ -1354,4 +1354,82 @@ ...@@ -1354,4 +1354,82 @@
<select id="getCheckIdByDetailId" resultType="java.lang.String"> <select id="getCheckIdByDetailId" resultType="java.lang.String">
select id from p_check where plan_task_detail_id = #{taskDetailId} limit 1 select id from p_check where plan_task_detail_id = #{taskDetailId} limit 1
</select> </select>
<select id="getStatics" resultType="java.util.Map">
SELECT
'1' AS `key`,
ifnull( sum( `p_plan_task`.`finish_num` ), 0 ) AS `value`,
'' AS unit,
'今日累计巡查点位' AS `name`,
'xfxcjrljxcdw' AS code
FROM
`p_plan_task`
WHERE
DATE_FORMAT( check_date, '%Y-%m-%d' ) = CURRENT_DATE ()
<if test="bizOrgCode != null and bizOrgCode != ''">
AND org_code LIKE CONCAT(#{bizOrgCode}, '%')
</if>
UNION ALL
SELECT
ifnull( sum( ppk.`point_num` ), 0 ) AS `value`,
'' AS unit,
'合格' AS `name`,
'xfxchg' AS code,
'2' AS `key`
FROM
`p_plan_task` ppk
LEFT JOIN p_plan_task_detail pptd ON pptd.task_no = ppk.id
WHERE
DATE_FORMAT( check_date, '%Y-%m-%d' ) = CURRENT_DATE () AND pptd.STATUS = 1
<if test="bizOrgCode != null and bizOrgCode != ''">
AND org_code LIKE CONCAT(#{bizOrgCode}, '%')
</if>
UNION ALL
SELECT
'' AS `value`,
'%' AS unit,
'合格占比' AS `name`,
'xfxchgzb' AS code,
'3' AS `key`
UNION ALL
SELECT
'' AS `value`,
'' AS unit,
'不合格' AS `name`,
'xfxcbhg' AS code,
'4' AS `key`
UNION ALL
SELECT
ifnull( sum( `p_plan_task`.`point_num` ), 0 ) AS `value`,
'' AS unit,
'今日漏查点位' AS `name`,
'currentDayMiss' AS `indexKey`,
'xfxcjrlcdw' AS code,
'5' AS `key`
FROM
`p_plan_task`
WHERE
`finish_status` = 3
AND DATE_FORMAT( check_date, '%Y-%m-%d' ) = CURRENT_DATE ()
<if test="bizOrgCode != null and bizOrgCode != ''">
AND org_code LIKE CONCAT(#{bizOrgCode}, '%')
</if>
UNION ALL
SELECT
'' AS `value`,
'' AS unit,
'漏查率' AS `name`,
'xfxclcl' AS code,
'6' AS `key`
</select>
<select id="queryByCompanyCode" resultType="java.lang.String">
SELECT biz_org_code
FROM cb_org_usr
WHERE is_delete = 0
<if test="companyCode != null and companyCode != ''">
AND code = #{companyCode}
</if>
</select>
</mapper> </mapper>
\ No newline at end of file
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