Commit 9764361c authored by wuqinghua's avatar wuqinghua

2022-7-19

parent 13a00380
...@@ -21,6 +21,9 @@ public class TDeviceInfo extends BaseEntity ...@@ -21,6 +21,9 @@ public class TDeviceInfo extends BaseEntity
/** 设备id */ /** 设备id */
private Integer deviceId; private Integer deviceId;
/** 管道名称*/
private String pipeName;
/** 企业id */ /** 企业id */
@Excel(name = "企业id") @Excel(name = "企业id")
private Integer enterpriseId; private Integer enterpriseId;
...@@ -91,6 +94,18 @@ public class TDeviceInfo extends BaseEntity ...@@ -91,6 +94,18 @@ public class TDeviceInfo extends BaseEntity
@Excel(name = "备注") @Excel(name = "备注")
private String remarks; private String remarks;
public static long getSerialVersionUID() {
return serialVersionUID;
}
public String getPipeName() {
return pipeName;
}
public void setPipeName(String pipeName) {
this.pipeName = pipeName;
}
public void setDeviceId(Integer deviceId) public void setDeviceId(Integer deviceId)
{ {
this.deviceId = deviceId; this.deviceId = deviceId;
...@@ -256,24 +271,26 @@ public class TDeviceInfo extends BaseEntity ...@@ -256,24 +271,26 @@ public class TDeviceInfo extends BaseEntity
@Override @Override
public String toString() { public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) return "TDeviceInfo{" +
.append("deviceId", getDeviceId()) "deviceId=" + deviceId +
.append("enterpriseId", getEnterpriseId()) ", pipeName='" + pipeName + '\'' +
.append("pipeCode", getPipeId()) ", enterpriseId=" + enterpriseId +
.append("deviceName", getDeviceName()) ", pipeId=" + pipeId +
.append("deviceCode", getDeviceCode()) ", deviceName='" + deviceName + '\'' +
.append("deviceAddr", getDeviceAddr()) ", deviceCode='" + deviceCode + '\'' +
.append("deviceModel", getDeviceModel()) ", deviceAddr='" + deviceAddr + '\'' +
.append("deviceType", getDeviceType()) ", deviceModel='" + deviceModel + '\'' +
.append("longitude", getLongitude()) ", deviceType='" + deviceType + '\'' +
.append("latitude", getLatitude()) ", longitude=" + longitude +
.append("iotNo", getIotNo()) ", latitude=" + latitude +
.append("iconUrl", getIconUrl()) ", iotNo='" + iotNo + '\'' +
.append("linkman", getLinkman()) ", iconUrl='" + iconUrl + '\'' +
.append("phone", getPhone()) ", linkman='" + linkman + '\'' +
.append("installationTime", getInstallationTime()) ", phone='" + phone + '\'' +
.append("inspectionTime", getInspectionTime()) ", installationTime=" + installationTime +
.append("remarks", getRemarks()) ", inspectionTime=" + inspectionTime +
.toString(); ", isDel='" + isDel + '\'' +
", remarks='" + remarks + '\'' +
'}';
} }
} }
...@@ -69,8 +69,8 @@ public class TDeviceInfoServiceImpl implements ITDeviceInfoService ...@@ -69,8 +69,8 @@ public class TDeviceInfoServiceImpl implements ITDeviceInfoService
DeviceInfoVo deviceInfoVo = new DeviceInfoVo(); DeviceInfoVo deviceInfoVo = new DeviceInfoVo();
BeanUtils.copyProperties(device, deviceInfoVo); BeanUtils.copyProperties(device, deviceInfoVo);
TPipe pipe = tPipeMapper.selectTPipeById(device.getPipeId()); // TPipe pipe = tPipeMapper.selectTPipeById(device.getPipeId());
deviceInfoVo.setPipeName(pipe.getPipeName()); // deviceInfoVo.setPipeName(pipe.getPipeName());
list.add(deviceInfoVo); list.add(deviceInfoVo);
} }
......
...@@ -6,6 +6,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -6,6 +6,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<resultMap type="TDeviceInfo" id="TDeviceInfoResult"> <resultMap type="TDeviceInfo" id="TDeviceInfoResult">
<result property="deviceId" column="device_id" /> <result property="deviceId" column="device_id" />
<result property="pipeName" column="pipe_name" />
<result property="enterpriseId" column="enterprise_id" /> <result property="enterpriseId" column="enterprise_id" />
<result property="pipeId" column="pipe_id" /> <result property="pipeId" column="pipe_id" />
<result property="deviceName" column="device_name" /> <result property="deviceName" column="device_name" />
...@@ -30,9 +31,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -30,9 +31,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</sql> </sql>
<select id="selectTDeviceInfoList" parameterType="TDeviceInfo" resultMap="TDeviceInfoResult"> <select id="selectTDeviceInfoList" parameterType="TDeviceInfo" resultMap="TDeviceInfoResult">
<include refid="selectTDeviceInfoVo"/> select a.*,b.pipe_name from t_device_info a left join t_pipe b on a.pipe_id=b.pipe_id
<where> <where>
is_del = '0' a.is_del = '0'
<if test="enterpriseId != null and enterpriseId != 0 "> and enterprise_id = #{enterpriseId}</if> <if test="enterpriseId != null and enterpriseId != 0 "> and enterprise_id = #{enterpriseId}</if>
<if test="deviceName != null and deviceName != ''"> and device_name like concat('%', #{deviceName}, '%')</if> <if test="deviceName != null and deviceName != ''"> and device_name like concat('%', #{deviceName}, '%')</if>
<if test="deviceCode != null and deviceCode != ''"> and device_code like concat('%', #{deviceCode}, '%')</if> <if test="deviceCode != null and deviceCode != ''"> and device_code like concat('%', #{deviceCode}, '%')</if>
......
...@@ -48,6 +48,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -48,6 +48,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
where pipe_id = #{pipeId} where pipe_id = #{pipeId}
</select> </select>
<!-- <select id="selectTPipeById" parameterType="int" resultMap="TPipeResult">-->
<!-- select pipe_id, pipe_code, pipe_addr, coordinates, pipe_length, pipe_type, pipe_pressure, icon_url, installation_time, inspection_time, remarks from t_pipe-->
<!-- where pipe_id = #{pipeId}-->
<!-- </select>-->
<select id="countPipeLength" resultType="double"> <select id="countPipeLength" resultType="double">
select COALESCE(sum(pipe_length), 0) from t_pipe select COALESCE(sum(pipe_length), 0) from t_pipe
where is_del = '0' where is_del = '0'
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment