<?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.LogKettleStepcountDao">
|
|
<!-- 可根据自己的需求,是否要使用 -->
|
<resultMap type="com.landtool.lanbase.modules.log.entity.LogKettleStepcount" id="logMap">
|
<result property="idbatch" column="IDBATCH"/>
|
<result property="channelid" column="CHANNELID"/>
|
<result property="logdate" column="LOGDATE"/>
|
<result property="transname" column="TRANSNAME"/>
|
<result property="stepname" column="STEPNAME"/>
|
<result property="stepcopy" column="STEPCOPY"/>
|
<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="logfield" column="LOGFIELD"/>
|
</resultMap>
|
|
<select id="queryList" resultType="com.landtool.lanbase.modules.log.entity.LogKettleStepcount">
|
select * from (
|
SELECT *
|
FROM(
|
SELECT ROW_NUMBER() OVER(
|
ORDER BY B.ID_BATCH DESC) AS rownumber,B.*
|
FROM (
|
SELECT * from LOG_KETTLE_STEPCOUNT
|
<where>
|
<if test="transname != null and transname!=''">
|
AND transname LIKE ('%' || #{transname} || '%')
|
</if>
|
<if test="stepname != null and stepname!=''">
|
AND stepname LIKE ('%' || #{stepname} || '%')
|
</if>
|
<if test="logdatebegin != null and logdatebegin !=''">
|
<![CDATA[ AND log_date >= to_timestamp(#{logdatebegin,jdbcType=VARCHAR},'yyyy-mm-dd hh24:mi:ss') ]]>
|
</if>
|
<if test="logdatefinish != null and logdatefinish !=''">
|
<![CDATA[ AND log_date <= 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_BATCH DESC
|
</otherwise>
|
</choose>
|
</select>
|
<select id="queryTotal" resultType="int">
|
select count(*) from LOG_KETTLE_STEPCOUNT
|
<where>
|
<if test="transname != null and transname!=''">
|
AND transname LIKE ('%' || #{transname} || '%')
|
</if>
|
<if test="stepname != null and stepname!=''">
|
AND stepname LIKE ('%' || #{stepname} || '%')
|
</if>
|
<if test="logdatebegin != null and logdatebegin !=''">
|
<![CDATA[ AND log_date >= to_timestamp(#{logdatebegin,jdbcType=VARCHAR},'yyyy-mm-dd hh24:mi:ss') ]]>
|
</if>
|
<if test="logdatefinish != null and logdatefinish !=''">
|
<![CDATA[ AND log_date <= to_timestamp(#{logdatefinish,jdbcType=VARCHAR},'yyyy-mm-dd hh24:mi:ss') ]]>
|
</if>
|
</where>
|
</select>
|
|
<select id="queryObject" resultType="com.landtool.lanbase.modules.log.entity.LogKettleStepcount">
|
select * from LOG_KETTLE_STEPCOUNT where CHANNEL_ID = #{value}
|
</select>
|
|
<select id="queryLinesByYear" resultType="com.landtool.lanbase.modules.log.entity.LogKettleStepcountJoinYear">
|
select to_char( LOG_DATE,'yyyy') as year,sum(LINES_INPUT) suminput,sum(LINES_OUTPUT) sumoutput from LOG_KETTLE_STEPCOUNT
|
<where>
|
<if test="logdatebegin != null and logdatebegin!=''">
|
and to_char( LOG_DATE,'yyyy') >= #{logdatebegin}
|
</if>
|
<if test="logdatefinish != null and logdatefinish!=''">
|
<![CDATA[ AND to_char( LOG_DATE,'yyyy') <= #{logdatefinish} ]]>
|
</if>
|
<if test="transname != null and transname!=''">
|
AND transname LIKE ('%' || #{transname} || '%')
|
</if>
|
<if test="stepname != null and stepname!=''">
|
AND stepname LIKE ('%' || #{stepname} || '%')
|
</if>
|
</where>
|
group by to_char( LOG_DATE,'yyyy')
|
</select>
|
</mapper>
|