孪生体筛选问题修改
正在显示
3 个修改的文件
包含
56 行增加
和
1 行删除
... | @@ -21,4 +21,7 @@ public interface FmTwinManageMapper extends BaseMapper<FmTwinManage> { | ... | @@ -21,4 +21,7 @@ public interface FmTwinManageMapper extends BaseMapper<FmTwinManage> { |
21 | @Param("twinType") String twinType,@Param("twinName") String twinName); | 21 | @Param("twinType") String twinType,@Param("twinName") String twinName); |
22 | 22 | ||
23 | FmTwinManage getOneByTwinId(@Param("twinId") String twinId,@Param("projectId") String projectId); | 23 | FmTwinManage getOneByTwinId(@Param("twinId") String twinId,@Param("projectId") String projectId); |
24 | |||
25 | List<FmTwinSqlResult> getListNoBound(@Param("projectId") String projectId, | ||
26 | @Param("twinType") String twinType,@Param("twinName") String twinName); | ||
24 | } | 27 | } | ... | ... |
... | @@ -36,6 +36,53 @@ | ... | @@ -36,6 +36,53 @@ |
36 | </if> | 36 | </if> |
37 | </select> | 37 | </select> |
38 | 38 | ||
39 | <select id="getListNoBound" resultType="com.skua.modules.twin.vo.FmTwinSqlResult"> | ||
40 | SELECT | ||
41 | a.id, | ||
42 | a.twin_id, | ||
43 | a.twin_name, | ||
44 | a.twin_type, | ||
45 | a.project_id, | ||
46 | a.loca_x, | ||
47 | a.loca_y, | ||
48 | a.loca_z, | ||
49 | a.rotate_x, | ||
50 | a.rotate_y, | ||
51 | a.rotate_z | ||
52 | FROM | ||
53 | ( | ||
54 | SELECT | ||
55 | fe.twin_id AS equip_twin_id, | ||
56 | fm.id, | ||
57 | fm.twin_id, | ||
58 | fm.twin_name, | ||
59 | fm.twin_type, | ||
60 | fm.project_id, | ||
61 | l.loca_x, | ||
62 | l.loca_y, | ||
63 | l.loca_z, | ||
64 | l.rotate_x, | ||
65 | l.rotate_y, | ||
66 | l.rotate_z | ||
67 | FROM | ||
68 | fm_twin_manage fm | ||
69 | LEFT JOIN fm_twin_equip fe ON fm.twin_id = fe.twin_id | ||
70 | LEFT JOIN fm_twin_location l ON fm.twin_id = l.twin_id | ||
71 | WHERE | ||
72 | fm.project_id = #{projectId} | ||
73 | AND fm.twin_type = '设备' | ||
74 | AND fm.del_flag = '1' | ||
75 | ) a | ||
76 | WHERE | ||
77 | a.equip_twin_id IS NULL | ||
78 | <if test="twinType!=null and twinType!=''"> | ||
79 | AND a.twin_type = #{twinType} | ||
80 | </if> | ||
81 | <if test="twinName!=null and twinName!=''"> | ||
82 | AND a.twin_name LIKE CONCAT(CONCAT('%', #{twinName}),'%') | ||
83 | </if> | ||
84 | </select> | ||
85 | |||
39 | <select id="getOneByTwinId" resultType="com.skua.modules.twin.entity.FmTwinManage"> | 86 | <select id="getOneByTwinId" resultType="com.skua.modules.twin.entity.FmTwinManage"> |
40 | select * from fm_twin_manage where twin_id = #{twinId} and project_id = #{projectId} limit 1 | 87 | select * from fm_twin_manage where twin_id = #{twinId} and project_id = #{projectId} limit 1 |
41 | </select> | 88 | </select> | ... | ... |
... | @@ -53,7 +53,12 @@ public class FmTwinServiceImpl implements IFmTwinService { | ... | @@ -53,7 +53,12 @@ public class FmTwinServiceImpl implements IFmTwinService { |
53 | @Override | 53 | @Override |
54 | public List<FmTwinResultVO> queryList(FmTwinQueryVO fmTwinQueryVO) { | 54 | public List<FmTwinResultVO> queryList(FmTwinQueryVO fmTwinQueryVO) { |
55 | List<FmTwinResultVO> list = new ArrayList<>(); | 55 | List<FmTwinResultVO> list = new ArrayList<>(); |
56 | List<FmTwinSqlResult> sqlList = fmTwinManageMapper.getSqlList(fmTwinQueryVO.getProjectId(),fmTwinQueryVO.getType(),fmTwinQueryVO.getKeyword()); | 56 | List<FmTwinSqlResult> sqlList = new ArrayList<>(); |
57 | if("false".equals(fmTwinQueryVO.getUnbound())){ | ||
58 | sqlList = fmTwinManageMapper.getListNoBound(fmTwinQueryVO.getProjectId(),fmTwinQueryVO.getType(),fmTwinQueryVO.getKeyword()); | ||
59 | }else{ | ||
60 | sqlList = fmTwinManageMapper.getSqlList(fmTwinQueryVO.getProjectId(),fmTwinQueryVO.getType(),fmTwinQueryVO.getKeyword()); | ||
61 | } | ||
57 | for (FmTwinSqlResult twinSqlResult : sqlList) { | 62 | for (FmTwinSqlResult twinSqlResult : sqlList) { |
58 | FmTwinResultVO twinResultVO = new FmTwinResultVO(); | 63 | FmTwinResultVO twinResultVO = new FmTwinResultVO(); |
59 | FmTwinLocationEntity twinLocation = new FmTwinLocationEntity(); | 64 | FmTwinLocationEntity twinLocation = new FmTwinLocationEntity(); | ... | ... |
-
请 注册 或 登录 后发表评论