Browse Source

url转base64存到副表

x-rf 3 years ago
parent
commit
7f3f51215f

+ 6 - 0
src/main/java/com/yx/face/boot/uitls/DownLoad.java

@@ -64,5 +64,11 @@ public class DownLoad {
         }
         return null;
     }
+
+//    public static void main(String[] args) throws IOException {
+//        String s = tranUrlToBase64String("https://ldb-airport.hz-hanghui.com:9100/data/hanghui/16375779864021cec7bf9ad7f4685973b4da438faf08a.png");
+//
+//        Base64Util.GenerateImage(s,"d:/8.jpg");
+//    }
 }
 

+ 36 - 0
src/main/java/com/yx/face/dao/UserFaceRecordsFromDao.java

@@ -0,0 +1,36 @@
+package com.yx.face.dao;
+
+import com.yx.face.model.entity.UserFaceRecordsFrom;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+public interface UserFaceRecordsFromDao {
+    long countByExample(UserFaceRecordsFrom example);
+
+    int deleteByExample(UserFaceRecordsFrom example);
+
+    int deleteByPrimaryKey(Integer id);
+
+    int insert(UserFaceRecordsFrom record);
+
+    int insertSelective(UserFaceRecordsFrom record);
+
+    List<UserFaceRecordsFrom> selectByExampleWithBLOBs(UserFaceRecordsFrom example);
+
+    List<UserFaceRecordsFrom> selectByExample(UserFaceRecordsFrom example);
+
+    UserFaceRecordsFrom selectByPrimaryKey(Integer id);
+
+    int updateByExampleSelective(@Param("record") UserFaceRecordsFrom record, @Param("example") UserFaceRecordsFrom example);
+
+    int updateByExampleWithBLOBs(@Param("record") UserFaceRecordsFrom record, @Param("example") UserFaceRecordsFrom example);
+
+    int updateByExample(@Param("record") UserFaceRecordsFrom record, @Param("example") UserFaceRecordsFrom example);
+
+    int updateByPrimaryKeySelective(UserFaceRecordsFrom record);
+
+    int updateByPrimaryKeyWithBLOBs(UserFaceRecordsFrom record);
+
+    int updateByPrimaryKey(UserFaceRecordsFrom record);
+}

+ 36 - 0
src/main/java/com/yx/face/dao/UserInfoFromDao.java

@@ -0,0 +1,36 @@
+package com.yx.face.dao;
+
+import com.yx.face.model.entity.UserInfoFrom;
+import org.apache.ibatis.annotations.Param; 
+
+import java.util.List;
+
+public interface UserInfoFromDao {
+    long countByExample(UserInfoFrom example);
+
+    int deleteByExample(UserInfoFrom example);
+
+    int deleteByPrimaryKey(Integer id);
+
+    int insert(UserInfoFrom record);
+
+    int insertSelective(UserInfoFrom record);
+
+    List<UserInfoFrom> selectByExampleWithBLOBs(UserInfoFrom example);
+
+    List<UserInfoFrom> selectByExample(UserInfoFrom example);
+
+    UserInfoFrom selectByPrimaryKey(Integer id);
+
+    int updateByExampleSelective(@Param("record") UserInfoFrom record, @Param("example") UserInfoFrom example);
+
+    int updateByExampleWithBLOBs(@Param("record") UserInfoFrom record, @Param("example") UserInfoFrom example);
+
+    int updateByExample(@Param("record") UserInfoFrom record, @Param("example") UserInfoFrom example);
+
+    int updateByPrimaryKeySelective(UserInfoFrom record);
+
+    int updateByPrimaryKeyWithBLOBs(UserInfoFrom record);
+
+    int updateByPrimaryKey(UserInfoFrom record);
+}

+ 36 - 0
src/main/java/com/yx/face/dao/UserVisitorListFromDao.java

@@ -0,0 +1,36 @@
+package com.yx.face.dao;
+
+import com.yx.face.model.entity.UserVisitorListFrom;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+public interface UserVisitorListFromDao {
+    long countByExample(UserVisitorListFrom example);
+
+    int deleteByExample(UserVisitorListFrom example);
+
+    int deleteByPrimaryKey(Integer id);
+
+    int insert(UserVisitorListFrom record);
+
+    int insertSelective(UserVisitorListFrom record);
+
+    List<UserVisitorListFrom> selectByExampleWithBLOBs(UserVisitorListFrom example);
+
+    List<UserVisitorListFrom> selectByExample(UserVisitorListFrom example);
+
+    UserVisitorListFrom selectByPrimaryKey(Integer id);
+
+    int updateByExampleSelective(@Param("record") UserVisitorListFrom record, @Param("example") UserVisitorListFrom example);
+
+    int updateByExampleWithBLOBs(@Param("record") UserVisitorListFrom record, @Param("example") UserVisitorListFrom example);
+
+    int updateByExample(@Param("record") UserVisitorListFrom record, @Param("example") UserVisitorListFrom example);
+
+    int updateByPrimaryKeySelective(UserVisitorListFrom record);
+
+    int updateByPrimaryKeyWithBLOBs(UserVisitorListFrom record);
+
+    int updateByPrimaryKey(UserVisitorListFrom record);
+}

+ 51 - 0
src/main/java/com/yx/face/model/entity/UserFaceRecordsFrom.java

@@ -0,0 +1,51 @@
+package com.yx.face.model.entity;
+
+import java.io.Serializable;
+
+public class UserFaceRecordsFrom implements Serializable {
+    private Integer id;
+
+    private Long userFaceRecordsId;
+
+    private byte[] imgBase;
+
+    private static final long serialVersionUID = 1L;
+
+    public Integer getId() {
+        return id;
+    }
+
+    public void setId(Integer id) {
+        this.id = id;
+    }
+
+    public Long getUserFaceRecordsId() {
+        return userFaceRecordsId;
+    }
+
+    public void setUserFaceRecordsId(Long userFaceRecordsId) {
+        this.userFaceRecordsId = userFaceRecordsId;
+    }
+
+    public byte[] getImgBase() {
+        return imgBase;
+    }
+
+    public void setImgBase(byte[] imgBase) {
+        this.imgBase = imgBase;
+    }
+
+    @Override
+    public String toString() {
+        StringBuilder sb = new StringBuilder();
+        sb.append(getClass().getSimpleName());
+        sb.append(" [");
+        sb.append("Hash = ").append(hashCode());
+        sb.append(", id=").append(id);
+        sb.append(", userFaceRecordsId=").append(userFaceRecordsId);
+        sb.append(", imgBase=").append(imgBase);
+        sb.append(", serialVersionUID=").append(serialVersionUID);
+        sb.append("]");
+        return sb.toString();
+    }
+}

+ 51 - 0
src/main/java/com/yx/face/model/entity/UserInfoFrom.java

@@ -0,0 +1,51 @@
+package com.yx.face.model.entity;
+
+import java.io.Serializable;
+
+public class UserInfoFrom implements Serializable {
+    private Integer id;
+
+    private Long userInfoId;
+
+    private byte[] imgBase;
+
+    private static final long serialVersionUID = 1L;
+
+    public Integer getId() {
+        return id;
+    }
+
+    public void setId(Integer id) {
+        this.id = id;
+    }
+
+    public Long getUserInfoId() {
+        return userInfoId;
+    }
+
+    public void setUserInfoId(Long userInfoId) {
+        this.userInfoId = userInfoId;
+    }
+
+    public byte[] getImgBase() {
+        return imgBase;
+    }
+
+    public void setImgBase(byte[] imgBase) {
+        this.imgBase = imgBase;
+    }
+
+    @Override
+    public String toString() {
+        StringBuilder sb = new StringBuilder();
+        sb.append(getClass().getSimpleName());
+        sb.append(" [");
+        sb.append("Hash = ").append(hashCode());
+        sb.append(", id=").append(id);
+        sb.append(", userInfoId=").append(userInfoId);
+        sb.append(", imgBase=").append(imgBase);
+        sb.append(", serialVersionUID=").append(serialVersionUID);
+        sb.append("]");
+        return sb.toString();
+    }
+}

+ 51 - 0
src/main/java/com/yx/face/model/entity/UserVisitorListFrom.java

@@ -0,0 +1,51 @@
+package com.yx.face.model.entity;
+
+import java.io.Serializable;
+
+public class UserVisitorListFrom implements Serializable {
+    private Integer id;
+
+    private Integer userVisitorListId;
+
+    private byte[] imgBase;
+
+    private static final long serialVersionUID = 1L;
+
+    public Integer getId() {
+        return id;
+    }
+
+    public void setId(Integer id) {
+        this.id = id;
+    }
+
+    public Integer getUserVisitorListId() {
+        return userVisitorListId;
+    }
+
+    public void setUserVisitorListId(Integer userVisitorListId) {
+        this.userVisitorListId = userVisitorListId;
+    }
+
+    public byte[] getImgBase() {
+        return imgBase;
+    }
+
+    public void setImgBase(byte[] imgBase) {
+        this.imgBase = imgBase;
+    }
+
+    @Override
+    public String toString() {
+        StringBuilder sb = new StringBuilder();
+        sb.append(getClass().getSimpleName());
+        sb.append(" [");
+        sb.append("Hash = ").append(hashCode());
+        sb.append(", id=").append(id);
+        sb.append(", userVisitorListId=").append(userVisitorListId);
+        sb.append(", imgBase=").append(imgBase);
+        sb.append(", serialVersionUID=").append(serialVersionUID);
+        sb.append("]");
+        return sb.toString();
+    }
+}

+ 25 - 4
src/main/java/com/yx/face/service/impl/UserInfoServiceImpl.java

@@ -10,10 +10,7 @@ import com.google.common.collect.Maps;
 import com.yx.face.boot.config.TaskPoolConfig;
 import com.yx.face.boot.restful.RestDTO;
 import com.yx.face.boot.restful.ServiceException;
-import com.yx.face.boot.uitls.DateUtils;
-import com.yx.face.boot.uitls.FileUploadUtil;
-import com.yx.face.boot.uitls.JsonUtils;
-import com.yx.face.boot.uitls.OkHttpUtils;
+import com.yx.face.boot.uitls.*;
 import com.yx.face.dao.*;
 import com.yx.face.model.dto.WxInfoDTO;
 import com.yx.face.model.entity.*;
@@ -60,10 +57,15 @@ public class UserInfoServiceImpl implements UserInfoService {
     @Resource
     private UserWhitelistDao userWhitelistdao;
 
+    @Resource
+    private UserFaceRecordsFromDao userFaceRecordsFromDao;
+
     @Resource
     private UserVisitorListDao userVisitorListDao;
     @Resource
     private UserBlackListDao userBlackListDao;
+    @Resource
+    private UserInfoFromDao userInfoFromDao;
 
     @Autowired
     private TaskPoolConfig taskPoolConfig;
@@ -152,6 +154,15 @@ public class UserInfoServiceImpl implements UserInfoService {
         userInfo.setPhone(phone);
         userInfo = userInfoDao.selectOne(userInfo);
         String image = buildImage(map.get("img").toString(), phone);
+        //url转base64存到副表
+        if (StringUtils.hasText(image)){
+            UserInfoFrom userInfoFrom = new UserInfoFrom();
+            userInfoFrom.setUserInfoId(userInfo.getId());
+            String urlToBase64String = DownLoad.tranUrlToBase64String(image);
+            byte[] decode = Base64Util.decode(urlToBase64String);
+            userInfoFrom.setImgBase(decode);
+            userInfoFromDao.insertSelective(userInfoFrom);
+        }
         if (userInfo == null) {
             userInfo = new UserInfo();
             userInfo.setUsername(name);
@@ -181,6 +192,16 @@ public class UserInfoServiceImpl implements UserInfoService {
         faceRecords.setToken(map.get("token").toString());
         faceRecords.setCreateTime(now);
         userFaceRecordsDao.insertSelective(faceRecords);
+
+        //url转base64存到副表
+        if (StringUtils.hasText(userInfo.getAvatar())){
+            UserFaceRecordsFrom userFaceRecordsFrom = new UserFaceRecordsFrom();
+            userFaceRecordsFrom.setUserFaceRecordsId(faceRecords.getUserId());
+            String urlToBase64String = DownLoad.tranUrlToBase64String(userInfo.getAvatar());
+            byte[] decode = Base64Util.decode(urlToBase64String);
+            userFaceRecordsFrom.setImgBase(decode);
+            userFaceRecordsFromDao.insertSelective(userFaceRecordsFrom);
+        }
     }
 
 

+ 33 - 5
src/main/java/com/yx/face/service/impl/UserVisitorListServiceImpl.java

@@ -8,9 +8,7 @@ import com.google.common.collect.Lists;
 import com.google.common.collect.Maps;
 import com.yx.face.boot.restful.RestDTO;
 import com.yx.face.boot.restful.ServiceException;
-import com.yx.face.boot.uitls.DateUtils;
-import com.yx.face.boot.uitls.JsonUtils;
-import com.yx.face.boot.uitls.SMSOrIdCardUtils;
+import com.yx.face.boot.uitls.*;
 import com.yx.face.dao.*;
 import com.yx.face.model.entity.*;
 import com.yx.face.model.search.UserWhitelistSearch;
@@ -40,6 +38,8 @@ import java.util.*;
 public class UserVisitorListServiceImpl implements UserVisitorListService {
     @Resource
     private UserVisitorListDao userVisitorListDao;
+    @Resource
+    private UserVisitorListFromDao userVisitorListFromDao;
 
     @Resource
     private AdminService adminService;
@@ -65,6 +65,11 @@ public class UserVisitorListServiceImpl implements UserVisitorListService {
     @Resource
     private FaceTaskDao faceTaskDao;
 
+    @Resource
+    private UserWhitelistFromDao userWhitelistFromDao;
+    @Resource
+    private UserBlackListFromDao userBlackListFromDao;
+
     @Override
     public PageInfo<UserVisitorListVO> getPageList(RestDTO<UserWhitelistSearch> dto) {
         UserWhitelistSearch data = dto.getData();
@@ -99,7 +104,18 @@ public class UserVisitorListServiceImpl implements UserVisitorListService {
         //校验是否存在
         UserWhitelist byPhoneAndId = userWhitelistDao.getByPhoneAndId(uvl.getPhone(), null, uvl.getAdminId());
         UserWhitelist addWhite = new UserWhitelist();
-        addWhite.setAvatar(uvl.getAvatar());
+
+        String avatar = uvl.getAvatar();
+        //url路径转换为base64数组,插入user_whitelist_from表
+        if (StringUtils.isNotBlank(avatar)){
+            UserWhitelistFrom userWhitelistFrom = new UserWhitelistFrom();
+            String urlToBase64String = DownLoad.tranUrlToBase64String(avatar);
+            byte[] decode = Base64Util.decode(urlToBase64String);
+            userWhitelistFrom.setUserWhitelistId(byPhoneAndId.getId());
+            userWhitelistFrom.setImgBase(decode);
+            userWhitelistFromDao.insertSelective(userWhitelistFrom);
+        }
+        addWhite.setAvatar(avatar);
         if (byPhoneAndId != null) {
             addWhite.setUpdateTime(new Date());
             addWhite.setId(byPhoneAndId.getId());
@@ -117,6 +133,7 @@ public class UserVisitorListServiceImpl implements UserVisitorListService {
         }
         //删除访客
         userVisitorListDao.deleteByPrimaryKey(id);
+        userVisitorListFromDao.deleteByPrimaryKey(id);//删除
 
         List<String> faceDeviceOne = faceDeviceDao.selectList(uvl.getAdminId());
         if (faceDeviceOne.isEmpty()) {
@@ -153,6 +170,16 @@ public class UserVisitorListServiceImpl implements UserVisitorListService {
         userBlackListOne.setPhone(uvl.getPhone());
         UserBlackList userBlackOne = userBlackListDao.selectOne(userBlackListOne);
         UserBlackList userBlackList = new UserBlackList();
+        String avatar = userBlackOne.getAvatar();//照片
+        //url路径转换为base64数组,插入user_whitelist_from表
+        if (StringUtils.isNotBlank(avatar)){
+            UserWhitelistFrom userWhitelistFrom = new UserWhitelistFrom();
+            String urlToBase64String = DownLoad.tranUrlToBase64String(avatar);
+            byte[] decode = Base64Util.decode(urlToBase64String);
+            userWhitelistFrom.setUserWhitelistId(userBlackOne.getId());
+            userWhitelistFrom.setImgBase(decode);
+            userWhitelistFromDao.insertSelective(userWhitelistFrom);
+        }
         if (userBlackOne != null) {
             userBlackList.setId(userBlackOne.getId());
             userBlackList.setAvatar(userBlackOne.getAvatar());
@@ -170,6 +197,7 @@ public class UserVisitorListServiceImpl implements UserVisitorListService {
         }
         //删除访客
         userVisitorListDao.deleteByPrimaryKey(id);
+        userVisitorListFromDao.deleteByPrimaryKey(id);
         List<String> faceDeviceOne = faceDeviceDao.selectList(uvl.getAdminId());
         if (faceDeviceOne.isEmpty()) {
             throw new ServiceException("该账号下没绑定设备,添加失败哦~");
@@ -283,4 +311,4 @@ public class UserVisitorListServiceImpl implements UserVisitorListService {
         faceTaskDao.updateByPrimaryKeySelective(faceTask);
         return result;
     }
-}
+}

+ 4 - 4
src/main/resources/mapper/UserBlackListFromDao.xml

@@ -72,7 +72,7 @@
   <sql id="Blob_Column_List">
     img_base
   </sql>
-  <select id="selectByExampleWithBLOBs" parameterType="com.yx.face.model.entity.UserBlackListFromExample" resultMap="ResultMapWithBLOBs">
+  <select id="selectByExampleWithBLOBs" parameterType="com.yx.face.model.entity.UserBlackListFrom" resultMap="ResultMapWithBLOBs">
     select
     <if test="distinct">
       distinct
@@ -88,7 +88,7 @@
       order by ${orderByClause}
     </if>
   </select>
-  <select id="selectByExample" parameterType="com.yx.face.model.entity.UserBlackListFromExample" resultMap="BaseResultMap">
+  <select id="selectByExample" parameterType="com.yx.face.model.entity.UserBlackListFrom" resultMap="BaseResultMap">
     select
     <if test="distinct">
       distinct
@@ -114,7 +114,7 @@
     delete from user_black_list_from
     where id = #{id,jdbcType=BIGINT}
   </delete>
-  <delete id="deleteByExample" parameterType="com.yx.face.model.entity.UserBlackListFromExample">
+  <delete id="deleteByExample" parameterType="com.yx.face.model.entity.UserBlackListFrom">
     delete from user_black_list_from
     <if test="_parameter != null">
       <include refid="Example_Where_Clause" />
@@ -151,7 +151,7 @@
       </if>
     </trim>
   </insert>
-  <select id="countByExample" parameterType="com.yx.face.model.entity.UserBlackListFromExample" resultType="java.lang.Long">
+  <select id="countByExample" parameterType="com.yx.face.model.entity.UserBlackListFrom" resultType="java.lang.Long">
     select count(*) from user_black_list_from
     <if test="_parameter != null">
       <include refid="Example_Where_Clause" />

+ 217 - 0
src/main/resources/mapper/UserFaceRecordsFromDao.xml

@@ -0,0 +1,217 @@
+<?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.yx.face.dao.UserFaceRecordsFromDao">
+  <resultMap id="BaseResultMap" type="com.yx.face.model.entity.UserFaceRecordsFrom">
+    <id column="id" jdbcType="INTEGER" property="id" />
+    <result column="user_face_records_id" jdbcType="INTEGER" property="userFaceRecordsId" />
+  </resultMap>
+  <resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="com.yx.face.model.entity.UserFaceRecordsFrom">
+    <result column="img_base" jdbcType="LONGVARBINARY" property="imgBase" />
+  </resultMap>
+  <sql id="Example_Where_Clause">
+    <where>
+      <foreach collection="oredCriteria" item="criteria" separator="or">
+        <if test="criteria.valid">
+          <trim prefix="(" prefixOverrides="and" suffix=")">
+            <foreach collection="criteria.criteria" item="criterion">
+              <choose>
+                <when test="criterion.noValue">
+                  and ${criterion.condition}
+                </when>
+                <when test="criterion.singleValue">
+                  and ${criterion.condition} #{criterion.value}
+                </when>
+                <when test="criterion.betweenValue">
+                  and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
+                </when>
+                <when test="criterion.listValue">
+                  and ${criterion.condition}
+                  <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
+                    #{listItem}
+                  </foreach>
+                </when>
+              </choose>
+            </foreach>
+          </trim>
+        </if>
+      </foreach>
+    </where>
+  </sql>
+  <sql id="Update_By_Example_Where_Clause">
+    <where>
+      <foreach collection="example.oredCriteria" item="criteria" separator="or">
+        <if test="criteria.valid">
+          <trim prefix="(" prefixOverrides="and" suffix=")">
+            <foreach collection="criteria.criteria" item="criterion">
+              <choose>
+                <when test="criterion.noValue">
+                  and ${criterion.condition}
+                </when>
+                <when test="criterion.singleValue">
+                  and ${criterion.condition} #{criterion.value}
+                </when>
+                <when test="criterion.betweenValue">
+                  and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
+                </when>
+                <when test="criterion.listValue">
+                  and ${criterion.condition}
+                  <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
+                    #{listItem}
+                  </foreach>
+                </when>
+              </choose>
+            </foreach>
+          </trim>
+        </if>
+      </foreach>
+    </where>
+  </sql>
+  <sql id="Base_Column_List">
+    id, user_face_records_id
+  </sql>
+  <sql id="Blob_Column_List">
+    img_base
+  </sql>
+  <select id="selectByExampleWithBLOBs" parameterType="com.yx.face.model.entity.UserFaceRecordsFrom" resultMap="ResultMapWithBLOBs">
+    select
+    <if test="distinct">
+      distinct
+    </if>
+    <include refid="Base_Column_List" />
+    ,
+    <include refid="Blob_Column_List" />
+    from user_face_records_from
+    <if test="_parameter != null">
+      <include refid="Example_Where_Clause" />
+    </if>
+    <if test="orderByClause != null">
+      order by ${orderByClause}
+    </if>
+  </select>
+  <select id="selectByExample" parameterType="com.yx.face.model.entity.UserFaceRecordsFrom" resultMap="BaseResultMap">
+    select
+    <if test="distinct">
+      distinct
+    </if>
+    <include refid="Base_Column_List" />
+    from user_face_records_from
+    <if test="_parameter != null">
+      <include refid="Example_Where_Clause" />
+    </if>
+    <if test="orderByClause != null">
+      order by ${orderByClause}
+    </if>
+  </select>
+  <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="ResultMapWithBLOBs">
+    select 
+    <include refid="Base_Column_List" />
+    ,
+    <include refid="Blob_Column_List" />
+    from user_face_records_from
+    where id = #{id,jdbcType=INTEGER}
+  </select>
+  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
+    delete from user_face_records_from
+    where id = #{id,jdbcType=INTEGER}
+  </delete>
+  <delete id="deleteByExample" parameterType="com.yx.face.model.entity.UserFaceRecordsFrom">
+    delete from user_face_records_from
+    <if test="_parameter != null">
+      <include refid="Example_Where_Clause" />
+    </if>
+  </delete>
+  <insert id="insert" parameterType="com.yx.face.model.entity.UserFaceRecordsFrom">
+    insert into user_face_records_from (id, user_face_records_id, img_base
+      )
+    values (#{id,jdbcType=INTEGER}, #{userFaceRecordsId,jdbcType=INTEGER}, #{imgBase,jdbcType=LONGVARBINARY}
+      )
+  </insert>
+  <insert id="insertSelective" parameterType="com.yx.face.model.entity.UserFaceRecordsFrom">
+    insert into user_face_records_from
+    <trim prefix="(" suffix=")" suffixOverrides=",">
+      <if test="id != null">
+        id,
+      </if>
+      <if test="userFaceRecordsId != null">
+        user_face_records_id,
+      </if>
+      <if test="imgBase != null">
+        img_base,
+      </if>
+    </trim>
+    <trim prefix="values (" suffix=")" suffixOverrides=",">
+      <if test="id != null">
+        #{id,jdbcType=INTEGER},
+      </if>
+      <if test="userFaceRecordsId != null">
+        #{userFaceRecordsId,jdbcType=INTEGER},
+      </if>
+      <if test="imgBase != null">
+        #{imgBase,jdbcType=LONGVARBINARY},
+      </if>
+    </trim>
+  </insert>
+  <select id="countByExample" parameterType="com.yx.face.model.entity.UserFaceRecordsFrom" resultType="java.lang.Long">
+    select count(*) from user_face_records_from
+    <if test="_parameter != null">
+      <include refid="Example_Where_Clause" />
+    </if>
+  </select>
+  <update id="updateByExampleSelective" parameterType="map">
+    update user_face_records_from
+    <set>
+      <if test="record.id != null">
+        id = #{record.id,jdbcType=INTEGER},
+      </if>
+      <if test="record.userFaceRecordsId != null">
+        user_face_records_id = #{record.userFaceRecordsId,jdbcType=INTEGER},
+      </if>
+      <if test="record.imgBase != null">
+        img_base = #{record.imgBase,jdbcType=LONGVARBINARY},
+      </if>
+    </set>
+    <if test="_parameter != null">
+      <include refid="Update_By_Example_Where_Clause" />
+    </if>
+  </update>
+  <update id="updateByExampleWithBLOBs" parameterType="map">
+    update user_face_records_from
+    set id = #{record.id,jdbcType=INTEGER},
+      user_face_records_id = #{record.userFaceRecordsId,jdbcType=INTEGER},
+      img_base = #{record.imgBase,jdbcType=LONGVARBINARY}
+    <if test="_parameter != null">
+      <include refid="Update_By_Example_Where_Clause" />
+    </if>
+  </update>
+  <update id="updateByExample" parameterType="map">
+    update user_face_records_from
+    set id = #{record.id,jdbcType=INTEGER},
+      user_face_records_id = #{record.userFaceRecordsId,jdbcType=INTEGER}
+    <if test="_parameter != null">
+      <include refid="Update_By_Example_Where_Clause" />
+    </if>
+  </update>
+  <update id="updateByPrimaryKeySelective" parameterType="com.yx.face.model.entity.UserFaceRecordsFrom">
+    update user_face_records_from
+    <set>
+      <if test="userFaceRecordsId != null">
+        user_face_records_id = #{userFaceRecordsId,jdbcType=INTEGER},
+      </if>
+      <if test="imgBase != null">
+        img_base = #{imgBase,jdbcType=LONGVARBINARY},
+      </if>
+    </set>
+    where id = #{id,jdbcType=INTEGER}
+  </update>
+  <update id="updateByPrimaryKeyWithBLOBs" parameterType="com.yx.face.model.entity.UserFaceRecordsFrom">
+    update user_face_records_from
+    set user_face_records_id = #{userFaceRecordsId,jdbcType=INTEGER},
+      img_base = #{imgBase,jdbcType=LONGVARBINARY}
+    where id = #{id,jdbcType=INTEGER}
+  </update>
+  <update id="updateByPrimaryKey" parameterType="com.yx.face.model.entity.UserFaceRecordsFrom">
+    update user_face_records_from
+    set user_face_records_id = #{userFaceRecordsId,jdbcType=INTEGER}
+    where id = #{id,jdbcType=INTEGER}
+  </update>
+</mapper>

+ 217 - 0
src/main/resources/mapper/UserInfoFromDao.xml

@@ -0,0 +1,217 @@
+<?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.yx.face.dao.UserInfoFromDao">
+  <resultMap id="BaseResultMap" type="com.yx.face.model.entity.UserInfoFrom">
+    <id column="id" jdbcType="INTEGER" property="id" />
+    <result column="user_info_id" jdbcType="BIGINT" property="userInfoId" />
+  </resultMap>
+  <resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="com.yx.face.model.entity.UserInfoFrom">
+    <result column="img_base" jdbcType="LONGVARBINARY" property="imgBase" />
+  </resultMap>
+  <sql id="Example_Where_Clause">
+    <where>
+      <foreach collection="oredCriteria" item="criteria" separator="or">
+        <if test="criteria.valid">
+          <trim prefix="(" prefixOverrides="and" suffix=")">
+            <foreach collection="criteria.criteria" item="criterion">
+              <choose>
+                <when test="criterion.noValue">
+                  and ${criterion.condition}
+                </when>
+                <when test="criterion.singleValue">
+                  and ${criterion.condition} #{criterion.value}
+                </when>
+                <when test="criterion.betweenValue">
+                  and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
+                </when>
+                <when test="criterion.listValue">
+                  and ${criterion.condition}
+                  <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
+                    #{listItem}
+                  </foreach>
+                </when>
+              </choose>
+            </foreach>
+          </trim>
+        </if>
+      </foreach>
+    </where>
+  </sql>
+  <sql id="Update_By_Example_Where_Clause">
+    <where>
+      <foreach collection="example.oredCriteria" item="criteria" separator="or">
+        <if test="criteria.valid">
+          <trim prefix="(" prefixOverrides="and" suffix=")">
+            <foreach collection="criteria.criteria" item="criterion">
+              <choose>
+                <when test="criterion.noValue">
+                  and ${criterion.condition}
+                </when>
+                <when test="criterion.singleValue">
+                  and ${criterion.condition} #{criterion.value}
+                </when>
+                <when test="criterion.betweenValue">
+                  and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
+                </when>
+                <when test="criterion.listValue">
+                  and ${criterion.condition}
+                  <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
+                    #{listItem}
+                  </foreach>
+                </when>
+              </choose>
+            </foreach>
+          </trim>
+        </if>
+      </foreach>
+    </where>
+  </sql>
+  <sql id="Base_Column_List">
+    id, user_info_id
+  </sql>
+  <sql id="Blob_Column_List">
+    img_base
+  </sql>
+  <select id="selectByExampleWithBLOBs" parameterType="com.yx.face.model.entity.UserInfoFrom" resultMap="ResultMapWithBLOBs">
+    select
+    <if test="distinct">
+      distinct
+    </if>
+    <include refid="Base_Column_List" />
+    ,
+    <include refid="Blob_Column_List" />
+    from user_info_from
+    <if test="_parameter != null">
+      <include refid="Example_Where_Clause" />
+    </if>
+    <if test="orderByClause != null">
+      order by ${orderByClause}
+    </if>
+  </select>
+  <select id="selectByExample" parameterType="com.yx.face.model.entity.UserInfoFrom" resultMap="BaseResultMap">
+    select
+    <if test="distinct">
+      distinct
+    </if>
+    <include refid="Base_Column_List" />
+    from user_info_from
+    <if test="_parameter != null">
+      <include refid="Example_Where_Clause" />
+    </if>
+    <if test="orderByClause != null">
+      order by ${orderByClause}
+    </if>
+  </select>
+  <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="ResultMapWithBLOBs">
+    select 
+    <include refid="Base_Column_List" />
+    ,
+    <include refid="Blob_Column_List" />
+    from user_info_from
+    where id = #{id,jdbcType=INTEGER}
+  </select>
+  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
+    delete from user_info_from
+    where id = #{id,jdbcType=INTEGER}
+  </delete>
+  <delete id="deleteByExample" parameterType="com.yx.face.model.entity.UserInfoFrom">
+    delete from user_info_from
+    <if test="_parameter != null">
+      <include refid="Example_Where_Clause" />
+    </if>
+  </delete>
+  <insert id="insert" parameterType="com.yx.face.model.entity.UserInfoFrom">
+    insert into user_info_from (id, user_info_id, img_base
+      )
+    values (#{id,jdbcType=INTEGER}, #{userInfoId,jdbcType=BIGINT}, #{imgBase,jdbcType=LONGVARBINARY}
+      )
+  </insert>
+  <insert id="insertSelective" parameterType="com.yx.face.model.entity.UserInfoFrom">
+    insert into user_info_from
+    <trim prefix="(" suffix=")" suffixOverrides=",">
+      <if test="id != null">
+        id,
+      </if>
+      <if test="userInfoId != null">
+        user_info_id,
+      </if>
+      <if test="imgBase != null">
+        img_base,
+      </if>
+    </trim>
+    <trim prefix="values (" suffix=")" suffixOverrides=",">
+      <if test="id != null">
+        #{id,jdbcType=INTEGER},
+      </if>
+      <if test="userInfoId != null">
+        #{userInfoId,jdbcType=BIGINT},
+      </if>
+      <if test="imgBase != null">
+        #{imgBase,jdbcType=LONGVARBINARY},
+      </if>
+    </trim>
+  </insert>
+  <select id="countByExample" parameterType="com.yx.face.model.entity.UserInfoFrom" resultType="java.lang.Long">
+    select count(*) from user_info_from
+    <if test="_parameter != null">
+      <include refid="Example_Where_Clause" />
+    </if>
+  </select>
+  <update id="updateByExampleSelective" parameterType="map">
+    update user_info_from
+    <set>
+      <if test="record.id != null">
+        id = #{record.id,jdbcType=INTEGER},
+      </if>
+      <if test="record.userInfoId != null">
+        user_info_id = #{record.userInfoId,jdbcType=INTEGER},
+      </if>
+      <if test="record.imgBase != null">
+        img_base = #{record.imgBase,jdbcType=LONGVARBINARY},
+      </if>
+    </set>
+    <if test="_parameter != null">
+      <include refid="Update_By_Example_Where_Clause" />
+    </if>
+  </update>
+  <update id="updateByExampleWithBLOBs" parameterType="map">
+    update user_info_from
+    set id = #{record.id,jdbcType=INTEGER},
+      user_info_id = #{record.userInfoId,jdbcType=INTEGER},
+      img_base = #{record.imgBase,jdbcType=LONGVARBINARY}
+    <if test="_parameter != null">
+      <include refid="Update_By_Example_Where_Clause" />
+    </if>
+  </update>
+  <update id="updateByExample" parameterType="map">
+    update user_info_from
+    set id = #{record.id,jdbcType=INTEGER},
+      user_info_id = #{record.userInfoId,jdbcType=INTEGER}
+    <if test="_parameter != null">
+      <include refid="Update_By_Example_Where_Clause" />
+    </if>
+  </update>
+  <update id="updateByPrimaryKeySelective" parameterType="com.yx.face.model.entity.UserInfoFrom">
+    update user_info_from
+    <set>
+      <if test="userInfoId != null">
+        user_info_id = #{userInfoId,jdbcType=BIGINT},
+      </if>
+      <if test="imgBase != null">
+        img_base = #{imgBase,jdbcType=LONGVARBINARY},
+      </if>
+    </set>
+    where id = #{id,jdbcType=INTEGER}
+  </update>
+  <update id="updateByPrimaryKeyWithBLOBs" parameterType="com.yx.face.model.entity.UserInfoFrom">
+    update user_info_from
+    set user_info_id = #{userInfoId,jdbcType=BIGINT},
+      img_base = #{imgBase,jdbcType=LONGVARBINARY}
+    where id = #{id,jdbcType=INTEGER}
+  </update>
+  <update id="updateByPrimaryKey" parameterType="com.yx.face.model.entity.UserInfoFrom">
+    update user_info_from
+    set user_info_id = #{userInfoId,jdbcType=BIGINT}
+    where id = #{id,jdbcType=INTEGER}
+  </update>
+</mapper>

+ 217 - 0
src/main/resources/mapper/UserVisitorListFromDao.xml

@@ -0,0 +1,217 @@
+<?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.yx.face.dao.UserVisitorListFromDao">
+  <resultMap id="BaseResultMap" type="com.yx.face.model.entity.UserVisitorListFrom">
+    <id column="id" jdbcType="INTEGER" property="id" />
+    <result column="user_visitor_list_id" jdbcType="BIGINT" property="userVisitorListId" />
+  </resultMap>
+  <resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="com.yx.face.model.entity.UserVisitorListFrom">
+    <result column="img_base" jdbcType="LONGVARBINARY" property="imgBase" />
+  </resultMap>
+  <sql id="Example_Where_Clause">
+    <where>
+      <foreach collection="oredCriteria" item="criteria" separator="or">
+        <if test="criteria.valid">
+          <trim prefix="(" prefixOverrides="and" suffix=")">
+            <foreach collection="criteria.criteria" item="criterion">
+              <choose>
+                <when test="criterion.noValue">
+                  and ${criterion.condition}
+                </when>
+                <when test="criterion.singleValue">
+                  and ${criterion.condition} #{criterion.value}
+                </when>
+                <when test="criterion.betweenValue">
+                  and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
+                </when>
+                <when test="criterion.listValue">
+                  and ${criterion.condition}
+                  <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
+                    #{listItem}
+                  </foreach>
+                </when>
+              </choose>
+            </foreach>
+          </trim>
+        </if>
+      </foreach>
+    </where>
+  </sql>
+  <sql id="Update_By_Example_Where_Clause">
+    <where>
+      <foreach collection="example.oredCriteria" item="criteria" separator="or">
+        <if test="criteria.valid">
+          <trim prefix="(" prefixOverrides="and" suffix=")">
+            <foreach collection="criteria.criteria" item="criterion">
+              <choose>
+                <when test="criterion.noValue">
+                  and ${criterion.condition}
+                </when>
+                <when test="criterion.singleValue">
+                  and ${criterion.condition} #{criterion.value}
+                </when>
+                <when test="criterion.betweenValue">
+                  and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
+                </when>
+                <when test="criterion.listValue">
+                  and ${criterion.condition}
+                  <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
+                    #{listItem}
+                  </foreach>
+                </when>
+              </choose>
+            </foreach>
+          </trim>
+        </if>
+      </foreach>
+    </where>
+  </sql>
+  <sql id="Base_Column_List">
+    id, user_visitor_list_id
+  </sql>
+  <sql id="Blob_Column_List">
+    img_base
+  </sql>
+  <select id="selectByExampleWithBLOBs" parameterType="com.yx.face.model.entity.UserVisitorListFrom" resultMap="ResultMapWithBLOBs">
+    select
+    <if test="distinct">
+      distinct
+    </if>
+    <include refid="Base_Column_List" />
+    ,
+    <include refid="Blob_Column_List" />
+    from user_visitor_list_from
+    <if test="_parameter != null">
+      <include refid="Example_Where_Clause" />
+    </if>
+    <if test="orderByClause != null">
+      order by ${orderByClause}
+    </if>
+  </select>
+  <select id="selectByExample" parameterType="com.yx.face.model.entity.UserVisitorListFrom" resultMap="BaseResultMap">
+    select
+    <if test="distinct">
+      distinct
+    </if>
+    <include refid="Base_Column_List" />
+    from user_visitor_list_from
+    <if test="_parameter != null">
+      <include refid="Example_Where_Clause" />
+    </if>
+    <if test="orderByClause != null">
+      order by ${orderByClause}
+    </if>
+  </select>
+  <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="ResultMapWithBLOBs">
+    select 
+    <include refid="Base_Column_List" />
+    ,
+    <include refid="Blob_Column_List" />
+    from user_visitor_list_from
+    where id = #{id,jdbcType=INTEGER}
+  </select>
+  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
+    delete from user_visitor_list_from
+    where id = #{id,jdbcType=INTEGER}
+  </delete>
+  <delete id="deleteByExample" parameterType="com.yx.face.model.entity.UserVisitorListFrom">
+    delete from user_visitor_list_from
+    <if test="_parameter != null">
+      <include refid="Example_Where_Clause" />
+    </if>
+  </delete>
+  <insert id="insert" parameterType="com.yx.face.model.entity.UserVisitorListFrom">
+    insert into user_visitor_list_from (id, user_visitor_list_id, img_base
+      )
+    values (#{id,jdbcType=INTEGER}, #{userVisitorListId,jdbcType=BIGINT}, #{imgBase,jdbcType=LONGVARBINARY}
+      )
+  </insert>
+  <insert id="insertSelective" parameterType="com.yx.face.model.entity.UserVisitorListFrom">
+    insert into user_visitor_list_from
+    <trim prefix="(" suffix=")" suffixOverrides=",">
+      <if test="id != null">
+        id,
+      </if>
+      <if test="userVisitorListId != null">
+        user_visitor_list_id,
+      </if>
+      <if test="imgBase != null">
+        img_base,
+      </if>
+    </trim>
+    <trim prefix="values (" suffix=")" suffixOverrides=",">
+      <if test="id != null">
+        #{id,jdbcType=INTEGER},
+      </if>
+      <if test="userVisitorListId != null">
+        #{userVisitorListId,jdbcType=BIGINT},
+      </if>
+      <if test="imgBase != null">
+        #{imgBase,jdbcType=LONGVARBINARY},
+      </if>
+    </trim>
+  </insert>
+  <select id="countByExample" parameterType="com.yx.face.model.entity.UserVisitorListFrom" resultType="java.lang.Long">
+    select count(*) from user_visitor_list_from
+    <if test="_parameter != null">
+      <include refid="Example_Where_Clause" />
+    </if>
+  </select>
+  <update id="updateByExampleSelective" parameterType="map">
+    update user_visitor_list_from
+    <set>
+      <if test="record.id != null">
+        id = #{record.id,jdbcType=INTEGER},
+      </if>
+      <if test="record.userVisitorListId != null">
+        user_visitor_list_id = #{record.userVisitorListId,jdbcType=BIGINT},
+      </if>
+      <if test="record.imgBase != null">
+        img_base = #{record.imgBase,jdbcType=LONGVARBINARY},
+      </if>
+    </set>
+    <if test="_parameter != null">
+      <include refid="Update_By_Example_Where_Clause" />
+    </if>
+  </update>
+  <update id="updateByExampleWithBLOBs" parameterType="map">
+    update user_visitor_list_from
+    set id = #{record.id,jdbcType=INTEGER},
+      user_visitor_list_id = #{record.userVisitorListId,jdbcType=BIGINT},
+      img_base = #{record.imgBase,jdbcType=LONGVARBINARY}
+    <if test="_parameter != null">
+      <include refid="Update_By_Example_Where_Clause" />
+    </if>
+  </update>
+  <update id="updateByExample" parameterType="map">
+    update user_visitor_list_from
+    set id = #{record.id,jdbcType=INTEGER},
+      user_visitor_list_id = #{record.userVisitorListId,jdbcType=BIGINT}
+    <if test="_parameter != null">
+      <include refid="Update_By_Example_Where_Clause" />
+    </if>
+  </update>
+  <update id="updateByPrimaryKeySelective" parameterType="com.yx.face.model.entity.UserVisitorListFrom">
+    update user_visitor_list_from
+    <set>
+      <if test="userVisitorListId != null">
+        user_visitor_list_id = #{userVisitorListId,jdbcType=BIGINT},
+      </if>
+      <if test="imgBase != null">
+        img_base = #{imgBase,jdbcType=LONGVARBINARY},
+      </if>
+    </set>
+    where id = #{id,jdbcType=INTEGER}
+  </update>
+  <update id="updateByPrimaryKeyWithBLOBs" parameterType="com.yx.face.model.entity.UserVisitorListFrom">
+    update user_visitor_list_from
+    set user_visitor_list_id = #{userVisitorListId,jdbcType=BIGINT},
+      img_base = #{imgBase,jdbcType=LONGVARBINARY}
+    where id = #{id,jdbcType=INTEGER}
+  </update>
+  <update id="updateByPrimaryKey" parameterType="com.yx.face.model.entity.UserVisitorListFrom">
+    update user_visitor_list_from
+    set user_visitor_list_id = #{userVisitorListId,jdbcType=BIGINT}
+    where id = #{id,jdbcType=INTEGER}
+  </update>
+</mapper>