|
|
@@ -0,0 +1,101 @@
|
|
|
+<?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.his.mapper.FsPrescribeRecordMapper">
|
|
|
+
|
|
|
+ <resultMap type="FsPrescribeRecord" id="FsPrescribeRecordResult">
|
|
|
+ <result property="id" column="id" />
|
|
|
+ <result property="prescribeImgUrl" column="prescribe_img_url" />
|
|
|
+ <result property="doctorId" column="doctor_id" />
|
|
|
+ <result property="drugDoctorId" column="drug_doctor_id" />
|
|
|
+ <result property="doctorName" column="doctor_name" />
|
|
|
+ <result property="drugDoctorName" column="drug_doctor_name" />
|
|
|
+ <result property="status" column="status" />
|
|
|
+ <result property="auditReason" column="audit_reason" />
|
|
|
+ <result property="createTime" column="create_time" />
|
|
|
+ <result property="updateTime" column="update_time" />
|
|
|
+ <result property="prescribeId" column="prescribe_id" />
|
|
|
+ </resultMap>
|
|
|
+
|
|
|
+ <sql id="selectFsPrescribeRecordVo">
|
|
|
+ select id, prescribe_img_url, doctor_id, drug_doctor_id, doctor_name, drug_doctor_name, status, audit_reason, create_time, update_time, prescribe_id from fs_prescibe_record
|
|
|
+ </sql>
|
|
|
+
|
|
|
+ <select id="selectFsPrescribeRecordById" parameterType="FsPrescribeRecord" resultMap="FsPrescribeRecordResult">
|
|
|
+ <include refid="selectFsPrescribeRecordVo"/>
|
|
|
+ <where>
|
|
|
+ <if test="prescribeImgUrl != null and prescribeImgUrl != ''"> and prescribe_img_url = #{prescribeImgUrl}</if>
|
|
|
+ <if test="doctorId != null "> and doctor_id = #{doctorId}</if>
|
|
|
+ <if test="drugDoctorId != null "> and drug_doctor_id = #{drugDoctorId}</if>
|
|
|
+ <if test="doctorName != null and doctorName != ''"> and doctor_name like concat('%', #{doctorName}, '%')</if>
|
|
|
+ <if test="drugDoctorName != null and drugDoctorName != ''"> and drug_doctor_name like concat('%', #{drugDoctorName}, '%')</if>
|
|
|
+ <if test="status != null "> and status = #{status}</if>
|
|
|
+ <if test="auditReason != null and auditReason != ''"> and audit_reason = #{auditReason}</if>
|
|
|
+ <if test="prescribeId != null "> and prescribe_id = #{prescribeId}</if>
|
|
|
+ </where>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="selectFsPrescribeRecordList" parameterType="Long" resultMap="FsPrescribeRecordResult">
|
|
|
+ <include refid="selectFsPrescribeRecordVo"/>
|
|
|
+ where id = #{id}
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <insert id="insertFsPrescribeRecord" parameterType="FsPrescribeRecord">
|
|
|
+ insert into fs_prescibe_record
|
|
|
+ <trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="id != null">id,</if>
|
|
|
+ <if test="prescribeImgUrl != null">prescribe_img_url,</if>
|
|
|
+ <if test="doctorId != null">doctor_id,</if>
|
|
|
+ <if test="drugDoctorId != null">drug_doctor_id,</if>
|
|
|
+ <if test="doctorName != null">doctor_name,</if>
|
|
|
+ <if test="drugDoctorName != null">drug_doctor_name,</if>
|
|
|
+ <if test="status != null">status,</if>
|
|
|
+ <if test="auditReason != null">audit_reason,</if>
|
|
|
+ <if test="createTime != null">create_time,</if>
|
|
|
+ <if test="updateTime != null">update_time,</if>
|
|
|
+ <if test="prescribeId != null">prescribe_id,</if>
|
|
|
+ </trim>
|
|
|
+ <trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="id != null">#{id},</if>
|
|
|
+ <if test="prescribeImgUrl != null">#{prescribeImgUrl},</if>
|
|
|
+ <if test="doctorId != null">#{doctorId},</if>
|
|
|
+ <if test="drugDoctorId != null">#{drugDoctorId},</if>
|
|
|
+ <if test="doctorName != null">#{doctorName},</if>
|
|
|
+ <if test="drugDoctorName != null">#{drugDoctorName},</if>
|
|
|
+ <if test="status != null">#{status},</if>
|
|
|
+ <if test="auditReason != null">#{auditReason},</if>
|
|
|
+ <if test="createTime != null">#{createTime},</if>
|
|
|
+ <if test="updateTime != null">#{updateTime},</if>
|
|
|
+ <if test="prescribeId != null">#{prescribeId},</if>
|
|
|
+ </trim>
|
|
|
+ </insert>
|
|
|
+
|
|
|
+ <update id="updateFsPrescribeRecord" parameterType="FsPrescribeRecord">
|
|
|
+ update fs_prescibe_record
|
|
|
+ <trim prefix="SET" suffixOverrides=",">
|
|
|
+ <if test="prescribeImgUrl != null">prescribe_img_url = #{prescribeImgUrl},</if>
|
|
|
+ <if test="doctorId != null">doctor_id = #{doctorId},</if>
|
|
|
+ <if test="drugDoctorId != null">drug_doctor_id = #{drugDoctorId},</if>
|
|
|
+ <if test="doctorName != null">doctor_name = #{doctorName},</if>
|
|
|
+ <if test="drugDoctorName != null">drug_doctor_name = #{drugDoctorName},</if>
|
|
|
+ <if test="status != null">status = #{status},</if>
|
|
|
+ <if test="auditReason != null">audit_reason = #{auditReason},</if>
|
|
|
+ <if test="createTime != null">create_time = #{createTime},</if>
|
|
|
+ <if test="updateTime != null">update_time = #{updateTime},</if>
|
|
|
+ <if test="prescribeId != null">prescribe_id = #{prescribeId},</if>
|
|
|
+ </trim>
|
|
|
+ where id = #{id}
|
|
|
+ </update>
|
|
|
+
|
|
|
+ <delete id="deleteFsPrescribeRecordById" parameterType="Long">
|
|
|
+ delete from fs_prescibe_record where id = #{id}
|
|
|
+ </delete>
|
|
|
+
|
|
|
+ <delete id="deleteFsPrescribeRecordByIds" parameterType="String">
|
|
|
+ delete from fs_prescibe_record where id in
|
|
|
+ <foreach item="id" collection="array" open="(" separator="," close=")">
|
|
|
+ #{id}
|
|
|
+ </foreach>
|
|
|
+ </delete>
|
|
|
+</mapper>
|