|
|
@@ -0,0 +1,84 @@
|
|
|
+<?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.doctor.mapper.DoctorMsgMapper">
|
|
|
+
|
|
|
+ <resultMap type="DoctorMsg" id="DoctorMsgResult">
|
|
|
+ <result property="id" column="id" />
|
|
|
+ <result property="type" column="type" />
|
|
|
+ <result property="title" column="title" />
|
|
|
+ <result property="content" column="content" />
|
|
|
+ <result property="createTime" column="create_time" />
|
|
|
+ <result property="isRead" column="is_read" />
|
|
|
+ <result property="updateTime" column="update_time" />
|
|
|
+ <result property="doctorId" column="doctor_id" />
|
|
|
+ </resultMap>
|
|
|
+
|
|
|
+ <sql id="selectDoctorMsgVo">
|
|
|
+ select id, type, title, content, create_time, is_read, update_time, doctor_id from doctor_msg
|
|
|
+ </sql>
|
|
|
+
|
|
|
+ <select id="selectDoctorMsgList" parameterType="DoctorMsg" resultMap="DoctorMsgResult">
|
|
|
+ <include refid="selectDoctorMsgVo"/>
|
|
|
+ <where>
|
|
|
+ <if test="type != null "> and type = #{type}</if>
|
|
|
+ <if test="title != null and title != ''"> and title = #{title}</if>
|
|
|
+ <if test="content != null and content != ''"> and content = #{content}</if>
|
|
|
+ <if test="isRead != null "> and is_read = #{isRead}</if>
|
|
|
+ <if test="doctorId != null "> and doctor_id = #{doctorId}</if>
|
|
|
+ </where>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="selectDoctorMsgById" parameterType="Long" resultMap="DoctorMsgResult">
|
|
|
+ <include refid="selectDoctorMsgVo"/>
|
|
|
+ where id = #{id}
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <insert id="insertDoctorMsg" parameterType="DoctorMsg" useGeneratedKeys="true" keyProperty="id">
|
|
|
+ insert into doctor_msg
|
|
|
+ <trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="type != null">type,</if>
|
|
|
+ <if test="title != null">title,</if>
|
|
|
+ <if test="content != null">content,</if>
|
|
|
+ <if test="createTime != null">create_time,</if>
|
|
|
+ <if test="isRead != null">is_read,</if>
|
|
|
+ <if test="updateTime != null">update_time,</if>
|
|
|
+ <if test="doctorId != null">doctor_id,</if>
|
|
|
+ </trim>
|
|
|
+ <trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="type != null">#{type},</if>
|
|
|
+ <if test="title != null">#{title},</if>
|
|
|
+ <if test="content != null">#{content},</if>
|
|
|
+ <if test="createTime != null">#{createTime},</if>
|
|
|
+ <if test="isRead != null">#{isRead},</if>
|
|
|
+ <if test="updateTime != null">#{updateTime},</if>
|
|
|
+ <if test="doctorId != null">#{doctorId},</if>
|
|
|
+ </trim>
|
|
|
+ </insert>
|
|
|
+
|
|
|
+ <update id="updateDoctorMsg" parameterType="DoctorMsg">
|
|
|
+ update doctor_msg
|
|
|
+ <trim prefix="SET" suffixOverrides=",">
|
|
|
+ <if test="type != null">type = #{type},</if>
|
|
|
+ <if test="title != null">title = #{title},</if>
|
|
|
+ <if test="content != null">content = #{content},</if>
|
|
|
+ <if test="createTime != null">create_time = #{createTime},</if>
|
|
|
+ <if test="isRead != null">is_read = #{isRead},</if>
|
|
|
+ <if test="updateTime != null">update_time = #{updateTime},</if>
|
|
|
+ <if test="doctorId != null">doctor_id = #{doctorId},</if>
|
|
|
+ </trim>
|
|
|
+ where id = #{id}
|
|
|
+ </update>
|
|
|
+
|
|
|
+ <delete id="deleteDoctorMsgById" parameterType="Long">
|
|
|
+ delete from doctor_msg where id = #{id}
|
|
|
+ </delete>
|
|
|
+
|
|
|
+ <delete id="deleteDoctorMsgByIds" parameterType="String">
|
|
|
+ delete from doctor_msg where id in
|
|
|
+ <foreach item="id" collection="array" open="(" separator="," close=")">
|
|
|
+ #{id}
|
|
|
+ </foreach>
|
|
|
+ </delete>
|
|
|
+</mapper>
|