懒羊羊
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.ModelMapper">
4
5     <!-- 通用查询映射结果 -->
6     <resultMap id="BaseResultMap" type="cn.stylefeng.guns.workflow.modular.entity.Model">
7         <id column="ID_" property="id" />
8         <result column="REV_" property="rev" />
9         <result column="NAME_" property="name" />
10         <result column="KEY_" property="key" />
11         <result column="CATEGORY_" property="category" />
12         <result column="CREATE_TIME_" property="createTime" />
13         <result column="LAST_UPDATE_TIME_" property="lastUpdateTime" />
14         <result column="VERSION_" property="version" />
15         <result column="META_INFO_" property="metaInfo" />
16         <result column="DEPLOYMENT_ID_" property="deploymentId" />
17         <result column="EDITOR_SOURCE_VALUE_ID_" property="editorSourceValueId" />
18         <result column="EDITOR_SOURCE_EXTRA_VALUE_ID_" property="editorSourceExtraValueId" />
19         <result column="TENANT_ID_" property="tenantId" />
20     </resultMap>
21
22     <!-- 通用查询结果列 -->
23     <sql id="Base_Column_List">
24         ID_ AS "id", REV_ AS "rev", NAME_ AS "name", KEY_ AS "key", CATEGORY_ AS "category", CREATE_TIME_ AS "createTime", LAST_UPDATE_TIME_ AS "lastUpdateTime", VERSION_ AS "version", META_INFO_ AS "metaInfo", DEPLOYMENT_ID_ AS "deploymentId", EDITOR_SOURCE_VALUE_ID_ AS "editorSourceValueId", EDITOR_SOURCE_EXTRA_VALUE_ID_ AS "editorSourceExtraValueId", TENANT_ID_ AS "tenantId"
25     </sql>
26
27
28     <select id="customList" resultType="cn.stylefeng.guns.workflow.modular.model.result.ModelResult" parameterType="cn.stylefeng.guns.workflow.modular.model.params.ModelParam">
29         select
30         <include refid="Base_Column_List"/>
31         from act_re_model where 1 = 1
32     </select>
33
34     <select id="customMapList" resultType="map" parameterType="cn.stylefeng.guns.workflow.modular.model.params.ModelParam">
35         select
36         <include refid="Base_Column_List"/>
37         from act_re_model where 1 = 1
38     </select>
39
40     <select id="customPageList" resultType="cn.stylefeng.guns.workflow.modular.model.result.ModelResult" parameterType="cn.stylefeng.guns.workflow.modular.model.params.ModelParam">
41         select
42         <include refid="Base_Column_List"/>
43         from act_re_model where 1 = 1
44     </select>
45
46     <select id="customPageMapList" resultType="map" parameterType="cn.stylefeng.guns.workflow.modular.model.params.ModelParam">
47         select
48         <include refid="Base_Column_List"/>,
49         dict.name as cateName
50         from act_re_model model
51         inner join sys_dict dict on model.CATEGORY_ = dict.code
52         <where>
53             <if test="paramCondition.name != null and paramCondition.name != ''">
54                 model.NAME_ like CONCAT('%',#{paramCondition.name},'%')
55             </if>
56             <if test="paramCondition.category != null and paramCondition.category != ''">
57                 and model.CATEGORY_ like CONCAT('%',#{paramCondition.category},'%')
58             </if>
59         </where>
60         order by model.LAST_UPDATE_TIME_ desc
61     </select>
62
63     <select id="customPageMapList" resultType="map" parameterType="cn.stylefeng.guns.workflow.modular.model.params.ModelParam" databaseId="mssql">
64         select
65         <include refid="Base_Column_List"/>,
66         dict.name as cateName
67         from act_re_model model
68         inner join sys_dict dict on model.CATEGORY_ = dict.code
69         <where>
70             <if test="paramCondition.name != null and paramCondition.name != ''">
71                 model.NAME_ like CONCAT('%',#{paramCondition.name},'%')
72             </if>
73             <if test="paramCondition.category != null and paramCondition.category != ''">
74                 and model.CATEGORY_ like CONCAT('%',#{paramCondition.category},'%')
75             </if>
76         </where>
77         order by model.LAST_UPDATE_TIME_ desc
78     </select>
79
80     <select id="customPageMapList" resultType="map" parameterType="cn.stylefeng.guns.workflow.modular.model.params.ModelParam" databaseId="pgsql">
81         select
82         <include refid="Base_Column_List"/>,
83         dict.name as "cateName"
84         from act_re_model m
85         inner join sys_dict dict on m.CATEGORY_ = dict.code
86         <where>
87             <if test="paramCondition.name != null and paramCondition.name != ''">
88                 m.NAME_ like '%' || #{paramCondition.name} || '%'
89             </if>
90             <if test="paramCondition.category != null and paramCondition.category != ''">
91                 and m.CATEGORY_ like '%' || #{paramCondition.category} || '%'
92             </if>
93         </where>
94         order by m.LAST_UPDATE_TIME_ desc
95     </select>
96
97     <select id="customPageMapList" resultType="map" parameterType="cn.stylefeng.guns.workflow.modular.model.params.ModelParam" databaseId="oracle">
98         select
99         <include refid="Base_Column_List"/>,
100         dict.name as "cateName"
101         from act_re_model m
102         inner join sys_dict dict on m.CATEGORY_ = dict.code
103         <where>
104             <if test="paramCondition.name != null and paramCondition.name != ''">
105                 m.NAME_ like '%' || #{paramCondition.name} || '%'
106             </if>
107             <if test="paramCondition.category != null and paramCondition.category != ''">
108                 and m.CATEGORY_ like '%' || #{paramCondition.category} || '%'
109             </if>
110         </where>
111         order by m.LAST_UPDATE_TIME_ desc
112     </select>
113
114 </mapper>