src/main/java/org/springblade/modules/yw/mapper/FirmInfoMapper.xml
@@ -5,9 +5,8 @@ <!--自定义分页查询--> <select id="selectFirmInfoPage" resultType="org.springblade.modules.yw.vo.FirmInfoVO"> select yfi.*,bdb.dict_value as categoryName yfi.* from yw_firm_info yfi left join blade_dict_biz bdb on bdb.dict_key = yfi.category and bdb.code = 'industry_category' where yfi.is_deleted = 0 <if test="firmInfo.name!=null and firmInfo.name!=''"> and yfi.name like concat('%',#{firmInfo.name},'%') src/main/java/org/springblade/modules/yw/mapper/RiskSourceMapper.xml
@@ -20,14 +20,19 @@ <select id="selectRiskSourcePage" resultType="org.springblade.modules.yw.vo.RiskSourceVO"> select yrs.*, yfi.name as firmName yfi.name as firmName,yfi.category,yfi.main_product, bdb.dict_value as riskLevelName from yw_risk_source yrs left join yw_firm_info yfi on yfi.id = yrs.firm_id and yfi.is_deleted = 0 left join blade_dict_biz bdb on bdb.dict_key = yrs.risk_level and bdb.code = 'risk_level' where yrs.is_deleted = 0 <if test="riskSource.firmId!=null"> and yrs.firm_id = #{riskSource.firmId} </if> <if test="riskSource.riskLevel!=null"> and yrs.risk_level = #{riskSource.riskLevel} </if> </select> <!--风险源统计查询--> src/main/java/org/springblade/modules/yw/service/impl/FirmInfoServiceImpl.java
@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage; 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.utils.PositionUtil; import org.springblade.core.tool.utils.BeanUtil; import org.springblade.modules.yw.entity.FirmInfo; @@ -32,7 +33,15 @@ */ @Override public IPage<FirmInfoVO> selectFirmInfoPage(IPage<FirmInfoVO> page, FirmInfoVO firmInfo) { return page.setRecords(baseMapper.selectFirmInfoPage(page,firmInfo)); List<FirmInfoVO> firmInfoVOS = baseMapper.selectFirmInfoPage(page, firmInfo); for (FirmInfoVO firmInfoVO : firmInfoVOS) { if (!Strings.isBlank(firmInfoVO.getCategory())){ firmInfoVO.setCategoryName( DictBizCache.getValues("industry_category",firmInfoVO.getCategory()) ); } } return page.setRecords(firmInfoVOS); } /** src/main/java/org/springblade/modules/yw/service/impl/RiskSourceServiceImpl.java
@@ -3,6 +3,7 @@ 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.core.tool.utils.BeanUtil; import org.springblade.modules.yw.entity.FirmInfo; import org.springblade.modules.yw.entity.RiskSourceEntity; @@ -39,7 +40,15 @@ */ @Override public IPage<RiskSourceVO> selectRiskSourcePage(IPage<RiskSourceVO> page, RiskSourceVO riskSource) { return page.setRecords(baseMapper.selectRiskSourcePage(page, riskSource)); List<RiskSourceVO> riskSourceVOS = baseMapper.selectRiskSourcePage(page, riskSource); for (RiskSourceVO riskSourceVO : riskSourceVOS) { if (!Strings.isBlank(riskSourceVO.getCategory())){ riskSourceVO.setCategory( DictBizCache.getValues("industry_category",riskSourceVO.getCategory()) ); } } return page.setRecords(riskSourceVOS); } /** src/main/java/org/springblade/modules/yw/vo/RiskSourceVO.java
@@ -1,24 +1,7 @@ /* * 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.RiskSourceEntity; import org.springblade.core.tool.node.INode; import lombok.Data; import lombok.EqualsAndHashCode; @@ -35,4 +18,13 @@ @ApiModelProperty(value = "企业名称") private String firmName; @ApiModelProperty(value = "环境风险等级") private String riskLevelName; @ApiModelProperty(value = "行业类别") private String category; @ApiModelProperty(value = "主要产品") private String mainProduct; }