|
|
@@ -0,0 +1,157 @@
|
|
|
+<?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.FsSopDoctorTaskMapper">
|
|
|
+
|
|
|
+ <resultMap type="FsSopDoctorTask" id="FsSopDoctorTaskResult">
|
|
|
+ <result property="id" column="id" />
|
|
|
+ <result property="companyUserId" column="company_user_id" />
|
|
|
+ <result property="userId" column="user_id" />
|
|
|
+ <result property="status" column="status" />
|
|
|
+ <result property="createTime" column="create_time" />
|
|
|
+ <result property="updateTime" column="update_time" />
|
|
|
+ <result property="remark" column="remark" />
|
|
|
+ <result property="packageId" column="package_id" />
|
|
|
+ <result property="orderCode" column="order_code" />
|
|
|
+ <result property="standbyId" column="standby_id" />
|
|
|
+ </resultMap>
|
|
|
+
|
|
|
+ <resultMap type="com.fs.his.vo.SopDoctorTaskVo" id="SopDoctorTaskVoResult">
|
|
|
+ <!-- 主键可 -->
|
|
|
+ <result property="id" column="id" />
|
|
|
+ <!-- fs_sop_doctor_task 表字段 -->
|
|
|
+ <result property="packageId" column="package_id" />
|
|
|
+ <result property="orderCode" column="order_code" />
|
|
|
+ <result property="companyUserId" column="company_user_id" />
|
|
|
+ <result property="doctorId" column="doctor_id" />
|
|
|
+ <result property="userId" column="user_id" />
|
|
|
+ <result property="status" column="status" />
|
|
|
+ <result property="remark" column="remark" />
|
|
|
+ <result property="createTime" column="create_time" />
|
|
|
+ <result property="updateTime" column="update_time" />
|
|
|
+
|
|
|
+ <!-- 关联表字段 -->
|
|
|
+ <result property="name" column="name" /> <!-- qwec.name -->
|
|
|
+ <result property="companyUserName" column="company_user_name" /> <!-- cp.nick_name -->
|
|
|
+ <result property="avatar" column="avatar" />
|
|
|
+ <result property="phone" column="phone" />
|
|
|
+ </resultMap>
|
|
|
+
|
|
|
+ <sql id="selectFsSopDoctorTaskVo">
|
|
|
+ select id, company_user_id, user_id, status, create_time, update_time, remark, package_id, order_code, standby_id from fs_sop_doctor_task
|
|
|
+ </sql>
|
|
|
+
|
|
|
+ <select id="selectFsSopDoctorTaskVoList" parameterType="com.fs.his.vo.SopDoctorTaskVo" resultMap="SopDoctorTaskVoResult">
|
|
|
+ SELECT
|
|
|
+ sdt.id,
|
|
|
+ sdt.user_id,
|
|
|
+ qwec.name,
|
|
|
+ qwec.avatar,
|
|
|
+ fu.phone,
|
|
|
+ cp.nick_name as company_user_name,
|
|
|
+ cp.user_id as company_user_id,
|
|
|
+ sdt.status,
|
|
|
+ sdt.create_time,
|
|
|
+ sdt.update_time,
|
|
|
+ sdt.remark
|
|
|
+ FROM
|
|
|
+ fs_sop_doctor_task sdt
|
|
|
+ LEFT JOIN company_user cp ON sdt.company_user_id = cp.user_id
|
|
|
+ LEFT JOIN qw_external_contact qwec ON sdt.user_id = qwec.id
|
|
|
+ LEFT JOIN fs_user fu ON qwec.fs_user_id = fu.user_id
|
|
|
+ <where>
|
|
|
+ <if test="id != null "> and sct.id = #{id}</if>
|
|
|
+ <if test="doctorId != null "> and sdt.doctor_id = #{doctorId}</if>
|
|
|
+ <if test="userId != null "> and sdt.user_id = #{userId}</if>
|
|
|
+ <if test="packageId != null "> and sdt.package_id = #{packageId}</if>
|
|
|
+ <if test="orderCode != null "> and sdt.order_code = #{orderCode}</if>
|
|
|
+ <if test="companyUserId != null "> and sct.company_user_id = #{companyUserId}</if>
|
|
|
+ <if test="status != null "> and sdt.status = #{status}</if>
|
|
|
+ <if test="qwUserId != null "> and qwec.qw_user_id = #{qwUserId}</if>
|
|
|
+ <if test="name != null "> and qwec.name like concat('%', #{name}, '%')</if>
|
|
|
+ <if test="companyUserName != null "> and cp.nick_name like concat('%', #{companyUserName}, '%')</if>
|
|
|
+ <if test="beginTime != null and beginTime != ''">
|
|
|
+ and sdt.create_time >= str_to_date(#{beginTime}, '%Y-%m-%d %H:%i:%s')
|
|
|
+ </if>
|
|
|
+ <if test="endTime != null and endTime != ''">
|
|
|
+ and sdt.create_time <= str_to_date(#{endTime}, '%Y-%m-%d %H:%i:%s')
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ ORDER BY sdt.id DESC
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="selectFsSopDoctorTaskById" parameterType="Long" resultMap="SopDoctorTaskVoResult">
|
|
|
+ SELECT
|
|
|
+ sdt.id,
|
|
|
+ sdt.user_id,
|
|
|
+ qwec.name,
|
|
|
+ qwec.avatar,
|
|
|
+ fu.phone,
|
|
|
+ cp.nick_name as company_user_name,
|
|
|
+ cp.user_id as company_user_id,
|
|
|
+ sdt.status,
|
|
|
+ sdt.create_time,
|
|
|
+ sdt.update_time,
|
|
|
+ sdt.remark
|
|
|
+ FROM
|
|
|
+ fs_sop_doctor_task sdt
|
|
|
+ LEFT JOIN company_user cp ON sdt.company_user_id = cp.user_id
|
|
|
+ LEFT JOIN qw_external_contact qwec ON sdt.user_id = qwec.id
|
|
|
+ LEFT JOIN fs_user fu ON qwec.fs_user_id = fu.user_id
|
|
|
+ where sdt.id = #{id}
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <insert id="insertFsSopDoctorTask" parameterType="FsSopDoctorTask" useGeneratedKeys="true" keyProperty="id">
|
|
|
+ insert into fs_sop_doctor_task
|
|
|
+ <trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="companyUserId != null">company_user_id,</if>
|
|
|
+ <if test="userId != null">user_id,</if>
|
|
|
+ <if test="status != null">status,</if>
|
|
|
+ <if test="createTime != null">create_time,</if>
|
|
|
+ <if test="updateTime != null">update_time,</if>
|
|
|
+ <if test="remark != null">remark,</if>
|
|
|
+ <if test="packageId != null">package_id,</if>
|
|
|
+ <if test="orderCode != null">order_code,</if>
|
|
|
+ <if test="standbyId != null">standby_id,</if>
|
|
|
+ </trim>
|
|
|
+ <trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="companyUserId != null">#{companyUserId},</if>
|
|
|
+ <if test="userId != null">#{userId},</if>
|
|
|
+ <if test="status != null">#{status},</if>
|
|
|
+ <if test="createTime != null">#{createTime},</if>
|
|
|
+ <if test="updateTime != null">#{updateTime},</if>
|
|
|
+ <if test="remark != null">#{remark},</if>
|
|
|
+ <if test="packageId != null">#{packageId},</if>
|
|
|
+ <if test="orderCode != null">#{orderCode},</if>
|
|
|
+ <if test="standbyId != null">#{standbyId},</if>
|
|
|
+ </trim>
|
|
|
+ </insert>
|
|
|
+
|
|
|
+ <update id="updateFsSopDoctorTask" parameterType="FsSopDoctorTask">
|
|
|
+ update fs_sop_doctor_task
|
|
|
+ <trim prefix="SET" suffixOverrides=",">
|
|
|
+ <if test="companyUserId != null">company_user_id = #{companyUserId},</if>
|
|
|
+ <if test="userId != null">user_id = #{userId},</if>
|
|
|
+ <if test="status != null">status = #{status},</if>
|
|
|
+ <if test="createTime != null">create_time = #{createTime},</if>
|
|
|
+ <if test="updateTime != null">update_time = #{updateTime},</if>
|
|
|
+ <if test="remark != null">remark = #{remark},</if>
|
|
|
+ <if test="packageId != null">package_id = #{packageId},</if>
|
|
|
+ <if test="orderCode != null">order_code = #{orderCode},</if>
|
|
|
+ <if test="standbyId != null">standby_id = #{standbyId},</if>
|
|
|
+ </trim>
|
|
|
+ where id = #{id}
|
|
|
+ </update>
|
|
|
+
|
|
|
+ <delete id="deleteFsSopDoctorTaskById" parameterType="Long">
|
|
|
+ delete from fs_sop_doctor_task where id = #{id}
|
|
|
+ </delete>
|
|
|
+
|
|
|
+ <delete id="deleteFsSopDoctorTaskByIds" parameterType="String">
|
|
|
+ delete from fs_sop_doctor_task where id in
|
|
|
+ <foreach item="id" collection="array" open="(" separator="," close=")">
|
|
|
+ #{id}
|
|
|
+ </foreach>
|
|
|
+ </delete>
|
|
|
+</mapper>
|