Browse Source

减少数据加载数量

hurugang 3 years ago
parent
commit
788c295c80

+ 3 - 3
src/main/java/cn/hnthyy/thmz/mapper/his/zd/JcJyItemChargeMapper.java

@@ -54,7 +54,7 @@ public interface JcJyItemChargeMapper {
     @Select({"<script>",
             " SELECT ",
             "<when test='commonParams==null'>",
-            " top 20 ",
+            " top ${pageSize} ",
             "</when>",
             "rtrim(code) code,name,py_code,d_code wb_code,class ,exec_unit,type=1,rtrim(sample_code) sample_code,bw_code='' ",
             "    FROM jy_zd_item WITH(NOLOCK) ",
@@ -68,7 +68,7 @@ public interface JcJyItemChargeMapper {
             " UNION ALL ",
             "    SELECT ",
             "<when test='commonParams==null'>",
-            " top 20 ",
+            " top ${pageSize} ",
             "</when>",
             "rtrim(code) code,name,py_code,d_code wb_code,class ,exec_unit,type=2,sample_code='',rtrim(bw_code) bw_code ",
             "    FROM jc_zd_item  WITH(NOLOCK) ",
@@ -80,7 +80,7 @@ public interface JcJyItemChargeMapper {
             "         name    like #{commonParams} collate Chinese_PRC_CI_AS )  ",
             "</when>",
             "</script>"})
-    List<JyZdItem> selectJcJyItemByCommonParams(@Param("commonParams") String commonParams);
+    List<JyZdItem> selectJcJyItemByCommonParams(@Param("commonParams") String commonParams, @Param("pageSize") Integer pageSize);
 
     /**
      * 诊疗项目查询

+ 2 - 2
src/main/java/cn/hnthyy/thmz/mapper/his/zd/MzZdYpYshMapper.java

@@ -18,7 +18,7 @@ public interface MzZdYpYshMapper {
             "<script>",
             "SELECT  ",
             "<when test='commonParams==null'>",
-            " top 20 ",
+            " top ${pageSize} ",
             "</when>",
             "code,serial,name,specification,charge_amount,manufactory,mini_unit,group_no,stock_amount_virtual,drug_win,yp_type=71 ",
             "    FROM view_mz_zd_yp_ysh WITH(NOLOCK)  ",
@@ -28,7 +28,7 @@ public interface MzZdYpYshMapper {
             "</when>",
             "GROUP BY code,serial, name,specification,charge_amount,manufactory,mini_unit,group_no,stock_amount_virtual,drug_win order by stock_amount_virtual desc",
             "</script>"})
-    List<MzZdYpYsh> selectMzZdYpYshByCommonParamsAndGroupNo(@Param("commonParams") String commonParams, @Param("groupNo") String groupNo);
+    List<MzZdYpYsh> selectMzZdYpYshByCommonParamsAndGroupNo(@Param("commonParams") String commonParams, @Param("groupNo") String groupNo, @Param("pageSize") Integer pageSize);
 
 
 

+ 5 - 4
src/main/java/cn/hnthyy/thmz/service/impl/his/zd/JcJyItemChargeServiceImpl.java

@@ -73,18 +73,19 @@ public class JcJyItemChargeServiceImpl implements JcJyItemChargeService {
 
     @Override
     public List<JyZdItem> queryJcJyItemByCommonParams(String commonParams) {
-        Integer pageSize =2000;
+        //Integer pageSize =2000;
+        Integer pageSize =10;
         if (StringUtils.isBlank(commonParams)) {
             commonParams = null;
-            pageSize =20;
+            pageSize =5;
         }
 //        if (SignUtil.isAlpha(commonParams)) {
 //            commonParams = commonParams.toUpperCase();
 //        }
         if (StringUtils.isNotBlank(commonParams)) {
-            commonParams = "%" + commonParams + "%";
+            commonParams = commonParams + "%";
         }
-        List<JyZdItem> jyZdItemList = jcJyItemChargeMapper.selectJcJyItemByCommonParams(commonParams);
+        List<JyZdItem> jyZdItemList = jcJyItemChargeMapper.selectJcJyItemByCommonParams(commonParams, pageSize);
         List<JyZdItem> zlList = zdChargeItemMapper.selectZlByCommonParams(commonParams, pageSize);
         if (jyZdItemList == null) {
             jyZdItemList = zlList;

+ 3 - 3
src/main/java/cn/hnthyy/thmz/service/impl/his/zd/MzZdYpYshServiceImpl.java

@@ -25,12 +25,12 @@ public class MzZdYpYshServiceImpl implements MzZdYpYshService {
         if (StringUtils.isBlank(commonParams)) {
             commonParams = null;
         } else {
-            commonParams = "%" + commonParams + "%";
+            commonParams = commonParams + "%";
         }
-        List<MzZdYpYsh> mzZdYpYshes = mzZdYpYshMapper.selectMzZdYpYshByCommonParamsAndGroupNo(commonParams, groupNo);
+        Integer pageSize =5;
+        List<MzZdYpYsh> mzZdYpYshes = mzZdYpYshMapper.selectMzZdYpYshByCommonParamsAndGroupNo(commonParams, groupNo,pageSize);
         //如果查询的是西成药,需要把医材 和诊疗项目,麻、精一,精二也查询过来
         if (Constants.XY_ZCY_GROUP_NO.equals(groupNo)) {
-            Integer pageSize =5;
             List<MzZdYpYsh> ycList = mzZdYpYshMapper.selectYcByCommonParams(commonParams,pageSize);
             mzZdYpYshes.addAll(ycList);
             List<MzZdYpYsh> mjList = mzZdYpYshMapper.selectMjyByCommonParams(commonParams,pageSize);

+ 1 - 1
src/main/resources/static/js/index.js

@@ -217,7 +217,7 @@ $(function () {
                         html+=obj.icd_text+'</div>';
                         html+='<div class="el-col el-col-4" style="float: right;text-align: right;margin-right: 5px;">';
                         html+=obj.num;
-                        html+=' </div><div style="clear: both;"></div></div>';
+                        html+=' </div><div style="clear: both;"></div></div>';
                     }
                 }
                 $("#numberOfIcdText").html(html);