| | |
| | | <?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.lf.server.mapper.sys.TokenMapper"> |
| | | <resultMap id="resultMap" type="com.lf.server.entity.sys.TokenEntity"> |
| | | <mapper namespace="com.terra.system.mapper.sys.TokenMapper"> |
| | | <resultMap id="resultMap" type="com.terra.system.entity.sys.TokenEntity"> |
| | | <id property="id" column="id"></id> |
| | | <result property="createUser" column="create_user"></result> |
| | | <result property="createTime" column="create_time"></result> |
| | |
| | | </select> |
| | | |
| | | <!-- 分页查询 --> |
| | | <select id="selectByPage" resultMap="resultMap" resultType="com.lf.server.entity.sys.TokenEntity"> |
| | | <select id="selectByPage" resultMap="resultMap" resultType="com.terra.system.entity.sys.TokenEntity"> |
| | | select a.*, fn_uname(create_user) createName, fn_uname(update_user) updateName |
| | | from lf.sys_token a |
| | | <where> |
| | |
| | | limit #{limit} offset #{offset} |
| | | </select> |
| | | |
| | | <select id="selectToken" resultMap="resultMap" resultType="com.lf.server.entity.sys.TokenEntity"> |
| | | <select id="selectToken" resultMap="resultMap" resultType="com.terra.system.entity.sys.TokenEntity"> |
| | | select a.*, fn_uname(create_user) createName, fn_uname(update_user) updateName |
| | | from lf.sys_token a |
| | | where id = #{id} |
| | | </select> |
| | | |
| | | <select id="selectByIds" resultType="com.lf.server.entity.sys.TokenEntity"> |
| | | <select id="selectByIds" resultType="com.terra.system.entity.sys.TokenEntity"> |
| | | select * from lf.sys_token where id in |
| | | <foreach item="id" collection="ids" index="index" open="(" separator="," close=")"> |
| | | #{id} |
| | | </foreach> |
| | | </select> |
| | | |
| | | <select id="selectOneById" resultType="com.lf.server.entity.sys.TokenEntity"> |
| | | <select id="selectOneById" resultType="com.terra.system.entity.sys.TokenEntity"> |
| | | select a.*, fn_uname(create_user) createName, fn_uname(update_user) updateName |
| | | from lf.sys_token a |
| | | where id = #{id} and expire > now() limit 1 |
| | | </select> |
| | | |
| | | <select id="selectOneByToken" resultType="com.lf.server.entity.sys.TokenEntity"> |
| | | <select id="selectOneByToken" resultType="com.terra.system.entity.sys.TokenEntity"> |
| | | select a.*, fn_uname(create_user) createName, fn_uname(update_user) updateName |
| | | from lf.sys_token a |
| | | where token = #{token} and expire > now() limit 1 |
| | | </select> |
| | | |
| | | <insert id="insertToken" parameterType="com.lf.server.entity.sys.TokenEntity"> |
| | | <insert id="insertToken" parameterType="com.terra.system.entity.sys.TokenEntity"> |
| | | <selectKey resultType="java.lang.Integer" order="AFTER" keyProperty="id"> |
| | | select currval('lf.sys_token_id_seq'::regclass) as id |
| | | </selectKey> |