<?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="SHyglJfglPointAdjustmentMapper" >
    <!-- 通用查询映射结果 -->

    <select id="selectSHyglJfglPointAdjustmentList" parameterType="pd" resultType="pd">
        select * from s_hygl_jfgl_point_adjustment where 1=1
        <if test="id !=null and id !='' ">
            and id = #{id}
        </if>
        <if test="applicationNumber !=null and applicationNumber !='' ">
            and applicationNumber = #{applicationNumber}
        </if>
        <if test="adjustmentQuantity !=null and adjustmentQuantity !='' ">
            and adjustmentQuantity = #{adjustmentQuantity}
        </if>
        <if test="applicant !=null and applicant !='' ">
            and applicant = #{applicant}
        </if>
        <if test="applicationTime !=null and applicationTime !='' ">
            and applicationTime = #{applicationTime}
        </if>
        <if test="approver !=null and approver !='' ">
            and approver = #{approver}
        </if>
        <if test="approvalTime !=null and approvalTime !='' ">
            and approvalTime = #{approvalTime}
        </if>
        <if test="approvalStatus !=null and approvalStatus !='' ">
            and approvalStatus = #{approvalStatus}
        </if>
        <if test="memberCardNumber !=null and memberCardNumber !='' ">
            and memberCardNumber = #{memberCardNumber}
        </if>
        <if test="memberPhone !=null and memberPhone !='' ">
            and memberPhone = #{memberPhone}
        </if>
        <if test="memberName !=null and memberName !='' ">
            and memberName = #{memberName}
        </if>
        <if test="pointsAdjusted !=null and pointsAdjusted !='' ">
            and pointsAdjusted = #{pointsAdjusted}
        </if>
        <if test="adjustmentReason !=null and adjustmentReason !='' ">
            and adjustmentReason = #{adjustmentReason}
        </if>
        <if test="adjustmentType !=null and adjustmentType !='' ">
            and adjustmentType = #{adjustmentType}
        </if>
    </select>


    <update id="updateSHyglJfglPointAdjustment" parameterType="pd" >
        update s_hygl_jfgl_point_adjustment
        <trim prefix=" SET " suffix="" prefixOverrides="," suffixOverrides=",">
        <if test="applicationNumber !=null and applicationNumber !='' ">
            applicationNumber = #{applicationNumber},
        </if>
        <if test="adjustmentQuantity !=null and adjustmentQuantity !='' ">
            adjustmentQuantity = #{adjustmentQuantity},
        </if>
        <if test="applicant !=null and applicant !='' ">
            applicant = #{applicant},
        </if>
        <if test="applicationTime !=null and applicationTime !='' ">
            applicationTime = #{applicationTime},
        </if>
        <if test="approver !=null and approver !='' ">
            approver = #{approver},
        </if>
        <if test="approvalTime !=null and approvalTime !='' ">
            approvalTime = #{approvalTime},
        </if>
        <if test="approvalStatus !=null and approvalStatus !='' ">
            approvalStatus = #{approvalStatus},
        </if>
        <if test="memberCardNumber !=null and memberCardNumber !='' ">
            memberCardNumber = #{memberCardNumber},
        </if>
        <if test="memberPhone !=null and memberPhone !='' ">
            memberPhone = #{memberPhone},
        </if>
        <if test="memberName !=null and memberName !='' ">
            memberName = #{memberName},
        </if>
        <if test="pointsAdjusted !=null and pointsAdjusted !='' ">
            pointsAdjusted = #{pointsAdjusted},
        </if>
        <if test="adjustmentReason !=null and adjustmentReason !='' ">
            adjustmentReason = #{adjustmentReason},
        </if>
        <if test="adjustmentType !=null and adjustmentType !='' ">
            adjustmentType = #{adjustmentType},
        </if>
        </trim>
        <if test="up != null and up!=''">
            <if test="id != null and id!=''">
                where id=#{id}
            </if>
        </if>
    </update>

    <delete id="SHyglJfglPointAdjustmentRemove" parameterType="pd">
        <if test="ids != null">
            delete from s_hygl_jfgl_point_adjustment where
            <if test="ids != null">
                id in(${ids})
            </if>
        </if>
    </delete>

    <insert id="addSHyglJfglPointAdjustment" parameterType="pd" >

        insert into s_hygl_jfgl_point_adjustment
        <trim prefix="(" suffix=")" prefixOverrides="," suffixOverrides=",">

        <if test="applicationNumber !=null and applicationNumber !='' ">
            applicationNumber,
        </if>
        <if test="adjustmentQuantity !=null and adjustmentQuantity !='' ">
            adjustmentQuantity,
        </if>
        <if test="applicant !=null and applicant !='' ">
            applicant,
        </if>
        <if test="applicationTime !=null and applicationTime !='' ">
            applicationTime,
        </if>
        <if test="approver !=null and approver !='' ">
            approver,
        </if>
        <if test="approvalTime !=null and approvalTime !='' ">
            approvalTime,
        </if>
        <if test="approvalStatus !=null and approvalStatus !='' ">
            approvalStatus,
        </if>
        <if test="memberCardNumber !=null and memberCardNumber !='' ">
            memberCardNumber,
        </if>
        <if test="memberPhone !=null and memberPhone !='' ">
            memberPhone,
        </if>
        <if test="memberName !=null and memberName !='' ">
            memberName,
        </if>
        <if test="pointsAdjusted !=null and pointsAdjusted !='' ">
            pointsAdjusted,
        </if>
        <if test="adjustmentReason !=null and adjustmentReason !='' ">
            adjustmentReason,
        </if>
        <if test="adjustmentType !=null and adjustmentType !='' ">
            adjustmentType,
        </if>
        </trim>
        <trim prefix=" VALUES (" suffix=")" prefixOverrides="," suffixOverrides=",">
        <if test="applicationNumber !=null and applicationNumber !='' ">
             #{applicationNumber},
        </if>
        <if test="adjustmentQuantity !=null and adjustmentQuantity !='' ">
             #{adjustmentQuantity},
        </if>
        <if test="applicant !=null and applicant !='' ">
             #{applicant},
        </if>
        <if test="applicationTime !=null and applicationTime !='' ">
             #{applicationTime},
        </if>
        <if test="approver !=null and approver !='' ">
             #{approver},
        </if>
        <if test="approvalTime !=null and approvalTime !='' ">
             #{approvalTime},
        </if>
        <if test="approvalStatus !=null and approvalStatus !='' ">
             #{approvalStatus},
        </if>
        <if test="memberCardNumber !=null and memberCardNumber !='' ">
             #{memberCardNumber},
        </if>
        <if test="memberPhone !=null and memberPhone !='' ">
             #{memberPhone},
        </if>
        <if test="memberName !=null and memberName !='' ">
             #{memberName},
        </if>
        <if test="pointsAdjusted !=null and pointsAdjusted !='' ">
             #{pointsAdjusted},
        </if>
        <if test="adjustmentReason !=null and adjustmentReason !='' ">
             #{adjustmentReason},
        </if>
        <if test="adjustmentType !=null and adjustmentType !='' ">
             #{adjustmentType},
        </if>
        </trim>

    </insert>

</mapper>
