<?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.ruoyi.model.mapper.AppPartnerdataMapper">
    
    <resultMap type="AppPartnerdata" id="AppPartnerdataResult">
        <result property="id"    column="id"    />
        <result property="bid"    column="bid"    />
        <result property="dataAmount"    column="dataAmount"    />
        <result property="remark"    column="remark"    />
        <result property="createTime"    column="create_time"    />
        <result property="createBy"    column="create_by"    />
        <result property="updateTime"    column="update_time"    />
        <result property="updateBy"    column="update_by"    />
        <result property="delFlag"    column="del_flag"    />
    </resultMap>

    <sql id="selectAppPartnerdataVo">
        select id, bid, dataAmount, remark, create_time, create_by, update_time, update_by, del_flag from app_partnerdata
    </sql>

    <select id="selectAppPartnerdataList" parameterType="AppPartnerdata" resultMap="AppPartnerdataResult">
        <include refid="selectAppPartnerdataVo"/>
        <where>  
            <if test="bid != null "> and bid = #{bid}</if>
            <if test="dataAmount != null "> and dataAmount = #{dataAmount}</if>
        </where>
    </select>
    
    <select id="selectAppPartnerdataById" parameterType="Long" resultMap="AppPartnerdataResult">
        <include refid="selectAppPartnerdataVo"/>
        where id = #{id}
    </select>

    <insert id="insertAppPartnerdata" parameterType="AppPartnerdata">
        insert into app_partnerdata
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="id != null">id,</if>
            <if test="bid != null">bid,</if>
            <if test="dataAmount != null">dataAmount,</if>
            <if test="remark != null">remark,</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},</if>
            <if test="bid != null">#{bid},</if>
            <if test="dataAmount != null">#{dataAmount},</if>
            <if test="remark != null">#{remark},</if>
            <if test="createTime != null">#{createTime},</if>
            <if test="createBy != null">#{createBy},</if>
            <if test="updateTime != null">#{updateTime},</if>
            <if test="updateBy != null">#{updateBy},</if>
            <if test="delFlag != null">#{delFlag},</if>
         </trim>
    </insert>

    <update id="updateAppPartnerdata" parameterType="AppPartnerdata">
        update app_partnerdata
        <trim prefix="SET" suffixOverrides=",">
            <if test="bid != null">bid = #{bid},</if>
            <if test="dataAmount != null">dataAmount = #{dataAmount},</if>
            <if test="remark != null">remark = #{remark},</if>
            <if test="createTime != null">create_time = #{createTime},</if>
            <if test="createBy != null">create_by = #{createBy},</if>
            <if test="updateTime != null">update_time = #{updateTime},</if>
            <if test="updateBy != null">update_by = #{updateBy},</if>
            <if test="delFlag != null">del_flag = #{delFlag},</if>
        </trim>
        where id = #{id}
    </update>

    <delete id="deleteAppPartnerdataById" parameterType="Long">
        delete from app_partnerdata where id = #{id}
    </delete>

    <delete id="deleteAppPartnerdataByIds" parameterType="String">
        delete from app_partnerdata where id in 
        <foreach item="id" collection="array" open="(" separator="," close=")">
            #{id}
        </foreach>
    </delete>
</mapper>