应急空间,救援队伍,风险源,应急物资查询调整,按企业查询
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill 庄骞 (smallchill@163.com) |
| | | */ |
| | | package org.springblade.common.cache; |
| | | |
| | | import org.apache.logging.log4j.util.Strings; |
| | | import org.springblade.common.enums.DictBizEnum; |
| | | import org.springblade.core.cache.utils.CacheUtil; |
| | | import org.springblade.core.secure.utils.AuthUtil; |
| | |
| | | import org.springblade.core.tool.utils.StringPool; |
| | | import org.springblade.modules.system.entity.DictBiz; |
| | | import org.springblade.modules.system.service.IDictBizService; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | import static org.springblade.core.cache.constant.CacheConstant.DICT_CACHE; |
| | | |
| | | /** |
| | |
| | | /** |
| | | * 获取字典值 |
| | | * |
| | | * @param code 字典编号 |
| | | * @param dictKeys 字符串键 |
| | | * @return String |
| | | */ |
| | | public static String getValues(String code, String dictKeys) { |
| | | List<String> list = new ArrayList<>(); |
| | | List<DictBiz> dictBizList = getList(code); |
| | | for (DictBiz dictBiz : dictBizList) { |
| | | if (dictKeys.contains(dictBiz.getDictKey())){ |
| | | list.add(dictBiz.getDictValue()); |
| | | } |
| | | } |
| | | return Strings.join(list,','); |
| | | } |
| | | |
| | | /** |
| | | * 获取字典值 |
| | | * |
| | | * @param code 字典编号枚举 |
| | | * @param dictKey String型字典键 |
| | | * @return String |
| | |
| | | */ |
| | | @ApiModelProperty(value = "所属企业id") |
| | | private Long firmId; |
| | | /** |
| | | * 责任人姓名 |
| | | */ |
| | | @ApiModelProperty(value = "责任人姓名") |
| | | private String personInCha; |
| | | /** |
| | | * 责任人电话 |
| | | */ |
| | | @ApiModelProperty(value = "责任人电话") |
| | | private String personInChaPhone; |
| | | |
| | | /** |
| | | * 创建人 |
| | |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="org.springblade.modules.yw.mapper.EmergencySpaceMapper"> |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="emergencySpaceResultMap" type="org.springblade.modules.yw.entity.EmergencySpaceEntity"> |
| | | <result column="id" property="id"/> |
| | | <result column="name" property="name"/> |
| | | <result column="type" property="type"/> |
| | | <result column="main_func" property="mainFunc"/> |
| | | <result column="lng" property="lng"/> |
| | | <result column="lat" property="lat"/> |
| | | <result column="pre_level" property="preLevel"/> |
| | | <result column="capacity" property="capacity"/> |
| | | <result column="remark" property="remark"/> |
| | | <result column="firm_id" property="firmId"/> |
| | | <result column="create_user" property="createUser"/> |
| | | <result column="create_time" property="createTime"/> |
| | | <result column="update_user" property="updateUser"/> |
| | | <result column="update_time" property="updateTime"/> |
| | | <result column="is_deleted" property="isDeleted"/> |
| | | </resultMap> |
| | | |
| | | <!--自定义分页查询--> |
| | | <select id="selectEmergencySpacePage" resultMap="emergencySpaceResultMap"> |
| | | select * from yw_emergency_space where is_deleted = 0 |
| | | <select id="selectEmergencySpacePage" resultType="org.springblade.modules.yw.vo.EmergencySpaceVO"> |
| | | select |
| | | yes.*, |
| | | yfi.name as firmName, |
| | | bdb.dict_value as emergencySpaceType |
| | | from yw_emergency_space yes |
| | | left join blade_dict_biz bdb on bdb.dict_key = yes.type and bdb.code = 'emergency_space_type' |
| | | left join yw_firm_info yfi on yfi.id = yes.firm_id and yfi.is_deleted = 0 |
| | | where yes.is_deleted = 0 |
| | | <if test="emergencySpace.name!=null and emergencySpace.name!=''"> |
| | | and yes.name like concat('%',#{emergencySpace.name},'%') |
| | | </if> |
| | | <if test="emergencySpace.firmId!=null"> |
| | | and yes.firm_id = #{emergencySpace.firmId} |
| | | </if> |
| | | <if test="emergencySpace.type!=null"> |
| | | and yes.type = #{emergencySpace.type} |
| | | </if> |
| | | </select> |
| | | |
| | | <!--获取应急空间统计数据--> |
| | |
| | | package org.springblade.modules.yw.mapper; |
| | | |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.springblade.modules.yw.entity.EmergencySuppliesEntity; |
| | | import org.springblade.modules.yw.vo.EmergencySuppliesVO; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | |
| | | * @param emergencySupplies |
| | | * @return |
| | | */ |
| | | List<EmergencySuppliesVO> selectEmergencySuppliesPage(IPage page, EmergencySuppliesVO emergencySupplies); |
| | | List<EmergencySuppliesVO> selectEmergencySuppliesPage(IPage page, |
| | | @Param("emergencySupplies") EmergencySuppliesVO emergencySupplies); |
| | | |
| | | } |
| | |
| | | <resultMap id="emergencySuppliesResultMap" type="org.springblade.modules.yw.entity.EmergencySuppliesEntity"> |
| | | <result column="id" property="id"/> |
| | | <result column="name" property="name"/> |
| | | <result column="number" property="number"/> |
| | | <result column="num" property="num"/> |
| | | <result column="unit" property="unit"/> |
| | | <result column="address" property="address"/> |
| | | <result column="sto_loc" property="stoLoc"/> |
| | | <result column="supplies_id" property="suppliesId"/> |
| | | <result column="remark" property="remark"/> |
| | | <result column="firm_id" property="firmId"/> |
| | | <result column="person_in_cha" property="personInCha"/> |
| | | <result column="person_in_cha_phone" property="personInChaPhone"/> |
| | | <result column="create_user" property="createUser"/> |
| | | <result column="create_time" property="createTime"/> |
| | | <result column="update_user" property="updateUser"/> |
| | |
| | | </resultMap> |
| | | |
| | | <!--自定义分页查询--> |
| | | <select id="selectEmergencySuppliesPage" resultMap="emergencySuppliesResultMap"> |
| | | select * from yw_emergency_supplies where is_deleted = 0 |
| | | <select id="selectEmergencySuppliesPage" resultType="org.springblade.modules.yw.vo.EmergencySuppliesVO"> |
| | | select |
| | | yes.*, |
| | | yfi.name as firmName, |
| | | ys.per_in_cha as personInCha,ys.per_in_cha_pho as personInChaPhone, |
| | | bdb.dict_value as emeSupType, |
| | | concat(yes.num,bdb1.dict_value) as numUnit |
| | | from |
| | | yw_emergency_supplies yes |
| | | left join yw_supplies ys on ys.id = yes.supplies_id and ys.is_deleted = 0 |
| | | left join yw_firm_info yfi on yfi.id = yes.firm_id and yfi.is_deleted = 0 |
| | | left join blade_dict_biz bdb on bdb.dict_key = yes.type and bdb.code = 'eme_sup_type' |
| | | left join blade_dict_biz bdb1 on bdb1.dict_key = yes.unit and bdb1.code = 'unit' |
| | | where yes.is_deleted = 0 |
| | | <if test="emergencySupplies.name!=null and emergencySupplies.name!=''"> |
| | | and yes.name like concat('%',#{emergencySupplies.name},'%') |
| | | </if> |
| | | <if test="emergencySupplies.firmId!=null"> |
| | | and yes.firm_id = #{emergencySupplies.firmId} |
| | | </if> |
| | | <if test="emergencySupplies.type!=null"> |
| | | and yes.type = #{emergencySupplies.type} |
| | | </if> |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | </resultMap> |
| | | |
| | | <!--自定义分页查询--> |
| | | <select id="selectRescueTeamPage" resultMap="rescueTeamResultMap"> |
| | | select * from yw_rescue_team where is_deleted = 0 |
| | | <select id="selectRescueTeamPage" resultType="org.springblade.modules.yw.vo.RescueTeamVO"> |
| | | select |
| | | yrt.*, |
| | | yfi.name as firmName |
| | | from |
| | | yw_rescue_team yrt |
| | | left join yw_firm_info yfi on yfi.id = yrt.firm_id and yfi.is_deleted = 0 |
| | | where yrt.is_deleted = 0 |
| | | <if test="rescueTeam.firmId!=null"> |
| | | and yrt.firm_id = #{rescueTeam.firmId} |
| | | </if> |
| | | <if test="rescueTeam.perInCha!=null and rescueTeam.perInCha!=''"> |
| | | and yrt.per_in_cha like concat('%',#{rescueTeam.perInCha},'%') |
| | | </if> |
| | | <if test="rescueTeam.perInChaPho!=null and rescueTeam.perInChaPho!=''"> |
| | | and yrt.per_in_cha_pho like concat('%',#{rescueTeam.perInChaPho},'%') |
| | | </if> |
| | | </select> |
| | | |
| | | <!--自定义分页查询--> |
| | |
| | | </resultMap> |
| | | |
| | | <!--自定义分页查询--> |
| | | <select id="selectRiskSourcePage" resultMap="riskSourceResultMap"> |
| | | select * from yw_risk_source where is_deleted = 0 |
| | | <select id="selectRiskSourcePage" resultType="org.springblade.modules.yw.vo.RiskSourceVO"> |
| | | select |
| | | yrs.*, |
| | | yfi.name as firmName |
| | | from |
| | | yw_risk_source yrs |
| | | left join yw_firm_info yfi on yfi.id = yrs.firm_id and yfi.is_deleted = 0 |
| | | where yrs.is_deleted = 0 |
| | | <if test="riskSource.firmId!=null"> |
| | | and yrs.firm_id = #{riskSource.firmId} |
| | | </if> |
| | | </select> |
| | | |
| | | <!--风险源统计查询--> |
| | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.apache.logging.log4j.util.Strings; |
| | | import org.springblade.common.cache.DictBizCache; |
| | | import org.springblade.common.cache.SysCache; |
| | | import org.springblade.common.utils.PositionUtil; |
| | | import org.springblade.core.tool.utils.BeanUtil; |
| | | import org.springblade.modules.yw.entity.EmergencySpaceEntity; |
| | |
| | | */ |
| | | @Override |
| | | public IPage<EmergencySpaceVO> selectEmergencySpacePage(IPage<EmergencySpaceVO> page, EmergencySpaceVO emergencySpace) { |
| | | return page.setRecords(baseMapper.selectEmergencySpacePage(page, emergencySpace)); |
| | | List<EmergencySpaceVO> emergencySpaceVOS = baseMapper.selectEmergencySpacePage(page, emergencySpace); |
| | | for (EmergencySpaceVO emergencySpaceVO : emergencySpaceVOS) { |
| | | // 设置应急空间主要用途 |
| | | emergencySpaceVO.setMainFuncName(DictBizCache.getValues("emergency_space_use",emergencySpaceVO.getMainFunc())); |
| | | } |
| | | return page.setRecords(emergencySpaceVOS); |
| | | } |
| | | |
| | | /** |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill 庄骞 (smallchill@163.com) |
| | | */ |
| | | package org.springblade.modules.yw.vo; |
| | | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import org.springblade.modules.yw.entity.EmergencySpaceEntity; |
| | | import org.springblade.core.tool.node.INode; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | |
| | | public class EmergencySpaceVO extends EmergencySpaceEntity { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * 企业名称 |
| | | */ |
| | | @ApiModelProperty(value = "企业名称") |
| | | private String firmName; |
| | | |
| | | /** |
| | | * 应急空间类型 |
| | | */ |
| | | @ApiModelProperty(value = "应急空间类型") |
| | | private String emergencySpaceType; |
| | | |
| | | /** |
| | | * 主要功能 |
| | | */ |
| | | @ApiModelProperty(value = "主要功能") |
| | | private String mainFuncName; |
| | | } |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill 庄骞 (smallchill@163.com) |
| | | */ |
| | | package org.springblade.modules.yw.vo; |
| | | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import org.springblade.modules.yw.entity.EmergencySuppliesEntity; |
| | | import org.springblade.core.tool.node.INode; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | |
| | | public class EmergencySuppliesVO extends EmergencySuppliesEntity { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | |
| | | @ApiModelProperty(value = "企业名称") |
| | | private String firmName; |
| | | |
| | | @ApiModelProperty(value = "类型") |
| | | private String emeSupType; |
| | | |
| | | @ApiModelProperty(value = "数量单位(拼接)") |
| | | private String numUnit; |
| | | |
| | | /** |
| | | * 责任人姓名 |
| | | */ |
| | | @ApiModelProperty(value = "责任人姓名") |
| | | private String personInCha; |
| | | /** |
| | | * 责任人电话 |
| | | */ |
| | | @ApiModelProperty(value = "责任人电话") |
| | | private String personInChaPhone; |
| | | |
| | | } |
| | |
| | | */ |
| | | package org.springblade.modules.yw.vo; |
| | | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import org.springblade.modules.yw.entity.RescueTeamEntity; |
| | | import org.springblade.core.tool.node.INode; |
| | | import lombok.Data; |
| | |
| | | public class RescueTeamVO extends RescueTeamEntity { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @ApiModelProperty(value = "企业名称") |
| | | private String firmName; |
| | | |
| | | } |
| | |
| | | */ |
| | | package org.springblade.modules.yw.vo; |
| | | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import org.springblade.modules.yw.entity.RiskSourceEntity; |
| | | import org.springblade.core.tool.node.INode; |
| | | import lombok.Data; |
| | |
| | | public class RiskSourceVO extends RiskSourceEntity { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @ApiModelProperty(value = "企业名称") |
| | | private String firmName; |
| | | } |