|
|
@@ -8,9 +8,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<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" />
|
|
|
@@ -20,45 +18,82 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<result property="terminatedTime" column="terminated_time" />
|
|
|
<result property="terminatedBy" column="terminated_by" />
|
|
|
<result property="remark" column="remark" />
|
|
|
+ <result property="orderCode" column="order_code" />
|
|
|
</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
|
|
|
+ select id, collection_id, user_id, doctor_id, package_id, package_name, current_step, status, create_time, completed_time, terminated_time, terminated_by, remark,order_code from fs_user_information_collection_schedule
|
|
|
</sql>
|
|
|
|
|
|
<select id="selectFsUserInformationCollectionScheduleList" parameterType="FsUserInformationCollectionSchedule" resultMap="FsUserInformationCollectionScheduleResult">
|
|
|
- <include refid="selectFsUserInformationCollectionScheduleVo"/>
|
|
|
+ SELECT
|
|
|
+ s.id,
|
|
|
+ s.collection_id,
|
|
|
+ s.user_id,
|
|
|
+ c.user_name,
|
|
|
+ s.doctor_id,
|
|
|
+ d.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,
|
|
|
+ s.order_code
|
|
|
+ FROM
|
|
|
+ fs_user_information_collection_schedule s
|
|
|
+ LEFT JOIN fs_user_information_collection c ON s.collection_id = c.id
|
|
|
+ LEFT JOIN fs_doctor d ON s.doctor_id = d.doctor_id
|
|
|
<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>
|
|
|
+ <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 c.user_name LIKE CONCAT('%', #{userName}, '%')</if>
|
|
|
+ <if test="doctorId != null"> AND s.doctor_id = #{doctorId}</if>
|
|
|
+ <if test="doctorName != null and doctorName != ''"> AND d.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>
|
|
|
</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
|
|
|
+ SELECT
|
|
|
+ s.id,
|
|
|
+ s.collection_id,
|
|
|
+ s.user_id,
|
|
|
+ c.user_name,
|
|
|
+ s.doctor_id,
|
|
|
+ d.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,
|
|
|
+ s.order_code
|
|
|
+ FROM
|
|
|
+ fs_user_information_collection_schedule s
|
|
|
+ LEFT JOIN fs_user_information_collection c ON s.collection_id = c.id
|
|
|
+ LEFT JOIN fs_doctor d ON s.doctor_id = d.doctor_id
|
|
|
<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="userName != null and userName != ''"> AND c.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="doctorName != null and doctorName != ''"> AND d.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>
|
|
|
@@ -72,9 +107,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
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="userName != null and userName != ''"> AND c.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="doctorName != null and doctorName != ''"> AND d.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>
|
|
|
@@ -90,15 +125,29 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<include refid="selectFsUserInformationCollectionScheduleVo"/>
|
|
|
where id = #{id}
|
|
|
</select>
|
|
|
-
|
|
|
+
|
|
|
+ <select id="selectFsUserInformationCollectionScheduleByCollectionId" parameterType="Long" resultMap="FsUserInformationCollectionScheduleResult">
|
|
|
+ SELECT
|
|
|
+ id, collection_id, user_id, doctor_id,
|
|
|
+ package_id, package_name, current_step, status, create_time,
|
|
|
+ completed_time, terminated_time, terminated_by, remark,order_code
|
|
|
+ FROM fs_user_information_collection_schedule
|
|
|
+ WHERE collection_id = #{collectionId}
|
|
|
+ ORDER BY id DESC
|
|
|
+ LIMIT 1
|
|
|
+ </select>
|
|
|
+ <select id="selectFsUserInformationCollectionByOrderCode" parameterType="String" resultMap="FsUserInformationCollectionScheduleResult">
|
|
|
+ <include refid="selectFsUserInformationCollectionScheduleVo"/>
|
|
|
+ where order_code = #{orderCode}
|
|
|
+ </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>
|
|
|
@@ -108,13 +157,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="terminatedTime != null">terminated_time,</if>
|
|
|
<if test="terminatedBy != null">terminated_by,</if>
|
|
|
<if test="remark != null">remark,</if>
|
|
|
+ <if test="orderCode != null">order_code,</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>
|
|
|
@@ -124,6 +172,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="terminatedTime != null">#{terminatedTime},</if>
|
|
|
<if test="terminatedBy != null">#{terminatedBy},</if>
|
|
|
<if test="remark != null">#{remark},</if>
|
|
|
+ <if test="orderCode != null">#{orderCode},</if>
|
|
|
</trim>
|
|
|
</insert>
|
|
|
|
|
|
@@ -132,9 +181,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<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>
|
|
|
@@ -144,6 +191,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="terminatedTime != null">terminated_time = #{terminatedTime},</if>
|
|
|
<if test="terminatedBy != null">terminated_by = #{terminatedBy},</if>
|
|
|
<if test="remark != null">remark = #{remark},</if>
|
|
|
+ <if test="orderCode != null">order_code = #{orderCode},</if>
|
|
|
</trim>
|
|
|
where id = #{id}
|
|
|
</update>
|