懒羊羊
2023-11-14 8286c62256f23bc2367a6729c0f46f84215e380b
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
<?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.ModelMapper">
 
    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="cn.stylefeng.guns.workflow.modular.entity.Model">
        <id column="ID_" property="id" />
        <result column="REV_" property="rev" />
        <result column="NAME_" property="name" />
        <result column="KEY_" property="key" />
        <result column="CATEGORY_" property="category" />
        <result column="CREATE_TIME_" property="createTime" />
        <result column="LAST_UPDATE_TIME_" property="lastUpdateTime" />
        <result column="VERSION_" property="version" />
        <result column="META_INFO_" property="metaInfo" />
        <result column="DEPLOYMENT_ID_" property="deploymentId" />
        <result column="EDITOR_SOURCE_VALUE_ID_" property="editorSourceValueId" />
        <result column="EDITOR_SOURCE_EXTRA_VALUE_ID_" property="editorSourceExtraValueId" />
        <result column="TENANT_ID_" property="tenantId" />
    </resultMap>
 
    <!-- 通用查询结果列 -->
    <sql id="Base_Column_List">
        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"
    </sql>
 
 
    <select id="customList" resultType="cn.stylefeng.guns.workflow.modular.model.result.ModelResult" parameterType="cn.stylefeng.guns.workflow.modular.model.params.ModelParam">
        select
        <include refid="Base_Column_List"/>
        from act_re_model where 1 = 1
    </select>
 
    <select id="customMapList" resultType="map" parameterType="cn.stylefeng.guns.workflow.modular.model.params.ModelParam">
        select
        <include refid="Base_Column_List"/>
        from act_re_model where 1 = 1
    </select>
 
    <select id="customPageList" resultType="cn.stylefeng.guns.workflow.modular.model.result.ModelResult" parameterType="cn.stylefeng.guns.workflow.modular.model.params.ModelParam">
        select
        <include refid="Base_Column_List"/>
        from act_re_model where 1 = 1
    </select>
 
    <select id="customPageMapList" resultType="map" parameterType="cn.stylefeng.guns.workflow.modular.model.params.ModelParam">
        select
        <include refid="Base_Column_List"/>,
        dict.name as cateName
        from act_re_model model
        inner join sys_dict dict on model.CATEGORY_ = dict.code
        <where>
            <if test="paramCondition.name != null and paramCondition.name != ''">
                model.NAME_ like CONCAT('%',#{paramCondition.name},'%')
            </if>
            <if test="paramCondition.category != null and paramCondition.category != ''">
                and model.CATEGORY_ like CONCAT('%',#{paramCondition.category},'%')
            </if>
        </where>
        order by model.LAST_UPDATE_TIME_ desc
    </select>
 
    <select id="customPageMapList" resultType="map" parameterType="cn.stylefeng.guns.workflow.modular.model.params.ModelParam" databaseId="mssql">
        select
        <include refid="Base_Column_List"/>,
        dict.name as cateName
        from act_re_model model
        inner join sys_dict dict on model.CATEGORY_ = dict.code
        <where>
            <if test="paramCondition.name != null and paramCondition.name != ''">
                model.NAME_ like CONCAT('%',#{paramCondition.name},'%')
            </if>
            <if test="paramCondition.category != null and paramCondition.category != ''">
                and model.CATEGORY_ like CONCAT('%',#{paramCondition.category},'%')
            </if>
        </where>
        order by model.LAST_UPDATE_TIME_ desc
    </select>
 
    <select id="customPageMapList" resultType="map" parameterType="cn.stylefeng.guns.workflow.modular.model.params.ModelParam" databaseId="pgsql">
        select
        <include refid="Base_Column_List"/>,
        dict.name as "cateName"
        from act_re_model m
        inner join sys_dict dict on m.CATEGORY_ = dict.code
        <where>
            <if test="paramCondition.name != null and paramCondition.name != ''">
                m.NAME_ like '%' || #{paramCondition.name} || '%'
            </if>
            <if test="paramCondition.category != null and paramCondition.category != ''">
                and m.CATEGORY_ like '%' || #{paramCondition.category} || '%'
            </if>
        </where>
        order by m.LAST_UPDATE_TIME_ desc
    </select>
 
    <select id="customPageMapList" resultType="map" parameterType="cn.stylefeng.guns.workflow.modular.model.params.ModelParam" databaseId="oracle">
        select
        <include refid="Base_Column_List"/>,
        dict.name as "cateName"
        from act_re_model m
        inner join sys_dict dict on m.CATEGORY_ = dict.code
        <where>
            <if test="paramCondition.name != null and paramCondition.name != ''">
                m.NAME_ like '%' || #{paramCondition.name} || '%'
            </if>
            <if test="paramCondition.category != null and paramCondition.category != ''">
                and m.CATEGORY_ like '%' || #{paramCondition.category} || '%'
            </if>
        </where>
        order by m.LAST_UPDATE_TIME_ desc
    </select>
 
</mapper>