tj
2025-06-05 2d549a04870d1315868a7cf19952b64e8071e711
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
<?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.cloudroam.mapper.BookMapper">
 
    <resultMap id="BaseResultMap" type="com.cloudroam.model.BookDO">
        <id column="id" jdbcType="INTEGER" property="id"/>
        <result column="title" jdbcType="VARCHAR" property="title"/>
        <result column="author" jdbcType="VARCHAR" property="author"/>
        <result column="summary" jdbcType="VARCHAR" property="summary"/>
        <result column="image" jdbcType="VARCHAR" property="image"/>
        <result column="create_time" jdbcType="TIMESTAMP" property="createTime"/>
        <result column="update_time" jdbcType="TIMESTAMP" property="updateTime"/>
        <result column="delete_time" jdbcType="TIMESTAMP" property="deleteTime"/>
        <result column="is_deleted" property="isDeleted"/>
    </resultMap>
 
    <!--CONCAT("%",#{q},"%")-->
    <select id="selectByTitleLikeKeyword" resultMap="BaseResultMap">
        SELECT *
        FROM book b
        WHERE
        b.title LIKE #{q}
        AND
        b.is_deleted = 0
    </select>
 
    <select id="selectByTitle" resultMap="BaseResultMap">
        SELECT *
        FROM book b
        WHERE b.title=#{title}
        AND
        b.is_deleted = 0
    </select>
</mapper>