|
|
@@ -10,6 +10,7 @@
|
|
|
<result property="prescribeId" column="prescribe_id" />
|
|
|
<result property="questionId" column="question_id" />
|
|
|
<result property="userId" column="user_id" />
|
|
|
+ <result property="userName" column="user_name" />
|
|
|
<result property="doctorId" column="doctor_id" />
|
|
|
<result property="companyUserId" column="company_user_id" />
|
|
|
<result property="packageId" column="package_id" />
|
|
|
@@ -21,14 +22,16 @@
|
|
|
<result property="personalCollectStatus" column="personal_collect_status"/>
|
|
|
<result property="logType" column="log_type" />
|
|
|
<result property="createTime" column="create_time" />
|
|
|
+ <result property="updateTime" column="update_time" />
|
|
|
+ <result property="operatorId" column="operator_id" />
|
|
|
<result property="remark" column="remark" />
|
|
|
</resultMap>
|
|
|
|
|
|
<sql id="selectFsUserInformationCollectionPersonalLogVo">
|
|
|
- select id, collection_id, prescribe_id, question_id, user_id, doctor_id,
|
|
|
+ select id, collection_id, prescribe_id, question_id, user_id,user_name, doctor_id,
|
|
|
company_user_id, package_id, package_name, pay_type, amount,
|
|
|
package_order_code, doctor_confirm_time, personal_collect_status,
|
|
|
- log_type, create_time, remark
|
|
|
+ log_type, create_time, update_time, operator_id, remark
|
|
|
from fs_user_information_collection_personal_log
|
|
|
</sql>
|
|
|
|
|
|
@@ -39,6 +42,7 @@
|
|
|
<if test="prescribeId != null"> and prescribe_id = #{prescribeId}</if>
|
|
|
<if test="questionId != null"> and question_id = #{questionId}</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="companyUserId != null"> and company_user_id = #{companyUserId}</if>
|
|
|
<if test="packageId != null"> and package_id = #{packageId}</if>
|
|
|
@@ -49,7 +53,6 @@
|
|
|
<if test="logType != null"> and log_type = #{logType}</if>
|
|
|
<if test="remark != null and remark != ''"> and remark like concat('%', #{remark}, '%')</if>
|
|
|
<if test="doctorConfirmTime != null"> and doctor_confirm_time >= #{doctorConfirmTime}</if>
|
|
|
- <!-- 如果需要时间段查询,可自行扩展 -->
|
|
|
</where>
|
|
|
order by create_time desc
|
|
|
</select>
|
|
|
@@ -72,7 +75,7 @@
|
|
|
<select id="selectLatestByCollectionId" parameterType="Long" resultMap="FsUserInformationCollectionPersonalLogResult">
|
|
|
<include refid="selectFsUserInformationCollectionPersonalLogVo"/>
|
|
|
WHERE collection_id = #{collectionId}
|
|
|
- ORDER BY create_time DESC
|
|
|
+ ORDER BY create_time DESC, id DESC
|
|
|
LIMIT 1
|
|
|
</select>
|
|
|
|
|
|
@@ -88,6 +91,7 @@
|
|
|
<if test="prescribeId != null">prescribe_id,</if>
|
|
|
<if test="questionId != null">question_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="companyUserId != null">company_user_id,</if>
|
|
|
<if test="packageId != null">package_id,</if>
|
|
|
@@ -98,7 +102,12 @@
|
|
|
<if test="doctorConfirmTime != null">doctor_confirm_time,</if>
|
|
|
<if test="personalCollectStatus != null">personal_collect_status,</if>
|
|
|
<if test="logType != null">log_type,</if>
|
|
|
- <if test="createTime != null">create_time,</if>
|
|
|
+ <choose>
|
|
|
+ <when test="createTime != null">create_time,</when>
|
|
|
+ <otherwise>create_time,</otherwise>
|
|
|
+ </choose>
|
|
|
+ <if test="updateTime != null">update_time,</if>
|
|
|
+ <if test="operatorId != null">operator_id,</if>
|
|
|
<if test="remark != null">remark,</if>
|
|
|
</trim>
|
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
@@ -106,6 +115,7 @@
|
|
|
<if test="prescribeId != null">#{prescribeId},</if>
|
|
|
<if test="questionId != null">#{questionId},</if>
|
|
|
<if test="userId != null">#{userId},</if>
|
|
|
+ <if test="userName != null">#{userName},</if>
|
|
|
<if test="doctorId != null">#{doctorId},</if>
|
|
|
<if test="companyUserId != null">#{companyUserId},</if>
|
|
|
<if test="packageId != null">#{packageId},</if>
|
|
|
@@ -116,7 +126,12 @@
|
|
|
<if test="doctorConfirmTime != null">#{doctorConfirmTime},</if>
|
|
|
<if test="personalCollectStatus != null">#{personalCollectStatus},</if>
|
|
|
<if test="logType != null">#{logType},</if>
|
|
|
- <if test="createTime != null">#{createTime},</if>
|
|
|
+ <choose>
|
|
|
+ <when test="createTime != null">#{createTime},</when>
|
|
|
+ <otherwise>NOW(),</otherwise>
|
|
|
+ </choose>
|
|
|
+ <if test="updateTime != null">#{updateTime},</if>
|
|
|
+ <if test="operatorId != null">#{operatorId},</if>
|
|
|
<if test="remark != null">#{remark},</if>
|
|
|
</trim>
|
|
|
</insert>
|
|
|
@@ -128,6 +143,7 @@
|
|
|
<if test="prescribeId != null">prescribe_id = #{prescribeId},</if>
|
|
|
<if test="questionId != null">question_id = #{questionId},</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="companyUserId != null">company_user_id = #{companyUserId},</if>
|
|
|
<if test="packageId != null">package_id = #{packageId},</if>
|
|
|
@@ -139,6 +155,8 @@
|
|
|
<if test="personalCollectStatus != null">personal_collect_status = #{personalCollectStatus},</if>
|
|
|
<if test="logType != null">log_type = #{logType},</if>
|
|
|
<if test="createTime != null">create_time = #{createTime},</if>
|
|
|
+ update_time = COALESCE(#{updateTime}, NOW()),
|
|
|
+ <if test="operatorId != null">operator_id = #{operatorId},</if>
|
|
|
<if test="remark != null">remark = #{remark},</if>
|
|
|
</trim>
|
|
|
where id = #{id}
|
|
|
@@ -148,9 +166,9 @@
|
|
|
delete from fs_user_information_collection_personal_log where id = #{id}
|
|
|
</delete>
|
|
|
|
|
|
- <delete id="deleteFsUserInformationCollectionPersonalLogByIds" parameterType="String">
|
|
|
+ <delete id="deleteFsUserInformationCollectionPersonalLogByIds" parameterType="java.util.List">
|
|
|
delete from fs_user_information_collection_personal_log where id in
|
|
|
- <foreach item="id" collection="array" open="(" separator="," close=")">
|
|
|
+ <foreach item="id" collection="list" open="(" separator="," close=")">
|
|
|
#{id}
|
|
|
</foreach>
|
|
|
</delete>
|