197 lines
11 KiB
XML
197 lines
11 KiB
XML
|
<?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.ruoyi.os.mapper.PatientInsuranceInfoMapper">
|
||
|
|
||
|
<resultMap type="PatientInsuranceInfo" id="PatientInsuranceInfoResult">
|
||
|
<result property="id" column="id" />
|
||
|
<result property="personalId" column="personal_id" />
|
||
|
<result property="idType" column="id_type" />
|
||
|
<result property="idNumber" column="id_number" />
|
||
|
<result property="name" column="name" />
|
||
|
<result property="birthdate" column="birthdate" />
|
||
|
<result property="gender" column="gender" />
|
||
|
<result property="contactPhone" column="contact_phone" />
|
||
|
<result property="mobilePhone" column="mobile_phone" />
|
||
|
<result property="registeredAddress" column="registered_address" />
|
||
|
<result property="residentialAddress" column="residential_address" />
|
||
|
<result property="paymentDistrict" column="payment_district" />
|
||
|
<result property="paymentDistrictName" column="payment_district_name" />
|
||
|
<result property="townshipStreet" column="township_street" />
|
||
|
<result property="communityVillageSchool" column="community_village_school" />
|
||
|
<result property="unitId" column="unit_id" />
|
||
|
<result property="unitName" column="unit_name" />
|
||
|
<result property="personalPaymentAmount" column="personal_payment_amount" />
|
||
|
<result property="financialSubsidyAmount" column="financial_subsidy_amount" />
|
||
|
<result property="totalAmount" column="total_amount" />
|
||
|
<result property="paymentTime" column="payment_time" />
|
||
|
<result property="paymentYear" column="payment_year" />
|
||
|
<result property="payerCategory" column="payer_category" />
|
||
|
</resultMap>
|
||
|
|
||
|
<sql id="selectPatientInsuranceInfoVo">
|
||
|
select id, personal_id, id_type, id_number, name, birthdate, gender, contact_phone, mobile_phone, registered_address, residential_address, payment_district, payment_district_name, township_street, community_village_school, unit_id, unit_name, personal_payment_amount, financial_subsidy_amount, total_amount, payment_time, payment_year, payer_category from patient_insurance_info
|
||
|
</sql>
|
||
|
|
||
|
<select id="selectPatientInsuranceInfoList" parameterType="PatientInsuranceInfo" resultMap="PatientInsuranceInfoResult">
|
||
|
<include refid="selectPatientInsuranceInfoVo"/>
|
||
|
<where>
|
||
|
<if test="personalId != null and personalId != ''"> and personal_id = #{personalId}</if>
|
||
|
<if test="idNumber != null and idNumber != ''"> and id_number = #{idNumber}</if>
|
||
|
<if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
|
||
|
<if test="registeredAddress != null and registeredAddress != ''"> and registered_address like concat('%', #{registeredAddress}, '%')</if>
|
||
|
<if test="paymentYear != null and paymentYear != ''"> and payment_year = #{paymentYear}</if>
|
||
|
</where>
|
||
|
</select>
|
||
|
|
||
|
<select id="selectPatientInsuranceInfoById" parameterType="Long" resultMap="PatientInsuranceInfoResult">
|
||
|
<include refid="selectPatientInsuranceInfoVo"/>
|
||
|
where id = #{id}
|
||
|
</select>
|
||
|
|
||
|
<insert id="insertPatientInsuranceInfo" parameterType="PatientInsuranceInfo" useGeneratedKeys="true" keyProperty="id">
|
||
|
insert into patient_insurance_info
|
||
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||
|
<if test="personalId != null and personalId != ''">personal_id,</if>
|
||
|
<if test="idType != null and idType != ''">id_type,</if>
|
||
|
<if test="idNumber != null and idNumber != ''">id_number,</if>
|
||
|
<if test="name != null and name != ''">name,</if>
|
||
|
<if test="birthdate != null">birthdate,</if>
|
||
|
<if test="gender != null and gender != ''">gender,</if>
|
||
|
<if test="contactPhone != null">contact_phone,</if>
|
||
|
<if test="mobilePhone != null">mobile_phone,</if>
|
||
|
<if test="registeredAddress != null">registered_address,</if>
|
||
|
<if test="residentialAddress != null">residential_address,</if>
|
||
|
<if test="paymentDistrict != null and paymentDistrict != ''">payment_district,</if>
|
||
|
<if test="paymentDistrictName != null and paymentDistrictName != ''">payment_district_name,</if>
|
||
|
<if test="townshipStreet != null and townshipStreet != ''">township_street,</if>
|
||
|
<if test="communityVillageSchool != null and communityVillageSchool != ''">community_village_school,</if>
|
||
|
<if test="unitId != null and unitId != ''">unit_id,</if>
|
||
|
<if test="unitName != null and unitName != ''">unit_name,</if>
|
||
|
<if test="personalPaymentAmount != null">personal_payment_amount,</if>
|
||
|
<if test="financialSubsidyAmount != null">financial_subsidy_amount,</if>
|
||
|
<if test="totalAmount != null">total_amount,</if>
|
||
|
<if test="paymentTime != null">payment_time,</if>
|
||
|
<if test="paymentYear != null and paymentYear != ''">payment_year,</if>
|
||
|
<if test="payerCategory != null and payerCategory != ''">payer_category,</if>
|
||
|
</trim>
|
||
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||
|
<if test="personalId != null and personalId != ''">#{personalId},</if>
|
||
|
<if test="idType != null and idType != ''">#{idType},</if>
|
||
|
<if test="idNumber != null and idNumber != ''">#{idNumber},</if>
|
||
|
<if test="name != null and name != ''">#{name},</if>
|
||
|
<if test="birthdate != null">#{birthdate},</if>
|
||
|
<if test="gender != null and gender != ''">#{gender},</if>
|
||
|
<if test="contactPhone != null">#{contactPhone},</if>
|
||
|
<if test="mobilePhone != null">#{mobilePhone},</if>
|
||
|
<if test="registeredAddress != null">#{registeredAddress},</if>
|
||
|
<if test="residentialAddress != null">#{residentialAddress},</if>
|
||
|
<if test="paymentDistrict != null and paymentDistrict != ''">#{paymentDistrict},</if>
|
||
|
<if test="paymentDistrictName != null and paymentDistrictName != ''">#{paymentDistrictName},</if>
|
||
|
<if test="townshipStreet != null and townshipStreet != ''">#{townshipStreet},</if>
|
||
|
<if test="communityVillageSchool != null and communityVillageSchool != ''">#{communityVillageSchool},</if>
|
||
|
<if test="unitId != null and unitId != ''">#{unitId},</if>
|
||
|
<if test="unitName != null and unitName != ''">#{unitName},</if>
|
||
|
<if test="personalPaymentAmount != null">#{personalPaymentAmount},</if>
|
||
|
<if test="financialSubsidyAmount != null">#{financialSubsidyAmount},</if>
|
||
|
<if test="totalAmount != null">#{totalAmount},</if>
|
||
|
<if test="paymentTime != null">#{paymentTime},</if>
|
||
|
<if test="paymentYear != null and paymentYear != ''">#{paymentYear},</if>
|
||
|
<if test="payerCategory != null and payerCategory != ''">#{payerCategory},</if>
|
||
|
</trim>
|
||
|
</insert>
|
||
|
|
||
|
<insert id="insertPatientInsuranceInfos" parameterType="java.util.List">
|
||
|
INSERT INTO patient_insurance_info (
|
||
|
personal_id,
|
||
|
id_type,
|
||
|
id_number,
|
||
|
name,
|
||
|
birthdate,
|
||
|
gender,
|
||
|
contact_phone,
|
||
|
mobile_phone,
|
||
|
registered_address,
|
||
|
residential_address,
|
||
|
payment_district,
|
||
|
payment_district_name,
|
||
|
township_street,
|
||
|
community_village_school,
|
||
|
unit_id,
|
||
|
unit_name,
|
||
|
personal_payment_amount,
|
||
|
financial_subsidy_amount,
|
||
|
total_amount,
|
||
|
payment_time,
|
||
|
payment_year,
|
||
|
payer_category
|
||
|
) VALUES
|
||
|
<foreach collection="list" item="item" separator=",">
|
||
|
(
|
||
|
#{item.personalId},
|
||
|
#{item.idType},
|
||
|
#{item.idNumber},
|
||
|
#{item.name},
|
||
|
#{item.birthdate},
|
||
|
#{item.gender},
|
||
|
#{item.contactPhone},
|
||
|
#{item.mobilePhone},
|
||
|
#{item.registeredAddress},
|
||
|
#{item.residentialAddress},
|
||
|
#{item.paymentDistrict},
|
||
|
#{item.paymentDistrictName},
|
||
|
#{item.townshipStreet},
|
||
|
#{item.communityVillageSchool},
|
||
|
#{item.unitId},
|
||
|
#{item.unitName},
|
||
|
#{item.personalPaymentAmount},
|
||
|
#{item.financialSubsidyAmount},
|
||
|
#{item.totalAmount},
|
||
|
#{item.paymentTime},
|
||
|
#{item.paymentYear},
|
||
|
#{item.payerCategory}
|
||
|
)
|
||
|
</foreach>
|
||
|
</insert>
|
||
|
|
||
|
<update id="updatePatientInsuranceInfo" parameterType="PatientInsuranceInfo">
|
||
|
update patient_insurance_info
|
||
|
<trim prefix="SET" suffixOverrides=",">
|
||
|
<if test="personalId != null and personalId != ''">personal_id = #{personalId},</if>
|
||
|
<if test="idType != null and idType != ''">id_type = #{idType},</if>
|
||
|
<if test="idNumber != null and idNumber != ''">id_number = #{idNumber},</if>
|
||
|
<if test="name != null and name != ''">name = #{name},</if>
|
||
|
<if test="birthdate != null">birthdate = #{birthdate},</if>
|
||
|
<if test="gender != null and gender != ''">gender = #{gender},</if>
|
||
|
<if test="contactPhone != null">contact_phone = #{contactPhone},</if>
|
||
|
<if test="mobilePhone != null">mobile_phone = #{mobilePhone},</if>
|
||
|
<if test="registeredAddress != null">registered_address = #{registeredAddress},</if>
|
||
|
<if test="residentialAddress != null">residential_address = #{residentialAddress},</if>
|
||
|
<if test="paymentDistrict != null and paymentDistrict != ''">payment_district = #{paymentDistrict},</if>
|
||
|
<if test="paymentDistrictName != null and paymentDistrictName != ''">payment_district_name = #{paymentDistrictName},</if>
|
||
|
<if test="townshipStreet != null and townshipStreet != ''">township_street = #{townshipStreet},</if>
|
||
|
<if test="communityVillageSchool != null and communityVillageSchool != ''">community_village_school = #{communityVillageSchool},</if>
|
||
|
<if test="unitId != null and unitId != ''">unit_id = #{unitId},</if>
|
||
|
<if test="unitName != null and unitName != ''">unit_name = #{unitName},</if>
|
||
|
<if test="personalPaymentAmount != null">personal_payment_amount = #{personalPaymentAmount},</if>
|
||
|
<if test="financialSubsidyAmount != null">financial_subsidy_amount = #{financialSubsidyAmount},</if>
|
||
|
<if test="totalAmount != null">total_amount = #{totalAmount},</if>
|
||
|
<if test="paymentTime != null">payment_time = #{paymentTime},</if>
|
||
|
<if test="paymentYear != null and paymentYear != ''">payment_year = #{paymentYear},</if>
|
||
|
<if test="payerCategory != null and payerCategory != ''">payer_category = #{payerCategory},</if>
|
||
|
</trim>
|
||
|
where id = #{id}
|
||
|
</update>
|
||
|
|
||
|
<delete id="deletePatientInsuranceInfoById" parameterType="Long">
|
||
|
delete from patient_insurance_info where id = #{id}
|
||
|
</delete>
|
||
|
|
||
|
<delete id="deletePatientInsuranceInfoByIds" parameterType="String">
|
||
|
delete from patient_insurance_info where id in
|
||
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||
|
#{id}
|
||
|
</foreach>
|
||
|
</delete>
|
||
|
</mapper>
|