Mybatis 动态使用update语句

    update  pf_product_audio_t
        <trim prefix="set" suffixOverrides=",">
            <if test="title != null">title=#{title},if>
            <if test="sort != null">sort=#{sort},if>
            <if test="audio != null">audio=#{audio},if>
            <if test="prodId != null">prod_id=#{prodId},if>    
            <if test="prodName != null">prod_name=#{prodName},if>    
            <if test="isDel != null">is_del=#{isDel},if>    
            <if test="isAdopt != null">is_adopt=#{isAdopt},if>
            <if test="createTime != null">create_time=#{createTime},if>
            <if test="createUser != null">create_user=#{createUser},if>
            <if test="modifyTime != null">modify_time=#{modifyTime},if>
            <if test="modifyUser != null">modify_user=#{modifyUser},if>
        trim>
        <where>
            id = #{id}
        where>

 

转载于:https://www.cnblogs.com/zhuzhen/p/7661140.html

你可能感兴趣的:(Mybatis 动态使用update语句)