<?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.smartor.mapper.PatServiceContractMapper">
|
|
<resultMap type="com.smartor.domain.PatServiceContract" id="PatServiceContractResult">
|
<result property="id" column="id"/>
|
<result property="contractNo" column="contract_no"/>
|
<result property="patId" column="pat_id"/>
|
<result property="contractType" column="contract_type"/>
|
<result property="salesChannel" column="sales_channel"/>
|
<result property="contractAmount" column="contract_amount"/>
|
<result property="paymentStatus" column="payment_status"/>
|
<result property="contractStatus" column="contract_status"/>
|
<result property="startDate" column="start_date"/>
|
<result property="endDate" column="end_date"/>
|
<result property="actualEndDate" column="actual_end_date"/>
|
<result property="pid" column="pid"/>
|
<result property="guid" column="guid"/>
|
<result property="delFlag" column="del_flag"/>
|
<result property="createBy" column="create_by"/>
|
<result property="updateBy" column="update_by"/>
|
<result property="updateTime" column="update_time"/>
|
<result property="orgid" column="orgid"/>
|
<result property="autoRenew" column="auto_renew"/>
|
<result property="renewalReminderDays" column="renewal_reminder_days"/>
|
<result property="specialTerms" column="special_terms"/>
|
<result property="signedAt" column="signed_at"/>
|
<result property="signedByPatient" column="signed_by_patient"/>
|
<result property="signedByHospital" column="signed_by_hospital"/>
|
<result property="cancellationReason" column="cancellation_reason"/>
|
<result property="cancelledAt" column="cancelled_at"/>
|
</resultMap>
|
|
<sql id="selectPatServiceContractVo">
|
select id,
|
contract_no,
|
pat_id,
|
contract_type,
|
sales_channel,
|
contract_amount,
|
payment_status,
|
contract_status,
|
start_date,
|
end_date,
|
actual_end_date,
|
pid,
|
guid,
|
del_flag,
|
create_by,
|
update_by,
|
update_time,
|
orgid,
|
auto_renew,
|
renewal_reminder_days,
|
special_terms,
|
signed_at,
|
signed_by_patient,
|
signed_by_hospital,
|
cancellation_reason,
|
cancelled_at
|
from pat_service_contract
|
</sql>
|
|
<select id="selectPatServiceContractList" parameterType="com.smartor.domain.PatServiceContract"
|
resultMap="PatServiceContractResult">
|
<include refid="selectPatServiceContractVo"/>
|
<where>
|
del_flag=0
|
<if test="contractNo != null and contractNo != ''">
|
and contract_no = #{contractNo}
|
</if>
|
<if test="patId != null ">
|
and pat_id = #{patId}
|
</if>
|
<if test="contractType != null and contractType != ''">
|
and contract_type = #{contractType}
|
</if>
|
<if test="salesChannel != null and salesChannel != ''">
|
and sales_channel = #{salesChannel}
|
</if>
|
<if test="contractAmount != null and contractAmount != ''">
|
and contract_amount = #{contractAmount}
|
</if>
|
<if test="paymentStatus != null and paymentStatus != ''">
|
and payment_status = #{paymentStatus}
|
</if>
|
<if test="contractStatus != null and contractStatus != ''">
|
and contract_status = #{contractStatus}
|
</if>
|
<if test="startDate != null ">
|
and start_date = #{startDate}
|
</if>
|
<if test="endDate != null ">
|
and end_date = #{endDate}
|
</if>
|
<if test="actualEndDate != null ">
|
and actual_end_date = #{actualEndDate}
|
</if>
|
<if test="pid != null ">
|
and pid = #{pid}
|
</if>
|
<if test="guid != null and guid != ''">
|
and guid = #{guid}
|
</if>
|
<if test="orgid != null and orgid != ''">
|
and orgid = #{orgid}
|
</if>
|
<if test="autoRenew != null and autoRenew != ''">
|
and auto_renew = #{autoRenew}
|
</if>
|
<if test="renewalReminderDays != null ">
|
and renewal_reminder_days = #{renewalReminderDays}
|
</if>
|
<if test="specialTerms != null and specialTerms != ''">
|
and special_terms = #{specialTerms}
|
</if>
|
<if test="signedAt != null ">
|
and signed_at = #{signedAt}
|
</if>
|
<if test="signedByPatient != null and signedByPatient != ''">
|
and signed_by_patient = #{signedByPatient}
|
</if>
|
<if test="signedByHospital != null and signedByHospital != ''">
|
and signed_by_hospital = #{signedByHospital}
|
</if>
|
<if test="cancellationReason != null and cancellationReason != ''">
|
and cancellation_reason = #{cancellationReason}
|
</if>
|
<if test="cancelledAt != null ">
|
and cancelled_at = #{cancelledAt}
|
</if>
|
</where>
|
</select>
|
|
<select id="selectPatServiceContractById" parameterType="Long"
|
resultMap="PatServiceContractResult">
|
<include refid="selectPatServiceContractVo"/>
|
where id = #{id}
|
</select>
|
|
<insert id="insertPatServiceContract" parameterType="com.smartor.domain.PatServiceContract">
|
insert into pat_service_contract
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
<if test="id != null">id,
|
</if>
|
<if test="contractNo != null">contract_no,
|
</if>
|
<if test="patId != null">pat_id,
|
</if>
|
<if test="contractType != null">contract_type,
|
</if>
|
<if test="salesChannel != null">sales_channel,
|
</if>
|
<if test="contractAmount != null">contract_amount,
|
</if>
|
<if test="paymentStatus != null">payment_status,
|
</if>
|
<if test="contractStatus != null">contract_status,
|
</if>
|
<if test="startDate != null">start_date,
|
</if>
|
<if test="endDate != null">end_date,
|
</if>
|
<if test="actualEndDate != null">actual_end_date,
|
</if>
|
<if test="pid != null">pid,
|
</if>
|
<if test="guid != null">guid,
|
</if>
|
<if test="delFlag != null">del_flag,
|
</if>
|
<if test="createBy != null">create_by,
|
</if>
|
<if test="updateBy != null">update_by,
|
</if>
|
<if test="updateTime != null">update_time,
|
</if>
|
<if test="orgid != null">orgid,
|
</if>
|
<if test="autoRenew != null">auto_renew,
|
</if>
|
<if test="renewalReminderDays != null">renewal_reminder_days,
|
</if>
|
<if test="specialTerms != null">special_terms,
|
</if>
|
<if test="signedAt != null">signed_at,
|
</if>
|
<if test="signedByPatient != null">signed_by_patient,
|
</if>
|
<if test="signedByHospital != null">signed_by_hospital,
|
</if>
|
<if test="cancellationReason != null">cancellation_reason,
|
</if>
|
<if test="cancelledAt != null">cancelled_at,
|
</if>
|
</trim>
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
<if test="id != null">#{id},
|
</if>
|
<if test="contractNo != null">#{contractNo},
|
</if>
|
<if test="patId != null">#{patId},
|
</if>
|
<if test="contractType != null">#{contractType},
|
</if>
|
<if test="salesChannel != null">#{salesChannel},
|
</if>
|
<if test="contractAmount != null">#{contractAmount},
|
</if>
|
<if test="paymentStatus != null">#{paymentStatus},
|
</if>
|
<if test="contractStatus != null">#{contractStatus},
|
</if>
|
<if test="startDate != null">#{startDate},
|
</if>
|
<if test="endDate != null">#{endDate},
|
</if>
|
<if test="actualEndDate != null">#{actualEndDate},
|
</if>
|
<if test="pid != null">#{pid},
|
</if>
|
<if test="guid != null">#{guid},
|
</if>
|
<if test="delFlag != null">#{delFlag},
|
</if>
|
<if test="createBy != null">#{createBy},
|
</if>
|
<if test="updateBy != null">#{updateBy},
|
</if>
|
<if test="updateTime != null">#{updateTime},
|
</if>
|
<if test="orgid != null">#{orgid},
|
</if>
|
<if test="autoRenew != null">#{autoRenew},
|
</if>
|
<if test="renewalReminderDays != null">#{renewalReminderDays},
|
</if>
|
<if test="specialTerms != null">#{specialTerms},
|
</if>
|
<if test="signedAt != null">#{signedAt},
|
</if>
|
<if test="signedByPatient != null">#{signedByPatient},
|
</if>
|
<if test="signedByHospital != null">#{signedByHospital},
|
</if>
|
<if test="cancellationReason != null">#{cancellationReason},
|
</if>
|
<if test="cancelledAt != null">#{cancelledAt},
|
</if>
|
</trim>
|
</insert>
|
|
<update id="updatePatServiceContract" parameterType="com.smartor.domain.PatServiceContract">
|
update pat_service_contract
|
<trim prefix="SET" suffixOverrides=",">
|
<if test="contractNo != null">contract_no =
|
#{contractNo},
|
</if>
|
<if test="patId != null">pat_id =
|
#{patId},
|
</if>
|
<if test="contractType != null">contract_type =
|
#{contractType},
|
</if>
|
<if test="salesChannel != null">sales_channel =
|
#{salesChannel},
|
</if>
|
<if test="contractAmount != null">contract_amount =
|
#{contractAmount},
|
</if>
|
<if test="paymentStatus != null">payment_status =
|
#{paymentStatus},
|
</if>
|
<if test="contractStatus != null">contract_status =
|
#{contractStatus},
|
</if>
|
<if test="startDate != null">start_date =
|
#{startDate},
|
</if>
|
<if test="endDate != null">end_date =
|
#{endDate},
|
</if>
|
<if test="actualEndDate != null">actual_end_date =
|
#{actualEndDate},
|
</if>
|
<if test="pid != null">pid =
|
#{pid},
|
</if>
|
<if test="guid != null">guid =
|
#{guid},
|
</if>
|
<if test="delFlag != null">del_flag =
|
#{delFlag},
|
</if>
|
<if test="createBy != null">create_by =
|
#{createBy},
|
</if>
|
<if test="updateBy != null">update_by =
|
#{updateBy},
|
</if>
|
<if test="updateTime != null">update_time =
|
#{updateTime},
|
</if>
|
<if test="orgid != null">orgid =
|
#{orgid},
|
</if>
|
<if test="autoRenew != null">auto_renew =
|
#{autoRenew},
|
</if>
|
<if test="renewalReminderDays != null">renewal_reminder_days =
|
#{renewalReminderDays},
|
</if>
|
<if test="specialTerms != null">special_terms =
|
#{specialTerms},
|
</if>
|
<if test="signedAt != null">signed_at =
|
#{signedAt},
|
</if>
|
<if test="signedByPatient != null">signed_by_patient =
|
#{signedByPatient},
|
</if>
|
<if test="signedByHospital != null">signed_by_hospital =
|
#{signedByHospital},
|
</if>
|
<if test="cancellationReason != null">cancellation_reason =
|
#{cancellationReason},
|
</if>
|
<if test="cancelledAt != null">cancelled_at =
|
#{cancelledAt},
|
</if>
|
</trim>
|
where id = #{id}
|
</update>
|
|
<update id="deletePatServiceContractById" parameterType="Long">
|
update pat_service_contract
|
<trim prefix="SET" suffixOverrides=",">
|
del_flag =1
|
</trim>
|
where id = #{id}
|
</update>
|
|
<update id="deletePatServiceContractByIds" parameterType="String">
|
update pat_service_contract
|
<trim prefix="SET" suffixOverrides=",">
|
del_flag =1
|
</trim>
|
where id in
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
#{id}
|
</foreach>
|
</update>
|
|
|
</mapper>
|