suerprisePlus
2024-12-17 d4e4ea6405756d495806a609e24ae85ebd7345ef
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
<?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.yb.dao.ThistoriestDao">
    <!-- 根据名称模糊查询-->
    <select id="getSessionId"  resultType="com.yb.entity.THistoryEntity"  >
        SELECT * FROM (
        SELECT * FROM t_history
        <where>
 
        <if test="sessionid != null">
            sessionid like #{sessionid}
        </if>
    </where> ORDER BY id DESC LIMIT 5
        ) AS subquery
        ORDER BY id ASC;
    </select>
</mapper>