<?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.hzya.frame.grpU8.nxproof.attachment.entity.AttachmentFileEntity">
    <resultMap id="get-AttachmentFileEntity-result" type="com.hzya.frame.grpU8.nxproof.attachment.entity.AttachmentFileEntity">

        <result property="aTGuid" column="aTGuid" />
        <result property="createDate" column="createDate" />
        <result property="createID" column="createID" />
        <result property="updateDate" column="updateDate" />
        <result property="updateID" column="updateID" />
        <result property="deleteDate" column="deleteDate" />
        <result property="deleteID" column="deleteID" />
        <result property="aTFileName" column="aTFileName" />
        <result property="aTExtName" column="aTExtName" />
        <result column="aTFile" property="aTFile" jdbcType="BLOB"  typeHandler="org.apache.ibatis.type.BlobTypeHandler" />
        <result property="relationApp" column="relationApp" />
        <result property="isDELETE" column="isDELETE" />
    </resultMap>


    <sql id="AttachmentFileEntity_Base_Column_List">
        ATGuid,
        CreateDate,
        CreateID,
        UpdateDate,
        UpdateID,
        DeleteDate,
        DeleteID,
        ATFileName,
        ATExtName,
        ATFile,
        RelationApp,
        ISDELETE
	</sql>



    <!-- 查询 采用==查询 -->
    <select id="AttachmentFileEntity_list_base" resultMap="get-AttachmentFileEntity-result" parameterType="com.hzya.frame.grpU8.nxproof.attachment.entity.AttachmentFileEntity">
        select
        <include refid="AttachmentFileEntity_Base_Column_List" />
        FROM
        AT_AttachmentFile
        <trim prefix="where" prefixOverrides="and">
            <if test="aTGuid != null and aTGuid !='' "> aTGuid = #{aTGuid} </if>
            <if test="aTFileName != null and aTFileName !='' ">and aTFileName = #{aTFileName} </if>
        </trim>
    </select>


    <insert id="AttachmentFileEntity_insert" parameterType="com.hzya.frame.grpU8.nxproof.attachment.entity.AttachmentFileEntity">
        insert into AT_AttachmentFile(
        <trim suffix="" suffixOverrides=",">
            <if test="aTGuid != null and aTGuid !='' ">aTGuid,</if>
            <if test="createDate != null and createDate !='' "> createDate, </if>
            <if test="createID != null and createID !='' "> createID, </if>
            <if test="updateDate != null and updateDate !='' ">   updateDate ,</if>
            <if test="updateID != null and updateID !='' ">updateID,</if>
            <if test="deleteDate != null and deleteDate !='' ">deleteDate,</if>
            <if test="deleteID != null and deleteID !='' ">deleteID,</if>
            <if test="aTFileName != null and aTFileName !='' ">aTFileName,</if>
            <if test="aTExtName != null and aTExtName !='' ">aTExtName,</if>
            <if test="aTFile != null and aTFile !='' ">aTFile,</if>
            relationApp,
            isDELETE
        </trim>
        )values
        (
        <trim suffix="" suffixOverrides=",">
            <if test="aTGuid != null and aTGuid !='' ">#{aTGuid},</if>
            <if test="createDate != null and createDate !='' "> #{createDate}, </if>
            <if test="createID != null and createID !='' "> #{createID}, </if>
            <if test="updateDate != null and updateDate !='' ">   #{updateDate} ,</if>
            <if test="updateID != null and updateID !='' ">#{updateID},</if>
            <if test="deleteDate != null and deleteDate !='' ">#{deleteDate},</if>
            <if test="deleteID != null and deleteID !='' ">#{deleteID},</if>
            <if test="aTFileName != null and aTFileName !='' ">#{aTFileName},</if>
            <if test="aTExtName != null and aTExtName !='' ">#{aTExtName},</if>
            <if test="aTFile != null and aTFile !='' ">#{aTFile,typeHandler=org.apache.ibatis.type.BlobTypeHandler},</if>
            'OER',
            0

        </trim>
        )
    </insert>
</mapper>
