zhaowenxuan
13 小时以前 e6eb8c14f98921ba73a7efdfc1415c6483dc4112
查询时间范围条件
3个文件已修改
22 ■■■■ 已修改文件
ltkj-admin/src/main/java/com/ltkj/web/controller/system/SysLoginController.java 19 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ltkj-hosp/src/main/java/com/ltkj/hosp/mapper/TjCustomerMapper.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
ltkj-hosp/src/main/resources/mapper/TjCustomerMapper.xml 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ltkj-admin/src/main/java/com/ltkj/web/controller/system/SysLoginController.java
@@ -1,10 +1,13 @@
package com.ltkj.web.controller.system;
import java.awt.peer.LabelPeer;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.*;
import cn.hutool.core.date.DateUnit;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.ltkj.common.annotation.RepeatSubmit;
import com.ltkj.common.core.domain.entity.SysDept;
@@ -81,6 +84,8 @@
    private ITjOrderService tjOrderService;
    @Autowired
    private TjCustomerMapper tjCustomerMapper;
    @Autowired
    private ISysConfigService sysConfigService;
    /**
     * 登录方法
@@ -103,8 +108,18 @@
            wq.eq(TjCustomer::getCusPhone, loginBody.getUsername());
            wq.eq(TjCustomer::getCusIdcard, loginBody.getSfzh());
            TjCustomer tjCustomer = customerService.getOne(wq);
            List<Map<String ,Object>> customer = tjCustomerMapper.getCusInfoListByCardAndName(tjCustomer.getCusIdcard(),tjCustomer.getCusName());
            ajax.put("orderList",customer);
            String key = sysConfigService.selectConfigByKey("h5OrXcxQueryDate");
            if (StrUtil.isBlank(key)){
                key = "2025-05-01";
            }
            SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
            try {
                Date date = sdf.parse(key);
                List<Map<String ,Object>> customer = tjCustomerMapper.getCusInfoListByCardAndName(tjCustomer.getCusIdcard(),tjCustomer.getCusName(),date);
                ajax.put("orderList",customer);
            } catch (ParseException e) {
                return AjaxResult.error();
            }
        }
        if (null == token) {
            return AjaxResult.error("登录失败!");
ltkj-hosp/src/main/java/com/ltkj/hosp/mapper/TjCustomerMapper.java
@@ -108,7 +108,7 @@
    List<Map<String ,Object >> getCusInfoList(@Param("card") String card,@Param("time") Date time);
    List<Map<String ,Object >> getCusInfoListByCardAndName(@Param("card") String card,@Param("name") String name);
    List<Map<String ,Object >> getCusInfoListByCardAndName(@Param("card") String card,@Param("name") String name,@Param("time") Date time);
    @Select("SELECT IF(b.cus_sex=0,'0','1') xb FROM tj_order a JOIN tj_customer b ON b.cus_id=a.user_id \n" +
ltkj-hosp/src/main/resources/mapper/TjCustomerMapper.xml
@@ -309,6 +309,7 @@
  LEFT JOIN tj_report r ON o.tj_number = r.tj_number
WHERE
  c.cus_idcard = #{card} AND c.cus_name = #{name} AND c.deleted = 0
        and o.create_time > #{time}
        ORDER BY
        o.create_time DESC
    </select>