|
|
@@ -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>
|