<?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.lyms.platform.permission.dao.master.MasterMysqlPatientsMapper">
<insert id="saveMysqlPatients" parameterType="com.lyms.platform.permission.model.MysqlPatients">
INSERT INTO patients(
patientId,
certType,
certno,
pcountry,
pnation,
pprofessionType,
pcensusType,
pworkUnit,
pliveType,
buildDoctor,
buildDate,
hospital_id,
hcertificateNum,
hcertificateType,
hcountry,
hnation,
hworkUnit,
hprofessionType,
haddressRegister,
paddress,
dueStatus,
addressPostRest,
addressRegister,
username,
dueDate,
lastMenses,
phone,
yn,
created,
modified,
birth,
type,
isSendCoupon,
husbandName,
husbandPhone,
husbandBirth,
vcCardNo,
normal,
fileCode,
yyzyfmHospital,
pid,
hospitalName
) VALUES (
#{patientId},
#{certType},
#{certno},
#{pcountry},
#{pnation},
#{pprofessionType},
#{pcensusType},
#{pworkUnit},
#{pliveType},
#{buildDoctor},
#{buildDate},
#{hospital_id},
#{hcertificateNum},
#{hcertificateType},
#{hcountry},
#{hnation},
#{hworkUnit},
#{hprofessionType},
#{haddressRegister},
#{paddress},
#{dueStatus},
#{addressPostRest},
#{addressRegister},
#{username},
#{dueDate},
#{lastMenses},
#{phone},
#{yn},
#{created},
#{modified},
#{birth},
#{type},
#{isSendCoupon},
#{husbandName},
#{husbandPhone},
#{husbandBirth},
#{vcCardNo},
#{normal},
#{fileCode},
#{yyzyfmHospital},
#{pid},
#{hospitalName}
)
</insert>
<select id="queryMysqlPatients" parameterType="com.lyms.platform.permission.model.MysqlPatients"
resultType="com.lyms.platform.permission.model.MysqlPatients">
SELECT
patientId,
certType,
certno,
pcountry,
pnation,
pprofessionType,
pcensusType,
pworkUnit,
pliveType,
buildDoctor,
buildDate,
hospital_id,
hcertificateNum,
hcertificateType,
hcountry,
hnation,
hworkUnit,
hprofessionType,
haddressRegister,
paddress,
dueStatus,
addressPostRest,
addressRegister,
username,
dueDate,
lastMenses,
phone,
yn,
created,
modified,
birth,
type,
isSendCoupon,
husbandName,
husbandPhone,
husbandBirth,
vcCardNo,
normal,
fileCode,
yyzyfmHospital
FROM patients
WHERE 1 = 1
<if test="patientId != null and patientId != ''">
AND patientId = #{patientId}
</if>
</select>
<update id="updateMysqlPatients" parameterType="com.lyms.platform.permission.model.MysqlPatients">
update patients
<set>
patientId=#{patientId},
certType=#{certType},
certno=#{certno},
pcountry=#{pcountry},
pnation=#{pnation},
pprofessionType=#{pprofessionType},
pcensusType=#{pcensusType},
pworkUnit=#{pworkUnit},
pliveType=#{pliveType},
buildDoctor=#{buildDoctor},
buildDate=#{buildDate},
hospital_id=#{hospital_id},
hcertificateNum=#{hcertificateNum},
hcertificateType=#{hcertificateType},
hcountry=#{hcountry},
hnation=#{hnation},
hworkUnit=#{hworkUnit},
hprofessionType=#{hprofessionType},
haddressRegister=#{haddressRegister},
paddress=#{paddress},
dueStatus=#{dueStatus},
addressPostRest=#{addressPostRest},
addressRegister=#{addressRegister},
username=#{username},
dueDate=#{dueDate},
lastMenses=#{lastMenses},
phone=#{phone},
yn=#{yn},
created=#{created},
modified=#{modified},
birth=#{birth},
type=#{type},
isSendCoupon=#{isSendCoupon},
husbandName=#{husbandName},
husbandPhone=#{husbandPhone},
husbandBirth=#{husbandBirth},
vcCardNo=#{vcCardNo},
normal=#{normal},
fileCode=#{fileCode},
yyzyfmHospital=#{yyzyfmHospital}
</set>
where id = #{id,jdbcType=INTEGER}
</update>
<delete id="deleteMysqlPatients" parameterType="com.lyms.platform.permission.model.MysqlPatients">
DELETE from patients WHERE patientId = #{patientId}
</delete>
</mapper>