|
|
|
|
<?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.base.mapper.CommonMapper">
|
|
|
|
|
<insert id="saveVmsExecute" parameterType="com.hisense.hiatmp.model.pis.VmsExecute">
|
|
|
|
|
insert into PIS_VMS_EXECUTE (ID,
|
|
|
|
|
DEVICE_ID,
|
|
|
|
|
RELEASE_TIME_START,
|
|
|
|
|
RELEASE_TIME_END,
|
|
|
|
|
ELEMENT_ID,
|
|
|
|
|
PLAN_ID,
|
|
|
|
|
ORDER_ID,
|
|
|
|
|
CASE_ID,
|
|
|
|
|
warn_Time)
|
|
|
|
|
values (#{id,jdbcType=VARCHAR},
|
|
|
|
|
#{deviceId,jdbcType=VARCHAR},
|
|
|
|
|
#{releaseTimeStart,jdbcType=TIMESTAMP},
|
|
|
|
|
#{releaseTimeEnd,jdbcType=TIMESTAMP},
|
|
|
|
|
#{elementId,jdbcType=VARCHAR},
|
|
|
|
|
#{planId,jdbcType=VARCHAR},
|
|
|
|
|
#{orderId,jdbcType=VARCHAR},
|
|
|
|
|
#{caseId,jdbcType=VARCHAR},
|
|
|
|
|
#{warnTime,jdbcType=VARCHAR})
|
|
|
|
|
</insert>
|
|
|
|
|
<insert id="saveLoginLog">
|
|
|
|
|
|
|
|
|
|
insert into LOG_DATA (NID,
|
|
|
|
|
LOGTYPE,
|
|
|
|
|
USERID,
|
|
|
|
|
CARDID,
|
|
|
|
|
USERNAME,
|
|
|
|
|
DEPARTMENTNAME,
|
|
|
|
|
DEPARTMENTID,
|
|
|
|
|
LOGTIME,
|
|
|
|
|
CLIENTIP,
|
|
|
|
|
CLIENTID,
|
|
|
|
|
OPERATETYPE,
|
|
|
|
|
FAILCODE,
|
|
|
|
|
OPERATETARGET,
|
|
|
|
|
OPERATECONTENT,
|
|
|
|
|
SYSTEMID,
|
|
|
|
|
FIRSTMENUID,
|
|
|
|
|
SECONDMENUID,
|
|
|
|
|
FUNCTIONID,
|
|
|
|
|
FUNCTIONNAME)
|
|
|
|
|
values (#{nid,jdbcType=VARCHAR},
|
|
|
|
|
#{logtype,jdbcType=VARCHAR},
|
|
|
|
|
#{userid,jdbcType=VARCHAR},
|
|
|
|
|
#{cardid,jdbcType=VARCHAR},
|
|
|
|
|
#{username,jdbcType=VARCHAR},
|
|
|
|
|
#{departmentname,jdbcType=VARCHAR},
|
|
|
|
|
#{departmentid,jdbcType=VARCHAR},
|
|
|
|
|
#{logtime,jdbcType=TIMESTAMP},
|
|
|
|
|
#{clientip,jdbcType=VARCHAR},
|
|
|
|
|
#{clientid,jdbcType=VARCHAR},
|
|
|
|
|
#{operatetype,jdbcType=VARCHAR},
|
|
|
|
|
#{failcode,jdbcType=VARCHAR},
|
|
|
|
|
#{operatetarget,jdbcType=VARCHAR},
|
|
|
|
|
#{operatecontent,jdbcType=VARCHAR},
|
|
|
|
|
#{systemid,jdbcType=VARCHAR},
|
|
|
|
|
#{firstmenuid,jdbcType=TIMESTAMP},
|
|
|
|
|
#{secondmenuid,jdbcType=VARCHAR},
|
|
|
|
|
#{functionid,jdbcType=VARCHAR},
|
|
|
|
|
#{functionname,jdbcType=VARCHAR})
|
|
|
|
|
|
|
|
|
|
</insert>
|
|
|
|
|
|
|
|
|
|
<delete id="deleteVmsExecute">
|
|
|
|
|
delete
|
|
|
|
|
from PIS_VMS_Execute p
|
|
|
|
|
where p.device_id = #{deviceId,jdbcType=VARCHAR}
|
|
|
|
|
</delete>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<select id="getEnumList" parameterType="java.util.ArrayList" resultType="java.util.HashMap">
|
|
|
|
|
select t.enumtypeid "enumtypeId",t.enumvalue "enumValue",t.enumname "enumName", t.dispindex from enum_type t
|
|
|
|
|
where t.enumtypeid in
|
|
|
|
|
<foreach collection="enumIds" item="enumtypeid" index="index" open="(" close=")" separator=",">
|
|
|
|
|
#{enumtypeid,jdbcType=VARCHAR}
|
|
|
|
|
</foreach>
|
|
|
|
|
order by t.enumtypeid,t.dispindex,t.enumvalue
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<select id="getDeptName" resultType="String">
|
|
|
|
|
select deptshortname
|
|
|
|
|
from department
|
|
|
|
|
where cdepartmentid = #{deptId}
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<select id="getPostName" resultType="String">
|
|
|
|
|
select enumname
|
|
|
|
|
from enum_type e
|
|
|
|
|
join pic_post_role_relation r on r.post_type = e.enumvalue
|
|
|
|
|
where e.enumtypeid = '20000'
|
|
|
|
|
and r.role_id = #{postId}
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<!-- 获取辖区信息- -->
|
|
|
|
|
<select id="selectAdminAreaList" resultType="java.util.Map">
|
|
|
|
|
select t.district_code, t.district_name
|
|
|
|
|
from admin_area t
|
|
|
|
|
</select>
|
|
|
|
|
<select id="queryEquip" parameterType="java.lang.String" resultType="java.util.Map">
|
|
|
|
|
${sqlStr}
|
|
|
|
|
</select>
|
|
|
|
|
<!-- <select id="getDepartmentList" resultType="com.hisense.hiatmp.model.common.Department">-->
|
|
|
|
|
<!-- select t.*, d.coordinate, f.coordinate as coordinateCenter-->
|
|
|
|
|
<!-- from department t-->
|
|
|
|
|
<!-- left join district d-->
|
|
|
|
|
<!-- on d.dept_id = t.cdepartmentid-->
|
|
|
|
|
<!-- left join face_district_center f-->
|
|
|
|
|
<!-- on f.area_dept_id = d.dept_id-->
|
|
|
|
|
<!-- order by t.cdepartmentcode asc-->
|
|
|
|
|
<!-- </select>-->
|
|
|
|
|
<select id="getDepartmentList" resultType="com.hisense.hiatmp.model.common.Department">
|
|
|
|
|
select t.* as coordinateCenter
|
|
|
|
|
from department t
|
|
|
|
|
order by t.cdepartmentcode asc
|
|
|
|
|
</select>
|
|
|
|
|
<select id="getDepartmentListByLevel" resultType="com.hisense.hiatmp.model.common.Department">
|
|
|
|
|
select *
|
|
|
|
|
from department t
|
|
|
|
|
<if test="nlevle != null and '' != nlevel">
|
|
|
|
|
where t.nlevel = #{nlevel, jdbcType=VARCHAR}
|
|
|
|
|
</if>
|
|
|
|
|
order by t.cdepartmentcode asc
|
|
|
|
|
</select>
|
|
|
|
|
<select id="getSysParamValue" resultType="java.lang.String">
|
|
|
|
|
SELECT T.PARAMVALUE
|
|
|
|
|
FROM SYSPARAMS T
|
|
|
|
|
WHERE T.PARAMCODE = #{paramCode, jdbcType=VARCHAR}
|
|
|
|
|
</select>
|
|
|
|
|
<select id="getCurrentUser" parameterType="java.lang.String" resultType="com.hisense.hiatmp.model.common.Operator">
|
|
|
|
|
select *
|
|
|
|
|
from operator t
|
|
|
|
|
where t.nuserid = #{userId, jdbcType=VARCHAR}
|
|
|
|
|
</select>
|
|
|
|
|
<select id="getDeptById" parameterType="java.lang.String" resultType="com.hisense.hiatmp.model.common.Department">
|
|
|
|
|
select *
|
|
|
|
|
from department t
|
|
|
|
|
where t.cdepartmentid = #{deptId, jdbcType=VARCHAR}
|
|
|
|
|
/* and rownum = 1*/
|
|
|
|
|
</select>
|
|
|
|
|
<select id="getRoleIdList" parameterType="java.lang.String" resultType="String">
|
|
|
|
|
SELECT t.roleid
|
|
|
|
|
FROM USER_ROLE_RELATION t
|
|
|
|
|
where t.nuserid = #{userId, jdbcType=VARCHAR}
|
|
|
|
|
</select>
|
|
|
|
|
<select id="getOperationList" parameterType="java.lang.String" resultType="String">
|
|
|
|
|
SELECT DISTINCT ROR.OPERATIONID
|
|
|
|
|
FROM USER_ROLE_RELATION URR
|
|
|
|
|
LEFT JOIN ROLE_OPERATION_RELATION ROR ON ROR.ROLEID = URR.ROLEID
|
|
|
|
|
WHERE URR.NUSERID = #{userId}
|
|
|
|
|
</select>
|
|
|
|
|
<select id="getOperationIdList" parameterType="java.lang.String" resultType="String">
|
|
|
|
|
select distinct orel.operationid
|
|
|
|
|
from role_operation_relation orel
|
|
|
|
|
where orel.roleid in (SELECT t.roleid FROM USER_ROLE_RELATION t where t.nuserid = #{userId, jdbcType=VARCHAR})
|
|
|
|
|
and orel.operationid = #{operationId, jdbcType=VARCHAR}
|
|
|
|
|
</select>
|
|
|
|
|
<select id="getHolidayList" resultType="com.hisense.hiatmp.model.common.HolidayDrop">
|
|
|
|
|
select t.holiday_id as holidayId,
|
|
|
|
|
t.holiday_name as holidayName,
|
|
|
|
|
to_char(tt.start_date, 'yyyy-MM-dd') as startDate,
|
|
|
|
|
to_char(tt.end_date, 'yyyy-MM-dd') as endDate,
|
|
|
|
|
to_char(ttt.start_date, 'yyyy-MM-dd') as startDatePre,
|
|
|
|
|
to_char(ttt.end_date, 'yyyy-MM-dd') as endDatePre,
|
|
|
|
|
to_char(tttt.start_date, 'yyyy-MM-dd') as startDatePrePre,
|
|
|
|
|
to_char(tttt.end_date, 'yyyy-MM-dd') as endDatePrePre
|
|
|
|
|
from face_holiday t
|
|
|
|
|
inner join face_holiday_config tt
|
|
|
|
|
on t.holiday_id = tt.holiday_id
|
|
|
|
|
and tt.year = #{year,jdbcType=INTEGER}
|
|
|
|
|
inner join face_holiday_config ttt
|
|
|
|
|
on t.holiday_id = ttt.holiday_id
|
|
|
|
|
and ttt.year = #{lastYear,jdbcType=INTEGER}
|
|
|
|
|
inner join face_holiday_config tttt
|
|
|
|
|
on t.holiday_id = tttt.holiday_id
|
|
|
|
|
and tttt.year = #{lastYear,jdbcType=INTEGER} - 1
|
|
|
|
|
<if test="holidayId != null and '' != holidayId">
|
|
|
|
|
and t.holiday_id=#{holidayId,jdbcType=VARCHAR}
|
|
|
|
|
</if>
|
|
|
|
|
order by tt.start_date asc
|
|
|
|
|
</select>
|
|
|
|
|
<select id="getEquipmentInfo" resultType="java.lang.String">
|
|
|
|
|
SELECT t.thirdsyscode
|
|
|
|
|
from equipment_info t
|
|
|
|
|
WHERE t.deviceid = #{deviceId,jdbcType=VARCHAR}
|
|
|
|
|
</select>
|
|
|
|
|
<select id="getPresetList" resultType="java.util.Map">
|
|
|
|
|
SELECT t.presetid as "presetId", t.presetname as "presetName"
|
|
|
|
|
FROM equip_video_preset t
|
|
|
|
|
WHERE t.deviceid = #{deviceId,jdbcType=VARCHAR}
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<select id="getAreaList" resultType="com.hisense.hiatmp.server_api.model.AreaContent">
|
|
|
|
|
select f.AREA_ID "areacode", f.AREA_NAME, f.COORDINATES, f.AREA_TYPE "areaType", d.COORDINATE "coordinateCenter"
|
|
|
|
|
from face_area f
|
|
|
|
|
left join face_district_center d
|
|
|
|
|
on f.area_id = d.area_dept_id
|
|
|
|
|
where 1=1
|
|
|
|
|
and f.AREA_MODEL =#{areaModel,jdbcType=VARCHAR}
|
|
|
|
|
|
|
|
|
|
<if test="list != null and list.size()!=0">
|
|
|
|
|
and f.AREA_ID in
|
|
|
|
|
<foreach collection="list" item="areaCode" index="index" open="(" close=")" separator=",">
|
|
|
|
|
#{areaCode ,jdbcType=VARCHAR}
|
|
|
|
|
</foreach>
|
|
|
|
|
</if>
|
|
|
|
|
</select>
|
|
|
|
|
<select id="getSocialDeptCenterList" resultType="com.hisense.hiatmp.server_api.model.SocialDeptCenter">
|
|
|
|
|
select ID,
|
|
|
|
|
SOCIAL_DEPT_ID,
|
|
|
|
|
COORDINATE,
|
|
|
|
|
SOCIAL_DEPT_TYPE,
|
|
|
|
|
SOCIAL_DEPT_NAME
|
|
|
|
|
from FACE_SOCIAL_DEPT_CENTER t
|
|
|
|
|
where 1=1
|
|
|
|
|
<if test='socialDeptType != null and socialDeptType.size() != 0'>
|
|
|
|
|
and t.SOCIAL_DEPT_TYPE in
|
|
|
|
|
<foreach collection="socialDeptType" item="item" index="index" open="(" close=")" separator=",">
|
|
|
|
|
#{item}
|
|
|
|
|
</foreach>
|
|
|
|
|
</if>
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<select id="getSecitionsByCoordinate" resultType="com.hisense.hiatmp.model.pis.Section">
|
|
|
|
|
<choose>
|
|
|
|
|
<when test="dataBase != null and dataBase != '' and dataBase == '1'.toString()">
|
|
|
|
|
SELECT M
|
|
|
|
|
.section_code "sectionId",
|
|
|
|
|
M.*,
|
|
|
|
|
st_distance ( G.geometry :: geography, st_geomfromtext (concat('POINT(',${longitude},'
|
|
|
|
|
',${latitude},')'), 4326 ) :: geography ) distance
|
|
|
|
|
FROM
|
|
|
|
|
bis_section_geometry
|
|
|
|
|
G LEFT JOIN bis_section M ON G.section_code = M.section_code
|
|
|
|
|
WHERE
|
|
|
|
|
st_dwithin(G.GEOMETRY, st_geomfromtext (concat('POINT(',${longitude},' ',${latitude},')'), 4326 ) ::
|
|
|
|
|
geography, 100, true)
|
|
|
|
|
ORDER BY
|
|
|
|
|
distance
|
|
|
|
|
</when>
|
|
|
|
|
<otherwise>
|
|
|
|
|
select m.section_code "sectionId",
|
|
|
|
|
m.*,
|
|
|
|
|
SDO_GEOM.SDO_DISTANCE(G.GEOMETRY, MDSYS.SDO_GEOMETRY(2001, 8307,
|
|
|
|
|
MDSYS.SDO_POINT_TYPE(${longitude}, ${latitude}, 0),
|
|
|
|
|
NULL,
|
|
|
|
|
NULL), 1) distance
|
|
|
|
|
from bis_section_geometry g
|
|
|
|
|
left join bis_section m on g.section_code = m.section_code
|
|
|
|
|
WHERE SDO_WITHIN_DISTANCE(G.GEOMETRY, MDSYS.SDO_GEOMETRY(2001, 8307,
|
|
|
|
|
MDSYS.SDO_POINT_TYPE(${longitude}, ${latitude}, 0),
|
|
|
|
|
NULL, NULL), 'distance=100 querytype=WINDOW') = 'TRUE'
|
|
|
|
|
order by distance
|
|
|
|
|
|
|
|
|
|
</otherwise>
|
|
|
|
|
</choose>
|
|
|
|
|
</select>
|
|
|
|
|
<select id="getCrossingByCoordinate" resultType="com.hisense.hiatmp.model.dmr.BisCrossing">
|
|
|
|
|
<choose>
|
|
|
|
|
<when test="dataBase != null and dataBase != '' and dataBase == '1'.toString()">
|
|
|
|
|
SELECT M
|
|
|
|
|
.*,
|
|
|
|
|
st_distance ( G.geometry :: geography, st_geomfromtext ( concat('POINT(',${longitude},'
|
|
|
|
|
',${latitude},')'), 4326 ) :: geography ) distance
|
|
|
|
|
FROM
|
|
|
|
|
bis_crossing_geometry
|
|
|
|
|
G LEFT JOIN bis_crossing M ON G.crossing_code = M.crossing_code
|
|
|
|
|
WHERE
|
|
|
|
|
st_dwithin(G.GEOMETRY, st_geomfromtext (concat('POINT(',${longitude},' ',${latitude},')'), 4326 ) ::
|
|
|
|
|
geography, 100, true)
|
|
|
|
|
</when>
|
|
|
|
|
<otherwise>
|
|
|
|
|
select m.*,
|
|
|
|
|
SDO_GEOM.SDO_DISTANCE(G.GEOMETRY, MDSYS.SDO_GEOMETRY(2001, 8307,
|
|
|
|
|
MDSYS.SDO_POINT_TYPE(${longitude}, ${latitude}, 0),
|
|
|
|
|
NULL, NULL), 1) distance
|
|
|
|
|
from bis_crossing_geometry g
|
|
|
|
|
left join bis_crossing m on g.crossing_code = m.crossing_code
|
|
|
|
|
WHERE SDO_WITHIN_DISTANCE(G.GEOMETRY,
|
|
|
|
|
MDSYS.SDO_GEOMETRY(2001, 8307, MDSYS.SDO_POINT_TYPE(${longitude}, ${latitude}, 0),
|
|
|
|
|
NULL, NULL), 'distance=100 querytype=WINDOW') = 'TRUE'
|
|
|
|
|
order by distance
|
|
|
|
|
|
|
|
|
|
</otherwise>
|
|
|
|
|
</choose>
|
|
|
|
|
</select>
|
|
|
|
|
<select id="getAreaByCoordinate" resultType="com.hisense.hiatmp.server_api.model.DistrictInfo">
|
|
|
|
|
<choose>
|
|
|
|
|
<when test="dataBase != null and dataBase != '' and dataBase == '1'.toString()">
|
|
|
|
|
SELECT M
|
|
|
|
|
.ID "districtCode",
|
|
|
|
|
M.short_name "districtName",
|
|
|
|
|
d.nlevel,
|
|
|
|
|
st_distance ( G.geometry :: geography, st_geomfromtext (concat('POINT(',${longitude},'
|
|
|
|
|
',${latitude},')'), 4326 ) :: geography ) distance
|
|
|
|
|
FROM
|
|
|
|
|
DISTRICT_GEOMETRY
|
|
|
|
|
G LEFT JOIN DISTRICT M ON G.ID = M.
|
|
|
|
|
ID LEFT JOIN department d ON d.cdepartmentid = M.dept_id
|
|
|
|
|
WHERE
|
|
|
|
|
st_dwithin(G.GEOMETRY, st_geomfromtext ( concat('POINT(',${longitude},' ',${latitude},')'), 4326 ) ::
|
|
|
|
|
geography, 100, true)
|
|
|
|
|
ORDER BY
|
|
|
|
|
distance,
|
|
|
|
|
nlevel
|
|
|
|
|
</when>
|
|
|
|
|
<otherwise>
|
|
|
|
|
select m.id "districtCode",
|
|
|
|
|
m.short_name "districtName",
|
|
|
|
|
d.nlevel,
|
|
|
|
|
SDO_GEOM.SDO_DISTANCE(G.GEOMETRY, MDSYS.SDO_GEOMETRY(2001, 8307,
|
|
|
|
|
MDSYS.SDO_POINT_TYPE(${longitude}, ${latitude}, 0),
|
|
|
|
|
NULL, NULL), 1) distance
|
|
|
|
|
from DISTRICT_GEOMETRY g
|
|
|
|
|
left join DISTRICT m on g.id = m.id
|
|
|
|
|
left join department d on d.cdepartmentid = m.dept_id
|
|
|
|
|
WHERE SDO_WITHIN_DISTANCE(G.GEOMETRY,
|
|
|
|
|
MDSYS.SDO_GEOMETRY(2001, 8307, MDSYS.SDO_POINT_TYPE(${longitude}, ${latitude}, 0),
|
|
|
|
|
NULL, NULL), 'distance=100 querytype=WINDOW') = 'TRUE'
|
|
|
|
|
order by distance, nlevel
|
|
|
|
|
|
|
|
|
|
</otherwise>
|
|
|
|
|
</choose>
|
|
|
|
|
</select>
|
|
|
|
|
<select id="getGpsList" resultType="com.hisense.hiatmp.server_api.model.GpsDevice">
|
|
|
|
|
select *
|
|
|
|
|
from (select ROW_NUMBER() OVER(PARTITION BY g.CVEHID ORDER BY g.DTRECORDTIME DESC) num, g.cvehid,
|
|
|
|
|
g.nvehalarm,
|
|
|
|
|
g.dtrecordtime,
|
|
|
|
|
g.decarlong as longitude,
|
|
|
|
|
g.decarlat as latitude,
|
|
|
|
|
g.ncarstatus,
|
|
|
|
|
g.nvehspeed,
|
|
|
|
|
g.ndirection,
|
|
|
|
|
g.datauploadtime,
|
|
|
|
|
g.datasavetime,
|
|
|
|
|
g.policeid,
|
|
|
|
|
g.mdsid,
|
|
|
|
|
g.reportstatus,
|
|
|
|
|
g.source,
|
|
|
|
|
e.thirdsyscode,
|
|
|
|
|
e.deviceid,
|
|
|
|
|
e.devicename,
|
|
|
|
|
e.gpstype,
|
|
|
|
|
e.gpsradiono,
|
|
|
|
|
et.enumname as gpstypename
|
|
|
|
|
from gps_data g
|
|
|
|
|
left join equipment_info e
|
|
|
|
|
on e.thirdsyscode = g.cvehid
|
|
|
|
|
left join (select enumname, enumvalue
|
|
|
|
|
from enum_type
|
|
|
|
|
where enumtypeid = '734') et
|
|
|
|
|
on et.enumvalue = e.gpstype
|
|
|
|
|
where g.dtrecordtime >=
|
|
|
|
|
sysdate -
|
|
|
|
|
(select nvl2(param.paramvalue, param.paramvalue, '5')
|
|
|
|
|
from (select t.paramvalue
|
|
|
|
|
from sysparams t
|
|
|
|
|
where t.paramcode = 'GPS_ONLINE_TIME_INTERVAL') param) / 1440) tt
|
|
|
|
|
where tt.num = 1;
|
|
|
|
|
</select>
|
|
|
|
|
<select id="getPoliceList" resultType="com.hisense.hiatmp.model.common.Police">
|
|
|
|
|
select p.*
|
|
|
|
|
from police p
|
|
|
|
|
where p.isclosed = '1'
|
|
|
|
|
</select>
|
|
|
|
|
<select id="getAllDepartmentAreaList" resultType="com.hisense.hiatmp.server_api.model.District">
|
|
|
|
|
select ID,
|
|
|
|
|
DEPT_ID,
|
|
|
|
|
DISTRICT_CODE,
|
|
|
|
|
DISTRICT_NAME,
|
|
|
|
|
COORDINATE,
|
|
|
|
|
REMARK,
|
|
|
|
|
SHORT_NAME,
|
|
|
|
|
COLOR,
|
|
|
|
|
COLORSHOW
|
|
|
|
|
from DISTRICT
|
|
|
|
|
</select>
|
|
|
|
|
<select id="getPresetListByThirdCode" resultType="java.util.Map">
|
|
|
|
|
SELECT DISTINCT t.presetid as "presetId", t.presetname as "presetName"
|
|
|
|
|
FROM equip_video_preset t
|
|
|
|
|
join equipment_info e on e.deviceid = t.deviceid
|
|
|
|
|
WHERE e.thirdsyscode = #{thirdsyscode,jdbcType=VARCHAR}
|
|
|
|
|
order by t.presetname
|
|
|
|
|
</select>
|
|
|
|
|
<select id="queryDeptAndArea" parameterType="java.lang.String"
|
|
|
|
|
resultType="com.hisense.hiatmp.model.common.Department">
|
|
|
|
|
select t.cdepartmentid,
|
|
|
|
|
t.cdepartmentcode,
|
|
|
|
|
t.cdepartmentname,
|
|
|
|
|
t.deptshortname,
|
|
|
|
|
t.nlevel,
|
|
|
|
|
t.departmentflag,
|
|
|
|
|
t.parentdepartment,
|
|
|
|
|
f.coordinates as coordinate,
|
|
|
|
|
f.area_id as areaCode,
|
|
|
|
|
f.area_name as areaName
|
|
|
|
|
from department t
|
|
|
|
|
join area_department_relation r
|
|
|
|
|
on t.cdepartmentcode = r.dept_id
|
|
|
|
|
join face_area f
|
|
|
|
|
on f.area_id = r.area_id
|
|
|
|
|
where 1 = 1
|
|
|
|
|
<if test="areaCode != null and '' != areaCode">
|
|
|
|
|
and f.area_id = #{areaCode, jdbcType=VARCHAR}
|
|
|
|
|
</if>
|
|
|
|
|
<if test="deptId != null and '' != deptId">
|
|
|
|
|
and t.cdepartmentid = #{deptId, jdbcType=VARCHAR}
|
|
|
|
|
</if>
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<select id="getBindOperator" resultType="java.lang.String">
|
|
|
|
|
select t.nuserid
|
|
|
|
|
from bda_operator_oauth t
|
|
|
|
|
where t.oauthuserid = #{oauthUserId, jdbcType=VARCHAR}
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<select id="getOauthOperator" resultType="java.lang.String">
|
|
|
|
|
select t.oauthuserid
|
|
|
|
|
from bda_operator_oauth t
|
|
|
|
|
where t.oauthuserid = #{oauthUserId, jdbcType=VARCHAR}
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<insert id="insertBindOperator" parameterType="com.hisense.hiatmp.server_api.model.BindOperatorDTO">
|
|
|
|
|
insert into bda_operator_oauth(oauthuserid, nuserid, oauthtype, xm, sfzh, policeid, dwdm, dwmc, zw, bind_time,
|
|
|
|
|
visit_time)
|
|
|
|
|
values (#{oauthUserId, jdbcType=VARCHAR}, #{userId, jdbcType=VARCHAR}, #{oauthType, jdbcType=VARCHAR},
|
|
|
|
|
#{xm, jdbcType=VARCHAR}, #{sfzh, jdbcType=VARCHAR}, #{policeId, jdbcType=VARCHAR},
|
|
|
|
|
#{dwdm, jdbcType=VARCHAR}, #{dwmc, jdbcType=VARCHAR}, #{zw, jdbcType=VARCHAR},
|
|
|
|
|
cast(current_timestamp(0) as
|
|
|
|
|
timestamp without time zone)
|
|
|
|
|
, cast(current_timestamp(0) as timestamp without time zone))
|
|
|
|
|
</insert>
|
|
|
|
|
|
|
|
|
|
<select id="getUserPwd" resultType="java.lang.String">
|
|
|
|
|
select cuserpwd
|
|
|
|
|
from operator
|
|
|
|
|
where trim(nuserid) = #{userId, jdbcType=VARCHAR}
|
|
|
|
|
</select>
|
|
|
|
|
<select id="getMenuTreeByUserId" resultType="com.hisense.hiatmp.server_api.model.Menu">
|
|
|
|
|
select m.*
|
|
|
|
|
from menu m
|
|
|
|
|
left join role_operation_relation rm on m.id = rm.operationid
|
|
|
|
|
left join user_role_relation ur on rm.roleid = ur.roleid
|
|
|
|
|
left join role ro on ur.roleid = ro.roleid
|
|
|
|
|
left join operator u on u.nuserid = ur.nuserid
|
|
|
|
|
where u.nuserid = #{userId, jdbcType=VARCHAR}
|
|
|
|
|
and m.del_flag!='1'
|
|
|
|
|
and m.version >0
|
|
|
|
|
order by m.order_id
|
|
|
|
|
</select>
|
|
|
|
|
<select id="getAllMenus" resultType="com.hisense.hiatmp.server_api.model.Menu">
|
|
|
|
|
select *
|
|
|
|
|
from menu m
|
|
|
|
|
</select>
|
|
|
|
|
<select id="getIfHaveUser" resultType="java.lang.String">
|
|
|
|
|
select nuserid
|
|
|
|
|
from operator
|
|
|
|
|
where nuserid = #{userId, jdbcType=VARCHAR}
|
|
|
|
|
</select>
|
|
|
|
|
<select id="getIfHaveSfzh" resultType="java.lang.String">
|
|
|
|
|
select nuserid
|
|
|
|
|
from operator
|
|
|
|
|
where cdescription = #{userId, jdbcType=VARCHAR}
|
|
|
|
|
</select>
|
|
|
|
|
<select id="getIfBinded" resultType="java.lang.String">
|
|
|
|
|
select oauthuserid
|
|
|
|
|
from bda_operator_oauth
|
|
|
|
|
where nuserid = #{userId, jdbcType=VARCHAR}
|
|
|
|
|
<choose>
|
|
|
|
|
<when test="dataBase != null and dataBase != '' and dataBase == '1'.toString()">
|
|
|
|
|
limit 1
|
|
|
|
|
</when>
|
|
|
|
|
<otherwise>
|
|
|
|
|
and rownum = 1
|
|
|
|
|
</otherwise>
|
|
|
|
|
</choose>
|
|
|
|
|
|
|
|
|
|
</select>
|
|
|
|
|
<select id="getDeptIdByUserId" resultType="java.lang.String">
|
|
|
|
|
select cdepartmentid
|
|
|
|
|
from operator
|
|
|
|
|
where nuserid = #{userId, jdbcType=VARCHAR}
|
|
|
|
|
</select>
|
|
|
|
|
<update id="updateVisitTime">
|
|
|
|
|
update bda_operator_oauth
|
|
|
|
|
set visit_time = cast(current_timestamp(0) as timestamp without time zone)
|
|
|
|
|
where trim(oauthuserid) = #{oauthUserId, jdbcType=VARCHAR}
|
|
|
|
|
</update>
|
|
|
|
|
<select id="getDepartmentListShort" resultType="com.hisense.hiatmp.model.common.DepartmentVO">
|
|
|
|
|
select t.*
|
|
|
|
|
from department t
|
|
|
|
|
order by t.cdepartmentcode asc
|
|
|
|
|
</select>
|
|
|
|
|
<select id="getMenuById" resultType="com.hisense.hiatmp.server_api.model.Menu">
|
|
|
|
|
select *
|
|
|
|
|
from menu m
|
|
|
|
|
where m.id = #{id}
|
|
|
|
|
|
|
|
|
|
</select>
|
|
|
|
|
</mapper>
|