懒羊羊
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
<?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.workflow.modular.mapper.ActModelMapper">
 
    <!--模型表名 -->
    <sql id="tableName">
        ACT_RE_MODEL
    </sql>
 
    <!--数据字典表名 -->
    <sql id="dicTableName">
        SYS_DICTIONARIES
    </sql>
 
    <!-- 列表 -->
    <select id="datalistPage" resultType="java.util.Map">
        select
            a.ID_,
            a.REV_,
            a.NAME_,
            a.KEY_,
            a.CATEGORY_,
            a.CREATE_TIME_,
            a.LAST_UPDATE_TIME_,
            a.VERSION_,
            d.BIANMA,
            d.NAME DNAME
        from
        <include refid="tableName"></include> a
        left join
        <include refid="dicTableName"></include> d
        on a.CATEGORY_ = d.BIANMA
        where 1=1
        <if test="pd.keywords!= null and pd.keywords != ''"><!-- 关键词检索 -->
            and
                (
                    a.NAME_ LIKE CONCAT(CONCAT('%', #{pd.keywords}),'%')
                )
        </if>
        <if test="pd.category != null and pd.category != ''"><!-- 分类检索 -->
            and a.CATEGORY_=#{pd.category}
        </if>
        order by a.LAST_UPDATE_TIME_ desc
    </select>
 
    <select id="datalistPage" resultType="java.util.Map" databaseId="oracle">
        select
            a.ID_,
            a.REV_,
            a.NAME_,
            a.KEY_,
            a.CATEGORY_,
            a.CREATE_TIME_,
            a.LAST_UPDATE_TIME_,
            a.VERSION_,
            d.BIANMA,
            d.NAME DNAME
        from
        <include refid="tableName"></include> a
        left join
        <include refid="dicTableName"></include> d
        on a.CATEGORY_ = d.BIANMA
        where 1=1
        <if test="pd.keywords!= null and pd.keywords != ''"><!-- 关键词检索 -->
            and
                (
                    a.NAME_ LIKE '%' || #{pd.keywords} || '%'
                )
        </if>
        <if test="pd.category != null and pd.category != ''"><!-- 分类检索 -->
            and a.CATEGORY_=#{pd.category}
        </if>
        order by a.LAST_UPDATE_TIME_ desc
    </select>
 
    <!-- 通过ID获取数据 -->
    <select id="findById" resultType="java.util.Map">
        select
            ID_,
            CATEGORY_
        from
        <include refid="tableName"></include>
        where
            ID_ = #{modelId}
    </select>
 
    <select id="findById" resultType="java.util.Map" databaseId="oracle">
        select
            ID_,
            CATEGORY_
        from
        <include refid="tableName"></include>
        where
            ID_ = #{modelId}
    </select>
 
    <!-- 修改类型 -->
    <update id="edit">
        update
        <include refid="tableName"></include>
        set
            CATEGORY_ = #{category}
        where
            ID_ = #{modelId}
    </update>
 
    <update id="edit" databaseId="oracle">
        update
        <include refid="tableName"></include>
        set
            CATEGORY_ = #{category}
        where
            ID_ = #{modelId}
    </update>
 
</mapper>