1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374 |
- package thyyxxk.webserver.dao.his.chronicDisease;
- import com.baomidou.mybatisplus.core.mapper.BaseMapper;
- import org.apache.ibatis.annotations.Delete;
- import org.apache.ibatis.annotations.Param;
- import org.apache.ibatis.annotations.Select;
- import thyyxxk.webserver.entity.chronicDisease.CrmPatientMi;
- import thyyxxk.webserver.entity.chronicDisease.CrmPatientVo;
- import java.util.List;
- public interface CrmPatientMiDao extends BaseMapper<CrmPatientMi> {
- @Select(" select top 1 mi.*, tz.height, tz.weight, tz.temperature, tz.respiratory_rate, tz.heart_rate, " +
- " tz.blood_sugar, tz.blood_pressure_high, tz.blood_pressure_low, tz.blood_oxygen, rtrim(f.name) as userName, " +
- " rtrim(p.name) as referPhysicianName " +
- " from crm_patient_mi mi" +
- " left join crm_patient_tzxx tz on (mi.p_id = tz.p_id collate Chinese_PRC_BIN) and mi.visit_times = tz.visit_times " +
- " left join a_employee_mi p on mi.refer_physician = p.code collate Chinese_PRC_BIN " +
- " left join a_employee_mi f on mi.creat_id = f.code collate Chinese_PRC_BIN " +
- " where mi.social_no = #{keyCode} or mi.his_mz_no = #{keyCode} or mi.his_zy_no = #{keyCode} or mi.his_tj_no = #{keyCode}" +
- " or mi.p_name = #{keyCode} or mi.p_id = #{keyCode} ")
- CrmPatientMi selectCrmPatientMiByCode(@Param("keyCode") String keyCode);
- @Select(" select * from crm_patient_mi where social_no = #{socialNo} ")
- CrmPatientMi selectCrmPatientMiBySocialNo(@Param("socialNo") String socialNo);
- @Select(" select * from crm_patient_mi where p_id = #{pId} ")
- CrmPatientMi selectCrmPatientMiByPId(@Param("pId") String pId);
- @Delete(" delete from crm_patient_mi where social_no = #{socialNo} ")
- void deleteCrmPatientMiBySocialNo(@Param("socialNo") String socialNo);
- @Delete(" delete from crm_patient_mi where p_id = #{pId} ")
- void deleteCrmPatientMiByPId(@Param("pId") String pId);
- @Select(" select top 1 rtrim(mi.name) as p_name, mi.sex, rtrim(mi.patient_id) as his_mz_no, mi.social_no, mi.age, mi.birth_day as birth_date, " +
- " rtrim(mi.phone_no) as rel_tel, mi.province_code, mi.city_code, rtrim(mi.detail) as detail_adress, " +
- " mi.district_code as area_code " +
- " from mz_patient_mi mi " +
- " where mi.patient_id = #{code} or mi.social_no = #{code} or mi.tj_no = #{code} or mi.ic_card_no = #{code} ")
- CrmPatientMi selectCrmPatientMiMzByCode(@Param("code") String code);
- @Select(" select top 1 rtrim(mi.name) as p_name, mi.sex, rtrim(mi.inpatient_no) as his_zy_no, mi.social_no, mi.birth_date as birth_date, " +
- " rtrim(mi.relation_tel) as rel_tel, mi.province_code, mi.city_code, mi.district_code as area_code, rtrim(mi.relation_district) as detail_adress, " +
- " rtrim(mi.mz_no) as his_mz_no, rtrim(mi.relation_name) as rel_name " +
- " from a_patient_mi mi " +
- " where mi.inpatient_no = #{code} or mi.social_no = #{code} or mi.mz_no = #{code} ")
- CrmPatientMi selectCrmPatientMiZyByCode(@Param("code") String code);
- @Select("<script> " +
- " select mi.*, tz.height, tz.weight, tz.temperature, tz.respiratory_rate, tz.heart_rate, " +
- " tz.blood_sugar, tz.blood_pressure_high, tz.blood_pressure_low, tz.blood_oxygen, rtrim(f.name) as userName, " +
- " rtrim(p.name) as referPhysicianName " +
- " from crm_patient_mi mi" +
- " left join crm_patient_tzxx tz on (mi.p_id = tz.p_id collate Chinese_PRC_BIN) and mi.visit_times = tz.visit_times " +
- " left join a_employee_mi p on mi.refer_physician = p.code collate Chinese_PRC_BIN " +
- " left join a_employee_mi f on mi.creat_id = f.code collate Chinese_PRC_BIN " +
- " where (mi.social_no like '%${keyCode}%' or mi.his_mz_no like '%${keyCode}%' " +
- " or mi.his_zy_no like '%${keyCode}%' or mi.p_name like '%${keyCode}%')" +
- "<if test=\"startTime != null and startTime != '' \">" +
- " and mi.create_date >= #{startTime} " +
- "</if>" +
- "<if test=\"endTime != null and endTime != '' \">" +
- " and mi.create_date <= #{endTime} " +
- "</if>" +
- "<if test=\"diseaseType != null and diseaseType != '' \">" +
- " and chronic_disease_type like '%${diseaseType}%' " +
- "</if>" +
- " order by mi.create_date " +
- "</script> ")
- List<CrmPatientMi> selectChronicDisease(CrmPatientVo vo);
- }
|