• mybatis带有序列的插入sql--保留一个做纪念


    现在项目都要换成雪花算法生成主键,之前使用序列的方式不用了,但是害怕自己忘记了以前的方式,特意记下来一个。

    <insert id="commit" parameterType="com.picc.hmims.productInfo.dto.ExamineBo">
            <selectKey keyProperty="taskId" resultType="String"    order="BEFORE">
                --             select seq_product_service_price.nextval from dual
                select nextval('seq_t_service')
            </selectKey>
            insert into T_EXAMINE_TASK
            (TASK_ID,TASK_CODE,BUSI_CODE,BUSI_NAME,BUSI_TYPE,TASK_TYPE,TASK_STATUS,TASK_RESULT,TASK_RESULT_DESC,ORG_CODE,APPLY_PERSON,APPLY_TIME,PREPARE,INSERT_OPER,INSERT_TIME
            )
            values(
            cast(#{taskId} as NUMERIC ),
            --seq_t_service.nextval,
            #{taskCode,jdbcType=VARCHAR},
            #{busiCode,jdbcType=VARCHAR},
            #{busiName,jdbcType=VARCHAR},
            #{busiType,jdbcType=VARCHAR},
            #{taskType,jdbcType=VARCHAR},
            #{taskStatus,jdbcType=VARCHAR},
            #{taskResult,jdbcType=VARCHAR},
            #{taskResultDesc,jdbcType=VARCHAR},
            #{orgCode,jdbcType=VARCHAR},
            #{applyPerson,jdbcType=VARCHAR},
            #{applyTime},
            #{prepare,jdbcType=VARCHAR},
            #{insertOper,jdbcType=VARCHAR},
            #{insertTime})
        </insert>
  • 相关阅读:
    [模板]洛谷T3369 普通平衡树 链表&普通Treap
    C++语法知识点整理
    [模板]洛谷T3373 线段树 模板2
    [模板]洛谷T3372 线段树 模板1
    [模板]洛谷T3368 树状数组 模板2
    JSON
    code first迁移和部署
    序列化 (C#)
    Linq小记
    文件和注册表
  • 原文地址:https://www.cnblogs.com/dongyaotou/p/12730160.html
Copyright © 2020-2023  润新知