Explorar o código

销售端新增任务栏,用于显示已创建采集表的当前进度;包括客户姓名,约诊医生,当前状态,采集表详情,挂载商品名称,创建时间,完成时间。

cgp hai 2 semanas
pai
achega
0d4c03b3f1

+ 105 - 0
fs-company/src/main/java/com/fs/company/controller/qw/FsUserInformationCollectionScheduleController.java

@@ -0,0 +1,105 @@
+package com.fs.company.controller.qw;
+
+import java.util.List;
+
+import com.fs.his.domain.FsUserInformationCollectionSchedule;
+import com.fs.qw.service.IFsUserInformationCollectionScheduleService;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.PutMapping;
+import org.springframework.web.bind.annotation.DeleteMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+import com.fs.common.annotation.Log;
+import com.fs.common.core.controller.BaseController;
+import com.fs.common.core.domain.AjaxResult;
+import com.fs.common.enums.BusinessType;
+import com.fs.common.utils.poi.ExcelUtil;
+import com.fs.common.core.page.TableDataInfo;
+
+
+/**
+ * 用户信息采集进度Controller
+ *
+ * @author cgp
+ * @date 2025-11-18
+ */
+@RestController
+@RequestMapping("/qw/collectionSchedule")
+public class FsUserInformationCollectionScheduleController extends BaseController
+{
+    @Autowired
+    private IFsUserInformationCollectionScheduleService fsUserInformationCollectionScheduleService;
+
+    /**
+     * 对于每条用户信息采集记录,只获取其最新的任务流程
+     */
+    @PreAuthorize("@ss.hasPermi('qw:collectionSchedule:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(FsUserInformationCollectionSchedule fsUserInformationCollectionSchedule)
+    {
+        startPage();
+        List<FsUserInformationCollectionSchedule> list = fsUserInformationCollectionScheduleService.getUserRecordLatestTaskProcess(fsUserInformationCollectionSchedule);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出用户信息采集进度列表
+     */
+    @PreAuthorize("@ss.hasPermi('qw:collectionSchedule:export')")
+    @Log(title = "用户信息采集进度", businessType = BusinessType.EXPORT)
+    @GetMapping("/export")
+    public AjaxResult export(FsUserInformationCollectionSchedule fsUserInformationCollectionSchedule)
+    {
+        List<FsUserInformationCollectionSchedule> list = fsUserInformationCollectionScheduleService.selectFsUserInformationCollectionScheduleList(fsUserInformationCollectionSchedule);
+        ExcelUtil<FsUserInformationCollectionSchedule> util = new ExcelUtil<FsUserInformationCollectionSchedule>(FsUserInformationCollectionSchedule.class);
+        return util.exportExcel(list, "用户信息采集进度数据");
+    }
+
+    /**
+     * 获取用户信息采集进度详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('qw:collectionSchedule:query')")
+    @GetMapping(value = "/{id}")
+    public AjaxResult getInfo(@PathVariable("id") Long id)
+    {
+        return AjaxResult.success(fsUserInformationCollectionScheduleService.selectFsUserInformationCollectionScheduleById(id));
+    }
+
+    /**
+     * 新增用户信息采集进度
+     */
+    @PreAuthorize("@ss.hasPermi('qw:collectionSchedule:add')")
+    @Log(title = "用户信息采集进度", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody FsUserInformationCollectionSchedule fsUserInformationCollectionSchedule)
+    {
+        return toAjax(fsUserInformationCollectionScheduleService.insertFsUserInformationCollectionSchedule(fsUserInformationCollectionSchedule));
+    }
+
+    /**
+     * 修改用户信息采集进度
+     */
+    @PreAuthorize("@ss.hasPermi('qw:collectionSchedule:edit')")
+    @Log(title = "用户信息采集进度", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody FsUserInformationCollectionSchedule fsUserInformationCollectionSchedule)
+    {
+        return toAjax(fsUserInformationCollectionScheduleService.updateFsUserInformationCollectionSchedule(fsUserInformationCollectionSchedule));
+    }
+
+    /**
+     * 删除用户信息采集进度
+     */
+    @PreAuthorize("@ss.hasPermi('qw:collectionSchedule:remove')")
+    @Log(title = "用户信息采集进度", businessType = BusinessType.DELETE)
+    @DeleteMapping("/{ids}")
+    public AjaxResult remove(@PathVariable Long[] ids)
+    {
+        return toAjax(fsUserInformationCollectionScheduleService.deleteFsUserInformationCollectionScheduleByIds(ids));
+    }
+}

+ 70 - 0
fs-service/src/main/java/com/fs/his/domain/FsUserInformationCollectionSchedule.java

@@ -0,0 +1,70 @@
+package com.fs.his.domain;
+
+import java.util.Date;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.fs.common.annotation.Excel;
+import lombok.Data;
+import com.fs.common.core.domain.BaseEntity;
+import lombok.EqualsAndHashCode;
+
+/**
+ * 用户信息采集进度对象 fs_user_information_collection_schedule
+ *
+ * @author fs
+ * @date 2025-11-18
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class FsUserInformationCollectionSchedule extends BaseEntity{
+
+    /** 主键 */
+    private Long id;
+
+    /** 用户信息采集表id */
+    private Long collectionId;
+
+    /** 用户id */
+    private Long userId;
+
+    /** 客户姓名 */
+    @Excel(name = "客户姓名")
+    private String userName;
+
+    /** 医生id */
+    private Long doctorId;
+
+    /** 约诊医生 */
+    @Excel(name = "约诊医生")
+    private String doctorName;
+
+    /** 套餐包Id */
+    private Long packageId;
+
+    /** 挂载商品名称 */
+    @Excel(name = "挂载商品名称")
+    private String packageName;
+
+    /** 当前流程节点:(1:待用户第一次确认、2:待开方、3:待药师审核、4:待建议、5:待用户二次确认);其中带疗法模式有1,2,3,5;无疗法模式只有1,4,5 */
+    @Excel(name = "当前状态")
+    private Integer currentStep;
+
+    /** 整体任务状态:1-进行中,2-已完成,3-已中止 */
+    @Excel(name = "整体任务状态:1-进行中,2-已完成,3-已中止")
+    private Integer status;
+
+    /** 完成时间 */
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    @Excel(name = "完成时间", width = 30, dateFormat = "yyyy-MM-dd")
+    private Date completedTime;
+
+    /** 中止时间 */
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    @Excel(name = "中止时间", width = 30, dateFormat = "yyyy-MM-dd")
+    private Date terminatedTime;
+
+    /** 中止操作人id */
+    private String terminatedBy;
+
+
+}

+ 88 - 0
fs-service/src/main/java/com/fs/his/enums/CollectionTaskStatusEnum.java

@@ -0,0 +1,88 @@
+package com.fs.his.enums;
+
+import com.fasterxml.jackson.annotation.JsonCreator;
+import com.fasterxml.jackson.annotation.JsonValue;
+import lombok.Getter;
+
+/**
+ * 用户信息采集任务的整体状态枚举
+ * 
+ * 1 - 进行中  
+ * 2 - 已完成  
+ * 3 - 已中止
+ */
+@Getter
+public enum CollectionTaskStatusEnum {
+
+    PROCESSING(1, "进行中"),
+    COMPLETED(2, "已完成"),
+    TERMINATED(3, "已中止");
+
+    /** 状态码(存入数据库的值) */
+    private final Integer code;
+
+    /** 状态描述 */
+    private final String desc;
+
+    CollectionTaskStatusEnum(Integer code, String desc) {
+        this.code = code;
+        this.desc = desc;
+    }
+
+    /**
+     * 根据 code 获取枚举(用于从数据库值转为枚举)
+     *
+     * @param code 状态码
+     * @return 对应的枚举,若无匹配则返回 null
+     */
+    public static CollectionTaskStatusEnum fromCode(Integer code) {
+        if (code == null) {
+            return null;
+        }
+        for (CollectionTaskStatusEnum status : values()) {
+            if (status.code.equals(code)) {
+                return status;
+            }
+        }
+        return null;
+    }
+
+    /**
+     * Jackson 反序列化时使用(支持 JSON 中直接传数字如 1 -> PROCESSING)
+     */
+    @JsonCreator
+    public static CollectionTaskStatusEnum fromJsonValue(Object value) {
+        if (value instanceof Number) {
+            return fromCode(((Number) value).intValue());
+        } else if (value instanceof String) {
+            try {
+                return fromCode(Integer.parseInt((String) value));
+            } catch (NumberFormatException ignored) {
+                // ignore
+            }
+        }
+        return null;
+    }
+
+    /**
+     * Jackson 序列化时输出 code 而不是 name(如输出 1 而不是 "PROCESSING")
+     */
+    @JsonValue
+    public Integer getCode() {
+        return this.code;
+    }
+
+    /**
+     * 判断是否为“活跃”状态(即未完成且未中止)
+     */
+    public boolean isActive() {
+        return this == PROCESSING;
+    }
+
+    /**
+     * 判断是否已结束(已完成 或 已中止)
+     */
+    public boolean isFinished() {
+        return this == COMPLETED || this == TERMINATED;
+    }
+}

+ 69 - 0
fs-service/src/main/java/com/fs/qw/mapper/FsUserInformationCollectionScheduleMapper.java

@@ -0,0 +1,69 @@
+package com.fs.qw.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.fs.his.domain.FsUserInformationCollectionSchedule;
+
+import java.util.List;
+
+/**
+ * 用户信息采集进度Mapper接口
+ * 
+ * @author fs
+ * @date 2025-11-18
+ */
+public interface FsUserInformationCollectionScheduleMapper extends BaseMapper<FsUserInformationCollectionSchedule>{
+    /**
+     * 查询用户信息采集进度
+     * 
+     * @param id 用户信息采集进度主键
+     * @return 用户信息采集进度
+     */
+    FsUserInformationCollectionSchedule selectFsUserInformationCollectionScheduleById(Long id);
+
+    /**
+     * 查询用户信息采集进度列表
+     * 
+     * @param fsUserInformationCollectionSchedule 用户信息采集进度
+     * @return 用户信息采集进度集合
+     */
+    List<FsUserInformationCollectionSchedule> selectFsUserInformationCollectionScheduleList(FsUserInformationCollectionSchedule fsUserInformationCollectionSchedule);
+
+    /**
+     * 对于每条用户信息采集记录,只获取其最新的任务流程
+     *
+     * @param fsUserInformationCollectionSchedule 用户信息采集进度
+     * @return 用户信息采集进度集合
+     */
+    List<FsUserInformationCollectionSchedule> getUserRecordLatestTaskProcess(FsUserInformationCollectionSchedule fsUserInformationCollectionSchedule);
+    /**
+     * 新增用户信息采集进度
+     * 
+     * @param fsUserInformationCollectionSchedule 用户信息采集进度
+     * @return 结果
+     */
+    int insertFsUserInformationCollectionSchedule(FsUserInformationCollectionSchedule fsUserInformationCollectionSchedule);
+
+    /**
+     * 修改用户信息采集进度
+     * 
+     * @param fsUserInformationCollectionSchedule 用户信息采集进度
+     * @return 结果
+     */
+    int updateFsUserInformationCollectionSchedule(FsUserInformationCollectionSchedule fsUserInformationCollectionSchedule);
+
+    /**
+     * 删除用户信息采集进度
+     * 
+     * @param id 用户信息采集进度主键
+     * @return 结果
+     */
+    int deleteFsUserInformationCollectionScheduleById(Long id);
+
+    /**
+     * 批量删除用户信息采集进度
+     * 
+     * @param ids 需要删除的数据主键集合
+     * @return 结果
+     */
+    int deleteFsUserInformationCollectionScheduleByIds(Long[] ids);
+}

+ 69 - 0
fs-service/src/main/java/com/fs/qw/service/IFsUserInformationCollectionScheduleService.java

@@ -0,0 +1,69 @@
+package com.fs.qw.service;
+
+import java.util.List;
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.fs.his.domain.FsUserInformationCollectionSchedule;
+
+/**
+ * 用户信息采集进度Service接口
+ * 
+ * @author fs
+ * @date 2025-11-18
+ */
+public interface IFsUserInformationCollectionScheduleService extends IService<FsUserInformationCollectionSchedule>{
+    /**
+     * 查询用户信息采集进度
+     * 
+     * @param id 用户信息采集进度主键
+     * @return 用户信息采集进度
+     */
+    FsUserInformationCollectionSchedule selectFsUserInformationCollectionScheduleById(Long id);
+
+    /**
+     * 查询用户信息采集进度列表
+     * 
+     * @param fsUserInformationCollectionSchedule 用户信息采集进度
+     * @return 用户信息采集进度集合
+     */
+    List<FsUserInformationCollectionSchedule> getUserRecordLatestTaskProcess(FsUserInformationCollectionSchedule fsUserInformationCollectionSchedule);
+
+    /**
+     * 查询用户信息采集进度列表
+     *
+     * @param fsUserInformationCollectionSchedule 用户信息采集进度
+     * @return 用户信息采集进度集合
+     */
+    List<FsUserInformationCollectionSchedule> selectFsUserInformationCollectionScheduleList(FsUserInformationCollectionSchedule fsUserInformationCollectionSchedule);
+
+    /**
+     * 新增用户信息采集进度
+     * 
+     * @param fsUserInformationCollectionSchedule 用户信息采集进度
+     * @return 结果
+     */
+    int insertFsUserInformationCollectionSchedule(FsUserInformationCollectionSchedule fsUserInformationCollectionSchedule);
+
+    /**
+     * 修改用户信息采集进度
+     * 
+     * @param fsUserInformationCollectionSchedule 用户信息采集进度
+     * @return 结果
+     */
+    int updateFsUserInformationCollectionSchedule(FsUserInformationCollectionSchedule fsUserInformationCollectionSchedule);
+
+    /**
+     * 批量删除用户信息采集进度
+     * 
+     * @param ids 需要删除的用户信息采集进度主键集合
+     * @return 结果
+     */
+    int deleteFsUserInformationCollectionScheduleByIds(Long[] ids);
+
+    /**
+     * 删除用户信息采集进度信息
+     * 
+     * @param id 用户信息采集进度主键
+     * @return 结果
+     */
+    int deleteFsUserInformationCollectionScheduleById(Long id);
+}

+ 104 - 0
fs-service/src/main/java/com/fs/qw/service/impl/FsUserInformationCollectionScheduleServiceImpl.java

@@ -0,0 +1,104 @@
+package com.fs.qw.service.impl;
+
+import java.util.List;
+import com.fs.common.utils.DateUtils;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.fs.his.domain.FsUserInformationCollectionSchedule;
+import com.fs.qw.mapper.FsUserInformationCollectionScheduleMapper;
+import com.fs.qw.service.IFsUserInformationCollectionScheduleService;
+import org.springframework.stereotype.Service;
+
+/**
+ * 用户信息采集进度Service业务层处理
+ *
+ * @author fs
+ * @date 2025-11-18
+ */
+@Service
+public class FsUserInformationCollectionScheduleServiceImpl extends ServiceImpl<FsUserInformationCollectionScheduleMapper, FsUserInformationCollectionSchedule> implements IFsUserInformationCollectionScheduleService {
+
+    /**
+     * 查询用户信息采集进度
+     *
+     * @param id 用户信息采集进度主键
+     * @return 用户信息采集进度
+     */
+    @Override
+    public FsUserInformationCollectionSchedule selectFsUserInformationCollectionScheduleById(Long id)
+    {
+        return baseMapper.selectFsUserInformationCollectionScheduleById(id);
+    }
+
+    /**
+     * 对于每条用户信息采集记录,只获取其最新的任务流程
+     *
+     * @param fsUserInformationCollectionSchedule 用户信息采集进度
+     * @return 用户信息采集进度
+     */
+    @Override
+    public List<FsUserInformationCollectionSchedule> getUserRecordLatestTaskProcess(FsUserInformationCollectionSchedule fsUserInformationCollectionSchedule)
+    {
+        return baseMapper.getUserRecordLatestTaskProcess(fsUserInformationCollectionSchedule);
+    }
+
+    /**
+     * 查询用户信息采集进度列表
+     *
+     * @param fsUserInformationCollectionSchedule 用户信息采集进度
+     * @return 用户信息采集进度
+     */
+    @Override
+    public List<FsUserInformationCollectionSchedule> selectFsUserInformationCollectionScheduleList(FsUserInformationCollectionSchedule fsUserInformationCollectionSchedule)
+    {
+        return baseMapper.getUserRecordLatestTaskProcess(fsUserInformationCollectionSchedule);
+    }
+
+    /**
+     * 新增用户信息采集进度
+     *
+     * @param fsUserInformationCollectionSchedule 用户信息采集进度
+     * @return 结果
+     */
+    @Override
+    public int insertFsUserInformationCollectionSchedule(FsUserInformationCollectionSchedule fsUserInformationCollectionSchedule)
+    {
+        fsUserInformationCollectionSchedule.setCreateTime(DateUtils.getNowDate());
+        return baseMapper.insertFsUserInformationCollectionSchedule(fsUserInformationCollectionSchedule);
+    }
+
+    /**
+     * 修改用户信息采集进度
+     *
+     * @param fsUserInformationCollectionSchedule 用户信息采集进度
+     * @return 结果
+     */
+    @Override
+    public int updateFsUserInformationCollectionSchedule(FsUserInformationCollectionSchedule fsUserInformationCollectionSchedule)
+    {
+        return baseMapper.updateFsUserInformationCollectionSchedule(fsUserInformationCollectionSchedule);
+    }
+
+    /**
+     * 批量删除用户信息采集进度
+     *
+     * @param ids 需要删除的用户信息采集进度主键
+     * @return 结果
+     */
+    @Override
+    public int deleteFsUserInformationCollectionScheduleByIds(Long[] ids)
+    {
+        return baseMapper.deleteFsUserInformationCollectionScheduleByIds(ids);
+    }
+
+    /**
+     * 删除用户信息采集进度信息
+     *
+     * @param id 用户信息采集进度主键
+     * @return 结果
+     */
+    @Override
+    public int deleteFsUserInformationCollectionScheduleById(Long id)
+    {
+        return baseMapper.deleteFsUserInformationCollectionScheduleById(id);
+    }
+}

+ 161 - 0
fs-service/src/main/resources/mapper/qw/FsUserInformationCollectionScheduleMapper.xml

@@ -0,0 +1,161 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper
+PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.fs.qw.mapper.FsUserInformationCollectionScheduleMapper">
+    
+    <resultMap type="FsUserInformationCollectionSchedule" id="FsUserInformationCollectionScheduleResult">
+        <result property="id"    column="id"    />
+        <result property="collectionId"    column="collection_id"    />
+        <result property="userId"    column="user_id"    />
+        <result property="userName"    column="user_name"    />
+        <result property="doctorId"    column="doctor_id"    />
+        <result property="doctorName"    column="doctor_name"    />
+        <result property="packageId"    column="package_id"    />
+        <result property="packageName"    column="package_name"    />
+        <result property="currentStep"    column="current_step"    />
+        <result property="status"    column="status"    />
+        <result property="createTime"    column="create_time"    />
+        <result property="completedTime"    column="completed_time"    />
+        <result property="terminatedTime"    column="terminated_time"    />
+        <result property="terminatedBy"    column="terminated_by"    />
+        <result property="remark"    column="remark"    />
+    </resultMap>
+
+    <sql id="selectFsUserInformationCollectionScheduleVo">
+        select id, collection_id, user_id, user_name, doctor_id, doctor_name, package_id, package_name, current_step, status, create_time, completed_time, terminated_time, terminated_by, remark from fs_user_information_collection_schedule
+    </sql>
+
+    <select id="selectFsUserInformationCollectionScheduleList" parameterType="FsUserInformationCollectionSchedule" resultMap="FsUserInformationCollectionScheduleResult">
+        <include refid="selectFsUserInformationCollectionScheduleVo"/>
+        <where>
+            <if test="collectionId != null "> and collection_id = #{collectionId}</if>
+            <if test="userId != null "> and user_id = #{userId}</if>
+            <if test="userName != null  and userName != ''"> and user_name like concat('%', #{userName}, '%')</if>
+            <if test="doctorId != null "> and doctor_id = #{doctorId}</if>
+            <if test="doctorName != null  and doctorName != ''"> and doctor_name like concat('%', #{doctorName}, '%')</if>
+            <if test="packageId != null "> and package_id = #{packageId}</if>
+            <if test="packageName != null  and packageName != ''"> and package_name like concat('%', #{packageName}, '%')</if>
+            <if test="currentStep != null "> and current_step = #{currentStep}</if>
+            <if test="status != null "> and status = #{status}</if>
+            <if test="completedTime != null "> and completed_time = #{completedTime}</if>
+            <if test="terminatedTime != null "> and terminated_time = #{terminatedTime}</if>
+            <if test="terminatedBy != null  and terminatedBy != ''"> and terminated_by = #{terminatedBy}</if>
+        </where>
+    </select>
+
+    <select id="getUserRecordLatestTaskProcess"
+            parameterType="FsUserInformationCollectionSchedule"
+            resultMap="FsUserInformationCollectionScheduleResult">
+
+        SELECT s.id, s.collection_id, s.user_id, s.user_name, s.doctor_id, s.doctor_name,
+        s.package_id, s.package_name, s.current_step, s.status, s.create_time,
+        s.completed_time, s.terminated_time, s.terminated_by, s.remark
+        FROM fs_user_information_collection_schedule s
+        <where>
+            <!-- 动态过滤条件 -->
+            <if test="collectionId != null"> AND s.collection_id = #{collectionId}</if>
+            <if test="userId != null"> AND s.user_id = #{userId}</if>
+            <if test="userName != null and userName != ''"> AND s.user_name LIKE CONCAT('%', #{userName}, '%')</if>
+            <if test="doctorId != null"> AND s.doctor_id = #{doctorId}</if>
+            <if test="doctorName != null and doctorName != ''"> AND s.doctor_name LIKE CONCAT('%', #{doctorName}, '%')</if>
+            <if test="packageId != null"> AND s.package_id = #{packageId}</if>
+            <if test="packageName != null and packageName != ''"> AND s.package_name LIKE CONCAT('%', #{packageName}, '%')</if>
+            <if test="currentStep != null"> AND s.current_step = #{currentStep}</if>
+            <if test="status != null"> AND s.status = #{status}</if>
+            <if test="completedTime != null"> AND s.completed_time = #{completedTime}</if>
+            <if test="terminatedTime != null"> AND s.terminated_time = #{terminatedTime}</if>
+            <if test="terminatedBy != null and terminatedBy != ''"> AND s.terminated_by = #{terminatedBy}</if>
+            AND s.id = (
+            SELECT MAX(s2.id)
+            FROM fs_user_information_collection_schedule s2
+            WHERE s2.collection_id = s.collection_id
+            <if test="collectionId != null"> AND s2.collection_id = #{collectionId}</if>
+            <if test="userId != null"> AND s2.user_id = #{userId}</if>
+            <if test="userName != null and userName != ''"> AND s2.user_name LIKE CONCAT('%', #{userName}, '%')</if>
+            <if test="doctorId != null"> AND s2.doctor_id = #{doctorId}</if>
+            <if test="doctorName != null and doctorName != ''"> AND s2.doctor_name LIKE CONCAT('%', #{doctorName}, '%')</if>
+            <if test="packageId != null"> AND s2.package_id = #{packageId}</if>
+            <if test="packageName != null and packageName != ''"> AND s2.package_name LIKE CONCAT('%', #{packageName}, '%')</if>
+            <if test="currentStep != null"> AND s2.current_step = #{currentStep}</if>
+            <if test="status != null"> AND s2.status = #{status}</if>
+            <if test="completedTime != null"> AND s2.completed_time = #{completedTime}</if>
+            <if test="terminatedTime != null"> AND s2.terminated_time = #{terminatedTime}</if>
+            <if test="terminatedBy != null and terminatedBy != ''"> AND s2.terminated_by = #{terminatedBy}</if>
+            )
+        </where>
+    </select>
+    
+    <select id="selectFsUserInformationCollectionScheduleById" parameterType="Long" resultMap="FsUserInformationCollectionScheduleResult">
+        <include refid="selectFsUserInformationCollectionScheduleVo"/>
+        where id = #{id}
+    </select>
+        
+    <insert id="insertFsUserInformationCollectionSchedule" parameterType="FsUserInformationCollectionSchedule" useGeneratedKeys="true" keyProperty="id">
+        insert into fs_user_information_collection_schedule
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="collectionId != null">collection_id,</if>
+            <if test="userId != null">user_id,</if>
+            <if test="userName != null">user_name,</if>
+            <if test="doctorId != null">doctor_id,</if>
+            <if test="doctorName != null">doctor_name,</if>
+            <if test="packageId != null">package_id,</if>
+            <if test="packageName != null">package_name,</if>
+            <if test="currentStep != null">current_step,</if>
+            <if test="status != null">status,</if>
+            <if test="createTime != null">create_time,</if>
+            <if test="completedTime != null">completed_time,</if>
+            <if test="terminatedTime != null">terminated_time,</if>
+            <if test="terminatedBy != null">terminated_by,</if>
+            <if test="remark != null">remark,</if>
+         </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="collectionId != null">#{collectionId},</if>
+            <if test="userId != null">#{userId},</if>
+            <if test="userName != null">#{userName},</if>
+            <if test="doctorId != null">#{doctorId},</if>
+            <if test="doctorName != null">#{doctorName},</if>
+            <if test="packageId != null">#{packageId},</if>
+            <if test="packageName != null">#{packageName},</if>
+            <if test="currentStep != null">#{currentStep},</if>
+            <if test="status != null">#{status},</if>
+            <if test="createTime != null">#{createTime},</if>
+            <if test="completedTime != null">#{completedTime},</if>
+            <if test="terminatedTime != null">#{terminatedTime},</if>
+            <if test="terminatedBy != null">#{terminatedBy},</if>
+            <if test="remark != null">#{remark},</if>
+         </trim>
+    </insert>
+
+    <update id="updateFsUserInformationCollectionSchedule" parameterType="FsUserInformationCollectionSchedule">
+        update fs_user_information_collection_schedule
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="collectionId != null">collection_id = #{collectionId},</if>
+            <if test="userId != null">user_id = #{userId},</if>
+            <if test="userName != null">user_name = #{userName},</if>
+            <if test="doctorId != null">doctor_id = #{doctorId},</if>
+            <if test="doctorName != null">doctor_name = #{doctorName},</if>
+            <if test="packageId != null">package_id = #{packageId},</if>
+            <if test="packageName != null">package_name = #{packageName},</if>
+            <if test="currentStep != null">current_step = #{currentStep},</if>
+            <if test="status != null">status = #{status},</if>
+            <if test="createTime != null">create_time = #{createTime},</if>
+            <if test="completedTime != null">completed_time = #{completedTime},</if>
+            <if test="terminatedTime != null">terminated_time = #{terminatedTime},</if>
+            <if test="terminatedBy != null">terminated_by = #{terminatedBy},</if>
+            <if test="remark != null">remark = #{remark},</if>
+        </trim>
+        where id = #{id}
+    </update>
+
+    <delete id="deleteFsUserInformationCollectionScheduleById" parameterType="Long">
+        delete from fs_user_information_collection_schedule where id = #{id}
+    </delete>
+
+    <delete id="deleteFsUserInformationCollectionScheduleByIds" parameterType="String">
+        delete from fs_user_information_collection_schedule where id in 
+        <foreach item="id" collection="array" open="(" separator="," close=")">
+            #{id}
+        </foreach>
+    </delete>
+</mapper>