懒羊羊
2023-08-30 1ac2bc1590406d9babec036e154d8d08f34a6aa1
提交 | 用户 | 时间
1ac2bc 1 <?xml version="1.0" encoding="UTF-8"?>
2 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
3 <mapper namespace="cn.stylefeng.guns.workflow.modular.mapper.ActModelMapper">
4
5     <!--模型表名 -->
6     <sql id="tableName">
7         ACT_RE_MODEL
8     </sql>
9
10     <!--数据字典表名 -->
11     <sql id="dicTableName">
12         SYS_DICTIONARIES
13     </sql>
14
15     <!-- 列表 -->
16     <select id="datalistPage" resultType="java.util.Map">
17         select
18             a.ID_,
19             a.REV_,
20             a.NAME_,
21             a.KEY_,
22             a.CATEGORY_,
23             a.CREATE_TIME_,
24             a.LAST_UPDATE_TIME_,
25             a.VERSION_,
26             d.BIANMA,
27             d.NAME DNAME
28         from
29         <include refid="tableName"></include> a
30         left join
31         <include refid="dicTableName"></include> d
32         on a.CATEGORY_ = d.BIANMA
33         where 1=1
34         <if test="pd.keywords!= null and pd.keywords != ''"><!-- 关键词检索 -->
35             and
36                 (
37                     a.NAME_ LIKE CONCAT(CONCAT('%', #{pd.keywords}),'%')
38                 )
39         </if>
40         <if test="pd.category != null and pd.category != ''"><!-- 分类检索 -->
41             and a.CATEGORY_=#{pd.category}
42         </if>
43         order by a.LAST_UPDATE_TIME_ desc
44     </select>
45
46     <select id="datalistPage" resultType="java.util.Map" databaseId="oracle">
47         select
48             a.ID_,
49             a.REV_,
50             a.NAME_,
51             a.KEY_,
52             a.CATEGORY_,
53             a.CREATE_TIME_,
54             a.LAST_UPDATE_TIME_,
55             a.VERSION_,
56             d.BIANMA,
57             d.NAME DNAME
58         from
59         <include refid="tableName"></include> a
60         left join
61         <include refid="dicTableName"></include> d
62         on a.CATEGORY_ = d.BIANMA
63         where 1=1
64         <if test="pd.keywords!= null and pd.keywords != ''"><!-- 关键词检索 -->
65             and
66                 (
67                     a.NAME_ LIKE '%' || #{pd.keywords} || '%'
68                 )
69         </if>
70         <if test="pd.category != null and pd.category != ''"><!-- 分类检索 -->
71             and a.CATEGORY_=#{pd.category}
72         </if>
73         order by a.LAST_UPDATE_TIME_ desc
74     </select>
75
76     <!-- 通过ID获取数据 -->
77     <select id="findById" resultType="java.util.Map">
78         select
79             ID_,
80             CATEGORY_
81         from
82         <include refid="tableName"></include>
83         where
84             ID_ = #{modelId}
85     </select>
86
87     <select id="findById" resultType="java.util.Map" databaseId="oracle">
88         select
89             ID_,
90             CATEGORY_
91         from
92         <include refid="tableName"></include>
93         where
94             ID_ = #{modelId}
95     </select>
96
97     <!-- 修改类型 -->
98     <update id="edit">
99         update
100         <include refid="tableName"></include>
101         set
102             CATEGORY_ = #{category}
103         where
104             ID_ = #{modelId}
105     </update>
106
107     <update id="edit" databaseId="oracle">
108         update
109         <include refid="tableName"></include>
110         set
111             CATEGORY_ = #{category}
112         where
113             ID_ = #{modelId}
114     </update>
115
116 </mapper>