电压修改和线路查询 杆塔查询

dev
liuguijing 1 year ago
parent 70cbde34ff
commit 5b66e70de4

@ -1,18 +1,27 @@
package com.shxy.xymanager_admin.controller;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.util.StrUtil;
import com.shxy.xymanager_common.annotation.Log;
import com.shxy.xymanager_common.base.BaseController;
import com.shxy.xymanager_common.base.ResponseReult;
import com.shxy.xymanager_common.bean.PermissionDetail;
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.View_Dy_Line_Tower_Terminals;
import com.shxy.xymanager_common.entity.View_Dy_Line_Tower_TerminalsExample;
import com.shxy.xymanager_common.enums.CommonStatus;
import com.shxy.xymanager_common.model.DyLineTreeListModel;
import com.shxy.xymanager_common.model.TerminalPhotosModel;
import com.shxy.xymanager_common.page.PageUtils;
import com.shxy.xymanager_common.page.TableDataInfo;
import com.shxy.xymanager_common.util.xinyin.HeaderUtil;
import com.shxy.xymanager_common.vo.DyListVo;
import com.shxy.xymanager_common.vo.DyTreeListVo;
import com.shxy.xymanager_common.vo.LastTowerVo;
import com.shxy.xymanager_common.vo.*;
import com.shxy.xymanager_dao.dao.View_Dy_Line_Tower_TerminalsDao;
import com.shxy.xymanager_service.service.DyLevelService;
import com.shxy.xymanager_service.service.UserService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiResponse;
@ -39,6 +48,12 @@ public class DyLevelController extends BaseController {
@Autowired
DyLevelService dyLevelService;
@Autowired
UserService userService;
@Autowired
View_Dy_Line_Tower_TerminalsDao view_dy_line_tower_terminalsDao;
@ApiOperation(value = "增加电压", notes = "增加电压", httpMethod = "POST")
@ApiResponses({@ApiResponse(code = 200, message = "请求成功"), @ApiResponse(code = 400, message = "请求参数没填好"), @ApiResponse(code = 404, message = "请求路径没有或页面跳转路径不对")})
@RequestMapping("/add")
@ -56,7 +71,7 @@ public class DyLevelController extends BaseController {
@ApiResponses({@ApiResponse(code = 200, message = "请求成功"), @ApiResponse(code = 400, message = "请求参数没填好"), @ApiResponse(code = 404, message = "请求路径没有或页面跳转路径不对")})
@RequestMapping("/delete")
@Log(title = "删除电压", type = "查询")
public ResponseReult<String> deleteDy(@Validated @NotNull(message = "id不能为空!") Integer vo) {
public ResponseReult<String> deleteDy(@RequestBody @Validated LineIdVo vo) {
ServiceBody<String> serviceBody = dyLevelService.delete(vo);
if (serviceBody.getCode() == ServiceStatus.SUCCESS) {
return ResponseReult.success(serviceBody.getData());
@ -82,8 +97,8 @@ public class DyLevelController extends BaseController {
@ApiResponses({@ApiResponse(code = 200, message = "请求成功"), @ApiResponse(code = 400, message = "请求参数没填好"), @ApiResponse(code = 404, message = "请求路径没有或页面跳转路径不对")})
@RequestMapping("/listAll")
@Log(title = "查询电压", type = "查询")
public ResponseReult<List<DyLevel>> listAll() {
ServiceBody<List<DyLevel>> serviceBody = dyLevelService.listAll();
public ResponseReult<TableDataInfo<DyLevel>> listAll(@RequestBody @Validated SelectVo vo) {
ServiceBody<TableDataInfo<DyLevel>> serviceBody = dyLevelService.listAll(vo);
if (serviceBody.getCode() == ServiceStatus.SUCCESS) {
return ResponseReult.success(serviceBody.getData());
} else {

@ -55,6 +55,20 @@ public class TerminalPhotoController extends BaseController {
}
}
// @ApiOperation(value = "告警划线", notes = "告警划线", httpMethod = "POST")
// @ApiResponses({@ApiResponse(code = 200, message = "请求成功"), @ApiResponse(code = 400, message = "请求参数没填好"), @ApiResponse(code = 404, message = "请求路径没有或页面跳转路径不对")})
// @RequestMapping("/takeAlarm")
// @Log(title = "告警划线", type = "查询")
// public ResponseReult<TakePIcModel> takeAlarm(@Validated TerminalPhotoVo vo) {
// ServiceBody<TakePIcModel> serviceBody = terminalPhotoService.takeAlarm(vo);
// if (serviceBody.getCode() == ServiceStatus.SUCCESS) {
// return ResponseReult.success(serviceBody.getData());
// } else {
// return ResponseReult.error(serviceBody.getCode(), serviceBody.getMsg());
// }
// }
@ApiOperation(value = "主动拍照下发状态查询", notes = "主动拍照下发状态查询接口", httpMethod = "POST")
@ApiResponses({@ApiResponse(code = 200, message = "请求成功"), @ApiResponse(code = 400, message = "请求参数没填好"), @ApiResponse(code = 404, message = "请求路径没有或页面跳转路径不对")})
@RequestMapping("/getTakePicStatus")

@ -8,7 +8,6 @@ import lombok.Data;
@Data
public class TermChannelCoordinateDto {
private float x1;
private float x2;
@ -17,5 +16,4 @@ public class TermChannelCoordinateDto {
private float y1;
}

@ -28,6 +28,10 @@ public class View_Dy_Line_Tower_Terminals implements Serializable {
@ApiModelProperty(value = "电压编号", example = "123456")
private String dyName;
private Date dyCreateTime;
private Date dyUpdateTime;
@ApiModelProperty(value = "线路编号", example = "123456")
private Integer lineId;

@ -331,6 +331,126 @@ public class View_Dy_Line_Tower_TerminalsExample {
return (Criteria) this;
}
public Criteria andDyCreateTimeIsNull() {
addCriterion("dy_create_time is null");
return (Criteria) this;
}
public Criteria andDyCreateTimeIsNotNull() {
addCriterion("dy_create_time is not null");
return (Criteria) this;
}
public Criteria andDyCreateTimeEqualTo(Date value) {
addCriterion("dy_create_time =", value, "dyCreateTime");
return (Criteria) this;
}
public Criteria andDyCreateTimeNotEqualTo(Date value) {
addCriterion("dy_create_time <>", value, "dyCreateTime");
return (Criteria) this;
}
public Criteria andDyCreateTimeGreaterThan(Date value) {
addCriterion("dy_create_time >", value, "dyCreateTime");
return (Criteria) this;
}
public Criteria andDyCreateTimeGreaterThanOrEqualTo(Date value) {
addCriterion("dy_create_time >=", value, "dyCreateTime");
return (Criteria) this;
}
public Criteria andDyCreateTimeLessThan(Date value) {
addCriterion("dy_create_time <", value, "dyCreateTime");
return (Criteria) this;
}
public Criteria andDyCreateTimeLessThanOrEqualTo(Date value) {
addCriterion("dy_create_time <=", value, "dyCreateTime");
return (Criteria) this;
}
public Criteria andDyCreateTimeIn(List<Date> values) {
addCriterion("dy_create_time in", values, "dyCreateTime");
return (Criteria) this;
}
public Criteria andDyCreateTimeNotIn(List<Date> values) {
addCriterion("dy_create_time not in", values, "dyCreateTime");
return (Criteria) this;
}
public Criteria andDyCreateTimeBetween(Date value1, Date value2) {
addCriterion("dy_create_time between", value1, value2, "dyCreateTime");
return (Criteria) this;
}
public Criteria andDyCreateTimeNotBetween(Date value1, Date value2) {
addCriterion("dy_create_time not between", value1, value2, "dyCreateTime");
return (Criteria) this;
}
public Criteria andDyUpdateTimeIsNull() {
addCriterion("dy_update_time is null");
return (Criteria) this;
}
public Criteria andDyUpdateTimeIsNotNull() {
addCriterion("dy_update_time is not null");
return (Criteria) this;
}
public Criteria andDyUpdateTimeEqualTo(Date value) {
addCriterion("dy_update_time =", value, "dyUpdateTime");
return (Criteria) this;
}
public Criteria andDyUpdateTimeNotEqualTo(Date value) {
addCriterion("dy_update_time <>", value, "dyUpdateTime");
return (Criteria) this;
}
public Criteria andDyUpdateTimeGreaterThan(Date value) {
addCriterion("dy_update_time >", value, "dyUpdateTime");
return (Criteria) this;
}
public Criteria andDyUpdateTimeGreaterThanOrEqualTo(Date value) {
addCriterion("dy_update_time >=", value, "dyUpdateTime");
return (Criteria) this;
}
public Criteria andDyUpdateTimeLessThan(Date value) {
addCriterion("dy_update_time <", value, "dyUpdateTime");
return (Criteria) this;
}
public Criteria andDyUpdateTimeLessThanOrEqualTo(Date value) {
addCriterion("dy_update_time <=", value, "dyUpdateTime");
return (Criteria) this;
}
public Criteria andDyUpdateTimeIn(List<Date> values) {
addCriterion("dy_update_time in", values, "dyUpdateTime");
return (Criteria) this;
}
public Criteria andDyUpdateTimeNotIn(List<Date> values) {
addCriterion("dy_update_time not in", values, "dyUpdateTime");
return (Criteria) this;
}
public Criteria andDyUpdateTimeBetween(Date value1, Date value2) {
addCriterion("dy_update_time between", value1, value2, "dyUpdateTime");
return (Criteria) this;
}
public Criteria andDyUpdateTimeNotBetween(Date value1, Date value2) {
addCriterion("dy_update_time not between", value1, value2, "dyUpdateTime");
return (Criteria) this;
}
public Criteria andLineIdIsNull() {
addCriterion("line_id is null");
return (Criteria) this;

@ -28,6 +28,11 @@ public class TowerListModel implements Serializable {
@Data
public static class TowerBean {
@ApiModelProperty(value = "电压编号", example = "123456")
private Integer dyid;
@ApiModelProperty(value = "电压名称", example = "123456")
private String dyname;
@ApiModelProperty(value = "杆塔编号", example = "123456")
private Integer id;

@ -12,6 +12,12 @@ import javax.validation.constraints.Min;
@ApiModel(value = "杆塔和线路模糊查询对象", description = "杆塔和线路模糊查询对象")
public class SelectVo {
@ApiModelProperty(value = "电压id", example = "电压id")
private Integer dyId;
@ApiModelProperty(value = "线路id", example = "线路id")
private Integer lineId;
@ApiModelProperty(value = "搜索内容", example = "搜索内容字段")
private String search;
@ -22,4 +28,5 @@ public class SelectVo {
@Min(value = 1, message = "分页大小最小为1")
@ApiModelProperty(value = "分页大小", required = true, example = "1")
private int pagesize;
}

@ -122,12 +122,12 @@
<!-- &lt;!&ndash; <property name="useActualColumnNames" value="false"/>&ndash;&gt;-->
<!-- </table>-->
<!-- <table tableName="v_dy_line_tower_terminals"-->
<!-- domainObjectName="View_Dy_Line_Tower_Terminals"-->
<!-- mapperName="View_Dy_Line_Tower_TerminalsDao"-->
<!-- >-->
<!-- &lt;!&ndash; <property name="useActualColumnNames" value="false"/>&ndash;&gt;-->
<!-- </table>-->
<table tableName="v_dy_line_tower_terminals"
domainObjectName="View_Dy_Line_Tower_Terminals"
mapperName="View_Dy_Line_Tower_TerminalsDao"
>
<!-- <property name="useActualColumnNames" value="false"/>-->
</table>
<!-- <table tableName="terminal_channel_mapper"-->

@ -5,6 +5,8 @@
<result column="id" jdbcType="INTEGER" property="id"/>
<result column="dy_id" jdbcType="INTEGER" property="dyId"/>
<result column="dy_name" jdbcType="VARCHAR" property="dyName"/>
<result column="dy_create_time" jdbcType="TIMESTAMP" property="dyCreateTime"/>
<result column="dy_update_time" jdbcType="TIMESTAMP" property="dyUpdateTime"/>
<result column="line_id" jdbcType="INTEGER" property="lineId"/>
<result column="line_name" jdbcType="VARCHAR" property="lineName"/>
<result column="line_bs_manufacturer" jdbcType="VARCHAR" property="lineBsManufacturer"/>
@ -33,7 +35,6 @@
<result column="phase" jdbcType="VARCHAR" property="phase"/>
<result column="equipment_type" jdbcType="VARCHAR" property="equipmentType"/>
<result column="last_heartbeat" jdbcType="BIGINT" property="lastHeartbeat"/>
<result column="termcount" jdbcType="INTEGER" property="termcount" />
</resultMap>
<sql id="Example_Where_Clause">
<where>
@ -53,36 +54,8 @@
</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="Example_Where_Clause_Permission">
<where>
<foreach collection="oredCriteria" item="criteria" separator="and">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="or" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
or ${criterion.condition}
</when>
<when test="criterion.singleValue">
or ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
or ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
or ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
<foreach close=")" collection="criterion.value" item="listItem" open="("
separator=",">
#{listItem}
</foreach>
</when>
@ -111,7 +84,8 @@
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
<foreach close=")" collection="criterion.value" item="listItem" open="("
separator=",">
#{listItem}
</foreach>
</when>
@ -123,12 +97,16 @@
</where>
</sql>
<sql id="Base_Column_List">
id, dy_id, dy_name, line_id, line_name, line_bs_manufacturer, tower_id, tower_name,
address, `order`, cmdid, org_id, equip_name, display_name, model, essential_info_version,
has_pan, bs_manufacturer, bs_production_date, bs_identifier, latitude, longitude,
status, protocol, sim, working_date, net_type, dev_type, phase, equipment_type, last_heartbeat,count(id) as termcount
id, dy_id, dy_name, dy_create_time, dy_update_time, line_id, line_name, line_bs_manufacturer,
tower_id, tower_name, address, `order`, cmdid, org_id, equip_name, display_name, model,
essential_info_version, has_pan, bs_manufacturer, bs_production_date, bs_identifier,
latitude, longitude, status, protocol, sim, working_date, net_type, dev_type, phase,
equipment_type, last_heartbeat
</sql>
<select id="selectByExample" parameterType="com.shxy.xymanager_common.entity.View_Dy_Line_Tower_TerminalsExample" resultMap="BaseResultMap">
<select id="selectByExample" parameterType="com.shxy.xymanager_common.entity.View_Dy_Line_Tower_TerminalsExample"
resultMap="BaseResultMap">
select
<if test="distinct">
distinct
@ -142,23 +120,6 @@
order by ${orderByClause}
</if>
</select>
<select id="selectByPermission" parameterType="com.shxy.xymanager_common.entity.View_Dy_Line_Tower_TerminalsExample" resultMap="BaseResultMap">
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
from v_dy_line_tower_terminals
<if test="_parameter != null">
<include refid="Example_Where_Clause_Permission" />
</if>
<if test="groupByClause != null">
group by ${groupByClause}
</if>
<if test="orderByClause != null">
order by ${orderByClause}
</if>
</select>
<delete id="deleteByExample" parameterType="com.shxy.xymanager_common.entity.View_Dy_Line_Tower_TerminalsExample">
delete from v_dy_line_tower_terminals
<if test="_parameter != null">
@ -166,28 +127,32 @@
</if>
</delete>
<insert id="insert" parameterType="com.shxy.xymanager_common.entity.View_Dy_Line_Tower_Terminals">
insert into v_dy_line_tower_terminals (id, dy_id, dy_name,
line_id, line_name, line_bs_manufacturer,
tower_id, tower_name, address,
order, cmdid, org_id,
equip_name, display_name, model,
essential_info_version, has_pan, bs_manufacturer,
bs_production_date, bs_identifier, latitude,
longitude, status, protocol,
sim, working_date, net_type,
dev_type, phase, equipment_type,
last_heartbeat)
dy_create_time, dy_update_time, line_id,
line_name, line_bs_manufacturer, tower_id,
tower_name, address, `order`,
cmdid, org_id, equip_name,
display_name, model, essential_info_version,
has_pan, bs_manufacturer, bs_production_date,
bs_identifier, latitude, longitude,
status, protocol, sim,
working_date, net_type, dev_type,
phase, equipment_type, last_heartbeat
)
values (#{id,jdbcType=INTEGER}, #{dyId,jdbcType=INTEGER}, #{dyName,jdbcType=VARCHAR},
#{lineId,jdbcType=INTEGER}, #{lineName,jdbcType=VARCHAR}, #{lineBsManufacturer,jdbcType=VARCHAR},
#{towerId,jdbcType=INTEGER}, #{towerName,jdbcType=VARCHAR}, #{address,jdbcType=VARCHAR},
#{order,jdbcType=INTEGER}, #{cmdid,jdbcType=VARCHAR}, #{orgId,jdbcType=SMALLINT},
#{equipName,jdbcType=VARCHAR}, #{displayName,jdbcType=VARCHAR}, #{model,jdbcType=VARCHAR},
#{essentialInfoVersion,jdbcType=VARCHAR}, #{hasPan,jdbcType=TINYINT}, #{bsManufacturer,jdbcType=VARCHAR},
#{bsProductionDate,jdbcType=DATE}, #{bsIdentifier,jdbcType=VARCHAR}, #{latitude,jdbcType=DOUBLE},
#{longitude,jdbcType=DOUBLE}, #{status,jdbcType=INTEGER}, #{protocol,jdbcType=INTEGER},
#{sim,jdbcType=VARCHAR}, #{workingDate,jdbcType=DATE}, #{netType,jdbcType=TINYINT},
#{devType,jdbcType=TINYINT}, #{phase,jdbcType=VARCHAR}, #{equipmentType,jdbcType=VARCHAR},
#{lastHeartbeat,jdbcType=BIGINT})
#{dyCreateTime,jdbcType=TIMESTAMP}, #{dyUpdateTime,jdbcType=TIMESTAMP}, #{lineId,jdbcType=INTEGER},
#{lineName,jdbcType=VARCHAR}, #{lineBsManufacturer,jdbcType=VARCHAR}, #{towerId,jdbcType=INTEGER},
#{towerName,jdbcType=VARCHAR}, #{address,jdbcType=VARCHAR}, #{order,jdbcType=INTEGER},
#{cmdid,jdbcType=VARCHAR}, #{orgId,jdbcType=SMALLINT}, #{equipName,jdbcType=VARCHAR},
#{displayName,jdbcType=VARCHAR}, #{model,jdbcType=VARCHAR}, #{essentialInfoVersion,jdbcType=VARCHAR},
#{hasPan,jdbcType=TINYINT}, #{bsManufacturer,jdbcType=VARCHAR}, #{bsProductionDate,jdbcType=DATE},
#{bsIdentifier,jdbcType=VARCHAR}, #{latitude,jdbcType=DOUBLE}, #{longitude,jdbcType=DOUBLE},
#{status,jdbcType=INTEGER}, #{protocol,jdbcType=INTEGER}, #{sim,jdbcType=VARCHAR},
#{workingDate,jdbcType=DATE}, #{netType,jdbcType=TINYINT}, #{devType,jdbcType=TINYINT},
#{phase,jdbcType=VARCHAR}, #{equipmentType,jdbcType=VARCHAR}, #{lastHeartbeat,jdbcType=BIGINT}
)
</insert>
<insert id="insertSelective" parameterType="com.shxy.xymanager_common.entity.View_Dy_Line_Tower_Terminals">
insert into v_dy_line_tower_terminals
@ -201,6 +166,12 @@
<if test="dyName != null">
dy_name,
</if>
<if test="dyCreateTime != null">
dy_create_time,
</if>
<if test="dyUpdateTime != null">
dy_update_time,
</if>
<if test="lineId != null">
line_id,
</if>
@ -220,7 +191,7 @@
address,
</if>
<if test="order != null">
order,
`order`,
</if>
<if test="cmdid != null">
cmdid,
@ -296,6 +267,12 @@
<if test="dyName != null">
#{dyName,jdbcType=VARCHAR},
</if>
<if test="dyCreateTime != null">
#{dyCreateTime,jdbcType=TIMESTAMP},
</if>
<if test="dyUpdateTime != null">
#{dyUpdateTime,jdbcType=TIMESTAMP},
</if>
<if test="lineId != null">
#{lineId,jdbcType=INTEGER},
</if>
@ -382,7 +359,8 @@
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.shxy.xymanager_common.entity.View_Dy_Line_Tower_TerminalsExample" resultType="java.lang.Long">
<select id="countByExample" parameterType="com.shxy.xymanager_common.entity.View_Dy_Line_Tower_TerminalsExample"
resultType="java.lang.Long">
select count(*) from v_dy_line_tower_terminals
<if test="_parameter != null">
<include refid="Example_Where_Clause"/>
@ -400,6 +378,12 @@
<if test="record.dyName != null">
dy_name = #{record.dyName,jdbcType=VARCHAR},
</if>
<if test="record.dyCreateTime != null">
dy_create_time = #{record.dyCreateTime,jdbcType=TIMESTAMP},
</if>
<if test="record.dyUpdateTime != null">
dy_update_time = #{record.dyUpdateTime,jdbcType=TIMESTAMP},
</if>
<if test="record.lineId != null">
line_id = #{record.lineId,jdbcType=INTEGER},
</if>
@ -419,7 +403,7 @@
address = #{record.address,jdbcType=VARCHAR},
</if>
<if test="record.order != null">
order = #{record.order,jdbcType=INTEGER},
`order`= #{record.order,jdbcType=INTEGER},
</if>
<if test="record.cmdid != null">
cmdid = #{record.cmdid,jdbcType=VARCHAR},
@ -494,13 +478,15 @@
set id = #{record.id,jdbcType=INTEGER},
dy_id = #{record.dyId,jdbcType=INTEGER},
dy_name = #{record.dyName,jdbcType=VARCHAR},
dy_create_time = #{record.dyCreateTime,jdbcType=TIMESTAMP},
dy_update_time = #{record.dyUpdateTime,jdbcType=TIMESTAMP},
line_id = #{record.lineId,jdbcType=INTEGER},
line_name = #{record.lineName,jdbcType=VARCHAR},
line_bs_manufacturer = #{record.lineBsManufacturer,jdbcType=VARCHAR},
tower_id = #{record.towerId,jdbcType=INTEGER},
tower_name = #{record.towerName,jdbcType=VARCHAR},
address = #{record.address,jdbcType=VARCHAR},
order = #{record.order,jdbcType=INTEGER},
'order' = #{record.order,jdbcType=INTEGER},
cmdid = #{record.cmdid,jdbcType=VARCHAR},
org_id = #{record.orgId,jdbcType=SMALLINT},
equip_name = #{record.equipName,jdbcType=VARCHAR},
@ -527,4 +513,52 @@
</if>
</update>
<sql id="Example_Where_Clause_Permission">
<where>
<foreach collection="oredCriteria" item="criteria" separator="and">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="or" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
or ${criterion.condition}
</when>
<when test="criterion.singleValue">
or ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
or ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
or ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="("
separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<select id="selectByPermission" parameterType="com.shxy.xymanager_common.entity.View_Dy_Line_Tower_TerminalsExample"
resultMap="BaseResultMap">
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List"/>
from v_dy_line_tower_terminals
<if test="_parameter != null">
<include refid="Example_Where_Clause_Permission"/>
</if>
<if test="groupByClause != null">
group by ${groupByClause}
</if>
<if test="orderByClause != null">
order by ${orderByClause}
</if>
</select>
</mapper>

@ -1,6 +1,8 @@
package com.shxy.xymanager_service.impl;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.util.StrUtil;
import com.github.pagehelper.PageInfo;
import com.shxy.xymanager_common.bean.PermissionDetail;
import com.shxy.xymanager_common.bean.ServiceBody;
@ -11,9 +13,12 @@ import com.shxy.xymanager_common.exception.Asserts;
import com.shxy.xymanager_common.model.DyLineTreeListModel;
import com.shxy.xymanager_common.model.TerminalPhotosModel;
import com.shxy.xymanager_common.page.PageUtils;
import com.shxy.xymanager_common.page.TableDataInfo;
import com.shxy.xymanager_common.util.xinyin.TerminalUtils;
import com.shxy.xymanager_common.vo.DyTreeListVo;
import com.shxy.xymanager_common.vo.LastTowerVo;
import com.shxy.xymanager_common.vo.LineIdVo;
import com.shxy.xymanager_common.vo.SelectVo;
import com.shxy.xymanager_dao.dao.*;
import com.shxy.xymanager_service.service.CacheService;
import com.shxy.xymanager_service.service.DyLevelService;
@ -25,6 +30,7 @@ import org.springframework.stereotype.Service;
import java.math.BigInteger;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;
@ -304,13 +310,21 @@ public class DyLevelServiceImpl implements DyLevelService {
@Override
public ServiceBody<String> add(DyLevel vo) {
vo.setCreateTime(new Date());
dyLevelDao.insertSelective(vo);
return Asserts.success("success");
}
@Override
public ServiceBody<String> delete(Integer vo) {
dyLevelDao.deleteByPrimaryKey(vo);
public ServiceBody<String> delete(LineIdVo vo) {
List<Integer> list = vo.getList();
if (CollectionUtil.isNotEmpty(list)) {
DyLevelExample example = new DyLevelExample();
example.createCriteria().andIdIn(list);
dyLevelDao.deleteByExample(example);
} else {
Asserts.fail("删除编号不能缺少");
}
return Asserts.success("success");
}
@ -321,10 +335,76 @@ public class DyLevelServiceImpl implements DyLevelService {
}
@Override
public ServiceBody<List<DyLevel>> listAll() {
DyLevelExample example = new DyLevelExample();
List<DyLevel> dyLevels = dyLevelDao.selectByExample(example);
return Asserts.success(dyLevels);
public ServiceBody<TableDataInfo<DyLevel>> listAll(SelectVo vo) {
TableDataInfo<DyLevel> model = new TableDataInfo<>();
String search = vo.getSearch();
int pageindex = vo.getPageindex();
int pagesize = vo.getPagesize();
Integer dyid = vo.getDyId();
PermissionDetail permissionListOver = userService.getPermissionList();
List<Integer> dypList = permissionListOver.getDypList();
List<Integer> linepList = permissionListOver.getLinepList();
List<Integer> towerpList = permissionListOver.getTowerpList();
List<Integer> termpList = permissionListOver.getTermpList();
View_Dy_Line_Tower_TerminalsExample example = new View_Dy_Line_Tower_TerminalsExample();
example.setGroupByClause("dy_id");
example.setOrderByClause("dy_id desc");
if (CommonStatus.DELETE.value().equals(permissionListOver.getIsSuper())) {
View_Dy_Line_Tower_TerminalsExample.Criteria criteria = example.createCriteria();
if (CollectionUtil.isNotEmpty(dypList)) {
criteria.andDyIdIn(dypList);
}
if (CollectionUtil.isNotEmpty(linepList)) {
criteria.andLineIdIn(linepList);
}
if (CollectionUtil.isNotEmpty(towerpList)) {
criteria.andTowerIdIn(towerpList);
}
if (CollectionUtil.isNotEmpty(termpList)) {
criteria.andLineIdIn(termpList);
}
}
if (StrUtil.isEmpty(search)) {
search = null;
} else {
search = "%" + search + "%";
}
if (StrUtil.isNotEmpty(search)) {
View_Dy_Line_Tower_TerminalsExample.Criteria or = example.or();
or.andDyNameLike(search);
}
if (BeanUtil.isNotEmpty(dyid) && dyid.intValue() != -1) {
View_Dy_Line_Tower_TerminalsExample.Criteria or2 = example.or();
or2.andDyIdEqualTo(dyid);
}
PageUtils.SetPage(pageindex, pagesize);
List<View_Dy_Line_Tower_Terminals> list = view_dy_line_tower_terminalsDao.selectByPermission(example);
ArrayList<DyLevel> dylist = new ArrayList<>();
if (CollectionUtil.isNotEmpty(list)) {
for (View_Dy_Line_Tower_Terminals item : list) {
DyLevel bean = new DyLevel();
bean.setId(item.getDyId());
bean.setName(item.getDyName());
bean.setCreateTime(item.getDyCreateTime());
bean.setUpdateTime(item.getDyUpdateTime());
dylist.add(bean);
}
}
model.setList(dylist);
TableDataInfo pageData = PageUtils.getDataTable(list);
int currentpage = pageData.getCurrentpage();
model.setCurrentpage(currentpage);
long total = pageData.getTotal();
model.setTotal(total);
int pageSize = pageData.getPagesize();
model.setPagesize(pageSize);
int pages = pageData.getTotalpage();
model.setTotalpage(pages);
return Asserts.success(model);
}
}

@ -72,9 +72,10 @@ public class LineServiceImpl implements LineService {
@Override
public ServiceBody<TableDataInfo<Lines>> getLineList(SelectVo vo) {
TableDataInfo model = new TableDataInfo();
String search = vo.getSearch();
Integer dyid = vo.getDyId();
PermissionDetail permissionListOver = userService.getPermissionListOver();
List<Integer> pList = permissionListOver.getLinepList();
String search = vo.getSearch();
if (StrUtil.isEmpty(search)) {
search = null;
} else {
@ -91,6 +92,12 @@ public class LineServiceImpl implements LineService {
criteria.andLineIdIn(pList);
}
}
if (BeanUtil.isNotEmpty(dyid) && dyid.intValue() != -1) {
View_Dy_Line_Tower_TerminalsExample.Criteria or2 = example.or();
or2.andDyIdEqualTo(dyid);
}
if (StrUtil.isNotBlank(search)) {
View_Dy_Line_Tower_TerminalsExample.Criteria or = example.or();
or.andLineNameLike(search);

@ -68,29 +68,59 @@ public class TowerServiceImpl implements TowerService {
@Override
public ServiceBody<TowerListModel> getTowerList(SelectVo vo) {
TowerListModel model = new TowerListModel();
PermissionDetail permissionListOver = userService.getPermissionListOver();
List<Integer> towerpList = permissionListOver.getTowerpList();
String search = vo.getSearch();
Integer dyid = vo.getDyId();
Integer lineId = vo.getLineId();
int pageindex = vo.getPageindex();
int pagesize = vo.getPagesize();
if (StrUtil.isEmpty(search)) {
search = null;
} else {
search = "%" + search + "%";
}
int pageindex = vo.getPageindex();
int pagesize = vo.getPagesize();
PermissionDetail permissionListOver = userService.getPermissionList();
List<Integer> dypList = permissionListOver.getDypList();
List<Integer> linepList = permissionListOver.getLinepList();
List<Integer> towerpList = permissionListOver.getTowerpList();
List<Integer> termpList = permissionListOver.getTermpList();
View_Dy_Line_Tower_TerminalsExample example = new View_Dy_Line_Tower_TerminalsExample();
example.setGroupByClause("tower_id");
example.setOrderByClause("id desc");
View_Dy_Line_Tower_TerminalsExample.Criteria criteria = example.createCriteria();
example.setOrderByClause("tower_id desc");
if (CommonStatus.DELETE.value().equals(permissionListOver.getIsSuper())) {
View_Dy_Line_Tower_TerminalsExample.Criteria criteria = example.createCriteria();
if (CollectionUtil.isNotEmpty(dypList)) {
criteria.andDyIdIn(dypList);
}
if (CollectionUtil.isNotEmpty(linepList)) {
criteria.andLineIdIn(linepList);
}
if (CollectionUtil.isNotEmpty(towerpList)) {
criteria.andTowerIdIn(towerpList);
}
if (StrUtil.isNotBlank(search)) {
if (CollectionUtil.isNotEmpty(termpList)) {
criteria.andLineIdIn(termpList);
}
}
if (StrUtil.isEmpty(search)) {
search = null;
} else {
search = "%" + search + "%";
}
if (StrUtil.isNotEmpty(search)) {
View_Dy_Line_Tower_TerminalsExample.Criteria or = example.or();
or.andTowerNameLike(search);
or.andLineNameLike(search);
or.andAddressLike(search);
}
if (BeanUtil.isNotEmpty(dyid) && dyid.intValue() != -1) {
View_Dy_Line_Tower_TerminalsExample.Criteria or2 = example.or();
or2.andDyIdEqualTo(dyid);
}
if (BeanUtil.isNotEmpty(lineId) && lineId.intValue() != -1) {
View_Dy_Line_Tower_TerminalsExample.Criteria or2 = example.or();
or2.andLineIdEqualTo(lineId);
}
PageUtils.SetPage(pageindex, pagesize);
List<View_Dy_Line_Tower_Terminals> list = view_dy_line_tower_terminalsDao.selectByPermission(example);
boolean empty = CollectionUtil.isEmpty(list);
@ -100,6 +130,8 @@ public class TowerServiceImpl implements TowerService {
ArrayList<TowerListModel.TowerBean> list1 = new ArrayList<>();
for (View_Dy_Line_Tower_Terminals item : list) {
TowerListModel.TowerBean towerBean = new TowerListModel.TowerBean();
towerBean.setDyid(item.getDyId());
towerBean.setDyname(item.getDyName());
towerBean.setId(item.getTowerId());
towerBean.setLineId(item.getLineId());
towerBean.setLineName(item.getLineName());

@ -74,7 +74,9 @@ public class UploadServiceImpl implements UploadService {
int pageindex = vo.getPageindex();
int pagesize = vo.getPagesize();
PageUtils.SetPage(pageindex, pagesize);
List<TerminalUpload> list = terminalUploadDao.selectByExample(new TerminalUploadExample());
TerminalUploadExample example = new TerminalUploadExample();
example.setOrderByClause("id desc");
List<TerminalUpload> list = terminalUploadDao.selectByExample(example);
if (CollectionUtil.isNotEmpty(list)) {
for (TerminalUpload item : list) {
item.setPath(path+item.getPath());

@ -4,8 +4,11 @@ import com.shxy.xymanager_common.bean.ServiceBody;
import com.shxy.xymanager_common.entity.DyLevel;
import com.shxy.xymanager_common.model.DyLineTreeListModel;
import com.shxy.xymanager_common.model.TerminalPhotosModel;
import com.shxy.xymanager_common.page.TableDataInfo;
import com.shxy.xymanager_common.vo.DyTreeListVo;
import com.shxy.xymanager_common.vo.LastTowerVo;
import com.shxy.xymanager_common.vo.LineIdVo;
import com.shxy.xymanager_common.vo.SelectVo;
import java.util.List;
@ -48,10 +51,10 @@ public interface DyLevelService {
ServiceBody<String> add(DyLevel vo);
ServiceBody<String> delete(Integer vo);
ServiceBody<String> delete(LineIdVo vo);
ServiceBody<String> update(DyLevel vo);
ServiceBody<List<DyLevel>> listAll();
ServiceBody<TableDataInfo<DyLevel>> listAll(SelectVo vo);
}

Loading…
Cancel
Save