feat(surgicalschedule): 将手术安排日期查询改为日期范围选择 BUG#305

- 将前端日期选择器从单日期改为日期范围选择器
- 修改查询参数从 scheduleDate 改为 scheduleDateRange 数组
- 新增 scheduleDateStart 和 scheduleDateEnd 参数用于后端查询
- 在后端 DTO 中添加日期范围查询字段并配置格式化注解
- 更新 MyBatis XML 映射文件中的日期查询条件逻辑
- 实现前端日期范围到查询参数的转换处理逻辑
This commit is contained in:
2026-03-31 16:10:34 +08:00
parent b7993885bb
commit 6accaa35c9
3 changed files with 50 additions and 16 deletions

View File

@@ -4,6 +4,7 @@ import com.fasterxml.jackson.annotation.JsonFormat;
import com.openhis.surgicalschedule.domain.OpSchedule;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springframework.format.annotation.DateTimeFormat;
import java.time.LocalDate;
@@ -18,6 +19,20 @@ import java.time.LocalDate;
@EqualsAndHashCode(callSuper = true)
public class OpScheduleDto extends OpSchedule {
/**
* 手术安排日期开始(查询用)
*/
@JsonFormat(pattern = "yyyy-MM-dd")
@DateTimeFormat(pattern = "yyyy-MM-dd")
private LocalDate scheduleDateStart;
/**
* 手术安排日期结束(查询用)
*/
@JsonFormat(pattern = "yyyy-MM-dd")
@DateTimeFormat(pattern = "yyyy-MM-dd")
private LocalDate scheduleDateEnd;
/**
* 患者姓名
*/

View File

@@ -47,8 +47,11 @@
<if test="dto.applyDeptId != null and dto.applyDeptId != ''">
AND cs.apply_dept_id = #{dto.applyDeptId}
</if>
<if test="dto.scheduleDate != null">
AND os.schedule_date = #{dto.scheduleDate}
<if test="dto.scheduleDateStart != null">
AND DATE(os.schedule_date) &gt;= #{dto.scheduleDateStart}
</if>
<if test="dto.scheduleDateEnd != null">
AND DATE(os.schedule_date) &lt;= #{dto.scheduleDateEnd}
</if>
<if test="dto.operCode != null and dto.operCode != ''">
AND os.oper_code LIKE CONCAT('%', #{dto.operCode}, '%')
@@ -134,7 +137,8 @@
<if test="dto.applyId != null"> AND os.apply_id = #{dto.applyId}</if>
<if test="dto.operCode != null and dto.operCode != ''"> AND os.oper_code = #{dto.operCode}</if>
<if test="dto.operName != null and dto.operName != ''"> AND os.oper_name LIKE CONCAT('%', #{dto.operName}, '%')</if>
<if test="dto.scheduleDate != null"> AND os.schedule_date = #{dto.scheduleDate}</if>
<if test="dto.scheduleDateStart != null"> AND DATE(os.schedule_date) &gt;= #{dto.scheduleDateStart}</if>
<if test="dto.scheduleDateEnd != null"> AND DATE(os.schedule_date) &lt;= #{dto.scheduleDateEnd}</if>
<if test="dto.orgId != null and dto.orgId != ''"> AND cs.org_id = #{dto.orgId}</if>
<if test="dto.applyDeptId != null and dto.applyDeptId != ''"> AND cs.apply_dept_id = #{dto.applyDeptId}</if>
<if test="dto.patientName != null and dto.patientName != ''"> AND ap.name LIKE CONCAT('%', #{dto.patientName}, '%')</if>