187 lines
7.2 KiB
XML
187 lines
7.2 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.securitycontrol.system.mapper.ISelectMapper">
|
||
|
|
|
||
|
|
<!--组织机构树-->
|
||
|
|
<select id="getOrgTree" resultType="com.securitycontrol.entity.system.vo.TreeNode">
|
||
|
|
SELECT org_id AS id,
|
||
|
|
p_id AS parentId,
|
||
|
|
org_name AS label
|
||
|
|
FROM sys_org
|
||
|
|
WHERE del_flag = 0
|
||
|
|
</select>
|
||
|
|
<!--角色下拉选-->
|
||
|
|
<select id="getRoleLists" resultType="com.securitycontrol.entity.system.vo.SelectVo">
|
||
|
|
SELECT role_id AS id,
|
||
|
|
role_name AS name
|
||
|
|
FROM sys_role
|
||
|
|
WHERE del_flag = 0
|
||
|
|
ORDER BY role_sort
|
||
|
|
</select>
|
||
|
|
<!--菜单树-->
|
||
|
|
<select id="getMenuTree" resultType="com.securitycontrol.entity.system.vo.TreeNode">
|
||
|
|
SELECT menu_id AS id,
|
||
|
|
p_id AS parentId,
|
||
|
|
menu_name AS label,
|
||
|
|
menu_type AS level
|
||
|
|
FROM sys_menu
|
||
|
|
WHERE del_flag = 0
|
||
|
|
</select>
|
||
|
|
<!--字典下拉选-->
|
||
|
|
<select id="getDictList" resultType="com.securitycontrol.entity.system.vo.TreeNode">
|
||
|
|
select dict_code as id, dict_name label, p_code AS parentId
|
||
|
|
from sys_dict
|
||
|
|
WHERE del_flag = 0
|
||
|
|
<if test="code!=null and code!=''">
|
||
|
|
and p_code=#{code}
|
||
|
|
</if>
|
||
|
|
ORDER BY dict_sort desc
|
||
|
|
</select>
|
||
|
|
<!--建管单位下拉选-->
|
||
|
|
<select id="getBuildLists" resultType="com.securitycontrol.entity.system.vo.SelectVo">
|
||
|
|
SELECT city_name AS name,
|
||
|
|
org_id AS orgId
|
||
|
|
FROM sys_build
|
||
|
|
</select>
|
||
|
|
<!--字典表下拉选-->
|
||
|
|
<select id="getDictLists" resultType="com.securitycontrol.entity.system.vo.SelectVo">
|
||
|
|
SELECT sd2.dict_code AS id,
|
||
|
|
sd2.dict_name AS name
|
||
|
|
FROM sys_dict sd
|
||
|
|
LEFT JOIN sys_dict sd2 ON sd.dict_code = sd2.p_code AND sd2.del_flag = 0
|
||
|
|
WHERE sd.dict_code = #{param} AND sd.del_flag = 0
|
||
|
|
ORDER BY sd2.dict_sort
|
||
|
|
</select>
|
||
|
|
<!--杆塔下拉选-->
|
||
|
|
<select id="getTowerLists" resultType="com.securitycontrol.entity.system.vo.SelectVo">
|
||
|
|
<if test="proType == 1">
|
||
|
|
SELECT sd2.dict_code AS id,
|
||
|
|
sd2.dict_name AS name
|
||
|
|
FROM sys_dict sd
|
||
|
|
LEFT JOIN sys_dict sd2 ON sd.dict_code = sd2.p_code AND sd2.del_flag = 0
|
||
|
|
WHERE sd.dict_code = #{param} AND sd.del_flag = 0
|
||
|
|
ORDER BY sd2.dict_sort
|
||
|
|
</if>
|
||
|
|
<if test="proType == 2">
|
||
|
|
SELECT gt_id AS id,
|
||
|
|
gt_name AS name
|
||
|
|
FROM t_pro_gt WHERE bid_code = #{param} AND del_flag = 0
|
||
|
|
</if>
|
||
|
|
|
||
|
|
</select>
|
||
|
|
<!--班组下拉选-->
|
||
|
|
<select id="getTeamLists" resultType="com.securitycontrol.entity.system.vo.SelectVo">
|
||
|
|
SELECT team_id AS id,
|
||
|
|
team_name AS name,
|
||
|
|
team_leader AS teamLeader,
|
||
|
|
team_leader_phone AS teamLeaderPhone
|
||
|
|
FROM tb_work_team
|
||
|
|
<where>
|
||
|
|
<if test="param!=null and param!=''">
|
||
|
|
AND bid_code = #{param}
|
||
|
|
</if>
|
||
|
|
</where>
|
||
|
|
|
||
|
|
</select>
|
||
|
|
<!--工程下拉选-->
|
||
|
|
<select id="getProLists" resultType="com.securitycontrol.entity.system.vo.SelectVo">
|
||
|
|
SELECT bid_code AS id,
|
||
|
|
pro_name AS name,
|
||
|
|
pro_type AS proType
|
||
|
|
FROM tb_project
|
||
|
|
WHERE del_flag = 0
|
||
|
|
</select>
|
||
|
|
<!--区域列表下拉选-->
|
||
|
|
<select id="getAreaLists" resultType="com.securitycontrol.entity.system.vo.SelectVo">
|
||
|
|
SELECT area_id AS id,
|
||
|
|
area_name AS name
|
||
|
|
FROM tb_area
|
||
|
|
<where>
|
||
|
|
bid_code = #{bidCode} AND del_flag = 0
|
||
|
|
<if test="gtId !=null and gtId!=''">
|
||
|
|
AND gt_id = #{gtId}
|
||
|
|
</if>
|
||
|
|
</where>
|
||
|
|
</select>
|
||
|
|
<!--边带下拉选-->
|
||
|
|
<select id="getBdLists" resultType="com.securitycontrol.entity.system.vo.SelectVo">
|
||
|
|
SELECT id,bd_name AS name,bid_code AS bidCode,gt_id AS gtId
|
||
|
|
FROM tb_pro_bd
|
||
|
|
<where>
|
||
|
|
del_flag = 0
|
||
|
|
<if test="bidCode!=null and bidCode !=''">
|
||
|
|
AND bid_code = #{bidCode}
|
||
|
|
</if>
|
||
|
|
</where>
|
||
|
|
</select>
|
||
|
|
<!--工程下拉选-->
|
||
|
|
<select id="getProList" resultType="com.securitycontrol.entity.system.vo.SelectVo">
|
||
|
|
select pro.bid_code bidCode,pro.pro_name name
|
||
|
|
from tb_project pro
|
||
|
|
LEFT JOIN sys_build sb on sb.org_id=pro.org
|
||
|
|
where pro.del_flag =0
|
||
|
|
<if test="proType!=null and proType!=''">
|
||
|
|
and pro.pro_type=#{proType}
|
||
|
|
</if>
|
||
|
|
<if test="orgId!=null and orgId!=''">
|
||
|
|
and pro.org=#{orgId}
|
||
|
|
</if>
|
||
|
|
<if test="cityName!=null and cityName!=''">
|
||
|
|
and sb.city_name=#{cityName}
|
||
|
|
</if>
|
||
|
|
</select>
|
||
|
|
<select id="getSelectLists" resultType="com.securitycontrol.entity.system.vo.SelectVo">
|
||
|
|
SELECT sd2.dict_code AS id,
|
||
|
|
sd2.dict_name AS name
|
||
|
|
FROM sys_dict sd
|
||
|
|
LEFT JOIN sys_dict sd2 ON sd.dict_code = sd2.p_code AND sd2.del_flag = 0
|
||
|
|
WHERE sd.dict_code = '9990' AND sd.del_flag = 0
|
||
|
|
ORDER BY sd2.dict_sort
|
||
|
|
</select>
|
||
|
|
|
||
|
|
<select id="getGtLists" resultType="com.securitycontrol.entity.system.vo.SelectVo">
|
||
|
|
SELECT tpg.gt_id AS gtId,tpg.gt_name AS name
|
||
|
|
FROM tb_pro_bd tpb
|
||
|
|
LEFT JOIN t_pro_gt tpg ON tpb.gt_id = tpg.gt_id
|
||
|
|
WHERE tpb.gt_id is not null AND tpb.gt_id !='' AND tpb.bid_code = #{bidCode}
|
||
|
|
</select>
|
||
|
|
<!--项目下拉选-->
|
||
|
|
<select id="getProjectList" resultType="com.securitycontrol.entity.system.vo.SelectVo">
|
||
|
|
SELECT pro_no AS id,
|
||
|
|
pro_name AS name
|
||
|
|
FROM tb_jj_project WHERE del_flag = 0
|
||
|
|
</select>
|
||
|
|
<!--单项工程下拉选-->
|
||
|
|
<select id="getSignProList" resultType="com.securitycontrol.entity.system.vo.SelectVo">
|
||
|
|
SELECT signle_no AS id,
|
||
|
|
single_name AS name
|
||
|
|
FROM tb_sign_project WHERE del_flag = 0
|
||
|
|
<if test="proNo!=null and proNo!=''">
|
||
|
|
AND project_no = #{proNo}
|
||
|
|
</if>
|
||
|
|
</select>
|
||
|
|
<select id="getRailLists" resultType="com.securitycontrol.entity.system.vo.SelectVo">
|
||
|
|
SELECT sd2.dict_code AS id,
|
||
|
|
sd2.dict_name AS name
|
||
|
|
FROM sys_dict sd
|
||
|
|
LEFT JOIN sys_dict sd2 ON sd.dict_code = sd2.p_code AND sd2.del_flag = 0
|
||
|
|
WHERE sd.dict_code = '3000' AND sd.del_flag = 0
|
||
|
|
ORDER BY sd2.dict_sort
|
||
|
|
</select>
|
||
|
|
<select id="getGiveAnAlarmLists" resultType="com.securitycontrol.entity.system.vo.SelectVo">
|
||
|
|
SELECT sd2.dict_code AS id,
|
||
|
|
sd2.dict_name AS name
|
||
|
|
FROM sys_dict sd
|
||
|
|
LEFT JOIN sys_dict sd2 ON sd.dict_code = sd2.p_code AND sd2.del_flag = 0
|
||
|
|
WHERE sd.dict_code = '3100' AND sd.del_flag = 0
|
||
|
|
ORDER BY sd2.dict_sort
|
||
|
|
</select>
|
||
|
|
<select id="getGuardAgainstLists" resultType="com.securitycontrol.entity.system.vo.SelectVo">
|
||
|
|
SELECT sd2.dict_code AS id,
|
||
|
|
sd2.dict_name AS name
|
||
|
|
FROM sys_dict sd
|
||
|
|
LEFT JOIN sys_dict sd2 ON sd.dict_code = sd2.p_code AND sd2.del_flag = 0
|
||
|
|
WHERE sd.dict_code = '3200' AND sd.del_flag = 0
|
||
|
|
ORDER BY sd2.dict_sort
|
||
|
|
</select>
|
||
|
|
</mapper>
|