CREATE SEQUENCE IF NOT EXISTS 表名_id字段名_SEQ;
CREATE TABLE "PUBLIC"."disaster_funds" (
"funds_id" INT8 NOT NULL DEFAULT NEXTVAL('disaster_funds_funds_id_SEQ'::REGCLASS),
"area_code" VARCHAR(12 byte) NULL,
"disaster_event" VARCHAR(50 byte) NULL,
"occur_date" DATE NULL,
"typhoon_num" INT4 NULL,
"funds_num" NUMERIC(10) NULL,
"notes" VARCHAR NULL,
"create_time" TIMESTAMP(6) NULL,
CONSTRAINT "表名_PKEY" PRIMARY KEY ("funds_id")
)
WITH (
OIDS=FALSE
);
<insert id="insert" parameterType="cn.entity.DisasterFunds" useGeneratedKeys="true" keyProperty="fundsId"> insert into disaster_funds (area_code, disaster_event, occur_date, typhoon_num, funds_num, notes, create_time) values (#{areaCode,jdbcType=VARCHAR}, #{disasterEvent,jdbcType=VARCHAR}, #{occurDate,jdbcType=DATE}, #{typhoonNum,jdbcType=INTEGER},#{fundsNum,jdbcType=DECIMAL}, #{notes,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}) </insert>