<?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.jsowell.pile.mapper.ThirdpartyParkingConfigMapper">
    <resultMap id="BaseResultMap" type="com.jsowell.pile.domain.ThirdpartyParkingConfig">
        <!--@mbg.generated-->
        <!--@Table thirdparty_parking_config-->
        <id column="id" jdbcType="INTEGER" property="id"/>
        <result column="parking_name" jdbcType="VARCHAR" property="parkingName"/>
        <result column="app_id" jdbcType="VARCHAR" property="appId"/>
        <result column="secret_key" jdbcType="VARCHAR" property="secretKey"/>
        <result column="parking_merchant_id" jdbcType="VARCHAR" property="parkingMerchantId"/>
        <result column="coupon_id" jdbcType="VARCHAR" property="couponId"/>
        <result column="create_time" jdbcType="TIMESTAMP" property="createTime"/>
        <result column="create_by" jdbcType="VARCHAR" property="createBy"/>
        <result column="update_time" jdbcType="TIMESTAMP" property="updateTime"/>
        <result column="update_by" jdbcType="VARCHAR" property="updateBy"/>
        <result column="del_flag" jdbcType="VARCHAR" property="delFlag"/>
    </resultMap>

    <sql id="Base_Column_List">
        <!--@mbg.generated-->
        id,
        parking_name,
        app_id,
        secret_key,
        parking_merchant_id,
        coupon_id,
        create_time,
        create_by,
        update_time,
        update_by,
        del_flag
    </sql>

    <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
        <!--@mbg.generated-->
        select
        <include refid="Base_Column_List"/>
        from thirdparty_parking_config
        where id = #{id,jdbcType=INTEGER}
    </select>

    <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
        <!--@mbg.generated-->
        delete
        from thirdparty_parking_config
        where id = #{id,jdbcType=INTEGER}
    </delete>

    <insert id="insert" parameterType="com.jsowell.pile.domain.ThirdpartyParkingConfig">
        <!--@mbg.generated-->
        insert into thirdparty_parking_config (id, parking_name, app_id,
                                               secret_key, parking_merchant_id, coupon_id,
                                               create_time, create_by, update_time,
                                               update_by, del_flag)
        values (#{id,jdbcType=INTEGER}, #{parkingName,jdbcType=VARCHAR}, #{appId,jdbcType=VARCHAR},
                #{secretKey,jdbcType=VARCHAR}, #{parkingMerchantId,jdbcType=VARCHAR}, #{couponId,jdbcType=VARCHAR},
                #{createTime,jdbcType=TIMESTAMP}, #{createBy,jdbcType=VARCHAR}, #{updateTime,jdbcType=TIMESTAMP},
                #{updateBy,jdbcType=VARCHAR}, #{delFlag,jdbcType=VARCHAR})
    </insert>

    <insert id="insertSelective" parameterType="com.jsowell.pile.domain.ThirdpartyParkingConfig">
        <!--@mbg.generated-->
        insert into thirdparty_parking_config
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="id != null">
                id,
            </if>
            <if test="parkingName != null">
                parking_name,
            </if>
            <if test="appId != null">
                app_id,
            </if>
            <if test="secretKey != null">
                secret_key,
            </if>
            <if test="parkingMerchantId != null">
                parking_merchant_id,
            </if>
            <if test="couponId != null">
                coupon_id,
            </if>
            <if test="createTime != null">
                create_time,
            </if>
            <if test="createBy != null">
                create_by,
            </if>
            <if test="updateTime != null">
                update_time,
            </if>
            <if test="updateBy != null">
                update_by,
            </if>
            <if test="delFlag != null">
                del_flag,
            </if>
        </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="id != null">
                #{id,jdbcType=INTEGER},
            </if>
            <if test="parkingName != null">
                #{parkingName,jdbcType=VARCHAR},
            </if>
            <if test="appId != null">
                #{appId,jdbcType=VARCHAR},
            </if>
            <if test="secretKey != null">
                #{secretKey,jdbcType=VARCHAR},
            </if>
            <if test="parkingMerchantId != null">
                #{parkingMerchantId,jdbcType=VARCHAR},
            </if>
            <if test="couponId != null">
                #{couponId,jdbcType=VARCHAR},
            </if>
            <if test="createTime != null">
                #{createTime,jdbcType=TIMESTAMP},
            </if>
            <if test="createBy != null">
                #{createBy,jdbcType=VARCHAR},
            </if>
            <if test="updateTime != null">
                #{updateTime,jdbcType=TIMESTAMP},
            </if>
            <if test="updateBy != null">
                #{updateBy,jdbcType=VARCHAR},
            </if>
            <if test="delFlag != null">
                #{delFlag,jdbcType=VARCHAR},
            </if>
        </trim>
    </insert>

    <update id="updateByPrimaryKeySelective" parameterType="com.jsowell.pile.domain.ThirdpartyParkingConfig">
        <!--@mbg.generated-->
        update thirdparty_parking_config
        <set>
            <if test="parkingName != null">
                parking_name = #{parkingName,jdbcType=VARCHAR},
            </if>
            <if test="appId != null">
                app_id = #{appId,jdbcType=VARCHAR},
            </if>
            <if test="secretKey != null">
                secret_key = #{secretKey,jdbcType=VARCHAR},
            </if>
            <if test="parkingMerchantId != null">
                parking_merchant_id = #{parkingMerchantId,jdbcType=VARCHAR},
            </if>
            <if test="couponId != null">
                coupon_id = #{couponId,jdbcType=VARCHAR},
            </if>
            <if test="createTime != null">
                create_time = #{createTime,jdbcType=TIMESTAMP},
            </if>
            <if test="createBy != null">
                create_by = #{createBy,jdbcType=VARCHAR},
            </if>
            <if test="updateTime != null">
                update_time = #{updateTime,jdbcType=TIMESTAMP},
            </if>
            <if test="updateBy != null">
                update_by = #{updateBy,jdbcType=VARCHAR},
            </if>
            <if test="delFlag != null">
                del_flag = #{delFlag,jdbcType=VARCHAR},
            </if>
        </set>
        where id = #{id,jdbcType=INTEGER}
    </update>

    <update id="updateByPrimaryKey" parameterType="com.jsowell.pile.domain.ThirdpartyParkingConfig">
        <!--@mbg.generated-->
        update thirdparty_parking_config
        set parking_name        = #{parkingName,jdbcType=VARCHAR},
            app_id              = #{appId,jdbcType=VARCHAR},
            secret_key          = #{secretKey,jdbcType=VARCHAR},
            parking_merchant_id = #{parkingMerchantId,jdbcType=VARCHAR},
            coupon_id           = #{couponId,jdbcType=VARCHAR},
            create_time         = #{createTime,jdbcType=TIMESTAMP},
            create_by           = #{createBy,jdbcType=VARCHAR},
            update_time         = #{updateTime,jdbcType=TIMESTAMP},
            update_by           = #{updateBy,jdbcType=VARCHAR},
            del_flag            = #{delFlag,jdbcType=VARCHAR}
        where id = #{id,jdbcType=INTEGER}
    </update>

    <select id="selectInfoList" resultMap="BaseResultMap">
        select
            <include refid="Base_Column_List"/>
        from thirdparty_parking_config
    </select>
</mapper>