FundDetailMapper.xml 8.23 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.chinagas.modules.zjwjsb.mapper.FundDetailMapper">
    <resultMap id="fundDetailResult" type="FundDetail">
        <id property="id" column="id"/>
        <result property="mainId" column="main_id"/>
        <result property="bizId"  column="biz_id"/>
        <result property="payNo"  column="pay_no"/>
        <result property="title"  column="title"/>
        <result property="approval" column="approval"/>
        <result property="hasPay" column="has_pay"/>
        <result property="waitForPay"  column="wait_for_pay"/>
        <result property="approvalForPay" column="approval_for_pay"/>
        <result property="itemClass" column="item_class"/>
        <result property="itemClassName" column="item_class_name"/>
        <result property="applyDate" column="apply_date"/>
        <result property="status" column="status"/>
        <result property="statusName" column="status_name"/>
        <result property="delFlag" column="del_flag"/>
        <result property="createTime" column="create_time"/>
        <result property="createBy" column="create_by"/>
        <result property="updateTime" column="update_time"/>
        <result property="updateBy" column="update_by"/>
    </resultMap>

    <sql id="selectFundDetailVo" >
        select
            d.id,
            d.main_id,
            d.biz_id,
            d.pay_no,
            d.title,
            d.approval,
            d.has_pay,
            d.wait_for_pay,
            d.approval_for_pay,
            d.item_class,
            d.item_class_name,
            d.apply_date,
            d.status,
            d.status_name,
            d.del_flag,
            d.create_time,
            d.create_by,
            d.update_time,
            d.update_by
        from ta_fund_detail d
    </sql>

    <select id="selectFundDetailById" parameterType="Long" resultMap="fundDetailResult">
        <include refid="selectFundDetailVo"/> where d.id = #{id}
    </select>

    <insert id="insertFundDetail" parameterType="FundDetail">
        insert into ta_fund_detail(
        <trim suffix="" suffixOverrides=",">
            <if test="id != null and id != ''">id,</if>
            <if test="mainId != null and mainId != ''">main_id,</if>
            <if test="bizId != null and bizId!= ''">biz_id,</if>
            <if test="payNo  != null and payNo  != ''">pay_no, </if>
            <if test="title  != null and title  != ''">title, </if>
            <if test="approval  != null">approval, </if>
            <if test="hasPay    != null">has_pay,    </if>
            <if test="waitForPay != null">wait_for_pay,</if>
            <if test="approvalForPay != null">approval_for_pay,</if>
            <if test="itemClass != null">item_class,</if>
            <if test="itemClassName != null and itemClassName != ''">item_class_name,</if>
            <if test="applyDate    != null">apply_date,    </if>
            <if test="status    != null">status,    </if>
            <if test="statusName    != null and statusName    != ''">status_name,    </if>
            <if test="delFlag    != null">del_flag,    </if>
            <if test="createBy    != null and createBy    != ''">create_by,    </if>
            <if test="updateTime    != null">update_time,    </if>
            <if test="updateBy    != null and updateBy    != ''">update_by,    </if>
            create_time
        </trim>
        )  values(
        <trim suffix="" suffixOverrides=",">
            <if test="id != null and id != ''">#{id},</if>
            <if test="mainId != null and mainId != ''">#{mainId},</if>
            <if test="bizId != null and bizId!= ''">#{bizId},</if>
            <if test="payNo  != null and payNo  != ''">#{payNo}, </if>
            <if test="title  != null and title  != ''">#{title}, </if>
            <if test="approval  != null">#{approval}, </if>
            <if test="hasPay    != null">#{hasPay},    </if>
            <if test="waitForPay != null">#{waitForPay},</if>
            <if test="approvalForPay != null">#{approvalForPay},</if>
            <if test="itemClass != null">#{itemClass},</if>
            <if test="itemClassName != null and itemClassName != ''">#{itemClassName},</if>
            <if test="applyDate != null">#{applyDate, jdbcType=TIMESTAMP},    </if>
            <if test="status    != null">#{status},    </if>
            <if test="statusName    != null and statusName    != ''">#{statusName},    </if>
            <if test="delFlag    != null">#{delFlag},    </if>
            <if test="createBy    != null and createBy    != ''">#{createBy},    </if>
            <if test="updateTime    != null">#{updateTime, jdbcType=TIMESTAMP},    </if>
            <if test="updateBy    != null and updateBy    != ''">#{updateBy},    </if>
            sysdate()
        </trim>
        )
    </insert>

    <update id="updateFundDetail" parameterType="FundDetail">
        update ta_fund_detail
        <trim prefix="SET" suffixOverrides=",">
            <if test="mainId != null and mainId != ''">main_id = #{mainId},</if>
            <if test="bizId != null and bizId != ''">biz_id = #{bizId},</if>
            <if test="payNo != null and payNo != ''">pay_no = #{payNo},</if>
            <if test="title != null and title != ''">title = #{title},</if>
            <if test="approval != null">approval = #{approval},</if>
            <if test="hasPay != null">has_pay = #{hasPay},</if>
            <if test="waitForPay != null">wait_for_pay = #{waitForPay},</if>
            <if test="approvalForPay != null">approval_for_pay = #{approvalForPay},</if>
            <if test="itemClass != null">item_class = #{itemClass},</if>
            <if test="itemClassName != null and itemClassName != ''">item_class_name = #{itemClassName},</if>
            <if test="applyDate != null">apply_date = #{applyDate, jdbcType=TIMESTAMP},</if>
            <if test="status != null">status = #{status},</if>
            <if test="statusName != null and statusName != ''">status_name = #{statusName},</if>
            <if test="delFlag != null">del_flag = #{delFlag},</if>
            <if test="createTime != null">create_time = #{createTime, jdbcType=TIMESTAMP},</if>
            <if test="createBy != null and createBy != ''">create_by = #{createBy},</if>
            <if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
            update_time = sysdate()
        </trim>
        where id = #{id}
    </update>

    <update id="updateFundDetailByBizId" parameterType="FundDetail">
        update ta_fund_detail
        <trim prefix="SET" suffixOverrides=",">
            <if test="mainId != null and mainId != ''">main_id = #{mainId},</if>
            <if test="payNo != null and payNo != ''">pay_no = #{payNo},</if>
            <if test="title != null and title != ''">title = #{title},</if>
            <if test="approval != null">approval = #{approval},</if>
            <if test="hasPay != null">has_pay = #{hasPay},</if>
            <if test="waitForPay != null">wait_for_pay = #{waitForPay},</if>
            <if test="approvalForPay != null">approval_for_pay = #{approvalForPay},</if>
            <if test="itemClass != null">item_class = #{itemClass},</if>
            <if test="itemClassName != null and itemClassName != ''">item_class_name = #{itemClassName},</if>
            <if test="applyDate != null">apply_date = #{applyDate, jdbcType=TIMESTAMP},</if>
            <if test="status != null">status = #{status},</if>
            <if test="statusName != null and statusName != ''">status_name = #{statusName},</if>
            <if test="delFlag != null">del_flag = #{delFlag},</if>
            <if test="createTime != null">create_time = #{createTime, jdbcType=TIMESTAMP},</if>
            <if test="createBy != null and createBy != ''">create_by = #{createBy},</if>
            <if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
            update_time = sysdate()
        </trim>
        where biz_id = #{bizId}
    </update>

    <update id="deleteFundDetailById" parameterType="Long">
        update ta_fund_detail set del_flag = '1' where id = #{id}
    </update>

    <delete id="deleteFundDetailByMainId" parameterType="String">
        delete from ta_fund_detail where main_id = #{mainId}
    </delete>

</mapper>