277 lines
12 KiB
XML
277 lines
12 KiB
XML
<?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.sercurityControl.proteam.mapper.VideoMapper">
|
|
<!--删除视频诊断数据-->
|
|
<update id="delVideoData">
|
|
UPDATE tb_resource_monitor SET del_flag = '1' WHERE id = #{id}
|
|
</update>
|
|
<!--更新视频诊断数据-->
|
|
<update id="updateVideoData">
|
|
UPDATE tb_resource_monitor SET pro_name = #{proName},team_leader = #{teamLeader},abnormal_detail = #{abnormalDetail},create_date = #{createDate} WHERE id = #{id}
|
|
</update>
|
|
<select id="getMenuListCity" resultType="com.sercurityControl.proteam.domain.DtreeEntity">
|
|
SELECT tcm.id AS id, tcm.build_unit_code AS parentId, tcm.bidding_section_name AS title,
|
|
td.puid AS puid,td.state AS state,'1' AS genre ,
|
|
td.t_name AS tName , td.t_code AS tCode,td.td_code AS tdCode,td.tw_code AS
|
|
twCode,td.pass_way AS passWay
|
|
FROM jj_class_meetting AS tcm
|
|
LEFT JOIN jj_class_metting_info jcmi on jcmi.class_id=tcm.id
|
|
left join jj_ball jb on jb.id=tcm.camera_id2
|
|
LEFT JOIN t_device td ON jb.camera_no = td.t_code AND td.is_flag=0
|
|
WHERE tcm.current_constr_date = CURRENT_DATE
|
|
AND tcm.build_unit_code is not null and tcm.build_unit_code !=''
|
|
and tcm.delete_flag='0'
|
|
AND TO_DAYS(tcm.current_constr_date) = TO_DAYS(now())
|
|
<if test="orgId != null and orgId != ''">
|
|
AND tcm.build_unit_code=#{orgId}
|
|
</if>
|
|
<if test="keyWord != null and keyWord != ''">
|
|
AND (
|
|
tcm.bidding_section_name LIKE CONCAT('%',#{keyWord},'%')
|
|
or jcmi.work_manage LIKE CONCAT('%',#{keyWord},'%')
|
|
or td.t_code LIKE CONCAT('%',#{keyWord},'%')
|
|
or td.mac_id LIKE CONCAT('%',#{keyWord},'%')
|
|
or td.puid LIKE CONCAT('%',#{keyWord},'%')
|
|
)
|
|
</if>
|
|
union All
|
|
|
|
SELECT tcm.id AS id, tcm.build_unit_code AS parentId, tcm.bidding_section_name AS title,
|
|
td.puid AS puid,td.state AS state,'1' AS genre ,
|
|
td.t_name AS tName , td.t_code AS tCode,jb.camera_no AS tdCode,td.tw_code AS
|
|
twCode,td.pass_way AS passWay
|
|
FROM jj_class_meetting AS tcm
|
|
LEFT JOIN jj_class_metting_info jcmi on jcmi.class_id=tcm.id
|
|
left join jj_ball jb on jb.id=tcm.camera_id3
|
|
LEFT JOIN t_device td ON jb.camera_no = td.t_code AND td.is_flag=0
|
|
WHERE tcm.current_constr_date = CURRENT_DATE
|
|
AND tcm.build_unit_code is not null and tcm.build_unit_code !=''
|
|
and tcm.delete_flag='0' and tcm.camera_id3 is not null
|
|
AND TO_DAYS(tcm.current_constr_date) = TO_DAYS(now())
|
|
<if test="orgId != null and orgId != ''">
|
|
AND tcm.build_unit_code=#{orgId}
|
|
</if>
|
|
<if test="keyWord != null and keyWord != ''">
|
|
AND (
|
|
tcm.bidding_section_name LIKE CONCAT('%',#{keyWord},'%')
|
|
or jcmi.work_manage LIKE CONCAT('%',#{keyWord},'%')
|
|
or td.t_code LIKE CONCAT('%',#{keyWord},'%')
|
|
or td.mac_id LIKE CONCAT('%',#{keyWord},'%')
|
|
or td.puid LIKE CONCAT('%',#{keyWord},'%')
|
|
)
|
|
</if>
|
|
union All
|
|
|
|
SELECT tcm.id AS id, tcm.build_unit_code AS parentId, tcm.bidding_section_name AS title,
|
|
td.puid AS puid,td.state AS state,'1' AS genre ,
|
|
td.t_name AS tName , td.t_code AS tCode,jb.camera_no AS tdCode,td.tw_code AS
|
|
twCode,td.pass_way AS passWay
|
|
FROM jj_class_meetting AS tcm
|
|
LEFT JOIN jj_class_metting_info jcmi on jcmi.class_id=tcm.id
|
|
left join jj_ball jb on jb.id=tcm.camera_id4
|
|
LEFT JOIN t_device td ON jb.camera_no = td.t_code AND td.is_flag=0
|
|
WHERE tcm.current_constr_date = CURRENT_DATE
|
|
AND tcm.build_unit_code is not null and tcm.build_unit_code !=''
|
|
and tcm.delete_flag='0' and tcm.camera_id4 is not null
|
|
AND TO_DAYS(tcm.current_constr_date) = TO_DAYS(now())
|
|
<if test="orgId != null and orgId != ''">
|
|
AND tcm.build_unit_code=#{orgId}
|
|
</if>
|
|
<if test="keyWord != null and keyWord != ''">
|
|
AND (
|
|
tcm.bidding_section_name LIKE CONCAT('%',#{keyWord},'%')
|
|
or jcmi.work_manage LIKE CONCAT('%',#{keyWord},'%')
|
|
or td.t_code LIKE CONCAT('%',#{keyWord},'%')
|
|
or td.mac_id LIKE CONCAT('%',#{keyWord},'%')
|
|
or td.puid LIKE CONCAT('%',#{keyWord},'%')
|
|
)
|
|
</if>
|
|
</select>
|
|
<!--查询省外球机 -->
|
|
<select id="getMenuListSWCity" resultType="com.sercurityControl.proteam.domain.DtreeEntity">
|
|
select td.device_name title,td.puid,td.mac_id ,td.gb_code,td.type_code,td.state state,tbt.type_name,tbt.type_code ,'1' AS genre,'0' parentId
|
|
,td.t_name AS tName , td.t_code AS tCode,td.td_code AS tdCode,td.tw_code AS
|
|
twCode,td.pass_way AS passWay
|
|
from t_device td
|
|
left join t_ball_type tbt on tbt.id=td.type_code
|
|
where td.is_flag='0' and tbt.type_code='sw_code'
|
|
<if test="keyWord != null and keyWord != ''">
|
|
AND (
|
|
td.device_name LIKE CONCAT('%',#{keyWord},'%')
|
|
or td.puid LIKE CONCAT('%',#{keyWord},'%')
|
|
or td.mac_id LIKE CONCAT('%',#{keyWord},'%')
|
|
)
|
|
</if>
|
|
ORDER BY td.state desc
|
|
</select>
|
|
<select id="getOrgSelected" resultType="com.sercurityControl.proteam.domain.DtreeEntity">
|
|
select org_id AS id,
|
|
city_name AS title,
|
|
'0' AS parentId,
|
|
'0' AS genre
|
|
from sys_org
|
|
where is_active = 1
|
|
</select>
|
|
<select id="getPerson" resultType="com.sercurityControl.proteam.domain.DtreeEntity">
|
|
SELECT jcmi.team_id AS id, jcmi.work_manage AS title,tcm.id AS
|
|
parentId ,'iconfont icon-renyuan' AS iconClass, '2' AS genre
|
|
FROM jj_class_meetting AS tcm
|
|
LEFT JOIN jj_class_metting_info jcmi on jcmi.class_id=tcm.id
|
|
WHERE tcm.delete_flag='0'
|
|
AND TO_DAYS(tcm.current_constr_date) = TO_DAYS(now())
|
|
<if test="orgId != null and orgId != ''">
|
|
AND tcm.build_unit_code=#{orgId}
|
|
</if>
|
|
<if test="keyWord != null and keyWord != ''">
|
|
AND (tcm.bidding_section_name LIKE CONCAT('%',#{keyWord},'%') or jcmi.work_manage LIKE CONCAT('%',#{keyWord},'%'))
|
|
</if>
|
|
</select>
|
|
|
|
|
|
|
|
<select id="getMenuListRisk" resultType="com.sercurityControl.proteam.domain.DtreeEntity"
|
|
parameterType="java.lang.String">
|
|
SELECT distinct tcm.id AS id, tcm.re_assessment_risk_level AS parentId, tcm.bidding_section_name AS title,
|
|
td.puid ,td.state ,'1' AS genre ,td.t_name tName , td.t_code tCode,td.td_code tdCode,td.tw_code AS
|
|
twCode,td.pass_way AS passWay
|
|
FROM jj_class_meetting AS tcm
|
|
LEFT JOIN jj_class_metting_info jcmi on jcmi.class_id=tcm.id
|
|
left join jj_ball jb on jb.id=tcm.camera_id2
|
|
LEFT JOIN t_device td ON jb.camera_no = td.t_code AND td.is_flag=0
|
|
WHERE tcm.current_constr_date = CURRENT_DATE
|
|
AND tcm.build_unit_code is not null and tcm.build_unit_code !=''
|
|
and tcm.delete_flag='0'
|
|
AND TO_DAYS(tcm.current_constr_date) = TO_DAYS(now())
|
|
<if test="orgId != null and orgId != ''">
|
|
AND tcm.build_unit_code=#{orgId}
|
|
</if>
|
|
<if test="keyWord != null and keyWord != ''">
|
|
or tcm.bidding_section_name LIKE CONCAT('%',#{keyWord},'%') or jcmi.work_manage LIKE CONCAT('%',#{keyWord},'%')
|
|
</if>
|
|
</select>
|
|
|
|
<!-- 根据传入的参数查询下拉选择数据 -->
|
|
<select id="getSelectParams" resultType="com.sercurityControl.proteam.domain.DtreeEntity">
|
|
SELECT sd1.id AS id,
|
|
sd1.`name` AS `title`,
|
|
'0' AS parentId,
|
|
'0' AS genre
|
|
FROM sys_dist sd1
|
|
LEFT JOIN sys_dist sd2 ON sd2.id = sd1.p_id
|
|
WHERE sd2.CODE = 'risk_level'
|
|
</select>
|
|
<select id="getVideoDiagnosis" resultType="com.sercurityControl.proteam.domain.VideoDiagnosis"
|
|
parameterType="com.sercurityControl.proteam.domain.VideoDiagnosis">
|
|
SELECT id AS id,
|
|
tbrm.pro_name AS proName,
|
|
tbrm.team_leader AS teamLeader,
|
|
tbrm.abnormal_detail AS abnormalDetail,
|
|
tbrm.create_date AS createDate
|
|
FROM tb_resource_monitor tbrm
|
|
WHERE tbrm.notice_type = '2'
|
|
AND tbrm.del_flag = '0'
|
|
<if test="keyWord!=null and keyWord!=''">
|
|
AND (
|
|
INSTR(tbrm.pro_name,#{keyWord}) > 0 OR
|
|
INSTR(tbrm.team_leader,#{keyWord}) > 0
|
|
)
|
|
</if>
|
|
<if test="createDate!=null and createDate!=''">
|
|
AND tbrm.create_date = #{createDate}
|
|
</if>
|
|
</select>
|
|
<!--固定球机查询节点-->
|
|
<select id="getMenuListRegular" resultType="com.sercurityControl.proteam.domain.DtreeEntity">
|
|
SELECT
|
|
td.device_name AS title,
|
|
td.gb_code AS puid,
|
|
td.state AS state,
|
|
td.t_name AS tName,
|
|
td.t_code AS tCode,
|
|
td.td_code AS tdCode,
|
|
td.tw_code AS twCode,
|
|
td.pass_way AS passWay
|
|
FROM t_device td
|
|
WHERE (td.device_type = '固定式球机' OR td.device_type = '固定球机') AND td.is_flag = '0' AND INSTR(td.gb_code,'-p') > 0
|
|
UNION ALL
|
|
SELECT
|
|
td.device_name AS title,
|
|
td.gb_code AS puid,
|
|
td.state AS state,
|
|
td.t_name AS tName,
|
|
td.t_code AS tCode,
|
|
td.td_code AS tdCode,
|
|
td.tw_code AS twCode,
|
|
td.pass_way AS passWay
|
|
FROM t_device AS td
|
|
WHERE (td.device_type = '固定式球机' OR td.device_type = '固定球机') AND td.is_flag = '0' AND INSTR(td.gb_code,'-p') = 0 AND INSTR(td.gb_code,'-') > 0
|
|
<if test="keyWord != null and keyWord != ''">
|
|
AND (
|
|
INSTR(td.device_name,#{keyWord}) > 0
|
|
)
|
|
</if>
|
|
</select>
|
|
<!--根据id获取视频诊断数据详情-->
|
|
<select id="getVideoDataById" resultType="com.sercurityControl.proteam.domain.VideoDiagnosis">
|
|
SELECT
|
|
id AS id,
|
|
pro_name AS proName,
|
|
team_leader AS teamLeader,
|
|
abnormal_detail AS abnormalDetail,
|
|
create_date AS createDate
|
|
FROM tb_resource_monitor
|
|
WHERE id = #{id} AND notice_type = '2' AND del_flag = '0'
|
|
</select>
|
|
|
|
<insert id="addVideoData" parameterType="com.sercurityControl.proteam.domain.VideoDiagnosis">
|
|
INSERT INTO tb_resource_monitor
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
<if test="proName !=null and proName !=''">
|
|
pro_name,
|
|
</if>
|
|
<if test="teamLeader !=null and teamLeader !=''">
|
|
team_leader,
|
|
</if>
|
|
<if test="abnormalDetail !=null and abnormalDetail !=''">
|
|
abnormal_detail,
|
|
</if>
|
|
<if test="noticeType !=null and noticeType !=''">
|
|
notice_type,
|
|
</if>
|
|
<if test="createTime !=null and createTime !=''">
|
|
create_time,
|
|
</if>
|
|
<if test="createDate !=null and createDate !=''">
|
|
create_date,
|
|
</if>
|
|
<if test="delFlag !=null and delFlag !=''">
|
|
del_flag,
|
|
</if>
|
|
</trim>
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
<if test="proName !=null and proName !=''">
|
|
#{proName},
|
|
</if>
|
|
<if test="teamLeader !=null and teamLeader !=''">
|
|
#{teamLeader},
|
|
</if>
|
|
<if test="abnormalDetail !=null and abnormalDetail !=''">
|
|
#{abnormalDetail},
|
|
</if>
|
|
<if test="noticeType !=null and noticeType !=''">
|
|
#{noticeType},
|
|
</if>
|
|
<if test="createTime !=null and createTime !=''">
|
|
#{createTime},
|
|
</if>
|
|
<if test="createDate !=null and createDate !=''">
|
|
#{createDate},
|
|
</if>
|
|
<if test="delFlag !=null and delFlag !=''">
|
|
#{delFlag},
|
|
</if>
|
|
</trim>
|
|
</insert>
|
|
</mapper>
|
|
|