9 changed files with 218 additions and 3 deletions
@ -0,0 +1,13 @@ |
|||||
|
package com.epmet.dto.form; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* 图层-类别查询form |
||||
|
*/ |
||||
|
@Data |
||||
|
public class CoverageCategoryQueryFormDTO { |
||||
|
private List<String> coverageTypes; |
||||
|
} |
@ -0,0 +1,14 @@ |
|||||
|
package com.epmet.dto.result; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
|
||||
|
/** |
||||
|
* 五大图层-类别 结果类 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class CoverageCategoryResultDTO { |
||||
|
|
||||
|
private String categoryKey; |
||||
|
private String categoryName; |
||||
|
|
||||
|
} |
@ -0,0 +1,16 @@ |
|||||
|
package com.epmet.dao; |
||||
|
|
||||
|
import com.epmet.commons.mybatis.dao.BaseDao; |
||||
|
import com.epmet.entity.IcCoverageCategoryDictEntity; |
||||
|
import org.apache.ibatis.annotations.Mapper; |
||||
|
|
||||
|
/** |
||||
|
* 五大图层类别字典表 |
||||
|
* |
||||
|
* @author generator generator@elink-cn.com |
||||
|
* @since v1.0.0 2022-06-16 |
||||
|
*/ |
||||
|
@Mapper |
||||
|
public interface IcCoverageCategoryDictDao extends BaseDao<IcCoverageCategoryDictEntity> { |
||||
|
|
||||
|
} |
@ -0,0 +1,59 @@ |
|||||
|
package com.epmet.entity; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.annotation.TableName; |
||||
|
|
||||
|
import com.epmet.commons.mybatis.entity.BaseEpmetEntity; |
||||
|
import lombok.Data; |
||||
|
import lombok.EqualsAndHashCode; |
||||
|
|
||||
|
import java.util.Date; |
||||
|
|
||||
|
/** |
||||
|
* 五大图层类别字典表 |
||||
|
* |
||||
|
* @author generator generator@elink-cn.com |
||||
|
* @since v1.0.0 2022-06-16 |
||||
|
*/ |
||||
|
@Data |
||||
|
@EqualsAndHashCode(callSuper=false) |
||||
|
@TableName("ic_coverage_category_dict") |
||||
|
public class IcCoverageCategoryDictEntity extends BaseEpmetEntity { |
||||
|
|
||||
|
private static final long serialVersionUID = 1L; |
||||
|
|
||||
|
/** |
||||
|
* default;或者customerId |
||||
|
*/ |
||||
|
private String customerId; |
||||
|
|
||||
|
/** |
||||
|
* 类别key |
||||
|
*/ |
||||
|
private String categoryKey; |
||||
|
|
||||
|
/** |
||||
|
* 名称 |
||||
|
*/ |
||||
|
private String categoryName; |
||||
|
|
||||
|
/** |
||||
|
* 所属场所类型; |
||||
|
社区自组织:community_org; |
||||
|
优势资源:superior_resource; |
||||
|
城市管理:city_management; |
||||
|
重点危化企业:dangerous_chemicals; |
||||
|
公共服务:public_service |
||||
|
*/ |
||||
|
private String placeType; |
||||
|
|
||||
|
/** |
||||
|
* 所属五大图层:zhzl:综合治理图层;yjcl:应急处置图层;aqsc:安全生产图层;csgl:城市管理图层;ggfw:公共服务图层 |
||||
|
*/ |
||||
|
private String coverageType; |
||||
|
|
||||
|
/** |
||||
|
* 排序 |
||||
|
*/ |
||||
|
private Integer sort; |
||||
|
|
||||
|
} |
@ -0,0 +1,16 @@ |
|||||
|
package com.epmet.service; |
||||
|
|
||||
|
import com.epmet.dto.result.CoverageCategoryResultDTO; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
public interface CoverageService { |
||||
|
|
||||
|
/** |
||||
|
* 根据图层列表,查询图层下的类别列表 |
||||
|
* @param coverageList 图层列表 |
||||
|
* @return 类别列表 |
||||
|
*/ |
||||
|
List<CoverageCategoryResultDTO> categoryList(List<String> coverageTypeList); |
||||
|
|
||||
|
} |
@ -0,0 +1,52 @@ |
|||||
|
package com.epmet.service.impl; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
||||
|
import com.epmet.dao.IcCoverageCategoryDictDao; |
||||
|
import com.epmet.dto.result.CoverageCategoryResultDTO; |
||||
|
import com.epmet.entity.IcCoverageCategoryDictEntity; |
||||
|
import com.epmet.service.CoverageService; |
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.stereotype.Service; |
||||
|
|
||||
|
import java.util.List; |
||||
|
import java.util.function.Function; |
||||
|
import java.util.stream.Collectors; |
||||
|
import java.util.stream.Stream; |
||||
|
|
||||
|
@Service |
||||
|
public class CoverageServiceImpl implements CoverageService { |
||||
|
|
||||
|
@Autowired |
||||
|
private IcCoverageCategoryDictDao coverageCategoryDictDao; |
||||
|
|
||||
|
/** |
||||
|
* 根据图层列表,查询图层下的类别列表 |
||||
|
* @param coverageTypeList 图层列表 |
||||
|
* @return 类别列表 |
||||
|
*/ |
||||
|
@Override |
||||
|
public List<CoverageCategoryResultDTO> categoryList(List<String> coverageTypeList) { |
||||
|
Stream<CoverageCategoryResultDTO> stream = coverageTypeList.stream().map(categoryType -> { |
||||
|
|
||||
|
LambdaQueryWrapper<IcCoverageCategoryDictEntity> query = new LambdaQueryWrapper<>(); |
||||
|
query.eq(IcCoverageCategoryDictEntity::getCoverageType, categoryType); |
||||
|
query.orderByAsc(IcCoverageCategoryDictEntity::getCreatedTime); |
||||
|
List<IcCoverageCategoryDictEntity> categoriesEntity = coverageCategoryDictDao.selectList(query); |
||||
|
|
||||
|
return categoriesEntity.stream().map(e -> { |
||||
|
CoverageCategoryResultDTO dto = new CoverageCategoryResultDTO(); |
||||
|
dto.setCategoryKey(e.getCategoryKey()); |
||||
|
dto.setCategoryName(e.getCategoryName()); |
||||
|
return dto; |
||||
|
}).collect(Collectors.toList()); |
||||
|
|
||||
|
}).flatMap(new Function<List<CoverageCategoryResultDTO>, Stream<CoverageCategoryResultDTO>>() { |
||||
|
@Override |
||||
|
public Stream<CoverageCategoryResultDTO> apply(List<CoverageCategoryResultDTO> coverageCategoryResultDTOS) { |
||||
|
return coverageCategoryResultDTOS.stream(); |
||||
|
} |
||||
|
}); |
||||
|
|
||||
|
return stream.collect(Collectors.toList()); |
||||
|
} |
||||
|
} |
@ -0,0 +1,23 @@ |
|||||
|
<?xml version="1.0" encoding="UTF-8"?> |
||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
||||
|
|
||||
|
<mapper namespace="com.epmet.dao.IcCoverageCategoryDictDao"> |
||||
|
|
||||
|
<resultMap type="com.epmet.entity.IcCoverageCategoryDictEntity" id="icCoverageCategoryDictMap"> |
||||
|
<result property="id" column="ID"/> |
||||
|
<result property="customerId" column="CUSTOMER_ID"/> |
||||
|
<result property="categoryKey" column="CATEGORY_KEY"/> |
||||
|
<result property="categoryName" column="CATEGORY_NAME"/> |
||||
|
<result property="placeType" column="PLACE_TYPE"/> |
||||
|
<result property="coverageType" column="COVERAGE_TYPE"/> |
||||
|
<result property="sort" column="SORT"/> |
||||
|
<result property="delFlag" column="DEL_FLAG"/> |
||||
|
<result property="revision" column="REVISION"/> |
||||
|
<result property="createdBy" column="CREATED_BY"/> |
||||
|
<result property="createdTime" column="CREATED_TIME"/> |
||||
|
<result property="updatedBy" column="UPDATED_BY"/> |
||||
|
<result property="updatedTime" column="UPDATED_TIME"/> |
||||
|
</resultMap> |
||||
|
|
||||
|
|
||||
|
</mapper> |
Loading…
Reference in new issue