• 徐俊's avatar
    xujun · 602d9030
    徐俊 authored
    602d9030
ComBatchDAO.xml 1.4 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.yiboshi.science.dao.ComBatchDAO">
    <sql id="allColumns">
        t.id as id, t.log_level as logLevel, t.short_title as shortTitle, t.ipaddress as ipaddress, t.customer_id as customerId, t.pageurl as pageurl, t.referrerurl as referrerurl, t.message as message, 
        t.created as created
    </sql>
    <select id="getListByPage" resultType="com.yiboshi.science.param.dto.ComBatchDTO">
        select * from com_batch
        <where>
            ${ew.sqlSegment}
        </where>
        ORDER BY year desc, batch desc
    </select>
    <select id="getMaxBatch"  resultType="java.lang.Integer">
        select ifnull(max(batch), 0)
        from com_batch
        where year = #{year} and proj_type = #{projType}
    </select>
    <select id="getCurrentBatch" parameterType="java.util.Map" resultType="com.yiboshi.science.param.dto.ComBatchDTO">
        select *
        from com_batch
        <where>
            <if test="projType != null and projType != ''">
                and proj_type = #{projType}
            </if>
            <if test="timeType != null and timeType != ''">
                and time_type = #{timeType}
            </if>
        </where>
        order by year desc, batch desc limit 1
    </select>
</mapper>