懒羊羊
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
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
<?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.MyleaveMapper">
 
    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="cn.stylefeng.guns.workflow.modular.entity.Myleave">
        <id column="myleave_id" property="myleaveId"/>
        <result column="username" property="username"/>
        <result column="type" property="type"/>
        <result column="starttime" property="starttime"/>
        <result column="endtime" property="endtime"/>
        <result column="whenlong" property="whenlong"/>
        <result column="reason" property="reason"/>
    </resultMap>
 
    <!-- 通用查询结果列 -->
    <sql id="Base_Column_List">
        myleave_id AS "myleaveId", username AS "username", type AS "type", starttime AS "starttime", endtime AS "endtime", whenlong AS "whenlong", reason AS "reason"
    </sql>
 
    <select id="customList" resultType="cn.stylefeng.guns.workflow.modular.model.result.MyleaveResult" parameterType="cn.stylefeng.guns.workflow.modular.model.params.MyLeaveParam">
        select
        <include refid="Base_Column_List"/>
        from oa_myleave where 1 = 1
    </select>
 
    <select id="customMapList" resultType="map" parameterType="cn.stylefeng.guns.workflow.modular.model.params.MyLeaveParam">
        select
        <include refid="Base_Column_List"/>
        from oa_myleave where 1 = 1
    </select>
 
    <select id="customPageList" resultType="cn.stylefeng.guns.workflow.modular.model.result.MyleaveResult" parameterType="cn.stylefeng.guns.workflow.modular.model.params.MyLeaveParam">
        select
        <include refid="Base_Column_List"/>
        from oa_myleave where 1 = 1
    </select>
 
    <!-- 列表 -->
    <select id="datalistPage" resultType="map">
        select
        l.username as username,
        l.type as type,
        l.starttime as starttime,
        l.endtime as endtime,
        l.whenlong as whenlong,
        l.myleave_id as myleaveId,
        l.reason as reason
        from
        oa_myleave l
        where 1=1
        <if test="pd.keywords!= null and pd.keywords != ''">
            and
            (
            l.reason LIKE CONCAT(CONCAT('%', #{pd.keywords}),'%')
            or
            l.username LIKE CONCAT(CONCAT('%', #{pd.keywords}),'%')
            )
        </if>
        <if test="pd.username!= null and pd.username != ''">
            and l.username = #{pd.username}
        </if>
        <if test="pd.type != null and pd.type != ''">
            and l.type=#{pd.type}
        </if>
        order by l.endtime desc
    </select>
 
    <select id="datalistPage" resultType="map" databaseId="mssql">
        select
        l.username as username,
        l.type as type,
        l.starttime as starttime,
        l.endtime as endtime,
        l.whenlong as whenlong,
        l.myleave_id as myleaveId,
        l.reason as reason
        from
        oa_myleave l
        where 1=1
        <if test="pd.keywords!= null and pd.keywords != ''">
            and
            (
            l.reason LIKE CONCAT(CONCAT('%', #{pd.keywords}),'%')
            or
            l.username LIKE CONCAT(CONCAT('%', #{pd.keywords}),'%')
            )
        </if>
        <if test="pd.username!= null and pd.username != ''">
            and l.username = #{pd.username}
        </if>
        <if test="pd.type != null and pd.type != ''">
            and l.type=#{pd.type}
        </if>
        order by l.endtime desc
    </select>
 
    <select id="datalistPage" resultType="map" databaseId="pgsql">
        select
        l.username as "username",
        l.type as "type",
        l.starttime as "starttime",
        l.endtime as "endtime",
        l.whenlong as "whenlong",
        l.myleave_id as "myleaveId",
        l.reason as "reason"
        from
        oa_myleave l
        where 1=1
        <if test="pd.keywords!= null and pd.keywords != ''">
            and
            (
            l.reason LIKE '%' || #{pd.keywords} || '%'
            or
            l.username LIKE '%' || #{pd.keywords} || '%'
            )
        </if>
        <if test="pd.username!= null and pd.username != ''">
            and l.username = #{pd.username}
        </if>
        <if test="pd.type != null and pd.type != ''">
            and l.type=#{pd.type}
        </if>
        order by l.endtime desc
    </select>
 
    <select id="datalistPage" resultType="map" databaseId="oracle">
        select
        l.username as "username",
        l.type as "type",
        l.starttime as "starttime",
        l.endtime as "endtime",
        l.whenlong as "whenlong",
        l.myleave_id as "myleaveId",
        l.reason as "reason"
        from
        oa_myleave l
        where 1=1
        <if test="pd.keywords!= null and pd.keywords != ''">
            and
            (
            l.reason LIKE '%' || #{pd.keywords} || '%'
            or
            l.username LIKE '%' || #{pd.keywords} || '%'
            )
        </if>
        <if test="pd.username!= null and pd.username != ''">
            and l.username = #{pd.username}
        </if>
        <if test="pd.type != null and pd.type != ''">
            and l.type=#{pd.type}
        </if>
        order by l.endtime desc
    </select>
 
 
    <!--查询请假类型-->
    <select id="getLeaves" resultType="map">
        select dict.dict_id dictId,
        dict.name dictName
        from sys_dict dict
        where dict.dict_type_id = '1160532886713155585'
    </select>
 
    <select id="getLeaves" resultType="map" databaseId="mssql">
        select dict.dict_id dictId,
        dict.name dictName
        from sys_dict dict
        where dict.dict_type_id = '1160532886713155585'
    </select>
 
    <select id="getLeaves" resultType="map" databaseId="pgsql">
        select dict.dict_id "dictId",
        dict.name "dictName"
        from sys_dict dict
        where dict.dict_type_id = '1160532886713155585'
    </select>
 
    <select id="getLeaves" resultType="map" databaseId="oracle">
        select dict.dict_id "dictId",
        dict.name "dictName"
        from sys_dict dict
        where dict.dict_type_id = '1160532886713155585'
    </select>
 
</mapper>