ah_jjzhgd_service/securitycontrol-model/securitycontrol-system/src/main/resources/mapper/SelectMapper.xml

187 lines
7.2 KiB
XML
Raw Normal View History

2024-02-22 09:58:31 +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" >
2024-04-18 14:04:25 +08:00
<mapper namespace="com.securitycontrol.system.mapper.ISelectMapper">
2024-02-22 09:58:31 +08:00
<!--组织机构树-->
<select id="getOrgTree" resultType="com.securitycontrol.entity.system.vo.TreeNode">
2024-02-23 11:10:33 +08:00
SELECT org_id AS id,
2024-03-14 14:18:02 +08:00
p_id AS parentId,
org_name AS label
2024-02-23 11:10:33 +08:00
FROM sys_org
WHERE del_flag = 0
2024-02-22 09:58:31 +08:00
</select>
2024-02-23 10:02:14 +08:00
<!--角色下拉选-->
<select id="getRoleLists" resultType="com.securitycontrol.entity.system.vo.SelectVo">
SELECT role_id AS id,
2024-03-14 14:18:02 +08:00
role_name AS name
2024-02-23 10:02:14 +08:00
FROM sys_role
WHERE del_flag = 0
ORDER BY role_sort
</select>
2024-02-26 15:57:37 +08:00
<!--菜单树-->
<select id="getMenuTree" resultType="com.securitycontrol.entity.system.vo.TreeNode">
SELECT menu_id AS id,
2024-03-14 14:18:02 +08:00
p_id AS parentId,
menu_name AS label,
menu_type AS level
2024-02-26 15:57:37 +08:00
FROM sys_menu
WHERE del_flag = 0
</select>
2024-02-28 09:43:30 +08:00
<!--字典下拉选-->
<select id="getDictList" resultType="com.securitycontrol.entity.system.vo.TreeNode">
2024-03-14 14:18:02 +08:00
select dict_code as id, dict_name label, p_code AS parentId
2024-02-28 09:43:30 +08:00
from sys_dict
WHERE del_flag = 0
<if test="code!=null and code!=''">
and p_code=#{code}
</if>
2024-03-14 14:18:02 +08:00
ORDER BY dict_sort desc
2024-02-28 09:43:30 +08:00
</select>
2024-03-12 13:20:40 +08:00
<!--建管单位下拉选-->
<select id="getBuildLists" resultType="com.securitycontrol.entity.system.vo.SelectVo">
SELECT city_name AS name,
2024-03-14 14:18:02 +08:00
org_id AS orgId
FROM sys_build
2024-03-12 13:20:40 +08:00
</select>
2024-03-13 19:05:42 +08:00
<!--字典表下拉选-->
<select id="getDictLists" resultType="com.securitycontrol.entity.system.vo.SelectVo">
SELECT sd2.dict_code AS id,
2024-03-14 14:18:02 +08:00
sd2.dict_name AS name
2024-03-13 19:05:42 +08:00
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>
2024-03-15 17:32:42 +08:00
<!--杆塔下拉选-->
<select id="getTowerLists" resultType="com.securitycontrol.entity.system.vo.SelectVo">
2024-03-16 21:18:14 +08:00
<if test="proType == 1">
2024-03-16 19:15:20 +08:00
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>
2024-03-16 21:18:14 +08:00
<if test="proType == 2">
2024-03-16 19:15:20 +08:00
SELECT gt_id AS id,
gt_name AS name
2024-03-28 15:18:49 +08:00
FROM t_pro_gt WHERE bid_code = #{param} AND del_flag = 0
2024-03-16 19:15:20 +08:00
</if>
2024-03-15 17:32:42 +08:00
</select>
2024-03-18 13:36:47 +08:00
<!--班组下拉选-->
<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
2024-03-28 15:18:49 +08:00
<where>
<if test="param!=null and param!=''">
AND bid_code = #{param}
</if>
</where>
2024-03-18 13:36:47 +08:00
</select>
2024-03-20 17:54:12 +08:00
<!--工程下拉选-->
<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
2024-03-26 20:55:07 +08:00
WHERE del_flag = 0
2024-03-20 17:54:12 +08:00
</select>
2024-03-21 09:21:09 +08:00
<!--区域列表下拉选-->
<select id="getAreaLists" resultType="com.securitycontrol.entity.system.vo.SelectVo">
SELECT area_id AS id,
area_name AS name
2024-03-27 20:48:11 +08:00
FROM tb_area
2024-03-21 09:21:09 +08:00
<where>
2024-03-28 15:18:49 +08:00
bid_code = #{bidCode} AND del_flag = 0
2024-03-21 09:21:09 +08:00
<if test="gtId !=null and gtId!=''">
AND gt_id = #{gtId}
</if>
</where>
</select>
2024-03-25 14:46:31 +08:00
<!--边带下拉选-->
<select id="getBdLists" resultType="com.securitycontrol.entity.system.vo.SelectVo">
2024-03-25 17:51:42 +08:00
SELECT id,bd_name AS name,bid_code AS bidCode,gt_id AS gtId
2024-03-25 14:46:31 +08:00
FROM tb_pro_bd
<where>
2024-03-26 20:55:07 +08:00
del_flag = 0
2024-03-25 14:46:31 +08:00
<if test="bidCode!=null and bidCode !=''">
AND bid_code = #{bidCode}
</if>
</where>
</select>
2024-03-26 17:25:06 +08:00
<!--工程下拉选-->
<select id="getProList" resultType="com.securitycontrol.entity.system.vo.SelectVo">
2024-03-26 18:35:43 +08:00
select pro.bid_code bidCode,pro.pro_name name
2024-03-26 17:25:06 +08:00
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>
2024-03-26 18:35:43 +08:00
<if test="orgId!=null and orgId!=''">
and pro.org=#{orgId}
2024-03-26 17:25:06 +08:00
</if>
<if test="cityName!=null and cityName!=''">
and sb.city_name=#{cityName}
</if>
</select>
2024-03-28 09:25:29 +08:00
<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
2024-04-01 19:45:19 +08:00
WHERE sd.dict_code = '9990' AND sd.del_flag = 0
2024-03-28 09:25:29 +08:00
ORDER BY sd2.dict_sort
</select>
2024-03-29 15:39:13 +08:00
<select id="getGtLists" resultType="com.securitycontrol.entity.system.vo.SelectVo">
2024-04-02 19:54:43 +08:00
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}
2024-03-29 15:39:13 +08:00
</select>
2024-04-02 14:44:36 +08:00
<!--项目下拉选-->
<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>
2024-04-09 18:17:55 +08:00
<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>
2024-02-22 09:58:31 +08:00
</mapper>