增加设备接口

This commit is contained in:
zy 2025-11-26 17:37:52 +08:00
parent 1884303b99
commit d7f38d8ae3
2 changed files with 13 additions and 3 deletions

View File

@ -30,19 +30,20 @@
<result property="survValue" column="SURV_VALUE" jdbcType="VARCHAR"/> <result property="survValue" column="SURV_VALUE" jdbcType="VARCHAR"/>
<result property="survUnit" column="SURV_UNIT" jdbcType="VARCHAR"/> <result property="survUnit" column="SURV_UNIT" jdbcType="VARCHAR"/>
<result property="readStatus" column="READ_STATUS" jdbcType="VARCHAR"/> <result property="readStatus" column="READ_STATUS" jdbcType="VARCHAR"/>
<result property="stationName" column="STATION_NAME" jdbcType="VARCHAR"/>
</resultMap> </resultMap>
<resultMap id="extMap" type="org.jeecg.common.entity.SurvAlertRecord" extends="baseResultMap"> <resultMap id="extMap" type="org.jeecg.common.entity.SurvAlertRecord" extends="baseResultMap">
<association property="stationName" select="getStationName" column="DEPLOY_CODE"/> <association property="stationName" select="getStationName" column="DEPLOY_CODE"/>
</resultMap> </resultMap>
<sql id="baseSql"> <sql id="baseSql">
ID,ALERT_CONTENT,CORP_ID,ALERT_DTATA_TYPE,ALERT_DATA_ID,PUSH_STATUS,DEVICE_CODE,STATION_CDOE,DEPLOY_CODE,DEPLOY_ID,ALERT_TIME,ITEM_NAME,DEVICE_NAME,CORP_NAME,TENANT_ID,RE_VISION,CREATED_BY,CREATE_TIME,UPDATED_BY,IS_DEL,UPDATED_TIME,ORG_MESSAGE,ITEM_CODE,NORMAL_VALUE,SURV_VALUE,READ_STATUS,SURV_UNIT ID,ALERT_CONTENT,CORP_ID,ALERT_DTATA_TYPE,ALERT_DATA_ID,PUSH_STATUS,DEVICE_CODE,STATION_CDOE,DEPLOY_CODE,DEPLOY_ID,ALERT_TIME,ITEM_NAME,DEVICE_NAME,CORP_NAME,TENANT_ID,RE_VISION,CREATED_BY,CREATE_TIME,UPDATED_BY,IS_DEL,UPDATED_TIME,ORG_MESSAGE,ITEM_CODE,NORMAL_VALUE,SURV_VALUE,READ_STATUS,SURV_UNIT,STATION_NAME
</sql> </sql>
<select id="getStationName" resultType="String"> <select id="getStationName" resultType="String">
select s.STATION_NAME from surv_device_deploy t left join surv_station_info s on t.STATION_CODE = s.STATION_CODE where t.DEPLOY_CODE= #{DEPLOY_CODE} select s.STATION_NAME from surv_device_deploy t left join surv_station_info s on t.STATION_CODE = s.STATION_CODE where t.DEPLOY_CODE= #{DEPLOY_CODE}
</select> </select>
<select id="pages" resultMap="extMap"> <select id="pages" resultMap="baseResultMap">
select <include refid="baseSql"/> select <include refid="baseSql"/>
from surv_alert_record where 1=1 from surv_alert_record where 1=1
<if test="deviceList!=null"> <if test="deviceList!=null">

View File

@ -11,6 +11,7 @@ import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors; import lombok.experimental.Accessors;
import org.apache.commons.lang3.StringUtils;
import org.apache.ibatis.type.JdbcType; import org.apache.ibatis.type.JdbcType;
import org.jeecg.common.mybatis.typehandler.ArrayStringTypeHandler; import org.jeecg.common.mybatis.typehandler.ArrayStringTypeHandler;
import org.jeecg.common.mybatis.typehandler.JsonArrayTypeHandler; import org.jeecg.common.mybatis.typehandler.JsonArrayTypeHandler;
@ -168,6 +169,14 @@ public class SurvAlertRecord implements Serializable {
/**站点名称*/ /**站点名称*/
@ApiModelProperty(value = "站点名称") @ApiModelProperty(value = "站点名称")
@TableField(exist = false)
private String stationName; private String stationName;
public String getFullDeviceName() {
if(StringUtils.isNotBlank(this.stationName)){
return stationName+"-"+deviceName;
}
return deviceName;
}
} }