2025-03-16 23:29:04 +08:00
<?xml version="1.0" encoding="UTF-8" ?>
< !DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace= "com.yanzhu.device.mapper.DevTowerDataLocalMapper" >
<resultMap type= "DevTowerDataLocal" id= "DevTowerDataLocalResult" >
<result property= "id" column= "id" />
<result property= "cfgId" column= "cfg_id" />
<result property= "projectId" column= "project_id" />
<result property= "projectName" column= "projectName" />
<result property= "comId" column= "com_id" />
<result property= "comName" column= "com_name" />
2025-03-22 19:04:33 +08:00
<result property= "deptId" column= "dept_id" />
<result property= "deptName" column= "dept_name" />
2025-03-16 23:29:04 +08:00
<result property= "deviceKey" column= "device_key" />
<result property= "deviceSource" column= "device_source" />
<result property= "towerId" column= "tower_id" />
<result property= "rangeNearEndAdValue" column= "range_near_end_ad_value" />
<result property= "rangeNearEndRealityValue" column= "range_near_end_reality_value" />
<result property= "rangeFarEndAdValue" column= "range_far_end_ad_value" />
<result property= "rangeFarEndRealityValue" column= "range_far_end_reality_value" />
<result property= "highNearEndAdValue" column= "high_near_end_ad_value" />
<result property= "highNearEndRealityValue" column= "high_near_end_reality_value" />
<result property= "highFarEndAdValue" column= "high_far_end_ad_value" />
<result property= "highFarEndRealityValue" column= "high_far_end_reality_value" />
<result property= "emptyWeightAdValue" column= "empty_weight_ad_value" />
<result property= "emptyWeightRealityValue" column= "empty_weight_reality_value" />
<result property= "loadWeightAdValue" column= "load_weight_ad_value" />
<result property= "loadWeightRealityValue" column= "load_weight_reality_value" />
<result property= "rotationStartAdValue" column= "rotation_start_ad_value" />
<result property= "rotationStartRealityValue" column= "rotation_start_reality_value" />
<result property= "rotationEndAdValue" column= "rotation_end_ad_value" />
<result property= "rotationEndRealityValue" column= "rotation_end_reality_value" />
<result property= "windSpeedFactor" column= "wind_speed_factor" />
<result property= "tiltFactor" column= "tilt_factor" />
<result property= "isDel" column= "is_del" />
<result property= "createBy" column= "create_by" />
<result property= "createTime" column= "create_time" />
<result property= "updateBy" column= "update_by" />
<result property= "updateTime" column= "update_time" />
<result property= "remark" column= "remark" />
</resultMap>
<sql id= "selectDevTowerDataLocalVo" >
select dtdl.id,
dtdl.cfg_id,
dtdl.project_id,
dtdl.com_id,
sp.dept_name projectName,
2025-03-22 19:04:33 +08:00
sd.dept_name com_name,dtdl.dept_id,pd.sub_dept_name dept_name,
2025-03-16 23:29:04 +08:00
dtdl.device_key,
dtdl.device_source,
dtdl.tower_id,
dtdl.range_near_end_ad_value,
dtdl.range_near_end_reality_value,
dtdl.range_far_end_ad_value,
dtdl.range_far_end_reality_value,
dtdl.high_near_end_ad_value,
dtdl.high_near_end_reality_value,
dtdl.high_far_end_ad_value,
dtdl.high_far_end_reality_value,
dtdl.empty_weight_ad_value,
dtdl.empty_weight_reality_value,
dtdl.load_weight_ad_value,
dtdl.load_weight_reality_value,
dtdl.rotation_start_ad_value,
dtdl.rotation_start_reality_value,
dtdl.rotation_end_ad_value,
dtdl.rotation_end_reality_value,
dtdl.wind_speed_factor,
dtdl.tilt_factor,
dtdl.is_del,
dtdl.create_by,
dtdl.create_time,
dtdl.update_by,
dtdl.update_time,
dtdl.remark
from dev_tower_data_local dtdl
left join sys_dept sp on sp.dept_id = dtdl.project_id
left join sys_dept sd on sd.dept_id = dtdl.com_id
2025-03-22 19:04:33 +08:00
left join pro_project_info_subdepts pd on pd.id=dtdl.dept_id
2025-03-16 23:29:04 +08:00
</sql>
<select id= "selectDevTowerDataLocalList" parameterType= "DevTowerDataLocal" resultMap= "DevTowerDataLocalResult" >
<include refid= "selectDevTowerDataLocalVo" />
<where >
<if test= "cfgId != null" > and dtdl.cfg_id = #{cfgId}</if>
<if test= "projectId != null " > and dtdl.project_id = #{projectId}</if>
<if test= "comId != null " > and dtdl.com_id = #{comId}</if>
2025-03-22 19:04:33 +08:00
<if test= "deptId != null " > and dtdl.dept_id = #{deptId}</if>
2025-03-16 23:29:04 +08:00
<if test= "projectName != null and projectName != ''" > and dtdl.project_id in (select spv.dept_id from sys_dept spv where spv.dept_name like concat('%', #{projectName}, '%'))</if>
<if test= "comName != null and comName != ''" > and dtdl.dept_id in (select sdv.dept_id from sys_dept sdv where sdv.dept_name like concat('%', #{comName}, '%'))</if>
<if test= "deviceKey != null and deviceKey != ''" > and dtdl.device_key = #{deviceKey}</if>
<if test= "deviceSource != null and deviceSource != ''" > and dtdl.device_source = #{deviceSource}</if>
<if test= "towerId != null and towerId != ''" > and dtdl.tower_id = #{towerId}</if>
<if test= "params.beginCreateTime != null and params.beginCreateTime != '' and params.endCreateTime != null and params.endCreateTime != ''" > and dtdl.create_time between #{params.beginCreateTime} and #{params.endCreateTime}</if>
</where>
order by dtdl.id desc
</select>
<select id= "selectDevTowerDataLocalById" parameterType= "Long" resultMap= "DevTowerDataLocalResult" >
<include refid= "selectDevTowerDataLocalVo" />
where dtdl.id = #{id}
</select>
<insert id= "insertDevTowerDataLocal" parameterType= "DevTowerDataLocal" useGeneratedKeys= "true" keyProperty= "id" >
insert into dev_tower_data_local
<trim prefix= "(" suffix= ")" suffixOverrides= "," >
<if test= "cfgId != null" > cfg_id,</if>
<if test= "projectId != null" > project_id,</if>
<if test= "comId != null" > com_id,</if>
2025-03-22 19:04:33 +08:00
<if test= "deptId != null" > dept_id,</if>
2025-03-16 23:29:04 +08:00
<if test= "deviceKey != null" > device_key,</if>
<if test= "deviceSource != null" > device_source,</if>
<if test= "towerId != null" > tower_id,</if>
<if test= "rangeNearEndAdValue != null" > range_near_end_ad_value,</if>
<if test= "rangeNearEndRealityValue != null" > range_near_end_reality_value,</if>
<if test= "rangeFarEndAdValue != null" > range_far_end_ad_value,</if>
<if test= "rangeFarEndRealityValue != null" > range_far_end_reality_value,</if>
<if test= "highNearEndAdValue != null" > high_near_end_ad_value,</if>
<if test= "highNearEndRealityValue != null" > high_near_end_reality_value,</if>
<if test= "highFarEndAdValue != null" > high_far_end_ad_value,</if>
<if test= "highFarEndRealityValue != null" > high_far_end_reality_value,</if>
<if test= "emptyWeightAdValue != null" > empty_weight_ad_value,</if>
<if test= "emptyWeightRealityValue != null" > empty_weight_reality_value,</if>
<if test= "loadWeightAdValue != null" > load_weight_ad_value,</if>
<if test= "loadWeightRealityValue != null" > load_weight_reality_value,</if>
<if test= "rotationStartAdValue != null" > rotation_start_ad_value,</if>
<if test= "rotationStartRealityValue != null" > rotation_start_reality_value,</if>
<if test= "rotationEndAdValue != null" > rotation_end_ad_value,</if>
<if test= "rotationEndRealityValue != null" > rotation_end_reality_value,</if>
<if test= "windSpeedFactor != null" > wind_speed_factor,</if>
<if test= "tiltFactor != null" > tilt_factor,</if>
<if test= "isDel != null" > is_del,</if>
<if test= "createBy != null" > create_by,</if>
<if test= "createTime != null" > create_time,</if>
<if test= "updateBy != null" > update_by,</if>
<if test= "updateTime != null" > update_time,</if>
<if test= "remark != null" > remark,</if>
</trim>
<trim prefix= "values (" suffix= ")" suffixOverrides= "," >
<if test= "cfgId != null" > #{cfgId},</if>
<if test= "projectId != null" > #{projectId},</if>
<if test= "comId != null" > #{comId},</if>
2025-03-22 19:04:33 +08:00
<if test= "deptId != null" > #{deptId},</if>
2025-03-16 23:29:04 +08:00
<if test= "deviceKey != null" > #{deviceKey},</if>
<if test= "deviceSource != null" > #{deviceSource},</if>
<if test= "towerId != null" > #{towerId},</if>
<if test= "rangeNearEndAdValue != null" > #{rangeNearEndAdValue},</if>
<if test= "rangeNearEndRealityValue != null" > #{rangeNearEndRealityValue},</if>
<if test= "rangeFarEndAdValue != null" > #{rangeFarEndAdValue},</if>
<if test= "rangeFarEndRealityValue != null" > #{rangeFarEndRealityValue},</if>
<if test= "highNearEndAdValue != null" > #{highNearEndAdValue},</if>
<if test= "highNearEndRealityValue != null" > #{highNearEndRealityValue},</if>
<if test= "highFarEndAdValue != null" > #{highFarEndAdValue},</if>
<if test= "highFarEndRealityValue != null" > #{highFarEndRealityValue},</if>
<if test= "emptyWeightAdValue != null" > #{emptyWeightAdValue},</if>
<if test= "emptyWeightRealityValue != null" > #{emptyWeightRealityValue},</if>
<if test= "loadWeightAdValue != null" > #{loadWeightAdValue},</if>
<if test= "loadWeightRealityValue != null" > #{loadWeightRealityValue},</if>
<if test= "rotationStartAdValue != null" > #{rotationStartAdValue},</if>
<if test= "rotationStartRealityValue != null" > #{rotationStartRealityValue},</if>
<if test= "rotationEndAdValue != null" > #{rotationEndAdValue},</if>
<if test= "rotationEndRealityValue != null" > #{rotationEndRealityValue},</if>
<if test= "windSpeedFactor != null" > #{windSpeedFactor},</if>
<if test= "tiltFactor != null" > #{tiltFactor},</if>
<if test= "isDel != null" > #{isDel},</if>
<if test= "createBy != null" > #{createBy},</if>
<if test= "createTime != null" > #{createTime},</if>
<if test= "updateBy != null" > #{updateBy},</if>
<if test= "updateTime != null" > #{updateTime},</if>
<if test= "remark != null" > #{remark},</if>
</trim>
</insert>
<update id= "updateDevTowerDataLocal" parameterType= "DevTowerDataLocal" >
update dev_tower_data_local
<trim prefix= "SET" suffixOverrides= "," >
<if test= "cfgId != null" > cfg_id = #{cfgId},</if>
<if test= "projectId != null" > project_id = #{projectId},</if>
<if test= "comId != null" > com_id = #{comId},</if>
2025-03-22 19:04:33 +08:00
<if test= "deptId != null" > dept_id = #{deptId},</if>
2025-03-16 23:29:04 +08:00
<if test= "deviceKey != null" > device_key = #{deviceKey},</if>
<if test= "deviceSource != null" > device_source = #{deviceSource},</if>
<if test= "towerId != null" > tower_id = #{towerId},</if>
<if test= "rangeNearEndAdValue != null" > range_near_end_ad_value = #{rangeNearEndAdValue},</if>
<if test= "rangeNearEndRealityValue != null" > range_near_end_reality_value = #{rangeNearEndRealityValue},</if>
<if test= "rangeFarEndAdValue != null" > range_far_end_ad_value = #{rangeFarEndAdValue},</if>
<if test= "rangeFarEndRealityValue != null" > range_far_end_reality_value = #{rangeFarEndRealityValue},</if>
<if test= "highNearEndAdValue != null" > high_near_end_ad_value = #{highNearEndAdValue},</if>
<if test= "highNearEndRealityValue != null" > high_near_end_reality_value = #{highNearEndRealityValue},</if>
<if test= "highFarEndAdValue != null" > high_far_end_ad_value = #{highFarEndAdValue},</if>
<if test= "highFarEndRealityValue != null" > high_far_end_reality_value = #{highFarEndRealityValue},</if>
<if test= "emptyWeightAdValue != null" > empty_weight_ad_value = #{emptyWeightAdValue},</if>
<if test= "emptyWeightRealityValue != null" > empty_weight_reality_value = #{emptyWeightRealityValue},</if>
<if test= "loadWeightAdValue != null" > load_weight_ad_value = #{loadWeightAdValue},</if>
<if test= "loadWeightRealityValue != null" > load_weight_reality_value = #{loadWeightRealityValue},</if>
<if test= "rotationStartAdValue != null" > rotation_start_ad_value = #{rotationStartAdValue},</if>
<if test= "rotationStartRealityValue != null" > rotation_start_reality_value = #{rotationStartRealityValue},</if>
<if test= "rotationEndAdValue != null" > rotation_end_ad_value = #{rotationEndAdValue},</if>
<if test= "rotationEndRealityValue != null" > rotation_end_reality_value = #{rotationEndRealityValue},</if>
<if test= "windSpeedFactor != null" > wind_speed_factor = #{windSpeedFactor},</if>
<if test= "tiltFactor != null" > tilt_factor = #{tiltFactor},</if>
<if test= "isDel != null" > is_del = #{isDel},</if>
<if test= "createBy != null" > create_by = #{createBy},</if>
<if test= "createTime != null" > create_time = #{createTime},</if>
<if test= "updateBy != null" > update_by = #{updateBy},</if>
<if test= "updateTime != null" > update_time = #{updateTime},</if>
<if test= "remark != null" > remark = #{remark},</if>
</trim>
where id = #{id}
</update>
<delete id= "deleteDevTowerDataLocalById" parameterType= "Long" >
delete from dev_tower_data_local where id = #{id}
</delete>
<delete id= "deleteDevTowerDataLocalByIds" parameterType= "String" >
delete from dev_tower_data_local where id in
<foreach item= "id" collection= "array" open= "(" separator= "," close= ")" >
#{id}
</foreach>
</delete>
</mapper>