فهرست منبع

门急诊费用转入

xiaochan 5 ماه پیش
والد
کامیت
fbec512529

+ 13 - 2
src/main/java/thyyxxk/webserver/controller/inpatient/TransferInOfExpensesController.java

@@ -6,6 +6,7 @@ import thyyxxk.webserver.entity.datamodify.GetDropdownBox;
 import thyyxxk.webserver.entity.datamodify.MzChargeDetail;
 import thyyxxk.webserver.entity.datamodify.ZyDetailCharge;
 import thyyxxk.webserver.entity.inpatient.ZyActpatient;
+import thyyxxk.webserver.entity.transferInOfExpenses.data.CorrectInvoice;
 import thyyxxk.webserver.service.inpatient.TransferInOfExpensesService;
 
 import java.util.List;
@@ -35,8 +36,8 @@ public class TransferInOfExpensesController {
     }
 
     @GetMapping("/getSerialNo")
-    public ResultVo<List<MzChargeDetail>> getSerialNo(Integer serialNo, Integer liShiFlag) {
-        return service.getSerialNo(serialNo, liShiFlag);
+    public ResultVo<List<MzChargeDetail>> getSerialNo(Integer serialNo) {
+        return service.getSerialNo(serialNo);
     }
 
     @GetMapping("/getZyJiMenZhenZhuangRuFeiYong")
@@ -63,4 +64,14 @@ public class TransferInOfExpensesController {
         return service.queryEntryName(pyCode);
     }
 
+    @PostMapping("/correctInvoice")
+    public ResultVo<String> correctInvoice(@RequestBody CorrectInvoice.CorrectInvoiceReq param) {
+        return service.correctInvoice(param);
+    }
+
+    @GetMapping("/getDzfpQrcodeBySerialNo")
+    public ResultVo<String> getDzfpQrcodeBySerialNo(@RequestParam("serialNo") Integer serialNo) {
+        return service.getDzfpQrcodeBySerialNo(serialNo);
+    }
+
 }

+ 14 - 0
src/main/java/thyyxxk/webserver/dao/his/inpatient/TransferInOfExpensesDao.java

@@ -7,6 +7,7 @@ import thyyxxk.webserver.entity.datamodify.MzChargeDetail;
 import thyyxxk.webserver.entity.datamodify.ZyDetailCharge;
 import thyyxxk.webserver.entity.inpatient.ZyActpatient;
 import thyyxxk.webserver.entity.medicalinsurance.inpatient.ZyPatientInfo;
+import thyyxxk.webserver.entity.transferInOfExpenses.data.CorrectInvoice;
 
 import java.util.List;
 
@@ -129,6 +130,11 @@ public interface TransferInOfExpensesDao {
                                      @Param("tableName") String tableName,
                                      @Param("serialNo") Integer serialNo);
 
+    @Select("select rtrim(patient_id) patient_id, times, receipt_no, serial_no from mz_receipt_serial " +
+            " where receipt_sn = #{serialNo} " +
+            "group by patient_id, times, receipt_no, serial_no")
+    CorrectInvoice getSerialNoByInvoiceNo(@Param("serialNo") Integer serialNo);
+
     /**
      * 分页获取这个病人是通过急门诊转入的费用   如果确实插入了数据但是没有看到 那就是他们没有维护好两个字典表
      *
@@ -242,4 +248,12 @@ public interface TransferInOfExpensesDao {
             "select code,rtrim(name)name from yp_zd_dict where py_code like #{pyCode} or code like #{pyCode} " +
             ") temp")
     List<GetDropdownBox> queryEntryName(@Param("pyCode") String pyCode);
+
+
+    @Select("select qrcode\n" +
+            "from mz_dzfp_upload\n" +
+            "where patient_id = '${patientId}'\n" +
+            "  and times = ${times}\n" +
+            "  and receipt_no = ${receiptNo} and type_flag = 5 and del_flag = 0")
+    CorrectInvoice.DzcfVo getMzDzcfUpload(CorrectInvoice params);
 }

+ 16 - 22
src/main/java/thyyxxk/webserver/dao/his/zhuyuanyisheng/YiZhuLuRuDao.java

@@ -2,6 +2,7 @@ package thyyxxk.webserver.dao.his.zhuyuanyisheng;
 
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.Wrapper;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.toolkit.Constants;
 import org.apache.ibatis.annotations.*;
 import thyyxxk.webserver.entity.datamodify.GetDropdownBox;
@@ -19,6 +20,7 @@ import thyyxxk.webserver.entity.zhuyuanyisheng.ZyOrderZk;
 import thyyxxk.webserver.entity.zhuyuanyisheng.dto.doctorAuth.DoctorAuthParams;
 import thyyxxk.webserver.entity.zhuyuanyisheng.vo.doctorAuth.DoctorAuthRest;
 import thyyxxk.webserver.entity.zhuyuanyisheng.yizhuluru.*;
+import thyyxxk.webserver.utils.WrapperUtils;
 
 import java.math.BigDecimal;
 import java.util.ArrayList;
@@ -113,9 +115,10 @@ public interface YiZhuLuRuDao {
                                 @Param("admissTimes") Integer admissTimes,
                                 @Param("ledgerSn") Integer ledgerSn);
 
-    default List<XinZhenYzActOrder> selectOrderNo(@Param(Constants.WRAPPER) Wrapper<?> wq) {
-        List<XinZhenYzActOrder> xinZhenYzActOrders = this.selectOrderNoByOld(wq);
-        List<XinZhenYzActOrder> xinZhenYzActOrders1 = this.selectOrderNoByNew(wq);
+    default List<XinZhenYzActOrder> selectOrderNo(@Param(Constants.WRAPPER) QueryWrapper<?> wq) {
+        String fullSql = WrapperUtils.getFullSql(wq);
+        List<XinZhenYzActOrder> xinZhenYzActOrders = this.selectOrderNoByOld(fullSql);
+        List<XinZhenYzActOrder> xinZhenYzActOrders1 = this.selectOrderNoByNew(fullSql);
         List<XinZhenYzActOrder> result = new ArrayList<>();
         result.addAll(xinZhenYzActOrders1);
         result.addAll(xinZhenYzActOrders);
@@ -125,9 +128,6 @@ public interface YiZhuLuRuDao {
 
     @Select("select                     cast(a.act_order_no as decimal) as act_order_no, " +
             "                           cast(cast(a.act_order_no as decimal) as varchar) id, " +
-            "    newOrderFlag         = (select count(*) " +
-            "                            from new_act_order_recording " +
-            "                            where new_act_order_recording.act_order_no = a.act_order_no), " +
             "                           order_code, " +
             "                           order_name, " +
             "                           rtrim(frequ_code)                                frequ_code, " +
@@ -233,21 +233,18 @@ public interface YiZhuLuRuDao {
             "                           kss.yyfs, " +
             "                           kss.ssqk, " +
             "                           kss.yysj, " +
-            "    executer1            = (select name from a_employee_mi where code = executer1), " +
-            "    executer2=             (select name from a_employee_mi where code = executer2)," +
+            "    executer1            = (select name from a_employee_mi with (NOLOCK) where code = executer1), " +
+            "    executer2=             (select name from a_employee_mi with (NOLOCK) where code = executer2)," +
             "    superiorDoctor = (select rtrim(authorized_doctor) from new_act_order_recording na where na.act_order_no = a.act_order_no) " +
             "from view_xc_all_yz a  with (NOLOCK) left join " +
             "zy_order_zk b with (NOLOCK) on (a.act_order_no = b.act_order_no) left join " +
             "yz_act_record_kss kss on (a.act_order_no = kss.act_order_no) " +
-            "where 1=1  and status_flag = '1' and  ${ew.sqlSegment} ")
-    List<XinZhenYzActOrder> selectOrderNoByNew(@Param(Constants.WRAPPER) Wrapper<?> wq);
+            "where status_flag = '1' and  ${sql} ")
+    List<XinZhenYzActOrder> selectOrderNoByNew(String sql);
 
 
     @Select("select                     cast(a.act_order_no as decimal)               as act_order_no,\n" +
             "                           cast(cast(a.act_order_no as decimal) as varchar) id,\n" +
-            "    newOrderFlag         = (select count(*)\n" +
-            "                            from new_act_order_recording\n" +
-            "                            where new_act_order_recording.act_order_no = a.act_order_no),\n" +
             "                           order_code,\n" +
             "                           order_name,\n" +
             "                           rtrim(frequ_code)                                frequ_code,\n" +
@@ -351,17 +348,14 @@ public interface YiZhuLuRuDao {
             "                            where code = modifier) /*停止人*/,\n" +
             "                           end_time /*停止时间*/,\n" +
             "    executer1            = (select name\n" +
-            "                            from a_employee_mi\n" +
+            "                            from a_employee_mi with (NOLOCK) \n" +
             "                            where code = executer1),\n" +
             "    executer2=             (select name\n" +
-            "                            from a_employee_mi\n" +
-            "                            where code = executer2),\n" +
-            "    superiorDoctor       = (select rtrim(authorized_doctor)\n" +
-            "                            from new_act_order_recording na\n" +
-            "                            where na.act_order_no = a.act_order_no)\n" +
-            "from yz_act_order a with (NOLOCK)\n" +
-            "where 1=1  and status_flag <> '1' and ${ew.sqlSegment} ;")
-    List<XinZhenYzActOrder> selectOrderNoByOld(@Param(Constants.WRAPPER) Wrapper<?> wq);
+            "                            from a_employee_mi with (NOLOCK)\n" +
+            "                            where code = executer2)\n" +
+            "from view_xc_all_yz a with (NOLOCK)\n" +
+            "where status_flag <> '1' and ${sql} ;")
+    List<XinZhenYzActOrder> selectOrderNoByOld(String sql);
 
 
     @Select("select act_order_no, " +

+ 8 - 1
src/main/java/thyyxxk/webserver/entity/inpatient/ZyActpatient.java

@@ -8,6 +8,7 @@ import org.springframework.format.annotation.DateTimeFormat;
 import thyyxxk.webserver.entity.datamodify.MzChargeDetail;
 import thyyxxk.webserver.entity.datamodify.ZyDetailCharge;
 import thyyxxk.webserver.entity.inpatient.charge.ZyDepositFile;
+import thyyxxk.webserver.entity.transferInOfExpenses.data.CorrectInvoice;
 
 import java.io.Serializable;
 import java.math.BigDecimal;
@@ -882,7 +883,6 @@ public class ZyActpatient implements Serializable {
     private BigDecimal ztYjjHj;
 
 
-
     //非数据库字段 控制发票打印标志,只是页面做显示,不更新
     private Integer printFlag;
     //住院缴费记录
@@ -898,6 +898,13 @@ public class ZyActpatient implements Serializable {
      */
     private List<WeiGuiFeiYongFenXi> weiPiPei;
 
+    /**
+     * 机制号
+     * 这个实体类只在急诊费用转入中有效,
+     * 用来冲正发票,是mz_receipt_serial表中的字段
+     */
+    private Integer serialNo;
+
 
     public String getSexName() {
         if (this.sex == null) {

+ 65 - 0
src/main/java/thyyxxk/webserver/entity/transferInOfExpenses/data/CorrectInvoice.java

@@ -0,0 +1,65 @@
+package thyyxxk.webserver.entity.transferInOfExpenses.data;
+
+import lombok.AllArgsConstructor;
+import lombok.Builder;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import javax.validation.constraints.NotNull;
+import java.util.List;
+
+@Data
+@Builder
+@AllArgsConstructor
+@NoArgsConstructor
+public class CorrectInvoice {
+
+    @NotNull(message = "患者门诊号不能为空")
+    private String patientId;
+
+    @NotNull(message = "就诊次数不能为空")
+    private Integer times;
+
+    /**
+     * 在 mz_receipt_serial 里面的 receipt_no 这个字段
+     */
+    private Integer receiptNo;
+
+    /**
+     * 部分开票 = 5
+     * 部分冲红 = 6
+     * chargeItemCodes 空传 5
+     */
+    private Integer typeFlag = 5;
+
+    /**
+     * 操作人
+     */
+    private String opId;
+
+    /**
+     * 不需要冲正的项目编码,也就是需要录入的项目编码
+     * 如果传的是 6 的话,就是需要冲正的编码
+     */
+    private List<String> chargeItemCodes;
+
+    @Data
+    public static class CorrectInvoiceReq {
+
+        /**
+         * 机制号
+         */
+        private Integer serialNo;
+
+        /**
+         * 需要冲正的项目编码
+         */
+        private List<String> codes;
+    }
+
+    @Data
+    public static class DzcfVo {
+        private String qrCode;
+        private String patientId;
+    }
+}

+ 0 - 2
src/main/java/thyyxxk/webserver/service/hutoolcache/UserCache.java

@@ -5,11 +5,9 @@ import cn.hutool.cache.CacheUtil;
 import cn.hutool.core.util.StrUtil;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import lombok.RequiredArgsConstructor;
-import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import thyyxxk.webserver.dao.his.hutoolcache.HutoolCacheDao;
 import thyyxxk.webserver.entity.login.UserInfo;
-import thyyxxk.webserver.service.PublicServer;
 import thyyxxk.webserver.utils.ListUtil;
 import thyyxxk.webserver.utils.TokenUtil;
 

+ 58 - 21
src/main/java/thyyxxk/webserver/service/inpatient/TransferInOfExpensesService.java

@@ -3,8 +3,9 @@ package thyyxxk.webserver.service.inpatient;
 import com.alibaba.fastjson.JSON;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import lombok.RequiredArgsConstructor;
 import lombok.extern.slf4j.Slf4j;
-import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Service;
 import thyyxxk.webserver.config.exception.ExceptionEnum;
 import thyyxxk.webserver.constants.Capacity;
@@ -16,10 +17,9 @@ import thyyxxk.webserver.entity.datamodify.MzChargeDetail;
 import thyyxxk.webserver.entity.datamodify.ZyDetailCharge;
 import thyyxxk.webserver.entity.inpatient.ZyActpatient;
 import thyyxxk.webserver.entity.medicalinsurance.inpatient.ZyPatientInfo;
+import thyyxxk.webserver.entity.transferInOfExpenses.data.CorrectInvoice;
 import thyyxxk.webserver.service.PublicServer;
-import thyyxxk.webserver.utils.DateUtil;
-import thyyxxk.webserver.utils.ResultVoUtil;
-import thyyxxk.webserver.utils.TokenUtil;
+import thyyxxk.webserver.utils.*;
 
 import java.math.BigDecimal;
 import java.util.HashMap;
@@ -36,16 +36,16 @@ import java.util.Map;
  */
 @Service
 @Slf4j
+@RequiredArgsConstructor
 public class TransferInOfExpensesService {
 
     private final TransferInOfExpensesDao dao;
     private final PublicServer publicServer;
+    private final RestTemplateUtils template;
+
+    @Value("${thmz-api-url}")
+    private String thmzApiUrl;
 
-    @Autowired
-    public TransferInOfExpensesService(TransferInOfExpensesDao dao, PublicServer publicServer) {
-        this.dao = dao;
-        this.publicServer = publicServer;
-    }
 
     /**
      * 查询再远患者信息
@@ -65,18 +65,12 @@ public class TransferInOfExpensesService {
     /**
      * 通过机制号来查找信息
      *
-     * @param serialNo  机制号
-     * @param liShiFlag 是否查看历史 0:不查看 1:查看
+     * @param serialNo 机制号
      * @return 返回信息
      */
-    public ResultVo<List<MzChargeDetail>> getSerialNo(Integer serialNo, Integer liShiFlag) {
-        List<MzChargeDetail> list;
-        if (liShiFlag == 0) {
-            list = dao.getSerialNo("mz_charge_detail", "mz_receipt_serial", serialNo);
-        } else {
-            list = dao.getSerialNo("mz_charge_detail_b", "mz_receipt_serial_b", serialNo);
-        }
-        if (list.size() > 0) {
+    public ResultVo<List<MzChargeDetail>> getSerialNo(Integer serialNo) {
+        List<MzChargeDetail> list = dao.getSerialNo("mz_charge_detail", "mz_receipt_serial", serialNo);
+        if (!list.isEmpty()) {
             return ResultVoUtil.success(list);
         } else {
             return ResultVoUtil.fail(ExceptionEnum.NO_DATA_EXIST);
@@ -98,7 +92,7 @@ public class TransferInOfExpensesService {
         List<ZyDetailCharge> list = dao.getZyJiMenZhenZhuangRuFeiYong(page, inpatientNo, chargeCodeMX, admissTimes, ledgerSn);
         List<ZyDetailCharge> sumList = dao.sumZyFee(inpatientNo, chargeCodeMX, admissTimes, ledgerSn);
         Map<String, Object> map = new HashMap<>(Capacity.TWO);
-        if (page.getTotal() > 0 || list.size() > 0) {
+        if (page.getTotal() > 0 || !list.isEmpty()) {
             BigDecimal sum = new BigDecimal(0);
             for (ZyDetailCharge zyDetailCharge : sumList) {
                 sum = sum.add(zyDetailCharge.getChargeFee().multiply(zyDetailCharge.getChargeAmount()));
@@ -130,6 +124,9 @@ public class TransferInOfExpensesService {
      * @return 返回通知
      */
     public ResultVo<String> baoCunHuanZheZhuYuanFeiYong(ZyActpatient param) {
+        if (param.getSerialNo() == null) {
+            return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "刷新页面机制号为空");
+        }
         param.setStaffId(TokenUtil.getInstance().getTokenUserId());
         List<MzChargeDetail> list = param.getList();
         //查询流水号
@@ -147,7 +144,6 @@ public class TransferInOfExpensesService {
                 return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "费用发生时间不能大于出院时间,患者出院时间为:" + DateUtil.formatDatetime(param.getDisDate()));
             }
         }
-
         // 流水号取出这个患者流水值的最大值 在加 1
         // 同时计算 出患者的总金额 以及 费用的类型
         list.removeIf(item -> "BILL99".equals(item.getChargeCodeMx()));
@@ -162,6 +158,46 @@ public class TransferInOfExpensesService {
         return ResultVoUtil.success(ExceptionEnum.SUCCESS_AND_EL_MESSAGE, "操作成功。");
     }
 
+
+    public ResultVo<String> correctInvoice(CorrectInvoice.CorrectInvoiceReq param) {
+        CorrectInvoice correctInvoice = dao.getSerialNoByInvoiceNo(param.getSerialNo());
+        if (correctInvoice == null) {
+            return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "没有找到该发票号");
+        }
+
+        String url = thmzApiUrl + "/uploadPartMzInvoice";
+        correctInvoice.setOpId(TokenUtil.getInstance().getTokenUserId());
+        param.getCodes().replaceAll(String::trim);
+        correctInvoice.setChargeItemCodes(param.getCodes());
+
+        ResultVo<String> resultVo = template.post(url, correctInvoice, String.class, "门诊部分开票");
+        if (resultVo == null) {
+            return R.fail(ExceptionEnum.LOGICAL_ERROR, "调用接口错误,请联系管理员。");
+        }
+        if (resultVo.getCode().equals(0)) {
+            return R.ok(resultVo.getData());
+        }
+        return R.fail(ExceptionEnum.LOGICAL_ERROR, resultVo.getMessage());
+    }
+
+    public ResultVo<String> getDzfpQrcodeBySerialNo(Integer serialNo) {
+        CorrectInvoice correctInvoice = dao.getSerialNoByInvoiceNo(serialNo);
+        return getDzfpQrcodeByCorrectInvoice(correctInvoice);
+    }
+
+    public ResultVo<String> getDzfpQrcodeByCorrectInvoice(CorrectInvoice correctInvoice) {
+        if (correctInvoice == null) {
+            return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "没有找到该发票号");
+        }
+        // 查询是否已经冲正了,如果冲正了就直接用冲正的东西
+        CorrectInvoice.DzcfVo mzDzcfUpload = dao.getMzDzcfUpload(correctInvoice);
+        if (mzDzcfUpload != null) {
+            return R.ok(mzDzcfUpload.getQrCode());
+        }
+        return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "没有找到电子发票");
+    }
+
+
     /**
      * 远程搜索 项目名称
      *
@@ -171,4 +207,5 @@ public class TransferInOfExpensesService {
     public ResultVo<List<GetDropdownBox>> queryEntryName(String pyCode) {
         return ResultVoUtil.success(dao.queryEntryName("%" + pyCode.toUpperCase() + "%"));
     }
+
 }

+ 4 - 1
src/main/java/thyyxxk/webserver/service/zhuyuanyisheng/YiZhuLuRuServer.java

@@ -49,6 +49,8 @@ import thyyxxk.webserver.service.zhuyuanyisheng.yizhuverify.YiZhuCheckData;
 import thyyxxk.webserver.utils.*;
 
 import java.math.BigDecimal;
+import java.time.Duration;
+import java.time.Instant;
 import java.util.*;
 import java.util.stream.Collectors;
 
@@ -92,7 +94,8 @@ public class YiZhuLuRuServer {
      * @return 返回医嘱数据
      */
     public ResultVo<List<XinZhenYzActOrder>> huoQuYiZhuShuJu(YiZhuFeiYongChaXunTiaoJian param) {
-        return ResultVoUtil.success(getOrderList(dao.selectOrderNo(param.buildQw())));
+        List<XinZhenYzActOrder> xinZhenYzActOrders = dao.selectOrderNo(param.buildQw());
+        return ResultVoUtil.success(xinZhenYzActOrders);
     }
 
     /**

+ 30 - 0
src/main/java/thyyxxk/webserver/utils/RestTemplateUtils.java

@@ -0,0 +1,30 @@
+package thyyxxk.webserver.utils;
+
+import cn.hutool.json.JSONUtil;
+import lombok.RequiredArgsConstructor;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.core.ParameterizedTypeReference;
+import org.springframework.http.HttpEntity;
+import org.springframework.http.HttpMethod;
+import org.springframework.stereotype.Component;
+import org.springframework.web.client.RestTemplate;
+import thyyxxk.webserver.entity.ResultVo;
+
+@Slf4j
+@Component
+@RequiredArgsConstructor
+public class RestTemplateUtils {
+    private final RestTemplate template;
+
+    public <T> ResultVo<T> get(String url, Object req, Class<T> clazz) {
+        return template.exchange(url, HttpMethod.GET, new HttpEntity<>(req), new ParameterizedTypeReference<ResultVo<T>>() {
+        }).getBody();
+    }
+
+    public <T> ResultVo<T> post(String url, Object req, Class<T> clazz, String logName) {
+        ResultVo<T> body = template.exchange(url, HttpMethod.POST, new HttpEntity<>(req), new ParameterizedTypeReference<ResultVo<T>>() {
+        }).getBody();
+        log.info("接口:{}\n参数:{}\n返回值:{}", logName, JSONUtil.toJsonStr(req), JSONUtil.toJsonStr(body));
+        return body;
+    }
+}

+ 31 - 0
src/main/java/thyyxxk/webserver/utils/WrapperUtils.java

@@ -0,0 +1,31 @@
+package thyyxxk.webserver.utils;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+
+import java.util.Date;
+import java.util.Map;
+
+public class WrapperUtils {
+    public static String getFullSql(QueryWrapper<?> wrapper) {
+        // 1. 获取SQL片段(带#{param}格式)
+        String sqlSegment = wrapper.getSqlSegment();
+
+        // 2. 获取参数映射
+        Map<String, Object> paramMap = wrapper.getParamNameValuePairs();
+
+        // 3. 替换参数
+        for (Map.Entry<String, Object> entry : paramMap.entrySet()) {
+            String paramName = entry.getKey();
+            Object value = entry.getValue();
+            String placeholder = "#{ew.paramNameValuePairs." + paramName + "}";
+
+            // 处理特殊值(字符串/日期需加引号)
+            String replacement = (value instanceof CharSequence || value instanceof Date)
+                    ? "'" + value + "'" : String.valueOf(value);
+
+            sqlSegment = sqlSegment.replace(placeholder, replacement);
+        }
+
+        return sqlSegment;
+    }
+}