<?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.gangquan360.smartadmin.module.quartz.dao.QuartzTaskLogDao">

    <resultMap id="QuartzTaskLogDTO"
               type="com.gangquan360.smartadmin.module.quartz.domain.dto.QuartzTaskLogVO"></resultMap>




    <sql id="baseSql">
        tl.id,
        tl.task_id,
        tl.task_name,
        tl.task_params,
        tl.process_status,
        tl.process_duration,
        tl.process_log,
        tl.ip_address,
        tl.update_time,
        tl.create_time
    </sql>


    <select id="queryList" resultMap="QuartzTaskLogDTO">
        SELECT
        <include refid="baseSql"></include>
        FROM
        t_quartz_task_log tl
        <where>
            <if test="queryDTO.taskId != null">
                AND tl.task_id = #{queryDTO.taskId}
            </if>
        </where>
        order BY tl.create_time DESC
    </select>

</mapper>