|
|
|
@ -0,0 +1,328 @@ |
|
|
|
<?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.inspect.simulator.mapper.BasedataPatrolPointMapper"> |
|
|
|
|
|
|
|
<resultMap type="com.inspect.simulator.domain.result.BasedataPatrolPoint" id="BasedataPatrolPointResult"> |
|
|
|
<result property="patrolPointId" column="patrol_point_id"/> |
|
|
|
<result property="patrolPointCode" column="patrol_point_code"/> |
|
|
|
<result property="patrolPointName" column="patrol_point_name"/> |
|
|
|
<result property="deviceTypeId" column="device_type_id"/> |
|
|
|
<result property="mainDeviceId" column="main_device_id"/> |
|
|
|
<result property="deviceId" column="device_id"/> |
|
|
|
<result property="patrolContent" column="patrol_content"/> |
|
|
|
<result property="purpose" column="purpose"/> |
|
|
|
<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="deleteFlag" column="delete_flag"/> |
|
|
|
<result property="stdParolPointId" column="std_parol_point_id"/> |
|
|
|
<result property="areaId" column="area_id"/> |
|
|
|
<result property="pointImptLevel" column="point_impt_level"/> |
|
|
|
<result property="patrolTypeId" column="patrol_type_id"/> |
|
|
|
<result property="alarmThreshold" column="alarm_threshold"/> |
|
|
|
<result property="algSubtypeId" column="alg_subtype_id"/> |
|
|
|
<result property="algSubtypeName" column="alg_subtype_name"/> |
|
|
|
<result property="lowerValue" column="lower_value"/> |
|
|
|
<result property="upperValue" column="upper_value"/> |
|
|
|
<result property="positionX" column="position_x"/> |
|
|
|
<result property="positionY" column="position_y"/> |
|
|
|
<result property="positionZ" column="position_z"/> |
|
|
|
<result property="algSubtypeIds" column="alg_subtype_ids"/> |
|
|
|
<result property="originalAlgSubtypeIds" column="original_alg_subtype_ids"/> |
|
|
|
<result property="originalDeviceId" column="original_device_id"/> |
|
|
|
<result property="disRefPicturePath" column="dis_ref_picture_path"/> |
|
|
|
<result property="originalMainDeviceId" column="original_main_device_id"/> |
|
|
|
<result property="meterType" column="meter_type"/> |
|
|
|
</resultMap> |
|
|
|
|
|
|
|
<sql id="selectBasedataPatrolPointVo"> |
|
|
|
select patrol_point_id, |
|
|
|
patrol_point_code, |
|
|
|
patrol_point_name, |
|
|
|
device_type_id, |
|
|
|
main_device_id, |
|
|
|
device_id, |
|
|
|
area_id, |
|
|
|
patrol_content, |
|
|
|
purpose, |
|
|
|
create_by, |
|
|
|
create_time, |
|
|
|
update_by, |
|
|
|
update_time, |
|
|
|
delete_flag, |
|
|
|
std_parol_point_id, |
|
|
|
point_impt_level, |
|
|
|
patrol_type_id, |
|
|
|
lower_value, |
|
|
|
upper_value, |
|
|
|
position_x, |
|
|
|
position_y, |
|
|
|
position_z, |
|
|
|
alg_subtype_ids, |
|
|
|
original_alg_subtype_ids, |
|
|
|
original_device_id, |
|
|
|
dis_ref_picture_path, |
|
|
|
original_main_device_id, |
|
|
|
alarm_threshold, |
|
|
|
meter_type |
|
|
|
from basedata_patrolpoint |
|
|
|
</sql> |
|
|
|
|
|
|
|
<select id="selectBasedataPatrolPointList" parameterType="com.inspect.simulator.domain.result.BasedataPatrolPoint" |
|
|
|
resultMap="BasedataPatrolPointResult"> |
|
|
|
<include refid="selectBasedataPatrolPointVo"/> |
|
|
|
<where> |
|
|
|
<if test="patrolPointCode != null and patrolPointCode != ''">and patrol_point_code = #{patrolPointCode}</if> |
|
|
|
<if test="patrolPointName != null and patrolPointName != ''">and patrol_point_name like concat('%', |
|
|
|
#{patrolPointName}, '%') |
|
|
|
</if> |
|
|
|
<if test="deviceTypeId != null ">and device_type_id = #{deviceTypeId}</if> |
|
|
|
<if test="mainDeviceId != null ">and main_device_id = #{mainDeviceId}</if> |
|
|
|
<if test="deviceId != null ">and device_id = #{deviceId}</if> |
|
|
|
<if test="areaId != null ">and area_id = #{areaId}</if> |
|
|
|
<if test="patrolContent != null and patrolContent != ''">and patrol_content = #{patrolContent}</if> |
|
|
|
<if test="purpose != null and purpose != ''">and purpose = #{purpose}</if> |
|
|
|
<if test="deleteFlag != null and deleteFlag != ''">and delete_flag = #{deleteFlag}</if> |
|
|
|
<if test="stdParolPointId != null ">and std_parol_point_id = #{stdParolPointId}</if> |
|
|
|
<if test="pointImptLevel != null and pointImptLevel != ''">and point_impt_level = #{pointImptLevel}</if> |
|
|
|
<if test="patrolTypeId != null and patrolTypeId != ''">and patrol_type_id = #{patrolTypeId}</if> |
|
|
|
<if test="lowerValue != null and lowerValue != ''">and lower_value = #{lowerValue}</if> |
|
|
|
<if test="upperValue != null and upperValue != ''">and upper_value = #{upperValue}</if> |
|
|
|
<if test="positionX != null and positionX != ''">and position_x = #{positionX}</if> |
|
|
|
<if test="positionY != null and positionY != ''">and position_y = #{positionY}</if> |
|
|
|
<if test="positionZ != null and positionZ != ''">and position_z = #{positionZ}</if> |
|
|
|
<if test="algSubtypeIds != null and algSubtypeIds != ''">and alg_subtype_ids = #{algSubtypeIds}</if> |
|
|
|
<if test="originalAlgSubtypeIds != null and originalAlgSubtypeIds != ''">and original_alg_subtype_ids = |
|
|
|
#{originalAlgSubtypeIds} |
|
|
|
</if> |
|
|
|
<if test="originalDeviceId != null and originalDeviceId != ''">and original_device_id = |
|
|
|
#{originalDeviceId} |
|
|
|
</if> |
|
|
|
<if test="disRefPicturePath != null and disRefPicturePath != ''">and dis_ref_picture_path = |
|
|
|
#{disRefPicturePath} |
|
|
|
</if> |
|
|
|
<if test="originalMainDeviceId != null and originalMainDeviceId != ''">and original_main_device_id = |
|
|
|
#{originalMainDeviceId} |
|
|
|
</if> |
|
|
|
<if test="alarmThreshold != null and alarmThreshold != ''">and alarm_threshold = #{alarmThreshold}</if> |
|
|
|
<if test="meterType != null and meterType != ''">and meter_type = #{meterType}</if> |
|
|
|
<if test="params != null"> |
|
|
|
<if test="params.ids != null and params.ids != ''"> |
|
|
|
and patrol_point_id in |
|
|
|
<foreach item="item" collection="ids" open="(" separator="," close=")"> |
|
|
|
#{item} |
|
|
|
</foreach> |
|
|
|
</if> |
|
|
|
</if> |
|
|
|
</where> |
|
|
|
</select> |
|
|
|
|
|
|
|
<select id="selectBasedataPatrolPointListLikePointCode" parameterType="com.inspect.simulator.domain.result.BasedataPatrolPoint" |
|
|
|
resultMap="BasedataPatrolPointResult"> |
|
|
|
<include refid="selectBasedataPatrolPointVo"/> |
|
|
|
<where> |
|
|
|
<if test="patrolPointCode != null and patrolPointCode != ''">and patrol_point_code like concat('%', #{patrolPointCode}, '%')</if> |
|
|
|
</where> |
|
|
|
</select> |
|
|
|
|
|
|
|
<select id="selectBasedataMonitorList" parameterType="com.inspect.simulator.domain.result.BasedataPatrolPoint" resultMap="BasedataPatrolPointResult"> |
|
|
|
-- select a.patrol_point_id, a.patrol_point_code,a.area_id, a.patrol_point_name, a.main_device_id, a.device_id, |
|
|
|
-- left join basedata_stdpatrol_point b on a.std_parol_point_id = b.std_patrol_point_id |
|
|
|
SELECT |
|
|
|
a.patrol_point_id, |
|
|
|
a.patrol_point_code, |
|
|
|
a.area_id, |
|
|
|
a.patrol_point_name, |
|
|
|
a.main_device_id, |
|
|
|
a.device_id, |
|
|
|
a.patrol_content, |
|
|
|
a.purpose, |
|
|
|
a.std_parol_point_id, |
|
|
|
a.upper_value, |
|
|
|
a.lower_value, |
|
|
|
a.alg_subtype_ids, |
|
|
|
a.point_impt_level, |
|
|
|
a.patrol_type_id, |
|
|
|
a.position_x, |
|
|
|
a.position_y, |
|
|
|
a.position_z, |
|
|
|
a.dis_ref_picture_path, |
|
|
|
a.alarm_threshold |
|
|
|
FROM |
|
|
|
basedata_patrolpoint a |
|
|
|
<where> |
|
|
|
<if test="patrolPointName != null and patrolPointName != ''">and a.patrol_point_name like concat('%', |
|
|
|
#{patrolPointName}, '%') |
|
|
|
</if> |
|
|
|
<if test="mainDeviceId != null ">and a.main_device_id = #{mainDeviceId}</if> |
|
|
|
<if test="deviceId != null ">and a.device_id = #{deviceId}</if> |
|
|
|
<if test="areaId != null ">and a.area_id = #{areaId}</if> |
|
|
|
<if test="pointImptLevel != null and pointImptLevel != ''">and a.point_impt_level = #{pointImptLevel}</if> |
|
|
|
<if test="patrolTypeId != null and patrolTypeId != ''">and a.patrol_type_id = #{patrolTypeId}</if> |
|
|
|
</where> |
|
|
|
</select> |
|
|
|
<select id="selectBasedataMonitorUnionList" parameterType="com.inspect.simulator.domain.result.BasedataPatrolPoint" |
|
|
|
resultMap="BasedataPatrolPointResult"> |
|
|
|
select a.area_id, |
|
|
|
a.std_patrol_point_name as patrol_point_name, |
|
|
|
#{deviceId} as device_id, |
|
|
|
a.patrol_content, |
|
|
|
b.dict_label as purpose, |
|
|
|
a.std_patrol_point_id as std_parol_point_id, |
|
|
|
a.alg_subtype_ids, |
|
|
|
a.alarm_threshold |
|
|
|
from basedata_stdpatrol_point a |
|
|
|
left join sys_dict_data b on b.dict_type = 'data_format' and a.data_format = b.dict_value |
|
|
|
where a.component_device_type_id = #{deviceTypeId} |
|
|
|
|
|
|
|
</select> |
|
|
|
<select id="selectPresetPosByPatrolPointId" parameterType="String" resultType="int"> |
|
|
|
select count(1) from patrol_preset_pos |
|
|
|
where patrol_point_id in |
|
|
|
<foreach item="patrolPointId" collection="array" open="(" separator="," close=")"> |
|
|
|
#{patrolPointId} |
|
|
|
</foreach> |
|
|
|
</select> |
|
|
|
<select id="selectBasedataPatrolPointByPatrolPointId" parameterType="Long" resultMap="BasedataPatrolPointResult"> |
|
|
|
<include refid="selectBasedataPatrolPointVo"/> |
|
|
|
where patrol_point_id = #{patrolPointId} |
|
|
|
</select> |
|
|
|
|
|
|
|
<select id="selectBasedataPatrolPointPresetForOne" parameterType="com.inspect.simulator.domain.result.BasedataPatrolPoint" |
|
|
|
resultMap="BasedataPatrolPointResult"> |
|
|
|
SELECT |
|
|
|
a.patrol_point_id, |
|
|
|
a.patrol_point_code, |
|
|
|
a.area_id, |
|
|
|
a.patrol_point_name, |
|
|
|
a.main_device_id, |
|
|
|
a.device_id |
|
|
|
FROM |
|
|
|
basedata_patrolpoint a, |
|
|
|
basedata_patrolpoint_preset b |
|
|
|
<where> |
|
|
|
a.patrol_point_id = b.patrol_point_id |
|
|
|
<if test="patrolPointId != null ">and a.patrol_point_id = #{patrolPointId}</if> |
|
|
|
<if test="mainDeviceId != null ">and a.main_device_id = #{mainDeviceId}</if> |
|
|
|
<if test="deviceId != null ">and a.device_id = #{deviceId}</if> |
|
|
|
<if test="areaId != null ">and a.area_id = #{areaId}</if> |
|
|
|
</where> |
|
|
|
limit 1 |
|
|
|
</select> |
|
|
|
<insert id="insertBasedataPatrolPoint" parameterType="com.inspect.simulator.domain.result.BasedataPatrolPoint" useGeneratedKeys="true" |
|
|
|
keyProperty="patrolPointId"> |
|
|
|
insert into basedata_patrolpoint |
|
|
|
<trim prefix="(" suffix=")" suffixOverrides=","> |
|
|
|
<if test="patrolPointCode != null">patrol_point_code,</if> |
|
|
|
<if test="patrolPointName != null and patrolPointName != ''">patrol_point_name,</if> |
|
|
|
<if test="deviceTypeId != null">device_type_id,</if> |
|
|
|
<if test="mainDeviceId != null">main_device_id,</if> |
|
|
|
<if test="deviceId != null">device_id,</if> |
|
|
|
<if test="areaId != null">area_id,</if> |
|
|
|
<if test="patrolContent != null">patrol_content,</if> |
|
|
|
<if test="purpose != null">purpose,</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="deleteFlag != null">delete_flag,</if> |
|
|
|
<if test="stdParolPointId != null">std_parol_point_id,</if> |
|
|
|
<if test="pointImptLevel != null and pointImptLevel != ''">point_impt_level,</if> |
|
|
|
<if test="patrolTypeId != null and patrolTypeId != ''">patrol_type_id,</if> |
|
|
|
<if test="lowerValue != null and lowerValue != ''">lower_value,</if> |
|
|
|
<if test="upperValue != null and upperValue != ''">upper_value,</if> |
|
|
|
<if test="positionX != null">position_x,</if> |
|
|
|
<if test="positionY != null">position_y,</if> |
|
|
|
<if test="positionZ != null">position_z,</if> |
|
|
|
<if test="algSubtypeIds != null">alg_subtype_ids,</if> |
|
|
|
<if test="originalAlgSubtypeIds != null">original_alg_subtype_ids,</if> |
|
|
|
<if test="originalDeviceId != null">original_device_id,</if> |
|
|
|
<if test="disRefPicturePath != null">dis_ref_picture_path,</if> |
|
|
|
<if test="originalMainDeviceId != null">original_main_device_id,</if> |
|
|
|
<if test="alarmThreshold != null">alarm_threshold,</if> |
|
|
|
<if test="meterType != null">meter_type,</if> |
|
|
|
</trim> |
|
|
|
<trim prefix="values (" suffix=")" suffixOverrides=","> |
|
|
|
<if test="patrolPointCode != null">#{patrolPointCode},</if> |
|
|
|
<if test="patrolPointName != null and patrolPointName != ''">#{patrolPointName},</if> |
|
|
|
<if test="deviceTypeId != null">#{deviceTypeId},</if> |
|
|
|
<if test="mainDeviceId != null">#{mainDeviceId},</if> |
|
|
|
<if test="deviceId != null">#{deviceId},</if> |
|
|
|
<if test="areaId != null">#{areaId},</if> |
|
|
|
<if test="patrolContent != null">#{patrolContent},</if> |
|
|
|
<if test="purpose != null">#{purpose},</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="deleteFlag != null">#{deleteFlag},</if> |
|
|
|
<if test="stdParolPointId != null">#{stdParolPointId},</if> |
|
|
|
<if test="pointImptLevel != null and pointImptLevel != ''">#{pointImptLevel},</if> |
|
|
|
<if test="patrolTypeId != null and patrolTypeId != ''">#{patrolTypeId},</if> |
|
|
|
<if test="lowerValue != null and lowerValue != ''">#{lowerValue},</if> |
|
|
|
<if test="upperValue != null and upperValue != ''">#{upperValue},</if> |
|
|
|
<if test="positionX != null">#{positionX},</if> |
|
|
|
<if test="positionY != null">#{positionY},</if> |
|
|
|
<if test="positionZ != null">#{positionZ},</if> |
|
|
|
<if test="algSubtypeIds != null">#{algSubtypeIds},</if> |
|
|
|
<if test="originalAlgSubtypeIds != null">#{originalAlgSubtypeIds},</if> |
|
|
|
<if test="originalDeviceId != null">#{originalDeviceId},</if> |
|
|
|
<if test="disRefPicturePath != null">#{disRefPicturePath},</if> |
|
|
|
<if test="originalMainDeviceId != null">#{originalMainDeviceId},</if> |
|
|
|
<if test="alarmThreshold != null">#{alarmThreshold},</if> |
|
|
|
<if test="meterType != null">#{meterType},</if> |
|
|
|
</trim> |
|
|
|
</insert> |
|
|
|
|
|
|
|
<update id="updateBasedataPatrolPoint" parameterType="com.inspect.simulator.domain.result.BasedataPatrolPoint"> |
|
|
|
update basedata_patrolpoint |
|
|
|
<trim prefix="SET" suffixOverrides=","> |
|
|
|
<if test="patrolPointCode != null">patrol_point_code = #{patrolPointCode},</if> |
|
|
|
<if test="patrolPointName != null and patrolPointName != ''">patrol_point_name = #{patrolPointName},</if> |
|
|
|
<if test="deviceTypeId != null">device_type_id = #{deviceTypeId},</if> |
|
|
|
<if test="mainDeviceId != null">main_device_id = #{mainDeviceId},</if> |
|
|
|
<if test="deviceId != null">device_id = #{deviceId},</if> |
|
|
|
<if test="areaId != null">area_id = #{areaId},</if> |
|
|
|
<if test="patrolContent != null">patrol_content = #{patrolContent},</if> |
|
|
|
<if test="purpose != null">purpose = #{purpose},</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="deleteFlag != null">delete_flag = #{deleteFlag},</if> |
|
|
|
<if test="stdParolPointId != null">std_parol_point_id = #{stdParolPointId},</if> |
|
|
|
<if test="pointImptLevel != null and pointImptLevel != ''">point_impt_level = #{pointImptLevel},</if> |
|
|
|
<if test="patrolTypeId != null and patrolTypeId != ''">patrol_type_id = #{patrolTypeId},</if> |
|
|
|
<if test="upperValue != null and upperValue != ''">upper_value = #{upperValue},</if> |
|
|
|
<if test="lowerValue != null and lowerValue != ''">lower_value = #{lowerValue},</if> |
|
|
|
<if test="positionX != null">position_x = #{positionX},</if> |
|
|
|
<if test="positionY != null">position_y = #{positionY},</if> |
|
|
|
<if test="positionZ != null">position_z = #{positionZ},</if> |
|
|
|
<if test="algSubtypeIds != null">alg_subtype_ids = #{algSubtypeIds},</if> |
|
|
|
<if test="originalAlgSubtypeIds != null">original_alg_subtype_ids = #{originalAlgSubtypeIds},</if> |
|
|
|
<if test="originalDeviceId != null">original_device_id = #{originalDeviceId},</if> |
|
|
|
<if test="disRefPicturePath != null">dis_ref_picture_path = #{disRefPicturePath},</if> |
|
|
|
<if test="originalMainDeviceId != null">original_main_device_id = #{originalMainDeviceId},</if> |
|
|
|
<if test="alarmThreshold != null">alarm_threshold = #{alarmThreshold},</if> |
|
|
|
<if test="meterType != null">meter_type = #{meterType},</if> |
|
|
|
</trim> |
|
|
|
where patrol_point_id = #{patrolPointId} |
|
|
|
</update> |
|
|
|
|
|
|
|
<delete id="deleteBasedataPatrolPointByPatrolPointId" parameterType="Long"> |
|
|
|
delete |
|
|
|
from basedata_patrolpoint |
|
|
|
where patrol_point_id = #{patrolPointId} |
|
|
|
</delete> |
|
|
|
|
|
|
|
<delete id="deleteBasedataPatrolPointByPatrolPointIds" parameterType="String"> |
|
|
|
delete from basedata_patrolpoint where patrol_point_id in |
|
|
|
<foreach item="patrolPointId" collection="array" open="(" separator="," close=")"> |
|
|
|
#{patrolPointId} |
|
|
|
</foreach> |
|
|
|
</delete> |
|
|
|
|
|
|
|
</mapper> |