<?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="cn.timer.api.dao.qyzx.QyzxEntAuthMapper">

    <resultMap id="BaseResultMap" type="cn.timer.api.bean.qyzx.QyzxEntAuth" >
        	<id column="id" property="id" />
                <id column="id" property="id" />
                <result column="org_code" property="orgCode" />
                <result column="certificate_type" property="certificateType" />
                <result column="business_license_url" property="businessLicenseUrl" />
                <result column="uscc" property="uscc" />
                <result column="name" property="name" />
                <result column="legal_person" property="legalPerson" />
                <result column="legal_person_idcard" property="legalPersonIdcard" />
                <result column="city" property="city" />
                <result column="detailed_address" property="detailedAddress" />
                <result column="auth_certificate_url" property="authCertificateUrl" />
                <result column="auth_type" property="authType" />
                <result column="auth_time" property="authTime" />
    </resultMap>

    <sql id="Base_Column_List">
                id,
                org_code,
                certificate_type,
                business_license_url,
                uscc,
                name,
                legal_person,
                legal_person_idcard,
                city,
                detailed_address,
                auth_certificate_url,
                auth_type,
                auth_time
    </sql>
    
    <sql id="Base_Column_List_Alias">
                id QyzxEntAuth_id,
                org_code QyzxEntAuth_org_code,
                certificate_type QyzxEntAuth_certificate_type,
                business_license_url QyzxEntAuth_business_license_url,
                uscc QyzxEntAuth_uscc,
                name QyzxEntAuth_name,
                legal_person QyzxEntAuth_legal_person,
                legal_person_idcard QyzxEntAuth_legal_person_idcard,
                city QyzxEntAuth_city,
                detailed_address QyzxEntAuth_detailed_address,
                auth_certificate_url QyzxEntAuth_auth_certificate_url,
                auth_type QyzxEntAuth_auth_type,
                auth_time QyzxEntAuth_auth_time
    </sql>

	<!-- 

    <insert id="insert" useGeneratedKeys="true" keyColumn="id" parameterType="cn.timer.api.bean.qyzx.QyzxEntAuth">
        INSERT INTO qyzx_ent_auth
        <trim prefix="(" suffix=")" suffixOverrides=",">
                        <if test ='null != orgCode'>
                        org_code,
                        </if>
                        <if test ='null != certificateType'>
                        certificate_type,
                        </if>
                        <if test ='null != businessLicenseUrl'>
                        business_license_url,
                        </if>
                        <if test ='null != uscc'>
                        uscc,
                        </if>
                        <if test ='null != name'>
                        name,
                        </if>
                        <if test ='null != legalPerson'>
                        legal_person,
                        </if>
                        <if test ='null != legalPersonIdcard'>
                        legal_person_idcard,
                        </if>
                        <if test ='null != city'>
                        city,
                        </if>
                        <if test ='null != detailedAddress'>
                        detailed_address,
                        </if>
                        <if test ='null != authCertificateUrl'>
                        auth_certificate_url,
                        </if>
                        <if test ='null != authType'>
                        auth_type,
                        </if>
                        <if test ='null != authTime'>
                        auth_time
                        </if>
        </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
                        <if test ='null != orgCode'>
                        #{orgCode},
                        </if>
                        <if test ='null != certificateType'>
                        #{certificateType},
                        </if>
                        <if test ='null != businessLicenseUrl'>
                        #{businessLicenseUrl},
                        </if>
                        <if test ='null != uscc'>
                        #{uscc},
                        </if>
                        <if test ='null != name'>
                        #{name},
                        </if>
                        <if test ='null != legalPerson'>
                        #{legalPerson},
                        </if>
                        <if test ='null != legalPersonIdcard'>
                        #{legalPersonIdcard},
                        </if>
                        <if test ='null != city'>
                        #{city},
                        </if>
                        <if test ='null != detailedAddress'>
                        #{detailedAddress},
                        </if>
                        <if test ='null != authCertificateUrl'>
                        #{authCertificateUrl},
                        </if>
                        <if test ='null != authType'>
                        #{authType},
                        </if>
                        <if test ='null != authTime'>
                        #{authTime}
                        </if>
        </trim>
    </insert>

    <delete id="delete" >
        DELETE FROM qyzx_ent_auth
        WHERE id = #{id}
    </delete>

    <update id="update" parameterType="cn.timer.api.bean.qyzx.QyzxEntAuth">
        UPDATE qyzx_ent_auth
        <set>
                    <if test ='null != orgCode'>org_code = #{orgCode},</if>
                    <if test ='null != certificateType'>certificate_type = #{certificateType},</if>
                    <if test ='null != businessLicenseUrl'>business_license_url = #{businessLicenseUrl},</if>
                    <if test ='null != uscc'>uscc = #{uscc},</if>
                    <if test ='null != name'>name = #{name},</if>
                    <if test ='null != legalPerson'>legal_person = #{legalPerson},</if>
                    <if test ='null != legalPersonIdcard'>legal_person_idcard = #{legalPersonIdcard},</if>
                    <if test ='null != city'>city = #{city},</if>
                    <if test ='null != detailedAddress'>detailed_address = #{detailedAddress},</if>
                    <if test ='null != authCertificateUrl'>auth_certificate_url = #{authCertificateUrl},</if>
                    <if test ='null != authType'>auth_type = #{authType},</if>
                    <if test ='null != authTime'>auth_time = #{authTime}</if>
        </set>
        WHERE id = #{id}
    </update>


    <select id="load" resultMap="BaseResultMap">
        SELECT <include refid="Base_Column_List" />
        FROM qyzx_ent_auth
        WHERE id = #{id}
    </select>

    <select id="pageList" resultMap="BaseResultMap">
        SELECT <include refid="Base_Column_List" />
        FROM qyzx_ent_auth
        LIMIT #{offset}, #{pageSize}
    </select>

    <select id="pageListCount" resultType="java.lang.Integer">
        SELECT count(1)
        FROM qyzx_ent_auth
    </select>

	 -->

</mapper>