浏览代码

优化报表查询功能

hurugang 5 年之前
父节点
当前提交
fb65c552be

+ 4 - 2
src/main/java/cn/hnthyy/thmz/mapper/thmz/MzmxsrMapper.java

@@ -48,7 +48,9 @@ public interface MzmxsrMapper {
      * @return
      */
     @Select({"<script>" +
-            "select id,xm, patient_id, jz_sq_dept, jz_sq_doctor, exec_dept, xmm, hsm, je, charge_date, dcount_date, quty, price, parent_code, input_date from t_mzmxsr where 1=1"+
+            "select a.id,xm, patient_id, jz_sq_dept, jz_sq_doctor, exec_dept, xmm, hsm, je, charge_date, dcount_date, quty, price, parent_code, " +
+            "input_date from t_mzmxsr a join  ("+
+            "select id from t_mzmxsr where 1=1"+
             "<when test='caseType==1'>" +
             " and charge_date  <![CDATA[>=]]>#{beginDate,jdbcType=TIMESTAMP} and charge_date  <![CDATA[<=]]>#{endDate,jdbcType=TIMESTAMP}" +
             "</when>" +
@@ -79,7 +81,7 @@ public interface MzmxsrMapper {
                     "<when test='xmm!=null'>" +
                     " and xmm =#{xmm}" +
                     "</when>"+
-            " order by id limit #{pageSize}"
+            " order by id limit #{offset},#{pageSize} )b on a.id=b.id"
             + "</script>"})
     List<Mzmxsr> selectMzmxsrWithPage(ThmzmxsrParamsVo thmzmxsrParamsVo);
 

+ 2 - 0
src/main/java/cn/hnthyy/thmz/vo/ThmzmxsrParamsVo.java

@@ -48,6 +48,8 @@ public class ThmzmxsrParamsVo {
     private String secondTableName;
     //每页显示的数据
     private Integer pageSize;
+    //页面当前位置
+    private Integer offset;
     //上一次查询到的总额
     private BigDecimal amount;
     //上一次查询到的总数

+ 1 - 0
src/main/resources/static/js/mzsrmx.js

@@ -316,6 +316,7 @@ function queryParams(params) {
         parentCode:$("#parentCode").val(),
         xmm:$("#xmm").val(),
         pageSize: params.limit,
+        offset:params.offset,
         amount:amount,
         total:total
     };