地图门口门禁和首页统计更改

0927cmt
songwenxuan 2024-06-03 15:54:38 +08:00
parent b20f28af7b
commit 732098c55f
5 changed files with 97 additions and 3 deletions

View File

@ -173,4 +173,16 @@ public class MkmjRelationController extends BaseController {
map.put("result", errInfo); map.put("result", errInfo);
return map; return map;
} }
@RequestMapping(value="/getAllCarAndPeopleInfoCountByArea")
@ResponseBody
public Object getAllCarAndPeopleInfoCountByArea() throws Exception{
Map<String,Object> map = new HashMap<String,Object>();
String errInfo = "success";
PageData pd = this.getPageData();
List<PageData> varList = mkmjRelationService.getAllCarAndPeopleInfoCountByArea(pd); //列出人闸机信息列表
map.put("varList", varList);
map.put("result", errInfo);
return map;
}
} }

View File

@ -45,6 +45,8 @@ public interface MkmjRelationMapper {
List<PageData> listAllForArea(PageData pd); List<PageData> listAllForArea(PageData pd);
List<PageData> getAllCarAndPeopleInfoCountByArea(PageData pd);
List<PageData> getCarAndPeopleInfolistPage(Page page); List<PageData> getCarAndPeopleInfolistPage(Page page);
/**id /**id

View File

@ -45,6 +45,8 @@ public interface MkmjRelationService {
public List<PageData> listAllForArea(PageData pd)throws Exception; public List<PageData> listAllForArea(PageData pd)throws Exception;
public List<PageData> getAllCarAndPeopleInfoCountByArea(PageData pd)throws Exception;
public List<PageData> getCarAndPeopleInfolistPage(Page page)throws Exception; public List<PageData> getCarAndPeopleInfolistPage(Page page)throws Exception;
/**id /**id

View File

@ -91,6 +91,14 @@ public class MkmjRelationServiceImpl implements MkmjRelationService {
return mkmjRelationMapper.listAllForArea(pd); return mkmjRelationMapper.listAllForArea(pd);
} }
/**()
* @param pd
* @throws Exception
*/
public List<PageData> getAllCarAndPeopleInfoCountByArea(PageData pd)throws Exception{
return mkmjRelationMapper.getAllCarAndPeopleInfoCountByArea(pd);
}
/**() /**()
* @param pd * @param pd
* @throws Exception * @throws Exception

View File

@ -146,7 +146,8 @@
(CASE WHEN r.TYPE = '0' THEN '入口' ELSE '出口' END) STATUS, (CASE WHEN r.TYPE = '0' THEN '入口' ELSE '出口' END) STATUS,
DATE_FORMAT(i.eventTime,'%Y-%m-%d %H:%i:%s') TIME, DATE_FORMAT(i.eventTime,'%Y-%m-%d %H:%i:%s') TIME,
i.readerDevName BAYNAME, i.readerDevName BAYNAME,
i.devName DOORNAME i.devName DOORNAME,
'person' AS TYPE
FROM FROM
mkmj_area f mkmj_area f
LEFT JOIN mkmj_relation r ON f.AREA_ID = r.AREA_ID AND r.ISDELETE = '0' LEFT JOIN mkmj_relation r ON f.AREA_ID = r.AREA_ID AND r.ISDELETE = '0'
@ -165,13 +166,14 @@
i.personName LIKE CONCAT(CONCAT('%', #{pd.KEYWORDS}),'%') i.personName LIKE CONCAT(CONCAT('%', #{pd.KEYWORDS}),'%')
) )
</if> </if>
GROUP BY i.MACHINE_INFO_ID UNION ALL GROUP BY i.MACHINE_INFO_ID UNION ALL
SELECT SELECT
i.PLATENO NAME, i.PLATENO NAME,
(CASE WHEN r.TYPE = '0' THEN '入口' ELSE '出口' END) STATUS, (CASE WHEN r.TYPE = '0' THEN '入口' ELSE '出口' END) STATUS,
DATE_FORMAT(i.CROSSTIME,'%Y-%m-%d %H:%i:%s') TIME, DATE_FORMAT(i.CROSSTIME,'%Y-%m-%d %H:%i:%s') TIME,
ENTRANCENAME BAYNAME, ENTRANCENAME BAYNAME,
ROADWAYNAME DOORNAME ROADWAYNAME DOORNAME,
'car' AS TYPE
FROM FROM
mkmj_area f mkmj_area f
LEFT JOIN mkmj_relation r ON f.AREA_ID = r.AREA_ID AND r.ISDELETE = '0' LEFT JOIN mkmj_relation r ON f.AREA_ID = r.AREA_ID AND r.ISDELETE = '0'
@ -195,6 +197,74 @@
ORDER BY DATE_FORMAT(TIME,'%Y-%m-%d %H:%i:%s') DESC ORDER BY DATE_FORMAT(TIME,'%Y-%m-%d %H:%i:%s') DESC
</select> </select>
<!-- 列表(全部) -->
<select id="getAllCarAndPeopleInfoCountByArea" parameterType="pd" resultType="pd">
SELECT
AREA_ID,
AREA_NAME,
count( CASE WHEN TYPE = 'person' AND STATUS = '入口' AND NAME IS NOT NULL THEN '1' END ) INPERSONCOUNT,
count( CASE WHEN TYPE = 'person' AND STATUS = '出口' AND NAME IS NOT NULL THEN '1' END ) OUTPERSONCOUNT,
count( CASE WHEN TYPE = 'car' AND STATUS = '入口' AND NAME IS NOT NULL THEN '1' END ) INCARCOUNT,
count( CASE WHEN TYPE = 'car' AND STATUS = '出口' AND NAME IS NOT NULL THEN '1' END ) OUTCARCOUNT,
TYPE
FROM
(
SELECT
f.AREA_ID,
f.AREA_NAME,
i.personName NAME,
( CASE WHEN r.TYPE = '0' THEN '入口' ELSE '出口' END ) STATUS,
DATE_FORMAT( i.eventTime, '%Y-%m-%d %H:%i:%s' ) TIME,
i.readerDevName BAYNAME,
i.devName DOORNAME,
'person' AS TYPE
FROM
mkmj_area f
LEFT JOIN mkmj_relation r ON f.AREA_ID = r.AREA_ID
AND r.ISDELETE = '0'
LEFT JOIN mkmj_device d ON r.DEVICE_ID = d.DEVICE_ID
AND d.ISDELETE = '0'
LEFT JOIN mkmj_dock_device de ON d.DOCK_DEVICE_ID = de.DOCK_DEVICE_ID
AND de.ISDELETE = '0'
LEFT JOIN mk_gate_person_machine_info i ON i.devName = de.DEVICE_NAME
AND i.ISDELETE = '0' AND i.eventTime > DATE_FORMAT( NOW( ), '%Y-%m-%d' )
WHERE
f.ISDELETE = '0'
GROUP BY
f.AREA_ID,
i.MACHINE_INFO_ID UNION ALL
SELECT
f.AREA_ID,
f.AREA_NAME,
i.PLATENO NAME,
( CASE WHEN r.TYPE = '0' THEN '入口' ELSE '出口' END ) STATUS,
DATE_FORMAT( i.CROSSTIME, '%Y-%m-%d %H:%i:%s' ) TIME,
ENTRANCENAME BAYNAME,
ROADWAYNAME DOORNAME,
'car' AS TYPE
FROM
mkmj_area f
LEFT JOIN mkmj_relation r ON f.AREA_ID = r.AREA_ID
AND r.ISDELETE = '0'
LEFT JOIN mkmj_device d ON r.DEVICE_ID = d.DEVICE_ID
AND d.ISDELETE = '0'
LEFT JOIN mkmj_dock_device de ON d.DOCK_DEVICE_ID = de.DOCK_DEVICE_ID
AND de.ISDELETE = '0'
LEFT JOIN mk_gate_car_machine_info i ON i.ROADWAYNAME = de.DEVICE_NAME
AND i.ISDELETE = '0' AND i.CROSSTIME > DATE_FORMAT( NOW( ), '%Y-%m-%d' )
WHERE
f.ISDELETE = '0'
GROUP BY
f.AREA_ID,
i.CAR_MACHINE_INFO_ID
) info
GROUP BY
AREA_ID,
TYPE
ORDER BY
DATE_FORMAT( TIME, '%Y-%m-%d %H:%i:%s' ) DESC
</select>
<!-- 批量删除 --> <!-- 批量删除 -->
<delete id="deleteAll" parameterType="String"> <delete id="deleteAll" parameterType="String">
update update