1
13693261870
2022-09-16 762f2fb45db004618ba099aa3c0bd89dba1eb843
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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
<?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.landtool.lanbase.modules.log.dao.LogKettleJobDao">
 
    <!-- 可根据自己的需求,是否要使用 -->
    <resultMap type="com.landtool.lanbase.modules.log.entity.LogKettleJob" id="logMap">
        <result property="idjob" column="IDJOB"/>
        <result property="channelid" column="CHANNELID"/>
        <result property="jobname" column="JOBNAME"/>
        <result property="status" column="STATUS"/>
        <result property="linesread" column="LINESREAD"/>
        <result property="lineswritten" column="LINESWRITTEN"/>
        <result property="linesupdated" column="LINESUPDATED"/>
        <result property="linesinput" column="LINESINPUT"/>
        <result property="linesoutput" column="LINESOUTPUT"/>
        <result property="linesrejected" column="LINESREJECTED"/>
        <result property="errors" column="ERRORS"/>
        <result property="startdate" column="STARTDATE"/>
        <result property="enddate" column="ENDDATE"/>
        <result property="logdate" column="LOGDATE"/>
        <result property="depdate" column="DEPDATE"/>
        <result property="replaydate" column="REPLAYDATE"/>
        <result property="executingserver" column="EXECUTINGSERVER"/>
        <result property="executinguser" column="EXECUTINGUSER"/>
        <result property="startjobentry" column="STARTJOBENTRY"/>
        <result property="client" column="CLIENT"/>
    </resultMap>
 
    <select id="queryList" resultType="com.landtool.lanbase.modules.log.entity.LogKettleJob">
        select * from (
        SELECT *
        FROM(
        SELECT ROW_NUMBER() OVER(
        ORDER BY B.ID_JOB DESC) AS rownumber,B.*
        FROM (
        SELECT * from LOG_KETTLE_JOB
        <where>
            <if test="jobname != null and jobname!=''">
                AND jobname LIKE ('%' || #{jobname} || '%')
            </if>
            <if test="status != null and status!=''">
                AND status = #{status}
            </if>
            <if test="logdatebegin != null and logdatebegin !=''">
                <![CDATA[ AND logdate >= to_timestamp(#{logdatebegin,jdbcType=VARCHAR},'yyyy-mm-dd hh24:mi:ss') ]]>
            </if>
            <if test="logdatefinish != null and logdatefinish !=''">
                <![CDATA[ AND logdate <= to_timestamp(#{logdatefinish,jdbcType=VARCHAR},'yyyy-mm-dd hh24:mi:ss') ]]>
            </if>
        </where>
        ) B
        ) A
        WHERE rownumber > #{lowerOffset} AND  <![CDATA[ rownumber <= ${upperOffset} ]]>
        )a order by
        <choose>
            <when test="sidx != null and sidx != ''">
                ${sidx} ${order}
            </when>
            <otherwise>
                ID_JOB DESC
            </otherwise>
        </choose>
    </select>
    <select id="queryTotal" resultType="int">
        select count(*) from LOG_KETTLE_JOB
        <where>
            <if test="jobname != null and jobname!=''">
                AND jobname LIKE ('%' || #{jobname} || '%')
            </if>
            <if test="status != null and status!=''">
                AND status = #{status}
            </if>
            <if test="logdatebegin != null and logdatebegin !=''">
                <![CDATA[ AND logdate >= to_timestamp(#{logdatebegin,jdbcType=VARCHAR},'yyyy-mm-dd hh24:mi:ss') ]]>
            </if>
            <if test="logdatefinish != null and logdatefinish !=''">
                <![CDATA[ AND logdate <= to_timestamp(#{logdatefinish,jdbcType=VARCHAR},'yyyy-mm-dd hh24:mi:ss') ]]>
            </if>
        </where>
    </select>
 
    <select id="queryObject" resultType="com.landtool.lanbase.modules.log.entity.LogKettleJob">
        select * from LOG_KETTLE_JOB where ID_JOB = #{value}
    </select>
</mapper>