Commit 72564851 authored by 曹盼盼's avatar 曹盼盼

修改企业列表

parent 062a4aef
......@@ -43,4 +43,6 @@ public interface TzBaseEnterpriseInfoMapper extends BaseMapper<TzBaseEnterpriseI
IPage<TzBaseEnterpriseInfoDto> page(Page<TzBaseEnterpriseInfoDto> page, TzBaseEnterpriseInfoDto tzBaseEnterpriseInfoDto);
IPage<TzBaseEnterpriseInfoDto> pageList(Page<TzBaseEnterpriseInfoDto> page, TzBaseEnterpriseInfoDto tzBaseEnterpriseInfoDto,List orgCodeList);
}
......@@ -88,6 +88,75 @@
</where>
</select>
<select id="pageList"
resultType="com.yeejoin.amos.boot.module.tzs.api.dto.TzBaseEnterpriseInfoDto">
SELECT
*,
CONCAT(province,'/',city,'/',district) AS region,
CONCAT(street,'/',address) AS full_address
FROM
tz_base_enterprise_info
<where>
<if
test="tzBaseEnterpriseInfoDto.unitType!=null and tzBaseEnterpriseInfoDto.unitType!='' ">
AND unit_type = #{tzBaseEnterpriseInfoDto.unitType}
</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.superviseOrgCode!=null and tzBaseEnterpriseInfoDto.superviseOrgCode!='' ">
AND supervise_org_code LIKE CONCAT('%',#{tzBaseEnterpriseInfoDto.superviseOrgCode},'%')
</if>
<if
test="tzBaseEnterpriseInfoDto.region!=null and tzBaseEnterpriseInfoDto.region!='' ">
AND CONCAT(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 supervise_org_code LIKE CONCAT('%',#{tzBaseEnterpriseInfoDto.address},'%')
</if>
<if test="orgCodeList != null and ! orgCodeList.isEmpty() and orgCodeList.size() > 0">
1=1
<foreach collection="orgCodeList" item="item" index="index" >
<if test="index==0">
AND
</if>
<if test="index!= 0">
OR
</if>
supervise_org_code LIKE CONCAT('%',#{item},'%')
</foreach>
</if>
AND is_delete = 0
</where>
</select>
<select id="selectByUseUnit" resultType="com.yeejoin.amos.boot.module.tzs.api.entity.TzBaseEnterpriseInfo">
select * from tz_base_enterprise_info where use_unit = #{useUnit}
</select>
......
......@@ -7,6 +7,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.github.pagehelper.util.PageObjectUtil;
import com.yeejoin.amos.boot.biz.common.entity.DataDictionary;
import com.yeejoin.amos.boot.biz.common.service.impl.DataDictionaryServiceImpl;
import com.yeejoin.amos.boot.biz.common.utils.DateUtils;
......@@ -125,6 +126,7 @@ public class TzBaseEnterpriseInfoServiceImpl
@Override
public IPage<TzBaseEnterpriseInfoDto> page(PageParam pageParam, TzBaseEnterpriseInfoDto tzBaseEnterpriseInfoDto) {
List<String> orgCodeList = new ArrayList<>();
if (tzBaseEnterpriseInfoDto.getSuperviseKey() != null) {
FeignClientResult<CompanyModel> result = Privilege.companyClient
.seleteOne(Long.valueOf(tzBaseEnterpriseInfoDto.getSuperviseKey()));
......@@ -134,12 +136,16 @@ public class TzBaseEnterpriseInfoServiceImpl
}
Page<TzBaseEnterpriseInfoDto> page = new Page<>(pageParam.getCurrent(), pageParam.getSize());
List<JSONObject> companyType1 = equipmentCategoryService.getCompanyType();
JSONObject companyType =companyType1.get(0);
String orgCode = companyType.getString("orgCode");
if (!ValidationUtil.isEmpty(orgCode)) {
tzBaseEnterpriseInfoDto.setSuperviseOrgCode(orgCode);
if (!ValidationUtil.isEmpty(companyType1)) {
for (JSONObject jsonObject : companyType1) {
String orgCode = jsonObject.getString("orgCode");
if (!ValidationUtil.isEmpty(orgCode)) {
orgCodeList.add(orgCode);
}
}
}
return this.baseMapper.page(page, tzBaseEnterpriseInfoDto);
return this.baseMapper.pageList(page, tzBaseEnterpriseInfoDto,orgCodeList);
}
@Override
......
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