zrj
2024-10-30 876ffe6934a0dd680c380c5ec866c26ba349dbd1
区域及企业查询调整(字典和区域解析)
5 files modified
47 ■■■■■ changed files
src/main/java/org/springblade/modules/yw/mapper/FirmInfoMapper.xml 7 ●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/yw/mapper/IndParkInfoMapper.xml 8 ●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/yw/service/impl/IndParkInfoServiceImpl.java 16 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/yw/vo/FirmInfoVO.java 4 ●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/yw/vo/IndParkInfoVO.java 12 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/yw/mapper/FirmInfoMapper.xml
@@ -4,8 +4,11 @@
    <!--自定义分页查询-->
    <select id="selectFirmInfoPage" resultType="org.springblade.modules.yw.vo.FirmInfoVO">
        select yfi.* from yw_firm_info yfi
        where is_deleted = 0
        select
        yfi.*,bdb.dict_value as categoryName
         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},'%')
        </if>
src/main/java/org/springblade/modules/yw/mapper/IndParkInfoMapper.xml
@@ -28,9 +28,13 @@
        select * from yw_ind_park_info where is_deleted = 0
    </select>
    <!--自定义分页查询-->
    <!--详情查询-->
    <select id="getDetail" resultType="org.springblade.modules.yw.vo.IndParkInfoVO">
        select * from yw_ind_park_info where is_deleted = 0
        select
        yipi.*,bdb.dict_value as parkLevel
        from yw_ind_park_info yipi
        left join blade_dict_biz bdb on bdb.dict_key = yipi.level and bdb.code = 'ind_park_level'
        where yipi.is_deleted = 0
    </select>
</mapper>
src/main/java/org/springblade/modules/yw/service/impl/IndParkInfoServiceImpl.java
@@ -124,7 +124,23 @@
        long count = firmInfoService.count();
        // 设置企业数量
        indParkInfoVO.setFirmNum((int) count);
        // 设置行政区划
        setRegionInfo(indParkInfoVO);
        // 返回
        return indParkInfoVO;
    }
    /**
     * 设置行政区划
     * @param indParkInfoVO
     */
    private void setRegionInfo(IndParkInfoVO indParkInfoVO) {
        QueryWrapper<Region> wrapper = new QueryWrapper<>();
        wrapper.eq("ancestors","000000000000,"+indParkInfoVO.getAreaCode());
        List<Region> list = regionService.list(wrapper);
        if (list.size()>0){
            Region region = list.get(0);
            indParkInfoVO.setRegionName(region.getProvinceName()+"-"+region.getCityName());
        }
    }
}
src/main/java/org/springblade/modules/yw/vo/FirmInfoVO.java
@@ -1,8 +1,12 @@
package org.springblade.modules.yw.vo;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springblade.modules.yw.entity.FirmInfo;
@Data
public class FirmInfoVO extends FirmInfo {
    @ApiModelProperty(value = "行业名称")
    private String categoryName;
}
src/main/java/org/springblade/modules/yw/vo/IndParkInfoVO.java
@@ -21,4 +21,16 @@
     */
    @ApiModelProperty(value = "企业数量", example = "")
    private Integer firmNum;
    /**
     * 园区级别
     */
    @ApiModelProperty(value = "园区级别", example = "")
    private String parkLevel;
    /**
     * 地市
     */
    @ApiModelProperty(value = "地市", example = "")
    private String regionName;
}