Commit 9764361c authored by wuqinghua's avatar wuqinghua

2022-7-19

parent 13a00380
......@@ -10,7 +10,7 @@ import com.zehong.common.core.domain.BaseEntity;
/**
* 设备信息对象 t_device_info
*
*
* @author zehong
* @date 2021-07-09
*/
......@@ -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;
......@@ -118,12 +133,12 @@ public class TDeviceInfo extends BaseEntity
{
return pipeId;
}
public void setDeviceName(String deviceName)
public void setDeviceName(String deviceName)
{
this.deviceName = deviceName;
}
public String getDeviceName()
public String getDeviceName()
{
return deviceName;
}
......@@ -141,97 +156,97 @@ public class TDeviceInfo extends BaseEntity
this.deviceAddr = deviceAddr;
}
public String getDeviceAddr()
public String getDeviceAddr()
{
return deviceAddr;
}
public void setDeviceModel(String deviceModel)
public void setDeviceModel(String deviceModel)
{
this.deviceModel = deviceModel;
}
public String getDeviceModel()
public String getDeviceModel()
{
return deviceModel;
}
public void setDeviceType(String deviceType)
public void setDeviceType(String deviceType)
{
this.deviceType = deviceType;
}
public String getDeviceType()
public String getDeviceType()
{
return deviceType;
}
public void setLongitude(BigDecimal longitude)
public void setLongitude(BigDecimal longitude)
{
this.longitude = longitude;
}
public BigDecimal getLongitude()
public BigDecimal getLongitude()
{
return longitude;
}
public void setLatitude(BigDecimal latitude)
public void setLatitude(BigDecimal latitude)
{
this.latitude = latitude;
}
public BigDecimal getLatitude()
public BigDecimal getLatitude()
{
return latitude;
}
public void setIotNo(String iotNo)
public void setIotNo(String iotNo)
{
this.iotNo = iotNo;
}
public String getIotNo()
public String getIotNo()
{
return iotNo;
}
public void setIconUrl(String iconUrl)
public void setIconUrl(String iconUrl)
{
this.iconUrl = iconUrl;
}
public String getIconUrl()
public String getIconUrl()
{
return iconUrl;
}
public void setLinkman(String linkman)
public void setLinkman(String linkman)
{
this.linkman = linkman;
}
public String getLinkman()
public String getLinkman()
{
return linkman;
}
public void setPhone(String phone)
public void setPhone(String phone)
{
this.phone = phone;
}
public String getPhone()
public String getPhone()
{
return phone;
}
public void setInstallationTime(Date installationTime)
public void setInstallationTime(Date installationTime)
{
this.installationTime = installationTime;
}
public Date getInstallationTime()
public Date getInstallationTime()
{
return installationTime;
}
public void setInspectionTime(Date inspectionTime)
public void setInspectionTime(Date inspectionTime)
{
this.inspectionTime = inspectionTime;
}
public Date getInspectionTime()
public Date getInspectionTime()
{
return inspectionTime;
}
......@@ -249,31 +264,33 @@ public class TDeviceInfo extends BaseEntity
this.remarks = remarks;
}
public String getRemarks()
public String getRemarks()
{
return remarks;
}
@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);
}
......
......@@ -3,9 +3,10 @@
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.zehong.system.mapper.TDeviceInfoMapper">
<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>
......@@ -50,7 +51,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="remarks != null and remarks != ''"> and remarks = #{remarks}</if>
</where>
</select>
<select id="selectTDeviceInfoById" parameterType="int" resultMap="TDeviceInfoResult">
<include refid="selectTDeviceInfoVo"/>
where device_id = #{deviceId}
......@@ -66,7 +67,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
where is_del = '0'
group by device_type
</select>
<insert id="insertTDeviceInfo" parameterType="TDeviceInfo" useGeneratedKeys="true" keyProperty="deviceId">
insert into t_device_info
<trim prefix="(" suffix=")" suffixOverrides=",">
......@@ -136,7 +137,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</delete>
<delete id="deleteTDeviceInfoByIds" parameterType="String">
delete from t_device_info where device_id in
delete from t_device_info where device_id in
<foreach item="deviceId" collection="array" open="(" separator="," close=")">
#{deviceId}
</foreach>
......@@ -168,4 +169,4 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
group by p.pipe_id
</if>
</select>
</mapper>
\ No newline at end of file
</mapper>
......@@ -3,7 +3,7 @@
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.zehong.system.mapper.TPipeMapper">
<resultMap type="TPipe" id="TPipeResult">
<result property="pipeId" column="pipe_id" />
<result property="enterpriseId" column="enterprise_id" />
......@@ -42,17 +42,22 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="remarks != null and remarks != ''"> and remarks = #{remarks}</if>
</where>
</select>
<select id="selectTPipeById" parameterType="int" resultMap="TPipeResult">
<include refid="selectTPipeVo"/>
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'
</select>
<insert id="insertTPipe" parameterType="TPipe" useGeneratedKeys="true" keyProperty="pipeId">
insert into t_pipe
<trim prefix="(" suffix=")" suffixOverrides=",">
......@@ -110,9 +115,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</delete>
<delete id="deleteTPipeByIds" parameterType="String">
delete from t_pipe where pipe_id in
delete from t_pipe where pipe_id in
<foreach item="pipeId" collection="array" open="(" separator="," close=")">
#{pipeId}
</foreach>
</delete>
</mapper>
\ No newline at end of file
</mapper>
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