获取装置列表接口

jni
liuguijing 2 years ago
parent 6b3ab20fc4
commit df9976435b

@ -0,0 +1,17 @@
package com.shxy.xymanager_common.dto;
import lombok.Data;
import java.io.Serializable;
@Data
public class TerminalChannelsAndScheduleDto implements Serializable {
private Integer id;
private String name;
private Integer scheduleid;
private static final long serialVersionUID = 1L;
}

@ -6,12 +6,11 @@ import java.io.Serializable;
@Data
public class TerminalChannelsDto implements Serializable {
private Integer id;
private String name;
private Integer scheduleid;
private static final long serialVersionUID = 1L;
}

@ -15,7 +15,7 @@ public class TerminalsAndChannelDto implements Serializable {
private String name;
private List<TerminalChannelsDto> list;
private List<TerminalChannelsAndScheduleDto> list;
private static final long serialVersionUID = 1L;

@ -0,0 +1,49 @@
package com.shxy.xymanager_common.dto;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
@Data
public class TerminalsAndLineAndChannelDto implements Serializable {
private Integer id;
private Integer lineid;
private String linename;
private Integer towerid;
private String towername;
private String cmdid;
private Short orgId;
private String equipName;
private String displayName;
private String model;
private String essentialInfoVersion;
private Byte hasPan;
private String bsManufacturer;
private Date bsProductionDate;
private String bsIdentifier;
private Double latitude;
private Double longitude;
private List<TerminalChannelsDto> list;
private static final long serialVersionUID = 1L;
}

@ -1,5 +1,7 @@
package com.shxy.xymanager_common.model;
import com.shxy.xymanager_common.dto.TerminalChannelsAndScheduleDto;
import com.shxy.xymanager_common.dto.TerminalChannelsDto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import jdk.nashorn.internal.ir.Terminal;
@ -35,9 +37,15 @@ public class TerminalListModel implements Serializable {
@ApiModelProperty(value = "线路编号", example = "123456")
private Integer lineid;
@ApiModelProperty(value = "线路名称", example = "123456")
private String linename;
@ApiModelProperty(value = "杆塔编号", example = "123456")
private Integer towerid;
@ApiModelProperty(value = "杆塔名称", example = "123456")
private String towername;
@ApiModelProperty(value = "图像监测装置 ID17 位编码)", example = "12345678")
private String cmdid;
@ -74,12 +82,16 @@ public class TerminalListModel implements Serializable {
@ApiModelProperty(value = "经度", example = "213")
private Double longitude;
@ApiModelProperty(value = "创建时间", example = "2022-06-08")
private Date createTime;
@ApiModelProperty(value = "修改时间", example = "2022-06-08")
private Date updateTime;
@ApiModelProperty(value = "通道编号和名称", example = "213")
private List<ChannelBeans> list;
}
@Data
public static class ChannelBeans {
@ApiModelProperty(value = "通道编号", example = "213")
private Integer id;
@ApiModelProperty(value = "通道名称", example = "213")
private String name;
}
}

@ -1,6 +1,7 @@
package com.shxy.xymanager_dao.dao;
import com.shxy.xymanager_common.dto.TerminalInfoDto;
import com.shxy.xymanager_common.dto.TerminalsAndLineAndChannelDto;
import com.shxy.xymanager_common.entity.Terminals;
import org.apache.ibatis.annotations.Param;
@ -12,6 +13,8 @@ public interface TerminalsDao {
List<Terminals> selectAll(@Param("status") Integer status);
List<TerminalsAndLineAndChannelDto> selectTermAndLineList(@Param("status") Integer status);
Terminals selectByCmdid(@Param("cmdid") String cmdid, @Param("status") Integer status);
Terminals selectByToweridAndLineid(@Param("lineid") Integer lineid,@Param("towerid") Integer towerid, @Param("status") Integer status);

@ -69,7 +69,6 @@
left join terminal_status f on f.term_id = y.id)
</select>
<insert id="insert" parameterType="com.shxy.xymanager_common.entity.DyLevel">
insert into dy_level (id, name, dy_value,
status, create_time, update_time
@ -78,6 +77,7 @@
#{status,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}
)
</insert>
<insert id="insertSelective" parameterType="com.shxy.xymanager_common.entity.DyLevel">
insert into dy_level
<trim prefix="(" suffix=")" suffixOverrides=",">

@ -35,7 +35,7 @@
<result column="tower_id" jdbcType="INTEGER" property="towerid"/>
<result column="cmdid" jdbcType="VARCHAR" property="cmdid"/>
<result column="display_name" jdbcType="VARCHAR" property="name"/>
<collection property="list" javaType="list" ofType="com.shxy.xymanager_common.dto.TerminalChannelsDto">
<collection property="list" javaType="list" ofType="com.shxy.xymanager_common.dto.TerminalChannelsAndScheduleDto">
<result column="channel_id" jdbcType="INTEGER" property="id"/>
<result column="channel_name" jdbcType="VARCHAR" property="name"/>
<result column="schedule_id" jdbcType="INTEGER" property="scheduleid"/>

@ -22,10 +22,12 @@
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime"/>
</resultMap>
<resultMap id="LineAndGtAndTermMap" type="com.shxy.xymanager_common.entity.Terminals">
<resultMap id="LineAndGtAndTermMap" type="com.shxy.xymanager_common.dto.TerminalsAndLineAndChannelDto">
<id column="id" jdbcType="INTEGER" property="id"/>
<result column="line_id" jdbcType="INTEGER" property="lineid"/>
<result column="line_name" jdbcType="VARCHAR" property="linename"/>
<result column="tower_id" jdbcType="INTEGER" property="towerid"/>
<result column="tower_name" jdbcType="VARCHAR" property="towername"/>
<result column="cmdid" jdbcType="VARCHAR" property="cmdid"/>
<result column="org_id" jdbcType="SMALLINT" property="orgId"/>
<result column="equip_name" jdbcType="VARCHAR" property="equipName"/>
@ -38,9 +40,10 @@
<result column="bs_identifier" jdbcType="VARCHAR" property="bsIdentifier"/>
<result column="latitude" jdbcType="DOUBLE" property="latitude"/>
<result column="longitude" jdbcType="DOUBLE" property="longitude"/>
<result column="status" jdbcType="INTEGER" property="status"/>
<result column="create_time" jdbcType="TIMESTAMP" property="createTime"/>
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime"/>
<collection property="list" javaType="list" ofType="com.shxy.xymanager_common.dto.TerminalChannelsDto">
<result column="channel_id" jdbcType="INTEGER" property="id"/>
<result column="channel_name" jdbcType="VARCHAR" property="name"/>
</collection>
</resultMap>
<sql id="Base_Column_List">
@ -55,11 +58,33 @@
from terminals
where status = #{status}
</select>
<select id="selectTermAndLineList" resultMap="LineAndGtAndTermMap">
select
<include refid="Base_Column_List"/>
from terminals
where status = #{status}
a.id as id,
a.line_id as line_id,
b.name as line_name,
a.tower_id as tower_id,
c.name as tower_name,
a.cmdid as cmdid,
a.org_id as org_id,
a.equip_name as equip_name,
a.display_name as display_name,
a.model as model,
a.essential_info_version as essential_info_version,
a.has_pan as has_pan,
a.bs_manufacturer as bs_manufacturer,
a.bs_production_date as bs_production_date,
a.bs_identifier as bs_identifier,
a.latitude as latitude,
a.longitude as longitude,
e.id as channel_id,
e.channel_name as channel_name
from
((((terminals a left join `lines` b on a.line_id = b.id and a.status = #{status})
left join tower c on a.tower_id = c.id)
left join terminal_channel_mapper d on a.id = d.term_id)
left join terminal_channels e on d.channel_id = e.id)
</select>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">

@ -1,35 +1,23 @@
package com.shxy.xymanager_service.impl;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.bean.copier.CopyOptions;
import cn.hutool.core.collection.CollectionUtil;
import com.github.pagehelper.PageInfo;
import com.shxy.xymanager_common.bean.ServiceBody;
import com.shxy.xymanager_common.entity.TerminalPositions;
import com.shxy.xymanager_common.entity.TerminalStatus;
import com.shxy.xymanager_common.entity.Terminals;
import com.shxy.xymanager_common.enums.CommonStatus;
import com.shxy.xymanager_common.exception.Asserts;
import com.shxy.xymanager_common.model.TerminalGpsModel;
import com.shxy.xymanager_common.model.TerminalListModel;
import com.shxy.xymanager_common.page.PageUtils;
import com.shxy.xymanager_common.util.MyDateUtils;
import com.shxy.xymanager_common.util.ProcessExecUtils;
import com.shxy.xymanager_common.vo.*;
import com.shxy.xymanager_dao.dao.TerminalPositionsDao;
import com.shxy.xymanager_dao.dao.TerminalStatusDao;
import com.shxy.xymanager_dao.dao.TerminalsDao;
import com.shxy.xymanager_service.interaction.Cma;
import com.shxy.xymanager_service.service.TerminalGpsService;
import com.shxy.xymanager_service.service.TerminalService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.math.BigInteger;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
/**

@ -7,6 +7,7 @@ import cn.hutool.core.date.DateTime;
import com.github.pagehelper.PageInfo;
import com.shxy.xymanager_common.bean.ServiceBody;
import com.shxy.xymanager_common.dto.TerminalInfoDto;
import com.shxy.xymanager_common.dto.TerminalsAndLineAndChannelDto;
import com.shxy.xymanager_common.entity.TerminalChannelMapper;
import com.shxy.xymanager_common.entity.TerminalStatus;
import com.shxy.xymanager_common.entity.Terminals;
@ -73,7 +74,7 @@ public class TerminalServiceImpl implements TerminalService {
int pageindex = vo.getPageindex();
int pagesize = vo.getPagesize();
PageUtils.SetPage(pageindex, pagesize);
List<Terminals> list = terminalsDao.selectAll(CommonStatus.EFFECTIVE.value());
List<TerminalsAndLineAndChannelDto> list = terminalsDao.selectTermAndLineList(CommonStatus.EFFECTIVE.value());
boolean empty = CollectionUtil.isEmpty(list);
if (empty) {
model.setList(new ArrayList<>());

@ -2,7 +2,6 @@ package com.shxy.xymanager_service.service;
import com.shxy.xymanager_common.bean.ServiceBody;
import com.shxy.xymanager_common.model.TerminalGpsModel;
import com.shxy.xymanager_common.model.TerminalListModel;
import com.shxy.xymanager_common.vo.*;
/**

Loading…
Cancel
Save