UserInfoFaceMapper.xml 2.08 KB
<!DOCTYPE mapper
        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.itboyst.facedemo.mapper.MybatisUserFaceInfoMapper">
    <resultMap id="userFace" type="com.itboyst.facedemo.domain.UserFaceInfo">
        <id column="id" property="id" javaType="int"/>
        <result column="group_id" property="groupId" javaType="java.lang.Integer"/>
        <result column="face_id" property="faceId" javaType="String"/>
        <result column="phone_number" property="phoneNumber" javaType="String"/>
        <result column="create_time" property="createTime" javaType="java.util.Date"/>
        <result column="face_feature" property="faceFeature"/>
    </resultMap>

    <resultMap id="userFace2" type="com.itboyst.facedemo.dto.FaceUserInfo">
        <id column="id" property="id" javaType="int"/>
        <result column="group_id" property="groupId" javaType="java.lang.Integer"/>
        <result column="face_id" property="faceId" javaType="String"/>
        <result column="phone_number" property="phoneNumber" javaType="String"/>
        <result column="create_time" property="createTime" javaType="java.util.Date"/>
        <result column="face_feature" property="faceFeature"/>
    </resultMap>


    <select id="findUserFaceInfoList" resultMap="userFace"  resultType="com.itboyst.facedemo.domain.UserFaceInfo">
        SELECT name,create_time from user_face_info
    </select>

    <insert id="insertUserFaceInfo" parameterType="com.itboyst.facedemo.domain.UserFaceInfo" >
            INSERT INTO user_face_info (group_id,face_id,name,face_feature) VALUES (#{groupId},#{faceId},#{name},#{faceFeature})
    </insert>

    <select id="getUserFaceInfoByGroupId" resultMap="userFace2" parameterType="java.lang.Integer" resultType="com.itboyst.facedemo.dto.FaceUserInfo">
        select face_id,name,face_feature from user_face_info
    </select>

    <update id="updateUserFaceInfo" parameterType="com.itboyst.facedemo.domain.UserFaceInfo" >
       update  user_face_info  set  face_feature =  #{faceFeature} where name = #{name}
    </update>
</mapper>