DockerProjectMapper.xml
8.07 KB
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
187
188
<?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="com.monitor.mysql.mapper.DockerProjectMapper" >
<resultMap id="BaseResultMap" type="com.model.DockerProjectModel" >
<id column="id" property="id" jdbcType="INTEGER" />
<result column="projectname" property="projectName" jdbcType="VARCHAR" />
<result column="projectgitgroup" property="projectGitGroup" jdbcType="VARCHAR" />
<result column="projectjobtype" property="projectJobType" jdbcType="VARCHAR" />
<result column="dockerprojectname" property="dockerProjectName" jdbcType="VARCHAR" />
<result column="dockergrayclusterid" property="dockerGrayClusterId" jdbcType="VARCHAR" />
<result column="dockergraynamespace" property="dockerGrayNameSpace" jdbcType="VARCHAR" />
<result column="dockergrayimagestore" property="dockerGrayImageStore" jdbcType="VARCHAR" />
<result column="dockeronlineclusterid" property="dockerOnlineClusterId" jdbcType="VARCHAR" />
<result column="dockeronlinenamespace" property="dockerOnlineNameSpace" jdbcType="VARCHAR" />
<result column="dockeronlineimagestore" property="dockerOnlineImageStore" jdbcType="VARCHAR" />
<result column="port" property="port" jdbcType="VARCHAR" />
<result column="autodeployflag" property="autodeployflag" jdbcType="VARCHAR" />
<result column="projecttype" property="projectType" jdbcType="VARCHAR" />
</resultMap>
<sql id="Base_Column_List" >
id, projectname,projectgitgroup,projectjobtype,dockerprojectname,dockergrayclusterid,dockergraynamespace,
dockergrayimagestore,dockeronlineclusterid,dockeronlinenamespace,dockeronlineimagestore,port,autodeployflag,projecttype
</sql>
<select id="selectByProjectName" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from docker_project
where
projectname = #{projectName}
</select>
<select id="selectCount" resultType="java.lang.Integer">
select
count(1)
from docker_project
</select>
<select id="selectAll" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from docker_project
</select>
<select id="selectByPage" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from docker_project
where 1=1
<if test="params.projectJobType != null" >
and projectjobtype = #{params.projectJobType}
</if>
order by id desc
limit #{startIndex},#{pageSize}
</select>
<select id="selectById" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from docker_project
where
id = #{id}
</select>
<select id="selectByProjectJobType" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from docker_project
where 1=1
<choose>
<when test="projectJobType != null && projectJobType !='' " >
and projectjobtype = #{projectJobType}
</when>
<otherwise>
and 1=2
</otherwise>
</choose>
</select>
<select id="selectByProjectType" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from docker_project
where 1=1
<choose>
<when test="projectType != null && projectType !='' " >
and projecttype = #{projectType}
</when>
<otherwise>
and 1=2
</otherwise>
</choose>
</select>
<select id="selectByIdList" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from docker_project
where 1=1
<choose>
<when test="idList != null && idList.size > 0" >
and
<foreach open="(" close=")" item="item" index="index" collection="idList" separator="or">
id = #{item}
</foreach>
</when>
<otherwise>
and 1=2
</otherwise>
</choose>
</select>
<select id="selectCountByCodition" resultType="java.lang.Integer">
select
count(1)
from docker_project
where 1=1
<if test="params.projectName != null && params.projectName != ''" >
and projectname like concat('%',#{params.projectName},'%')
</if>
<if test="params.dockerProjectName != null && params.dockerProjectName != ''" >
and dockerProjectName like concat('%',#{params.dockerProjectName},'%')
</if>
<if test="params.projectJobType != null && params.projectJobType != ''" >
and projectjobtype = #{params.projectJobType}
</if>
<if test="params.projectType != null && params.projectType != ''" >
and projecttype = #{params.projectType}
</if>
</select>
<select id="selectDockerInfosByCodition" resultMap="BaseResultMap">
select * from docker_project
where 1=1
<if test="params.projectName != null && params.projectName != ''" >
and projectname like concat('%',#{params.projectName},'%')
</if>
<if test="params.dockerProjectName != null && params.dockerProjectName != ''" >
and dockerprojectname like concat('%',#{params.dockerProjectName},'%')
</if>
<if test="params.projectJobType != null && params.projectJobType != ''" >
and projectjobtype = #{params.projectJobType}
</if>
<if test="params.projectType != null && params.projectType != ''" >
and projecttype = #{params.projectType}
</if>
order by projecttype
limit #{startIndex},#{pageSize}
</select>
<insert id="insertInfo" parameterType="com.model.DockerProjectModel" >
insert into docker_project
(projectname,projectgitgroup,projectjobtype,dockerprojectname,dockergrayclusterid,dockergraynamespace,
dockergrayimagestore,dockeronlineclusterid,dockeronlinenamespace,dockeronlineimagestore,port,autodeployflag,projecttype)
values (#{projectName,jdbcType=VARCHAR}, #{projectGitGroup,jdbcType=VARCHAR}, #{projectJobType,jdbcType=VARCHAR},
#{dockerProjectName,jdbcType=VARCHAR}, #{dockerGrayClusterId,jdbcType=VARCHAR}, #{dockerGrayNameSpace,jdbcType=VARCHAR},
#{dockerGrayImageStore,jdbcType=VARCHAR},#{dockerOnlineClusterId,jdbcType=VARCHAR},#{dockerOnlineNameSpace,jdbcType=VARCHAR},
#{dockerOnlineImageStore,jdbcType=VARCHAR},#{port,jdbcType=INTEGER},#{autodeployflag,jdbcType=VARCHAR},#{projectType,jdbcType=VARCHAR})
</insert>
<update id="updateById" parameterType="com.model.DockerProjectModel" >
update docker_project
set
projectname = #{projectName,jdbcType=VARCHAR},
projectgitgroup = #{projectGitGroup,jdbcType=VARCHAR},
projectjobtype = #{projectJobType,jdbcType=VARCHAR},
dockerprojectname = #{dockerProjectName,jdbcType=VARCHAR},
dockergrayclusterid = #{dockerGrayClusterId,jdbcType=VARCHAR},
dockergraynamespace = #{dockerGrayNameSpace,jdbcType=VARCHAR},
dockergrayimagestore = #{dockerGrayImageStore,jdbcType=VARCHAR},
dockeronlineclusterid = #{dockerOnlineClusterId,jdbcType=VARCHAR},
dockeronlinenamespace = #{dockerOnlineNameSpace,jdbcType=VARCHAR},
dockeronlineimagestore = #{dockerOnlineImageStore,jdbcType=VARCHAR},
port = #{port,jdbcType=INTEGER},
autodeployflag= #{autodeployflag,jdbcType=VARCHAR},
projecttype= #{projectType,jdbcType=VARCHAR}
where id = #{id,jdbcType=INTEGER}
</update>
<delete id="deleteById" parameterType="java.lang.Integer">
delete from docker_project where id = #{id,jdbcType=INTEGER}
</delete>
</mapper>