|
@@ -0,0 +1,116 @@
|
|
|
|
|
+<?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.qw.mapper.FsCompanyCustomerMapper">
|
|
|
|
|
+
|
|
|
|
|
+ <resultMap type="com.fs.qw.domain.FsCompanyCustomer" id="FsCompanyCustomerResult">
|
|
|
|
|
+ <result property="id" column="id" />
|
|
|
|
|
+ <result property="customerName" column="customer_name" />
|
|
|
|
|
+ <result property="sex" column="sex" />
|
|
|
|
|
+ <result property="age" column="age" />
|
|
|
|
|
+ <result property="address" column="address" />
|
|
|
|
|
+ <result property="phone" column="phone" />
|
|
|
|
|
+ <result property="filingTime" column="filing_time" />
|
|
|
|
|
+ <result property="companyUserId" column="company_user_id" />
|
|
|
|
|
+ <result property="companyUserName" column="company_user_name" />
|
|
|
|
|
+ <result property="appointmentTime" column="appointment_time" />
|
|
|
|
|
+ <result property="doctorId" column="doctor_id" />
|
|
|
|
|
+ <result property="doctorName" column="doctor_name" />
|
|
|
|
|
+ <result property="presentIllness" column="present_illness" />
|
|
|
|
|
+ <result property="currentMedication" column="current_medication" />
|
|
|
|
|
+ <result property="allergyHistory" column="allergy_history" />
|
|
|
|
|
+ <result property="createBy" column="create_by" />
|
|
|
|
|
+ <result property="createTime" column="create_time" />
|
|
|
|
|
+ <result property="updateBy" column="update_by" />
|
|
|
|
|
+ <result property="updateTime" column="update_time" />
|
|
|
|
|
+ <result property="remark" column="remark" />
|
|
|
|
|
+ </resultMap>
|
|
|
|
|
+
|
|
|
|
|
+ <sql id="selectFsCompanyCustomerVo">
|
|
|
|
|
+ select id, customer_name, sex, age, address, phone, filing_time,
|
|
|
|
|
+ company_user_id, company_user_name, appointment_time, doctor_id, doctor_name,
|
|
|
|
|
+ present_illness, current_medication, allergy_history,
|
|
|
|
|
+ create_by, create_time, update_by, update_time, remark, del_flag
|
|
|
|
|
+ from fs_company_customer
|
|
|
|
|
+ </sql>
|
|
|
|
|
+
|
|
|
|
|
+ <select id="selectFsCompanyCustomerList" parameterType="com.fs.qw.domain.FsCompanyCustomer" resultMap="FsCompanyCustomerResult">
|
|
|
|
|
+ <include refid="selectFsCompanyCustomerVo"/>
|
|
|
|
|
+ where del_flag = '0'
|
|
|
|
|
+ <if test="customerName != null and customerName != ''">
|
|
|
|
|
+ and customer_name like concat('%', #{customerName}, '%')
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="phone != null and phone != ''">
|
|
|
|
|
+ and phone like concat('%', #{phone}, '%')
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="companyUserName != null and companyUserName != ''">
|
|
|
|
|
+ and company_user_name like concat('%', #{companyUserName}, '%')
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="companyUserId != null">
|
|
|
|
|
+ and company_user_id = #{companyUserId}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="beginTime != null and beginTime != ''">
|
|
|
|
|
+ and filing_time >= #{params.beginTime}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="endTime != null and endTime != ''">
|
|
|
|
|
+ and filing_time <= #{params.endTime}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ order by filing_time desc
|
|
|
|
|
+ </select>
|
|
|
|
|
+
|
|
|
|
|
+ <select id="selectFsCompanyCustomerById" parameterType="Long" resultMap="FsCompanyCustomerResult">
|
|
|
|
|
+ <include refid="selectFsCompanyCustomerVo"/>
|
|
|
|
|
+ where id = #{id} and del_flag = '0'
|
|
|
|
|
+ </select>
|
|
|
|
|
+
|
|
|
|
|
+ <insert id="insertFsCompanyCustomer" parameterType="com.fs.qw.domain.FsCompanyCustomer" useGeneratedKeys="true" keyProperty="id">
|
|
|
|
|
+ insert into fs_company_customer (
|
|
|
|
|
+ customer_name, sex, age, address, phone, filing_time,
|
|
|
|
|
+ company_user_id, company_user_name, appointment_time, doctor_id, doctor_name,
|
|
|
|
|
+ present_illness, current_medication, allergy_history,
|
|
|
|
|
+ create_by, create_time, remark
|
|
|
|
|
+ ) values (
|
|
|
|
|
+ #{customerName}, #{sex}, #{age}, #{address}, #{phone}, #{filingTime},
|
|
|
|
|
+ #{companyUserId}, #{companyUserName}, #{appointmentTime}, #{doctorId}, #{doctorName},
|
|
|
|
|
+ #{presentIllness}, #{currentMedication}, #{allergyHistory},
|
|
|
|
|
+ #{createBy}, sysdate(), #{remark}
|
|
|
|
|
+ )
|
|
|
|
|
+ </insert>
|
|
|
|
|
+
|
|
|
|
|
+ <update id="updateFsCompanyCustomer" parameterType="com.fs.qw.domain.FsCompanyCustomer">
|
|
|
|
|
+ update fs_company_customer
|
|
|
|
|
+ <set>
|
|
|
|
|
+ <if test="customerName != null and customerName != ''">customer_name = #{customerName},</if>
|
|
|
|
|
+ <if test="sex != null">sex = #{sex},</if>
|
|
|
|
|
+ <if test="age != null">age = #{age},</if>
|
|
|
|
|
+ <if test="address != null">address = #{address},</if>
|
|
|
|
|
+ <if test="phone != null">phone = #{phone},</if>
|
|
|
|
|
+ <if test="filingTime != null">filing_time = #{filingTime},</if>
|
|
|
|
|
+ <if test="companyUserId != null">company_user_id = #{companyUserId},</if>
|
|
|
|
|
+ <if test="companyUserName != null">company_user_name = #{companyUserName},</if>
|
|
|
|
|
+ <if test="appointmentTime != null">appointment_time = #{appointmentTime},</if>
|
|
|
|
|
+ <if test="doctorId != null">doctor_id = #{doctorId},</if>
|
|
|
|
|
+ <if test="doctorName != null">doctor_name = #{doctorName},</if>
|
|
|
|
|
+ <if test="presentIllness != null">present_illness = #{presentIllness},</if>
|
|
|
|
|
+ <if test="currentMedication != null">current_medication = #{currentMedication},</if>
|
|
|
|
|
+ <if test="allergyHistory != null">allergy_history = #{allergyHistory},</if>
|
|
|
|
|
+ <if test="remark != null">remark = #{remark},</if>
|
|
|
|
|
+ <if test="updateBy != null">update_by = #{updateBy},</if>
|
|
|
|
|
+ update_time = sysdate()
|
|
|
|
|
+ </set>
|
|
|
|
|
+ where id = #{id}
|
|
|
|
|
+ </update>
|
|
|
|
|
+
|
|
|
|
|
+ <update id="deleteFsCompanyCustomerById" parameterType="Long">
|
|
|
|
|
+ update fs_company_customer set del_flag = '2' where id = #{id}
|
|
|
|
|
+ </update>
|
|
|
|
|
+
|
|
|
|
|
+ <update id="deleteFsCompanyCustomerByIds" parameterType="String">
|
|
|
|
|
+ update fs_company_customer set del_flag = '2' where id in
|
|
|
|
|
+ <foreach collection="array" item="id" open="(" separator="," close=")">
|
|
|
|
|
+ #{id}
|
|
|
|
|
+ </foreach>
|
|
|
|
|
+ </update>
|
|
|
|
|
+
|
|
|
|
|
+</mapper>
|