Commit 9764361c authored by wuqinghua's avatar wuqinghua

2022-7-19

parent 13a00380
......@@ -21,6 +21,9 @@ public class TDeviceInfo extends BaseEntity
/** 设备id */
private Integer deviceId;
/** 管道名称*/
private String pipeName;
/** 企业id */
@Excel(name = "企业id")
private Integer enterpriseId;
......@@ -91,6 +94,18 @@ public class TDeviceInfo extends BaseEntity
@Excel(name = "备注")
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)
{
this.deviceId = deviceId;
......@@ -256,24 +271,26 @@ public class TDeviceInfo extends BaseEntity
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("deviceId", getDeviceId())
.append("enterpriseId", getEnterpriseId())
.append("pipeCode", getPipeId())
.append("deviceName", getDeviceName())
.append("deviceCode", getDeviceCode())
.append("deviceAddr", getDeviceAddr())
.append("deviceModel", getDeviceModel())
.append("deviceType", getDeviceType())
.append("longitude", getLongitude())
.append("latitude", getLatitude())
.append("iotNo", getIotNo())
.append("iconUrl", getIconUrl())
.append("linkman", getLinkman())
.append("phone", getPhone())
.append("installationTime", getInstallationTime())
.append("inspectionTime", getInspectionTime())
.append("remarks", getRemarks())
.toString();
return "TDeviceInfo{" +
"deviceId=" + deviceId +
", pipeName='" + pipeName + '\'' +
", enterpriseId=" + enterpriseId +
", pipeId=" + pipeId +
", deviceName='" + deviceName + '\'' +
", deviceCode='" + deviceCode + '\'' +
", deviceAddr='" + deviceAddr + '\'' +
", deviceModel='" + deviceModel + '\'' +
", deviceType='" + deviceType + '\'' +
", longitude=" + longitude +
", latitude=" + latitude +
", iotNo='" + iotNo + '\'' +
", iconUrl='" + iconUrl + '\'' +
", linkman='" + linkman + '\'' +
", phone='" + phone + '\'' +
", installationTime=" + installationTime +
", inspectionTime=" + inspectionTime +
", isDel='" + isDel + '\'' +
", remarks='" + remarks + '\'' +
'}';
}
}
......@@ -69,8 +69,8 @@ public class TDeviceInfoServiceImpl implements ITDeviceInfoService
DeviceInfoVo deviceInfoVo = new DeviceInfoVo();
BeanUtils.copyProperties(device, deviceInfoVo);
TPipe pipe = tPipeMapper.selectTPipeById(device.getPipeId());
deviceInfoVo.setPipeName(pipe.getPipeName());
// TPipe pipe = tPipeMapper.selectTPipeById(device.getPipeId());
// deviceInfoVo.setPipeName(pipe.getPipeName());
list.add(deviceInfoVo);
}
......
......@@ -6,6 +6,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<resultMap type="TDeviceInfo" id="TDeviceInfoResult">
<result property="deviceId" column="device_id" />
<result property="pipeName" column="pipe_name" />
<result property="enterpriseId" column="enterprise_id" />
<result property="pipeId" column="pipe_id" />
<result property="deviceName" column="device_name" />
......@@ -30,9 +31,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</sql>
<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>
is_del = '0'
a.is_del = '0'
<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="deviceCode != null and deviceCode != ''"> and device_code like concat('%', #{deviceCode}, '%')</if>
......
......@@ -48,6 +48,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
where pipe_id = #{pipeId}
</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 COALESCE(sum(pipe_length), 0) from t_pipe
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