Commit 9764361c authored by wuqinghua's avatar wuqinghua

2022-7-19

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