|
|
@@ -5,29 +5,36 @@
|
|
|
<mapper namespace="com.fs.handwrite.mapper.HandwriteCollectionMapper">
|
|
|
|
|
|
<resultMap type="HandwriteCollection" id="HandwriteCollectionResult">
|
|
|
- <result property="id" column="id" />
|
|
|
- <result property="patientName" column="patient_name" />
|
|
|
- <result property="patientPhone" column="patient_phone" />
|
|
|
- <result property="createTime" column="create_time" />
|
|
|
- <result property="updateTime" column="update_time" />
|
|
|
- <result property="billImgUrl" column="bill_img_url" />
|
|
|
- <result property="orderCode" column="order_code" />
|
|
|
+ <result property="id" column="id" />
|
|
|
+ <result property="patientName" column="patient_name" />
|
|
|
+ <result property="patientPhone" column="patient_phone" />
|
|
|
+ <result property="createTime" column="create_time" />
|
|
|
+ <result property="updateTime" column="update_time" />
|
|
|
+ <result property="billImgUrl" column="bill_img_url" />
|
|
|
+ <result property="orderCode" column="order_code" />
|
|
|
+ <result property="createBy" column="create_by" />
|
|
|
+ <result property="updateBy" column="update_by" />
|
|
|
+ <result property="companyUserId" column="company_user_id"/>
|
|
|
</resultMap>
|
|
|
|
|
|
<sql id="selectHandwriteCollectionVo">
|
|
|
- select id, patient_name, patient_phone, create_time, update_time, bill_img_url, order_code
|
|
|
+ select id, patient_name, patient_phone, create_time, update_time, bill_img_url, order_code, create_by, update_by, company_user_id
|
|
|
from fs_handwrite_collection
|
|
|
</sql>
|
|
|
|
|
|
<select id="selectHandwriteCollectionList" parameterType="HandwriteCollection" resultMap="HandwriteCollectionResult">
|
|
|
- <include refid="selectHandwriteCollectionVo"/>
|
|
|
+ select hc.id, hc.patient_name, hc.patient_phone, hc.create_time, hc.update_time,
|
|
|
+ hc.bill_img_url, hc.order_code, hc.create_by, hc.update_by, hc.company_user_id,
|
|
|
+ cu.nick_name as companyUserName
|
|
|
+ from fs_handwrite_collection hc left join company_user cu on cu.user_id = hc.company_user_id
|
|
|
<where>
|
|
|
- <if test="patientName != null and patientName != ''"> and patient_name like concat('%', #{patientName}, '%')</if>
|
|
|
- <if test="patientPhone != null and patientPhone != ''"> and patient_phone like concat('%', #{patientPhone}, '%')</if>
|
|
|
- <if test="orderCode != null and orderCode != ''"> and order_code = #{orderCode}</if>
|
|
|
- <if test="billImgUrl != null and billImgUrl != ''"> and bill_img_url = #{billImgUrl}</if>
|
|
|
+ <if test="patientName != null and patientName != ''"> and hc.patient_name like concat('%', #{patientName}, '%')</if>
|
|
|
+ <if test="patientPhone != null and patientPhone != ''"> and hc.patient_phone like concat('%', #{patientPhone}, '%')</if>
|
|
|
+ <if test="companyUserName != null and companyUserName != ''"> and cu.nick_name like concat('%', #{companyUserName}, '%')</if>
|
|
|
+ <if test="orderCode != null and orderCode != ''"> and hc.order_code = #{orderCode}</if>
|
|
|
+ <if test="billImgUrl != null and billImgUrl != ''"> and hc.bill_img_url = #{billImgUrl}</if>
|
|
|
</where>
|
|
|
- order by create_time desc
|
|
|
+ order by hc.create_time desc
|
|
|
</select>
|
|
|
|
|
|
<select id="selectHandwriteCollectionById" parameterType="Integer" resultMap="HandwriteCollectionResult">
|
|
|
@@ -44,6 +51,9 @@
|
|
|
<if test="updateTime != null">update_time,</if>
|
|
|
<if test="billImgUrl != null">bill_img_url,</if>
|
|
|
<if test="orderCode != null">order_code,</if>
|
|
|
+ <if test="createBy != null">create_by,</if>
|
|
|
+ <if test="updateBy != null">update_by,</if>
|
|
|
+ <if test="companyUserId != null">company_user_id,</if>
|
|
|
</trim>
|
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
<if test="patientName != null">#{patientName},</if>
|
|
|
@@ -52,6 +62,9 @@
|
|
|
<if test="updateTime != null">#{updateTime},</if>
|
|
|
<if test="billImgUrl != null">#{billImgUrl},</if>
|
|
|
<if test="orderCode != null">#{orderCode},</if>
|
|
|
+ <if test="createBy != null">#{createBy},</if>
|
|
|
+ <if test="updateBy != null">#{updateBy},</if>
|
|
|
+ <if test="companyUserId != null">#{companyUserId},</if>
|
|
|
</trim>
|
|
|
</insert>
|
|
|
|
|
|
@@ -64,6 +77,9 @@
|
|
|
<if test="updateTime != null">update_time = #{updateTime},</if>
|
|
|
<if test="billImgUrl != null">bill_img_url = #{billImgUrl},</if>
|
|
|
<if test="orderCode != null">order_code = #{orderCode},</if>
|
|
|
+ <if test="createBy != null">create_by = #{createBy},</if>
|
|
|
+ <if test="updateBy != null">update_by = #{updateBy},</if>
|
|
|
+ <if test="companyUserId != null">company_user_id = #{companyUserId},</if>
|
|
|
</trim>
|
|
|
where id = #{id}
|
|
|
</update>
|