<?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.docus.server.report.mapper.AfJobTimeMapper">
    <insert id="insert">
        INSERT INTO `docus_archivefile`.`af_job_time`(`id`, `update_time`, `job_type`)
        VALUES (#{afJobTime.id}, #{afJobTime.updateTime},  #{afJobTime.jobType});
    </insert>
    <update id="updateById">

        UPDATE `docus_archivefile`.`af_job_time`
        SET `update_time` = #{afJobTime.updateTime},
        WHERE `id` = #{afJobTime.id};
    </update>

    <select id="getAfJobTimeByJobType" resultType="com.docus.server.report.entity.AfJobTime">
        select id, DATE_FORMAT(update_time,'%Y-%m-%d %H:%i:%s')  as updateTime,job_type as jobType
        from `docus_archivefile`.`af_job_time`
        where job_type= #{jobType}
    </select>
</mapper>
