Commit 41fd00c7 by liulianglang

照片布控预警

parent 196afb83
package org.springblade.founder.ztrxyj.controller;
import io.swagger.annotations.ApiOperation;
import org.springblade.founder.tjfx.entity.AjtjParam;
import org.springblade.founder.tjfx.entity.LianTj;
import org.springblade.founder.utils.R;
import org.springblade.founder.ztrxyj.entity.Ztryyjxx;
import org.springblade.founder.ztrxyj.service.ztgjService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
@RestController
@RequestMapping("/ztgj")
public class gjcxController {
@Autowired
private ztgjService ztService;
@PostMapping("/getYjList")
public R getYjList(Ztryyjxx ztryyjxx){
try {
return R.ok().data(ztService.getYjList(ztryyjxx));
} catch (Exception e) {
e.printStackTrace();
return R.error(e.getMessage());
}
}
@PostMapping("/getListYjXqgj")
public R getListYjXqgj(Ztryyjxx ztryyjxx){
try {
return R.ok().data(ztService.getListYjXqgj(ztryyjxx));
} catch (Exception e) {
e.printStackTrace();
return R.error(e.getMessage());
}
}
}
package org.springblade.founder.ztrxyj.entity;
public class Ztryyjxx {
/**
* faceName : 周千雷
* faceUrl : http://74.10.30.180:10005/125,136dc5d5b1545f0
* score : 0.9903
* captureTime : 2022-03-30 15:57:16
* faceDbId : 700046010603000037
* faceCertNo : 460026200003123010
* alarmTime : 2022-03-30 15:57:21
* faceDbName : 省-前科人员库
* panoramaUrl : http://74.10.30.180:10005/14892,ffffb852c48c8330781a7825
* deviceId : 800046010603004299
* deviceName : 华盛夜都大厅
* captureUrl : http://74.10.30.180:10005/14856,ffffb852c48c83360ca07721
*/
private String faceName;
private String faceUrl;
private String score;
private String captureTime;
private String faceDbId;
private String faceCertNo;
private String alarmTime;
private String faceDbName;
private String panoramaUrl;
private String deviceId;
private String deviceName;
private String captureUrl;
private int page;
public int getPage() {
return page;
}
public void setPage(int page) {
this.page = page;
}
public int getLimit() {
return limit;
}
public void setLimit(int limit) {
this.limit = limit;
}
private int limit;
public String getXxzjbh() {
return xxzjbh;
}
public void setXxzjbh(String xxzjbh) {
this.xxzjbh = xxzjbh;
}
private String xxzjbh;
public void setFaceName(String faceName) {
this.faceName = faceName;
}
public void setFaceUrl(String faceUrl) {
this.faceUrl = faceUrl;
}
public void setScore(String score) {
this.score = score;
}
public void setCaptureTime(String captureTime) {
this.captureTime = captureTime;
}
public void setFaceDbId(String faceDbId) {
this.faceDbId = faceDbId;
}
public void setFaceCertNo(String faceCertNo) {
this.faceCertNo = faceCertNo;
}
public void setAlarmTime(String alarmTime) {
this.alarmTime = alarmTime;
}
public void setFaceDbName(String faceDbName) {
this.faceDbName = faceDbName;
}
public void setPanoramaUrl(String panoramaUrl) {
this.panoramaUrl = panoramaUrl;
}
public void setDeviceId(String deviceId) {
this.deviceId = deviceId;
}
public void setDeviceName(String deviceName) {
this.deviceName = deviceName;
}
public void setCaptureUrl(String captureUrl) {
this.captureUrl = captureUrl;
}
public String getFaceName() {
return faceName;
}
public String getFaceUrl() {
return faceUrl;
}
public String getScore() {
return score;
}
public String getCaptureTime() {
return captureTime;
}
public String getFaceDbId() {
return faceDbId;
}
public String getFaceCertNo() {
return faceCertNo;
}
public String getAlarmTime() {
return alarmTime;
}
public String getFaceDbName() {
return faceDbName;
}
public String getPanoramaUrl() {
return panoramaUrl;
}
public String getDeviceId() {
return deviceId;
}
public String getDeviceName() {
return deviceName;
}
public String getCaptureUrl() {
return captureUrl;
}
}
package org.springblade.founder.ztrxyj.mapper;
import org.apache.ibatis.annotations.Mapper;
import org.springblade.founder.ztrxyj.entity.Ztryyjxx;
import org.springframework.stereotype.Component;
import java.util.List;
@Mapper
@Component
public interface ztgjMapper {
List<Ztryyjxx> getListYjgj(Ztryyjxx ztryyjxx);
int getListYjgjCount(Ztryyjxx ztryyjxx);
List<Ztryyjxx> getListYjXqgj(Ztryyjxx ztryyjxx);
int getListYjXqgjCount(Ztryyjxx ztryyjxx);
}
<?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="org.springblade.founder.ztrxyj.mapper.ztgjMapper">
<select id="getListYjgj" resultType="org.springblade.founder.ztrxyj.entity.Ztryyjxx">
select xxzjbh, faceName, faceUrl, score, captureTime,
faceDbId, faceCertNo, alarmTime, faceDbName, panoramaUrl, deviceId, deviceName, captureUrl from tb_maztry_yj yj right join (
select
faceCertNo idcard, max(captureTime) zpsj
from tb_maztry_yj
<where>
<if test="xxzjbh != null and xxzjbh != ''">
and xxzjbh = #{xxzjbh}
</if>
<if test="facename != null and facename != ''">
and faceName = #{facename}
</if>
<if test="score != null and score != ''">
and score = #{score}
</if>
<if test="capturetime != null">
and captureTime = #{capturetime}
</if>
<if test="facedbid != null and facedbid != ''">
and faceDbId = #{facedbid}
</if>
<if test="facecertno != null and facecertno != ''">
and faceCertNo = #{facecertno}
</if>
<if test="alarmtime != null">
and alarmTime = #{alarmtime}
</if>
<if test="facedbname != null and facedbname != ''">
and faceDbName = #{facedbname}
</if>
<if test="deviceid != null and deviceid != ''">
and deviceId = #{deviceid}
</if>
<if test="devicename != null and devicename != ''">
and deviceName = #{devicename}
</if>
</where>
group by faceCertNo order by zpsj desc limit #{ page }, #{ limit }
) bb on yj.faceCertNo=bb.idcard and yj.captureTime=bb.zpsj
</select>
<select id="getListYjgjCount" resultType="java.lang.Integer">
select count(1) from ( select
faceCertNo idcard, max(captureTime) zpsj
from tb_maztry_yj
<where>
<if test="xxzjbh != null and xxzjbh != ''">
and xxzjbh = #{xxzjbh}
</if>
<if test="facename != null and facename != ''">
and faceName = #{facename}
</if>
<if test="score != null and score != ''">
and score = #{score}
</if>
<if test="capturetime != null">
and captureTime = #{capturetime}
</if>
<if test="facedbid != null and facedbid != ''">
and faceDbId = #{facedbid}
</if>
<if test="facecertno != null and facecertno != ''">
and faceCertNo = #{facecertno}
</if>
<if test="alarmtime != null">
and alarmTime = #{alarmtime}
</if>
<if test="facedbname != null and facedbname != ''">
and faceDbName = #{facedbname}
</if>
<if test="deviceid != null and deviceid != ''">
and deviceId = #{deviceid}
</if>
<if test="devicename != null and devicename != ''">
and deviceName = #{devicename}
</if>
</where>
group by faceCertNo ) bb
</select>
<select id="getListYjXqgj" resultType="org.springblade.founder.ztrxyj.entity.Ztryyjxx">
select xxzjbh, faceName, faceUrl, score, captureTime,
faceDbId, faceCertNo, alarmTime, faceDbName, panoramaUrl, deviceId, deviceName, captureUrl
from tb_maztry_yj yj
<where>
<if test="xxzjbh != null and xxzjbh != ''">
and xxzjbh = #{xxzjbh}
</if>
<if test="facename != null and facename != ''">
and faceName = #{facename}
</if>
<if test="score != null and score != ''">
and score = #{score}
</if>
<if test="capturetime != null">
and captureTime = #{capturetime}
</if>
<if test="facedbid != null and facedbid != ''">
and faceDbId = #{facedbid}
</if>
<if test="facecertno != null and facecertno != ''">
and faceCertNo = #{facecertno}
</if>
<if test="alarmtime != null">
and alarmTime = #{alarmtime}
</if>
<if test="facedbname != null and facedbname != ''">
and faceDbName = #{facedbname}
</if>
<if test="deviceid != null and deviceid != ''">
and deviceId = #{deviceid}
</if>
<if test="devicename != null and devicename != ''">
and deviceName = #{devicename}
</if>
</where>
</select>
<select id="getListYjXqgjCount" resultType="java.lang.Integer">
select count(1) from tb_maztry_yj yj
<where>
<if test="xxzjbh != null and xxzjbh != ''">
and xxzjbh = #{xxzjbh}
</if>
<if test="facename != null and facename != ''">
and faceName = #{facename}
</if>
<if test="score != null and score != ''">
and score = #{score}
</if>
<if test="capturetime != null">
and captureTime = #{capturetime}
</if>
<if test="facedbid != null and facedbid != ''">
and faceDbId = #{facedbid}
</if>
<if test="facecertno != null and facecertno != ''">
and faceCertNo = #{facecertno}
</if>
<if test="alarmtime != null">
and alarmTime = #{alarmtime}
</if>
<if test="facedbname != null and facedbname != ''">
and faceDbName = #{facedbname}
</if>
<if test="deviceid != null and deviceid != ''">
and deviceId = #{deviceid}
</if>
<if test="devicename != null and devicename != ''">
and deviceName = #{devicename}
</if>
</where>
</select>
</mapper>
package org.springblade.founder.ztrxyj.service;
import org.springblade.founder.ztrxyj.entity.Ztryyjxx;
import java.util.Map;
public interface ztgjService {
Map<String, Object> getYjList(Ztryyjxx ztryyjxx);
Map<String, Object> getListYjXqgj(Ztryyjxx ztryyjxx);
}
package org.springblade.founder.ztrxyj.service;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import org.apache.commons.lang.StringUtils;
import org.springblade.founder.utils.EasyUIPage;
import org.springblade.founder.utils.HttpClient;
import org.springblade.founder.utils.R;
import org.springblade.founder.ztrxyj.entity.Ztryyjxx;
import org.springblade.founder.ztrxyj.mapper.ztgjMapper;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
@Service
public class ztgjServiceImpl implements ztgjService {
@Resource
private ztgjMapper ztgj;
@Override
public Map<String, Object> getYjList(Ztryyjxx ztryyjxx) {
Map<String, Object> rtMap = new HashMap<>();
EasyUIPage easyUIPage = new EasyUIPage();
easyUIPage.setPage(ztryyjxx.getPage());
easyUIPage.setPagePara(ztryyjxx.getLimit());
int begin = easyUIPage.getBegin();
int end = easyUIPage.getEnd();
ztryyjxx.setPage(begin);
ztryyjxx.setLimit(end);
rtMap.put("rows",ztgj.getListYjgj(ztryyjxx));
rtMap.put("total",ztgj.getListYjgjCount(ztryyjxx));
return rtMap;
}
@Override
public Map<String, Object> getListYjXqgj(Ztryyjxx ztryyjxx) {
Map<String, Object> rtMap = new HashMap<>();
EasyUIPage easyUIPage = new EasyUIPage();
easyUIPage.setPage(ztryyjxx.getPage());
easyUIPage.setPagePara(ztryyjxx.getLimit());
int begin = easyUIPage.getBegin();
int end = easyUIPage.getEnd();
ztryyjxx.setPage(begin);
ztryyjxx.setLimit(end);
rtMap.put("rows",ztgj.getListYjXqgj(ztryyjxx));
rtMap.put("total",ztgj.getListYjXqgjCount(ztryyjxx));
return rtMap;
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment