Mybatis的增删改查(查询)完整代码

查询 单表

controller

/**
     *
     *张子辉  患者列表重做(已测试)
     */
    @PostMapping("/queryAllPatient")
    @ApiOperation(value = "患者列表", notes = "患者列表", httpMethod = "POST")
    @ResponseBody
    public PageInfo queryAllPatient(@RequestBody PatientDto patientDto) {
        PageHelper.startPage(1,3);
        List<PatientRegisterDomain> list = patientRegisterImpl.queryAllPatient(patientDto);
        PageInfo pageInfo = new PageInfo(list);
        return  pageInfo;
    }

service

 //张子辉  患者列表  (重做最新)
    List<PatientRegisterDomain> queryAllPatient(PatientDto patientDto);

serviceImpl

 /**
     * 张子辉  患者列表(重做最新)
     */
    @Override
    public List<PatientRegisterDomain> queryAllPatient(PatientDto patientDto) {
        return patientRegisterDao.queryAllPatient(patientDto);
    }

dao

/**
     * 张子辉   患者列表(重做最新)
     */
    List<PatientRegisterDomain> queryAllPatient(PatientDto patientDto);

mapper

  <resultMap id="BaseResultMap" type="com.xyhsoft.ygt.yqjj.api.patient.domain.PatientRegisterDomain" >
    <!-- 通用查询映射结果 -->
    <id column="ID" property="id" jdbcType="INTEGER" />
    <result column="RECORD_NUM" property="recordNum" jdbcType="VARCHAR" />
    <result column="NAME" property="name" jdbcType="VARCHAR" />
    <result column="ID_CARD" property="idCard" jdbcType="VARCHAR" />
    <result column="GENDER" property="gender" jdbcType="VARCHAR" />
    <result column="AGE" property="age" jdbcType="TINYINT" />
    <result column="PHONE" property="phone" jdbcType="VARCHAR" />
    <result column="NATIONALITY" property="nationality" jdbcType="VARCHAR" />
    <result column="NATION" property="nation" jdbcType="VARCHAR" />
    <result column="PROFESSION" property="profession" jdbcType="VARCHAR" />
    <result column="SITE_LOCATION" property="siteLocation" jdbcType="VARCHAR" />
    <result column="HOME_ADDRESS" property="homeAddress" jdbcType="VARCHAR" />
    <result column="CALL_TIME" property="callTime" jdbcType="TIMESTAMP" />
        <!--<result column="create_time" property="createTime" jdbcType="TIMESTAMP" />-->
    <result column="VISIT_TIME" property="visitTime" jdbcType="TIMESTAMP" />
    <result column="ARRIVAL_TIME" property="arrivalTime" jdbcType="TIMESTAMP" />
    <result column="DEPARTURE_TIME" property="departureTime" jdbcType="TIMESTAMP" />
    <result column="CHIEF_COMPLAINT" property="chiefComplaint" jdbcType="VARCHAR" />
    <result column="HPI" property="hpi" jdbcType="VARCHAR" />
    <result column="PAST_HISTORY" property="pastHistory" jdbcType="VARCHAR" />
    <result column="ALLERGIC_HISTORY" property="allergicHistory" jdbcType="VARCHAR" />
    <result column="POSITIVE_SIGN" property="positiveSign" jdbcType="VARCHAR" />
    <result column="NEGATIVE_SYMPTOMS" property="negativeSymptoms" jdbcType="VARCHAR" />
    <result column="MEDICALHISTORY_PROVIDER" property="medicalhistoryProvider" jdbcType="VARCHAR" />
    <result column="PATIENT_RELATION" property="patientRelation" jdbcType="VARCHAR" />
    <result column="CHECK_T" property="checkT" jdbcType="VARCHAR" />
    <result column="CHECK_P" property="checkP" jdbcType="VARCHAR" />
    <result column="CHECK_R" property="checkR" jdbcType="VARCHAR" />
    <result column="CHECK_SYS" property="checkSys" jdbcType="VARCHAR" />
    <result column="CHECK_DIA" property="checkDia" jdbcType="VARCHAR" />
    <result column="CONSCIOUSNESS" property="consciousness" jdbcType="VARCHAR" />
    <result column="PUPIL" property="pupil" jdbcType="VARCHAR" />
    <result column="LIGHT_REFLEX" property="lightReflex" jdbcType="VARCHAR" />
    <result column="HEAD_NECK" property="headNeck" jdbcType="VARCHAR" />
    <result column="THORACIC_DORSAL" property="thoracicDorsal" jdbcType="VARCHAR" />
    <result column="HEART_LUNG" property="heartLung" jdbcType="VARCHAR" />
    <result column="ABDOMEN" property="abdomen" jdbcType="VARCHAR" />
    <result column="SPINE_LIMBS" property="spineLimbs" jdbcType="VARCHAR" />
    <result column="NERVOUS_SYSTEM" property="nervousSystem" jdbcType="VARCHAR" />
    <result column="RECORD_OTHER" property="recordOther" jdbcType="VARCHAR" />
    <result column="REFLEX_SKIN" property="reflexSkin" jdbcType="VARCHAR" />
    <result column="HOSPITAL_DIAGNOSIS" property="hospitalDiagnosis" jdbcType="VARCHAR" />
    <result column="THERAPEUTIC_MEASURES" property="therapeuticMeasures" jdbcType="VARCHAR" />
    <result column="AUXILIARY_EXAMINATION" property="auxiliaryExamination" jdbcType="VARCHAR" />
    <result column="MEASURES_OTHER" property="measuresOther" jdbcType="VARCHAR" />
    <result column="MEASURES_SPO2H" property="measuresSpo2h" jdbcType="VARCHAR" />
    <result column="MEASURES_GLU" property="measuresGlu" jdbcType="VARCHAR" />
    <result column="MEASURES_THERAPY" property="measuresTherapy" jdbcType="VARCHAR" />
    <result column="DOCTOR_NAME" property="doctorName" jdbcType="VARCHAR" />
    <result column="VISIT_RESULT" property="visitResult" jdbcType="VARCHAR" />
    <result column="VISIT_DOCTOR" property="visitDoctor" jdbcType="VARCHAR" />
    <result column="VISIT_NURSE" property="visitNurse" jdbcType="VARCHAR" />
    <result column="VISIT_DRIVER" property="visitDriver" jdbcType="VARCHAR" />
    <result column="PATIENT_TO" property="patientTo" jdbcType="VARCHAR" />
    <result column="PATIENT_OTHER" property="patientOther" jdbcType="VARCHAR" />
    <result column="DELIVERY_ADDRESS" property="deliveryAddress" jdbcType="VARCHAR" />
    <result column="DELIVERY_TIME" property="deliveryTime" jdbcType="TIMESTAMP" />
    <result column="ILLNESS_P" property="illnessP" jdbcType="VARCHAR" />
    <result column="ILLNESS_T" property="illnessT" jdbcType="VARCHAR" />
    <result column="ILLNESS_SYS" property="illnessSys" jdbcType="VARCHAR" />
    <result column="ILLNESS_DIA" property="illnessDia" jdbcType="VARCHAR" />
    <result column="DELIVERY_CONSCIOUSNESS" property="deliveryConsciousness" jdbcType="VARCHAR" />
    <result column="DISEASE_CLASSIFY" property="diseaseClassify" jdbcType="VARCHAR" />
    <result column="REMEDY_RESULT" property="remedyResult" jdbcType="VARCHAR" />
    <result column="PATIENT_COOPERATION" property="patientCooperation" jdbcType="VARCHAR" />
    <result column="MEDICAL_STAFF" property="medicalStaff" jdbcType="VARCHAR" />
    <result column="HOSPITAL_OUTCOME" property="hospitalOutcome" jdbcType="VARCHAR" />
    <result column="DEATH_CERTIFICATE" property="deathCertificate" jdbcType="VARCHAR" />
    <result column="FIRSTAID_STATUS" property="firstaidStatus" jdbcType="VARCHAR" />
    <result column="HOSP_NAME" property="hospName" jdbcType="VARCHAR" />
    <result column="NOTIFICATION_OTHER" property="notificationOther" jdbcType="VARCHAR" />
    <result column="PATIENT_RELATION2" property="patientRelation2" jdbcType="VARCHAR" />
    <result column="DUTY_SIGNATURE" property="dutySignature" jdbcType="VARCHAR" />
    <result column="NUNCIATOR_SIGNATURE" property="nunciatorSignature" jdbcType="VARCHAR" />
    <result column="NUNCIATOR_TIME" property="nunciatorTime" jdbcType="TIMESTAMP" />
    <result column="CREATE_BY" property="createBy" jdbcType="VARCHAR" />
    <result column="UPDATE_BY" property="updateBy" jdbcType="VARCHAR" />
    <result column="CREATE_TIME" property="createTime" jdbcType="TIMESTAMP" />
    <result column="UPDATE_TIME" property="updateTime" jdbcType="TIMESTAMP" />
    <result column="ORG_CODE" property="orgCode" jdbcType="VARCHAR" />
    <result column="FIRSTAID_ID" property="firstaidId" jdbcType="INTEGER" />
</resultMap>
 <!-- 通用查询结果列 -->
    <sql id="Base_Column_List" >
    ID, RECORD_NUM, NAME, ID_CARD, GENDER, AGE, PHONE, NATIONALITY, NATION, PROFESSION,
    SITE_LOCATION, HOME_ADDRESS, CALL_TIME, VISIT_TIME, ARRIVAL_TIME, DEPARTURE_TIME,
    CHIEF_COMPLAINT, HPI, PAST_HISTORY, ALLERGIC_HISTORY, POSITIVE_SIGN, NEGATIVE_SYMPTOMS,
    MEDICALHISTORY_PROVIDER, PATIENT_RELATION, CHECK_T, CHECK_P, CHECK_R, CHECK_SYS,
    CHECK_DIA, CONSCIOUSNESS, PUPIL, LIGHT_REFLEX, HEAD_NECK, THORACIC_DORSAL, HEART_LUNG,
    ABDOMEN, SPINE_LIMBS, NERVOUS_SYSTEM, RECORD_OTHER, REFLEX_SKIN, HOSPITAL_DIAGNOSIS,
    THERAPEUTIC_MEASURES, AUXILIARY_EXAMINATION, MEASURES_OTHER, MEASURES_SPO2H, MEASURES_GLU,
    MEASURES_THERAPY, DOCTOR_NAME, VISIT_RESULT, VISIT_DOCTOR, VISIT_NURSE, VISIT_DRIVER,
    PATIENT_TO, PATIENT_OTHER, DELIVERY_ADDRESS, DELIVERY_TIME, ILLNESS_P, ILLNESS_T,
    ILLNESS_SYS, ILLNESS_DIA, DELIVERY_CONSCIOUSNESS, DISEASE_CLASSIFY, REMEDY_RESULT,
    PATIENT_COOPERATION, MEDICAL_STAFF, HOSPITAL_OUTCOME, DEATH_CERTIFICATE, FIRSTAID_STATUS,
    HOSP_NAME, NOTIFICATION_OTHER, PATIENT_RELATION2, DUTY_SIGNATURE, NUNCIATOR_SIGNATURE,
    NUNCIATOR_TIME, CREATE_BY, UPDATE_BY, CREATE_TIME, UPDATE_TIME, ORG_CODE, FIRSTAID_ID
  </sql>
 <!--张子辉 查询患者列表 重做最新-->
    <select id="queryAllPatient" parameterType="com.xyhsoft.ygt.yqjj.api.patient.domain.PatientRegisterDomain" resultMap="BaseResultMap">
        select
        <include refid="Base_Column_List"/>
        from yqjj_patient
        <where>
            <if test="name != null and name != ''">
                NAME = #{name}

            </if>

            <if test="idCard != null and idCard != ''">
                ID_CARD = #{idCard}
            </if>

            <!--<if test="callTime != null and callTime != ''">-->
                <!--CALL_TIME = #{callTime}-->
            <!--</if>-->

            <!--时间日期转换异常-->

            <if test="callTime != null">
                date(CALL_TIME) = date(#{callTime,jdbcType=TIMESTAMP})
            </if>


            <if test="firstaidStatus != null and firstaidStatus != ''">
                FIRSTAID_STATUS = #{firstaidStatus}
            </if>
        </where>

    </select>

结果展示
在这里插入图片描述

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值