cim 根据应用领域查询图层服务 和 查询智能算法组件

This commit is contained in:
yitonglei 2022-08-19 14:11:06 +08:00
parent 6dcee405c5
commit e503565a85
5 changed files with 64 additions and 0 deletions

View File

@ -10,6 +10,7 @@ import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
@ -46,4 +47,18 @@ public class CIMController {
return new Result<List<Map>>().ok(cimService.getCIMApplyApplicationList());
}
@GetMapping("/cimImgResources")
@ApiOperation("根据应用领域查询图层服务")
public Result cimImgResources(@RequestParam String type){
List<Map> imgServices = cimService.getImgServices(type);
return new Result().ok(imgServices);
}
@GetMapping("/cimAssemblyResources")
@ApiOperation("查询智能算法组件")
public Result cimAssemblyResources(){
List<Map> maps = cimService.cimAssemblyResources();
return new Result().ok(maps);
}
}

View File

@ -180,4 +180,9 @@ public interface ResourceDao extends BaseDao<ResourceEntity> {
List<Map> countByCIMType(@Param("deptId") Long deptId);
List<Map> getCIMApplyApplicationList(@Param("deptId") Long deptId);
List<Map> getImgServices(@Param("type") String type);
List<Map> cimAssemblyResources();
}

View File

@ -8,4 +8,8 @@ public interface CIMService {
List<Map> countByType();
List<Map> getCIMApplyApplicationList();
List<Map> getImgServices(String type);
List<Map> cimAssemblyResources();
}

View File

@ -69,4 +69,20 @@ public class CIMServiceImpl implements CIMService {
}
return resourceDao.getCIMApplyApplicationList(sysDeptEntity.getId());
}
@Override
public List<Map> getImgServices(String type) {
List<Map> imgServices = new ArrayList<>();
imgServices = resourceDao.getImgServices(type);
return imgServices;
}
@Override
public List<Map> cimAssemblyResources() {
List<Map> result = new ArrayList<>();
result = resourceDao.cimAssemblyResources();
return result;
}
}

View File

@ -1629,4 +1629,28 @@
ORDER BY
tdr.create_date
</select>
<select id="getImgServices" parameterType="java.lang.String" resultType="java.util.Map">
with A as
(
SELECT m.* FROM
(
SELECT a.name,a.id,a.info_list FROM tb_data_resource a INNER JOIN tb_data_attr b ON a.id = b.data_resource_id
WHERE a.dept_id = 1555080592128163841 AND a.del_flag = 0 and a.type = '组件服务'
AND (b.attr_type = '组件类型' AND b.attr_value = '图层服务' ) AND b.del_flag = 0
) m
INNER JOIN tb_data_attr b ON m.id = b.data_resource_id
AND b.attr_type = '应用领域' AND LOCATE(#{type},b.attr_value) AND b.del_flag = 0
)
SELECT A.*,c.attr_value as link FROM A INNER JOIN tb_data_attr c ON A.id = c.data_resource_id
AND c.attr_type = '图层缩略图' AND c.del_flag = 0
</select>
<select id="cimAssemblyResources" resultType="java.util.Map">
SELECT a.name,a.id,a.info_list FROM tb_data_resource a INNER JOIN tb_data_attr b ON a.id = b.data_resource_id
WHERE a.dept_id = 1555080592128163841 AND a.type = '组件服务' AND a.del_flag = 0
AND (b.attr_type = '组件类型' AND b.attr_value = '智能算法' ) AND b.del_flag = 0
</select>
</mapper>