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

    <select id="selectSKcCrkWeeklyrequisitionstatsList" parameterType="pd" resultType="pd">
        select * from s_kc_crk_weeklyrequisitionstats where 1=1
        <if test="week !=null and week !='' ">
            and week = #{week}
        </if>
        <if test="requisitionOrderCount !=null and requisitionOrderCount !='' ">
            and requisitionOrderCount = #{requisitionOrderCount}
        </if>
        <if test="requisitionItemRows !=null and requisitionItemRows !='' ">
            and requisitionItemRows = #{requisitionItemRows}
        </if>
        <if test="deliveryOrderCount !=null and deliveryOrderCount !='' ">
            and deliveryOrderCount = #{deliveryOrderCount}
        </if>
        <if test="deliveryItemRows !=null and deliveryItemRows !='' ">
            and deliveryItemRows = #{deliveryItemRows}
        </if>
        <if test="deliveryRowRatio !=null and deliveryRowRatio !='' ">
            and deliveryRowRatio = #{deliveryRowRatio}
        </if>
        <if test="requisitionQuantity !=null and requisitionQuantity !='' ">
            and requisitionQuantity = #{requisitionQuantity}
        </if>
        <if test="deliveryQuantity !=null and deliveryQuantity !='' ">
            and deliveryQuantity = #{deliveryQuantity}
        </if>
        <if test="deliveryQuantityRatio !=null and deliveryQuantityRatio !='' ">
            and deliveryQuantityRatio = #{deliveryQuantityRatio}
        </if>
        <if test="validAutoRequisitionRows !=null and validAutoRequisitionRows !='' ">
            and validAutoRequisitionRows = #{validAutoRequisitionRows}
        </if>
        <if test="modifiedAutoRequisitionRows !=null and modifiedAutoRequisitionRows !='' ">
            and modifiedAutoRequisitionRows = #{modifiedAutoRequisitionRows}
        </if>
        <if test="manuallyAddedRows !=null and manuallyAddedRows !='' ">
            and manuallyAddedRows = #{manuallyAddedRows}
        </if>
        <if test="manuallyDeletedRows !=null and manuallyDeletedRows !='' ">
            and manuallyDeletedRows = #{manuallyDeletedRows}
        </if>
        <if test="modifiedPercentage !=null and modifiedPercentage !='' ">
            and modifiedPercentage = #{modifiedPercentage}
        </if>
        <if test="addedPercentage !=null and addedPercentage !='' ">
            and addedPercentage = #{addedPercentage}
        </if>
        <if test="deletedPercentage !=null and deletedPercentage !='' ">
            and deletedPercentage = #{deletedPercentage}
        </if>
        <if test="confirmedSubmissionRows !=null and confirmedSubmissionRows !='' ">
            and confirmedSubmissionRows = #{confirmedSubmissionRows}
        </if>
        <if test="autoGeneratedRequisitionQuantity !=null and autoGeneratedRequisitionQuantity !='' ">
            and autoGeneratedRequisitionQuantity = #{autoGeneratedRequisitionQuantity}
        </if>
        <if test="confirmedSubmissionQuantity !=null and confirmedSubmissionQuantity !='' ">
            and confirmedSubmissionQuantity = #{confirmedSubmissionQuantity}
        </if>
    </select>


    <update id="updateSKcCrkWeeklyrequisitionstats" parameterType="pd" >
        update s_kc_crk_weeklyrequisitionstats
        <trim prefix=" SET " suffix="" prefixOverrides="," suffixOverrides=",">
        <if test="week !=null and week !='' ">
            week = #{week},
        </if>
        <if test="requisitionOrderCount !=null and requisitionOrderCount !='' ">
            requisitionOrderCount = #{requisitionOrderCount},
        </if>
        <if test="requisitionItemRows !=null and requisitionItemRows !='' ">
            requisitionItemRows = #{requisitionItemRows},
        </if>
        <if test="deliveryOrderCount !=null and deliveryOrderCount !='' ">
            deliveryOrderCount = #{deliveryOrderCount},
        </if>
        <if test="deliveryItemRows !=null and deliveryItemRows !='' ">
            deliveryItemRows = #{deliveryItemRows},
        </if>
        <if test="deliveryRowRatio !=null and deliveryRowRatio !='' ">
            deliveryRowRatio = #{deliveryRowRatio},
        </if>
        <if test="requisitionQuantity !=null and requisitionQuantity !='' ">
            requisitionQuantity = #{requisitionQuantity},
        </if>
        <if test="deliveryQuantity !=null and deliveryQuantity !='' ">
            deliveryQuantity = #{deliveryQuantity},
        </if>
        <if test="deliveryQuantityRatio !=null and deliveryQuantityRatio !='' ">
            deliveryQuantityRatio = #{deliveryQuantityRatio},
        </if>
        <if test="validAutoRequisitionRows !=null and validAutoRequisitionRows !='' ">
            validAutoRequisitionRows = #{validAutoRequisitionRows},
        </if>
        <if test="modifiedAutoRequisitionRows !=null and modifiedAutoRequisitionRows !='' ">
            modifiedAutoRequisitionRows = #{modifiedAutoRequisitionRows},
        </if>
        <if test="manuallyAddedRows !=null and manuallyAddedRows !='' ">
            manuallyAddedRows = #{manuallyAddedRows},
        </if>
        <if test="manuallyDeletedRows !=null and manuallyDeletedRows !='' ">
            manuallyDeletedRows = #{manuallyDeletedRows},
        </if>
        <if test="modifiedPercentage !=null and modifiedPercentage !='' ">
            modifiedPercentage = #{modifiedPercentage},
        </if>
        <if test="addedPercentage !=null and addedPercentage !='' ">
            addedPercentage = #{addedPercentage},
        </if>
        <if test="deletedPercentage !=null and deletedPercentage !='' ">
            deletedPercentage = #{deletedPercentage},
        </if>
        <if test="confirmedSubmissionRows !=null and confirmedSubmissionRows !='' ">
            confirmedSubmissionRows = #{confirmedSubmissionRows},
        </if>
        <if test="autoGeneratedRequisitionQuantity !=null and autoGeneratedRequisitionQuantity !='' ">
            autoGeneratedRequisitionQuantity = #{autoGeneratedRequisitionQuantity},
        </if>
        <if test="confirmedSubmissionQuantity !=null and confirmedSubmissionQuantity !='' ">
            confirmedSubmissionQuantity = #{confirmedSubmissionQuantity},
        </if>
        </trim>
        <if test="up != null and up!=''">
            <if test="id != null and id!=''">
                where id=#{id}
            </if>
        </if>
    </update>

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

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

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

        <if test="week !=null and week !='' ">
            week,
        </if>
        <if test="requisitionOrderCount !=null and requisitionOrderCount !='' ">
            requisitionOrderCount,
        </if>
        <if test="requisitionItemRows !=null and requisitionItemRows !='' ">
            requisitionItemRows,
        </if>
        <if test="deliveryOrderCount !=null and deliveryOrderCount !='' ">
            deliveryOrderCount,
        </if>
        <if test="deliveryItemRows !=null and deliveryItemRows !='' ">
            deliveryItemRows,
        </if>
        <if test="deliveryRowRatio !=null and deliveryRowRatio !='' ">
            deliveryRowRatio,
        </if>
        <if test="requisitionQuantity !=null and requisitionQuantity !='' ">
            requisitionQuantity,
        </if>
        <if test="deliveryQuantity !=null and deliveryQuantity !='' ">
            deliveryQuantity,
        </if>
        <if test="deliveryQuantityRatio !=null and deliveryQuantityRatio !='' ">
            deliveryQuantityRatio,
        </if>
        <if test="validAutoRequisitionRows !=null and validAutoRequisitionRows !='' ">
            validAutoRequisitionRows,
        </if>
        <if test="modifiedAutoRequisitionRows !=null and modifiedAutoRequisitionRows !='' ">
            modifiedAutoRequisitionRows,
        </if>
        <if test="manuallyAddedRows !=null and manuallyAddedRows !='' ">
            manuallyAddedRows,
        </if>
        <if test="manuallyDeletedRows !=null and manuallyDeletedRows !='' ">
            manuallyDeletedRows,
        </if>
        <if test="modifiedPercentage !=null and modifiedPercentage !='' ">
            modifiedPercentage,
        </if>
        <if test="addedPercentage !=null and addedPercentage !='' ">
            addedPercentage,
        </if>
        <if test="deletedPercentage !=null and deletedPercentage !='' ">
            deletedPercentage,
        </if>
        <if test="confirmedSubmissionRows !=null and confirmedSubmissionRows !='' ">
            confirmedSubmissionRows,
        </if>
        <if test="autoGeneratedRequisitionQuantity !=null and autoGeneratedRequisitionQuantity !='' ">
            autoGeneratedRequisitionQuantity,
        </if>
        <if test="confirmedSubmissionQuantity !=null and confirmedSubmissionQuantity !='' ">
            confirmedSubmissionQuantity,
        </if>
        </trim>
        <trim prefix=" VALUES (" suffix=")" prefixOverrides="," suffixOverrides=",">
        <if test="week !=null and week !='' ">
             #{week},
        </if>
        <if test="requisitionOrderCount !=null and requisitionOrderCount !='' ">
             #{requisitionOrderCount},
        </if>
        <if test="requisitionItemRows !=null and requisitionItemRows !='' ">
             #{requisitionItemRows},
        </if>
        <if test="deliveryOrderCount !=null and deliveryOrderCount !='' ">
             #{deliveryOrderCount},
        </if>
        <if test="deliveryItemRows !=null and deliveryItemRows !='' ">
             #{deliveryItemRows},
        </if>
        <if test="deliveryRowRatio !=null and deliveryRowRatio !='' ">
             #{deliveryRowRatio},
        </if>
        <if test="requisitionQuantity !=null and requisitionQuantity !='' ">
             #{requisitionQuantity},
        </if>
        <if test="deliveryQuantity !=null and deliveryQuantity !='' ">
             #{deliveryQuantity},
        </if>
        <if test="deliveryQuantityRatio !=null and deliveryQuantityRatio !='' ">
             #{deliveryQuantityRatio},
        </if>
        <if test="validAutoRequisitionRows !=null and validAutoRequisitionRows !='' ">
             #{validAutoRequisitionRows},
        </if>
        <if test="modifiedAutoRequisitionRows !=null and modifiedAutoRequisitionRows !='' ">
             #{modifiedAutoRequisitionRows},
        </if>
        <if test="manuallyAddedRows !=null and manuallyAddedRows !='' ">
             #{manuallyAddedRows},
        </if>
        <if test="manuallyDeletedRows !=null and manuallyDeletedRows !='' ">
             #{manuallyDeletedRows},
        </if>
        <if test="modifiedPercentage !=null and modifiedPercentage !='' ">
             #{modifiedPercentage},
        </if>
        <if test="addedPercentage !=null and addedPercentage !='' ">
             #{addedPercentage},
        </if>
        <if test="deletedPercentage !=null and deletedPercentage !='' ">
             #{deletedPercentage},
        </if>
        <if test="confirmedSubmissionRows !=null and confirmedSubmissionRows !='' ">
             #{confirmedSubmissionRows},
        </if>
        <if test="autoGeneratedRequisitionQuantity !=null and autoGeneratedRequisitionQuantity !='' ">
             #{autoGeneratedRequisitionQuantity},
        </if>
        <if test="confirmedSubmissionQuantity !=null and confirmedSubmissionQuantity !='' ">
             #{confirmedSubmissionQuantity},
        </if>
        </trim>

    </insert>

</mapper>
