Browse Source

来宜人员去掉默认时间,并默认展示50条数据

LIVE_YE 3 năm trước cách đây
mục cha
commit
5df921a7c0

+ 17 - 0
boman-common/boman-common-core/src/main/java/com/boman/common/core/web/controller/BaseController.java

@@ -73,6 +73,23 @@ public class BaseController
         return rspData;
     }
 
+    /**
+     * 响应请求分页数据(来宜专用)
+     */
+    @SuppressWarnings({ "rawtypes", "unchecked" })
+    protected TableDataInfo getDataTableLy(List<?> list,String startTime,String endTime)
+    {
+        TableDataInfo rspData = new TableDataInfo();
+        rspData.setCode(HttpStatus.SUCCESS);
+        rspData.setRows(list);
+        rspData.setMsg("查询成功");
+        rspData.setTotal(new PageInfo(list).getTotal());
+        if(StringUtils.isEmpty(startTime) || StringUtils.isEmpty(endTime)){
+            rspData.setTotal(50);
+        }
+        return rspData;
+    }
+
     /**
      * 响应返回结果
      * 

+ 2 - 1
boman-web-core/src/main/java/com/boman/web/core/controller/ToQianshanPersonnerController.java

@@ -6,6 +6,7 @@ import com.boman.domain.dto.AjaxResult;
 import com.boman.web.core.domain.ToQianshanPersonner;
 import com.boman.web.core.domain.vo.AccountingDataVo;
 import com.boman.web.core.service.toQianShan.ToQianshanPersonnerService;
+import com.github.pagehelper.PageInfo;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.RequestMapping;
@@ -33,7 +34,7 @@ public class ToQianshanPersonnerController extends BaseController {
     public TableDataInfo toQianshan(ToQianshanPersonner toQianshanPersonner) {
 
         List<Map<String,Object>> list = toQianshanPersonnerService.toQianshan(toQianshanPersonner);
-        return getDataTable(list);
+        return getDataTableLy(list,toQianshanPersonner.getStartTime(),toQianshanPersonner.getEndTime());
     }
 
 

+ 3 - 1
boman-web-core/src/main/resources/mapper/ToQianshanPersonnerMapper.xml

@@ -71,14 +71,16 @@
         from to_qianshan_personner
         <where>
             1=1
+            <if test="startTime != null  and startTime != '' and endTime != null  and endTime != ''">
             and DATE_FORMAT(hi_date,'%Y-%m-%d %H:%i:%s') &gt;= DATE_FORMAT(#{startTime},'%Y-%m-%d %H:%i:%s')
             and DATE_FORMAT(hi_date,'%Y-%m-%d %H:%i:%s') &lt;= DATE_FORMAT(#{endTime},'%Y-%m-%d %H:%i:%s')
-
+            </if>
             <if test="hiIcd != null  and hiIcd != ''">and hi_icd = #{hiIcd}</if>
             <if test="hiName != null  and hiName != ''">and hi_name like concat(#{hiName}, '%')</if>
             <if test="hiDestinationRc != null  and hiDestinationRc != ''">and hi_destination_rc like concat('%', #{hiDestinationRc}, '%')</if>
         </where>
         ORDER BY hi_date DESC
+
     </select>
     <select id="getNewInfo" resultMap="ToQianshanPersonnerResult">
         select hi_adress,risk_lv,address,QU,sex,hi_name,hi_destination_street,FXDJ_LY,hi_destination_rc,hi_phone,hi_date,hi_icd ,SHI,SHENG,hi_destination_area