<?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.hzya.frame.seeyon.cbs8.entity.TransactionDetailEntity">
    <resultMap id="get-TransactionDetailEntity-result" type="com.hzya.frame.seeyon.cbs8.entity.TransactionDetailEntity">
        <result property="id" column="id" />
        <result property="accountNo" column="accountNo" />
        <result property="accountName" column="accountName" />
        <result property="openBank" column="openBank" />
        <result property="bankType" column="bankType" />
        <result property="bankTransactionDate" column="bankTransactionDate" />
        <result property="transactionSerialNumber" column="transactionSerialNumber" />
        <result property="currency" column="currency" />
        <result property="incurredAmount" column="incurredAmount" />
        <result property="purpose" column="purpose" />
        <result property="digest" column="digest" />
        <result property="oppositeAccount" column="oppositeAccount" />
        <result property="oppositeName" column="oppositeName" />
        <result property="oppositeOpeningBank" column="oppositeOpeningBank" />
        <result property="remark" column="remark" />
    </resultMap>

    <sql id="TransactionDetailEntity_Base_Column_List">
        id,
        field0001 as accountNo,
        field0002 as accountName,
        field0003 as openBank,
        field0004 as bankType,
        field0005 as transactionSerialNumber,
        field0006 as bankTransactionDate,
        field0007 as bankSerialNumber,
        field0008 as currency,
        field0009 as incurredAmount,
        field0010 as purpose,
        field0011 as digest,
        field0012 as oppositeAccount,
        field0013 as oppositeName,
        field0014 as oppositeOpeningBank,
        field0015 as remark
    </sql>

    <!--  采用==查询 -->
    <select id="TransactionDetailEntity_list_base" resultMap="get-TransactionDetailEntity-result" parameterType="com.hzya.frame.seeyon.cbs8.entity.TransactionDetailEntity">
        select
        <include refid="TransactionDetailEntity_Base_Column_List"/>
        from
        formmain_0233
        <trim prefix="where" prefixOverrides="and">
            <if test="id != null and id !='' ">id = #{id} </if>
            <if test="accountNo != null and accountNo !='' "> and field0001 = #{accountNo} </if>
            <if test="accountName != null and accountName !='' "> and field0002 = #{accountName} </if>
            <if test="openBank != null and openBank !='' "> and field0003 = #{openBank} </if>
            <if test="bankType != null and bankType !='' "> and field0004 = #{bankType} </if>
            <if test="transactionSerialNumber != null and transactionSerialNumber !='' "> and field0005 = #{transactionSerialNumber} </if>
            <if test="bankTransactionDate != null and bankTransactionDate !='' "> and field0006 = #{bankTransactionDate} </if>
            <if test="bankSerialNumber != null and bankSerialNumber !='' "> and field0007 = #{bankSerialNumber} </if>
            <if test="currency != null and currency !='' "> and field0008 = #{currency} </if>
            <if test="incurredAmount != null and incurredAmount !='' "> and field0009 = #{incurredAmount} </if>
            <if test="purpose != null and purpose !='' "> and field0010 = #{purpose} </if>
            <if test="digest != null and digest !='' "> and field0011 = #{digest} </if>
            <if test="oppositeAccount != null and oppositeAccount !='' "> and field0012 = #{oppositeAccount} </if>
            <if test="oppositeName != null and oppositeName !='' "> and field0013 = #{oppositeName} </if>
            <if test="oppositeOpeningBank != null and oppositeOpeningBank !='' "> and field0014 = #{oppositeOpeningBank} </if>
            <if test="remark != null and remark !='' "> and field0015 = #{remark} </if>
        </trim>
    </select>
    <!-- 只查询交易流水号-->
    <select id="TransactionDetailEntity_list_serialNumber" resultMap="get-TransactionDetailEntity-result" parameterType="com.hzya.frame.seeyon.cbs8.entity.TransactionDetailEntity">
        select
        field0005 as transactionSerialNumber
        from
        formmain_0233
        <trim prefix="where" prefixOverrides="and">
            <if test="id != null and id !='' ">id = #{id} </if>
            <if test="accountNo != null and accountNo !='' "> and field0001 = #{accountNo} </if>
            <if test="accountName != null and accountName !='' "> and field0002 = #{accountName} </if>
            <if test="openBank != null and openBank !='' "> and field0003 = #{openBank} </if>
            <if test="bankType != null and bankType !='' "> and field0004 = #{bankType} </if>
            <if test="transactionSerialNumber != null and transactionSerialNumber !='' "> and field0005 = #{transactionSerialNumber} </if>
            <if test="bankTransactionDate != null and bankTransactionDate !='' "> and field0006 >= #{bankTransactionDate} </if>
            <if test="bankSerialNumber != null and bankSerialNumber !='' "> and field0007 = #{bankSerialNumber} </if>
            <if test="currency != null and currency !='' "> and field0008 = #{currency} </if>
            <if test="incurredAmount != null and incurredAmount !='' "> and field0009 = #{incurredAmount} </if>
            <if test="purpose != null and purpose !='' "> and field0010 = #{purpose} </if>
            <if test="digest != null and digest !='' "> and field0011 = #{digest} </if>
            <if test="oppositeAccount != null and oppositeAccount !='' "> and field0012 = #{oppositeAccount} </if>
            <if test="oppositeName != null and oppositeName !='' "> and field0013 = #{oppositeName} </if>
            <if test="oppositeOpeningBank != null and oppositeOpeningBank !='' "> and field0014 = #{oppositeOpeningBank} </if>
            <if test="remark != null and remark !='' "> and field0015 = #{remark} </if>
        </trim>
    </select>
</mapper>
