门禁 人员闸机相关接口
parent
905576b68b
commit
577df3bc45
|
@ -0,0 +1,25 @@
|
||||||
|
package com.zcloud.mapper.datasource.map;
|
||||||
|
|
||||||
|
import com.zcloud.entity.Page;
|
||||||
|
import com.zcloud.entity.PageData;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 说明:TODO
|
||||||
|
* 作者:wangxuan
|
||||||
|
* 官网:www.zcloudchina.com
|
||||||
|
*/
|
||||||
|
@Mapper
|
||||||
|
public interface GateAreaMapMapper {
|
||||||
|
List<PageData> getDatalistPage(Page page);
|
||||||
|
|
||||||
|
void edit(PageData pd);
|
||||||
|
|
||||||
|
void removeByIds(PageData pageData);
|
||||||
|
|
||||||
|
void save(PageData pageData);
|
||||||
|
|
||||||
|
List<PageData> getGatePosition(PageData pageData);
|
||||||
|
}
|
|
@ -0,0 +1,48 @@
|
||||||
|
package com.zcloud.mapper.datasource.map;
|
||||||
|
|
||||||
|
import com.zcloud.entity.Page;
|
||||||
|
import com.zcloud.entity.PageData;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 说明:TODO
|
||||||
|
* 作者:wangxuan
|
||||||
|
* 官网:www.zcloudchina.com
|
||||||
|
*/
|
||||||
|
@Mapper
|
||||||
|
public interface GateMachineMapMapper {
|
||||||
|
ArrayList<PageData> getDatalistPage(Page page);
|
||||||
|
|
||||||
|
void edit(PageData pd);
|
||||||
|
|
||||||
|
void removeByIds(PageData pageData);
|
||||||
|
|
||||||
|
void save(PageData pageData);
|
||||||
|
|
||||||
|
List<PageData> getOnlineGateMachine(PageData pageData);
|
||||||
|
|
||||||
|
List<PageData> getTodayInOutCount(PageData pageData);
|
||||||
|
|
||||||
|
// 弃用 因需求变更
|
||||||
|
List<PageData> getGatePosition(PageData pageData);
|
||||||
|
|
||||||
|
PageData getGateMachineInfoById(PageData pageData);
|
||||||
|
|
||||||
|
List<PageData> getPersonRecordCountByEId(PageData gateMachineInfo);
|
||||||
|
|
||||||
|
List<PageData> getCarRecordCountByEId(PageData gateMachineInfo);
|
||||||
|
|
||||||
|
List<PageData> getCarRecordCountByCorpId(PageData gateMachineInfo);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 今天闸机的进出记录
|
||||||
|
* @param gateMachineInfo
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<PageData> getPersonRecordListAllByIdlistPage(Page page);
|
||||||
|
|
||||||
|
String[] getMachineEquipmentIdsByAreaId(PageData pageData);
|
||||||
|
}
|
|
@ -83,12 +83,12 @@ public class GateMachineServiceImpl implements GateMachineService {
|
||||||
@Override
|
@Override
|
||||||
public List<PageData> getGatePosition(PageData pageData) {
|
public List<PageData> getGatePosition(PageData pageData) {
|
||||||
// todo 需求变更,现在闸机变成了区域
|
// todo 需求变更,现在闸机变成了区域
|
||||||
if (pageData.getString("TYPE").equals("PERSON")) {
|
if (pageData.getString("TYPE").equals("PERSON_MACHINE")) {
|
||||||
pageData.put("GATE_AREA_TYPE", 0);
|
pageData.put("GATE_AREA_TYPE", 0);
|
||||||
// 人闸机定位
|
// 人闸机定位
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pageData.getString("TYPE").equals("CAR")) {
|
if (pageData.getString("TYPE").equals("CAR_MACHINE")) {
|
||||||
// 车闸机定位
|
// 车闸机定位
|
||||||
pageData.put("GATE_AREA_TYPE", 1);
|
pageData.put("GATE_AREA_TYPE", 1);
|
||||||
}
|
}
|
||||||
|
@ -100,6 +100,8 @@ public class GateMachineServiceImpl implements GateMachineService {
|
||||||
return gateAreaMapper.getGatePosition(pageData);
|
return gateAreaMapper.getGatePosition(pageData);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public PageData getGateMachineInfoById(PageData pageData) {
|
public PageData getGateMachineInfoById(PageData pageData) {
|
||||||
return gateMachineMapper.getGateMachineInfoById(pageData);
|
return gateMachineMapper.getGateMachineInfoById(pageData);
|
||||||
|
|
|
@ -0,0 +1,7 @@
|
||||||
|
package com.zcloud.service.map;
|
||||||
|
|
||||||
|
import com.zcloud.entity.PageData;
|
||||||
|
|
||||||
|
public interface MapService {
|
||||||
|
String[] getGateIdsByGateAreaId(PageData pageData);
|
||||||
|
}
|
|
@ -0,0 +1,17 @@
|
||||||
|
package com.zcloud.service.map.impl;
|
||||||
|
|
||||||
|
import com.zcloud.entity.PageData;
|
||||||
|
import com.zcloud.mapper.datasource.map.GateMachineMapMapper;
|
||||||
|
import com.zcloud.service.map.MapService;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
public class MapServiceImpl implements MapService {
|
||||||
|
@Autowired
|
||||||
|
private GateMachineMapMapper gateMachineMapMapper;
|
||||||
|
@Override
|
||||||
|
public String[] getGateIdsByGateAreaId(PageData pageData) {
|
||||||
|
return gateMachineMapMapper.getMachineEquipmentIdsByAreaId(pageData);
|
||||||
|
}
|
||||||
|
}
|
|
@ -128,6 +128,20 @@ public class HKUtil {
|
||||||
return returnMap;
|
return returnMap;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取监控点预览取流URL
|
||||||
|
* @param id 设备编号
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static Map<String,Object> getDoorComeAndOutInfo(String[] ids,String pageNo,String pageSize){
|
||||||
|
JSONObject jsonBody = new JSONObject();
|
||||||
|
jsonBody.put("doorIndexCodes",ids);
|
||||||
|
jsonBody.put("pageNo",pageNo);
|
||||||
|
jsonBody.put("pageSize",pageSize);
|
||||||
|
Map<String,Object> returnMap = publicHkInterface(jsonBody,"/api/acs/v2/door/events");
|
||||||
|
return returnMap;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* API名称:
|
* API名称:
|
||||||
* 查询监控点列表v2
|
* 查询监控点列表v2
|
||||||
|
|
|
@ -66,6 +66,7 @@
|
||||||
select LONGITUDE,
|
select LONGITUDE,
|
||||||
LATITUDE,
|
LATITUDE,
|
||||||
GATE_AREA_NAME,
|
GATE_AREA_NAME,
|
||||||
|
GATE_AREA_NAME as MAP_POINT_NAME,
|
||||||
'${TYPE}' TYPE,
|
'${TYPE}' TYPE,
|
||||||
GATE_AREA_ID id
|
GATE_AREA_ID id
|
||||||
FROM
|
FROM
|
||||||
|
|
|
@ -0,0 +1,104 @@
|
||||||
|
<?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.zcloud.mapper.datasource.map.GateAreaMapMapper">
|
||||||
|
<sql id="table"> mk_gate_area </sql>
|
||||||
|
<sql id="filed">
|
||||||
|
f.GATE_AREA_ID,
|
||||||
|
f.GATE_AREA_NAME,
|
||||||
|
f.GATE_AREA_TYPE,
|
||||||
|
f.LATITUDE,
|
||||||
|
f.LONGITUDE,
|
||||||
|
f.CORPINFO_ID,
|
||||||
|
f.ISDELETE,
|
||||||
|
f.CREATOR,
|
||||||
|
f.CREATTIME,
|
||||||
|
f.OPERATOR,
|
||||||
|
f.OPERATTIME
|
||||||
|
</sql>
|
||||||
|
<insert id="save">
|
||||||
|
INSERT INTO <include refid="table"></include>
|
||||||
|
(
|
||||||
|
GATE_AREA_ID,
|
||||||
|
GATE_AREA_NAME,
|
||||||
|
GATE_AREA_TYPE,
|
||||||
|
LATITUDE,
|
||||||
|
LONGITUDE,
|
||||||
|
CORPINFO_ID,
|
||||||
|
ISDELETE,
|
||||||
|
CREATOR,
|
||||||
|
CREATTIME,
|
||||||
|
OPERATOR,
|
||||||
|
OPERATTIME
|
||||||
|
)
|
||||||
|
VALUES (
|
||||||
|
#{GATE_AREA_ID},
|
||||||
|
#{GATE_AREA_NAME},
|
||||||
|
#{GATE_AREA_TYPE},
|
||||||
|
#{LATITUDE},
|
||||||
|
#{LONGITUDE},
|
||||||
|
#{CORPINFO_ID},
|
||||||
|
#{ISDELETE},
|
||||||
|
#{CREATOR},
|
||||||
|
#{CREATTIME},
|
||||||
|
#{OPERATOR},
|
||||||
|
#{OPERATTIME}
|
||||||
|
)
|
||||||
|
</insert>
|
||||||
|
<select id="getDatalistPage" resultType="com.zcloud.entity.PageData">
|
||||||
|
select <include refid="filed"></include>, CONCAT_WS('--', f.LATITUDE,f.LONGITUDE) LONGTITUDEANDLATITUDE,
|
||||||
|
(select count(1) from BUS_GATEVIDEO v where v.GATE_AREA_ID = f.GATE_AREA_ID and v.ISDELETE = '0') as VIDEO_COUNT,
|
||||||
|
(select count(1) from mk_gate_machine m where m.GATE_AREA_ID = f.GATE_AREA_ID and m.ISDELETE = '0') as GATE_COUNT
|
||||||
|
from
|
||||||
|
<include refid="table"></include> f where f.ISDELETE = 0
|
||||||
|
<if test="pd.GATE_AREA_NAME != null and pd.GATE_AREA_NAME != ''">
|
||||||
|
and f.GATE_AREA_NAME like CONCAT(CONCAT('%', #{pd.GATE_AREA_NAME}),'%')
|
||||||
|
</if>
|
||||||
|
<if test="pd.CORPINFO_ID != null and pd.CORPINFO_ID != ''">
|
||||||
|
and f.CORPINFO_ID = #{pd.CORPINFO_ID}
|
||||||
|
</if>
|
||||||
|
<if test="pd.GATE_AREA_TYPE != null and pd.GATE_AREA_TYPE != ''">
|
||||||
|
and f.GATE_AREA_TYPE = #{pd.GATE_AREA_TYPE}
|
||||||
|
</if>
|
||||||
|
order by f.OPERATTIME desc
|
||||||
|
</select>
|
||||||
|
<select id="getGatePosition" resultType="com.zcloud.entity.PageData">
|
||||||
|
select LONGITUDE,
|
||||||
|
LATITUDE,
|
||||||
|
GATE_AREA_NAME,
|
||||||
|
GATE_AREA_NAME as MAP_POINT_NAME,
|
||||||
|
'${TYPE}' TYPE,
|
||||||
|
GATE_AREA_ID id
|
||||||
|
FROM
|
||||||
|
mk_gate_area
|
||||||
|
WHERE
|
||||||
|
isdelete = 0 and GATE_AREA_TYPE = #{GATE_AREA_TYPE}
|
||||||
|
<if test="AREA != null and AREA != ''">
|
||||||
|
and CORPINFO_ID in (select CORPINFO_ID from bus_corp_info where AREA = #{AREA} and ISDELETE = 0)
|
||||||
|
</if>
|
||||||
|
<if test="CORPINFO_ID != null and CORPINFO_ID != ''">
|
||||||
|
and CORPINFO_ID = #{CORPINFO_ID}
|
||||||
|
</if>
|
||||||
|
</select>
|
||||||
|
<update id="edit">
|
||||||
|
update
|
||||||
|
<include refid="table"></include>
|
||||||
|
set
|
||||||
|
GATE_AREA_NAME = #{GATE_AREA_NAME},
|
||||||
|
GATE_AREA_TYPE = #{GATE_AREA_TYPE},
|
||||||
|
LONGITUDE = #{LONGITUDE},
|
||||||
|
LATITUDE = #{LATITUDE},
|
||||||
|
CORPINFO_ID = #{CORPINFO_ID},
|
||||||
|
OPERATOR = #{OPERATOR},
|
||||||
|
OPERATTIME = #{OPERATTIME}
|
||||||
|
where
|
||||||
|
GATE_AREA_ID = #{GATE_AREA_ID}
|
||||||
|
</update>
|
||||||
|
<update id="removeByIds">
|
||||||
|
update mk_gate_area
|
||||||
|
set ISDELETE = 1
|
||||||
|
where GATE_AREA_ID in
|
||||||
|
<foreach collection="list" item="item" open="(" separator="," close=")">
|
||||||
|
#{item}
|
||||||
|
</foreach>
|
||||||
|
</update>
|
||||||
|
</mapper>
|
|
@ -0,0 +1,356 @@
|
||||||
|
<?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.zcloud.mapper.datasource.map.GateMachineMapMapper">
|
||||||
|
<sql id="table"> mk_gate_machine </sql>
|
||||||
|
|
||||||
|
<sql id="filed">
|
||||||
|
f
|
||||||
|
.
|
||||||
|
GATE_MACHINE_ID
|
||||||
|
,
|
||||||
|
f.GATE_MACHINE_TYPE,
|
||||||
|
f.EQUIPMENTID,
|
||||||
|
f.GATE_MACHINE_MODEL,
|
||||||
|
f.GATE_MACHINE_NAME,
|
||||||
|
f.STATE,
|
||||||
|
f.DESCR,
|
||||||
|
f.LATITUDE,
|
||||||
|
f.LONGITUDE,
|
||||||
|
f.CORPINFO_ID,
|
||||||
|
f.CREATOR,
|
||||||
|
f.CREATTIME,
|
||||||
|
f.OPERATOR,
|
||||||
|
f.OPERATTIME,
|
||||||
|
f.REMAKE
|
||||||
|
</sql>
|
||||||
|
<insert id="save">
|
||||||
|
INSERT INTO mk_gate_machine
|
||||||
|
(
|
||||||
|
GATE_MACHINE_ID,
|
||||||
|
GATE_AREA_ID,
|
||||||
|
GATE_MACHINE_NAME,
|
||||||
|
GATE_MACHINE_TYPE,
|
||||||
|
EQUIPMENTID,
|
||||||
|
GATE_MACHINE_MODEL,
|
||||||
|
STATE,
|
||||||
|
DESCR,
|
||||||
|
LONGITUDE,
|
||||||
|
LATITUDE,
|
||||||
|
CORPINFO_ID,
|
||||||
|
CREATOR,
|
||||||
|
CREATTIME,
|
||||||
|
OPERATOR,
|
||||||
|
OPERATTIME)
|
||||||
|
VALUES (#{GATE_MACHINE_ID},
|
||||||
|
#{GATE_AREA_ID},
|
||||||
|
#{GATE_MACHINE_NAME},
|
||||||
|
#{GATE_MACHINE_TYPE},
|
||||||
|
#{EQUIPMENTID},
|
||||||
|
#{GATE_MACHINE_MODEL},
|
||||||
|
#{STATE},
|
||||||
|
#{DESCR},
|
||||||
|
#{LONGITUDE},
|
||||||
|
#{LATITUDE},
|
||||||
|
#{CORPINFO_ID},
|
||||||
|
#{CREATOR},
|
||||||
|
#{CREATTIME},
|
||||||
|
#{OPERATOR},
|
||||||
|
#{OPERATTIME})
|
||||||
|
</insert>
|
||||||
|
<select id="getDatalistPage" resultType="com.zcloud.entity.PageData">
|
||||||
|
select <include refid="filed"></include>, CONCAT_WS('--', f.LATITUDE,f.LONGITUDE) LONGTITUDEANDLATITUDE
|
||||||
|
from
|
||||||
|
mk_gate_machine f where ISDELETE = 0
|
||||||
|
<if test="pd.GATE_MACHINE_NAME != null and pd.GATE_MACHINE_NAME != ''">
|
||||||
|
and f.GATE_MACHINE_NAME like CONCAT(CONCAT('%', #{pd.GATE_MACHINE_NAME}),'%')
|
||||||
|
</if>
|
||||||
|
<if test="pd.GATE_AREA_ID != null and pd.GATE_AREA_ID != ''">
|
||||||
|
and f.GATE_AREA_ID = #{pd.GATE_AREA_ID}
|
||||||
|
</if>
|
||||||
|
<if test="pd.GATE_MACHINE_TYPE != null and pd.GATE_MACHINE_TYPE != ''">
|
||||||
|
and f.GATE_MACHINE_TYPE = #{pd.GATE_MACHINE_TYPE}
|
||||||
|
</if>
|
||||||
|
<if test="pd.GATE_MACHINE_MODEL != null and pd.GATE_MACHINE_MODEL != ''">
|
||||||
|
and f.GATE_MACHINE_MODEL like CONCAT(CONCAT('%', #{pd.GATE_MACHINE_MODEL}),'%')
|
||||||
|
</if>
|
||||||
|
</select>
|
||||||
|
<select id="getOnlineGateMachine" resultType="com.zcloud.entity.PageData">
|
||||||
|
SELECT
|
||||||
|
'PERSON_OUT' TYPE,
|
||||||
|
COUNT( 1 ) COUNT
|
||||||
|
FROM
|
||||||
|
`bus_carduser` f
|
||||||
|
WHERE
|
||||||
|
f.TIME BETWEEN CONCAT( DATE_FORMAT( now(), '%Y-%m-%d' ), ' 00:00:00' )
|
||||||
|
AND CONCAT( DATE_FORMAT( now(), '%Y-%m-%d' ), ' 23:59:59' )
|
||||||
|
AND STATE = 1
|
||||||
|
<if test="AREA != null and AREA != ''">
|
||||||
|
and CORPINFO_ID in (select CORPINFO_ID from bus_corp_info where AREA = #{AREA} and ISDELETE = 0)
|
||||||
|
</if>
|
||||||
|
<if test="CORP_INFO_ID != null and CORP_INFO_ID != ''">
|
||||||
|
and CORPINFO_ID = #{CORP_INFO_ID}
|
||||||
|
</if>
|
||||||
|
UNION ALL
|
||||||
|
SELECT
|
||||||
|
'PERSON_IN' TYPE,
|
||||||
|
COUNT( 1 ) count
|
||||||
|
FROM
|
||||||
|
`bus_carduser` f
|
||||||
|
WHERE
|
||||||
|
f.TIME BETWEEN CONCAT( DATE_FORMAT( now(), '%Y-%m-%d' ), ' 00:00:00' )
|
||||||
|
AND CONCAT( DATE_FORMAT( now(), '%Y-%m-%d' ), ' 23:59:59' )
|
||||||
|
AND STATE = 0
|
||||||
|
<if test="AREA != null and AREA != ''">
|
||||||
|
and CORPINFO_ID in (select CORPINFO_ID from bus_corp_info where AREA = #{AREA} and ISDELETE = 0)
|
||||||
|
</if>
|
||||||
|
<if test="CORP_INFO_ID != null and CORP_INFO_ID != ''">
|
||||||
|
and CORPINFO_ID = #{CORP_INFO_ID}
|
||||||
|
</if>
|
||||||
|
UNION ALL
|
||||||
|
SELECT
|
||||||
|
'CAR_IN' TYPE,
|
||||||
|
IFNULL( COUNT( 1 ), 0 ) COUNT
|
||||||
|
FROM
|
||||||
|
bus_foreigncar c
|
||||||
|
WHERE
|
||||||
|
c.ISDELETE = 0 and
|
||||||
|
c.TIME_IN BETWEEN CONCAT( DATE_FORMAT( now(), '%Y-%m-%d' ), ' 00:00:00' )
|
||||||
|
AND CONCAT( DATE_FORMAT( now(), '%Y-%m-%d' ), ' 23:59:59' )
|
||||||
|
<if test="AREA != null and AREA != ''">
|
||||||
|
and CORPINFO_ID in (select CORPINFO_ID from bus_corp_info where AREA = #{AREA} and ISDELETE = 0)
|
||||||
|
</if>
|
||||||
|
<if test="CORP_INFO_ID != null and CORP_INFO_ID != ''">
|
||||||
|
and CORPINFO_ID = #{CORP_INFO_ID}
|
||||||
|
</if>
|
||||||
|
UNION ALL
|
||||||
|
SELECT
|
||||||
|
'CAR_OUT' TYPE,
|
||||||
|
IFNULL( COUNT( 1 ), 0 ) COUNT
|
||||||
|
FROM
|
||||||
|
bus_foreigncar c
|
||||||
|
WHERE
|
||||||
|
c.ISDELETE = 0 and
|
||||||
|
c.TIME_OUT BETWEEN CONCAT( DATE_FORMAT( now(), '%Y-%m-%d' ), ' 00:00:00' )
|
||||||
|
AND CONCAT( DATE_FORMAT( now(), '%Y-%m-%d' ), ' 23:59:59' )
|
||||||
|
<if test="AREA != null and AREA != ''">
|
||||||
|
and CORPINFO_ID in (select CORPINFO_ID from bus_corp_info where AREA = #{AREA} and ISDELETE = 0)
|
||||||
|
</if>
|
||||||
|
<if test="CORP_INFO_ID != null and CORP_INFO_ID != ''">
|
||||||
|
and CORPINFO_ID = #{CORP_INFO_ID}
|
||||||
|
</if>
|
||||||
|
UNION ALL
|
||||||
|
SELECT
|
||||||
|
'CAMERA' TYPE,
|
||||||
|
IFNULL( COUNT( 1 ), 0 ) COUNT
|
||||||
|
FROM
|
||||||
|
bus_gatevideo v
|
||||||
|
LEFT JOIN mk_gate_area o on v.GATE_AREA_ID = o.GATE_AREA_ID
|
||||||
|
WHERE
|
||||||
|
v.isdelete = 0
|
||||||
|
<if test="AREA != null and AREA != ''">
|
||||||
|
and o.CORPINFO_ID in (select CORPINFO_ID from bus_corp_info where AREA = #{AREA} and ISDELETE = 0)
|
||||||
|
</if>
|
||||||
|
<if test="CORP_INFO_ID != null and CORP_INFO_ID != ''">
|
||||||
|
and o.CORPINFO_ID = #{CORP_INFO_ID}
|
||||||
|
</if>
|
||||||
|
|
||||||
|
</select>
|
||||||
|
<select id="getTodayInOutCount" resultType="com.zcloud.entity.PageData">
|
||||||
|
SELECT
|
||||||
|
f.EQUIPMENTID,
|
||||||
|
COUNT( 1 ) COUNT,
|
||||||
|
m.GATE_MACHINE_NAME
|
||||||
|
FROM
|
||||||
|
bus_carduser f
|
||||||
|
LEFT JOIN mk_gate_machine m ON f.EQUIPMENTID = m.EQUIPMENTID
|
||||||
|
WHERE
|
||||||
|
f.TIME > CONCAT( DATE_FORMAT( now(), '%Y-%m-%d' ), ' 00:00:00' )
|
||||||
|
<if test="AREA != null and AREA != ''">
|
||||||
|
and m.CORPINFO_ID in (select CORPINFO_ID from bus_corp_info where AREA = #{AREA} and ISDELETE = 0)
|
||||||
|
</if>
|
||||||
|
<if test="CORP_INFO_ID != null and CORP_INFO_ID != ''">
|
||||||
|
and m.CORPINFO_ID = #{CORP_INFO_ID}
|
||||||
|
</if>
|
||||||
|
<if test="CORPINFO_ID != null and CORPINFO_ID != ''">
|
||||||
|
and m.CORPINFO_ID = #{CORPINFO_ID}
|
||||||
|
</if>
|
||||||
|
|
||||||
|
GROUP BY
|
||||||
|
f.EQUIPMENTID
|
||||||
|
ORDER BY
|
||||||
|
GATE_MACHINE_NAME DESC
|
||||||
|
</select>
|
||||||
|
<select id="getGatePosition" resultType="com.zcloud.entity.PageData">
|
||||||
|
select LONGITUDE,
|
||||||
|
LATITUDE,
|
||||||
|
GATE_MACHINE_NAME,
|
||||||
|
'${TYPE}' TYPE,
|
||||||
|
GATE_MACHINE_ID id
|
||||||
|
FROM
|
||||||
|
mk_gate_machine
|
||||||
|
WHERE
|
||||||
|
isdelete = 0
|
||||||
|
and GATE_MACHINE_TYPE = #{GATE_MACHINE_TYPE}
|
||||||
|
<if test="AREA != null and AREA != ''">
|
||||||
|
and CORPINFO_ID in (select CORPINFO_ID from bus_corp_info where AREA = #{AREA} and ISDELETE = 0)
|
||||||
|
</if>
|
||||||
|
<if test="CORP_INFO_ID != null and CORP_INFO_ID != ''">
|
||||||
|
and CORPINFO_ID = #{CORP_INFO_ID}
|
||||||
|
</if>
|
||||||
|
</select>
|
||||||
|
<select id="getGateMachineInfoById" resultType="com.zcloud.entity.PageData">
|
||||||
|
SELECT
|
||||||
|
r.GATE_AREA_NAME,
|
||||||
|
GROUP_CONCAT( f.GATE_MACHINE_NAME ) GATE_MACHINE_NAME,
|
||||||
|
GROUP_CONCAT( DISTINCT f.GATE_MACHINE_MODEL ) GATE_MACHINE_MODEL,
|
||||||
|
GROUP_CONCAT( DISTINCT r.CORPINFO_ID ) CORPINFO_ID,
|
||||||
|
GROUP_CONCAT( f.EQUIPMENTID ) EQUIPMENTID
|
||||||
|
FROM
|
||||||
|
mk_gate_machine f
|
||||||
|
LEFT JOIN mk_gate_area r ON r.GATE_AREA_ID = f.GATE_AREA_ID
|
||||||
|
|
||||||
|
left join bus_gatevideo v on v.GATE_AREA_ID = f.GATE_AREA_ID
|
||||||
|
WHERE
|
||||||
|
f.ISDELETE = 0
|
||||||
|
<if test="GATE_AREA_ID != null and GATE_AREA_ID != ''" >
|
||||||
|
and f.GATE_AREA_ID = #{GATE_AREA_ID}
|
||||||
|
</if>
|
||||||
|
<if test="GATEVIDEO_ID != null and GATEVIDEO_ID != ''" >
|
||||||
|
AND v.GATEVIDEO_ID = #{GATEVIDEO_ID}
|
||||||
|
</if>
|
||||||
|
|
||||||
|
GROUP BY
|
||||||
|
f.GATE_AREA_ID
|
||||||
|
</select>
|
||||||
|
<select id="getPersonRecordCountByEId" resultType="com.zcloud.entity.PageData">
|
||||||
|
SELECT
|
||||||
|
COUNT( 1 ) COUNT,
|
||||||
|
CASE
|
||||||
|
STATE
|
||||||
|
WHEN 0 THEN
|
||||||
|
'PERSON_IN' ELSE 'PERSON_OUT'
|
||||||
|
END TYPE
|
||||||
|
FROM
|
||||||
|
bus_carduser
|
||||||
|
WHERE
|
||||||
|
EQUIPMENTID in <foreach collection="array" item="item" open="(" separator="," close=")">
|
||||||
|
#{item}
|
||||||
|
</foreach>
|
||||||
|
AND TIME BETWEEN CONCAT( DATE_FORMAT( now(), '%Y-%m-%d' ), ' 00:00:00' )
|
||||||
|
AND CONCAT( DATE_FORMAT( now(), '%Y-%m-%d' ), ' 23:59:59' )
|
||||||
|
GROUP BY
|
||||||
|
STATE
|
||||||
|
</select>
|
||||||
|
<select id="getCarRecordCountByEId" resultType="com.zcloud.entity.PageData">
|
||||||
|
SELECT
|
||||||
|
COUNT( 1 ) COUNT,
|
||||||
|
'CAR_IN' TYPE
|
||||||
|
FROM
|
||||||
|
bus_foreigncar
|
||||||
|
WHERE
|
||||||
|
EQUIPMENTID in
|
||||||
|
<foreach collection="array" item="item" open="(" separator="," close=")">
|
||||||
|
#{item}
|
||||||
|
</foreach>
|
||||||
|
AND TIME_IN BETWEEN CONCAT( DATE_FORMAT( now(), '%Y-%m-%d' ), ' 00:00:00' )
|
||||||
|
AND CONCAT( DATE_FORMAT( now(), '%Y-%m-%d' ), ' 23:59:59' ) UNION ALL
|
||||||
|
SELECT
|
||||||
|
COUNT( 1 ) COUNT,
|
||||||
|
'CAR_OUT' TYPE
|
||||||
|
FROM
|
||||||
|
bus_foreigncar
|
||||||
|
WHERE
|
||||||
|
EQUIPMENTID in
|
||||||
|
<foreach collection="array" item="item" open="(" separator="," close=")">
|
||||||
|
#{item}
|
||||||
|
</foreach>
|
||||||
|
AND TIME_OUT BETWEEN CONCAT( DATE_FORMAT( now(), '%Y-%m-%d' ), ' 00:00:00' )
|
||||||
|
AND CONCAT( DATE_FORMAT( now(), '%Y-%m-%d' ), ' 23:59:59' )
|
||||||
|
</select>
|
||||||
|
<select id="getCarRecordCountByCorpId" resultType="com.zcloud.entity.PageData">
|
||||||
|
SELECT
|
||||||
|
COUNT( 1 ) COUNT,
|
||||||
|
'CAR_IN' TYPE
|
||||||
|
FROM
|
||||||
|
bus_foreigncar
|
||||||
|
WHERE
|
||||||
|
ISDELETE = 0
|
||||||
|
and CORPINFO_ID = #{CORPINFO_ID}
|
||||||
|
AND TIME_IN BETWEEN CONCAT( DATE_FORMAT( now(), '%Y-%m-%d' ), ' 00:00:00' )
|
||||||
|
AND CONCAT( DATE_FORMAT( now(), '%Y-%m-%d' ), ' 23:59:59' ) UNION ALL
|
||||||
|
SELECT
|
||||||
|
COUNT( 1 ) COUNT,
|
||||||
|
'CAR_OUT' TYPE
|
||||||
|
FROM
|
||||||
|
bus_foreigncar
|
||||||
|
WHERE
|
||||||
|
ISDELETE = 0
|
||||||
|
and CORPINFO_ID = #{CORPINFO_ID}
|
||||||
|
AND TIME_OUT BETWEEN CONCAT( DATE_FORMAT( now(), '%Y-%m-%d' ), ' 00:00:00' )
|
||||||
|
AND CONCAT( DATE_FORMAT( now(), '%Y-%m-%d' ), ' 23:59:59' )
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<update id="edit">
|
||||||
|
update
|
||||||
|
<include refid="table"></include>
|
||||||
|
set
|
||||||
|
GATE_MACHINE_TYPE = #{GATE_MACHINE_TYPE},
|
||||||
|
GATE_MACHINE_MODEL = #{GATE_MACHINE_MODEL},
|
||||||
|
GATE_MACHINE_NAME = #{GATE_MACHINE_NAME},
|
||||||
|
STATE = #{STATE},
|
||||||
|
DESCR = #{DESCR},
|
||||||
|
LONGITUDE = #{LONGITUDE},
|
||||||
|
LATITUDE = #{LATITUDE},
|
||||||
|
CORPINFO_ID = #{CORPINFO_ID},
|
||||||
|
OPERATOR = #{OPERATOR},
|
||||||
|
OPERATTIME = #{OPERATTIME},
|
||||||
|
REMAKE = #{REMAKE}
|
||||||
|
where
|
||||||
|
GATE_MACHINE_ID = #{GATE_MACHINE_ID}
|
||||||
|
</update>
|
||||||
|
|
||||||
|
<update id="removeByIds">
|
||||||
|
update mk_gate_machine
|
||||||
|
set ISDELETE = 1
|
||||||
|
where GATE_MACHINE_ID in
|
||||||
|
<foreach collection="list" item="item" open="(" separator="," close=")">
|
||||||
|
#{item}
|
||||||
|
</foreach>
|
||||||
|
</update>
|
||||||
|
|
||||||
|
|
||||||
|
<select id="getPersonRecordListAllByIdlistPage" resultType="com.zcloud.entity.PageData">
|
||||||
|
SELECT
|
||||||
|
f.*
|
||||||
|
from bus_carduser f
|
||||||
|
WHERE
|
||||||
|
1=1
|
||||||
|
and f.EQUIPMENTID in (select EQUIPMENTID from mk_gate_machine where GATE_AREA_ID = #{pd.GATE_AREA_ID})
|
||||||
|
AND f.TIME BETWEEN CONCAT( DATE_FORMAT( now(), '%Y-%m-%d' ), ' 00:00:00' )
|
||||||
|
AND CONCAT( DATE_FORMAT( now(), '%Y-%m-%d' ), ' 23:59:59' )
|
||||||
|
order by f.time desc
|
||||||
|
</select>
|
||||||
|
|
||||||
|
|
||||||
|
<select id="listHkDoor" resultType="com.zcloud.entity.PageData">
|
||||||
|
SELECT
|
||||||
|
f.*
|
||||||
|
from bus_carduser f
|
||||||
|
WHERE
|
||||||
|
1=1
|
||||||
|
and f.EQUIPMENTID in (select EQUIPMENTID from mk_gate_machine where GATE_AREA_ID = #{pd.GATE_AREA_ID})
|
||||||
|
AND f.TIME BETWEEN CONCAT( DATE_FORMAT( now(), '%Y-%m-%d' ), ' 00:00:00' )
|
||||||
|
AND CONCAT( DATE_FORMAT( now(), '%Y-%m-%d' ), ' 23:59:59' )
|
||||||
|
order by f.time desc
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="getMachineEquipmentIdsByAreaId" resultType="String">
|
||||||
|
SELECT
|
||||||
|
f.EQUIPMENTID
|
||||||
|
FROM
|
||||||
|
mk_gate_machine f
|
||||||
|
WHERE
|
||||||
|
f.GATE_AREA_ID = #{GATE_AREA_ID}
|
||||||
|
AND f.ISDELETE = '0'
|
||||||
|
</select>
|
||||||
|
</mapper>
|
Loading…
Reference in New Issue