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

    <select id="selectSKcCrkMdqhRequisitionapplicationList" parameterType="pd" resultType="pd">
        select * from s_kc_crk_mdqh_requisitionapplication where 1=1
        <if test="requisitionApplicationNumber !=null and requisitionApplicationNumber !='' ">
            and requisitionApplicationNumber = #{requisitionApplicationNumber}
        </if>
        <if test="applicationType !=null and applicationType !='' ">
            and applicationType = #{applicationType}
        </if>
        <if test="applicant !=null and applicant !='' ">
            and applicant = #{applicant}
        </if>
        <if test="applicationTime !=null and applicationTime !='' ">
            and applicationTime = #{applicationTime}
        </if>
        <if test="reviewStatus !=null and reviewStatus !='' ">
            and reviewStatus = #{reviewStatus}
        </if>
    </select>


    <update id="updateSKcCrkMdqhRequisitionapplication" parameterType="pd" >
        update s_kc_crk_mdqh_requisitionapplication
        <trim prefix=" SET " suffix="" prefixOverrides="," suffixOverrides=",">
        <if test="requisitionApplicationNumber !=null and requisitionApplicationNumber !='' ">
            requisitionApplicationNumber = #{requisitionApplicationNumber},
        </if>
        <if test="applicationType !=null and applicationType !='' ">
            applicationType = #{applicationType},
        </if>
        <if test="applicant !=null and applicant !='' ">
            applicant = #{applicant},
        </if>
        <if test="applicationTime !=null and applicationTime !='' ">
            applicationTime = #{applicationTime},
        </if>
        <if test="reviewStatus !=null and reviewStatus !='' ">
            reviewStatus = #{reviewStatus},
        </if>
        </trim>
        <if test="up != null and up!=''">
            <if test="id != null and id!=''">
                where id=#{id}
            </if>
        </if>
    </update>

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

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

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

        <if test="requisitionApplicationNumber !=null and requisitionApplicationNumber !='' ">
            requisitionApplicationNumber,
        </if>
        <if test="applicationType !=null and applicationType !='' ">
            applicationType,
        </if>
        <if test="applicant !=null and applicant !='' ">
            applicant,
        </if>
        <if test="applicationTime !=null and applicationTime !='' ">
            applicationTime,
        </if>
        <if test="reviewStatus !=null and reviewStatus !='' ">
            reviewStatus,
        </if>
        </trim>
        <trim prefix=" VALUES (" suffix=")" prefixOverrides="," suffixOverrides=",">
        <if test="requisitionApplicationNumber !=null and requisitionApplicationNumber !='' ">
             #{requisitionApplicationNumber},
        </if>
        <if test="applicationType !=null and applicationType !='' ">
             #{applicationType},
        </if>
        <if test="applicant !=null and applicant !='' ">
             #{applicant},
        </if>
        <if test="applicationTime !=null and applicationTime !='' ">
             #{applicationTime},
        </if>
        <if test="reviewStatus !=null and reviewStatus !='' ">
             #{reviewStatus},
        </if>
        </trim>

    </insert>

</mapper>
