<?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.seeyon.dao.impl.CtpFileDaoImpl">
    <resultMap id="get-CtpFileEntity-result" type="com.hzya.frame.seeyon.entity.CtpFileEntity">
        <!--主键 -->
        <result property="id" column="id" />
        <result property="category" column="category" />
        <result property="type" column="type" />
        <result property="filename" column="filename" />
        <result property="mime_type" column="mime_type" />
        <result property="create_date" column="create_date" />
        <result property="create_member" column="create_member" />
        <result property="file_size" column="file_size" />
        <result property="description" column="description" />
        <result property="update_date" column="update_date" />
        <result property="account_id" column="account_id" />
    </resultMap>



    <sql id="CtpFileEntity_sql">
        id,
        category,
        type,
        filename,
        mime_type,
        create_date,
        create_member,
        file_size,
        description,
        update_date,
        account_id
    </sql>


    <!-- 查询 采用==查询 -->
    <select id="entity_list_base" resultMap="get-CtpFileEntity-result" parameterType="com.hzya.frame.seeyon.entity.CtpFileEntity">
    select
    <include refid="CtpFileEntity_sql"/>
    from
    ctp_file
    <trim prefix="where" prefixOverrides="and">
        <if test="id != null and id != ''">id = #{id}</if>
        <if test="filename != null and filename != ''">and filename = #{filename}</if>
    </trim>
    </select>

    <!-- 查询 采用==查询 -->
    <select id="queryFile" resultMap="get-CtpFileEntity-result" parameterType="com.hzya.frame.seeyon.entity.CtpFileEntity">
    select
    <include refid="CtpFileEntity_sql"/>
    from
    ctp_file
    <trim prefix="where" prefixOverrides="and">
        <if test="id != null and id != ''">id = #{id}</if>
        <if test="filename != null and filename != ''">and filename = #{filename}</if>
    </trim>
    </select>

    <!-- 查询 采用==查询 -->
    <select id="queryCtpFileById" resultMap="get-CtpFileEntity-result" parameterType="com.hzya.frame.seeyon.entity.CtpFileEntity">
        select
        <include refid="CtpFileEntity_sql"/>
        from
        ctp_file
        <trim prefix="where" prefixOverrides="and">
            <if test="id != null and id != ''">id = #{id}</if>
            <if test="filename != null and filename != ''">and filename = #{filename}</if>
        </trim>
    </select>


</mapper>
