添加“face_sample”相关CRUD代码
This commit is contained in:
parent
33c573b782
commit
a3ba944745
@ -1,7 +1,5 @@
|
||||
package com.ycwl.basic.mapper.pc;
|
||||
|
||||
import com.ycwl.basic.model.pc.broker.entity.BrokerEntity;
|
||||
import com.ycwl.basic.model.pc.broker.req.BrokerReqQuery;
|
||||
import com.ycwl.basic.model.pc.device.entity.DeviceEntity;
|
||||
import com.ycwl.basic.model.pc.device.req.DeviceReqQuery;
|
||||
import com.ycwl.basic.model.pc.device.resp.DeviceRespVO;
|
||||
|
@ -1,8 +1,5 @@
|
||||
package com.ycwl.basic.mapper.pc;
|
||||
|
||||
import com.ycwl.basic.model.pc.device.entity.DeviceEntity;
|
||||
import com.ycwl.basic.model.pc.device.req.DeviceReqQuery;
|
||||
import com.ycwl.basic.model.pc.device.resp.DeviceRespVO;
|
||||
import com.ycwl.basic.model.pc.face.entity.FaceEntity;
|
||||
import com.ycwl.basic.model.pc.face.req.FaceReqQuery;
|
||||
import com.ycwl.basic.model.pc.face.resp.FaceRespVO;
|
||||
@ -13,12 +10,13 @@ import java.util.List;
|
||||
/**
|
||||
* @Author:longbinbin
|
||||
* @Date:2024/11/29 15:09
|
||||
* 用户人脸
|
||||
*/
|
||||
public interface FaceMapper {
|
||||
List<FaceRespVO> list(FaceReqQuery faceReqQuery);
|
||||
FaceRespVO getById(Long id);
|
||||
int add(FaceEntity device);
|
||||
int add(FaceEntity face);
|
||||
int deleteById(Long id);
|
||||
int deleteByIds(@Param("list") Long ids);
|
||||
int update(DeviceEntity device);
|
||||
int update(FaceEntity face);
|
||||
}
|
||||
|
22
src/main/java/com/ycwl/basic/mapper/pc/FaceSampleMapper.java
Normal file
22
src/main/java/com/ycwl/basic/mapper/pc/FaceSampleMapper.java
Normal file
@ -0,0 +1,22 @@
|
||||
package com.ycwl.basic.mapper.pc;
|
||||
|
||||
import com.ycwl.basic.model.pc.faceSample.entity.FaceSampleEntity;
|
||||
import com.ycwl.basic.model.pc.faceSample.req.FaceSampleReqQuery;
|
||||
import com.ycwl.basic.model.pc.faceSample.resp.FaceSampleRespVO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author:longbinbin
|
||||
* @Date:2024/11/29 15:38
|
||||
* 人脸样本(设备上报)检索
|
||||
*/
|
||||
public interface FaceSampleMapper {
|
||||
List<FaceSampleRespVO> list(FaceSampleReqQuery faceSampleReqQuery);
|
||||
FaceSampleRespVO getById(Long id);
|
||||
int add(FaceSampleEntity faceSample);
|
||||
int deleteById(Long id);
|
||||
int deleteByIds(@Param("list") Long ids);
|
||||
int update(FaceSampleEntity faceSample);
|
||||
}
|
@ -0,0 +1,44 @@
|
||||
package com.ycwl.basic.model.pc.faceSample.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @Author:longbinbin
|
||||
* @Date:2024/11/29 15:40
|
||||
*/
|
||||
@Data
|
||||
@TableName("face_sample")
|
||||
public class FaceSampleEntity {
|
||||
@TableId
|
||||
private Long id;
|
||||
/**
|
||||
* 来源设备
|
||||
*/
|
||||
private Long deviceId;
|
||||
/**
|
||||
* 人脸照片
|
||||
*/
|
||||
private String faceUrl;
|
||||
/**
|
||||
* 与样本匹配的ID,逗号隔开
|
||||
*/
|
||||
private String matchSampleIds;
|
||||
/**
|
||||
* 匹配率
|
||||
*/
|
||||
private String firstMatchRate;
|
||||
/**
|
||||
* 匹配的结果,JSON字符串
|
||||
*/
|
||||
private String matchResult;
|
||||
/**
|
||||
* 是否匹配,0未匹配,1已匹配
|
||||
*/
|
||||
private Integer status;
|
||||
private Date createAt;
|
||||
private Date updateAt;
|
||||
}
|
@ -0,0 +1,50 @@
|
||||
package com.ycwl.basic.model.pc.faceSample.req;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @Author:longbinbin
|
||||
* @Date:2024/11/29 15:40
|
||||
*/
|
||||
@Data
|
||||
@ApiModel("人脸样本查询参数")
|
||||
public class FaceSampleReqQuery {
|
||||
/**
|
||||
* 来源设备
|
||||
*/
|
||||
@ApiModelProperty("来源设备")
|
||||
private Long deviceId;
|
||||
/**
|
||||
* 人脸照片
|
||||
*/
|
||||
@ApiModelProperty("人脸照片")
|
||||
private String faceUrl;
|
||||
/**
|
||||
* 与样本匹配的ID,逗号隔开
|
||||
*/
|
||||
@ApiModelProperty("与样本匹配的ID,逗号隔开")
|
||||
private String matchSampleIds;
|
||||
/**
|
||||
* 匹配率
|
||||
*/
|
||||
@ApiModelProperty("匹配率")
|
||||
private String firstMatchRate;
|
||||
/**
|
||||
* 匹配的结果,JSON字符串
|
||||
*/
|
||||
@ApiModelProperty("匹配的结果,JSON字符串")
|
||||
private String matchResult;
|
||||
/**
|
||||
* 是否匹配,0未匹配,1已匹配
|
||||
*/
|
||||
@ApiModelProperty("是否匹配,0未匹配,1已匹配")
|
||||
private Integer status;
|
||||
private Date startTime;
|
||||
private Date endTime;
|
||||
}
|
@ -0,0 +1,50 @@
|
||||
package com.ycwl.basic.model.pc.faceSample.resp;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @Author:longbinbin
|
||||
* @Date:2024/11/29 15:40
|
||||
*/
|
||||
@Data
|
||||
@ApiModel("人脸样本响应参数")
|
||||
public class FaceSampleRespVO {
|
||||
private Long id;
|
||||
/**
|
||||
* 来源设备
|
||||
*/
|
||||
@ApiModelProperty("来源设备")
|
||||
private Long deviceId;
|
||||
/**
|
||||
* 人脸照片
|
||||
*/
|
||||
@ApiModelProperty("人脸照片")
|
||||
private String faceUrl;
|
||||
/**
|
||||
* 与样本匹配的ID,逗号隔开
|
||||
*/
|
||||
@ApiModelProperty("与样本匹配的ID,逗号隔开")
|
||||
private String matchSampleIds;
|
||||
/**
|
||||
* 匹配率
|
||||
*/
|
||||
@ApiModelProperty("匹配率")
|
||||
private String firstMatchRate;
|
||||
/**
|
||||
* 匹配的结果,JSON字符串
|
||||
*/
|
||||
@ApiModelProperty("匹配的结果,JSON字符串")
|
||||
private String matchResult;
|
||||
/**
|
||||
* 是否匹配,0未匹配,1已匹配
|
||||
*/
|
||||
@ApiModelProperty("是否匹配,0未匹配,1已匹配")
|
||||
private Integer status;
|
||||
private Date createAt;
|
||||
private Date updateAt;
|
||||
}
|
76
src/main/resources/mapper/pc/FaceSampleMapper.xml
Normal file
76
src/main/resources/mapper/pc/FaceSampleMapper.xml
Normal file
@ -0,0 +1,76 @@
|
||||
<?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.ycwl.basic.mapper.pc.FaceSampleMapper">
|
||||
<insert id="add">
|
||||
insert into face_sample(id, device_id, face_url, match_sample_ids, first_match_rate, match_result,`status`)
|
||||
values (#{id}, #{deviceId}, #{faceUrl}, #{matchSampleIds}, #{firstMatchRate}, #{matchResult},#{status})
|
||||
</insert>
|
||||
<update id="update">
|
||||
update face_sample
|
||||
<set>
|
||||
<if test="deviceId!= null ">
|
||||
device_id = #{deviceId},
|
||||
</if>
|
||||
<if test="faceUrl!= null and faceUrl!= ''">
|
||||
face_url = #{faceUrl},
|
||||
</if>
|
||||
<if test="matchSampleIds!= null and matchSampleIds!= ''">
|
||||
match_sample_ids = #{matchSampleIds},
|
||||
</if>
|
||||
<if test="firstMatchRate!= null ">
|
||||
first_match_rate = #{firstMatchRate},
|
||||
</if>
|
||||
<if test="matchResult!= null and matchResult!= ''">
|
||||
match_result = #{matchResult},
|
||||
</if>
|
||||
<if test="status!= null ">
|
||||
`status` = #{status},
|
||||
</if>
|
||||
</set>
|
||||
where id = #{id}
|
||||
</update>
|
||||
<delete id="deleteById">
|
||||
delete from face_sample where id = #{id}
|
||||
</delete>
|
||||
<delete id="deleteByIds">
|
||||
<if test="list!= null and list.size() > 0">
|
||||
delete from face_sample where id in (
|
||||
<foreach collection="list" item="id" separator=",">
|
||||
#{id}
|
||||
</foreach>
|
||||
)
|
||||
</if>
|
||||
</delete>
|
||||
<select id="list" resultType="com.ycwl.basic.model.pc.faceSample.resp.FaceSampleRespVO">
|
||||
select id, device_id, face_url, match_sample_ids, first_match_rate, match_result,`status`
|
||||
from face_sample
|
||||
<where>
|
||||
<if test="deviceId!= null and deviceId!= ''">
|
||||
and device_id = #{deviceId}
|
||||
</if>
|
||||
<if test="matchSampleIds!= null and matchSampleIds!= ''">
|
||||
and match_sample_ids like concat('%', #{matchSampleIds}, '%')
|
||||
</if>
|
||||
<if test="startMatchRate!= null ">
|
||||
and first_match_rate >= #{startMatchRate}
|
||||
</if>
|
||||
<if test="endMatchRate!= null ">
|
||||
and first_match_rate <= #{endMatchRate}
|
||||
</if>
|
||||
<if test="startTime!=null">
|
||||
and create_at >= #{startTime}
|
||||
</if>
|
||||
<if test="endTime!=null">
|
||||
and create_at <= #{endTime}
|
||||
</if>
|
||||
<if test="status!= null ">
|
||||
and `status` = #{status}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
<select id="getById" resultType="com.ycwl.basic.model.pc.faceSample.resp.FaceSampleRespVO">
|
||||
select id, device_id, face_url, match_sample_ids, first_match_rate, match_result,`status`
|
||||
from face_sample
|
||||
where id = #{id}
|
||||
</select>
|
||||
</mapper>
|
Loading…
x
Reference in New Issue
Block a user