yang_shj
1 year ago
10 changed files with 116 additions and 4 deletions
@ -0,0 +1,23 @@
|
||||
package com.hnac.hzims.equipment.feign; |
||||
|
||||
import com.hnac.hzims.EquipmentConstants; |
||||
import org.springblade.core.tool.api.R; |
||||
import org.springframework.cloud.openfeign.FeignClient; |
||||
import org.springframework.web.bind.annotation.GetMapping; |
||||
|
||||
import java.util.List; |
||||
|
||||
@FeignClient(value = EquipmentConstants.APP_NAME) |
||||
public interface IEmTreeInspectClient { |
||||
|
||||
String API_PREFIX = "/feign/em/tree/inspect"; |
||||
String GET_EM_TREE_CONTENT_ID = API_PREFIX + "/getEmTreeContentId"; |
||||
|
||||
/** |
||||
* 获取设备信息中已绑定的巡检内容定义ID |
||||
* @return 巡检内容定义ID |
||||
*/ |
||||
@GetMapping(GET_EM_TREE_CONTENT_ID) |
||||
R<List<Long>> getEmTreeContentId(); |
||||
|
||||
} |
@ -0,0 +1,31 @@
|
||||
package com.hnac.hzims.equipment.feign; |
||||
|
||||
import com.hnac.hzims.equipment.service.IEmTreeInspectService; |
||||
import lombok.AllArgsConstructor; |
||||
import lombok.extern.slf4j.Slf4j; |
||||
import org.springblade.core.tool.api.R; |
||||
import org.springframework.web.bind.annotation.GetMapping; |
||||
import org.springframework.web.bind.annotation.RestController; |
||||
|
||||
import java.util.List; |
||||
|
||||
/** |
||||
* @ClassName EmTreeInspectClient |
||||
* @description: 设备树与巡检内容定义关联关系client |
||||
* @author: hx |
||||
* @create: 2023-08-11 17:31 |
||||
* @Version 4.0 |
||||
**/ |
||||
@RestController |
||||
@AllArgsConstructor |
||||
@Slf4j |
||||
public class EmTreeInspectClient implements IEmTreeInspectClient { |
||||
|
||||
private final IEmTreeInspectService emTreeInspectService; |
||||
|
||||
@Override |
||||
@GetMapping(GET_EM_TREE_CONTENT_ID) |
||||
public R<List<Long>> getEmTreeContentId() { |
||||
return R.data(emTreeInspectService.selectEmTreeContentId()); |
||||
} |
||||
} |
@ -1,5 +1,15 @@
|
||||
<?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.hnac.hzims.equipment.mapper.EmTreeInspectMapper"> |
||||
|
||||
<select id="selectEmTreeContentId" resultType="java.lang.Long"> |
||||
select distinct content_id |
||||
from hzims_em_definition ed, |
||||
hzims_em_tree et, |
||||
hzims_em_tree_inspect ti |
||||
where ed.id = et.definition_id |
||||
and et.id = ti.tree_id |
||||
and ed.IS_DELETED = 0 |
||||
and ti.IS_DELETED = 0 |
||||
and et.IS_DELETED = 0 |
||||
</select> |
||||
</mapper> |
Loading…
Reference in new issue