Commit 1d167481 authored by suhuiguang's avatar suhuiguang

2.增加设备类型字段

4.增加设备类型筛选
parent eaa64c14
package com.yeejoin.amos.boot.module.statistics.api.mapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.module.statistics.api.entity.TzBaseEnterpriseInfo;
import com.yeejoin.amos.boot.module.ymt.api.dto.TzBaseEnterpriseInfoDto;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
......@@ -22,4 +25,13 @@ public interface EnterpriseBizMapper {
TzBaseEnterpriseInfo queryByUseCode(@Param("useCode") String useCode);
TzBaseEnterpriseInfo queryBySeq(@Param("sequenceNbr") String sequenceNbr);
/**
* 监查值守迁移接口
* @param page 分页参数
* @param tzBaseEnterpriseInfoDto 筛选条件
* @param orgCodeList 机构
* @return 分页
*/
IPage<TzBaseEnterpriseInfoDto> pageList2(Page<TzBaseEnterpriseInfoDto> page, TzBaseEnterpriseInfoDto tzBaseEnterpriseInfoDto, List orgCodeList, List unitTypeList);
}
......@@ -14,5 +14,103 @@
<select id="queryBySeq" resultType="com.yeejoin.amos.boot.module.statistics.api.entity.TzBaseEnterpriseInfo">
select * from tz_base_enterprise_info where sequence_nbr = #{sequenceNbr}
</select>
<select id="pageList2"
resultType="com.yeejoin.amos.boot.module.ymt.api.dto.TzBaseEnterpriseInfoDto">
SELECT
*,
equip_category as equipType,
TRIM(TRAILING '/' FROM CONCAT(
CASE WHEN COALESCE(province, '') <![CDATA[<>]]> '' THEN CONCAT(province, '/') ELSE '' END,
CASE WHEN COALESCE(city, '') <![CDATA[<>]]> '' THEN CONCAT(city, '/') ELSE '' END,
CASE WHEN COALESCE(district, '') <![CDATA[<>]]> '' THEN CONCAT(district, '/') ELSE '' END
)) AS region,
<if test=" tzBaseEnterpriseInfoDto.unitType.indexOf('使用单位')!=-1">
(SELECT cdd.name from amos_tzs_biz.cb_data_dictionary cdd WHERE cdd.code = industry_supervisor and cdd.type = 'HYZGBM') AS industrySupervisorName,
</if>
CONCAT(street,'/',address) AS full_address
FROM
tz_base_enterprise_info
<if test=" tzBaseEnterpriseInfoDto.unitType.indexOf('检验检测机构') !=-1 ">
JOIN (select unit_code,max(accept_date) from tz_jyjc_opening_application
where 1=1
<if test=" tzBaseEnterpriseInfoDto.jyjcStatus!=null and tzBaseEnterpriseInfoDto.jyjcStatus!='' ">
and status = #{tzBaseEnterpriseInfoDto.jyjcStatus}
</if>
<if test=" tzBaseEnterpriseInfoDto.jyjcType!=null and tzBaseEnterpriseInfoDto.jyjcType!='' ">
and open_biz_type = #{tzBaseEnterpriseInfoDto.jyjcType}
</if>
group by unit_code,open_biz_type) t1
ON t1.unit_code = use_code
</if>
<where>
<!-- <if-->
<!-- test="tzBaseEnterpriseInfoDto.unitType!=null and tzBaseEnterpriseInfoDto.unitType!='' and tzBaseEnterpriseInfoDto.unitType!='使用单位' ">-->
<!-- -->
<!-- AND unit_type LIKE CONCAT('%',#{tzBaseEnterpriseInfoDto.unitType},'%')-->
<!-- </if>-->
<if test="unitTypeList != null and !unitTypeList.isEmpty()">
AND (
<foreach collection="unitTypeList" item="item" separator=" OR ">
unit_type LIKE CONCAT('%', #{item}, '%')
</foreach>
)
</if>
<if
test="tzBaseEnterpriseInfoDto.useUnit!=null and tzBaseEnterpriseInfoDto.useUnit!='' ">
AND use_unit LIKE CONCAT('%',#{tzBaseEnterpriseInfoDto.useUnit},'%')
</if>
<if
test="tzBaseEnterpriseInfoDto.useUnitCertificate!=null and tzBaseEnterpriseInfoDto.useUnitCertificate!='' ">
AND use_unit_certificate = #{tzBaseEnterpriseInfoDto.useUnitCertificate}
</if>
<if
test="tzBaseEnterpriseInfoDto.useCode!=null and tzBaseEnterpriseInfoDto.useCode!='' ">
AND use_code LIKE CONCAT('%',#{tzBaseEnterpriseInfoDto.useCode},'%')
</if>
<if
test="tzBaseEnterpriseInfoDto.region!=null and tzBaseEnterpriseInfoDto.region!='' ">
AND CONCAT_WS('/', province,city,district) LIKE CONCAT('%',#{tzBaseEnterpriseInfoDto.region},'%')
</if>
<if
test="tzBaseEnterpriseInfoDto.legalPerson!=null and tzBaseEnterpriseInfoDto.legalPerson!='' ">
AND legal_person LIKE CONCAT('%',#{tzBaseEnterpriseInfoDto.legalPerson},'%')
</if>
<if
test="tzBaseEnterpriseInfoDto.legalPhone!=null and tzBaseEnterpriseInfoDto.legalPhone!='' ">
AND legal_phone LIKE CONCAT('%',#{tzBaseEnterpriseInfoDto.legalPhone},'%')
</if>
<if
test="tzBaseEnterpriseInfoDto.superviseOrgCode!=null and tzBaseEnterpriseInfoDto.superviseOrgCode!='' ">
AND supervise_org_code LIKE CONCAT('%',#{tzBaseEnterpriseInfoDto.superviseOrgCode},'%')
</if>
<if
test="tzBaseEnterpriseInfoDto.address!=null and tzBaseEnterpriseInfoDto.address!='' ">
AND address LIKE CONCAT('%',#{tzBaseEnterpriseInfoDto.address},'%')
</if>
<if test="tzBaseEnterpriseInfoDto.regulatoryLabels!=null and tzBaseEnterpriseInfoDto.regulatoryLabels!='' ">
AND regulatory_labels LIKE CONCAT('%',#{tzBaseEnterpriseInfoDto.regulatoryLabels},'%')
</if>
<if test="tzBaseEnterpriseInfoDto.equipType!=null and tzBaseEnterpriseInfoDto.equipType!='' ">
AND equip_category LIKE CONCAT('%',#{tzBaseEnterpriseInfoDto.equipType},'%')
</if>
<if test="orgCodeList != null and !orgCodeList.isEmpty()">
AND (
<foreach collection="orgCodeList" item="item" separator=" OR ">
supervise_org_code LIKE CONCAT('%', #{item}, '%')
</foreach>
)
</if>
<if test="tzBaseEnterpriseInfoDto.industrySupervisor!=null and tzBaseEnterpriseInfoDto.industrySupervisor!='' ">
AND (industry_supervisor = #{tzBaseEnterpriseInfoDto.industrySupervisor}
<if test=" tzBaseEnterpriseInfoDto.industrySupervisor == '6527' ">
or industry_supervisor is null
</if>)
</if>
AND is_delete = 0
</where>
order by rec_date desc
</select>
</mapper>
......@@ -11,11 +11,12 @@ import com.yeejoin.amos.boot.module.common.api.enums.UnitTypeEnum;
import com.yeejoin.amos.boot.module.statistics.api.mapper.EnterpriseBizMapper;
import com.yeejoin.amos.boot.module.ymt.api.dto.TzBaseEnterpriseInfoDto;
import com.yeejoin.amos.boot.module.ymt.api.entity.PageParam;
import com.yeejoin.amos.boot.module.ymt.api.mapper.TzBaseEnterpriseInfoMapper;
import com.yeejoin.amos.boot.module.ymt.api.enums.EquipmentClassifityEnum;
import com.yeejoin.amos.component.feign.model.FeignClientResult;
import com.yeejoin.amos.feign.privilege.Privilege;
import com.yeejoin.amos.feign.privilege.model.CompanyModel;
import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.lucene.queryparser.classic.QueryParser;
import org.elasticsearch.action.search.SearchRequest;
import org.elasticsearch.action.search.SearchResponse;
......@@ -44,8 +45,6 @@ public class EnterpriseBizServiceImpl {
private StCommonServiceImpl stCommonService;
private TzBaseEnterpriseInfoMapper tzBaseEnterpriseInfoMapper;
private EnterpriseBizMapper enterpriseBizMapper;
private RestHighLevelClient restHighLevelClient;
......@@ -54,11 +53,10 @@ public class EnterpriseBizServiceImpl {
private Logger logger = LoggerFactory.getLogger(EnterpriseBizServiceImpl.class);
public EnterpriseBizServiceImpl(RedisUtils redisUtils, StCommonServiceImpl stCommonService,
TzBaseEnterpriseInfoMapper tzBaseEnterpriseInfoMapper, EnterpriseBizMapper enterpriseBizMapper,
EnterpriseBizMapper enterpriseBizMapper,
RestHighLevelClient restHighLevelClient) {
this.redisUtils = redisUtils;
this.stCommonService = stCommonService;
this.tzBaseEnterpriseInfoMapper = tzBaseEnterpriseInfoMapper;
this.enterpriseBizMapper = enterpriseBizMapper;
this.restHighLevelClient = restHighLevelClient;
}
......@@ -107,13 +105,23 @@ public class EnterpriseBizServiceImpl {
}
}
}
IPage<TzBaseEnterpriseInfoDto> tzBaseEnterpriseInfoDtoIPage = tzBaseEnterpriseInfoMapper.pageList2(page, tzBaseEnterpriseInfoDto, orgCodeList, unitTypeList);
IPage<TzBaseEnterpriseInfoDto> tzBaseEnterpriseInfoDtoIPage = enterpriseBizMapper.pageList2(page, tzBaseEnterpriseInfoDto, orgCodeList, unitTypeList);
if (ValidationUtil.isEmpty(tzBaseEnterpriseInfoDtoIPage.getRecords())) {
logger.info("查询到的数据为空");
return tzBaseEnterpriseInfoDtoIPage;
}
for(TzBaseEnterpriseInfoDto dto : tzBaseEnterpriseInfoDtoIPage.getRecords()){
if(StringUtils.isNotEmpty(dto.getEquipType())){
String equipType = dto.getEquipType();
List<String> equipTypeList = JSON.parseArray(equipType, String.class);
Set<String> names = new HashSet<>();
for(String equCode : equipTypeList){
names.add(EquipmentClassifityEnum.getNameByCode(equCode));
}
names.remove("");
dto.setEquipTypeName(StringUtils.join(names, ","));
}
}
if (tzBaseEnterpriseInfoDto.getUnitType().contains(UnitTypeEnum.CZDW.getName())) {
SearchRequest searchRequest = new SearchRequest("idx_biz_view_jg_all");
......
......@@ -319,4 +319,14 @@ public class TzBaseEnterpriseInfoDto extends BaseDto {
//充装单位列表展示需要的气瓶数量
private String gasCount;
/**
* 设备类型-code
*/
private String equipType;
/**
* 设备类型-名称
*/
private String equipTypeName;
}
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