AccountBattchLogMapper.xml 4.03 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="cn.com.polysoft.template.dao.AccountBattchLogMapper" >

    <select id="queryByCondition" parameterType="cn.com.polysoft.template.dto.property.BatchQueryDTO" resultType="cn.com.polysoft.template.entity.AccountBattchLogEntity">
        <!--select t.id,t.battch_id,t.account_count,t.check_date,t.details,
        t.receive_msg_time,case when t.status = 1 then '财险账单接收失败'
        when t.status = 2 then '财险账单接收成功'
        when t.status = 3 then '汇总金额核验失败'
        when t.status = 4 then '汇总金额核验成功'
        when t.status = 5 then '业务系统处理失败'
        when t.status = 6 then '业务系统处理成功' else '' end  status_text,
        t.status
        from cai_account_battch_log t
        <where>
            <if test="batchId != null and batchId != ''">and t.battch_id = #{batchId}</if>
            <if test="status != null and status != ''">and t.status = #{status}</if>
            <if test="billReceiveStartTime != null and billReceiveStartTime != ''">and t.check_date >= #{billReceiveStartTime}</if>
            <if test="billReceiveEndTime != null and billReceiveEndTime != ''">and t.check_date &lt;= #{billReceiveEndTime}</if>
            <if test="messageReceiveStartTime != null and messageReceiveStartTime != ''">and t.receive_msg_time >= #{messageReceiveStartTime}</if>
            <if test="messageReceiveEndTime != null and messageReceiveEndTime != ''">and t.receive_msg_time &lt;= #{messageReceiveEndTime}</if>
        </where>
        order by t.receive_msg_time desc-->
        select DISTINCT t.id,t.battch_id,t.account_count,t.check_date,t.details,
        t.receive_msg_time,case when t.status = 1 then '财险账单接收失败'
        when t.status = 2 then '财险账单接收成功'
        when t.status = 3 then '汇总金额核验失败'
        when t.status = 4 then '汇总金额核验成功'
        when t.status = 5 then '业务系统处理失败'
        when t.status = 6 then '业务系统处理成功' else '' end  status_text,
        t.status
        from cai_account_battch_log t
        LEFT JOIN treaty_soa_info tr on t.battch_id=tr.batch_id
        <where>
            <if test="batchId != null and batchId != ''">and t.battch_id like #{batchId}</if>
            <if test="accountNo != null and accountNo !=''">and tr.account_no like #{accountNo}</if>
            <if test="status != null and status != ''">and t.status = #{status}</if>
            <if test="billReceiveStartTime != null and billReceiveStartTime != ''">and to_date(t.check_date,'yyyy-MM-dd') >= to_date(#{billReceiveStartTime},'yyyy-MM-dd')</if>
            <if test="billReceiveEndTime != null and billReceiveEndTime != ''">and to_date(t.check_date,'yyyy-MM-dd') &lt;= to_date(#{billReceiveEndTime},'yyyy-MM-dd')</if>
            <if test="messageReceiveStartTime != null and messageReceiveStartTime != ''">and to_date(t.receive_msg_time,'yyyy-MM-dd') >= to_date(#{messageReceiveStartTime},'yyyy-MM-dd')</if>
            <if test="messageReceiveEndTime != null and messageReceiveEndTime != ''">and to_date(t.receive_msg_time,'yyyy-MM-dd') &lt;= to_date(#{messageReceiveEndTime},'yyyy-MM-dd')</if>
        </where>
        order by t.receive_msg_time desc
    </select>

    <select id="queryBatchFailReason" resultType="string">
        select t.details from cai_account_battch_log t where t.battch_id = #{batchId}
    </select>

    <select id="selectByCheckDate" parameterType="cn.com.polysoft.template.entity.AccountBattchLogEntity" resultType="cn.com.polysoft.template.entity.AccountBattchLogEntity">
        select * from cai_account_battch_log t where t.check_date = #{checkDate}
    </select>

    <select id="selectByBatchId" parameterType="cn.com.polysoft.template.entity.AccountBattchLogEntity" resultType="cn.com.polysoft.template.entity.AccountBattchLogEntity">
        select * from cai_account_battch_log t where t.battch_id = #{battchId}
    </select>
</mapper>