|
|
@@ -0,0 +1,151 @@
|
|
|
+<?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.hisStore.mapper.FsUserInformationCollectionPersonalLogMapper">
|
|
|
+
|
|
|
+ <resultMap type="FsUserInformationCollectionPersonalLog" id="FsUserInformationCollectionPersonalLogResult">
|
|
|
+ <result property="id" column="id" />
|
|
|
+ <result property="collectionId" column="collection_id" />
|
|
|
+ <result property="prescribeId" column="prescribe_id" />
|
|
|
+ <result property="questionId" column="question_id" />
|
|
|
+ <result property="userId" column="user_id" />
|
|
|
+ <result property="doctorId" column="doctor_id" />
|
|
|
+ <result property="companyUserId" column="company_user_id" />
|
|
|
+ <result property="packageId" column="package_id" />
|
|
|
+ <result property="packageName" column="package_name" />
|
|
|
+ <result property="payType" column="pay_type" />
|
|
|
+ <result property="amount" column="amount" />
|
|
|
+ <result property="packageOrderCode" column="package_order_code" />
|
|
|
+ <result property="doctorConfirmTime" column="doctor_confirm_time" />
|
|
|
+ <result property="personalCollectStatus" column="personal_collect_status"/>
|
|
|
+ <result property="logType" column="log_type" />
|
|
|
+ <result property="createTime" column="create_time" />
|
|
|
+ <result property="remark" column="remark" />
|
|
|
+ </resultMap>
|
|
|
+
|
|
|
+ <sql id="selectFsUserInformationCollectionPersonalLogVo">
|
|
|
+ select id, collection_id, prescribe_id, question_id, user_id, 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
|
|
|
+ from fs_user_information_collection_personal_log
|
|
|
+ </sql>
|
|
|
+
|
|
|
+ <select id="selectFsUserInformationCollectionPersonalLogList" parameterType="FsUserInformationCollectionPersonalLog" resultMap="FsUserInformationCollectionPersonalLogResult">
|
|
|
+ <include refid="selectFsUserInformationCollectionPersonalLogVo"/>
|
|
|
+ <where>
|
|
|
+ <if test="collectionId != null"> and collection_id = #{collectionId}</if>
|
|
|
+ <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="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>
|
|
|
+ <if test="packageName != null and packageName != ''"> and package_name like concat('%', #{packageName}, '%')</if>
|
|
|
+ <if test="payType != null"> and pay_type = #{payType}</if>
|
|
|
+ <if test="packageOrderCode != null and packageOrderCode != ''"> and package_order_code = #{packageOrderCode}</if>
|
|
|
+ <if test="personalCollectStatus != null"> and personal_collect_status = #{personalCollectStatus}</if>
|
|
|
+ <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>
|
|
|
+
|
|
|
+ <!-- 统计记录数(用于绑定前校验)命中联合唯一索引 -->
|
|
|
+ <select id="countByCollectionIdAndPrescribeId" resultType="int">
|
|
|
+ SELECT COUNT(1)
|
|
|
+ FROM fs_user_information_collection_personal_log
|
|
|
+ WHERE collection_id = #{collectionId}
|
|
|
+ AND prescribe_id = #{prescribeId}
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <!-- 查询绑定详情(获取套餐包等信息)命中联合唯一索引 -->
|
|
|
+ <select id="selectByCollectionIdAndPrescribeId" resultMap="FsUserInformationCollectionPersonalLogResult">
|
|
|
+ <include refid="selectFsUserInformationCollectionPersonalLogVo"/>
|
|
|
+ WHERE collection_id = #{collectionId}
|
|
|
+ AND prescribe_id = #{prescribeId}
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="selectFsUserInformationCollectionPersonalLogById" parameterType="Long" resultMap="FsUserInformationCollectionPersonalLogResult">
|
|
|
+ <include refid="selectFsUserInformationCollectionPersonalLogVo"/>
|
|
|
+ where id = #{id}
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <insert id="insertFsUserInformationCollectionPersonalLog" parameterType="FsUserInformationCollectionPersonalLog" useGeneratedKeys="true" keyProperty="id">
|
|
|
+ insert into fs_user_information_collection_personal_log
|
|
|
+ <trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="collectionId != null">collection_id,</if>
|
|
|
+ <if test="prescribeId != null">prescribe_id,</if>
|
|
|
+ <if test="questionId != null">question_id,</if>
|
|
|
+ <if test="userId != null">user_id,</if>
|
|
|
+ <if test="doctorId != null">doctor_id,</if>
|
|
|
+ <if test="companyUserId != null">company_user_id,</if>
|
|
|
+ <if test="packageId != null">package_id,</if>
|
|
|
+ <if test="packageName != null">package_name,</if>
|
|
|
+ <if test="payType != null">pay_type,</if>
|
|
|
+ <if test="amount != null">amount,</if>
|
|
|
+ <if test="packageOrderCode != null">package_order_code,</if>
|
|
|
+ <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>
|
|
|
+ <if test="remark != null">remark,</if>
|
|
|
+ </trim>
|
|
|
+ <trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="collectionId != null">#{collectionId},</if>
|
|
|
+ <if test="prescribeId != null">#{prescribeId},</if>
|
|
|
+ <if test="questionId != null">#{questionId},</if>
|
|
|
+ <if test="userId != null">#{userId},</if>
|
|
|
+ <if test="doctorId != null">#{doctorId},</if>
|
|
|
+ <if test="companyUserId != null">#{companyUserId},</if>
|
|
|
+ <if test="packageId != null">#{packageId},</if>
|
|
|
+ <if test="packageName != null">#{packageName},</if>
|
|
|
+ <if test="payType != null">#{payType},</if>
|
|
|
+ <if test="amount != null">#{amount},</if>
|
|
|
+ <if test="packageOrderCode != null">#{packageOrderCode},</if>
|
|
|
+ <if test="doctorConfirmTime != null">#{doctorConfirmTime},</if>
|
|
|
+ <if test="personalCollectStatus != null">#{personalCollectStatus},</if>
|
|
|
+ <if test="logType != null">#{logType},</if>
|
|
|
+ <if test="createTime != null">#{createTime},</if>
|
|
|
+ <if test="remark != null">#{remark},</if>
|
|
|
+ </trim>
|
|
|
+ </insert>
|
|
|
+
|
|
|
+ <update id="updateFsUserInformationCollectionPersonalLog" parameterType="FsUserInformationCollectionPersonalLog">
|
|
|
+ update fs_user_information_collection_personal_log
|
|
|
+ <trim prefix="SET" suffixOverrides=",">
|
|
|
+ <if test="collectionId != null">collection_id = #{collectionId},</if>
|
|
|
+ <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="doctorId != null">doctor_id = #{doctorId},</if>
|
|
|
+ <if test="companyUserId != null">company_user_id = #{companyUserId},</if>
|
|
|
+ <if test="packageId != null">package_id = #{packageId},</if>
|
|
|
+ <if test="packageName != null">package_name = #{packageName},</if>
|
|
|
+ <if test="payType != null">pay_type = #{payType},</if>
|
|
|
+ <if test="amount != null">amount = #{amount},</if>
|
|
|
+ <if test="packageOrderCode != null">package_order_code = #{packageOrderCode},</if>
|
|
|
+ <if test="doctorConfirmTime != null">doctor_confirm_time = #{doctorConfirmTime},</if>
|
|
|
+ <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>
|
|
|
+ <if test="remark != null">remark = #{remark},</if>
|
|
|
+ </trim>
|
|
|
+ where id = #{id}
|
|
|
+ </update>
|
|
|
+
|
|
|
+ <delete id="deleteFsUserInformationCollectionPersonalLogById" parameterType="Long">
|
|
|
+ delete from fs_user_information_collection_personal_log where id = #{id}
|
|
|
+ </delete>
|
|
|
+
|
|
|
+ <delete id="deleteFsUserInformationCollectionPersonalLogByIds" parameterType="String">
|
|
|
+ delete from fs_user_information_collection_personal_log where id in
|
|
|
+ <foreach item="id" collection="array" open="(" separator="," close=")">
|
|
|
+ #{id}
|
|
|
+ </foreach>
|
|
|
+ </delete>
|
|
|
+
|
|
|
+</mapper>
|