当前位置:Gxlcms > 数据库问题 > oracle 排序字段自增长

oracle 排序字段自增长

时间:2021-07-01 10:21:17 帮助过:18人阅读

insert id="insertGoodsDescription" parameterClass="goodsDescription" > <selectKey resultClass="int" keyProperty="serviceDescriptionId" > SELECT goods_description_SEQ.nextval AS service_description_id from dual </selectKey> insert into product_service_description ( service_description_id, label_name, label_icon, label_description, sort_num, product_id, is_default, is_delete, ADD_TIME, ADD_USER_ID, EDIT_TIME, EDIT_USER_ID) values ( #serviceDescriptionId#, #labelName#, #labelIcon#, #labelDescription#, nvl (#sortNum#, ( SELECT MAX(sort_num) + 1 FROM product_service_description) ), <!--#sortNum#,--> #productId#, #isDefault#, N, #addTime#, #addUserId#, #editTime#, #editUserId# ) </insert>
<!-- 添加微信团活动 -->
    
    <insert id="save" parameterType="WeixinActivity">
   
    INSERT INTO  weixin_activity
    (
     WEIXIN_NAME,
     BANNER_IMG_URL,
     START_TIME,
     END_TIME , 
     GROUP_PRICE,
     DISCOUNT_LAB,
     MINIMUM_JOIN_MEMBER_NUM,
     ORDER_BY,
     IS_STATUS,
     BEGIN_WAIT_TIME,
     ADD_USER_ID,
     EDIT_TIME,
     IS_DELETE,
     ADD_TIME,
     EDIT_USER_ID
     ) values
    ( 
    #{weixinName},
    #{bannerImgUrl},
    #{startTime},
    #{endTime},
    #{groupPrice},
    #{discountLab},
    #{minimumJoinMemberNum},
    IFNULL(#{sortBy},  (
        SELECT id
        FROM (
        SELECT MAX(order_by) + 1 AS id
        FROM weixin_activity) t)),
    
    
<!--         (select id from   -->
<!--    (SELECT MAX(order_by) + 1 as id FROM weixin_activity) t), -->
   
    #{isStatus},
    #{beginWaitTime},
    #{addUserId},
    #{editTime},
    N,
    #{addTime},
    #{editUserId}
    )
  </insert>

 

oracle 排序字段自增长

标签:iss   sde   code   bsp   活动   sel   rom   nextval   sort   

人气教程排行