|
@@ -0,0 +1,82 @@
|
|
|
|
|
+<?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.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" />
|
|
|
|
|
+ </resultMap>
|
|
|
|
|
+
|
|
|
|
|
+ <sql id="selectHandwriteCollectionVo">
|
|
|
|
|
+ select id, patient_name, patient_phone, create_time, update_time, bill_img_url, order_code
|
|
|
|
|
+ from fs_handwrite_collection
|
|
|
|
|
+ </sql>
|
|
|
|
|
+
|
|
|
|
|
+ <select id="selectHandwriteCollectionList" parameterType="HandwriteCollection" resultMap="HandwriteCollectionResult">
|
|
|
|
|
+ <include refid="selectHandwriteCollectionVo"/>
|
|
|
|
|
+ <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>
|
|
|
|
|
+ </where>
|
|
|
|
|
+ order by create_time desc
|
|
|
|
|
+ </select>
|
|
|
|
|
+
|
|
|
|
|
+ <select id="selectHandwriteCollectionById" parameterType="Integer" resultMap="HandwriteCollectionResult">
|
|
|
|
|
+ <include refid="selectHandwriteCollectionVo"/>
|
|
|
|
|
+ where id = #{id}
|
|
|
|
|
+ </select>
|
|
|
|
|
+
|
|
|
|
|
+ <insert id="insertHandwriteCollection" parameterType="HandwriteCollection" useGeneratedKeys="true" keyProperty="id">
|
|
|
|
|
+ insert into fs_handwrite_collection
|
|
|
|
|
+ <trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
|
|
+ <if test="patientName != null">patient_name,</if>
|
|
|
|
|
+ <if test="patientPhone != null">patient_phone,</if>
|
|
|
|
|
+ <if test="createTime != null">create_time,</if>
|
|
|
|
|
+ <if test="updateTime != null">update_time,</if>
|
|
|
|
|
+ <if test="billImgUrl != null">bill_img_url,</if>
|
|
|
|
|
+ <if test="orderCode != null">order_code,</if>
|
|
|
|
|
+ </trim>
|
|
|
|
|
+ <trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
|
|
+ <if test="patientName != null">#{patientName},</if>
|
|
|
|
|
+ <if test="patientPhone != null">#{patientPhone},</if>
|
|
|
|
|
+ <if test="createTime != null">#{createTime},</if>
|
|
|
|
|
+ <if test="updateTime != null">#{updateTime},</if>
|
|
|
|
|
+ <if test="billImgUrl != null">#{billImgUrl},</if>
|
|
|
|
|
+ <if test="orderCode != null">#{orderCode},</if>
|
|
|
|
|
+ </trim>
|
|
|
|
|
+ </insert>
|
|
|
|
|
+
|
|
|
|
|
+ <update id="updateHandwriteCollection" parameterType="HandwriteCollection">
|
|
|
|
|
+ update fs_handwrite_collection
|
|
|
|
|
+ <trim prefix="SET" suffixOverrides=",">
|
|
|
|
|
+ <if test="patientName != null">patient_name = #{patientName},</if>
|
|
|
|
|
+ <if test="patientPhone != null">patient_phone = #{patientPhone},</if>
|
|
|
|
|
+ <if test="createTime != null">create_time = #{createTime},</if>
|
|
|
|
|
+ <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>
|
|
|
|
|
+ </trim>
|
|
|
|
|
+ where id = #{id}
|
|
|
|
|
+ </update>
|
|
|
|
|
+
|
|
|
|
|
+ <delete id="deleteHandwriteCollectionById" parameterType="Integer">
|
|
|
|
|
+ delete from fs_handwrite_collection where id = #{id}
|
|
|
|
|
+ </delete>
|
|
|
|
|
+
|
|
|
|
|
+ <delete id="deleteHandwriteCollectionByIds" parameterType="String">
|
|
|
|
|
+ delete from fs_handwrite_collection where id in
|
|
|
|
|
+ <foreach item="id" collection="array" open="(" separator="," close=")">
|
|
|
|
|
+ #{id}
|
|
|
|
|
+ </foreach>
|
|
|
|
|
+ </delete>
|
|
|
|
|
+
|
|
|
|
|
+</mapper>
|