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

    <select id="selectSYpdgChineseDecoctionstList" parameterType="pd" resultType="pd">
        select * from s_ypdg_chinese_decoctionst where 1=1
        <if test="id !=null and id !='' ">
            and id = #{id}
        </if>
        <if test="createdBy !=null and createdBy !='' ">
            and createdBy = #{createdBy}
        </if>
        <if test="createdDate !=null and createdDate !='' ">
            and createdDate = #{createdDate}
        </if>
        <if test="demandOrderNumber !=null and demandOrderNumber !='' ">
            and demandOrderNumber = #{demandOrderNumber}
        </if>
        <if test="thirdOrderId !=null and thirdOrderId !='' ">
            and thirdOrderId = #{thirdOrderId}
        </if>
        <if test="platformUserId !=null and platformUserId !='' ">
            and platformUserId = #{platformUserId}
        </if>
        <if test="businessId !=null and businessId !='' ">
            and businessId = #{businessId}
        </if>
        <if test="orderer !=null and orderer !='' ">
            and orderer = #{orderer}
        </if>
        <if test="ordererPhone !=null and ordererPhone !='' ">
            and ordererPhone = #{ordererPhone}
        </if>
        <if test="consignee !=null and consignee !='' ">
            and consignee = #{consignee}
        </if>
        <if test="encryptedConsignee !=null and encryptedConsignee !='' ">
            and encryptedConsignee = #{encryptedConsignee}
        </if>
        <if test="encryptedConsigneePhone !=null and encryptedConsigneePhone !='' ">
            and encryptedConsigneePhone = #{encryptedConsigneePhone}
        </if>
        <if test="consigneePhone !=null and consigneePhone !='' ">
            and consigneePhone = #{consigneePhone}
        </if>
        <if test="chainCompanyName !=null and chainCompanyName !='' ">
            and chainCompanyName = #{chainCompanyName}
        </if>
        <if test="storageId !=null and storageId !='' ">
            and storageId = #{storageId}
        </if>
        <if test="isSaved !=null and isSaved !='' ">
            and isSaved = #{isSaved}
        </if>
        <if test="prescriptionImage !=null and prescriptionImage !='' ">
            and prescriptionImage = #{prescriptionImage}
        </if>
        <if test="medicineDosage !=null and medicineDosage !='' ">
            and medicineDosage = #{medicineDosage}
        </if>
        <if test="decoctionMethod !=null and decoctionMethod !='' ">
            and decoctionMethod = #{decoctionMethod}
        </if>
        <if test="orderStore !=null and orderStore !='' ">
            and orderStore = #{orderStore}
        </if>
        <if test="submitTime !=null and submitTime !='' ">
            and submitTime = #{submitTime}
        </if>
        <if test="cancelTime !=null and cancelTime !='' ">
            and cancelTime = #{cancelTime}
        </if>
        <if test="paymentTime !=null and paymentTime !='' ">
            and paymentTime = #{paymentTime}
        </if>
        <if test="orderStatus !=null and orderStatus !='' ">
            and orderStatus = #{orderStatus}
        </if>
        <if test="remarks !=null and remarks !='' ">
            and remarks = #{remarks}
        </if>
    </select>


    <update id="updateSYpdgChineseDecoctionst" parameterType="pd" >
        update s_ypdg_chinese_decoctionst
        <trim prefix=" SET " suffix="" prefixOverrides="," suffixOverrides=",">
        <if test="createdBy !=null and createdBy !='' ">
            createdBy = #{createdBy},
        </if>
        <if test="createdDate !=null and createdDate !='' ">
            createdDate = #{createdDate},
        </if>
        <if test="demandOrderNumber !=null and demandOrderNumber !='' ">
            demandOrderNumber = #{demandOrderNumber},
        </if>
        <if test="thirdOrderId !=null and thirdOrderId !='' ">
            thirdOrderId = #{thirdOrderId},
        </if>
        <if test="platformUserId !=null and platformUserId !='' ">
            platformUserId = #{platformUserId},
        </if>
        <if test="businessId !=null and businessId !='' ">
            businessId = #{businessId},
        </if>
        <if test="orderer !=null and orderer !='' ">
            orderer = #{orderer},
        </if>
        <if test="ordererPhone !=null and ordererPhone !='' ">
            ordererPhone = #{ordererPhone},
        </if>
        <if test="consignee !=null and consignee !='' ">
            consignee = #{consignee},
        </if>
        <if test="encryptedConsignee !=null and encryptedConsignee !='' ">
            encryptedConsignee = #{encryptedConsignee},
        </if>
        <if test="encryptedConsigneePhone !=null and encryptedConsigneePhone !='' ">
            encryptedConsigneePhone = #{encryptedConsigneePhone},
        </if>
        <if test="consigneePhone !=null and consigneePhone !='' ">
            consigneePhone = #{consigneePhone},
        </if>
        <if test="chainCompanyName !=null and chainCompanyName !='' ">
            chainCompanyName = #{chainCompanyName},
        </if>
        <if test="storageId !=null and storageId !='' ">
            storageId = #{storageId},
        </if>
        <if test="isSaved !=null and isSaved !='' ">
            isSaved = #{isSaved},
        </if>
        <if test="prescriptionImage !=null and prescriptionImage !='' ">
            prescriptionImage = #{prescriptionImage},
        </if>
        <if test="medicineDosage !=null and medicineDosage !='' ">
            medicineDosage = #{medicineDosage},
        </if>
        <if test="decoctionMethod !=null and decoctionMethod !='' ">
            decoctionMethod = #{decoctionMethod},
        </if>
        <if test="orderStore !=null and orderStore !='' ">
            orderStore = #{orderStore},
        </if>
        <if test="submitTime !=null and submitTime !='' ">
            submitTime = #{submitTime},
        </if>
        <if test="cancelTime !=null and cancelTime !='' ">
            cancelTime = #{cancelTime},
        </if>
        <if test="paymentTime !=null and paymentTime !='' ">
            paymentTime = #{paymentTime},
        </if>
        <if test="orderStatus !=null and orderStatus !='' ">
            orderStatus = #{orderStatus},
        </if>
        <if test="remarks !=null and remarks !='' ">
            remarks = #{remarks},
        </if>
        </trim>
        <if test="up != null and up!=''">
            <if test="id != null and id!=''">
                where id=#{id}
            </if>
        </if>
    </update>

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

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

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

        <if test="createdBy !=null and createdBy !='' ">
            createdBy,
        </if>
        <if test="createdDate !=null and createdDate !='' ">
            createdDate,
        </if>
        <if test="demandOrderNumber !=null and demandOrderNumber !='' ">
            demandOrderNumber,
        </if>
        <if test="thirdOrderId !=null and thirdOrderId !='' ">
            thirdOrderId,
        </if>
        <if test="platformUserId !=null and platformUserId !='' ">
            platformUserId,
        </if>
        <if test="businessId !=null and businessId !='' ">
            businessId,
        </if>
        <if test="orderer !=null and orderer !='' ">
            orderer,
        </if>
        <if test="ordererPhone !=null and ordererPhone !='' ">
            ordererPhone,
        </if>
        <if test="consignee !=null and consignee !='' ">
            consignee,
        </if>
        <if test="encryptedConsignee !=null and encryptedConsignee !='' ">
            encryptedConsignee,
        </if>
        <if test="encryptedConsigneePhone !=null and encryptedConsigneePhone !='' ">
            encryptedConsigneePhone,
        </if>
        <if test="consigneePhone !=null and consigneePhone !='' ">
            consigneePhone,
        </if>
        <if test="chainCompanyName !=null and chainCompanyName !='' ">
            chainCompanyName,
        </if>
        <if test="storageId !=null and storageId !='' ">
            storageId,
        </if>
        <if test="isSaved !=null and isSaved !='' ">
            isSaved,
        </if>
        <if test="prescriptionImage !=null and prescriptionImage !='' ">
            prescriptionImage,
        </if>
        <if test="medicineDosage !=null and medicineDosage !='' ">
            medicineDosage,
        </if>
        <if test="decoctionMethod !=null and decoctionMethod !='' ">
            decoctionMethod,
        </if>
        <if test="orderStore !=null and orderStore !='' ">
            orderStore,
        </if>
        <if test="submitTime !=null and submitTime !='' ">
            submitTime,
        </if>
        <if test="cancelTime !=null and cancelTime !='' ">
            cancelTime,
        </if>
        <if test="paymentTime !=null and paymentTime !='' ">
            paymentTime,
        </if>
        <if test="orderStatus !=null and orderStatus !='' ">
            orderStatus,
        </if>
        <if test="remarks !=null and remarks !='' ">
            remarks,
        </if>
        </trim>
        <trim prefix=" VALUES (" suffix=")" prefixOverrides="," suffixOverrides=",">
        <if test="createdBy !=null and createdBy !='' ">
             #{createdBy},
        </if>
        <if test="createdDate !=null and createdDate !='' ">
             #{createdDate},
        </if>
        <if test="demandOrderNumber !=null and demandOrderNumber !='' ">
             #{demandOrderNumber},
        </if>
        <if test="thirdOrderId !=null and thirdOrderId !='' ">
             #{thirdOrderId},
        </if>
        <if test="platformUserId !=null and platformUserId !='' ">
             #{platformUserId},
        </if>
        <if test="businessId !=null and businessId !='' ">
             #{businessId},
        </if>
        <if test="orderer !=null and orderer !='' ">
             #{orderer},
        </if>
        <if test="ordererPhone !=null and ordererPhone !='' ">
             #{ordererPhone},
        </if>
        <if test="consignee !=null and consignee !='' ">
             #{consignee},
        </if>
        <if test="encryptedConsignee !=null and encryptedConsignee !='' ">
             #{encryptedConsignee},
        </if>
        <if test="encryptedConsigneePhone !=null and encryptedConsigneePhone !='' ">
             #{encryptedConsigneePhone},
        </if>
        <if test="consigneePhone !=null and consigneePhone !='' ">
             #{consigneePhone},
        </if>
        <if test="chainCompanyName !=null and chainCompanyName !='' ">
             #{chainCompanyName},
        </if>
        <if test="storageId !=null and storageId !='' ">
             #{storageId},
        </if>
        <if test="isSaved !=null and isSaved !='' ">
             #{isSaved},
        </if>
        <if test="prescriptionImage !=null and prescriptionImage !='' ">
             #{prescriptionImage},
        </if>
        <if test="medicineDosage !=null and medicineDosage !='' ">
             #{medicineDosage},
        </if>
        <if test="decoctionMethod !=null and decoctionMethod !='' ">
             #{decoctionMethod},
        </if>
        <if test="orderStore !=null and orderStore !='' ">
             #{orderStore},
        </if>
        <if test="submitTime !=null and submitTime !='' ">
             #{submitTime},
        </if>
        <if test="cancelTime !=null and cancelTime !='' ">
             #{cancelTime},
        </if>
        <if test="paymentTime !=null and paymentTime !='' ">
             #{paymentTime},
        </if>
        <if test="orderStatus !=null and orderStatus !='' ">
             #{orderStatus},
        </if>
        <if test="remarks !=null and remarks !='' ">
             #{remarks},
        </if>
        </trim>

    </insert>

</mapper>
