IJobResultMapper.xml 2.39 KB
<?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>