cgp пре 1 дан
родитељ
комит
ba605dab81

+ 86 - 0
fs-doctor-app/src/main/java/com/fs/app/controller/FsPrescribeDataScrmController.java

@@ -0,0 +1,86 @@
+package com.fs.app.controller;
+
+
+import com.fs.common.core.controller.BaseController;
+import com.fs.common.core.domain.AjaxResult;
+import com.fs.common.core.page.TableDataInfo;
+import com.fs.common.utils.poi.ExcelUtil;
+import com.fs.his.domain.FsPrescribeDataScrm;
+import com.fs.his.service.IFsPrescribeDataScrmService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+import java.util.List;
+
+/**
+ * 处方表(SCRM)Controller
+ *
+ * @author ruoyi
+ * @date 2026-06-11
+ */
+@RestController
+@RequestMapping("/his/prescribeDataScrm")
+public class FsPrescribeDataScrmController extends BaseController
+{
+    @Autowired
+    private IFsPrescribeDataScrmService fsPrescribeScrmService;
+
+    /**
+     * 查询处方表(SCRM)列表
+     */
+    @GetMapping("/list")
+    public TableDataInfo list(FsPrescribeDataScrm fsPrescribeDataScrm)
+    {
+        startPage();
+        List<FsPrescribeDataScrm> list = fsPrescribeScrmService.selectFsPrescribeDataScrmList(fsPrescribeDataScrm);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出处方表(SCRM)列表
+     */
+    @PostMapping("/export")
+    public void export(HttpServletResponse response, FsPrescribeDataScrm fsPrescribeDataScrm) throws IOException {
+        List<FsPrescribeDataScrm> list = fsPrescribeScrmService.selectFsPrescribeDataScrmList(fsPrescribeDataScrm);
+        ExcelUtil<FsPrescribeDataScrm> util = new ExcelUtil<FsPrescribeDataScrm>(FsPrescribeDataScrm.class);
+        util.exportExcel(response, list, "处方表(SCRM)数据");
+    }
+
+    /**
+     * 获取处方表(SCRM)详细信息
+     */
+    @GetMapping(value = "/{prescribeId}")
+    public AjaxResult getInfo(@PathVariable("prescribeId") Long prescribeId)
+    {
+        return AjaxResult.success(fsPrescribeScrmService.selectFsPrescribeDataScrmByPrescribeId(prescribeId));
+    }
+
+    /**
+     * 新增处方表(SCRM)
+     */
+    @PostMapping
+    public AjaxResult add(@RequestBody FsPrescribeDataScrm fsPrescribeDataScrm)
+    {
+        return toAjax(fsPrescribeScrmService.insertFsPrescribeDataScrm(fsPrescribeDataScrm));
+    }
+
+    /**
+     * 修改处方表(SCRM)
+     */
+    @PutMapping
+    public AjaxResult edit(@RequestBody FsPrescribeDataScrm fsPrescribeDataScrm)
+    {
+        return toAjax(fsPrescribeScrmService.updateFsPrescribeDataScrm(fsPrescribeDataScrm));
+    }
+
+    /**
+     * 删除处方表(SCRM)
+     */
+    @DeleteMapping("/{prescribeIds}")
+    public AjaxResult remove(@PathVariable Long[] prescribeIds)
+    {
+        return toAjax(fsPrescribeScrmService.deleteFsPrescribeDataScrmByPrescribeIds(prescribeIds));
+    }
+}

+ 180 - 0
fs-service/src/main/java/com/fs/his/domain/FsPrescribeDataScrm.java

@@ -0,0 +1,180 @@
+package com.fs.his.domain;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.fs.common.core.domain.BaseEntity;
+import lombok.Data;
+
+import java.util.Date;
+
+/**
+ * 处方表(SCRM)对象 fs_prescribe_scrm
+ *
+ * @author ruoyi
+ * @date 2026-06-11
+ */
+
+@Data
+public class FsPrescribeDataScrm extends BaseEntity
+{
+    private static final long serialVersionUID = 1L;
+
+    /** id */
+    private Long prescribeId;
+
+    /** 处方类型 1西药 2中药 */
+    private Integer prescribeType;
+
+    /** 订单ID */
+    private Long inquiryOrderId;
+
+    /** 订单编号 */
+    private Long orderCode;
+
+    /** 店铺订单ID */
+    private Long storeOrderId;
+
+    /** 用户ID */
+    private Long userId;
+
+    /** 患者ID */
+    private Long patientId;
+
+    /** 处⽅单ID(唯⼀ID) */
+    private String prescribeCode;
+
+    /** 患者描述 */
+    private String patientDescs;
+
+    /** 现病史 */
+    private String nowIllness;
+
+    /** 既往史 */
+    private String historyIllness;
+
+    /** 患者年龄 */
+    private String patientAge;
+
+    /** 患者姓名 */
+    private String patientName;
+
+    /** 体重 */
+    private String weight;
+
+    /** 是否有过敏史(传值:是/否) */
+    private String isHistoryAllergic;
+
+    /** 过敏史 */
+    private String historyAllergic;
+
+    /** 肝功能是否异常(传值:是/否) */
+    private String liverUnusual;
+
+    /** 肾功能是否异常(传值:是/否) */
+    private String renalUnusual;
+
+    /** 是否是备孕/怀孕/哺乳期(传值:是 */
+    private String isLactation;
+
+    /** 患者电话 */
+    private String patientTel;
+
+    /** 患者性别(传数字,1男 0⼥) */
+    private Integer patientGender;
+
+    /** 复诊凭证 */
+    private String recordPic;
+
+    /** 处方图片地址 */
+    private String prescribeImgUrl;
+
+    /** 处方图片存储地址 */
+    private String prescribeImgStoreUrl;
+
+    /** 拒绝原因 */
+    private String auditReason;
+
+    /** 诊断 */
+    private String diagnose;
+
+    /** 医生ID */
+    private Long doctorId;
+
+    /** 药师ID */
+    private Long drugDoctorId;
+
+    /** 创建时间 */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    private Date createTime;
+
+    /** 状态 0待药师审核 1审核通过 2药师审核不通过 */
+    private Integer status;
+
+    /** 审核时间 */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    private Date auditTime;
+
+    /** 使用JSON */
+    private String usageJson;
+
+    /** 备注 */
+    private String remark;
+
+    /** 店铺ID */
+    private Long storeId;
+
+    /** 处方医生id */
+    private Long prescribeDoctorId;
+
+    /** 医生签名 */
+    private String doctorSignUrl;
+
+    /** 处方医生签名 */
+    private String prescribeDoctorSignUrl;
+
+    /** 药师签名 */
+    private String drugDoctorSignUrl;
+
+    /** 患者生日 */
+    private String patientBirthday;
+
+    /** 制作类型 0-颗粒剂 1-膏方 */
+    private Integer recipeType;
+
+    /** 二维码图片 */
+    private String prescribeCodeUrl;
+
+    /** 用药周期 */
+    private Integer cycle;
+
+    /** icd_code */
+    private String icdCode;
+
+    /** 订单来源 */
+    private Integer source;
+
+    /** 医生是否确认 0未确认 1已确认 -1医生拒方 */
+    private Integer doctorConfirm;
+
+    /** 医生开始操作时间(益寿缘从医生建议开始算) */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    private Date startOperateTime;
+
+    /** 医生结束操作时间(医生第一次确认处方算) */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    private Date endOperateTime;
+
+    /** 医生操作秒数 */
+    private Long operateSecond;
+
+    /** 第三方用户id */
+    private Long thirdPartyUserId;
+
+    /** 是否推送给第三方(0:未推送,1:已推送) */
+    private Integer isSendToThirdParty;
+
+    /** 手写信息采集主键id */
+    private Long handwriteCollectionId;
+
+    /** 客户信息表id */
+    private Long companyCustomerId;
+}

+ 61 - 0
fs-service/src/main/java/com/fs/his/mapper/FsPrescribeDataScrmMapper.java

@@ -0,0 +1,61 @@
+package com.fs.his.mapper;
+
+import com.fs.his.domain.FsPrescribeDataScrm;
+import java.util.List;
+
+/**
+ * 处方表(SCRM)Mapper接口
+ *
+ * @author ruoyi
+ * @date 2026-06-11
+ */
+public interface FsPrescribeDataScrmMapper
+{
+    /**
+     * 查询处方表(SCRM)
+     *
+     * @param prescribeId 处方表(SCRM)主键
+     * @return 处方表(SCRM)
+     */
+    public FsPrescribeDataScrm selectFsPrescribeDataScrmByPrescribeId(Long prescribeId);
+
+    /**
+     * 查询处方表(SCRM)列表
+     *
+     * @param fsPrescribeDataScrm 处方表(SCRM)
+     * @return 处方表(SCRM)集合
+     */
+    public List<FsPrescribeDataScrm> selectFsPrescribeDataScrmList(FsPrescribeDataScrm fsPrescribeDataScrm);
+
+    /**
+     * 新增处方表(SCRM)
+     *
+     * @param fsPrescribeDataScrm 处方表(SCRM)
+     * @return 结果
+     */
+    public int insertFsPrescribeDataScrm(FsPrescribeDataScrm fsPrescribeDataScrm);
+
+    /**
+     * 修改处方表(SCRM)
+     *
+     * @param fsPrescribeDataScrm 处方表(SCRM)
+     * @return 结果
+     */
+    public int updateFsPrescribeDataScrm(FsPrescribeDataScrm fsPrescribeDataScrm);
+
+    /**
+     * 删除处方表(SCRM)
+     *
+     * @param prescribeId 处方表(SCRM)主键
+     * @return 结果
+     */
+    public int deleteFsPrescribeDataScrmByPrescribeId(Long prescribeId);
+
+    /**
+     * 批量删除处方表(SCRM)
+     *
+     * @param prescribeIds 需要删除的数据主键集合
+     * @return 结果
+     */
+    public int deleteFsPrescribeDataScrmByPrescribeIds(Long[] prescribeIds);
+}

+ 61 - 0
fs-service/src/main/java/com/fs/his/service/IFsPrescribeDataScrmService.java

@@ -0,0 +1,61 @@
+package com.fs.his.service;
+
+import com.fs.his.domain.FsPrescribeDataScrm;
+import java.util.List;
+
+/**
+ * 处方表(SCRM)Service接口
+ *
+ * @author ruoyi
+ * @date 2026-06-11
+ */
+public interface IFsPrescribeDataScrmService
+{
+    /**
+     * 查询处方表(SCRM)
+     *
+     * @param prescribeId 处方表(SCRM)主键
+     * @return 处方表(SCRM)
+     */
+    public FsPrescribeDataScrm selectFsPrescribeDataScrmByPrescribeId(Long prescribeId);
+
+    /**
+     * 查询处方表(SCRM)列表
+     *
+     * @param fsPrescribeDataScrm 处方表(SCRM)
+     * @return 处方表(SCRM)集合
+     */
+    public List<FsPrescribeDataScrm> selectFsPrescribeDataScrmList(FsPrescribeDataScrm fsPrescribeDataScrm);
+
+    /**
+     * 新增处方表(SCRM)
+     *
+     * @param fsPrescribeDataScrm 处方表(SCRM)
+     * @return 结果
+     */
+    public int insertFsPrescribeDataScrm(FsPrescribeDataScrm fsPrescribeDataScrm);
+
+    /**
+     * 修改处方表(SCRM)
+     *
+     * @param fsPrescribeDataScrm 处方表(SCRM)
+     * @return 结果
+     */
+    public int updateFsPrescribeDataScrm(FsPrescribeDataScrm fsPrescribeDataScrm);
+
+    /**
+     * 批量删除处方表(SCRM)
+     *
+     * @param prescribeIds 需要删除的处方表(SCRM)主键集合
+     * @return 结果
+     */
+    public int deleteFsPrescribeDataScrmByPrescribeIds(Long[] prescribeIds);
+
+    /**
+     * 删除处方表(SCRM)信息
+     *
+     * @param prescribeId 处方表(SCRM)主键
+     * @return 结果
+     */
+    public int deleteFsPrescribeDataScrmByPrescribeId(Long prescribeId);
+}

+ 95 - 0
fs-service/src/main/java/com/fs/his/service/impl/FsPrescribeDataScrmServiceImpl.java

@@ -0,0 +1,95 @@
+package com.fs.his.service.impl;
+
+import com.fs.common.utils.DateUtils;
+import com.fs.his.domain.FsPrescribeDataScrm;
+import com.fs.his.mapper.FsPrescribeDataScrmMapper;
+import com.fs.his.service.IFsPrescribeDataScrmService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import java.util.List;
+
+/**
+ * 处方表(SCRM)Service业务层处理
+ *
+ * @author ruoyi
+ * @date 2026-06-11
+ */
+@Service
+public class FsPrescribeDataScrmServiceImpl implements IFsPrescribeDataScrmService
+{
+    @Autowired
+    private FsPrescribeDataScrmMapper fsPrescribeDataScrmMapper;
+
+    /**
+     * 查询处方表(SCRM)
+     *
+     * @param prescribeId 处方表(SCRM)主键
+     * @return 处方表(SCRM)
+     */
+    @Override
+    public FsPrescribeDataScrm selectFsPrescribeDataScrmByPrescribeId(Long prescribeId)
+    {
+        return fsPrescribeDataScrmMapper.selectFsPrescribeDataScrmByPrescribeId(prescribeId);
+    }
+
+    /**
+     * 查询处方表(SCRM)列表
+     *
+     * @param fsPrescribeDataScrm 处方表(SCRM)
+     * @return 处方表(SCRM)
+     */
+    @Override
+    public List<FsPrescribeDataScrm> selectFsPrescribeDataScrmList(FsPrescribeDataScrm fsPrescribeDataScrm)
+    {
+        return fsPrescribeDataScrmMapper.selectFsPrescribeDataScrmList(fsPrescribeDataScrm);
+    }
+
+    /**
+     * 新增处方表(SCRM)
+     *
+     * @param fsPrescribeDataScrm 处方表(SCRM)
+     * @return 结果
+     */
+    @Override
+    public int insertFsPrescribeDataScrm(FsPrescribeDataScrm fsPrescribeDataScrm)
+    {
+        fsPrescribeDataScrm.setCreateTime(DateUtils.getNowDate());
+        return fsPrescribeDataScrmMapper.insertFsPrescribeDataScrm(fsPrescribeDataScrm);
+    }
+
+    /**
+     * 修改处方表(SCRM)
+     *
+     * @param fsPrescribeDataScrm 处方表(SCRM)
+     * @return 结果
+     */
+    @Override
+    public int updateFsPrescribeDataScrm(FsPrescribeDataScrm fsPrescribeDataScrm)
+    {
+        return fsPrescribeDataScrmMapper.updateFsPrescribeDataScrm(fsPrescribeDataScrm);
+    }
+
+    /**
+     * 批量删除处方表(SCRM)
+     *
+     * @param prescribeIds 需要删除的处方表(SCRM)主键
+     * @return 结果
+     */
+    @Override
+    public int deleteFsPrescribeDataScrmByPrescribeIds(Long[] prescribeIds)
+    {
+        return fsPrescribeDataScrmMapper.deleteFsPrescribeDataScrmByPrescribeIds(prescribeIds);
+    }
+
+    /**
+     * 删除处方表(SCRM)信息
+     *
+     * @param prescribeId 处方表(SCRM)主键
+     * @return 结果
+     */
+    @Override
+    public int deleteFsPrescribeDataScrmByPrescribeId(Long prescribeId)
+    {
+        return fsPrescribeDataScrmMapper.deleteFsPrescribeDataScrmByPrescribeId(prescribeId);
+    }
+}

+ 296 - 0
fs-service/src/main/resources/mapper/his/FsPrescribeDataScrmMapper.xml

@@ -0,0 +1,296 @@
+<?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_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 &lt;= #{params.endCreateTime}
+            </if>
+        </where>
+        order by create_time desc
+    </select>
+
+    <insert id="insertFsPrescribeDataScrm" parameterType="FsPrescribeDataScrm" useGeneratedKeys="true" keyProperty="prescribeId">
+        insert into fs_prescribe_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_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_scrm where prescribe_id = #{prescribeId}
+    </delete>
+
+    <delete id="deleteFsPrescribeDataScrmByPrescribeIds" parameterType="Long">
+        delete from fs_prescribe_scrm where prescribe_id in
+        <foreach collection="array" item="prescribeId" open="(" separator="," close=")">
+            #{prescribeId}
+        </foreach>
+    </delete>
+</mapper>