1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711 |
- <?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="PharmaceuticalServiceMapper">
- <!--档案管理查询-->
- <select id="selectArchivesList" parameterType="pd" resultType="pd">
- select *,DATE_FORMAT(updateTime, '%Y-%m-%d %H:%i:%s') AS updateTime2 from s_dtp_ysfw_archive_management where 1=1
- <if test="serviceTypeNumber!= null and serviceTypeNumber!=''">
- and serviceTypeNumber=#{serviceTypeNumber}
- </if>
- <if test="serviceTypeName!= null and serviceTypeName!=''">
- and serviceTypeName=#{serviceTypeName}
- </if>
- <if test="followUpPerson!= null and followUpPerson!=''">
- and followUpPerson=#{followUpPerson}
- </if>
- <if test="gender!= null and gender!=''">
- and gender=#{gender}
- </if>
- <if test="name!= null and name!=''">
- and name=#{name}
- </if>
- <if test="genericName!= null and genericName!=''">
- and genericName=#{genericName}
- </if>
- <if test="acceptFollowUp!= null and acceptFollowUp!=''">
- and acceptFollowUp=#{acceptFollowUp}
- </if>
- <if test="archiveCompleteStatus!= null and archiveCompleteStatus!=''">
- and archiveCompleteStatus=#{archiveCompleteStatus}
- </if>
- <if test="followUpPerson!= null and followUpPerson!=''">
- and followUpPerson=#{followUpPerson}
- </if>
- <if test="storeName!= null and storeName!=''">
- and storeName=#{storeName}
- </if>
- <if test="disease!= null and disease!=''">
- and disease=#{disease}
- </if>
- <if test="flipStatus!= null and flipStatus!=''">
- and flipStatus=#{flipStatus}
- </if>
- <if test="updateTime!= null and updateTime!=''">
- and updateTime like concat(#{updateTime}, '%')
- </if>
- <if test="joinProject!= null and joinProject!=''">
- and joinProject=#{joinProject}
- </if>
- <if test="charityAssistance!= null and charityAssistance!=''">
- and charityAssistance=#{charityAssistance}
- </if>
- <if test="id !=null and id !='' ">
- and id = #{id}
- </if>
- </select>
- <!-- 检查患者是否存在name LIKE CONCAT('%', #{name}, '%') -->
- <select id="checkPatientIsExist" parameterType="pd" resultType="pd">
- select name,phoneNumber from s_dtp_ysfw_archive_management where 1=1
- <if test="name!= null and name!=''">
- and name =#{name}
- </if>
- <if test="documentNumber!= null and documentNumber!=''">
- and documentNumber=#{documentNumber}
- </if>
- <if test="phoneNumber!= null and phoneNumber!=''">
- and phoneNumber=#{phoneNumber}
- </if>
- </select>
- <select id="slectPatientByNameOrPhone" parameterType="pd" resultType="pd">
- select * from s_dtp_ysfw_archive_management where 1=1 AND name LIKE CONCAT('%', #{query}, '%') or phoneNumber=#{query}
- </select>
- <select id="slectPatientByNameOrPhoneOrIdCard" parameterType="pd" resultType="pd">
- select * from s_dtp_ysfw_archive_management where 1=1 AND name LIKE CONCAT('%', #{query}, '%') or phoneNumber=#{query} or documentNumber=#{query}
- </select>
- <select id="slectPatientById" parameterType="pd" resultType="pd">
- select * from s_dtp_ysfw_archive_management where 1=1 AND id=#{id}
- </select>
- <select id="selectPatientById" parameterType="pd" resultType="pd">
- select * from s_dtp_ysfw_archive_management where 1=1 and id=#{patientId}
- </select>
- <!-- 插入新的档案记录 -->
- <insert id="insertArchiveRecord" parameterType="pd">
- INSERT INTO s_dtp_ysfw_archive_management
- <trim prefix="(" suffix=")" prefixOverrides="," suffixOverrides=",">
- <if test="realNameStatus != null">realNameStatus,</if>
- <if test="name != null and name != ''">name,</if>
- <if test="gender != null">gender,</if>
- <if test="age != null">age,</if>
- <if test="dateBirth != null">dateBirth,</if>
- <if test="phoneNumber != null and phoneNumber != ''">phoneNumber,</if>
- <if test="documentNumber != null and documentNumber != ''">documentNumber,</if>
- <if test="idCardImg != null and idCardImg != ''">idCardImg,</if>
- <if test="landlineNumber != null and landlineNumber != ''">landlineNumber,</if>
- <if test="documentType != null and documentType != ''">documentType,</if>
- <if test="createTime != null">createTime,</if>
- <if test="archiveCreator != null and archiveCreator != ''">archiveCreator,</if>
- <if test="creator != null and creator != ''">creator,</if>
- <if test="archiveCompleteStatus != null">archiveCompleteStatus,</if>
- <if test="contactRelation != null and contactRelation != ''">contactRelation,</if>
- <if test="contactPhone != null and contactPhone != ''">contactPhone,</if>
- <if test="contactName != null and contactName != ''">contactName,</if>
- <if test="flipStatus != null">flipStatus,</if>
- <if test="chronicTumorType != null and chronicTumorType != ''">chronicTumorType,</if>
- <if test="nation != null and nation != ''">nation,</if>
- <if test="nativePlace != null and nativePlace != ''">nativePlace,</if>
- <if test="height != null">height,</if>
- <if test="weight != null">weight,</if>
- <if test="BMI != null and BMI != ''">BMI,</if>
- <if test="storeId != null and storeId != ''">storeId,</if>
- <if test="insurance != null and insurance != ''">insurance,</if>
- <if test="socialSecurityCard != null and socialSecurityCard != ''">socialSecurityCard,</if>
- <if test="timeFirstDiagnosis != null">timeFirstDiagnosis,</if>
- <if test="diseaseType != null and diseaseType != ''">diseaseType,</if>
- <if test="healingLineCollection != null and healingLineCollection != ''">healingLineCollection,</if>
- <if test="disease != null and disease != ''">disease,</if>
- <if test="ownedStore != null and ownedStore != ''">ownedStore,</if>
- <if test="archiveCompleter != null and archiveCompleter != ''">archiveCompleter,</if>
- <if test="acceptFollowUp != null">acceptFollowUp,</if>
- <if test="followUpPerson != null and followUpPerson != ''">followUpPerson,</if>
- <if test="charityAssistance != null">charityAssistance,</if>
- <if test="manufacturer != null and manufacturer != ''">manufacturer,</if>
- <if test="joinProject != null">joinProject,</if>
- <if test="mdmCode != null and mdmCode != ''">mdmCode,</if>
- <if test="productName != null and productName != ''">productName,</if>
- <if test="storeName != null and storeName != ''">storeName,</if>
- <if test="followUpStatus != null">followUpStatus,</if>
- <if test="noFlipCause != null and noFlipCause != ''">noFlipCause,</if>
- <if test="genericName != null and genericName != ''">genericName,</if>
- <if test="updateTime != null and updateTime != ''">updateTime,</if>
- <if test="dl != null and dl != ''">dl,</if>
- <if test="xl != null and xl != ''">xl,</if>
- <if test="addr != null and addr != ''">addr</if>
- </trim>
- <trim prefix=" VALUES (" suffix=")" prefixOverrides="," suffixOverrides=",">
- <if test="realNameStatus != null">#{realNameStatus},</if>
- <if test="name != null and name != ''">#{name},</if>
- <if test="gender != null">#{gender},</if>
- <if test="age != null">#{age},</if>
- <if test="dateBirth != null">#{dateBirth},</if>
- <if test="phoneNumber != null and phoneNumber != ''">#{phoneNumber},</if>
- <if test="documentNumber != null and documentNumber != ''">#{documentNumber},</if>
- <if test="idCardImg != null and idCardImg != ''">#{idCardImg},</if>
- <if test="landlineNumber != null and landlineNumber != ''">#{landlineNumber},</if>
- <if test="documentType != null and documentType != ''">#{documentType},</if>
- <if test="createTime != null">#{createTime},</if>
- <if test="archiveCreator != null and archiveCreator != ''">#{archiveCreator},</if>
- <if test="creator != null and creator != ''">#{creator},</if>
- <if test="archiveCompleteStatus != null">#{archiveCompleteStatus},</if>
- <if test="contactRelation != null and contactRelation != ''">#{contactRelation},</if>
- <if test="contactPhone != null and contactPhone != ''">#{contactPhone},</if>
- <if test="contactName != null and contactName != ''">#{contactName},</if>
- <if test="flipStatus != null">#{flipStatus},</if>
- <if test="chronicTumorType != null and chronicTumorType != ''">#{chronicTumorType},</if>
- <if test="nation != null and nation != ''">#{nation},</if>
- <if test="nativePlace != null and nativePlace != ''">#{nativePlace},</if>
- <if test="height != null">#{height},</if>
- <if test="weight != null">#{weight},</if>
- <if test="BMI != null and BMI != ''">#{BMI},</if>
- <if test="storeId != null and storeId != ''">#{storeId},</if>
- <if test="insurance != null and insurance != ''">#{insurance},</if>
- <if test="socialSecurityCard != null and socialSecurityCard != ''">#{socialSecurityCard},</if>
- <if test="timeFirstDiagnosis != null">#{timeFirstDiagnosis},</if>
- <if test="diseaseType != null and diseaseType != ''">#{diseaseType},</if>
- <if test="healingLineCollection != null and healingLineCollection != ''">#{healingLineCollection},</if>
- <if test="disease != null and disease != ''">#{disease},</if>
- <if test="ownedStore != null and ownedStore != ''">#{ownedStore},</if>
- <if test="archiveCompleter != null and archiveCompleter != ''">#{archiveCompleter},</if>
- <if test="acceptFollowUp != null">#{acceptFollowUp},</if>
- <if test="followUpPerson != null and followUpPerson != ''">#{followUpPerson},</if>
- <if test="charityAssistance != null">#{charityAssistance},</if>
- <if test="manufacturer != null and manufacturer != ''">#{manufacturer},</if>
- <if test="joinProject != null">#{joinProject},</if>
- <if test="mdmCode != null and mdmCode != ''">#{mdmCode},</if>
- <if test="productName != null and productName != ''">#{productName},</if>
- <if test="storeName != null and storeName != ''">#{storeName},</if>
- <if test="followUpStatus != null">#{followUpStatus},</if>
- <if test="noFlipCause != null and noFlipCause != ''">#{noFlipCause},</if>
- <if test="genericName != null and genericName != ''">#{genericName},</if>
- <if test="updateTime != null and updateTime != ''">#{updateTime},</if>
- <if test="dl != null and dl != ''">#{dl},</if>
- <if test="xl != null and xl != ''">#{xl},</if>
- <if test="addr != null and addr != ''">#{addr}</if>
- </trim>
- </insert>
- <!-- 更新档案记录 -->
- <update id="updateArchiveRecord" parameterType="pd">
- UPDATE s_dtp_ysfw_archive_management
- SET
- <if test="realNameStatus != null ">realNameStatus = #{realNameStatus},</if>
- <if test="gender != null and gender != ''">gender = #{gender},</if>
- <if test="age != null and age != ''" >age = #{age},</if>
- <if test="dateBirth != null and dateBirth != ''">dateBirth = #{dateBirth},</if>
- <if test="phoneNumber != null and phoneNumber != ''">phoneNumber = #{phoneNumber},</if>
- <if test="documentNumber != null and documentNumber != ''">documentNumber=#{documentNumber},</if>
- <if test="idCardImg != null and idCardImg != ''">idCardImg=#{idCardImg},</if>
- <if test="landlineNumber != null and landlineNumber != ''">landlineNumber = #{landlineNumber},</if>
- <if test="archiveCompleteStatus != null">archiveCompleteStatus = #{archiveCompleteStatus},</if>
- <if test="contactRelation != null and contactRelation != ''">contactRelation = #{contactRelation},</if>
- <if test="contactPhone != null and contactPhone != ''">contactPhone = #{contactPhone},</if>
- <if test="contactName != null and contactName != ''">contactName = #{contactName},</if>
- <if test="flipStatus != null">flipStatus = #{flipStatus},</if>
- <if test="chronicTumorType != null and chronicTumorType != ''">chronicTumorType = #{chronicTumorType},</if>
- <if test="nation != null and nation != ''">nation = #{nation},</if>
- <if test="nativePlace != null and nativePlace != ''">nativePlace = #{nativePlace},</if>
- <if test="height != null and height != ''">height = #{height},</if>
- <if test="weight != null and weight != ''">weight = #{weight},</if>
- <if test="BMI != null and BMI != ''">BMI = #{BMI},</if>
- <if test="insurance != null and insurance != ''">insurance = #{insurance},</if>
- <if test="socialSecurityCard != null and socialSecurityCard != ''">socialSecurityCard = #{socialSecurityCard},</if>
- <if test="timeFirstDiagnosis != null">timeFirstDiagnosis = #{timeFirstDiagnosis},</if>
- <if test="diseaseType != null and diseaseType != ''">diseaseType = #{diseaseType},</if>
- <if test="healingLineCollection != null and healingLineCollection != ''">healingLineCollection = #{healingLineCollection},</if>
- <if test="disease != null and disease != ''">disease = #{disease},</if>
- <if test="ownedStore != null and ownedStore != ''">ownedStore = #{ownedStore},</if>
- <if test="archiveCompleter != null and archiveCompleter != ''">archiveCompleter = #{archiveCompleter},</if>
- <if test="acceptFollowUp != null">acceptFollowUp = #{acceptFollowUp},</if>
- <if test="followUpPerson != null and followUpPerson != ''">followUpPerson = #{followUpPerson},</if>
- <if test="charityAssistance != null">charityAssistance = #{charityAssistance},</if>
- <if test="manufacturer != null and manufacturer != ''">manufacturer = #{manufacturer},</if>
- <if test="joinProject != null and gender != ''">joinProject = #{joinProject},</if>
- <if test="mdmCode != null and mdmCode != ''">mdmCode = #{mdmCode},</if>
- <if test="productName != null and productName != ''">productName = #{productName},</if>
- <if test="storeName != null and storeName != ''">storeName = #{storeName},</if>
- <if test="storeId != null and storeId != ''">storeId = #{storeId},</if>
- <if test="noFlipCause != null and noFlipCause != ''">noFlipCause = #{noFlipCause},</if>
- <if test="followUpStatus != null and followUpStatus != ''">followUpStatus = #{followUpStatus},</if>
- <if test="genericName != null and genericName != ''">genericName = #{genericName},</if>
- updateTime = #{updateTime}
- WHERE id = #{id}
- </update>
- <!--患者绑定微信上翻-->
- <update id="ShaoMaShangFan" parameterType="pd">
- update s_dtp_ysfw_archive_management
- <trim prefix="SET" suffixOverrides="," prefixOverrides=",">
- <if test="openId != null and openId != ''">
- openId = #{openId},
- </if>
- <if test="flipStatus != null and flipStatus != ''">
- flipStatus = #{flipStatus},
- </if>
- <if test="updateTime != null and updateTime != ''">
- updateTime = #{updateTime},
- </if>
- <if test="archiveCreator != null and archiveCreator != ''">
- archiveCreator = #{archiveCreator},
- </if>
- </trim>
- where id = #{id}
- </update>
- <!--患者解除绑定-->
- <update id="unbound" parameterType="pd">
- update s_dtp_ysfw_archive_management
- <trim prefix="SET" suffixOverrides="," prefixOverrides=",">
- <if test="openId != null and openId != ''">
- openId = #{openId},
- </if>
- <if test="flipStatus != null and flipStatus != ''">
- flipStatus = #{flipStatus},
- </if>
- <if test="noFlipCause != null and noFlipCause != ''">
- noFlipCause = #{noFlipCause},
- </if>
- <if test="updateTime != null and updateTime != ''">
- updateTime = #{updateTime},
- </if>
- <if test="archiveCreator != null and archiveCreator != ''">
- archiveCreator = #{archiveCreator},
- </if>
- </trim>
- where id = #{id}
- </update>
- <!--档案管理修改-->
- <update id="updateArchives" parameterType="pd">
- update s_dtp_ysfw_archive_management
- <trim prefix="SET" suffixOverrides="," prefixOverrides=",">
- <if test="realNameStatus != null and realNameStatus!=''">
- realNameStatus = #{realNameStatus},
- </if>
- <if test="name != null and name != ''">
- name = #{name},
- </if>
- <if test="gender != null and gender != ''">
- gender = #{gender},
- </if>
- <if test="age != null and age != ''">
- age = #{age},
- </if>
- <if test="dateBirth != null and dateBirth != ''">
- dateBirth = #{dateBirth},
- </if>
- <if test="phoneNumber != null and phoneNumber != ''">
- phoneNumber = #{phoneNumber},
- </if>
- <if test="documentNumber != null and documentNumber != ''">
- documentNumber = #{documentNumber},
- </if>
- <if test="idCardImg != null and idCardImg != ''">
- idCardImg = #{idCardImg},
- </if>
- <if test="landlineNumber != null and landlineNumber != ''">
- landlineNumber = #{landlineNumber},
- </if>
- <if test="documentType != null and documentType != ''">
- documentType = #{documentType},
- </if>
- <if test="archiveCreator != null and archiveCreator != ''">
- archiveCreator = #{archiveCreator},
- </if>
- <if test="creator != null and creator != ''">
- creator = #{creator},
- </if>
- <if test="archiveCompleteStatus != null">
- archiveCompleteStatus = #{archiveCompleteStatus},
- </if>
- <if test="contactRelation != null and contactRelation != ''">
- contactRelation = #{contactRelation},
- </if>
- <if test="contactPhone != null and contactPhone != ''">
- contactPhone = #{contactPhone},
- </if>
- <if test="contactName != null and contactName != ''">
- contactName = #{contactName},
- </if>
- <if test="flipStatus != null and flipStatus != ''">
- flipStatus = #{flipStatus},
- </if>
- <if test="noFlipCause != null and noFlipCause != ''">
- noFlipCause = #{noFlipCause},
- </if>
- <if test="chronicTumorType != null and chronicTumorType != ''">
- chronicTumorType = #{chronicTumorType},
- </if>
- <if test="nation != null and nation != ''">
- nation = #{nation},
- </if>
- <if test="nativePlace != null and nativePlace != ''">
- nativePlace = #{nativePlace},
- </if>
- <if test="height != null and height != ''">
- height = #{height},
- </if>
- <if test="weight != null and weight != ''">
- weight = #{weight},
- </if>
- <if test="BMI != null and BMI != ''">
- BMI = #{BMI},
- </if>
- <if test="insurance != null and insurance != ''">
- insurance = #{insurance},
- </if>
- <if test="socialSecurityCard != null and socialSecurityCard != ''">
- socialSecurityCard = #{socialSecurityCard},
- </if>
- <if test="timeFirstDiagnosis != null and timeFirstDiagnosis != ''">
- timeFirstDiagnosis = #{timeFirstDiagnosis},
- </if>
- <if test="diseaseType != null and diseaseType != ''">
- diseaseType = #{diseaseType},
- </if>
- <if test="healingLineCollection != null and healingLineCollection != ''">
- healingLineCollection = #{healingLineCollection},
- </if>
- <if test="disease != null and disease != ''">
- disease = #{disease},
- </if>
- <if test="ownedStore != null and ownedStore != ''">
- ownedStore = #{ownedStore},
- </if>
- <if test="archiveCompleter != null and archiveCompleter != ''">
- archiveCompleter = #{archiveCompleter},
- </if>
- <if test="acceptFollowUp != null and acceptFollowUp != ''">
- acceptFollowUp = #{acceptFollowUp},
- </if>
- <if test="followUpPerson != null and followUpPerson != ''">
- followUpPerson = #{followUpPerson},
- </if>
- <if test="charityAssistance != null and charityAssistance != ''">
- charityAssistance = #{charityAssistance},
- </if>
- <if test="manufacturer != null and manufacturer != ''">
- manufacturer = #{manufacturer},
- </if>
- <if test="joinProject != null and joinProject != ''">
- joinProject = #{joinProject},
- </if>
- <if test="mdmCode != null and mdmCode != ''">
- mdmCode = #{mdmCode},
- </if>
- <if test="productName != null and productName != ''">
- productName = #{productName},
- </if>
- <if test="storeName != null and storeName != ''">
- storeName = #{storeName},
- </if>
- <if test="storeId != null and storeId != ''">
- storeId = #{storeId},
- </if>
- <if test="followUpStatus != null and followUpStatus != ''">
- followUpStatus = #{followUpStatus},
- </if>
- <if test="genericName != null and genericName != ''">
- genericName = #{genericName},
- </if>
- <if test="waist != null and waist != ''">
- waist = #{waist},
- </if>
- <if test="hip != null and hip != ''">
- hip = #{hip},
- </if>
- <if test="bloodPressure != null and bloodPressure != ''">
- bloodPressure = #{bloodPressure},
- </if>
- <if test="bloodSugar != null and bloodSugar != ''">
- bloodSugar = #{bloodSugar},
- </if>
- <if test="medicalHistory != null and medicalHistory != ''">
- medicalHistory = #{medicalHistory},
- </if>
- <if test="hasSurgicalTraumaHistory != null">
- hasSurgicalTraumaHistory = #{hasSurgicalTraumaHistory},
- </if>
- <if test="infectiousDiseaseHistory != null and infectiousDiseaseHistory != ''">
- infectiousDiseaseHistory = #{infectiousDiseaseHistory},
- </if>
- <if test="allergyHistory != null and allergyHistory != ''">
- allergyHistory = #{allergyHistory},
- </if>
- <if test="businessBelonging != null and businessBelonging != ''">
- businessBelonging = #{businessBelonging},
- </if>
- <if test="zlfq != null and zlfq != ''">
- zlfq = #{zlfq},
- </if>
- <if test="jytb != null and jytb != ''">
- jytb = #{jytb},
- </if>
- <if test="treatmentStage != null and treatmentStage != ''">
- treatmentStage = #{treatmentStage},
- </if>
- <if test="fzjc != null and fzjc != ''">
- fzjc = #{fzjc},
- </if>
- <if test="pdl1 != null and pdl1 != ''">
- pdl1 = #{pdl1},
- </if>
- <if test="zlsd != null and zlsd != ''">
- zlsd = #{zlsd},
- </if>
- <if test="dl != null and dl != ''">dl=#{dl},</if>
- <if test="xl != null and xl != ''">xl=#{xl},</if>
- <if test="addr != null and addr != ''">addr=#{addr},</if>
- <if test="contactName != null and contactName != ''">contactName=#{contactName},</if>
- <if test="contactPhone != null and contactPhone != ''">contactPhone=#{contactPhone},</if>
- <if test="tnb != null and tnb != ''">
- tnb = #{tnb},
- </if>
- <if test="tnbhbz != null and tnbhbz != ''">
- tnbhbz = #{tnbhbz},
- </if>
- <if test="gxy != null and gxy != ''">
- gxy = #{gxy},
- </if>
- <if test="gxyhbz != null and gxyhbz != ''">
- gxyhbz = #{gxyhbz},
- </if>
- <if test="gxz != null and gxz != ''">
- gxz = #{gxz},
- </if>
- <if test="gxzhbz != null and gxzhbz != ''">
- gxzhbz = #{gxzhbz},
- </if>
- </trim>
- where id = #{id}
- </update>
- <!--档案管理删除-->
- <delete id="archivesRemove" parameterType="pd">
- <if test="ids != null">
- delete from s_dtp_ysfw_archive_management where
- <if test="ids != null">
- id in(#{ids})
- </if>
- </if>
- </delete>
- <!--随访任务 查询-->
- <select id="selectFollowUpList" parameterType="pd" resultType="pd">
- select *,DATE_FORMAT(updatedAt, '%Y-%m-%d %H:%i:%s') AS updateTime2 from s_dtp_ysfw_follow_up_task where 1=1
- <if test="id != null and id != ''">
- and id=#{id}
- </if>
- <if test="appointmentDate != null and appointmentDate != ''">
- and appointmentDate=#{appointmentDate}
- </if>
- <if test="businessBelonging != null and businessBelonging != ''">
- and businessBelonging=#{businessBelonging}
- </if>
- <if test="taskName != null and taskName != ''">
- and taskName=#{taskName}
- </if>
- <if test="taskTheme != null and taskTheme != ''">
- and taskTheme=#{taskTheme}
- </if>
- <if test="patientName != null and patientName != ''">
- and patientName=#{patientName}
- </if>
- <if test="gender != null and gender != ''">
- and gender=#{gender}
- </if>
- <if test="age != null and age != ''">
- and age=#{age}
- </if>
- <if test="followUpSummary != null and followUpSummary != ''">
- and followUpSummary=#{followUpSummary}
- </if>
- <if test="disease != null and disease != ''">
- and disease=#{disease}
- </if>
- <if test="storeName != null and storeName != ''">
- and storeName=#{storeName}
- </if>
- <if test="genericName != null and genericName != ''">
- and genericName=#{genericName}
- </if>
- <if test="productName != null and productName != ''">
- and productName=#{productName}
- </if>
- <if test="taskFollower != null and taskFollower != ''">
- and taskFollower=#{taskFollower}
- </if>
- <if test="actualFollowUpTime != null and actualFollowUpTime != ''">
- and actualFollowUpTime=#{actualFollowUpTime}
- </if>
- <if test="callConnectedCount != null and callConnectedCount != ''">
- and callConnectedCount=#{callConnectedCount}
- </if>
- <if test="outboundCallCount != null and outboundCallCount != ''">
- and outboundCallCount=#{outboundCallCount}
- </if>
- <if test="nextOutboundCallCount != null and nextOutboundCallCount != ''">
- and nextOutboundCallCount=#{nextOutboundCallCount}
- </if>
- <if test="taskStatus != null and taskStatus != ''">
- and taskStatus=#{taskStatus}
- </if>
- <if test="lastOutboundStatus != null and lastOutboundStatus != ''">
- and lastOutboundStatus=#{lastOutboundStatus}
- </if>
- <if test="createdAt != null and createdAt != ''">
- and createdAt=#{createdAt}
- </if>
- <if test="updatedAt != null and updatedAt != ''">
- and updatedAt=#{updatedAt}
- </if>
- </select>
- <!--随访任务 修改-->
- <update id="updateFollowUp" parameterType="pd" >
- <if test="up != null and up!=''">
- update s_dtp_ysfw_follow_up_task
- </if>
- <trim prefix=" SET " suffix="" prefixOverrides="," suffixOverrides=",">
- <if test="appointmentDate != null and appointmentDate != ''">
- appointmentDate=#{appointmentDate},
- </if>
- <if test="businessBelonging != null and businessBelonging != ''">
- businessBelonging=#{businessBelonging},
- </if>
- <if test="taskName != null and taskName != ''">
- taskName=#{taskName},
- </if>
- <if test="taskTheme != null and taskTheme != ''">
- taskTheme=#{taskTheme},
- </if>
- <if test="patientName != null and patientName != ''">
- patientName=#{patientName},
- </if>
- <if test="gender != null and gender != ''">
- gender=#{gender},
- </if>
- <if test="age != null and age != ''">
- age=#{age},
- </if>
- <if test="followUpSummary != null and followUpSummary != ''">
- followUpSummary=#{followUpSummary},
- </if>
- <if test="disease != null and disease != ''">
- disease=#{disease},
- </if>
- <if test="storeName != null and storeName != ''">
- storeName=#{storeName},
- </if>
- <if test="genericName != null and genericName != ''">
- genericName=#{genericName},
- </if>
- <if test="productName != null and productName != ''">
- productName=#{productName},
- </if>
- <if test="taskFollower != null and taskFollower != ''">
- taskFollower=#{taskFollower},
- </if>
- <if test="actualFollowUpTime != null and actualFollowUpTime != ''">
- actualFollowUpTime=#{actualFollowUpTime},
- </if>
- <if test="callConnectedCount != null and callConnectedCount != ''">
- callConnectedCount=#{callConnectedCount},
- </if>
- <if test="outboundCallCount != null and outboundCallCount != ''">
- outboundCallCount=#{outboundCallCount},
- </if>
- <if test="nextOutboundCallCount != null and nextOutboundCallCount != ''">
- nextOutboundCallCount=#{nextOutboundCallCount},
- </if>
- <if test="taskStatus != null and taskStatus != ''">
- taskStatus=#{taskStatus},
- </if>
- <if test="lastOutboundStatus != null and lastOutboundStatus != ''">
- lastOutboundStatus=#{lastOutboundStatus},
- </if>
- <if test="createdAt != null and createdAt != ''">
- createdAt=#{createdAt},
- </if>
- <if test="updatedAt != null and updatedAt != ''">
- updatedAt=#{updatedAt},
- </if>
- </trim>
- <if test="up != null and up!=''">
- <if test="id!= null and id!=''">
- where id=#{id}
- </if>
- </if>
- </update>
- <!--随访任务 删除-->
- <delete id="followUpRemove" parameterType="pd">
- <if test="ids != null">
- delete from s_dtp_ysfw_follow_up_task where
- <if test="ids != null">
- id in(#{ids})
- </if>
- </if>
- </delete>
- <!--随访跟进人分配 查询-->
- <select id="selectFollowUpAssignList" parameterType="pd" resultType="pd">
- select *,DATE_FORMAT(updatedAt, '%Y-%m-%d %H:%i:%s') AS updateTime2 from s_dtp_ysfw_follow_up_assign where 1=1
- <if test="id != null and id != ''">
- and id=#{id}
- </if>
- <if test="patientName != null and patientName != ''">
- and patientName=#{patientName}
- </if>
- <if test="patientPhone != null and patientPhone != ''">
- and patientPhone=#{patientPhone}
- </if>
- <if test="gender != null and gender != ''">
- and gender=#{gender}
- </if>
- <if test="age != null and age != ''">
- and age=#{age}
- </if>
- <if test="disease != null and disease != ''">
- and disease=#{disease}
- </if>
- <if test="clinicalDiagnosis != null">
- and clinicalDiagnosis=#{clinicalDiagnosis}
- </if>
- <if test="medicineName != null and medicineName != ''">
- and medicineName=#{medicineName}
- </if>
- <if test="lastPurchaseDate != null">
- and lastPurchaseDate=#{lastPurchaseDate}
- </if>
- <if test="filingDate != null">
- and filingDate=#{filingDate}
- </if>
- <if test="followUpPersonName != null and followUpPersonName != ''">
- and followUpPersonName=#{followUpPersonName}
- </if>
- <if test="followUpPersonPhone != null and followUpPersonPhone != ''">
- and followUpPersonPhone=#{followUpPersonPhone}
- </if>
- <if test="followUpPersonRole != null and followUpPersonRole != ''">
- and followUpPersonRole=#{followUpPersonRole}
- </if>
- <if test="storeName != null and storeName != ''">
- and storeName=#{storeName}
- </if>
- <if test="patientAssignmentStatus != null and patientAssignmentStatus != ''">
- and patientAssignmentStatus=#{patientAssignmentStatus}
- </if>
- <if test="terminatedEmployeeName != null">
- and terminatedEmployeeName=#{terminatedEmployeeName}
- </if>
- <if test="terminatedEmployeePhone != null">
- and terminatedEmployeePhone=#{terminatedEmployeePhone}
- </if>
- <if test="terminatedEmployeeStore != null">
- and terminatedEmployeeStore=#{terminatedEmployeeStore}
- </if>
- <if test="createdAt != null">
- and createdAt=#{createdAt}
- </if>
- <if test="updatedAt != null">
- and updatedAt=#{updatedAt}
- </if>
- </select>
- <!--随访跟进人分配 修改-->
- <update id="updateFollowUpAssign" parameterType="pd" >
- <if test="up != null and up!=''">
- update s_dtp_ysfw_follow_up_assign
- </if>
- <trim prefix=" SET " suffix="" prefixOverrides="," suffixOverrides=",">
- <if test="patientName != null and patientName != ''">
- patientName=#{patientName},
- </if>
- <if test="patientPhone != null and patientPhone != ''">
- patientPhone=#{patientPhone},
- </if>
- <if test="gender != null and gender != ''">
- gender=#{gender},
- </if>
- <if test="age != null and age != ''">
- age=#{age},
- </if>
- <if test="disease != null and disease != ''">
- disease=#{disease},
- </if>
- <if test="clinicalDiagnosis != null">
- clinicalDiagnosis=#{clinicalDiagnosis},
- </if>
- <if test="medicineName != null and medicineName != ''">
- medicineName=#{medicineName},
- </if>
- <if test="lastPurchaseDate != null">
- lastPurchaseDate=#{lastPurchaseDate},
- </if>
- <if test="filingDate != null">
- filingDate=#{filingDate},
- </if>
- <if test="followUpPersonName != null and followUpPersonName != ''">
- followUpPersonName=#{followUpPersonName},
- </if>
- <if test="followUpPersonPhone != null and followUpPersonPhone != ''">
- followUpPersonPhone=#{followUpPersonPhone},
- </if>
- <if test="followUpPersonRole != null and followUpPersonRole != ''">
- followUpPersonRole=#{followUpPersonRole},
- </if>
- <if test="storeName != null and storeName != ''">
- storeName=#{storeName},
- </if>
- <if test="patientAssignmentStatus != null and patientAssignmentStatus != ''">
- patientAssignmentStatus=#{patientAssignmentStatus},
- </if>
- <if test="terminatedEmployeeName != null">
- terminatedEmployeeName=#{terminatedEmployeeName},
- </if>
- <if test="terminatedEmployeePhone != null">
- terminatedEmployeePhone=#{terminatedEmployeePhone},
- </if>
- <if test="terminatedEmployeeStore != null">
- terminatedEmployeeStore=#{terminatedEmployeeStore},
- </if>
- <if test="createdAt != null">
- createdAt=#{createdAt},
- </if>
- <if test="updatedAt != null">
- updatedAt=#{updatedAt},
- </if>
- </trim>
- <if test="up != null and up!=''">
- <if test="id!= null and id!=''">
- where id=#{id}
- </if>
- </if>
- </update>
- <!--随访跟进人分配 删除-->
- <delete id="followUpAssignRemove" parameterType="pd">
- <if test="ids != null">
- delete from s_dtp_ysfw_follow_up_assign where
- <if test="ids != null">
- id in(#{ids})
- </if>
- </if>
- </delete>
- <!--根据所属们id查询患者信息-->
- <select id="getAllPatients" parameterType="pd" resultType="pd">
- select id ,name ,storeName ,storeId from s_dtp_ysfw_archive_management where 1=1 and storeId=#{DeptId}
- </select>
- <select id="selectConsultationAndDrug" parameterType="pd" resultType="pd">
- SELECT
- pc.id AS id,
- pc.storeName,
- pc.storeId,
- pc.patientId,
- pc.createdBy,
- pc.createdDate,
- pc.patientName,
- pc.patientPhone,
- pc.gender,
- pc.age,
- pc.KnowledgeLink,
- pc.questionType,
- pc.consultationQuestion,
- pc.pharmacistAnswer,
- pc.consultationTime,
- pc.disease,
- pc.genericName,
- pc.productName,
- pd.id AS prescriptionDrugId,
- pd.productName AS prescriptionProductName,
- pd.genericName AS prescriptionGenericName,
- pd.mdmCode AS prescriptionmdmCode,
- pd.prescriptionNumber
- FROM
- s_dtp_ysfw_patient_consultation pc
- LEFT JOIN
- s_dtp_cfdj_prescription_drug pd ON pc.patientId = pd.patientId
- WHERE
- pc.storeId = #{storeId}
- <if test="createdDate != null">
- AND pc.createdDate=#{createdDate}
- </if>
- <if test="query != null and query != ''">
- AND (pc.patientName LIKE CONCAT('%', #{query}, '%')
- OR pc.patientPhone = #{query})
- </if>
- <if test="questionType != null and questionType != ''">
- AND pc.questionType=#{questionType}
- </if>
- <if test="consultationQuestion != null and consultationQuestion != ''">
- AND pc.consultationQuestion=#{consultationQuestion}
- </if>
- <if test="pharmacistAnswer != null and pharmacistAnswer != ''">
- AND pc.pharmacistAnswer=#{pharmacistAnswer}
- </if>
- <if test="beginTime != null and beginTime!='' and endTime != null and endTime!=''">
- and pc.consultationTime between #{beginTime} and #{endTime}
- </if>
- <if test="disease != null and disease != ''">
- AND pc.disease=#{disease}
- </if>
- <if test="product != null and product != ''">
- AND pd.genericName =#{product} OR pd.productName = #{product} OR pd.mdmCode = #{product}
- </if>
- ORDER BY
- pc.id ASC
- </select>
- <!--患者咨询根据id-->
- <select id="findPatientCounselingById" parameterType="pd" resultType="pd">
- select * from s_dtp_ysfw_patient_consultation where 1=1 and id=#{id}
- </select>
- <!--患者咨询 查询所有-->
- <select id="selectPatientCounselingList" parameterType="pd" resultType="pd">
- select *,DATE_FORMAT(consultationTime, '%Y-%m-%d %H:%i:%s') AS updateTime2 from s_dtp_ysfw_patient_consultation where 1=1
- <if test="id != null and id != ''">
- and id=#{id}
- </if>
- <if test="createdBy != null and createdBy != ''">
- AND createdBy=#{createdBy}
- </if>
- <if test="createdDate != null">
- AND createdDate=#{createdDate}
- </if>
- <if test="patientName != null and patientName != ''">
- AND patientName=#{patientName}
- </if>
- <if test="patientPhone != null and patientPhone != ''">
- AND patientPhone=#{patientPhone}
- </if>
- <if test="questionType != null and questionType != ''">
- AND questionType=#{questionType}
- </if>
- <if test="consultationQuestion != null and consultationQuestion != ''">
- AND consultationQuestion=#{consultationQuestion}
- </if>
- <if test="pharmacistAnswer != null and pharmacistAnswer != ''">
- AND pharmacistAnswer=#{pharmacistAnswer}
- </if>
- <if test="consultationTime != null">
- AND consultationTime=#{consultationTime}
- </if>
- <if test="disease != null and disease != ''">
- AND disease=#{disease}
- </if>
- <if test="genericName != null and genericName != ''">
- AND genericName=#{genericName}
- </if>
- <if test="productName != null and productName != ''">
- AND productName=#{productName}
- </if>
- </select>
- <insert id="insertPatientConsultation" parameterType="pd">
- INSERT INTO s_dtp_ysfw_patient_consultation
- <trim prefix="(" suffix=")" prefixOverrides="," suffixOverrides=",">
- <if test="createdBy != null and createdBy !=''">createdBy,</if>
- <if test="createdDate != null and createdDate !=''">createdDate,</if>
- <if test="patientName != null and patientName != ''">patientName,</if>
- <if test="patientPhone != null and patientPhone != ''">patientPhone,</if>
- <if test="gender != null">gender,</if>
- <if test="age != null">age,</if>
- <if test="KnowledgeLink != null and KnowledgeLink != ''">KnowledgeLink,</if>
- <if test="questionType != null and questionType != ''">questionType,</if>
- <if test="consultationQuestion != null and consultationQuestion != ''">consultationQuestion,</if>
- <if test="pharmacistAnswer != null and pharmacistAnswer != ''">pharmacistAnswer,</if>
- <if test="consultationTime != null">consultationTime,</if>
- <if test="contactRelation != null and contactRelation != ''">contactRelation,</if>
- <if test="disease != null and disease != ''">disease,</if>
- <if test="genericName != null and genericName != ''">genericName,</if>
- <if test="productName != null and productName != ''">productName,</if>
- <if test="storeId != null">storeId,</if>
- <if test="storeName != null and storeName != ''">storeName,</if>
- <if test="patientId != null">patientId,</if>
- </trim>
- <trim prefix=" VALUES (" suffix=")" prefixOverrides="," suffixOverrides=",">
- <if test="createdBy != null and createdBy !=''">#{createdBy},</if>
- <if test="createdDate != null and createdDate !=''">#{createdDate},</if>
- <if test="patientName != null and patientName != ''">#{patientName},</if>
- <if test="patientPhone != null and patientPhone != ''">#{patientPhone},</if>
- <if test="gender != null">#{gender},</if>
- <if test="age != null">#{age},</if>
- <if test="KnowledgeLink != null and KnowledgeLink != ''">#{KnowledgeLink},</if>
- <if test="questionType != null and questionType != ''">#{questionType},</if>
- <if test="consultationQuestion != null and consultationQuestion != ''">#{consultationQuestion},</if>
- <if test="pharmacistAnswer != null and pharmacistAnswer != ''">#{pharmacistAnswer},</if>
- <if test="consultationTime != null and consultationTime != ''">#{consultationTime},</if>
- <if test="contactRelation != null and contactRelation != ''">#{contactRelation},</if>
- <if test="disease != null and disease != ''">#{disease},</if>
- <if test="genericName != null and genericName != ''">#{genericName},</if>
- <if test="productName != null and productName != ''">#{productName},</if>
- <if test="storeId != null">#{storeId},</if>
- <if test="storeName != null and storeName != ''">#{storeName},</if>
- <if test="patientId != null and patientId != ''">#{patientId},</if>
- </trim>
- </insert>
- <!--患者咨询 修改-->
- <update id="updatePatientCounseling" parameterType="pd" >
- <if test="up != null and up!=''">
- update s_dtp_ysfw_patient_consultation
- </if>
- <trim prefix=" SET " suffix="" prefixOverrides="," suffixOverrides=",">
- <if test="regenerator != null and regenerator != ''">
- regenerator=#{regenerator},
- </if>
- <if test="updateDate != null and updateDate !=''">
- updateDate=#{updateDate},
- </if>
- <if test="questionType != null and questionType != ''">
- questionType=#{questionType},
- </if>
- <if test="KnowledgeLink != null and KnowledgeLink != ''">
- KnowledgeLink=#{KnowledgeLink},
- </if>
- <if test="contactRelation != null and contactRelation != ''">
- contactRelation=#{contactRelation},
- </if>
- <if test="consultationQuestion != null and consultationQuestion != ''">
- consultationQuestion=#{consultationQuestion},
- </if>
- <if test="pharmacistAnswer != null and pharmacistAnswer != ''">
- pharmacistAnswer=#{pharmacistAnswer},
- </if>
- <if test="consultationTime != null">
- consultationTime=#{consultationTime},
- </if>
- </trim>
- <if test="up != null and up!=''">
- <if test="id!= null and id!=''">
- where id=#{id}
- </if>
- </if>
- </update>
- <!--患者咨询 删除-->
- <delete id="patientCounselingRemove" parameterType="pd">
- <if test="ids != null">
- delete from s_dtp_ysfw_patient_consultation where
- <if test="ids != null">
- id in(#{ids})
- </if>
- </if>
- </delete>
- <!--随访满意度评价 查询-->
- <select id="selectFindFollowUpEvaluationList" parameterType="pd" resultType="pd">
- select * from s_ysfw_follow_up_evaluation where 1=1
- <if test="id != null and id != ''">
- AND id = #{id}
- </if>
- <if test="businessId != null and businessId != ''">
- AND businessId = #{businessId}
- </if>
- <if test="businessName != null and businessName != ''">
- AND businessName = #{businessName}
- </if>
- <if test="createdBy != null and createdBy != ''">
- AND createdBy = #{createdBy}
- </if>
- <if test="createdDate != null">
- AND createdDate = #{createdDate}
- </if>
- <if test="patientName != null and patientName != ''">
- AND patientName = #{patientName}
- </if>
- <if test="followUpTask != null and followUpTask != ''">
- AND followUpTask = #{followUpTask}
- </if>
- <if test="taskFollower != null and taskFollower != ''">
- AND taskFollower = #{taskFollower}
- </if>
- <if test="evaluationDate != null and evaluationDate != ''" >
- AND evaluationDate = #{evaluationDate}
- </if>
- <if test="beginTime != null and beginTime!='' and endTime != null and endTime!=''">
- and evaluationDate between #{beginTime} and #{endTime}
- </if>
- <if test="chainStoreName != null and chainStoreName != ''">
- AND chainStoreName = #{chainStoreName}
- </if>
- <if test="storeName != null and storeName != ''">
- AND storeName = #{storeName}
- </if>
- <if test="taskId != null and taskId != ''">
- AND taskId = #{taskId}
- </if>
- </select>
- <!--随访满意度评价 修改-->
- <update id="updateFindFollowUpEvaluation" parameterType="pd" >
- <if test="up != null and up!=''">
- update s_ysfw_follow_up_evaluation
- </if>
- <trim prefix=" SET " suffix="" prefixOverrides="," suffixOverrides=",">
- <if test="businessName != null and businessName != ''">
- businessName = #{businessName},
- </if>
- <if test="createdBy != null and createdBy != ''">
- createdBy = #{createdBy},
- </if>
- <if test="createdDate != null">
- createdDate = #{createdDate},
- </if>
- <if test="patientName != null and patientName != ''">
- patientName = #{patientName},
- </if>
- <if test="followUpTask != null and followUpTask != ''">
- followUpTask = #{followUpTask},
- </if>
- <if test="taskFollower != null and taskFollower != ''">
- taskFollower = #{taskFollower},
- </if>
- <if test="evaluationDate != null">
- evaluationDate = #{evaluationDate},
- </if>
- <if test="chainStoreName != null and chainStoreName != ''">
- chainStoreName = #{chainStoreName},
- </if>
- <if test="storeName != null and storeName != ''">
- storeName = #{storeName},
- </if>
- <if test="taskId != null and taskId != ''">
- taskId = #{taskId},
- </if>
- </trim>
- <if test="up != null and up!=''">
- <if test="id!= null and id!=''">
- where id=#{id}
- </if>
- </if>
- </update>
- <!--随访满意度评价 删除-->
- <delete id="findFollowUpEvaluationRemove" parameterType="pd">
- <if test="ids != null">
- delete from s_ysfw_follow_up_evaluation where
- <if test="ids != null">
- id in(#{ids})
- </if>
- </if>
- </delete>
- <!--查询患者基础信息-->
- <select id="selectPatientBasicInfo" parameterType="pd" resultType="pd">
- SELECT * FROM s_dtp_ysfw_patientbasicinfor WHERE 1=1
- <if test="id != null and id != ''">
- AND id = #{id}
- </if>
- <if test="currentEconomicSituation != null and currentEconomicSituation != ''">
- AND currentEconomicSituation = #{currentEconomicSituation}
- </if>
- <if test="patientAwareness != null and patientAwareness != ''">
- AND patientAwareness = #{patientAwareness}
- </if>
- <if test="followUpFeedbackDoctor != null and followUpFeedbackDoctor != ''">
- AND followUpFeedbackDoctor = #{followUpFeedbackDoctor}
- </if>
- <if test="bloodPressureStatus != null and bloodPressureStatus != ''">
- AND bloodPressureStatus = #{bloodPressureStatus}
- </if>
- <if test="heartRate != null and heartRate != ''">
- AND heartRate = #{heartRate}
- </if>
- <if test="smokingHistory != null and smokingHistory != ''">
- AND smokingHistory = #{smokingHistory}
- </if>
- <if test="drinkingHistory != null and drinkingHistory != ''">
- AND drinkingHistory = #{drinkingHistory}
- </if>
- <if test="exerciseHabit != null and exerciseHabit != ''">
- AND exerciseHabit = #{exerciseHabit}
- </if>
- <if test="dietaryPreference != null and dietaryPreference != ''">
- AND dietaryPreference = #{dietaryPreference}
- </if>
- <if test="sleepCondition != null and sleepCondition != ''">
- AND sleepCondition = #{sleepCondition}
- </if>
- <if test="pathologicalStage != null and pathologicalStage != ''">
- AND pathologicalStage = #{pathologicalStage}
- </if>
- <if test="treatmentStage != null and treatmentStage != ''">
- AND treatmentStage = #{treatmentStage}
- </if>
- <if test="accompanyingSymptoms != null and accompanyingSymptoms != ''">
- AND accompanyingSymptoms = #{accompanyingSymptoms}
- </if>
- <if test="hasGeneticTesting != null and hasGeneticTesting != ''">
- AND hasGeneticTesting = #{hasGeneticTesting}
- </if>
- <if test="hasImmuneTesting != null and hasImmuneTesting != ''">
- AND hasImmuneTesting = #{hasImmuneTesting}
- </if>
- <if test="medicalHistory != null and medicalHistory != ''">
- AND medicalHistory = #{medicalHistory}
- </if>
- <if test="medicalHistoryDescription != null and medicalHistoryDescription != ''">
- AND medicalHistoryDescription = #{medicalHistoryDescription}
- </if>
- <if test="infectiousDiseaseHistory != null and infectiousDiseaseHistory != ''">
- AND infectiousDiseaseHistory = #{infectiousDiseaseHistory}
- </if>
- <if test="infectiousDiseaseHistoryDescription != null and infectiousDiseaseHistoryDescription != ''">
- AND infectiousDiseaseHistoryDescription = #{infectiousDiseaseHistoryDescription}
- </if>
- <if test="allergyHistory != null and allergyHistory != ''">
- AND allergyHistory = #{allergyHistory}
- </if>
- <if test="pastAdverseDrugReactionHistory != null and pastAdverseDrugReactionHistory != ''">
- AND pastAdverseDrugReactionHistory = #{pastAdverseDrugReactionHistory}
- </if>
- <if test="hasSurgicalTraumaHistory != null and hasSurgicalTraumaHistory != ''">
- AND hasSurgicalTraumaHistory = #{hasSurgicalTraumaHistory}
- </if>
- <if test="multipleTreatmentReasonsDescription != null and multipleTreatmentReasonsDescription != ''">
- AND multipleTreatmentReasonsDescription = #{multipleTreatmentReasonsDescription}
- </if>
- <if test="familyHistoryId != null and familyHistoryId != ''">
- AND familyHistoryId = #{familyHistoryId}
- </if>
- <if test="previousMedicationId != null and previousMedicationId != ''">
- AND previousMedicationId = #{previousMedicationId}
- </if>
- <if test="contactPersonId != null and contactPersonId != ''">
- AND contactPersonId = #{contactPersonId}
- </if>
- <if test="archiveId != null and archiveId != ''">
- AND archiveId = #{archiveId}
- </if>
- <if test="caregiver != null and caregiver != ''">
- AND caregiver = #{caregiver}
- </if>
- <if test="createdBy != null and createdBy != ''">
- AND createdBy = #{createdBy}
- </if>
- <if test="createdAt != null and createdAt != ''">
- AND createdAt = #{createdAt}
- </if>
- <if test="basicInfoCompleter != null and basicInfoCompleter != ''">
- AND basicInfoCompleter = #{basicInfoCompleter}
- </if>
- <if test="recordUpdateTimestamp != null and recordUpdateTimestamp != ''">
- AND recordUpdateTimestamp = #{recordUpdateTimestamp}
- </if>
- <if test="status != null and status != ''">
- AND status = #{status}
- </if>
- <if test="deleteMarker != null and deleteMarker != ''">
- AND deleteMarker = #{deleteMarker}
- </if>
- </select>
- <!--查询患者基础信息根据Id-->
- <select id="selectPatientBasicInfoById" parameterType="pd" resultType="pd">
- SELECT * FROM s_dtp_ysfw_patientbasicinfor WHERE 1=1
- <if test="id != null and id != ''">
- AND archiveId = #{id}
- </if>
- </select>
- <!--添加患者基础信息-->
- <insert id="insertPatientBasicInfo" parameterType="pd">
- INSERT INTO s_dtp_ysfw_patientbasicinfor
- <trim prefix="(" suffix=")" prefixOverrides="," suffixOverrides=",">
- <if test="id != null and id != ''">id,</if>
- <if test="currentEconomicSituation != null and currentEconomicSituation != ''">currentEconomicSituation,</if>
- <if test="patientAwareness != null and patientAwareness != ''">patientAwareness,</if>
- <if test="followUpFeedbackDoctor != null and followUpFeedbackDoctor != ''">followUpFeedbackDoctor,</if>
- <if test="bloodPressureStatus != null and bloodPressureStatus != ''">bloodPressureStatus,</if>
- <if test="heartRate != null and heartRate != ''">heartRate,</if>
- <if test="smokingHistory != null and smokingHistory != ''">smokingHistory,</if>
- <if test="drinkingHistory != null and drinkingHistory != ''">drinkingHistory,</if>
- <if test="exerciseHabit != null and exerciseHabit != ''">exerciseHabit,</if>
- <if test="dietaryPreference != null and dietaryPreference != ''">dietaryPreference,</if>
- <if test="sleepCondition != null and sleepCondition != ''">sleepCondition,</if>
- <if test="pathologicalStage != null and pathologicalStage != ''">pathologicalStage,</if>
- <if test="treatmentStage != null and treatmentStage != ''">treatmentStage,</if>
- <if test="accompanyingSymptoms != null and accompanyingSymptoms != ''">accompanyingSymptoms,</if>
- <if test="hasGeneticTesting != null and hasGeneticTesting != ''">hasGeneticTesting,</if>
- <if test="hasImmuneTesting != null and hasImmuneTesting != ''">hasImmuneTesting,</if>
- <if test="medicalHistory != null and medicalHistory != ''">medicalHistory,</if>
- <if test="medicalHistoryDescription != null and medicalHistoryDescription != ''">medicalHistoryDescription,</if>
- <if test="infectiousDiseaseHistory != null and infectiousDiseaseHistory != ''">infectiousDiseaseHistory,</if>
- <if test="infectiousDiseaseHistoryDescription != null and infectiousDiseaseHistoryDescription != ''">infectiousDiseaseHistoryDescription,</if>
- <if test="allergyHistory != null and allergyHistory != ''">allergyHistory,</if>
- <if test="pastAdverseDrugReactionHistory != null and pastAdverseDrugReactionHistory != ''">pastAdverseDrugReactionHistory,</if>
- <if test="hasSurgicalTraumaHistory != null and hasSurgicalTraumaHistory != ''">hasSurgicalTraumaHistory,</if>
- <if test="multipleTreatmentReasonsDescription != null and multipleTreatmentReasonsDescription != ''">multipleTreatmentReasonsDescription,</if>
- <if test="familyHistoryId != null and familyHistoryId != ''">familyHistoryId,</if>
- <if test="previousMedicationId != null and previousMedicationId != ''">previousMedicationId,</if>
- <if test="contactPersonId != null and contactPersonId != ''">contactPersonId,</if>
- <if test="archiveId != null and archiveId != ''">archiveId,</if>
- <if test="caregiver != null and caregiver != ''">caregiver,</if>
- <if test="createdBy != null and createdBy != ''">createdBy,</if>
- <if test="createdAt != null and createdAt != ''">createdAt,</if>
- <if test="basicInfoCompleter != null and basicInfoCompleter != ''">basicInfoCompleter,</if>
- <if test="recordUpdateTimestamp != null and recordUpdateTimestamp != ''">recordUpdateTimestamp,</if>
- <if test="status != null and status != ''">status,</if>
- <if test="deleteMarker != null and deleteMarker != ''">deleteMarker</if>
- </trim>
- <trim prefix="VALUES (" suffix=")" prefixOverrides="," suffixOverrides=",">
- <if test="id != null and id != ''">#{id},</if>
- <if test="currentEconomicSituation != null and currentEconomicSituation != ''">#{currentEconomicSituation},</if>
- <if test="patientAwareness != null and patientAwareness != ''">#{patientAwareness},</if>
- <if test="followUpFeedbackDoctor != null and followUpFeedbackDoctor != ''">#{followUpFeedbackDoctor},</if>
- <if test="bloodPressureStatus != null and bloodPressureStatus != ''">#{bloodPressureStatus},</if>
- <if test="heartRate != null and heartRate != ''">#{heartRate},</if>
- <if test="smokingHistory != null and smokingHistory != ''">#{smokingHistory},</if>
- <if test="drinkingHistory != null and drinkingHistory != ''">#{drinkingHistory},</if>
- <if test="exerciseHabit != null and exerciseHabit != ''">#{exerciseHabit},</if>
- <if test="dietaryPreference != null and dietaryPreference != ''">#{dietaryPreference},</if>
- <if test="sleepCondition != null and sleepCondition != ''">#{sleepCondition},</if>
- <if test="pathologicalStage != null and pathologicalStage != ''">#{pathologicalStage},</if>
- <if test="treatmentStage != null and treatmentStage != ''">#{treatmentStage},</if>
- <if test="accompanyingSymptoms != null and accompanyingSymptoms != ''">#{accompanyingSymptoms},</if>
- <if test="hasGeneticTesting != null and hasGeneticTesting != ''">#{hasGeneticTesting},</if>
- <if test="hasImmuneTesting != null and hasImmuneTesting != ''">#{hasImmuneTesting},</if>
- <if test="medicalHistory != null and medicalHistory != ''">#{medicalHistory},</if>
- <if test="medicalHistoryDescription != null and medicalHistoryDescription != ''">#{medicalHistoryDescription},</if>
- <if test="infectiousDiseaseHistory != null and infectiousDiseaseHistory != ''">#{infectiousDiseaseHistory},</if>
- <if test="infectiousDiseaseHistoryDescription != null and infectiousDiseaseHistoryDescription != ''">#{infectiousDiseaseHistoryDescription},</if>
- <if test="allergyHistory != null and allergyHistory != ''">#{allergyHistory},</if>
- <if test="pastAdverseDrugReactionHistory != null and pastAdverseDrugReactionHistory != ''">#{pastAdverseDrugReactionHistory},</if>
- <if test="hasSurgicalTraumaHistory != null and hasSurgicalTraumaHistory != ''">#{hasSurgicalTraumaHistory},</if>
- <if test="multipleTreatmentReasonsDescription != null and multipleTreatmentReasonsDescription != ''">#{multipleTreatmentReasonsDescription},</if>
- <if test="familyHistoryId != null and familyHistoryId != ''">#{familyHistoryId},</if>
- <if test="previousMedicationId != null and previousMedicationId != ''">#{previousMedicationId},</if>
- <if test="contactPersonId != null and contactPersonId != ''">#{contactPersonId},</if>
- <if test="archiveId != null and archiveId != ''">#{archiveId},</if>
- <if test="caregiver != null and caregiver != ''">#{caregiver},</if>
- <if test="createdBy != null and createdBy != ''">#{createdBy},</if>
- <if test="createdAt != null and createdAt != ''">#{createdAt},</if>
- <if test="basicInfoCompleter != null and basicInfoCompleter != ''">#{basicInfoCompleter},</if>
- <if test="recordUpdateTimestamp != null and recordUpdateTimestamp != ''">#{recordUpdateTimestamp},</if>
- <if test="status != null and status != ''">#{status},</if>
- <if test="deleteMarker != null and deleteMarker != ''">#{deleteMarker}</if>
- </trim>
- </insert>
- <!--修改患者基础信息-->
- <update id="updatePatientBasicInfo" parameterType="pd">
- UPDATE s_dtp_ysfw_patientbasicinfor SET
- <trim prefix="" suffixOverrides="," prefixOverrides=",">
- <if test="currentEconomicSituation != null and currentEconomicSituation != ''">
- currentEconomicSituation = #{currentEconomicSituation},
- </if>
- <if test="patientAwareness != null and patientAwareness != ''">
- patientAwareness = #{patientAwareness},
- </if>
- <if test="followUpFeedbackDoctor != null and followUpFeedbackDoctor != ''">
- followUpFeedbackDoctor = #{followUpFeedbackDoctor},
- </if>
- <if test="bloodPressureStatus != null and bloodPressureStatus != ''">
- bloodPressureStatus = #{bloodPressureStatus},
- </if>
- <if test="heartRate != null and heartRate != ''">
- heartRate = #{heartRate},
- </if>
- <if test="smokingHistory != null and smokingHistory != ''">
- smokingHistory = #{smokingHistory},
- </if>
- <if test="drinkingHistory != null and drinkingHistory != ''">
- drinkingHistory = #{drinkingHistory},
- </if>
- <if test="exerciseHabit != null and exerciseHabit != ''">
- exerciseHabit = #{exerciseHabit},
- </if>
- <if test="dietaryPreference != null and dietaryPreference != ''">
- dietaryPreference = #{dietaryPreference},
- </if>
- <if test="sleepCondition != null and sleepCondition != ''">
- sleepCondition = #{sleepCondition},
- </if>
- <if test="pathologicalStage != null and pathologicalStage != ''">
- pathologicalStage = #{pathologicalStage},
- </if>
- <if test="treatmentStage != null and treatmentStage != ''">
- treatmentStage = #{treatmentStage},
- </if>
- <if test="accompanyingSymptoms != null and accompanyingSymptoms != ''">
- accompanyingSymptoms = #{accompanyingSymptoms},
- </if>
- <if test="hasGeneticTesting != null and hasGeneticTesting != ''">
- hasGeneticTesting = #{hasGeneticTesting},
- </if>
- <if test="hasImmuneTesting != null and hasImmuneTesting != ''">
- hasImmuneTesting = #{hasImmuneTesting},
- </if>
- <if test="medicalHistory != null and medicalHistory != ''">
- medicalHistory = #{medicalHistory},
- </if>
- <if test="medicalHistoryDescription != null and medicalHistoryDescription != ''">
- medicalHistoryDescription = #{medicalHistoryDescription},
- </if>
- <if test="infectiousDiseaseHistory != null and infectiousDiseaseHistory != ''">
- infectiousDiseaseHistory = #{infectiousDiseaseHistory},
- </if>
- <if test="infectiousDiseaseHistoryDescription != null and infectiousDiseaseHistoryDescription != ''">
- infectiousDiseaseHistoryDescription = #{infectiousDiseaseHistoryDescription},
- </if>
- <if test="allergyHistory != null and allergyHistory != ''">
- allergyHistory = #{allergyHistory},
- </if>
- <if test="pastAdverseDrugReactionHistory != null and pastAdverseDrugReactionHistory != ''">
- pastAdverseDrugReactionHistory = #{pastAdverseDrugReactionHistory},
- </if>
- <if test="hasSurgicalTraumaHistory != null and hasSurgicalTraumaHistory != ''">
- hasSurgicalTraumaHistory = #{hasSurgicalTraumaHistory},
- </if>
- <if test="multipleTreatmentReasonsDescription != null and multipleTreatmentReasonsDescription != ''">
- multipleTreatmentReasonsDescription = #{multipleTreatmentReasonsDescription},
- </if>
- <if test="familyHistoryId != null and familyHistoryId != ''">
- familyHistoryId = #{familyHistoryId},
- </if>
- <if test="previousMedicationId != null and previousMedicationId != ''">
- previousMedicationId = #{previousMedicationId},
- </if>
- <if test="contactPersonId != null and contactPersonId != ''">
- contactPersonId = #{contactPersonId},
- </if>
- <if test="archiveId != null and archiveId != ''">
- archiveId = #{archiveId},
- </if>
- <if test="caregiver != null and caregiver != ''">
- caregiver = #{caregiver},
- </if>
- <if test="createdBy != null and createdBy != ''">
- createdBy = #{createdBy},
- </if>
- <if test="createdAt != null and createdAt != ''">
- createdAt = #{createdAt},
- </if>
- <if test="basicInfoCompleter != null and basicInfoCompleter != ''">
- basicInfoCompleter = #{basicInfoCompleter},
- </if>
- <if test="recordUpdateTimestamp != null and recordUpdateTimestamp != ''">
- recordUpdateTimestamp = #{recordUpdateTimestamp},
- </if>
- <if test="status != null and status != ''">
- status = #{status},
- </if>
- <if test="deleteMarker != null and deleteMarker != ''">
- deleteMarker = #{deleteMarker}
- </if>
- </trim>
- WHERE id = #{id}
- </update>
- <!--假删除患者基础信息表-->
- <update id="deletePatientBasicInfo" parameterType="pd">
- UPDATE s_dtp_ysfw_patientbasicinfor SET status = 0 ,deleteMarker =1 WHERE id = #{id}
- </update>
- <!--物理患者基础信息表-->
- <update id="delPatientBasicInfo" parameterType="pd">
- DELETE FROM s_dtp_ysfw_patientbasicinfor WHERE id = #{id}
- </update>
- <!--联系人信息查询-->
- <select id="selectContacts" parameterType="pd" resultType="pd">
- SELECT * FROM s_dtp_ysfw_contacts WHERE 1=1
- <if test="id != null and id != ''">
- AND id = #{id}
- </if>
- <if test="archiveId != null and archiveId != ''">
- AND archiveId = #{archiveId}
- </if>
- <if test="contactPhone != null and contactPhone != ''">
- AND contactPhone = #{contactPhone}
- </if>
- <if test="contactName != null and contactName != ''">
- AND contactName = #{contactName}
- </if>
- <if test="contactRelationship != null and contactRelationship != ''">
- AND contactRelationship = #{contactRelationship}
- </if>
- <if test="createdBy != null and createdBy != ''">
- AND createdBy = #{createdBy}
- </if>
- <if test="status != null and status != ''">
- AND status = #{status}
- </if>
- </select>
- <!--联系人信息添加-->
- <insert id="insertContact" parameterType="pd">
- INSERT INTO s_dtp_ysfw_contacts
- <trim prefix="(" suffix=")" prefixOverrides="," suffixOverrides=",">
- <if test="archiveId != null and archiveId != ''">archiveId,</if>
- <if test="contactPhone != null and contactPhone != ''">contactPhone,</if>
- <if test="contactName != null and contactNamecontactName != ''">contactName,</if>
- <if test="contactRelationship != null and contactRelationship != ''">contactRelationship,</if>
- <if test="createdBy != null and createdBy != ''">createdBy,</if>
- <if test="createdAt != null and createdAt != ''">createdAt,</if>
- <if test="updatedAt != null and updatedAt != ''">updatedAt,</if>
- <if test="status != null and status != ''">status</if>
- </trim>
- <trim prefix="VALUES (" suffix=")" prefixOverrides="," suffixOverrides=",">
- <if test="archiveId != null and archiveId != ''">#{archiveId},</if>
- <if test="contactPhone != null and contactPhone != ''">#{contactPhone},</if>
- <if test="contactName != null and contactName != ''">#{contactName},</if>
- <if test="contactRelationship != null and contactRelationship != ''">#{contactRelationship},</if>
- <if test="createdBy != null and createdBy != ''">#{createdBy},</if>
- <if test="createdAt != null and createdAt != ''">#{createdAt},</if>
- <if test="updatedAt != null and updatedAt != ''">#{updatedAt},</if>
- <if test="status != null and status != ''">#{status}</if>
- </trim>
- </insert>
- <!--联系人信息修改-->
- <update id="updateContact" parameterType="pd">
- UPDATE s_dtp_ysfw_contacts SET
- <trim prefix="" suffixOverrides="," prefixOverrides=",">
- <if test="archiveId != null and archiveId != ''">
- archiveId = #{archiveId},
- </if>
- <if test="contactPhone != null and contactPhone != ''">
- contactPhone = #{contactPhone},
- </if>
- <if test="contactName != null and contactName != ''">
- contactName = #{contactName},
- </if>
- <if test="contactRelationship != null and contactRelationship != ''">
- contactRelationship = #{contactRelationship},
- </if>
- <if test="createdBy != null and createdBy != ''">
- createdBy = #{createdBy},
- </if>
- <if test="status != null and status != ''">
- status = #{status}
- </if>
- </trim>
- WHERE id = #{id}
- </update>
- <select id="findhistoryByarchiveId" parameterType="pd" resultType="pd">
- SELECT * FROM s_dtp_ysfw_family_history WHERE 1=1 and archiveId = #{archiveId}
- </select>
- <select id="findrecordsByarchiveId" parameterType="pd" resultType="pd">
- SELECT * FROM s_dtp_ysfw_medication_records WHERE 1=1 and archiveId = #{archiveId}
- </select>
- <select id="findcontactsByarchiveId" parameterType="pd" resultType="pd">
- SELECT * FROM s_dtp_ysfw_contacts WHERE 1=1 and archiveId = #{archiveId}
- </select>
- <!--家族病史表信息查询-->
- <select id="selectFamilyHistories" parameterType="pd" resultType="pd">
- SELECT * FROM s_dtp_ysfw_family_history WHERE 1=1
- <if test="id != null and id != ''">
- AND id = #{id}
- </if>
- <if test="archiveId != null and archiveId != ''">
- AND archiveId = #{archiveId}
- </if>
- <if test="disease != null and disease != ''">
- AND disease = #{disease}
- </if>
- <if test="member != null and member != ''">
- AND member = #{member}
- </if>
- <if test="createdBy != null and createdBy != ''">
- AND createdBy = #{createdBy}
- </if>
- <if test="status != null and status != ''">
- AND status = #{status}
- </if>
- </select>
- <!--家族病史表信息添加-->
- <insert id="insertFamilyHistory" parameterType="pd">
- INSERT INTO s_dtp_ysfw_family_history
- <trim prefix="(" suffix=")" prefixOverrides="," suffixOverrides=",">
- <if test="archiveId != null and archiveId != ''">archiveId,</if>
- <if test="disease != null and disease != ''">disease,</if>
- <if test="member != null and member != ''">member,</if>
- <if test="createdBy != null and createdBy != ''">createdBy,</if>
- <if test="createdAt != null and createdAt != ''">createdAt,</if>
- <if test="updatedAt != null and updatedAt != ''">updatedAt,</if>
- <if test="status != null and status != ''">status</if>
- </trim>
- <trim prefix="VALUES (" suffix=")" prefixOverrides="," suffixOverrides=",">
- <if test="archiveId != null and archiveId != ''">#{archiveId},</if>
- <if test="disease != null and disease != ''">#{disease},</if>
- <if test="member != null and member != ''">#{member},</if>
- <if test="createdBy != null and createdBy != ''">#{createdBy},</if>
- <if test="createdAt != null and createdAt != ''">#{createdAt},</if>
- <if test="updatedAt != null and updatedAt != ''">#{updatedAt},</if>
- <if test="status != null and status != ''">#{status}</if>
- </trim>
- </insert>
- <!--家族病史表信息修改-->
- <update id="updateFamilyHistory" parameterType="pd">
- UPDATE s_dtp_ysfw_family_history SET
- <trim prefix="" suffixOverrides="," prefixOverrides=",">
- <if test="archiveId != null and archiveId != ''">
- archiveId = #{archiveId},
- </if>
- <if test="disease != null and disease != ''">
- disease = #{disease},
- </if>
- <if test="member != null and member != ''">
- member = #{member},
- </if>
- <if test="createdBy != null and createdBy != ''">
- createdBy = #{createdBy},
- </if>
- <if test="status != null and status != ''">
- status = #{status}
- </if>
- </trim>
- WHERE id = #{id}
- </update>
- <!--用药情况表表信息查询-->
- <select id="selectMedicationRecords" parameterType="pd" resultType="pd">
- SELECT * FROM s_dtp_ysfw_medication_records WHERE 1=1
- <if test="id != null and id != ''">
- AND id = #{id}
- </if>
- <if test="archiveId != null and archiveId != ''">
- AND archiveId = #{archiveId}
- </if>
- <if test="medicationDescription != null and medicationDescription != ''">
- AND medicationDescription = #{medicationDescription}
- </if>
- <if test="medicationType != null and medicationType != ''">
- AND medicationType = #{medicationType}
- </if>
- <if test="createdBy != null and createdBy != ''">
- AND createdBy = #{createdBy}
- </if>
- <if test="status != null and status != ''">
- AND status = #{status}
- </if>
- </select>
- <!--用药情况表表信息添加-->
- <insert id="insertMedicationRecord" parameterType="pd">
- INSERT INTO s_dtp_ysfw_medication_records
- <trim prefix="(" suffix=")" prefixOverrides="," suffixOverrides=",">
- <if test="archiveId != null and archiveId != ''">archiveId,</if>
- <if test="medicationDescription != null and medicationDescription != ''">medicationDescription,</if>
- <if test="medicationType != null and medicationType != ''">medicationType,</if>
- <if test="createdBy != null and createdBy != ''">createdBy,</if>
- <if test="createdAt != null and createdAt != ''">createdAt,</if>
- <if test="updatedAt != null and updatedAt != ''">updatedAt,</if>
- <if test="status != null and status != ''">status</if>
- </trim>
- <trim prefix="VALUES (" suffix=")" prefixOverrides="," suffixOverrides=",">
- <if test="archiveId != null and archiveId != ''">#{archiveId},</if>
- <if test="medicationDescription != null and medicationDescription != ''">#{medicationDescription},</if>
- <if test="medicationType != null and medicationType != ''">#{medicationType},</if>
- <if test="createdBy != null and createdBy != ''">#{createdBy},</if>
- <if test="createdAt != null and createdAt != ''">#{createdAt},</if>
- <if test="updatedAt != null and updatedAt != ''">#{updatedAt},</if>
- <if test="status != null and status != ''">#{status}</if>
- </trim>
- </insert>
- <!--用药情况表表信息修改-->
- <update id="updateMedicationRecord" parameterType="pd">
- UPDATE s_dtp_ysfw_medication_records SET
- <trim prefix="" suffixOverrides="," prefixOverrides=",">
- <if test="archiveId != null and archiveId != ''">
- archiveId = #{archiveId},
- </if>
- <if test="medicationDescription != null and medicationDescription != ''">
- medicationDescription = #{medicationDescription},
- </if>
- <if test="medicationType != null and medicationType != ''">
- medicationType = #{medicationType},
- </if>
- <if test="created_by != null and created_by != ''">
- createdBy = #{createdBy},
- </if>
- <if test="status != null and status != ''">
- status = #{status}
- </if>
- </trim>
- WHERE id = #{id}
- </update>
- <!--物理删除家 联系人表,族病史表,用药情况表-->
- <update id="physicalDeleteContact" parameterType="pd">
- DELETE FROM s_dtp_ysfw_contacts WHERE id = #{id}
- </update>
- <update id="physicalDeleteFamilyHistory" parameterType="pd">
- DELETE FROM s_dtp_ysfw_family_history WHERE id = #{id}
- </update>
- <update id="physicalDeleteMedicationRecord" parameterType="pd">
- DELETE FROM s_dtp_ysfw_medication_records WHERE id = #{id}
- </update>
- <!--物理删除家 联系人表,族病史表,用药情况表根据档案 archiveId 删除-->
- <update id="DeleteContact" parameterType="pd">
- DELETE FROM s_dtp_ysfw_contacts WHERE archiveId = #{archiveId}
- </update>
- <update id="DeleteFamilyHistory" parameterType="pd">
- DELETE FROM s_dtp_ysfw_family_history WHERE archiveId = #{archiveId}
- </update>
- <update id="DeleteMedicationRecord" parameterType="pd">
- DELETE FROM s_dtp_ysfw_medication_records WHERE archiveId = #{archiveId}
- </update>
- <!--查询对应患者的用药购药信息-->
- <select id="getDrugPurchaseList" parameterType="pd" resultType="pd">
- select
- sddpr.prescriptionNumber , -- 销售
- sdpr.salesOrderNumber, -- 处方编号
- sddpr.prescriptionDate, -- 处方日期
- sdpr.hospital, -- 医院
- sdpr.prescribingDoctor, -- 处方医生
- sdpr.department, -- 科室
- sdpr.attendingDoctor, -- 主管医生
- sdpr.clinicalDiagnosis, -- 临床诊断
- sddpr.genericName,-- 药品通用名
- sddpr.productName,-- 商品名
- sddpr.medicationRoute,-- 用药途径
- sddpr.dosageFrequency,-- 用药频次
- sddpr.singleDoseUnit,-- 单次剂量
- sdpr.registrant,-- 登记人
- sdpr.registrationDate,-- 登记日期
- sdpr.saleDate,-- 销售日期
- sddpr.pharmacyName -- 购药门店名称
- from s_dtp_drug_purchase_record sddpr
- left join s_dtp_prescription_registration sdpr on sddpr.prescriptionNumber=sdpr.prescriptionNumber
- where sdpr.patientId=#{id}
- </select>
- </mapper>
|