dev #3
@ -25,6 +25,10 @@ public class EmsSiteSetting extends BaseEntity
|
|||||||
@Excel(name = "站点名称")
|
@Excel(name = "站点名称")
|
||||||
private String siteName;
|
private String siteName;
|
||||||
|
|
||||||
|
/** 站点简称 */
|
||||||
|
@Excel(name = "站点简称")
|
||||||
|
private String siteShortName;
|
||||||
|
|
||||||
/** 站点地址 */
|
/** 站点地址 */
|
||||||
@Excel(name = "站点地址")
|
@Excel(name = "站点地址")
|
||||||
private String siteAddress;
|
private String siteAddress;
|
||||||
@ -77,6 +81,16 @@ public class EmsSiteSetting extends BaseEntity
|
|||||||
return siteName;
|
return siteName;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setSiteShortName(String siteShortName)
|
||||||
|
{
|
||||||
|
this.siteShortName = siteShortName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getSiteShortName()
|
||||||
|
{
|
||||||
|
return siteShortName;
|
||||||
|
}
|
||||||
|
|
||||||
public void setSiteAddress(String siteAddress)
|
public void setSiteAddress(String siteAddress)
|
||||||
{
|
{
|
||||||
this.siteAddress = siteAddress;
|
this.siteAddress = siteAddress;
|
||||||
@ -162,6 +176,7 @@ public class EmsSiteSetting extends BaseEntity
|
|||||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||||
.append("id", getId())
|
.append("id", getId())
|
||||||
.append("siteName", getSiteName())
|
.append("siteName", getSiteName())
|
||||||
|
.append("siteShortName", getSiteShortName())
|
||||||
.append("siteAddress", getSiteAddress())
|
.append("siteAddress", getSiteAddress())
|
||||||
.append("runningTime", getRunningTime())
|
.append("runningTime", getRunningTime())
|
||||||
.append("latitude", getLatitude())
|
.append("latitude", getLatitude())
|
||||||
|
|||||||
@ -135,6 +135,8 @@ public class DevicePointMatchDataProcessor {
|
|||||||
return new HashMap<>();
|
return new HashMap<>();
|
||||||
}
|
}
|
||||||
return pointEnumMatchList.stream()
|
return pointEnumMatchList.stream()
|
||||||
|
.filter(Objects::nonNull)
|
||||||
|
.filter(data -> StringUtils.isNotEmpty(data.getMatchField()))
|
||||||
.collect(Collectors.groupingBy(data -> StringUtils.toCamelCase(data.getMatchField())));
|
.collect(Collectors.groupingBy(data -> StringUtils.toCamelCase(data.getMatchField())));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -237,8 +239,14 @@ public class DevicePointMatchDataProcessor {
|
|||||||
* 转换字段值为配置枚举值
|
* 转换字段值为配置枚举值
|
||||||
*/
|
*/
|
||||||
public void convertFieldValueToEnumMatch(String siteId, String deviceCategory, Object entity) {
|
public void convertFieldValueToEnumMatch(String siteId, String deviceCategory, Object entity) {
|
||||||
|
if (entity == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
Map<String, List<EmsPointEnumMatch>> pointEnumMatchMap = this.getPointEnumMatchMap(siteId, deviceCategory);
|
Map<String, List<EmsPointEnumMatch>> pointEnumMatchMap = this.getPointEnumMatchMap(siteId, deviceCategory);
|
||||||
|
if (pointEnumMatchMap == null || pointEnumMatchMap.isEmpty()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
Field[] fields = entity.getClass().getDeclaredFields();
|
Field[] fields = entity.getClass().getDeclaredFields();
|
||||||
for (Field field : fields) {
|
for (Field field : fields) {
|
||||||
String fieldName = field.getName();
|
String fieldName = field.getName();
|
||||||
@ -252,7 +260,9 @@ public class DevicePointMatchDataProcessor {
|
|||||||
if (CollectionUtils.isNotEmpty(pointEnumMatchList) && matchValue != null) {
|
if (CollectionUtils.isNotEmpty(pointEnumMatchList) && matchValue != null) {
|
||||||
String finalMatchValue = String.valueOf(matchValue).replace(".0", "");
|
String finalMatchValue = String.valueOf(matchValue).replace(".0", "");
|
||||||
Optional<EmsPointEnumMatch> enumMatch = pointEnumMatchList.stream()
|
Optional<EmsPointEnumMatch> enumMatch = pointEnumMatchList.stream()
|
||||||
.filter(data -> data.getDataEnumCode().equals(finalMatchValue)).findFirst();
|
.filter(Objects::nonNull)
|
||||||
|
.filter(data -> Objects.equals(data.getDataEnumCode(), finalMatchValue))
|
||||||
|
.findFirst();
|
||||||
if (enumMatch.isPresent()) {
|
if (enumMatch.isPresent()) {
|
||||||
matchValue = enumMatch.get().getEnumCode();
|
matchValue = enumMatch.get().getEnumCode();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -7,6 +7,7 @@
|
|||||||
<resultMap type="EmsSiteSetting" id="EmsSiteSettingResult">
|
<resultMap type="EmsSiteSetting" id="EmsSiteSettingResult">
|
||||||
<result property="id" column="id" />
|
<result property="id" column="id" />
|
||||||
<result property="siteName" column="site_name" />
|
<result property="siteName" column="site_name" />
|
||||||
|
<result property="siteShortName" column="site_short_name" />
|
||||||
<result property="siteAddress" column="site_address" />
|
<result property="siteAddress" column="site_address" />
|
||||||
<result property="runningTime" column="running_time" />
|
<result property="runningTime" column="running_time" />
|
||||||
<result property="latitude" column="latitude" />
|
<result property="latitude" column="latitude" />
|
||||||
@ -22,13 +23,14 @@
|
|||||||
</resultMap>
|
</resultMap>
|
||||||
|
|
||||||
<sql id="selectEmsSiteSettingVo">
|
<sql id="selectEmsSiteSettingVo">
|
||||||
select id, site_name, site_address, running_time, latitude, longitude, install_capacity, install_power, remark, create_by, update_by, create_time, update_time, site_id from ems_site_setting
|
select id, site_name, site_short_name, site_address, running_time, latitude, longitude, install_capacity, install_power, remark, create_by, update_by, create_time, update_time, site_id from ems_site_setting
|
||||||
</sql>
|
</sql>
|
||||||
|
|
||||||
<select id="selectEmsSiteSettingList" parameterType="EmsSiteSetting" resultMap="EmsSiteSettingResult">
|
<select id="selectEmsSiteSettingList" parameterType="EmsSiteSetting" resultMap="EmsSiteSettingResult">
|
||||||
<include refid="selectEmsSiteSettingVo"/>
|
<include refid="selectEmsSiteSettingVo"/>
|
||||||
<where>
|
<where>
|
||||||
<if test="siteName != null and siteName != ''"> and site_name like concat('%', #{siteName}, '%')</if>
|
<if test="siteName != null and siteName != ''"> and site_name like concat('%', #{siteName}, '%')</if>
|
||||||
|
<if test="siteShortName != null and siteShortName != ''"> and site_short_name like concat('%', #{siteShortName}, '%')</if>
|
||||||
<if test="siteAddress != null and siteAddress != ''"> and site_address = #{siteAddress}</if>
|
<if test="siteAddress != null and siteAddress != ''"> and site_address = #{siteAddress}</if>
|
||||||
<if test="runningTime != null "> and running_time = #{runningTime}</if>
|
<if test="runningTime != null "> and running_time = #{runningTime}</if>
|
||||||
<if test="latitude != null "> and latitude = #{latitude}</if>
|
<if test="latitude != null "> and latitude = #{latitude}</if>
|
||||||
@ -48,6 +50,7 @@
|
|||||||
insert into ems_site_setting
|
insert into ems_site_setting
|
||||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||||
<if test="siteName != null and siteName != ''">site_name,</if>
|
<if test="siteName != null and siteName != ''">site_name,</if>
|
||||||
|
<if test="siteShortName != null">site_short_name,</if>
|
||||||
<if test="siteAddress != null">site_address,</if>
|
<if test="siteAddress != null">site_address,</if>
|
||||||
<if test="runningTime != null">running_time,</if>
|
<if test="runningTime != null">running_time,</if>
|
||||||
<if test="latitude != null">latitude,</if>
|
<if test="latitude != null">latitude,</if>
|
||||||
@ -63,6 +66,7 @@
|
|||||||
</trim>
|
</trim>
|
||||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||||
<if test="siteName != null and siteName != ''">#{siteName},</if>
|
<if test="siteName != null and siteName != ''">#{siteName},</if>
|
||||||
|
<if test="siteShortName != null">#{siteShortName},</if>
|
||||||
<if test="siteAddress != null">#{siteAddress},</if>
|
<if test="siteAddress != null">#{siteAddress},</if>
|
||||||
<if test="runningTime != null">#{runningTime},</if>
|
<if test="runningTime != null">#{runningTime},</if>
|
||||||
<if test="latitude != null">#{latitude},</if>
|
<if test="latitude != null">#{latitude},</if>
|
||||||
@ -82,6 +86,7 @@
|
|||||||
update ems_site_setting
|
update ems_site_setting
|
||||||
<trim prefix="SET" suffixOverrides=",">
|
<trim prefix="SET" suffixOverrides=",">
|
||||||
<if test="siteName != null and siteName != ''">site_name = #{siteName},</if>
|
<if test="siteName != null and siteName != ''">site_name = #{siteName},</if>
|
||||||
|
<if test="siteShortName != null">site_short_name = #{siteShortName},</if>
|
||||||
<if test="siteAddress != null">site_address = #{siteAddress},</if>
|
<if test="siteAddress != null">site_address = #{siteAddress},</if>
|
||||||
<if test="runningTime != null">running_time = #{runningTime},</if>
|
<if test="runningTime != null">running_time = #{runningTime},</if>
|
||||||
<if test="latitude != null">latitude = #{latitude},</if>
|
<if test="latitude != null">latitude = #{latitude},</if>
|
||||||
|
|||||||
Reference in New Issue
Block a user