change - hw_electronic_fence数据库由maxw加上device_mode_id和device_id,连表查询,修改相应mapper和do层

breach-zhy
zangch 2 months ago committed by zch
parent 2917a7a0e5
commit 8b3e911b0c

@ -79,6 +79,12 @@ public class HwElectronicFence extends BaseEntity
//电子围栏区域信息 //电子围栏区域信息
private List<HwFenceArea> hwFenceAreaList; private List<HwFenceArea> hwFenceAreaList;
private String deviceModeName;
private String deviceName;
private Long deviceModeId;
private Long deviceId;
public List<HwFenceArea> getHwFenceAreaList() { public List<HwFenceArea> getHwFenceAreaList() {
return hwFenceAreaList; return hwFenceAreaList;
} }
@ -247,6 +253,38 @@ public class HwElectronicFence extends BaseEntity
this.alarmInfoFlag = alarmInfoFlag; this.alarmInfoFlag = alarmInfoFlag;
} }
public String getDeviceModeName() {
return deviceModeName;
}
public void setDeviceModeName(String deviceModeName) {
this.deviceModeName = deviceModeName;
}
public String getDeviceName() {
return deviceName;
}
public void setDeviceName(String deviceName) {
this.deviceName = deviceName;
}
public Long getDeviceModeId() {
return deviceModeId;
}
public void setDeviceModeId(Long deviceModeId) {
this.deviceModeId = deviceModeId;
}
public Long getDeviceId() {
return deviceId;
}
public void setDeviceId(Long deviceId) {
this.deviceId = deviceId;
}
@Override @Override
public String toString() { public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
@ -269,6 +307,10 @@ public class HwElectronicFence extends BaseEntity
.append("updateTime", getUpdateTime()) .append("updateTime", getUpdateTime())
.append("fenceField", getFenceField()) .append("fenceField", getFenceField())
.append("hwFenceTargetList", getHwFenceTargetList()) .append("hwFenceTargetList", getHwFenceTargetList())
.append("deviceModeName", getDeviceModeName())
.append("deviceName", getDeviceName())
.append("deviceModeId", getDeviceModeId())
.append("deviceId", getDeviceId())
.toString(); .toString();
} }
} }

@ -24,6 +24,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="updateTime" column="update_time" /> <result property="updateTime" column="update_time" />
<result property="fenceField" column="fence_field" /> <result property="fenceField" column="fence_field" />
<result property="sceneName" column="scene_name" /> <result property="sceneName" column="scene_name" />
<result property="deviceModeName" column="device_mode_name" />
<result property="deviceName" column="device_name" />
<result property="deviceModeId" column="device_mode_id" />
<result property="deviceId" column="device_id" />
</resultMap> </resultMap>
<resultMap id="HwElectronicFenceHwFenceTargetResult" type="HwElectronicFence" extends="HwElectronicFenceResult"> <resultMap id="HwElectronicFenceHwFenceTargetResult" type="HwElectronicFence" extends="HwElectronicFenceResult">
@ -37,34 +41,91 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap> </resultMap>
<sql id="selectHwElectronicFenceVo"> <sql id="selectHwElectronicFenceVo">
select electronic_fence_id, electronic_fence_name, tenant_id, scene_id, fence_type, effective_time_flag, time_zone, effective_time, trigger_status, fence_push_flag, fence_push_content, fence_recover_content, remark, create_by, create_time, update_by, update_time, fence_field from hw_electronic_fence select hef.electronic_fence_id,
hef.electronic_fence_name,
hef.tenant_id,
hef.scene_id,
hef.fence_type,
hef.effective_time_flag,
hef.time_zone,
hef.effective_time,
hef.trigger_status,
hef.fence_push_flag,
hef.fence_push_content,
hef.fence_recover_content,
hef.remark,
hef.create_by,
hef.create_time,
hef.update_by,
hef.update_time,
hef.fence_field,
hdm.device_mode_name,
hd.device_name,
hef.device_mode_id,
hef.device_id,
hs.scene_name
from hw_electronic_fence hef
left join hw_device_mode hdm on hdm.device_mode_id = hef.device_mode_id
left join hw_device hd on hd.device_id = hef.device_id
left join hw_scene hs on hs.scene_id = hef.scene_id
</sql> </sql>
<select id="selectHwElectronicFenceList" parameterType="HwElectronicFence" resultMap="HwElectronicFenceResult"> <select id="selectHwElectronicFenceList" parameterType="HwElectronicFence" resultMap="HwElectronicFenceResult">
<include refid="selectHwElectronicFenceVo"/> <include refid="selectHwElectronicFenceVo"/>
<where> <where>
trigger_status !='9' trigger_status !='9'
<if test="electronicFenceName != null and electronicFenceName != ''"> and electronic_fence_name like concat('%', #{electronicFenceName}, '%')</if> <if test="electronicFenceName != null and electronicFenceName != ''"> and hef.electronic_fence_name like concat('%', #{electronicFenceName}, '%')</if>
<if test="tenantId != null "> and tenant_id = #{tenantId}</if> <if test="tenantId != null "> and hef.tenant_id = #{tenantId}</if>
<if test="sceneId != null "> and scene_id = #{sceneId}</if> <if test="sceneId != null "> and hef.scene_id = #{sceneId}</if>
<if test="fenceType != null and fenceType != ''"> and fence_type = #{fenceType}</if> <if test="fenceType != null and fenceType != ''"> and hef.fence_type = #{fenceType}</if>
<if test="effectiveTimeFlag != null and effectiveTimeFlag != ''"> and effective_time_flag = #{effectiveTimeFlag}</if> <if test="effectiveTimeFlag != null and effectiveTimeFlag != ''"> and hef.effective_time_flag = #{effectiveTimeFlag}</if>
<if test="timeZone != null and timeZone != ''"> and time_zone = #{timeZone}</if> <if test="timeZone != null and timeZone != ''"> and hef.time_zone = #{timeZone}</if>
<if test="effectiveTime != null and effectiveTime != ''"> and effective_time = #{effectiveTime}</if> <if test="effectiveTime != null and effectiveTime != ''"> and hef.effective_time = #{effectiveTime}</if>
<if test="triggerStatus != null and triggerStatus != ''"> and trigger_status = #{triggerStatus}</if> <if test="triggerStatus != null and triggerStatus != ''"> and hef.trigger_status = #{triggerStatus}</if>
<if test="fencePushFlag != null and fencePushFlag != ''"> and fence_push_flag = #{fencePushFlag}</if> <if test="fencePushFlag != null and fencePushFlag != ''"> and hef.fence_push_flag = #{fencePushFlag}</if>
<if test="fencePushContent != null and fencePushContent != ''"> and fence_push_content = #{fencePushContent}</if> <if test="fencePushContent != null and fencePushContent != ''"> and hef.fence_push_content = #{fencePushContent}</if>
<if test="fenceRecoverContent != null and fenceRecoverContent != ''"> and fence_recover_content = #{fenceRecoverContent}</if> <if test="fenceRecoverContent != null and fenceRecoverContent != ''"> and hef.fence_recover_content = #{fenceRecoverContent}</if>
<if test="fenceField != null and fenceField != ''"> and fence_field = #{fenceField}</if> <if test="fenceField != null and fenceField != ''"> and hef.fence_field = #{fenceField}</if>
<if test="deviceModeName != null and deviceModeName != ''"> and hef.device_mode_name = #{deviceModeName}</if>
<if test="deviceName != null and deviceName != ''"> and hd.device_name = #{deviceName}</if>
<if test="deviceModeId != null "> and hef.device_mode_id = #{deviceModeId}</if>
<if test="deviceId != null "> and hef.device_id = #{deviceId}</if>
<if test="sceneName != null ">and hs.scene_name = #{sceneName}</if>
</where> </where>
</select> </select>
<select id="selectHwElectronicFenceByElectronicFenceId" parameterType="Long" resultMap="HwElectronicFenceHwFenceTargetResult"> <select id="selectHwElectronicFenceByElectronicFenceId" parameterType="Long" resultMap="HwElectronicFenceHwFenceTargetResult">
select a.electronic_fence_id, a.electronic_fence_name, a.tenant_id, a.scene_id, a.fence_type, a.effective_time_flag, a.time_zone, a.effective_time, a.trigger_status, a.fence_push_flag, a.fence_push_content, a.fence_recover_content, a.remark, a.create_by, a.create_time, a.update_by, a.update_time, a.fence_field, select hef.electronic_fence_id,
b.electronic_fence_id as sub_electronic_fence_id, b.target_type as sub_target_type, b.target_id as sub_target_id hef.electronic_fence_name,
from hw_electronic_fence a hef.tenant_id,
left join hw_fence_target b on b.electronic_fence_id = a.electronic_fence_id hef.scene_id,
where a.electronic_fence_id = #{electronicFenceId} hef.fence_type,
hef.effective_time_flag,
hef.time_zone,
hef.effective_time,
hef.trigger_status,
hef.fence_push_flag,
hef.fence_push_content,
hef.fence_recover_content,
hef.remark,
hef.create_by,
hef.create_time,
hef.update_by,
hef.update_time,
hef.fence_field,
hft.electronic_fence_id as sub_electronic_fence_id,
hft.target_type as sub_target_type,
hft.target_id as sub_target_id,
hd.device_name ,
hef.device_id ,
hef.device_mode_id ,
hs.scene_name,
hdm.device_mode_name
from hw_electronic_fence hef
left join hw_fence_target hft on hft.electronic_fence_id = hef.electronic_fence_id
left join hw_device_mode hdm on hdm.device_mode_id = hef.device_mode_id
left join hw_device hd on hd.device_id = hef.device_id
left join hw_scene hs on hs.scene_id = hef.scene_id
where hef.electronic_fence_id = #{electronicFenceId}
</select> </select>
<insert id="insertHwElectronicFence" parameterType="HwElectronicFence" useGeneratedKeys="true" keyProperty="electronicFenceId"> <insert id="insertHwElectronicFence" parameterType="HwElectronicFence" useGeneratedKeys="true" keyProperty="electronicFenceId">
@ -87,6 +148,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="updateBy != null">update_by,</if> <if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if> <if test="updateTime != null">update_time,</if>
<if test="fenceField != null">fence_field,</if> <if test="fenceField != null">fence_field,</if>
<if test="deviceModeId != null">device_mode_id,</if>
<if test="deviceId != null">device_id,</if>
</trim> </trim>
<trim prefix="values (" suffix=")" suffixOverrides=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="electronicFenceName != null and electronicFenceName != ''">#{electronicFenceName},</if> <if test="electronicFenceName != null and electronicFenceName != ''">#{electronicFenceName},</if>
@ -106,6 +169,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="updateBy != null">#{updateBy},</if> <if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if> <if test="updateTime != null">#{updateTime},</if>
<if test="fenceField != null">#{fenceField},</if> <if test="fenceField != null">#{fenceField},</if>
<if test="deviceModeId != null">device_mode_id,</if>
<if test="deviceId != null">device_id,</if>
</trim> </trim>
</insert> </insert>
@ -129,6 +194,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="updateBy != null">update_by = #{updateBy},</if> <if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if> <if test="updateTime != null">update_time = #{updateTime},</if>
<if test="fenceField != null">fence_field = #{fenceField},</if> <if test="fenceField != null">fence_field = #{fenceField},</if>
<if test="deviceModeId != null">device_mode_id = #{deviceModeId},</if>
<if test="deviceId != null">device_id = #{deviceId},</if>
</trim> </trim>
where electronic_fence_id = #{electronicFenceId} where electronic_fence_id = #{electronicFenceId}
</update> </update>
@ -207,6 +274,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="fencePushContent != null and fencePushContent != ''"> and hef.fence_push_content = #{fencePushContent}</if> <if test="fencePushContent != null and fencePushContent != ''"> and hef.fence_push_content = #{fencePushContent}</if>
<if test="fenceRecoverContent != null and fenceRecoverContent != ''"> and hef.fence_recover_content = #{fenceRecoverContent}</if> <if test="fenceRecoverContent != null and fenceRecoverContent != ''"> and hef.fence_recover_content = #{fenceRecoverContent}</if>
<if test="fenceField != null and fenceField != ''"> and hef.fence_field = #{fenceField}</if> <if test="fenceField != null and fenceField != ''"> and hef.fence_field = #{fenceField}</if>
<if test="deviceModeName != null and deviceModeName != ''"> and hdm.device_model_name like concat('%', #{deviceModeName}, '%')</if>
<if test="deviceName != null and deviceName != ''"> and hd.device_name like concat('%', #{deviceName}, '%')</if>
<if test="deviceId != null "> and hef.device_id = #{deviceId}</if>
<if test="deviceModeId != null "> and hef.device_mode_id = #{deviceModeId}</if>
<!-- 租户数据范围过滤 --> <!-- 租户数据范围过滤 -->
${params.tenantDataScope} ${params.tenantDataScope}
</where> </where>

Loading…
Cancel
Save