懒羊羊
2023-08-30 1ac2bc1590406d9babec036e154d8d08f34a6aa1
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
<?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="cn.stylefeng.guns.sys.modular.system.mapper.NoticeMapper">
 
    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="cn.stylefeng.guns.sys.modular.system.entity.Notice">
        <id column="notice_id" property="noticeId" />
        <result column="title" property="title" />
        <result column="content" property="content" />
        <result column="create_time" property="createTime" />
        <result column="create_user" property="createUser" />
        <result column="update_time" property="updateTime" />
        <result column="update_user" property="updateUser" />
    </resultMap>
 
    <!-- 通用查询结果列 -->
    <sql id="Base_Column_List">
        notice_id AS "noticeId", title AS "title", content AS "content", create_time AS "createTime", create_user AS "createUser", update_time AS "updateTime", update_user AS "updateUser"
    </sql>
 
    <select id="list" resultType="map">
        select
        <include refid="Base_Column_List"></include>
        from sys_notice
        <if test="condition != null and condition != ''">
            where title like CONCAT('%',#{condition},'%') or content like CONCAT('%',#{condition},'%')
        </if>
        order by create_time DESC
    </select>
 
    <select id="list" resultType="map" databaseId="pgsql">
        select
        <include refid="Base_Column_List"></include>
        from sys_notice
        <if test="condition != null and condition != ''">
            where title like '%' || #{condition} || '%' or content like '%' || #{condition} || '%'
        </if>
        order by create_time DESC
    </select>
 
    <select id="list" resultType="map" databaseId="oracle">
        select
        <include refid="Base_Column_List"></include>
        from sys_notice
        <if test="condition != null and condition != ''">
            where title like '%' || #{condition} || '%' or content like '%' || #{condition} || '%'
        </if>
        order by create_time DESC
    </select>
</mapper>