<?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.frequency.userwithdrawalwaywi.mapper.UserWithdrawalWayWiMapper">
    
    <resultMap type="com.ruoyi.frequency.userwithdrawalwaywi.entity.UserWithdrawalWayWi" id="UserWithdrawalWayWiResult">
        <result property="id"    column="id"    />
        <result property="createBy"    column="create_by"    />
        <result property="createTime"    column="create_time"    />
        <result property="updateBy"    column="update_by"    />
        <result property="updateTime"    column="update_time"    />
        <result property="delFlag"    column="del_flag"    />
        <result property="userType"    column="user_type"    />
        <result property="userId"    column="user_id"    />
        <result property="pfWayId"    column="pf_way_id"    />
        <result property="linkman"    column="linkman"    />
        <result property="contactWay"    column="contact_way"    />
        <result property="cashAccount"    column="cash_account"    />
        <result property="userWithdrawalWayId"    column="user_withdrawal_way_id"    />
        <result property="accountOpeningSubBranch"    column="account_opening_sub_branch"    />
        <result property="areaCode"    column="area_code"    />
    </resultMap>

    <sql id="selectUserWithdrawalWayWiVo">
        select id, create_by, create_time, update_by, update_time, del_flag, user_type, user_id, pf_way_id, linkman, contact_way, cash_account, user_withdrawal_way_id, account_opening_sub_branch, area_code from t_user_withdrawal_way_wi
    </sql>

    <select id="selectUserWithdrawalWayWiList" parameterType="com.ruoyi.frequency.userwithdrawalwaywi.entity.UserWithdrawalWayWi" resultMap="UserWithdrawalWayWiResult">
        <include refid="selectUserWithdrawalWayWiVo"/>
        <where>  
            <if test="createBy != null "> and create_by = #{createBy}</if>
            <if test="updateBy != null "> and update_by = #{updateBy}</if>
            <if test="userType != null  and userType != ''"> and user_type = #{userType}</if>
            <if test="userId != null "> and user_id = #{userId}</if>
            <if test="pfWayId != null "> and pf_way_id = #{pfWayId}</if>
            <if test="linkman != null  and linkman != ''"> and linkman = #{linkman}</if>
            <if test="contactWay != null  and contactWay != ''"> and contact_way = #{contactWay}</if>
            <if test="cashAccount != null  and cashAccount != ''"> and cash_account = #{cashAccount}</if>
            <if test="userWithdrawalWayId != null "> and user_withdrawal_way_id = #{userWithdrawalWayId}</if>
            <if test="accountOpeningSubBranch != null  and accountOpeningSubBranch != ''"> and account_opening_sub_branch = #{accountOpeningSubBranch}</if>
            <if test="areaCode != null  and areaCode != ''"> and area_code = #{areaCode}</if>
        </where>
    </select>
    
    <select id="selectUserWithdrawalWayWiById" parameterType="Long" resultMap="UserWithdrawalWayWiResult">
        <include refid="selectUserWithdrawalWayWiVo"/>
        where id = #{id}
    </select>
        
    <insert id="insertUserWithdrawalWayWi" parameterType="com.ruoyi.frequency.userwithdrawalwaywi.entity.UserWithdrawalWayWi">
        insert into t_user_withdrawal_way_wi
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="id != null">id,</if>
            <if test="createBy != null">create_by,</if>
            <if test="createTime != null">create_time,</if>
            <if test="updateBy != null">update_by,</if>
            <if test="updateTime != null">update_time,</if>
            <if test="delFlag != null">del_flag,</if>
            <if test="userType != null">user_type,</if>
            <if test="userId != null">user_id,</if>
            <if test="pfWayId != null">pf_way_id,</if>
            <if test="linkman != null">linkman,</if>
            <if test="contactWay != null">contact_way,</if>
            <if test="cashAccount != null">cash_account,</if>
            <if test="userWithdrawalWayId != null">user_withdrawal_way_id,</if>
            <if test="accountOpeningSubBranch != null">account_opening_sub_branch,</if>
            <if test="areaCode != null">area_code,</if>
         </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="id != null">#{id},</if>
            <if test="createBy != null">#{createBy},</if>
            <if test="createTime != null">#{createTime},</if>
            <if test="updateBy != null">#{updateBy},</if>
            <if test="updateTime != null">#{updateTime},</if>
            <if test="delFlag != null">#{delFlag},</if>
            <if test="userType != null">#{userType},</if>
            <if test="userId != null">#{userId},</if>
            <if test="pfWayId != null">#{pfWayId},</if>
            <if test="linkman != null">#{linkman},</if>
            <if test="contactWay != null">#{contactWay},</if>
            <if test="cashAccount != null">#{cashAccount},</if>
            <if test="userWithdrawalWayId != null">#{userWithdrawalWayId},</if>
            <if test="accountOpeningSubBranch != null">#{accountOpeningSubBranch},</if>
            <if test="areaCode != null">#{areaCode},</if>
         </trim>
    </insert>

    <update id="updateByWithdrawalWayWi" parameterType="com.ruoyi.frequency.userwithdrawalwaywi.entity.UserWithdrawalWayWi">
        update t_user_withdrawal_way_wi
        <trim prefix="SET" suffixOverrides=",">
            <if test="createBy != null">create_by = #{createBy},</if>
            <if test="createTime != null">create_time = #{createTime},</if>
            <if test="updateBy != null">update_by = #{updateBy},</if>
            <if test="updateTime != null">update_time = #{updateTime},</if>
            <if test="delFlag != null">del_flag = #{delFlag},</if>
            <if test="userType != null">user_type = #{userType},</if>
            <if test="userId != null">user_id = #{userId},</if>
            <if test="pfWayId != null">pf_way_id = #{pfWayId},</if>
            <if test="linkman != null">linkman = #{linkman},</if>
            <if test="contactWay != null">contact_way = #{contactWay},</if>
            <if test="cashAccount != null">cash_account = #{cashAccount},</if>
            <if test="userWithdrawalWayId != null">user_withdrawal_way_id = #{userWithdrawalWayId},</if>
            <if test="accountOpeningSubBranch != null">account_opening_sub_branch = #{accountOpeningSubBranch},</if>
            <if test="areaCode != null">area_code = #{areaCode},</if>
        </trim>
        where id = #{id}
    </update>

    <delete id="deleteUserWithdrawalWayWiById" parameterType="Long">
        delete from t_user_withdrawal_way_wi where id = #{id}
    </delete>

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