29 lines
1.4 KiB
XML
29 lines
1.4 KiB
XML
|
|
<?xml version="1.0" encoding="UTF-8"?>
|
||
|
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||
|
|
<mapper namespace="com.electromagnetic.industry.software.data.manage.repository.dao.TokenMapper">
|
||
|
|
<resultMap id="TokenResultMap" type="com.electromagnetic.industry.software.data.manage.domain.boardservice.user.model.Token">
|
||
|
|
<id column="id" jdbcType="BIGINT" property="id" />
|
||
|
|
<result column="user_id" jdbcType="VARCHAR" property="userId" />
|
||
|
|
<result column="token" jdbcType="VARCHAR" property="token" />
|
||
|
|
<result column="is_long_term" jdbcType="TINYINT" property="isLongTerm" />
|
||
|
|
<result column="created_at" jdbcType="TIMESTAMP" property="createdAt" />
|
||
|
|
<result column="expire_at" jdbcType="TIMESTAMP" property="expireAt" />
|
||
|
|
</resultMap>
|
||
|
|
|
||
|
|
<insert id="insert" parameterType="com.electromagnetic.industry.software.data.manage.domain.boardservice.user.model.Token">
|
||
|
|
insert into tokens(
|
||
|
|
<if test="userId != null and userId !='' ">user_id,</if>
|
||
|
|
<if test="token != null and token !='' ">token,</if>
|
||
|
|
is_long_term,
|
||
|
|
created_at,
|
||
|
|
<if test="expireAt != null">expire_at</if>
|
||
|
|
)
|
||
|
|
values (
|
||
|
|
<if test="userId != null and userId !='' ">#{userId},</if>
|
||
|
|
<if test="token != null and token !='' ">#{token},</if>
|
||
|
|
0,
|
||
|
|
now(),
|
||
|
|
<if test="expireAt !=null">#{expireAt}</if>
|
||
|
|
)
|
||
|
|
</insert>
|
||
|
|
</mapper>
|