GetCashlistMapperAuto.xml 5.57 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.lecuntao.ordering.customization.dal.GetCashlistMapper">

    <resultMap id="getCashlistPO" type="com.lecuntao.ordering.customization.po.GetCashlistPO">
        
        <id column="ID" jdbcType="NUMERIC" property="id"/>
        <result column="TENANT_ID" jdbcType="NUMERIC" property="tenantId"/>
        <result column="MEMBER_ID" jdbcType="VARCHAR" property="memberId"/>
        <result column="WITH_DRAW_NUMBER" jdbcType="VARCHAR" property="withDrawNumber"/>
        <result column="APPLY_TIME" jdbcType="TIMESTAMP" property="applyTime"/>
        <result column="ACCOUNT_INFO" jdbcType="VARCHAR" property="accountInfo"/>
        <result column="PAYMENT_TIME" jdbcType="TIMESTAMP" property="paymentTime"/>
        <result column="ACCOUNT_NUMBER" jdbcType="VARCHAR" property="accountNumber"/>
        <result column="WITH_DRAW_PERSON_NAME" jdbcType="VARCHAR" property="withDrawPersonName"/>
        <result column="WITH_DRAW_AMOUNT" jdbcType="NUMERIC" property="withDrawAmount"/>
        <result column="STATUS" jdbcType="VARCHAR" property="status"/>
        <result column="FAIL_REASON" jdbcType="VARCHAR" property="failReason"/>
        <result column="DATE_ID" jdbcType="NUMERIC" property="dateId"></result>
        <result column="ROW_VERSION" jdbcType="NUMERIC" property="rowVersion"/>
        <result column="IS_DELETED" jdbcType="TINYINT" property="isDeleted"/>
        <result column="CREATED_BY" jdbcType="NUMERIC" property="createdBy"/>
        <result column="CREATION_TIME" jdbcType="TIMESTAMP" property="creationTime"/>
        <result column="LAST_UPDATED_BY" jdbcType="NUMERIC" property="lastUpdatedBy"/>
        <result column="LAST_UPDATE_TIME" jdbcType="TIMESTAMP" property="lastUpdateTime"/>
    </resultMap>

    <sql id="entityColumnList">
         `ID`, `TENANT_ID`, `MEMBER_ID`, `WITH_DRAW_NUMBER`, `APPLY_TIME`, `ACCOUNT_INFO`, `PAYMENT_TIME`, `ACCOUNT_NUMBER`, `WITH_DRAW_PERSON_NAME`, `WITH_DRAW_AMOUNT`, `STATUS`, `FAIL_REASON`,`DATE_ID`, `ROW_VERSION`,`IS_DELETED`,`CREATED_BY`,`CREATION_TIME`,`LAST_UPDATED_BY`,`LAST_UPDATE_TIME`
    </sql>

    <insert id="insert">
        INSERT INTO
            `CUS_GET_CASHLIST`
            (
            <include refid="entityColumnList" />
            )
        VALUES
        (
        #{ getCashlist.id },
        #{ passport.tenantId },
        #{ getCashlist.memberId },
        #{ getCashlist.withDrawNumber },
        #{ getCashlist.applyTime },
        #{ getCashlist.accountInfo },
        #{ getCashlist.paymentTime },
        #{ getCashlist.accountNumber },
        #{ getCashlist.withDrawPersonName },
        #{ getCashlist.withDrawAmount },
        #{ getCashlist.status },
        #{ getCashlist.failReason },
        #{ getCashlist.dateId},
        
        0,0,#{ passport.userId },sysdate(),null,null
        )
    </insert>

    <insert id="insertBatch">
        INSERT INTO
            `CUS_GET_CASHLIST`
            (
            <include refid="entityColumnList" />
            )
        VALUES
        <foreach collection="list" item= "getCashlist" index ="index" separator=",">
            (
            #{ getCashlist.id },
            #{ passport.tenantId },
            #{ getCashlist.memberId },
            #{ getCashlist.withDrawNumber },
            #{ getCashlist.applyTime },
            #{ getCashlist.accountInfo },
            #{ getCashlist.paymentTime },
            #{ getCashlist.accountNumber },
            #{ getCashlist.withDrawPersonName },
            #{ getCashlist.withDrawAmount },
            #{ getCashlist.status },
            #{ getCashlist.failReason },
            #{ getCashlist.dateId},
            
            0,0,#{ passport.userId },sysdate(),null,null
            )
        </foreach >
    </insert>


    <update id="delete">
        UPDATE
            `CUS_GET_CASHLIST`
        SET
            `IS_DELETED` = 1
            ,`LAST_UPDATED_BY`=#{ passport.userId }
            ,`LAST_UPDATE_TIME`=SYSDATE()
        WHERE
            `IS_DELETED`=0

            AND `ID` = #{id}
    </update>

    <update id= "deleteBatch">
        UPDATE
            `CUS_GET_CASHLIST`
        SET
            `IS_DELETED` = 1
            ,`LAST_UPDATED_BY`=#{ passport.userId }
            ,`LAST_UPDATE_TIME`=SYSDATE()
        WHERE
            `IS_DELETED`=0

            AND `ID` in
        <foreach collection="list" item= "id" index ="index" open= "(" close =")" separator=",">
            #{id}
        </foreach >
    </update >


    <select id="getById" resultMap="getCashlistPO">
        SELECT
            <include refid="entityColumnList" />
        FROM
            `CUS_GET_CASHLIST`
        WHERE
            `IS_DELETED` = 0
            AND `ID` = #{id}

    </select>

    <select id="getListByIds" resultMap="getCashlistPO">
        SELECT
            <include refid="entityColumnList" />
        FROM
            `CUS_GET_CASHLIST`
        WHERE
        `IS_DELETED` = 0
        AND `ID` in
        <foreach collection="list" item= "id" index ="index" open= "(" close =")" separator=",">
            #{id}
        </foreach >
        

    </select>

    <select id="getAllList" resultMap="getCashlistPO">
        SELECT
            <include refid="entityColumnList" />
        FROM
            `CUS_GET_CASHLIST`
        WHERE
            `IS_DELETED`=0

    </select>

    <select id="existById"  resultType="java.lang.Long">
        SELECT
            COUNT(*)
        FROM
            `CUS_GET_CASHLIST`
        WHERE
            `IS_DELETED`=0
            AND `ID`=#{id}

    </select>
</mapper>