zoukankan      html  css  js  c++  java
  • 【sql】带prefix和suffix的insert

    <insert id="insert" parameterType="net.huadong.entity.CustomArea">
    insert into customer_area
    <trim prefix="(" suffix=")" suffixOverrides=",">
    <if test="areaName != null">
    area_name,
    </if>
    <if test="areaType != null">
    area_type,
    </if>
    <if test="isEnable != null">
    is_enable,
    </if>
    <if test="position != null">
    position,
    </if>
    <if test="remark != null">
    remark,
    </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
    <if test="areaName != null">
    #{areaName},
    </if>
    <if test="areaType != null">
    #{areaType},
    </if>
    <if test="isEnable != null">
    #{isEnable},
    </if>
    <if test="position != null">
    #{position},
    </if>
    <if test="remark != null">
    #{remark},
    </if>
    </trim>
    </insert>
  • 相关阅读:
    php第九节课
    php第八节课
    php第七节课
    php第六讲
    php第五节课
    php第四节课
    php第三节课
    Golang Slice切片
    Golang 反射
    Golang 流程控制
  • 原文地址:https://www.cnblogs.com/CESC4/p/7728314.html
Copyright © 2011-2022 走看看