123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288 |
- <?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="DTPMapper">
- <!--处方登记 -->
- <select id="RecipeRegisterList" parameterType="pd" resultType="pd">
- select id, orderId, saleOrderNumber, genericName, productName, specification, quantity, manufacturer, mdmCode,
- posMemberName, posMemberPhone, prescriptionType, orderTime, prescriptionNumber, hospital, department,
- doctor, patientName, patientPhone, storeName, registrar, completionTime, deliveryMethod, paymentCode,
- paymentMethod, status ,create_time as createTime from s_dtp_cfdj_prescription
- <where>
- <if test="id != null">AND id = #{id}</if>
- <if test="orderId != null and orderId!=''">AND orderId = #{orderId}</if>
- <if test="saleOrderNumber != null and saleOrderNumber!=''">AND saleOrderNumber = #{saleOrderNumber}</if>
- <if test="genericName != null and genericName!=''">AND genericName = #{genericName}</if>
- <if test="productName != null and productName!=''">AND productName = #{productName}</if>
- <if test="specification != null and specification!=''">AND specification = #{specification}</if>
- <if test="quantity != null and quantity!=''">AND quantity = #{quantity}</if>
- <if test="manufacturer != null and manufacturer!=''">AND manufacturer = #{manufacturer}</if>
- <if test="mdmCode != null and mdmCode!=''">AND mdmCode = #{mdmCode}</if>
- <if test="posMemberName != null and posMemberName!=''">AND posMemberName = #{posMemberName}</if>
- <if test="posMemberPhone != null and posMemberPhone!=''">AND posMemberPhone = #{posMemberPhone}</if>
- <if test="prescriptionType != null and prescriptionType!=''">AND prescriptionType=#{prescriptionType}</if>
- <if test="orderTime != null and orderTime!=''">AND orderTime = #{orderTime}</if>
- <if test="prescriptionNumber != null and prescriptionNumber!=''">AND prescriptionNumber = #{prescriptionNumber}</if>
- <if test="hospital != null and hospital!=''">AND hospital = #{hospital}</if>
- <if test="department != null and department!=''">AND department = #{department}</if>
- <if test="doctor != null and doctor!=''">AND doctor = #{doctor}</if>
- <if test="query != null and query!=''">
- AND patientName LIKE CONCAT('%', #{query}, '%') or patientPhone = #{query}
- </if>
- <if test="storeName != null and storeName!=''">AND storeName = #{storeName}</if>
- <if test="registrar != null and registrar!=''">AND registrar = #{registrar}</if>
- <if test="completionTime != null and completionTime!=''">AND completionTime = #{completionTime}</if>
- <if test="deliveryMethod != null and deliveryMethod!=''">AND deliveryMethod=#{deliveryMethod}</if>
- <if test="paymentCode != null and paymentCode!=''">AND paymentCode = #{paymentCode}</if>
- <if test="paymentMethod != null and paymentMethod!=''">AND paymentMethod = #{paymentMethod}</if>
- <if test="status != null and status!=''">AND status = #{status}</if>
- <if test="createTime != null and createTime!=''">AND create_time = #{createTime}</if>
- and del_flag = '0'
- </where>
- order by create_time desc
- </select>
- <insert id="insertRecipe" parameterType="pd">
- insert into s_dtp_cfdj_prescription
- <trim prefix="(" suffix=")" prefixOverrides="," suffixOverrides=",">
- <if test="orderId != null and orderId!=''">orderId,</if>
- <if test="saleOrderNumber != null and saleOrderNumber!=''">saleOrderNumber,</if>
- <if test="genericName != null and genericName!=''">genericName,</if>
- <if test="productName != null and productName!=''">productName,</if>
- <if test="specification != null and specification!=''">specification,</if>
- <if test="quantity != null and quantity!=''">quantity,</if>
- <if test="manufacturer != null and manufacturer!=''">manufacturer,</if>
- <if test="mdmCode != null and mdmCode!=''">mdmCode,</if>
- <if test="posMemberName != null and posMemberName!=''">posMemberName,</if>
- <if test="posMemberPhone != null and posMemberPhone!=''">posMemberPhone,</if>
- <if test="prescriptionType != null and prescriptionType!=''">prescriptionType,</if>
- <if test="orderTime != null and orderTime!=''">orderTime,</if>
- <if test="prescriptionNumber != null and prescriptionNumber!=''">prescriptionNumber,</if>
- <if test="hospital != null and hospital!=''">hospital,</if>
- <if test="department != null and department!=''">department,</if>
- <if test="doctor != null and doctor!=''">doctor,</if>
- <if test="patientName != null and patientName!=''">patientName,</if>
- <if test="patientPhone != null and patientPhone!=''">patientPhone,</if>
- <if test="storeName != null and storeName!=''">storeName,</if>
- <if test="registrar != null and registrar!=''">registrar,</if>
- <if test="completionTime != null and completionTime!=''">completionTime,</if>
- <if test="deliveryMethod != null and deliveryMethod!=''">deliveryMethod,</if>
- <if test="paymentCode != null and paymentCode!=''">paymentCode,</if>
- <if test="paymentMethod != null and paymentMethod!=''">paymentMethod,</if>
- <if test="status != null and status!=''">status},</if>
- <if test="createTime != null and createTime!=''">create_time,</if>
- </trim>
- <trim prefix=" VALUES (" suffix=")" prefixOverrides="," suffixOverrides=",">
- <if test="orderId != null and orderId!=''">#{orderId},</if>
- <if test="saleOrderNumber != null and saleOrderNumber!=''">#{saleOrderNumber},</if>
- <if test="genericName != null and genericName!=''">#{genericName},</if>
- <if test="productName != null and productName!=''">#{productName},</if>
- <if test="specification != null and specification!=''">#{specification},</if>
- <if test="quantity != null and quantity!=''">#{quantity},</if>
- <if test="manufacturer != null and manufacturer!=''">#{manufacturer},</if>
- <if test="mdmCode != null and mdmCode!=''">#{mdmCode},</if>
- <if test="posMemberName != null and posMemberName!=''">#{posMemberName},</if>
- <if test="posMemberPhone != null and posMemberPhone!=''">#{posMemberPhone},</if>
- <if test="prescriptionType != null and prescriptionType!=''">#{prescriptionType},</if>
- <if test="orderTime != null and orderTime!=''">#{orderTime},</if>
- <if test="prescriptionNumber != null and prescriptionNumber!=''">#{prescriptionNumber},</if>
- <if test="hospital != null and hospital!=''">#{hospital},</if>
- <if test="department != null and department!=''">#{department},</if>
- <if test="doctor != null and doctor!=''">#{doctor},</if>
- <if test="patientName != null and patientName!=''">#{patientName},</if>
- <if test="patientPhone != null and patientPhone!=''">#{patientPhone},</if>
- <if test="storeName != null and storeName!=''">#{storeName},</if>
- <if test="registrar != null and registrar!=''">#{registrar},</if>
- <if test="completionTime != null and completionTime!=''">#{completionTime},</if>
- <if test="deliveryMethod != null and deliveryMethod!=''">#{deliveryMethod},</if>
- <if test="paymentCode != null and paymentCode!=''">#{paymentCode},</if>
- <if test="paymentMethod != null and paymentMethod!=''">#{paymentMethod},</if>
- <if test="status != null and status!=''">#{status},</if>
- <if test="createTime != null and createTime!=''">#{createTime},</if>
- </trim>
- </insert>
- <delete id="deleteRecipe" parameterType="pd">
- <if test="ids != null and ids!=''">
- delete from s_dtp_cfdj_prescription
- where id in (${ids})
- </if>
- </delete>
- <update id="updateRecipe" parameterType="pd">
- update s_dtp_cfdj_prescription
- <trim prefix=" SET " suffix="" prefixOverrides="," suffixOverrides=",">
- <if test="orderId != null and orderId!=''">orderId=#{orderId},</if>
- <if test="saleOrderNumber != null and saleOrderNumber!=''">saleOrderNumber=#{saleOrderNumber},</if>
- <if test="genericName != null and genericName!=''">genericName=#{genericName},</if>
- <if test="productName != null and productName!=''">productName=#{productName},</if>
- <if test="specification != null">specification=#{specification},</if>
- <if test="quantity != null">quantity=#{quantity},</if>
- <if test="manufacturer != null">manufacturer=#{manufacturer},</if>
- <if test="mdmCode != null">mdmCode=#{mdmCode},</if>
- <if test="posMemberName != null and posMemberName!=''">posMemberName=#{posMemberName},</if>
- <if test="posMemberPhone != null and posMemberPhone!=''">posMemberPhone=#{posMemberPhone},</if>
- <if test="prescriptionType != null and prescriptionType!=''">prescriptionType=#{prescriptionType},</if>
- <if test="orderTime != null">orderTime=#{orderTime},</if>
- <if test="prescriptionNumber != null and prescriptionNumber!=''">prescriptionNumber=#{prescriptionNumber},</if>
- <if test="hospital != null">hospital=#{hospital},</if>
- <if test="department != null">department=#{department},</if>
- <if test="doctor != null">doctor=#{doctor},</if>
- <if test="patientName != null and patientName!=''">patientName=#{patientName},</if>
- <if test="patientPhone != null and patientPhone!=''">patientPhone=#{patientPhone},</if>
- <if test="storeName != null">storeName=#{storeName},</if>
- <if test="registrar != null">registrar=#{registrar},</if>
- <if test="completionTime != null and completionTime!=''">completionTime=#{completionTime},</if>
- <if test="deliveryMethod != null and deliveryMethod!=''">deliveryMethod=#{deliveryMethod},</if>
- <if test="paymentCode != null and paymentCode!=''">paymentCode=#{paymentCode},</if>
- <if test="paymentMethod != null and paymentMethod!=''">paymentMethod=#{paymentMethod},</if>
- <if test="status != null and status!=''">status=#{status},</if>
- <if test="createTime != null and createTime!=''">create_time=#{createTime},</if>
- </trim>
- where id=#{id}
- </update>
- <select id="checkPatientNameAndPhoneUnique" parameterType="pd" resultType="pd">
- select patientName, patientPhone from s_dtp_cfdj_prescription where patientName=#{patientName} and patientPhone=#{patientPhone} and del_flag = '0' limit 1
- </select>
- <select id="selectOne" parameterType="pd" resultType="pd">
- select id, orderId, saleOrderNumber, genericName, productName, specification, quantity, manufacturer, mdmCode,
- posMemberName, posMemberPhone, prescriptionType, orderTime, prescriptionNumber, hospital, department,
- doctor, patientName, patientPhone, storeName, registrar, completionTime, deliveryMethod, paymentCode,
- paymentMethod, status ,create_time as createTime from s_dtp_cfdj_prescription where id=#{id}
- </select>
- <!--冷链配送管理 -->
- <select id="DistributionOrderList" parameterType="pd" resultType="pd">
- select id, orderNumber, chainName, storeName, deliveryStatus, coldChainType,orderSource,recipientName,
- recipientPhone,recipientAddress,departureTemperature,arrivalTemperature,signaturePhoto,isOnlineSignature,
- deliveryBoxNumber,icePackNumber,deliveryPerson, expectedDeliveryTime, actualDeliveryTime, creationTime, updatedTime,
- createdBy, createdDate
- from s_dtp_llps_distribution_order
- <where>
- <if test="id != null">AND id = #{id}</if>
- <if test="orderNumber != null and orderNumber!=''">AND orderNumber = #{orderNumber}</if>
- <if test="chainName != null and chainName!=''">AND chainName = #{chainName}</if>
- <if test="storeName != null and storeName!=''">AND storeName = #{storeName}</if>
- <if test="deliveryStatus != null and deliveryStatus!=''">AND deliveryStatus = #{deliveryStatus}</if>
- <if test="recipientName != null and recipientName!=''">AND recipientName = #{recipientName}</if>
- <if test="recipientPhone != null and recipientPhone!=''">AND recipientPhone = #{recipientPhone}</if>
- <if test="recipientAddress != null and recipientAddress!=''">AND recipientAddress = #{recipientAddress}</if>
- <if test="deliveryPerson != null and deliveryPerson!=''">AND deliveryPerson = #{deliveryPerson}</if>
- <if test="expectedDeliveryTime != null and expectedDeliveryTime!=''">AND expectedDeliveryTime = #{expectedDeliveryTime}</if>
- <if test="actualDeliveryTime != null and actualDeliveryTime!=''">AND actualDeliveryTime = #{actualDeliveryTime}</if>
- <if test="creationTime != null and creationTime!=''">AND creationTime = #{creationTime}</if>
- <if test="updatedTime != null and updatedTime!=''">AND updatedTime = #{updatedTime}</if>
- <if test="createdBy != null and createdBy!=''">AND createdBy = #{createdBy}</if>
- <if test="createdDate != null and createdDate!=''">AND createdDate = #{createdDate}</if>
- <if test="query != null and query!=''">
- AND recipientName LIKE CONCAT('%', #{query}, '%') or recipientPhone = #{query}
- </if>
- and del_flag= '0'
- </where>
- order by create_time desc
- </select>
- <insert id="insertDistributionOrder" parameterType="pd">
- insert into s_dtp_llps_distribution_order
- <trim prefix="(" suffix=")" prefixOverrides="," suffixOverrides=",">
- <if test="orderNumber != null and orderNumber!=''">orderNumber,</if>
- <if test="chainName != null and chainName!=''">chainName,</if>
- <if test="storeName != null and storeName!=''">storeName,</if>
- <if test="deliveryStatus != null and deliveryStatus!=''">deliveryStatus,</if>
- <if test="recipientName != null and recipientName!=''">recipientName,</if>
- <if test="recipientPhone != null and recipientPhone!=''">recipientPhone,</if>
- <if test="recipientAddress != null and recipientAddress!=''">recipientAddress,</if>
- <if test="deliveryPerson != null and deliveryPerson!=''">deliveryPerson,</if>
- <if test="expectedDeliveryTime != null and expectedDeliveryTime!=''">expectedDeliveryTime,</if>
- <if test="actualDeliveryTime != null and actualDeliveryTime!=''">actualDeliveryTime,</if>
- <if test="createdBy != null and createdBy!=''">createdBy,</if>
- <if test="createdDate != null and createdDate!=''">createdDate,</if>
- <if test="creationTime != null and creationTime!=''">creationTime,</if>
- <if test="updatedTime != null and updatedTime!=''">updatedTime,</if>
- <if test="createTime != null and createTime!=''">create_time,</if>
- <if test="coldChainType != null and coldChainType != ''">coldChainType ,</if>
- <if test="orderSource != null and orderSource != ''">orderSource,</if>
- <if test="departureTemperature != null">departureTemperature,</if>
- <if test="arrivalTemperature != null">arrivalTemperature,</if>
- <if test="signaturePhoto != null and signaturePhoto != ''">signaturePhoto,</if>
- <if test="isOnlineSignature != null">isOnlineSignature ,</if>
- <if test="deliveryBoxNumber != null and deliveryBoxNumber != ''">deliveryBoxNumber ,</if>
- <if test="icePackNumber != null and icePackNumber != ''">icePackNumber,</if>
- <if test="paymentSequence != null">paymentSequence,</if>
- </trim>
- <trim prefix=" VALUES (" suffix=")" prefixOverrides="," suffixOverrides=",">
- <if test="orderNumber != null and orderNumber!=''">#{orderNumber},</if>
- <if test="chainName != null and chainName!=''">#{chainName},</if>
- <if test="storeName != null and storeName!=''">#{storeName},</if>
- <if test="deliveryStatus != null and deliveryStatus!=''">#{deliveryStatus},</if>
- <if test="recipientName != null and recipientName!=''">#{recipientName},</if>
- <if test="recipientPhone != null and recipientPhone!=''">#{recipientPhone},</if>
- <if test="recipientAddress != null and recipientAddress!=''">#{recipientAddress},</if>
- <if test="deliveryPerson != null and deliveryPerson!=''">#{deliveryPerson},</if>
- <if test="expectedDeliveryTime != null and expectedDeliveryTime!=''">#{expectedDeliveryTime},</if>
- <if test="actualDeliveryTime != null and actualDeliveryTime!=''">#{actualDeliveryTime},</if>
- <if test="createdBy != null and createdBy!=''">#{createdBy},</if>
- <if test="createdDate != null and createdDate!=''">#{createdDate},</if>
- <if test="creationTime != null and creationTime!=''">#{creationTime},</if>
- <if test="updatedTime != null and updatedTime!=''">#{updatedTime},</if>
- <if test="createTime != null and createTime!=''">#{createTime},</if>
- <if test="coldChainType != null and coldChainType != ''">#{coldChainType} ,</if>
- <if test="orderSource != null and orderSource != ''">#{orderSource},</if>
- <if test="departureTemperature != null">#{departureTemperature},</if>
- <if test="arrivalTemperature != null">#{arrivalTemperature},</if>
- <if test="signaturePhoto != null and signaturePhoto != ''">#{signaturePhoto},</if>
- <if test="isOnlineSignature != null">#{isOnlineSignature} ,</if>
- <if test="deliveryBoxNumber != null and deliveryBoxNumber != ''">#{deliveryBoxNumber} ,</if>
- <if test="icePackNumber != null and icePackNumber != ''">#{icePackNumber},</if>
- <if test="paymentSequence != null">#{paymentSequence},</if>
- </trim>
- </insert>
- <update id="updateDistributionOrder" parameterType="pd">
- update s_dtp_llps_distribution_order
- <set>
- <if test="orderNumber != null and orderNumber != ''">orderNumber = #{orderNumber},</if>
- <if test="chainName != null and chainName != ''">chainName = #{chainName},</if>
- <if test="storeName != null and storeName != ''">storeName = #{storeName},</if>
- <if test="deliveryStatus != null">deliveryStatus = #{deliveryStatus},</if>
- <if test="recipientName != null and recipientName != ''">recipientName = #{recipientName},</if>
- <if test="recipientPhone != null and recipientPhone != ''">recipientPhone = #{recipientPhone},</if>
- <if test="recipientAddress != null and recipientAddress != ''">recipientAddress = #{recipientAddress},</if>
- <if test="deliveryPerson != null and deliveryPerson != ''">deliveryPerson = #{deliveryPerson},</if>
- <if test="expectedDeliveryTime != null">expectedDeliveryTime = #{expectedDeliveryTime},</if>
- <if test="actualDeliveryTime != null">actualDeliveryTime = #{actualDeliveryTime},</if>
- <if test="createdBy != null and createdBy != ''">createdBy = #{createdBy},</if>
- <if test="createdDate != null">createdDate = #{createdDate},</if>
- <if test="creationTime != null">creationTime = #{creationTime},</if>
- <if test="updatedTime != null">updatedTime = #{updatedTime},</if>
- <if test="createTime != null">create_time = #{createTime},</if>
- <if test="coldChainType != null and coldChainType != ''">coldChainType = #{coldChainType},</if>
- <if test="orderSource != null and orderSource != ''">orderSource = #{orderSource},</if>
- <if test="departureTemperature != null">departureTemperature = #{departureTemperature},</if>
- <if test="arrivalTemperature != null">arrivalTemperature = #{arrivalTemperature},</if>
- <if test="signaturePhoto != null and signaturePhoto != ''">signaturePhoto = #{signaturePhoto},</if>
- <if test="isOnlineSignature != null">isOnlineSignature = #{isOnlineSignature},</if>
- <if test="deliveryBoxNumber != null and deliveryBoxNumber != ''">deliveryBoxNumber = #{deliveryBoxNumber},</if>
- <if test="icePackNumber != null and icePackNumber != ''">icePackNumber = #{icePackNumber},</if>
- <if test="paymentSequence != null">paymentSequence = #{paymentSequence},</if>
- </set>
- where id = #{id}
- </update>
- <update id="softDeleteColdOrder" parameterType="pd">
- <if test="ids != null and ids.size() > 0">
- update s_dtp_llps_distribution_order
- set del_flag = 1
- where id in
- <foreach item="id" index="index" collection="ids" open="(" separator="," close=")">
- #{id}
- </foreach>
- </if>
- </update>
- </mapper>
|