| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346 |
- <?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="com.fs.his.mapper.FsPrescribeDataScrmMapper">
- <resultMap type="com.fs.his.domain.FsPrescribeDataScrm" id="FsPrescribeDataScrmResult">
- <id property="prescribeId" column="prescribe_id" />
- <result property="prescribeType" column="prescribe_type" />
- <result property="inquiryOrderId" column="inquiry_order_id" />
- <result property="orderCode" column="order_code" />
- <result property="storeOrderId" column="store_order_id" />
- <result property="userId" column="user_id" />
- <result property="patientId" column="patient_id" />
- <result property="prescribeCode" column="prescribe_code" />
- <result property="patientDescs" column="patient_descs" />
- <result property="nowIllness" column="now_illness" />
- <result property="historyIllness" column="history_illness" />
- <result property="patientAge" column="patient_age" />
- <result property="patientName" column="patient_name" />
- <result property="weight" column="weight" />
- <result property="isHistoryAllergic" column="is_history_allergic" />
- <result property="historyAllergic" column="history_allergic" />
- <result property="liverUnusual" column="liver_unusual" />
- <result property="renalUnusual" column="renal_unusual" />
- <result property="isLactation" column="is_lactation" />
- <result property="patientTel" column="patient_tel" />
- <result property="patientGender" column="patient_gender" />
- <result property="recordPic" column="record_pic" />
- <result property="prescribeImgUrl" column="prescribe_img_url" />
- <result property="prescribeImgStoreUrl" column="prescribe_img_store_url"/>
- <result property="auditReason" column="audit_reason" />
- <result property="diagnose" column="diagnose" />
- <result property="doctorId" column="doctor_id" />
- <result property="drugDoctorId" column="drug_doctor_id" />
- <result property="createTime" column="create_time" />
- <result property="status" column="status" />
- <result property="auditTime" column="audit_time" />
- <result property="usageJson" column="usage_json" />
- <result property="remark" column="remark" />
- <result property="storeId" column="store_id" />
- <result property="prescribeDoctorId" column="prescribe_doctor_id" />
- <result property="doctorSignUrl" column="doctor_sign_url" />
- <result property="prescribeDoctorSignUrl" column="prescribe_doctor_sign_url"/>
- <result property="drugDoctorSignUrl" column="drug_doctor_sign_url" />
- <result property="patientBirthday" column="patient_birthday" />
- <result property="recipeType" column="recipe_type" />
- <result property="prescribeCodeUrl" column="prescribe_code_url" />
- <result property="cycle" column="cycle" />
- <result property="icdCode" column="icd_code" />
- <result property="source" column="source" />
- <result property="doctorConfirm" column="doctor_confirm" />
- <result property="startOperateTime" column="start_operate_time" />
- <result property="endOperateTime" column="end_operate_time" />
- <result property="operateSecond" column="operate_second" />
- <result property="thirdPartyUserId" column="third_party_user_id" />
- <result property="isSendToThirdParty" column="is_send_to_third_party" />
- <result property="handwriteCollectionId" column="handwrite_collection_id"/>
- <result property="companyCustomerId" column="company_customer_id" />
- <result property="createBy" column="create_by" />
- <result property="updateBy" column="update_by" />
- <result property="updateTime" column="update_time" />
- </resultMap>
- <sql id="selectFsPrescribeDataScrmVo">
- select prescribe_id, prescribe_type, inquiry_order_id,order_code, store_order_id, user_id, patient_id,
- prescribe_code, patient_descs, now_illness, history_illness, patient_age, patient_name,
- weight, is_history_allergic, history_allergic, liver_unusual, renal_unusual, is_lactation,
- patient_tel, patient_gender, record_pic, prescribe_img_url, prescribe_img_store_url,
- audit_reason, diagnose, doctor_id, drug_doctor_id, create_time, status, audit_time,
- usage_json, remark, store_id, prescribe_doctor_id, doctor_sign_url,
- prescribe_doctor_sign_url, drug_doctor_sign_url, patient_birthday, recipe_type,
- prescribe_code_url, cycle, icd_code, source, doctor_confirm, start_operate_time,
- end_operate_time, operate_second, third_party_user_id, is_send_to_third_party,
- handwrite_collection_id, company_customer_id
- from fs_prescribe_data_scrm
- </sql>
- <select id="selectFsPrescribeDataScrmByPrescribeId" parameterType="Long" resultMap="FsPrescribeDataScrmResult">
- <include refid="selectFsPrescribeDataScrmVo"/>
- where prescribe_id = #{prescribeId}
- </select>
- <select id="selectFsPrescribeDataScrmList" parameterType="FsPrescribeDataScrm" resultMap="FsPrescribeDataScrmResult">
- <include refid="selectFsPrescribeDataScrmVo"/>
- <where>
- <if test="prescribeType != null"> and prescribe_type = #{prescribeType}</if>
- <if test="inquiryOrderId != null"> and inquiry_order_id = #{inquiryOrderId}</if>
- <if test="orderCode != null"> and order_code = #{orderCode}</if>
- <if test="storeOrderId != null"> and store_order_id = #{storeOrderId}</if>
- <if test="userId != null"> and user_id = #{userId}</if>
- <if test="patientId != null"> and patient_id = #{patientId}</if>
- <if test="prescribeCode != null and prescribeCode != ''"> and prescribe_code = #{prescribeCode}</if>
- <if test="patientName != null and patientName != ''"> and patient_name like concat('%', #{patientName}, '%')</if>
- <if test="patientTel != null and patientTel != ''"> and patient_tel = #{patientTel}</if>
- <if test="patientGender != null"> and patient_gender = #{patientGender}</if>
- <if test="diagnose != null and diagnose != ''"> and diagnose like concat('%', #{diagnose}, '%')</if>
- <if test="doctorId != null"> and doctor_id = #{doctorId}</if>
- <if test="drugDoctorId != null"> and drug_doctor_id = #{drugDoctorId}</if>
- <if test="status != null"> and status = #{status}</if>
- <if test="storeId != null"> and store_id = #{storeId}</if>
- <if test="prescribeDoctorId != null"> and prescribe_doctor_id = #{prescribeDoctorId}</if>
- <if test="source != null"> and source = #{source}</if>
- <if test="doctorConfirm != null"> and doctor_confirm = #{doctorConfirm}</if>
- <if test="isSendToThirdParty != null"> and is_send_to_third_party = #{isSendToThirdParty}</if>
- <if test="companyCustomerId != null"> and company_customer_id = #{companyCustomerId}</if>
- <!-- 按时间范围查询 -->
- <if test="params != null and beginTime != null and beginTime != ''">
- and create_time >= #{params.beginCreateTime}
- </if>
- <if test="params != null and endTime != null and endTime != ''">
- and create_time <= #{params.endCreateTime}
- </if>
- </where>
- order by create_time desc
- </select>
- <select id="waitOpenPrescribeList" resultType="com.fs.qw.vo.FsPrescribeDataScrmVO">
- select pds.* from fs_prescribe_data_scrm pds
- left join fs_company_customer fcc on pds.prescribe_id = fcc.prescribe_id
- <where>
- pds.doctor_id = #{doctorId}
- <if test="prescribeType != null"> and prescribe_type = #{prescribeType}</if>
- <if test="orderCode != null"> and order_code = #{orderCode}</if>
- <if test="prescribeCode != null and prescribeCode != ''"> and prescribe_code = #{prescribeCode}</if>
- <if test="patientName != null and patientName != ''"> and patient_name like concat('%', #{patientName}, '%')</if>
- <if test="doctorId != null"> and doctor_id = #{doctorId}</if>
- <if test="doctorConfirm != null"> and doctor_confirm = #{doctorConfirm}</if>
- </where>
- order by create_time desc
- </select>
- <select id="pendingStorePrescribeList" resultType="com.fs.qw.vo.FsPrescribeDataScrmVO">
- select pds.* from fs_prescribe_data_scrm pds
- left join fs_company_customer fcc on pds.prescribe_id = fcc.prescribe_id
- <where>
- pds.drug_doctor_id = #{drugDoctorId} and doctor_confirm = 1 <!--必须是医生开方通过的才能进入待药师审核 -->
- <if test="orderCode != null"> and order_code = #{orderCode}</if>
- <if test="prescribeCode != null and prescribeCode != ''"> and prescribe_code = #{prescribeCode}</if>
- <if test="patientName != null and patientName != ''"> and patient_name like concat('%', #{patientName}, '%')</if>
- <if test="status != null"> and status = #{status}</if>
- </where>
- order by create_time desc
- </select>
- <select id="selectFsPrescribeDataScrmImgVOByPrescribeId"
- resultType="com.fs.his.vo.FsPrescribeDataScrmImgVO">
- select fpds.*,
- doctor.doctor_name as doctorName,
- doctor.sign_url as doctorSign,
- doctor.practise_code as practiseCode,
- doctor.position as doctorPosition,
- doctor.certificate_code as certificateCode,
- drug_fd.doctor_name as drugDoctorName,
- drug_fd.sign_url as drugDoctorSign
- from fs_prescribe_data_scrm fpds
- left join fs_doctor doctor on fpds.doctor_id = doctor.doctor_id
- left join fs_doctor drug_fd on fpds.drug_doctor_id = drug_fd.doctor_id
- left join fs_patient fp on fpds.patient_id = fp.patient_id
- </select>
- <insert id="insertFsPrescribeDataScrm" parameterType="FsPrescribeDataScrm" useGeneratedKeys="true" keyProperty="prescribeId">
- insert into fs_prescribe_data_scrm
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="prescribeType != null">prescribe_type,</if>
- <if test="inquiryOrderId != null">inquiry_order_id,</if>
- <if test="orderCode != null">order_code,</if>
- <if test="storeOrderId != null">store_order_id,</if>
- <if test="userId != null">user_id,</if>
- <if test="patientId != null">patient_id,</if>
- <if test="prescribeCode != null">prescribe_code,</if>
- <if test="patientDescs != null">patient_descs,</if>
- <if test="nowIllness != null">now_illness,</if>
- <if test="historyIllness != null">history_illness,</if>
- <if test="patientAge != null">patient_age,</if>
- <if test="patientName != null">patient_name,</if>
- <if test="weight != null">weight,</if>
- <if test="isHistoryAllergic != null">is_history_allergic,</if>
- <if test="historyAllergic != null">history_allergic,</if>
- <if test="liverUnusual != null">liver_unusual,</if>
- <if test="renalUnusual != null">renal_unusual,</if>
- <if test="isLactation != null">is_lactation,</if>
- <if test="patientTel != null">patient_tel,</if>
- <if test="patientGender != null">patient_gender,</if>
- <if test="recordPic != null">record_pic,</if>
- <if test="prescribeImgUrl != null">prescribe_img_url,</if>
- <if test="prescribeImgStoreUrl != null">prescribe_img_store_url,</if>
- <if test="auditReason != null">audit_reason,</if>
- <if test="diagnose != null">diagnose,</if>
- <if test="doctorId != null">doctor_id,</if>
- <if test="drugDoctorId != null">drug_doctor_id,</if>
- <if test="createTime != null">create_time,</if>
- <if test="status != null">status,</if>
- <if test="auditTime != null">audit_time,</if>
- <if test="usageJson != null">usage_json,</if>
- <if test="remark != null">remark,</if>
- <if test="storeId != null">store_id,</if>
- <if test="prescribeDoctorId != null">prescribe_doctor_id,</if>
- <if test="doctorSignUrl != null">doctor_sign_url,</if>
- <if test="prescribeDoctorSignUrl != null">prescribe_doctor_sign_url,</if>
- <if test="drugDoctorSignUrl != null">drug_doctor_sign_url,</if>
- <if test="patientBirthday != null">patient_birthday,</if>
- <if test="recipeType != null">recipe_type,</if>
- <if test="prescribeCodeUrl != null">prescribe_code_url,</if>
- <if test="cycle != null">cycle,</if>
- <if test="icdCode != null">icd_code,</if>
- <if test="source != null">source,</if>
- <if test="doctorConfirm != null">doctor_confirm,</if>
- <if test="startOperateTime != null">start_operate_time,</if>
- <if test="endOperateTime != null">end_operate_time,</if>
- <if test="operateSecond != null">operate_second,</if>
- <if test="thirdPartyUserId != null">third_party_user_id,</if>
- <if test="isSendToThirdParty != null">is_send_to_third_party,</if>
- <if test="handwriteCollectionId != null">handwrite_collection_id,</if>
- <if test="companyCustomerId != null">company_customer_id,</if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="prescribeType != null">#{prescribeType},</if>
- <if test="inquiryOrderId != null">#{inquiryOrderId},</if>
- <if test="orderCode != null">#{orderCode},</if>
- <if test="storeOrderId != null">#{storeOrderId},</if>
- <if test="userId != null">#{userId},</if>
- <if test="patientId != null">#{patientId},</if>
- <if test="prescribeCode != null">#{prescribeCode},</if>
- <if test="patientDescs != null">#{patientDescs},</if>
- <if test="nowIllness != null">#{nowIllness},</if>
- <if test="historyIllness != null">#{historyIllness},</if>
- <if test="patientAge != null">#{patientAge},</if>
- <if test="patientName != null">#{patientName},</if>
- <if test="weight != null">#{weight},</if>
- <if test="isHistoryAllergic != null">#{isHistoryAllergic},</if>
- <if test="historyAllergic != null">#{historyAllergic},</if>
- <if test="liverUnusual != null">#{liverUnusual},</if>
- <if test="renalUnusual != null">#{renalUnusual},</if>
- <if test="isLactation != null">#{isLactation},</if>
- <if test="patientTel != null">#{patientTel},</if>
- <if test="patientGender != null">#{patientGender},</if>
- <if test="recordPic != null">#{recordPic},</if>
- <if test="prescribeImgUrl != null">#{prescribeImgUrl},</if>
- <if test="prescribeImgStoreUrl != null">#{prescribeImgStoreUrl},</if>
- <if test="auditReason != null">#{auditReason},</if>
- <if test="diagnose != null">#{diagnose},</if>
- <if test="doctorId != null">#{doctorId},</if>
- <if test="drugDoctorId != null">#{drugDoctorId},</if>
- <if test="createTime != null">#{createTime},</if>
- <if test="status != null">#{status},</if>
- <if test="auditTime != null">#{auditTime},</if>
- <if test="usageJson != null">#{usageJson},</if>
- <if test="remark != null">#{remark},</if>
- <if test="storeId != null">#{storeId},</if>
- <if test="prescribeDoctorId != null">#{prescribeDoctorId},</if>
- <if test="doctorSignUrl != null">#{doctorSignUrl},</if>
- <if test="prescribeDoctorSignUrl != null">#{prescribeDoctorSignUrl},</if>
- <if test="drugDoctorSignUrl != null">#{drugDoctorSignUrl},</if>
- <if test="patientBirthday != null">#{patientBirthday},</if>
- <if test="recipeType != null">#{recipeType},</if>
- <if test="prescribeCodeUrl != null">#{prescribeCodeUrl},</if>
- <if test="cycle != null">#{cycle},</if>
- <if test="icdCode != null">#{icdCode},</if>
- <if test="source != null">#{source},</if>
- <if test="doctorConfirm != null">#{doctorConfirm},</if>
- <if test="startOperateTime != null">#{startOperateTime},</if>
- <if test="endOperateTime != null">#{endOperateTime},</if>
- <if test="operateSecond != null">#{operateSecond},</if>
- <if test="thirdPartyUserId != null">#{thirdPartyUserId},</if>
- <if test="isSendToThirdParty != null">#{isSendToThirdParty},</if>
- <if test="handwriteCollectionId != null">#{handwriteCollectionId},</if>
- <if test="companyCustomerId != null">#{companyCustomerId},</if>
- </trim>
- </insert>
- <update id="updateFsPrescribeDataScrm" parameterType="FsPrescribeDataScrm">
- update fs_prescribe_data_scrm
- <trim prefix="SET" suffixOverrides=",">
- <if test="prescribeType != null">prescribe_type = #{prescribeType},</if>
- <if test="inquiryOrderId != null">inquiry_order_id = #{inquiryOrderId},</if>
- <if test="orderCode != null">order_code = #{orderCode},</if>
- <if test="storeOrderId != null">store_order_id = #{storeOrderId},</if>
- <if test="userId != null">user_id = #{userId},</if>
- <if test="patientId != null">patient_id = #{patientId},</if>
- <if test="prescribeCode != null">prescribe_code = #{prescribeCode},</if>
- <if test="patientDescs != null">patient_descs = #{patientDescs},</if>
- <if test="nowIllness != null">now_illness = #{nowIllness},</if>
- <if test="historyIllness != null">history_illness = #{historyIllness},</if>
- <if test="patientAge != null">patient_age = #{patientAge},</if>
- <if test="patientName != null">patient_name = #{patientName},</if>
- <if test="weight != null">weight = #{weight},</if>
- <if test="isHistoryAllergic != null">is_history_allergic = #{isHistoryAllergic},</if>
- <if test="historyAllergic != null">history_allergic = #{historyAllergic},</if>
- <if test="liverUnusual != null">liver_unusual = #{liverUnusual},</if>
- <if test="renalUnusual != null">renal_unusual = #{renalUnusual},</if>
- <if test="isLactation != null">is_lactation = #{isLactation},</if>
- <if test="patientTel != null">patient_tel = #{patientTel},</if>
- <if test="patientGender != null">patient_gender = #{patientGender},</if>
- <if test="recordPic != null">record_pic = #{recordPic},</if>
- <if test="prescribeImgUrl != null">prescribe_img_url = #{prescribeImgUrl},</if>
- <if test="prescribeImgStoreUrl != null">prescribe_img_store_url = #{prescribeImgStoreUrl},</if>
- <if test="auditReason != null">audit_reason = #{auditReason},</if>
- <if test="diagnose != null">diagnose = #{diagnose},</if>
- <if test="doctorId != null">doctor_id = #{doctorId},</if>
- <if test="drugDoctorId != null">drug_doctor_id = #{drugDoctorId},</if>
- <if test="createTime != null">create_time = #{createTime},</if>
- <if test="status != null">status = #{status},</if>
- <if test="auditTime != null">audit_time = #{auditTime},</if>
- <if test="usageJson != null">usage_json = #{usageJson},</if>
- <if test="remark != null">remark = #{remark},</if>
- <if test="storeId != null">store_id = #{storeId},</if>
- <if test="prescribeDoctorId != null">prescribe_doctor_id = #{prescribeDoctorId},</if>
- <if test="doctorSignUrl != null">doctor_sign_url = #{doctorSignUrl},</if>
- <if test="prescribeDoctorSignUrl != null">prescribe_doctor_sign_url = #{prescribeDoctorSignUrl},</if>
- <if test="drugDoctorSignUrl != null">drug_doctor_sign_url = #{drugDoctorSignUrl},</if>
- <if test="patientBirthday != null">patient_birthday = #{patientBirthday},</if>
- <if test="recipeType != null">recipe_type = #{recipeType},</if>
- <if test="prescribeCodeUrl != null">prescribe_code_url = #{prescribeCodeUrl},</if>
- <if test="cycle != null">cycle = #{cycle},</if>
- <if test="icdCode != null">icd_code = #{icdCode},</if>
- <if test="source != null">source = #{source},</if>
- <if test="doctorConfirm != null">doctor_confirm = #{doctorConfirm},</if>
- <if test="startOperateTime != null">start_operate_time = #{startOperateTime},</if>
- <if test="endOperateTime != null">end_operate_time = #{endOperateTime},</if>
- <if test="operateSecond != null">operate_second = #{operateSecond},</if>
- <if test="thirdPartyUserId != null">third_party_user_id = #{thirdPartyUserId},</if>
- <if test="isSendToThirdParty != null">is_send_to_third_party = #{isSendToThirdParty},</if>
- <if test="handwriteCollectionId != null">handwrite_collection_id = #{handwriteCollectionId},</if>
- <if test="companyCustomerId != null">company_customer_id = #{companyCustomerId},</if>
- </trim>
- where prescribe_id = #{prescribeId}
- </update>
- <delete id="deleteFsPrescribeDataScrmByPrescribeId" parameterType="Long">
- delete from fs_prescribe_data_scrm where prescribe_id = #{prescribeId}
- </delete>
- <delete id="deleteFsPrescribeDataScrmByPrescribeIds" parameterType="Long">
- delete from fs_prescribe_data_scrm where prescribe_id in
- <foreach collection="array" item="prescribeId" open="(" separator="," close=")">
- #{prescribeId}
- </foreach>
- </delete>
- <update id="clearPrescribeUrl">
- UPDATE fs_prescribe_data_scrm
- SET prescribe_img_url = NULL, prescribe_img_store_url = NULL
- WHERE prescribe_id = 1;
- </update>
- </mapper>
|