权限接口修改

dev
liuguijing 1 year ago
parent a92695f5bf
commit 118766228b

@ -4,11 +4,10 @@ import com.shxy.xymanager_common.base.BaseController;
import com.shxy.xymanager_common.base.ResponseReult;
import com.shxy.xymanager_common.bean.ServiceBody;
import com.shxy.xymanager_common.bean.ServiceStatus;
import com.shxy.xymanager_common.entity.DyLevel;
import com.shxy.xymanager_common.entity.TbPermission;
import com.shxy.xymanager_common.entity.TbRole;
import com.shxy.xymanager_common.exception.ApiException;
import com.shxy.xymanager_common.model.DyLineTreeListModel;
import com.shxy.xymanager_common.model.PermissionDyLineTreeListModel;
import com.shxy.xymanager_common.model.PermissionModel;
import com.shxy.xymanager_service.service.RoleService;
@ -81,8 +80,8 @@ public class RoleController extends BaseController {
@GetMapping("getPermissionTree")
@ApiOperation("查询权限树状图")
public ResponseReult<PermissionDyLineTreeListModel> getPermissionTree() {
ServiceBody<PermissionDyLineTreeListModel> serviceBody = service.getPermissionTree();
public ResponseReult<List<DyLevel>> getPermissionTree() {
ServiceBody<List<DyLevel>> serviceBody = service.getPermissionTree();
if (serviceBody.getCode() == ServiceStatus.SUCCESS) {
return ResponseReult.success(serviceBody.getData());
} else {

@ -1,7 +1,6 @@
package com.shxy.xymanager_common.entity;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.shxy.xymanager_common.model.PermissionDyLineTreeListModel;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

@ -68,6 +68,10 @@ public class Terminals implements Serializable {
/*展示名字 等价与displayname 用于方便*/
private String name;
public String getName() {
return cmdid;
}
private static final long serialVersionUID = 1L;
}

@ -8,7 +8,7 @@ package com.shxy.xymanager_common.enums;
* @author
*/
public enum PermissionDetailEnum {
DY("DY", 1), LINE("LINE", 2),TOWER("TOWER", 3);
DY("DY", 1), LINE("LINE", 2),TOWER("TOWER", 3),TERM("TERM", 4);
private String name;
private Integer value;

@ -1,21 +0,0 @@
package com.shxy.xymanager_common.model;
import com.shxy.xymanager_common.entity.DyLevel;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
/**
* 线
*/
@Data
@ApiModel(value = "权限电压线路树状图列表", description = "权限电压线路树状图列表")
public class PermissionDyLineTreeListModel implements Serializable {
@ApiModelProperty(value = "电压列表", example = "[]")
private List<DyLevel> list;
}

@ -30,8 +30,6 @@ public interface DyLevelDao {
List<DyLineAndTerminalWithHeartDto> selectListTreeList( @Param("status") Integer status,@Param("list") List<Integer> list);
List<DyLineAndTerminalWithHeartDto> selectPermissionListTreeList();
List<DyLineAndTerminalNoHeartDto> selectTreeListByChannelId(@Param("channelid") Integer channelid, @Param("status") Integer status);
int updateByPrimaryKeySelective(DyLevel record);

@ -2,24 +2,35 @@ package com.shxy.xymanager_dao.dao;
import com.shxy.xymanager_common.dto.TerminalsWithHeart;
import com.shxy.xymanager_common.entity.TerminalStatus;
import com.shxy.xymanager_common.entity.TerminalStatusExample;
import org.apache.ibatis.annotations.Param;
import java.util.List;
public interface TerminalStatusDao {
TerminalsWithHeart selectByCmdId(@Param("cmdid") String cmdid);
TerminalStatus selectByPrimaryKey(Integer termId);
long countByExample(TerminalStatusExample example);
int deleteByExample(TerminalStatusExample example);
int deleteByPrimaryKey(Integer termId);
int insert(TerminalStatus record);
int insertSelective(TerminalStatus record);
List<TerminalStatus> selectAll();
List<TerminalStatus> selectByExample(TerminalStatusExample example);
TerminalStatus selectByPrimaryKey(Integer termId);
int updateByExampleSelective(@Param("record") TerminalStatus record, @Param("example") TerminalStatusExample example);
TerminalsWithHeart selectByCmdId(@Param("cmdid") String cmdid);
int updateByExample(@Param("record") TerminalStatus record, @Param("example") TerminalStatusExample example);
int updateByPrimaryKeySelective(TerminalStatus record);
int updateByPrimaryKey(TerminalStatus record);
}

@ -53,19 +53,19 @@
</javaClientGenerator>
<!-- &lt;!&ndash; 列出要生成代码的所有表这里配置的是不生成Example文件 &ndash;&gt;-->
<table tableName="terminals"
domainObjectName="TerminalsBak"
mapperName="TerminalsBakDao"
>
<!-- <property name="useActualColumnNames" value="false"/>-->
</table>
<!-- <table tableName="terminals"-->
<!-- domainObjectName="TerminalsBak"-->
<!-- mapperName="TerminalsBakDao"-->
<!-- >-->
<!-- &lt;!&ndash; <property name="useActualColumnNames" value="false"/>&ndash;&gt;-->
<!-- </table>-->
<table tableName="towers"
domainObjectName="TowersBak"
mapperName="TowersBakDao">
<!-- <property name="useActualColumnNames" value="false"/>-->
</table>
<!-- <table tableName="towers"-->
<!-- domainObjectName="TowersBak"-->
<!-- mapperName="TowersBakDao">-->
<!-- &lt;!&ndash; <property name="useActualColumnNames" value="false"/>&ndash;&gt;-->
<!-- </table>-->
<!-- <table tableName="terminal_channels"-->
<!-- domainObjectName="TerminalChannels"-->
<!-- mapperName="TerminalChannelsDao"-->
@ -101,13 +101,12 @@
<!-- enableSelectByExample="false" selectByExampleQueryId="false">-->
<!-- &lt;!&ndash; <property name="useActualColumnNames" value="false"/>&ndash;&gt;-->
<!-- </table>-->
<!-- <table tableName="terminal_status"-->
<!-- domainObjectName="TerminalStatus"-->
<!-- mapperName="TerminalStatusDao"-->
<!-- enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false"-->
<!-- enableSelectByExample="false" selectByExampleQueryId="false">-->
<!-- &lt;!&ndash; <property name="useActualColumnNames" value="false"/>&ndash;&gt;-->
<!-- </table>-->
<table tableName="terminal_status"
domainObjectName="TerminalStatus"
mapperName="TerminalStatusDao"
>
<!-- <property name="useActualColumnNames" value="false"/>-->
</table>
<!-- <table tableName="lines"-->
<!-- domainObjectName="LinesBak"-->

@ -84,7 +84,7 @@
<result column="protocol" jdbcType="INTEGER" property="protocol" />
<result column="cmdid" jdbcType="VARCHAR" property="cmdid" />
<result column="last_heartbeat" jdbcType="BIGINT" property="lastheartbeat" />
<result column="display_name" jdbcType="VARCHAR" property="name" />
<result column="display_name" jdbcType="VARCHAR" property=" name" />
</collection>
</collection>
</resultMap>
@ -314,25 +314,6 @@
</if>
</select>
<select id="selectPermissionListTreeList" resultMap="LineAndTerminalMap">
select
a.id as id,
a.name as name,
a.dy_value as dyvalue,
b.id as line_id,
b.name as line_name,
d.id as term_id,
d.tower_id as tower_id,
c.name as tower_name,
c.address as address,
d.cmdid as cmdid,
d.equip_name as equip_name,
d.display_name as display_name
from (((dy_level a left join `lines` b on a.id = b.dy_level_id )
left join towers c on b.id = c.line_id )
left join terminals d on c.id = d.tower_id )
</select>
<select id="selectTreeListByChannelId" resultMap="LineAndTerminalNoHeartMap">
SELECT
a.id AS id,

@ -1,54 +1,108 @@
<?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.shxy.xymanager_dao.dao.TerminalStatusDao">
<resultMap id="BaseResultMap" type="com.shxy.xymanager_common.entity.TerminalStatus">
<id column="term_id" jdbcType="INTEGER" property="termId"/>
<result column="last_heartbeat" jdbcType="BIGINT" property="lastHeartbeat"/>
<result column="last_heartbeat_ip" jdbcType="VARCHAR" property="lastHeartbeatIp"/>
<result column="last_heartbeat_port" jdbcType="SMALLINT" property="lastHeartbeatPort"/>
<result column="last_frame_no" jdbcType="SMALLINT" property="lastFrameNo"/>
<result column="battery_voltage" jdbcType="REAL" property="batteryVoltage"/>
<result column="op_temperature" jdbcType="REAL" property="opTemperature"/>
<result column="battery_capacity" jdbcType="REAL" property="batteryCapacity"/>
<result column="floating_charge" jdbcType="TINYINT" property="floatingCharge"/>
<result column="total_working_time" jdbcType="BIGINT" property="totalWorkingTime"/>
<result column="working_time" jdbcType="BIGINT" property="workingTime"/>
<result column="connection_state" jdbcType="TINYINT" property="connectionState"/>
<result column="signal_strength_4g" jdbcType="TINYINT" property="signalStrength4g"/>
<result column="signal_strength_2g" jdbcType="TINYINT" property="signalStrength2g"/>
<result column="send_flow" jdbcType="BIGINT" property="sendFlow"/>
<result column="recv_flow" jdbcType="BIGINT" property="recvFlow"/>
<result column="ws_update_time" jdbcType="BIGINT" property="wsUpdateTime"/>
<result column="remaining_ram" jdbcType="TINYINT" property="remainingRam"/>
<result column="remaining_rom" jdbcType="TINYINT" property="remainingRom"/>
<result column="boot_time" jdbcType="BIGINT" property="bootTime"/>
<result column="rs_update_time" jdbcType="BIGINT" property="updateTime"/>
<result column="gps_status" jdbcType="INTEGER" property="gpsStatus"/>
</resultMap>
<resultMap id="BaseResultMap" type="com.shxy.xymanager_common.entity.TerminalStatus">
<id column="term_id" jdbcType="INTEGER" property="termId" />
<result column="last_heartbeat" jdbcType="BIGINT" property="lastHeartbeat" />
<result column="last_heartbeat_ip" jdbcType="VARCHAR" property="lastHeartbeatIp" />
<result column="last_heartbeat_port" jdbcType="SMALLINT" property="lastHeartbeatPort" />
<result column="last_frame_no" jdbcType="SMALLINT" property="lastFrameNo" />
<result column="battery_voltage" jdbcType="REAL" property="batteryVoltage" />
<result column="op_temperature" jdbcType="REAL" property="opTemperature" />
<result column="battery_capacity" jdbcType="REAL" property="batteryCapacity" />
<result column="floating_charge" jdbcType="TINYINT" property="floatingCharge" />
<result column="total_working_time" jdbcType="INTEGER" property="totalWorkingTime" />
<result column="working_time" jdbcType="INTEGER" property="workingTime" />
<result column="connection_state" jdbcType="TINYINT" property="connectionState" />
<result column="send_flow" jdbcType="INTEGER" property="sendFlow" />
<result column="recv_flow" jdbcType="INTEGER" property="recvFlow" />
<result column="ws_update_time" jdbcType="BIGINT" property="wsUpdateTime" />
<result column="signal_strength_4g" jdbcType="TINYINT" property="signalStrength4g" />
<result column="signal_strength_2g" jdbcType="TINYINT" property="signalStrength2g" />
<result column="remaining_ram" jdbcType="SMALLINT" property="remainingRam" />
<result column="remaining_rom" jdbcType="SMALLINT" property="remainingRom" />
<result column="boot_time" jdbcType="BIGINT" property="bootTime" />
<result column="rs_update_time" jdbcType="BIGINT" property="rsUpdateTime" />
<result column="gps_status" jdbcType="INTEGER" property="gpsStatus" />
</resultMap>
<resultMap id="heartResultMap" type="com.shxy.xymanager_common.dto.TerminalsWithHeart">
<result column="term_id" jdbcType="INTEGER" property="id"/>
<result column="tower_id" jdbcType="INTEGER" property="towerid"/>
<result column="cmdid" jdbcType="VARCHAR" property="cmdid"/>
<result column="equip_name" jdbcType="VARCHAR" property="equipname"/>
<result column="display_name" jdbcType="VARCHAR" property="displayname"/>
<result column="model" jdbcType="VARCHAR" property="model"/>
<result column="protocol" jdbcType="INTEGER" property="protocol"/>
<result column="last_heartbeat" jdbcType="BIGINT" property="lastheartbeat"/>
</resultMap>
<sql id="Base_Column_List">
term_id, last_heartbeat,last_heartbeat_ip,last_heartbeat_port, last_frame_no, battery_voltage, op_temperature, battery_capacity,
floating_charge, total_working_time, working_time,connection_state, signal_strength_4g,
signal_strength_2g,send_flow, recv_flow,ws_update_time,remaining_ram, remaining_rom, boot_time, rs_update_time, gps_status
<resultMap id="heartResultMap" type="com.shxy.xymanager_common.dto.TerminalsWithHeart">
<result column="term_id" jdbcType="INTEGER" property="id" />
<result column="tower_id" jdbcType="INTEGER" property="towerid" />
<result column="cmdid" jdbcType="VARCHAR" property="cmdid" />
<result column="equip_name" jdbcType="VARCHAR" property="equipname" />
<result column="display_name" jdbcType="VARCHAR" property="displayname" />
<result column="model" jdbcType="VARCHAR" property="model" />
<result column="protocol" jdbcType="INTEGER" property="protocol" />
<result column="last_heartbeat" jdbcType="BIGINT" property="lastheartbeat" />
</resultMap>
<sql id="Example_Where_Clause">
<where>
<foreach collection="oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Update_By_Example_Where_Clause">
<where>
<foreach collection="example.oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Base_Column_List">
term_id, last_heartbeat, last_heartbeat_ip, last_heartbeat_port, last_frame_no, battery_voltage,
op_temperature, battery_capacity, floating_charge, total_working_time, working_time,
connection_state, send_flow, recv_flow, ws_update_time, signal_strength_4g, signal_strength_2g,
remaining_ram, remaining_rom, boot_time, rs_update_time, gps_status
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>
from terminal_status
where term_id = #{termId,jdbcType=INTEGER}
</select>
<select id="selectByCmdId" resultMap="heartResultMap">
<select id="selectByCmdId" resultMap="heartResultMap">
select
b.id as term_id,
b.tower_id as tower_id,
@ -62,199 +116,375 @@
terminals b
where a.term_id = b.id and b.cmdid = #{cmdid}
</select>
<select id="selectAll" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>
from terminal_status
</select>
<select id="selectTerminalInfo" resultType="com.shxy.xymanager_common.dto.TerminalInfoDto">
select
ts.term_id termId, ts.battery_voltage batteryVoltage, ts.battery_capacity batteryCapacity, ts.floating_charge floatingCharge, ts.total_working_time totalWorkingTime,
ts.working_time workingTime, ts.connection_state connectionState, ts.ws_update_time wsUpdateTime,t.cmdid cmId
from terminal_status ts left join terminals t on ts.term_id = t.id
where ts.term_id = #{termId,jdbcType=INTEGER}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
<select id="selectByExample" parameterType="com.shxy.xymanager_common.entity.TerminalStatusExample" resultMap="BaseResultMap">
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
from terminal_status
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null">
order by ${orderByClause}
</if>
</select>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from terminal_status
where term_id = #{termId,jdbcType=INTEGER}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
delete from terminal_status
where term_id = #{termId,jdbcType=INTEGER}
</delete>
<insert id="insert" parameterType="com.shxy.xymanager_common.entity.TerminalStatus">
insert into terminal_status (term_id, last_heartbeat, last_frame_no,
battery_voltage, op_temperature, battery_capacity,
floating_charge, total_working_time, working_time,
connection_state, signal_strength_4g, signal_strength_2g,
remaining_ram, remaining_rom, start_time,
update_time)
values (#{termId,jdbcType=INTEGER}, #{lastHeartbeat,jdbcType=TIMESTAMP}, #{lastFrameNo,jdbcType=SMALLINT},
#{batteryVoltage,jdbcType=REAL}, #{opTemperature,jdbcType=REAL}, #{batteryCapacity,jdbcType=REAL},
#{floatingCharge,jdbcType=TINYINT}, #{totalWorkingTime,jdbcType=INTEGER}, #{workingTime,jdbcType=INTEGER},
#{connectionState,jdbcType=TINYINT}, #{signalStrength4g,jdbcType=TINYINT}, #{signalStrength2g,jdbcType=TINYINT},
#{remainingRam,jdbcType=TINYINT}, #{remainingRom,jdbcType=TINYINT}, #{startTime,jdbcType=TIMESTAMP},
#{updateTime,jdbcType=TIMESTAMP})
<delete id="deleteByExample" parameterType="com.shxy.xymanager_common.entity.TerminalStatusExample">
delete from terminal_status
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" parameterType="com.shxy.xymanager_common.entity.TerminalStatus">
insert into terminal_status (term_id, last_heartbeat, last_heartbeat_ip,
last_heartbeat_port, last_frame_no, battery_voltage,
op_temperature, battery_capacity, floating_charge,
total_working_time, working_time, connection_state,
send_flow, recv_flow, ws_update_time,
signal_strength_4g, signal_strength_2g, remaining_ram,
remaining_rom, boot_time, rs_update_time,
gps_status)
values (#{termId,jdbcType=INTEGER}, #{lastHeartbeat,jdbcType=BIGINT}, #{lastHeartbeatIp,jdbcType=VARCHAR},
#{lastHeartbeatPort,jdbcType=SMALLINT}, #{lastFrameNo,jdbcType=SMALLINT}, #{batteryVoltage,jdbcType=REAL},
#{opTemperature,jdbcType=REAL}, #{batteryCapacity,jdbcType=REAL}, #{floatingCharge,jdbcType=TINYINT},
#{totalWorkingTime,jdbcType=INTEGER}, #{workingTime,jdbcType=INTEGER}, #{connectionState,jdbcType=TINYINT},
#{sendFlow,jdbcType=INTEGER}, #{recvFlow,jdbcType=INTEGER}, #{wsUpdateTime,jdbcType=BIGINT},
#{signalStrength4g,jdbcType=TINYINT}, #{signalStrength2g,jdbcType=TINYINT}, #{remainingRam,jdbcType=SMALLINT},
#{remainingRom,jdbcType=SMALLINT}, #{bootTime,jdbcType=BIGINT}, #{rsUpdateTime,jdbcType=BIGINT},
#{gpsStatus,jdbcType=INTEGER})
</insert>
<insert id="insertSelective" parameterType="com.shxy.xymanager_common.entity.TerminalStatus">
insert into terminal_status
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="termId != null">
term_id,
</if>
<if test="lastHeartbeat != null">
last_heartbeat,
</if>
<if test="lastHeartbeatIp != null">
last_heartbeat_ip,
</if>
<if test="lastHeartbeatPort != null">
last_heartbeat_port,
</if>
<if test="lastFrameNo != null">
last_frame_no,
</if>
<if test="batteryVoltage != null">
battery_voltage,
</if>
<if test="opTemperature != null">
op_temperature,
</if>
<if test="batteryCapacity != null">
battery_capacity,
</if>
<if test="floatingCharge != null">
floating_charge,
</if>
<if test="totalWorkingTime != null">
total_working_time,
</if>
<if test="workingTime != null">
working_time,
</if>
<if test="connectionState != null">
connection_state,
</if>
<if test="sendFlow != null">
send_flow,
</if>
<if test="recvFlow != null">
recv_flow,
</if>
<if test="wsUpdateTime != null">
ws_update_time,
</if>
<if test="signalStrength4g != null">
signal_strength_4g,
</if>
<if test="signalStrength2g != null">
signal_strength_2g,
</if>
<if test="remainingRam != null">
remaining_ram,
</if>
<if test="remainingRom != null">
remaining_rom,
</if>
<if test="bootTime != null">
boot_time,
</if>
<if test="rsUpdateTime != null">
rs_update_time,
</if>
<if test="gpsStatus != null">
gps_status,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="termId != null">
#{termId,jdbcType=INTEGER},
</if>
<if test="lastHeartbeat != null">
#{lastHeartbeat,jdbcType=BIGINT},
</if>
<if test="lastHeartbeatIp != null">
#{lastHeartbeatIp,jdbcType=VARCHAR},
</if>
<if test="lastHeartbeatPort != null">
#{lastHeartbeatPort,jdbcType=SMALLINT},
</if>
<if test="lastFrameNo != null">
#{lastFrameNo,jdbcType=SMALLINT},
</if>
<if test="batteryVoltage != null">
#{batteryVoltage,jdbcType=REAL},
</if>
<if test="opTemperature != null">
#{opTemperature,jdbcType=REAL},
</if>
<if test="batteryCapacity != null">
#{batteryCapacity,jdbcType=REAL},
</if>
<if test="floatingCharge != null">
#{floatingCharge,jdbcType=TINYINT},
</if>
<if test="totalWorkingTime != null">
#{totalWorkingTime,jdbcType=INTEGER},
</if>
<if test="workingTime != null">
#{workingTime,jdbcType=INTEGER},
</if>
<if test="connectionState != null">
#{connectionState,jdbcType=TINYINT},
</if>
<if test="sendFlow != null">
#{sendFlow,jdbcType=INTEGER},
</if>
<if test="recvFlow != null">
#{recvFlow,jdbcType=INTEGER},
</if>
<if test="wsUpdateTime != null">
#{wsUpdateTime,jdbcType=BIGINT},
</if>
<if test="signalStrength4g != null">
#{signalStrength4g,jdbcType=TINYINT},
</if>
<if test="signalStrength2g != null">
#{signalStrength2g,jdbcType=TINYINT},
</if>
<if test="remainingRam != null">
#{remainingRam,jdbcType=SMALLINT},
</if>
<if test="remainingRom != null">
#{remainingRom,jdbcType=SMALLINT},
</if>
<if test="bootTime != null">
#{bootTime,jdbcType=BIGINT},
</if>
<if test="rsUpdateTime != null">
#{rsUpdateTime,jdbcType=BIGINT},
</if>
<if test="gpsStatus != null">
#{gpsStatus,jdbcType=INTEGER},
</if>
</trim>
</insert>
<insert id="insertSelective" parameterType="com.shxy.xymanager_common.entity.TerminalStatus">
insert into terminal_status
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="termId != null">
term_id,
</if>
<if test="lastHeartbeat != null">
last_heartbeat,
</if>
<if test="lastFrameNo != null">
last_frame_no,
</if>
<if test="batteryVoltage != null">
battery_voltage,
</if>
<if test="opTemperature != null">
op_temperature,
</if>
<if test="batteryCapacity != null">
battery_capacity,
</if>
<if test="floatingCharge != null">
floating_charge,
</if>
<if test="totalWorkingTime != null">
total_working_time,
</if>
<if test="workingTime != null">
working_time,
</if>
<if test="connectionState != null">
connection_state,
</if>
<if test="signalStrength4g != null">
signal_strength_4g,
</if>
<if test="signalStrength2g != null">
signal_strength_2g,
</if>
<if test="remainingRam != null">
remaining_ram,
</if>
<if test="remainingRom != null">
remaining_rom,
</if>
<if test="startTime != null">
start_time,
</if>
<if test="updateTime != null">
update_time,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="termId != null">
#{termId,jdbcType=INTEGER},
</if>
<if test="lastHeartbeat != null">
#{lastHeartbeat,jdbcType=TIMESTAMP},
</if>
<if test="lastFrameNo != null">
#{lastFrameNo,jdbcType=SMALLINT},
</if>
<if test="batteryVoltage != null">
#{batteryVoltage,jdbcType=REAL},
</if>
<if test="opTemperature != null">
#{opTemperature,jdbcType=REAL},
</if>
<if test="batteryCapacity != null">
#{batteryCapacity,jdbcType=REAL},
</if>
<if test="floatingCharge != null">
#{floatingCharge,jdbcType=TINYINT},
</if>
<if test="totalWorkingTime != null">
#{totalWorkingTime,jdbcType=INTEGER},
</if>
<if test="workingTime != null">
#{workingTime,jdbcType=INTEGER},
</if>
<if test="connectionState != null">
#{connectionState,jdbcType=TINYINT},
</if>
<if test="signalStrength4g != null">
#{signalStrength4g,jdbcType=TINYINT},
</if>
<if test="signalStrength2g != null">
#{signalStrength2g,jdbcType=TINYINT},
</if>
<if test="remainingRam != null">
#{remainingRam,jdbcType=TINYINT},
</if>
<if test="remainingRom != null">
#{remainingRom,jdbcType=TINYINT},
</if>
<if test="startTime != null">
#{startTime,jdbcType=TIMESTAMP},
</if>
<if test="updateTime != null">
#{updateTime,jdbcType=TIMESTAMP},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.shxy.xymanager_common.entity.TerminalStatus">
update terminal_status
<set>
<if test="lastHeartbeat != null">
last_heartbeat = #{lastHeartbeat,jdbcType=TIMESTAMP},
</if>
<if test="lastFrameNo != null">
last_frame_no = #{lastFrameNo,jdbcType=SMALLINT},
</if>
<if test="batteryVoltage != null">
battery_voltage = #{batteryVoltage,jdbcType=REAL},
</if>
<if test="opTemperature != null">
op_temperature = #{opTemperature,jdbcType=REAL},
</if>
<if test="batteryCapacity != null">
battery_capacity = #{batteryCapacity,jdbcType=REAL},
</if>
<if test="floatingCharge != null">
floating_charge = #{floatingCharge,jdbcType=TINYINT},
</if>
<if test="totalWorkingTime != null">
total_working_time = #{totalWorkingTime,jdbcType=INTEGER},
</if>
<if test="workingTime != null">
working_time = #{workingTime,jdbcType=INTEGER},
</if>
<if test="gpsStatus != null">
gps_status = #{gpsStatus},
</if>
<if test="connectionState != null">
connection_state = #{connectionState,jdbcType=TINYINT},
</if>
<if test="signalStrength4g != null">
signal_strength_4g = #{signalStrength4g,jdbcType=TINYINT},
</if>
<if test="signalStrength2g != null">
signal_strength_2g = #{signalStrength2g,jdbcType=TINYINT},
</if>
<if test="remainingRam != null">
remaining_ram = #{remainingRam,jdbcType=TINYINT},
</if>
<if test="remainingRom != null">
remaining_rom = #{remainingRom,jdbcType=TINYINT},
</if>
<if test="bootTime != null">
boot_time = #{bootTime,jdbcType=TIMESTAMP},
</if>
<if test="updateTime != null">
rs_update_time = #{updateTime,jdbcType=TIMESTAMP},
</if>
</set>
where term_id = #{termId,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKey" parameterType="com.shxy.xymanager_common.entity.TerminalStatus">
<select id="countByExample" parameterType="com.shxy.xymanager_common.entity.TerminalStatusExample" resultType="java.lang.Long">
select count(*) from terminal_status
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
update terminal_status
<set>
<if test="record.termId != null">
term_id = #{record.termId,jdbcType=INTEGER},
</if>
<if test="record.lastHeartbeat != null">
last_heartbeat = #{record.lastHeartbeat,jdbcType=BIGINT},
</if>
<if test="record.lastHeartbeatIp != null">
last_heartbeat_ip = #{record.lastHeartbeatIp,jdbcType=VARCHAR},
</if>
<if test="record.lastHeartbeatPort != null">
last_heartbeat_port = #{record.lastHeartbeatPort,jdbcType=SMALLINT},
</if>
<if test="record.lastFrameNo != null">
last_frame_no = #{record.lastFrameNo,jdbcType=SMALLINT},
</if>
<if test="record.batteryVoltage != null">
battery_voltage = #{record.batteryVoltage,jdbcType=REAL},
</if>
<if test="record.opTemperature != null">
op_temperature = #{record.opTemperature,jdbcType=REAL},
</if>
<if test="record.batteryCapacity != null">
battery_capacity = #{record.batteryCapacity,jdbcType=REAL},
</if>
<if test="record.floatingCharge != null">
floating_charge = #{record.floatingCharge,jdbcType=TINYINT},
</if>
<if test="record.totalWorkingTime != null">
total_working_time = #{record.totalWorkingTime,jdbcType=INTEGER},
</if>
<if test="record.workingTime != null">
working_time = #{record.workingTime,jdbcType=INTEGER},
</if>
<if test="record.connectionState != null">
connection_state = #{record.connectionState,jdbcType=TINYINT},
</if>
<if test="record.sendFlow != null">
send_flow = #{record.sendFlow,jdbcType=INTEGER},
</if>
<if test="record.recvFlow != null">
recv_flow = #{record.recvFlow,jdbcType=INTEGER},
</if>
<if test="record.wsUpdateTime != null">
ws_update_time = #{record.wsUpdateTime,jdbcType=BIGINT},
</if>
<if test="record.signalStrength4g != null">
signal_strength_4g = #{record.signalStrength4g,jdbcType=TINYINT},
</if>
<if test="record.signalStrength2g != null">
signal_strength_2g = #{record.signalStrength2g,jdbcType=TINYINT},
</if>
<if test="record.remainingRam != null">
remaining_ram = #{record.remainingRam,jdbcType=SMALLINT},
</if>
<if test="record.remainingRom != null">
remaining_rom = #{record.remainingRom,jdbcType=SMALLINT},
</if>
<if test="record.bootTime != null">
boot_time = #{record.bootTime,jdbcType=BIGINT},
</if>
<if test="record.rsUpdateTime != null">
rs_update_time = #{record.rsUpdateTime,jdbcType=BIGINT},
</if>
<if test="record.gpsStatus != null">
gps_status = #{record.gpsStatus,jdbcType=INTEGER},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map">
update terminal_status
set last_heartbeat = #{lastHeartbeat,jdbcType=TIMESTAMP},
set term_id = #{record.termId,jdbcType=INTEGER},
last_heartbeat = #{record.lastHeartbeat,jdbcType=BIGINT},
last_heartbeat_ip = #{record.lastHeartbeatIp,jdbcType=VARCHAR},
last_heartbeat_port = #{record.lastHeartbeatPort,jdbcType=SMALLINT},
last_frame_no = #{record.lastFrameNo,jdbcType=SMALLINT},
battery_voltage = #{record.batteryVoltage,jdbcType=REAL},
op_temperature = #{record.opTemperature,jdbcType=REAL},
battery_capacity = #{record.batteryCapacity,jdbcType=REAL},
floating_charge = #{record.floatingCharge,jdbcType=TINYINT},
total_working_time = #{record.totalWorkingTime,jdbcType=INTEGER},
working_time = #{record.workingTime,jdbcType=INTEGER},
connection_state = #{record.connectionState,jdbcType=TINYINT},
send_flow = #{record.sendFlow,jdbcType=INTEGER},
recv_flow = #{record.recvFlow,jdbcType=INTEGER},
ws_update_time = #{record.wsUpdateTime,jdbcType=BIGINT},
signal_strength_4g = #{record.signalStrength4g,jdbcType=TINYINT},
signal_strength_2g = #{record.signalStrength2g,jdbcType=TINYINT},
remaining_ram = #{record.remainingRam,jdbcType=SMALLINT},
remaining_rom = #{record.remainingRom,jdbcType=SMALLINT},
boot_time = #{record.bootTime,jdbcType=BIGINT},
rs_update_time = #{record.rsUpdateTime,jdbcType=BIGINT},
gps_status = #{record.gpsStatus,jdbcType=INTEGER}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="com.shxy.xymanager_common.entity.TerminalStatus">
update terminal_status
<set>
<if test="lastHeartbeat != null">
last_heartbeat = #{lastHeartbeat,jdbcType=BIGINT},
</if>
<if test="lastHeartbeatIp != null">
last_heartbeat_ip = #{lastHeartbeatIp,jdbcType=VARCHAR},
</if>
<if test="lastHeartbeatPort != null">
last_heartbeat_port = #{lastHeartbeatPort,jdbcType=SMALLINT},
</if>
<if test="lastFrameNo != null">
last_frame_no = #{lastFrameNo,jdbcType=SMALLINT},
</if>
<if test="batteryVoltage != null">
battery_voltage = #{batteryVoltage,jdbcType=REAL},
</if>
<if test="opTemperature != null">
op_temperature = #{opTemperature,jdbcType=REAL},
</if>
<if test="batteryCapacity != null">
battery_capacity = #{batteryCapacity,jdbcType=REAL},
</if>
<if test="floatingCharge != null">
floating_charge = #{floatingCharge,jdbcType=TINYINT},
</if>
<if test="totalWorkingTime != null">
total_working_time = #{totalWorkingTime,jdbcType=INTEGER},
</if>
<if test="workingTime != null">
working_time = #{workingTime,jdbcType=INTEGER},
</if>
<if test="connectionState != null">
connection_state = #{connectionState,jdbcType=TINYINT},
</if>
<if test="sendFlow != null">
send_flow = #{sendFlow,jdbcType=INTEGER},
</if>
<if test="recvFlow != null">
recv_flow = #{recvFlow,jdbcType=INTEGER},
</if>
<if test="wsUpdateTime != null">
ws_update_time = #{wsUpdateTime,jdbcType=BIGINT},
</if>
<if test="signalStrength4g != null">
signal_strength_4g = #{signalStrength4g,jdbcType=TINYINT},
</if>
<if test="signalStrength2g != null">
signal_strength_2g = #{signalStrength2g,jdbcType=TINYINT},
</if>
<if test="remainingRam != null">
remaining_ram = #{remainingRam,jdbcType=SMALLINT},
</if>
<if test="remainingRom != null">
remaining_rom = #{remainingRom,jdbcType=SMALLINT},
</if>
<if test="bootTime != null">
boot_time = #{bootTime,jdbcType=BIGINT},
</if>
<if test="rsUpdateTime != null">
rs_update_time = #{rsUpdateTime,jdbcType=BIGINT},
</if>
<if test="gpsStatus != null">
gps_status = #{gpsStatus,jdbcType=INTEGER},
</if>
</set>
where term_id = #{termId,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKey" parameterType="com.shxy.xymanager_common.entity.TerminalStatus">
update terminal_status
set last_heartbeat = #{lastHeartbeat,jdbcType=BIGINT},
last_heartbeat_ip = #{lastHeartbeatIp,jdbcType=VARCHAR},
last_heartbeat_port = #{lastHeartbeatPort,jdbcType=SMALLINT},
last_frame_no = #{lastFrameNo,jdbcType=SMALLINT},
battery_voltage = #{batteryVoltage,jdbcType=REAL},
op_temperature = #{opTemperature,jdbcType=REAL},
@ -263,12 +493,20 @@
total_working_time = #{totalWorkingTime,jdbcType=INTEGER},
working_time = #{workingTime,jdbcType=INTEGER},
connection_state = #{connectionState,jdbcType=TINYINT},
send_flow = #{sendFlow,jdbcType=INTEGER},
recv_flow = #{recvFlow,jdbcType=INTEGER},
ws_update_time = #{wsUpdateTime,jdbcType=BIGINT},
signal_strength_4g = #{signalStrength4g,jdbcType=TINYINT},
signal_strength_2g = #{signalStrength2g,jdbcType=TINYINT},
remaining_ram = #{remainingRam,jdbcType=TINYINT},
remaining_rom = #{remainingRom,jdbcType=TINYINT},
start_time = #{startTime,jdbcType=TIMESTAMP},
update_time = #{updateTime,jdbcType=TIMESTAMP}
remaining_ram = #{remainingRam,jdbcType=SMALLINT},
remaining_rom = #{remainingRom,jdbcType=SMALLINT},
boot_time = #{bootTime,jdbcType=BIGINT},
rs_update_time = #{rsUpdateTime,jdbcType=BIGINT},
gps_status = #{gpsStatus,jdbcType=INTEGER}
where term_id = #{termId,jdbcType=INTEGER}
</update>
</mapper>

@ -40,6 +40,18 @@ public class DyLevelServiceImpl implements DyLevelService {
@Autowired
DyLevelDao dyLevelDao;
@Autowired
LinesDao linesDao;
@Autowired
TowerDao towerDao;
@Autowired
TerminalsDao terminalsDao;
@Autowired
TerminalStatusDao terminalStatusDao;
@Autowired
TerminalChannelMapperDao terminalChannelMapperDao;
@ -55,9 +67,6 @@ public class DyLevelServiceImpl implements DyLevelService {
@Autowired
TerminalFavsDao terminalFavsDao;
@Autowired
TerminalsDao terminalsDao;
@Autowired
CacheService cacheService;

@ -9,7 +9,6 @@ import com.shxy.xymanager_common.enums.CommonStatus;
import com.shxy.xymanager_common.enums.PermissionDetailEnum;
import com.shxy.xymanager_common.exception.ApiException;
import com.shxy.xymanager_common.exception.Asserts;
import com.shxy.xymanager_common.model.PermissionDyLineTreeListModel;
import com.shxy.xymanager_dao.dao.*;
import com.shxy.xymanager_service.service.RoleService;
import lombok.extern.slf4j.Slf4j;
@ -18,7 +17,6 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
@ -135,6 +133,9 @@ public class RoleServiceImpl implements RoleService {
if (resourceType.intValue() == PermissionDetailEnum.TOWER.value()) {
permissionDetail.getTowerpList().add(resourceId);
}
if (resourceType.intValue() == PermissionDetailEnum.TERM.value()) {
permissionDetail.getTermpList().add(resourceId);
}
}
}
} else {
@ -167,18 +168,12 @@ public class RoleServiceImpl implements RoleService {
*
* */
@Override
public ServiceBody<PermissionDyLineTreeListModel> getPermissionTree() {
PermissionDyLineTreeListModel model = new PermissionDyLineTreeListModel();
public ServiceBody<List<DyLevel>> getPermissionTree() {
List<DyLevel> dyLevels = dyLevelDao.selectByExample(new DyLevelExample());
List<Lines> lines = linesDao.selectByExample(new LinesExample());
List<Towers> towers = towerDao.selectByExample(new TowersExample());
List<Terminals> terminals = terminalsDao.selectByExample(new TerminalsExample());
boolean empty = CollectionUtil.isEmpty(dyLevels);
if (empty) {
model.setList(new ArrayList<>());
} else {
model.setList(dyLevels);
if (CollectionUtil.isNotEmpty(dyLevels)) {
HashMap<Integer, DyLevel> dymap = new HashMap<>();
HashMap<Integer, Lines> linemap = new HashMap<>();
HashMap<Integer, Towers> towermap = new HashMap<>();
@ -195,7 +190,6 @@ public class RoleServiceImpl implements RoleService {
for (Terminals termitem : terminals) {
termmap.put(termitem.getId(), termitem);
}
for (Terminals termitem : terminals) {
Integer towerid = termitem.getTowerid();
if (towerid != null) {
@ -203,10 +197,8 @@ public class RoleServiceImpl implements RoleService {
if (BeanUtil.isNotEmpty(towers1)) {
towers1.getList().add(termitem);
}
}
}
for (Towers titem : towers) {
Integer lineId = titem.getLineId();
if (lineId != null) {
@ -216,7 +208,6 @@ public class RoleServiceImpl implements RoleService {
}
}
}
for (Lines litem : lines) {
Integer dyLevelId = litem.getDyLevelId();
if (dyLevelId != null) {
@ -226,11 +217,7 @@ public class RoleServiceImpl implements RoleService {
}
}
}
ArrayList<DyLevel> dyLevellist = new ArrayList<>(dymap.values());
model.setList(dyLevellist);
}
return Asserts.success(model);
return Asserts.success(dyLevels);
}
}

@ -2,9 +2,9 @@ package com.shxy.xymanager_service.service;
import com.shxy.xymanager_common.bean.PermissionDetail;
import com.shxy.xymanager_common.bean.ServiceBody;
import com.shxy.xymanager_common.entity.DyLevel;
import com.shxy.xymanager_common.entity.TbPermission;
import com.shxy.xymanager_common.entity.TbRole;
import com.shxy.xymanager_common.model.PermissionDyLineTreeListModel;
import java.util.List;
@ -24,6 +24,6 @@ public interface RoleService {
void changePermission(Integer roleId, List<TbPermission> list) throws Exception;
ServiceBody<PermissionDyLineTreeListModel> getPermissionTree() ;
ServiceBody<List<DyLevel>> getPermissionTree() ;
}

Loading…
Cancel
Save