oracle插入当前日期:
<insert id="insert" parameterType="User">
insert into user1
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null and id != ''">id,</if>
<if test="name != null and name != ''">name,</if>
<if test="sex != null and sex != ''">sex,</if>
createtime,
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null and id != ''">#{id},</if>
<if test="name != null and name != ''">#{name},</if>
<if test="sex != null and sex != ''">#{sex},</if>
sysdate,
</trim>
</insert>
mysql插入当前日期:
<insert id="insert" parameterType="User">
insert into user1
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null and id != ''">id,</if>
<if test="name != null and name != ''">name,</if>
<if test="sex != null and sex != ''">sex,</if>
createtime,
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null and id != ''">#{id},</if>
<if test="name != null and name != ''">#{name},</if>
<if test="sex != null and sex != ''">#{sex},</if>
now(),
</trim>
</insert>
mysql获取某个时间端内时间列表信息:
SELECT
date_add( date_sub( '2020-06-01', INTERVAL 1 DAY ), INTERVAL ( cast( help_topic_id AS signed INTEGER ) + 1 ) DAY ) daytime
FROM
mysql.help_topic
WHERE
help_topic_id < DATEDIFF(
'2020-10-31',
date_sub( '2020-06-01', INTERVAL 1 DAY ))