提交 | 用户 | 时间
|
e7c126
|
1 |
<?xml version="1.0" encoding="UTF-8"?> |
H |
2 |
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
|
3 |
"http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
|
4 |
<mapper namespace="com.xxl.job.admin.dao.XxlJobUserDao"> |
|
5 |
|
|
6 |
<resultMap id="XxlJobUser" type="com.xxl.job.admin.core.model.XxlJobUser" > |
|
7 |
<result column="id" property="id" /> |
|
8 |
<result column="username" property="username" /> |
|
9 |
<result column="password" property="password" /> |
|
10 |
<result column="role" property="role" /> |
|
11 |
<result column="permission" property="permission" /> |
|
12 |
</resultMap> |
|
13 |
|
|
14 |
<sql id="Base_Column_List"> |
|
15 |
t.id, |
|
16 |
t.username, |
|
17 |
t.password, |
|
18 |
t.role, |
|
19 |
t.permission |
|
20 |
</sql> |
|
21 |
|
|
22 |
<select id="pageList" parameterType="java.util.HashMap" resultMap="XxlJobUser"> |
|
23 |
SELECT <include refid="Base_Column_List" /> |
|
24 |
FROM xxl_job_user AS t |
|
25 |
<trim prefix="WHERE" prefixOverrides="AND | OR" > |
|
26 |
<if test="username != null and username != ''"> |
|
27 |
AND t.username like CONCAT(CONCAT('%', #{username}), '%') |
|
28 |
</if> |
|
29 |
<if test="role gt -1"> |
|
30 |
AND t.role = #{role} |
|
31 |
</if> |
|
32 |
</trim> |
|
33 |
ORDER BY username ASC |
|
34 |
LIMIT #{offset}, #{pagesize} |
|
35 |
</select> |
|
36 |
|
|
37 |
<select id="pageListCount" parameterType="java.util.HashMap" resultType="int"> |
|
38 |
SELECT count(1) |
|
39 |
FROM xxl_job_user AS t |
|
40 |
<trim prefix="WHERE" prefixOverrides="AND | OR" > |
|
41 |
<if test="username != null and username != ''"> |
|
42 |
AND t.username like CONCAT(CONCAT('%', #{username}), '%') |
|
43 |
</if> |
|
44 |
<if test="role gt -1"> |
|
45 |
AND t.role = #{role} |
|
46 |
</if> |
|
47 |
</trim> |
|
48 |
</select> |
|
49 |
|
|
50 |
<select id="loadByUserName" parameterType="java.util.HashMap" resultMap="XxlJobUser"> |
|
51 |
SELECT <include refid="Base_Column_List" /> |
|
52 |
FROM xxl_job_user AS t |
|
53 |
WHERE t.username = #{username} |
|
54 |
</select> |
|
55 |
|
|
56 |
<insert id="save" parameterType="com.xxl.job.admin.core.model.XxlJobUser" useGeneratedKeys="true" keyProperty="id" > |
|
57 |
INSERT INTO xxl_job_user ( |
|
58 |
username, |
|
59 |
password, |
|
60 |
role, |
|
61 |
permission |
|
62 |
) VALUES ( |
|
63 |
#{username}, |
|
64 |
#{password}, |
|
65 |
#{role}, |
|
66 |
#{permission} |
|
67 |
); |
|
68 |
</insert> |
|
69 |
|
|
70 |
<update id="update" parameterType="com.xxl.job.admin.core.model.XxlJobUser" > |
|
71 |
UPDATE xxl_job_user |
|
72 |
SET |
|
73 |
<if test="password != null and password != ''"> |
|
74 |
password = #{password}, |
|
75 |
</if> |
|
76 |
role = #{role}, |
|
77 |
permission = #{permission} |
|
78 |
WHERE id = #{id} |
|
79 |
</update> |
|
80 |
|
|
81 |
<delete id="delete" parameterType="java.util.HashMap"> |
|
82 |
DELETE |
|
83 |
FROM xxl_job_user |
|
84 |
WHERE id = #{id} |
|
85 |
</delete> |
|
86 |
|
|
87 |
</mapper> |