From 3dcb170f7e0ecbcf406953e81b3cf739cc120b7a Mon Sep 17 00:00:00 2001
From: zjh <zjh@888>
Date: 星期五, 22 十二月 2023 15:31:11 +0800
Subject: [PATCH] zjh 本地 2023/12/22 -3/

---
 ltkj-admin/src/main/java/com/ltkj/web/controller/system/TjCustomerController.java |   41 +++++++++++---------
 ltkj-admin/src/main/java/com/ltkj/web/controller/sqlserver/TjSqlController.java   |    6 ++-
 ltkj-hosp/src/main/java/com/ltkj/hosp/mapper/TestMapper.java                      |   21 ++++++++--
 3 files changed, 43 insertions(+), 25 deletions(-)

diff --git a/ltkj-admin/src/main/java/com/ltkj/web/controller/sqlserver/TjSqlController.java b/ltkj-admin/src/main/java/com/ltkj/web/controller/sqlserver/TjSqlController.java
index 9137ca6..3e22a89 100644
--- a/ltkj-admin/src/main/java/com/ltkj/web/controller/sqlserver/TjSqlController.java
+++ b/ltkj-admin/src/main/java/com/ltkj/web/controller/sqlserver/TjSqlController.java
@@ -79,8 +79,10 @@
 
     @GetMapping("/newGetTjPat")
     @ApiOperation(value = "鏂扮殑鏌ヨ浣撴淇℃伅鎺ュ彛")
-    public AjaxResult newGetTjPat() {
-        List<Map<String, Object>> maps = testMapper.newGetTjPat();
+    public AjaxResult newGetTjPat(@RequestParam(required = false)String pacCode,
+                                  @RequestParam(required = false)String pacName,
+                                  @RequestParam(required = false)String pacRemark) {
+        List<Map<String, Object>> maps = testMapper.newGetTjPat(pacCode,pacName,pacRemark);
         DynamicDataSourceContextHolder.clearDataSourceType();
         return AjaxResult.success(maps);
     }
diff --git a/ltkj-admin/src/main/java/com/ltkj/web/controller/system/TjCustomerController.java b/ltkj-admin/src/main/java/com/ltkj/web/controller/system/TjCustomerController.java
index f49efda..d720ab8 100644
--- a/ltkj-admin/src/main/java/com/ltkj/web/controller/system/TjCustomerController.java
+++ b/ltkj-admin/src/main/java/com/ltkj/web/controller/system/TjCustomerController.java
@@ -18,6 +18,7 @@
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import io.swagger.annotations.ApiParam;
+import org.apache.ibatis.annotations.Param;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.util.DigestUtils;
 import org.springframework.web.bind.annotation.*;
@@ -65,8 +66,10 @@
 
     @GetMapping("/newGetTjPat")
     @ApiOperation(value = "鏌ヨhis鏁版嵁搴撹繑鍥炴柊鐨勬暟鎹�")
-    public AjaxResult newGetTjPat() {
-        List<Map<String, Object>> maps = testMapper.newGetTjPat();
+    public AjaxResult newGetTjPat(@RequestParam(required = false)String pacCode,
+                                  @RequestParam(required = false)String pacName,
+                                  @RequestParam(required = false)String pacRemark) {
+        List<Map<String, Object>> maps = testMapper.newGetTjPat(pacCode,pacName,pacRemark);
         DynamicDataSourceContextHolder.clearDataSourceType();
         return AjaxResult.success(maps);
     }
@@ -108,24 +111,24 @@
                     if(null==ltkjTjPat){
                         tjvLtkjvtjpatService.save(tjPatByIdCard);
                     }
-                }
-                DynamicDataSourceContextHolder.clearDataSourceType();
-                //鍐嶆牴鎹韩浠借瘉鍙峰啓customer琛�
-                TjCustomer tjCustomer = tjCustomerService.getTjCustomerByCusIdCard(cusIdcard);
-                if(null == tjCustomer){
-                    testMapper.getTjPatByCusId(cusIdcard);
-                    LambdaQueryWrapper<TjCustomer> qw = new LambdaQueryWrapper<>();
-                    qw.eq(TjCustomer::getCusIdcard, cusIdcard);
-                    TjCustomer customer = tjCustomerService.getOne(qw);
-                    customer.setReservationId(customer.getCardId());
-                    extracted(customer);
-                    return success(customer);
-                }else {
-                    tjCustomer.setReservationId(tjCustomer.getCardId());
-                    extracted(tjCustomer);
-                    return success(tjCustomer);
-                }
+                    DynamicDataSourceContextHolder.clearDataSourceType();
+                    //鍐嶆牴鎹韩浠借瘉鍙峰啓customer琛�
+                    TjCustomer tjCustomer = tjCustomerService.getTjCustomerByCusIdCard(cusIdcard);
+                    if(null == tjCustomer){
+                        testMapper.getTjPatByCusId(cusIdcard);
+                        LambdaQueryWrapper<TjCustomer> qw = new LambdaQueryWrapper<>();
+                        qw.eq(TjCustomer::getCusIdcard, cusIdcard);
+                        TjCustomer customer = tjCustomerService.getOne(qw);
+                        customer.setReservationId(customer.getCardId());
+                        extracted(customer);
+                        return success(customer);
+                    }else {
+                        tjCustomer.setReservationId(tjCustomer.getCardId());
+                        extracted(tjCustomer);
+                        return success(tjCustomer);
+                    }
 
+                }
             }
             //end====2023.12.12
             LambdaQueryWrapper<TjReservation> wq = new LambdaQueryWrapper<>();
diff --git a/ltkj-hosp/src/main/java/com/ltkj/hosp/mapper/TestMapper.java b/ltkj-hosp/src/main/java/com/ltkj/hosp/mapper/TestMapper.java
index 10961b3..82b3757 100644
--- a/ltkj-hosp/src/main/java/com/ltkj/hosp/mapper/TestMapper.java
+++ b/ltkj-hosp/src/main/java/com/ltkj/hosp/mapper/TestMapper.java
@@ -44,11 +44,24 @@
     public List<LtkjTjPat> getTjPat();
 
     @DataSource(value = DataSourceType.SLAVE_PACS)
-    @Select("select fcard_iD xh,fcard_no pacCode,pat_name pacName,\n" +
+    @Select({"<script> select fcard_iD xh,fcard_no pacCode,pat_name pacName,\n" +
             " (case when patsex_id='0' then '鐢�' when patsex_id='1' then '濂�' else '鏈煡' end )+';'+brnl detail,\n" +
-            " pat_id price , mobile pacRemark\n" +
-            "  from histjv_ltkjvtjpat")
-    public List<Map<String,Object>> newGetTjPat();
+            " pat_id price , mobile pacRemark" +
+            "  from histjv_ltkjvtjpat where 1=1 "+
+            " <when test='pacCode!=null'>" +
+            "  AND fcard_no = #{pacCode}" +
+            "</when>" +
+            " <when test='pacName!=null'>" +
+            "  AND pat_name = #{pacName}" +
+            "</when>" +
+            " <when test='pacRemark!=null'>" +
+            "  AND mobile = #{pacRemark}" +
+            "</when>" +
+            "</script>"})
+    public List<Map<String,Object>> newGetTjPat(@Param("pacCode")String pacCode,
+                                                @Param("pacName")String pacName,
+                                                @Param("pacRemark")String pacRemark);
+
 
     @DataSource(value = DataSourceType.SLAVE_HIS)
     @Select("SELECT * FROM histjv_LTKJVTJPAT where Ltrim(Rtrim(fcard_no)) = #{id} or Ltrim(Rtrim(fcard_id))=#{id} ")

--
Gitblit v1.8.0