HandledJobMapper.xml
2.15 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
<?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.HandledJobMapper" >
<resultMap id="BaseResultMap" type="com.model.HandledJob" >
<id column="id" property="id" jdbcType="INTEGER" />
<result column="work_id" property="workId" jdbcType="VARCHAR" />
<result column="title" property="title" jdbcType="VARCHAR" />
<result column="type" property="type" jdbcType="VARCHAR" />
<result column="handler_role" property="handlerRole" jdbcType="VARCHAR" />
<result column="handler" property="handler" jdbcType="VARCHAR" />
<result column="handle_cType" property="handlecType" jdbcType="VARCHAR" />
<result column="handle_type" property="handleType" jdbcType="INTEGER" />
<result column="createTime" property="createTime" jdbcType="VARCHAR" />
</resultMap>
<sql id="Base_Column_List" >
id, work_id, title,type,handler_role,handler,handle_type,handle_cType,DATE_FORMAT(create_time,'%Y-%m-%d %H:%i:%S') AS createTime
</sql>
<select id="selectCount" resultType="java.lang.Integer">
select
count(1)
from handled_job
where
handler = #{handler}
</select>
<select id="selectByPage" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from handled_job
where
handler = #{params.handler}
order by id desc
limit #{startIndex},#{pageSize}
</select>
<select id="selectByworkId" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from handled_job
where
work_id = #{workid}
order by id
</select>
<insert id="insert" parameterType="com.model.HandledJob" >
insert into handled_job
(work_id,
title,
type,
handler_role,
handler,
handle_type,
handle_cType,
create_time)
values
(#{workId,jdbcType=VARCHAR},
#{title,jdbcType=VARCHAR},
#{type,jdbcType=VARCHAR},
#{handlerRole,jdbcType=VARCHAR},
#{handler,jdbcType=VARCHAR},
#{handleType,jdbcType=INTEGER},
#{handlecType,jdbcType=VARCHAR},
now())
</insert>
</mapper>