|
|
|
|
<?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">
|
|
|
|
|
|
|
|
|
|
<select id="getOperatorByName" resultType="com.hisense.hiatmp.model.common.Operator">
|
|
|
|
|
select *
|
|
|
|
|
from operator
|
|
|
|
|
where cusername = #{cusername}
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<select id="getOperatorById" resultType="com.hisense.hiatmp.model.common.Operator">
|
|
|
|
|
select o.*,d.cdepartmentname,d.nlevel
|
|
|
|
|
from operator o
|
|
|
|
|
LEFT JOIN department d on o.cdepartmentid = d.cdepartmentid
|
|
|
|
|
where o.nuserid = #{nuserid}
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<select id="getAllOperator" resultType="com.hisense.hiatmp.model.common.Operator">
|
|
|
|
|
select *
|
|
|
|
|
from operator;
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<select id="updateByPrimaryKeySelective" resultType="String">
|
|
|
|
|
update operator
|
|
|
|
|
set cuserpwd = #{cuserpwd},last_mod_date = NOW()
|
|
|
|
|
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}
|
|
|
|
|
</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>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</mapper>
|