隐患排查APP
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

78 lines
2.9 KiB

2 years ago
<?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.hisense.hiatmp.server_api.mapper.OperatorMapper">
2 years ago
<select id="getOperatorByName" resultType="com.hisense.hiatmp.model.common.Operator">
2 years ago
select *
from operator
where cusername = #{cusername}
2 years ago
</select>
2 years ago
<select id="getOperatorById" resultType="com.hisense.hiatmp.model.common.Operator">
2 years ago
select o.*,d.cdepartmentname,d.nlevel
from operator o
LEFT JOIN department d on o.cdepartmentid = d.cdepartmentid
where o.nuserid = #{nuserid}
2 years ago
</select>
2 years ago
<select id="getAllOperator" resultType="com.hisense.hiatmp.model.common.Operator">
2 years ago
select *
from operator;
2 years ago
</select>
<select id="updateByPrimaryKeySelective" resultType="String">
2 years ago
update operator
set cuserpwd = #{cuserpwd},last_mod_date = NOW()
2 years ago
where nuserid = #{nuserid} RETURNING nuserid;
</select>
<select id="getRoleById" resultType="String">
select r.rolename from role_operation_relation ror
LEFT JOIN "public"."role" r on ror.roleid = r.roleid
where ror.operationid = #{nuserid}
2 years ago
</select>
<select id="getOperatorDataSum" resultType="com.hisense.hiatmp.model.common.HighDangerBaseNum">
SELECT DISTINCT 'MyPC' AS status, count(*) AS count
FROM tht_hidden_danger_base hdb
LEFT JOIN tht_hidden_danger_road hdr
ON hdb.business_id = hdr.business_id AND hdb.pc_count = hdr.pc_count
LEFT JOIN department dp ON hdb.handle_dept = dp.cdepartmentid
LEFT JOIN enum_type et ON et.ENUMTYPEID = '6601' AND et.enumvalue = hdb.status
WHERE
1 = 1
AND hdr.pc_operator = #{nuserid}
AND hdb.status = '10'
AND hdr.nid is not null
AND hdb.approve_status != '0' AND hdb.approve_status != '-1'
UNION ALL
SELECT DISTINCT 'MyZL' AS status, count(*) AS count
FROM tht_hidden_danger_base hdb
LEFT JOIN tht_hidden_danger_road hdr
ON hdb.business_id = hdr.business_id AND hdb.pc_count = hdr.pc_count
LEFT JOIN department dp ON hdb.handle_dept = dp.cdepartmentid
LEFT JOIN enum_type et ON et.ENUMTYPEID = '6601' AND et.enumvalue = hdb.status
WHERE
1 = 1
AND hdr.pc_operator = #{nuserid}
AND hdb.status = '20'
AND hdr.nid is not null
AND hdb.approve_status != '0' AND hdb.approve_status != '-1'
UNION ALL
SELECT DISTINCT 'MySP' AS status, count(*) AS count
FROM tht_approve ta
LEFT JOIN tht_hidden_danger_base hdb ON hdb.business_id = ta.business_id
WHERE
1 = 1
AND hdb.status in ('10','20')
AND ta.operate_content in ('1','2')
AND ta.operator = #{nuserid}
</select>
2 years ago
</mapper>