IJobResultMapper.xml
2.39 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
<?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.yoho.jobs.dal.IJobResultMapper">
<resultMap id="BaseResultMap" type="com.yoho.jobs.dal.domain.ProcessResultVO">
<id column="code" property="code" jdbcType="VARCHAR" />
<result column="message" property="message" jdbcType="VARCHAR" />
<result column="beginTime" property="beginTime" jdbcType="VARCHAR" />
<result column="endTime" property="endTime" jdbcType="VARCHAR" />
<result column="jobName" property="jobName" jdbcType="VARCHAR" />
<result column="jobGroup" property="jobGroup" jdbcType="VARCHAR" />
<result column="processor" property="processor" jdbcType="VARCHAR" />
<result column="jobType" property="jobType" jdbcType="INTEGER" />
<result column="processIp" property="processIp" jdbcType="VARCHAR" />
<result column="module" property="module" jdbcType="VARCHAR" />
<result column="cronExpression" property="cronExpression"
jdbcType="VARCHAR" />
<result column="context" property="context" jdbcType="VARCHAR" />
<result column="activeMode" property="activeMode" jdbcType="INTEGER" />
<result column="recordDate" property="recordDate" jdbcType="TIMESTAMP" />
</resultMap>
<sql id="Base_Column_List">
code, message, beginTime, endTime, jobName, jobGroup,
processor,
jobType, processIp, module, cronExpression, context,
activeMode,recordDate
</sql>
<insert id="insertJob" parameterType="com.yoho.jobs.dal.domain.ProcessResultVO">
insert into
job_run_log(code, message, beginTime, endTime, jobName,
jobGroup,
processor,
jobType, processIp, module, cronExpression,
context,
activeMode , recordDate)values(#{code,jdbcType=VARCHAR},
#{message,jdbcType=VARCHAR},#{beginTime,jdbcType=VARCHAR},#{endTime,jdbcType=VARCHAR},
#{jobName,jdbcType=VARCHAR},#{jobGroup,jdbcType=VARCHAR},#{processor,jdbcType=VARCHAR},
#{jobType,jdbcType=INTEGER},#{processIp,jdbcType=VARCHAR},#{module,jdbcType=VARCHAR},
#{cronExpression,jdbcType=VARCHAR},#{context,jdbcType=VARCHAR},#{activeMode,jdbcType=INTEGER},#{recordDate,jdbcType=TIMESTAMP}
)
</insert>
<select id="selectJobs" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>
from job_run_log
where jobName= #{jobName} AND module = #{module} order by recordDate desc limit #{limit}
</select>
</mapper>