234fb62a 张雷

孪生体筛选问题修改

1 个父辈 432e1897
......@@ -21,4 +21,7 @@ public interface FmTwinManageMapper extends BaseMapper<FmTwinManage> {
@Param("twinType") String twinType,@Param("twinName") String twinName);
FmTwinManage getOneByTwinId(@Param("twinId") String twinId,@Param("projectId") String projectId);
List<FmTwinSqlResult> getListNoBound(@Param("projectId") String projectId,
@Param("twinType") String twinType,@Param("twinName") String twinName);
}
......
......@@ -36,6 +36,53 @@
</if>
</select>
<select id="getListNoBound" resultType="com.skua.modules.twin.vo.FmTwinSqlResult">
SELECT
a.id,
a.twin_id,
a.twin_name,
a.twin_type,
a.project_id,
a.loca_x,
a.loca_y,
a.loca_z,
a.rotate_x,
a.rotate_y,
a.rotate_z
FROM
(
SELECT
fe.twin_id AS equip_twin_id,
fm.id,
fm.twin_id,
fm.twin_name,
fm.twin_type,
fm.project_id,
l.loca_x,
l.loca_y,
l.loca_z,
l.rotate_x,
l.rotate_y,
l.rotate_z
FROM
fm_twin_manage fm
LEFT JOIN fm_twin_equip fe ON fm.twin_id = fe.twin_id
LEFT JOIN fm_twin_location l ON fm.twin_id = l.twin_id
WHERE
fm.project_id = #{projectId}
AND fm.twin_type = '设备'
AND fm.del_flag = '1'
) a
WHERE
a.equip_twin_id IS NULL
<if test="twinType!=null and twinType!=''">
AND a.twin_type = #{twinType}
</if>
<if test="twinName!=null and twinName!=''">
AND a.twin_name LIKE CONCAT(CONCAT('%', #{twinName}),'%')
</if>
</select>
<select id="getOneByTwinId" resultType="com.skua.modules.twin.entity.FmTwinManage">
select * from fm_twin_manage where twin_id = #{twinId} and project_id = #{projectId} limit 1
</select>
......
......@@ -53,7 +53,12 @@ public class FmTwinServiceImpl implements IFmTwinService {
@Override
public List<FmTwinResultVO> queryList(FmTwinQueryVO fmTwinQueryVO) {
List<FmTwinResultVO> list = new ArrayList<>();
List<FmTwinSqlResult> sqlList = fmTwinManageMapper.getSqlList(fmTwinQueryVO.getProjectId(),fmTwinQueryVO.getType(),fmTwinQueryVO.getKeyword());
List<FmTwinSqlResult> sqlList = new ArrayList<>();
if("false".equals(fmTwinQueryVO.getUnbound())){
sqlList = fmTwinManageMapper.getListNoBound(fmTwinQueryVO.getProjectId(),fmTwinQueryVO.getType(),fmTwinQueryVO.getKeyword());
}else{
sqlList = fmTwinManageMapper.getSqlList(fmTwinQueryVO.getProjectId(),fmTwinQueryVO.getType(),fmTwinQueryVO.getKeyword());
}
for (FmTwinSqlResult twinSqlResult : sqlList) {
FmTwinResultVO twinResultVO = new FmTwinResultVO();
FmTwinLocationEntity twinLocation = new FmTwinLocationEntity();
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!