<?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.jeecg.module.custom.ocr.dataDao.PictureCompareMapper">
    <resultMap id="BaseResultMap" type="org.jeecg.module.custom.ocr.dataobject.PictureCompare">
        <id column="id" jdbcType="BIGINT" property="id" />
        <result column="first_img_no" jdbcType="BIGINT" property="firstImgNo" />
        <result column="first_img_url" jdbcType="VARCHAR" property="firstImgUrl" />
        <result column="first_local_img_url" jdbcType="VARCHAR" property="firstLocalImgUrl" />
        <result column="first_img_hash" jdbcType="VARCHAR" property="firstImgHash" />
        <result column="second_img_no" jdbcType="BIGINT" property="secondImgNo" />
        <result column="second_img_url" jdbcType="VARCHAR" property="secondImgUrl" />
        <result column="second_local_img_url" jdbcType="VARCHAR" property="secondLocalImgUrl" />
        <result column="second_img_hash" jdbcType="VARCHAR" property="secondImgHash" />
        <result column="similarity_score" jdbcType="VARCHAR" property="similarityScore" />
    </resultMap>

    <sql id="Base_Column_List">
        id, first_img_no, first_img_url, first_local_img_url, first_img_hash,
        second_img_no, second_img_url, second_local_img_url, second_img_hash,
        similarity_score
    </sql>

    <insert id="save" parameterType="org.jeecg.module.custom.ocr.dataobject.PictureCompare" useGeneratedKeys="true" keyProperty="id">
        INSERT INTO photos_compare (
            first_img_no, first_img_url, first_local_img_url, first_img_hash,
            second_img_no, second_img_url, second_local_img_url, second_img_hash,
            similarity_score
        ) VALUES (
                     #{firstImgNo},
                     #{firstImgUrl},
                     #{firstLocalImgUrl},
                     #{firstImgHash},
                     #{secondImgNo},
                     #{secondImgUrl},
                     #{secondLocalImgUrl},
                     #{secondImgHash},
                     #{similarityScore}
                 )
    </insert>
</mapper>
