Files
pasd_java/pasd-healthcare/target/classes/com/ruoyi/os/mapper/HealthcareOsPatientInfoMapper.xml

129 lines
6.7 KiB
XML
Raw Normal View History

2025-07-28 14:58:32 +08:00
<?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.HealthcareOsPatientInfoMapper">
<resultMap type="HealthcareOsPatientInfo" id="OsPatientInfoResult">
<result property="id" column="id" />
<result property="patientType" column="patient_type" />
<result property="studentId" column="student_id" />
<result property="name" column="name" />
<result property="gender" column="gender" />
<result property="age" column="age" />
<result property="major" column="major" />
<result property="classInfo" column="class_info" />
<result property="phone" column="phone" />
<result property="counselor" column="counselor" />
<result property="department" column="department" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
<result property="idCard" column="id_card" />
</resultMap>
<sql id="selectOsPatientInfoVo">
select id, patient_type, student_id,AES_DECRYPT(UNHEX(id_card),'zhxg') as id_card , name, gender, age, major, class_info, phone, counselor, department, create_by, create_time, update_by, update_time from healthcare_os_patient_info
</sql>
<select id="selectOsPatientInfoList" parameterType="HealthcareOsPatientInfo" resultMap="OsPatientInfoResult">
<include refid="selectOsPatientInfoVo"/>
<where>
<if test="patientType != null "> and patient_type = #{patientType}</if>
<if test="studentId != null and studentId != ''"> and student_id = #{studentId}</if>
<if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
<if test="gender != null and gender != ''"> and gender = #{gender}</if>
<if test="age != null "> and age = #{age}</if>
<if test="major != null and major != ''"> and major = #{major}</if>
<if test="classInfo != null and classInfo != ''"> and class_info = #{classInfo}</if>
<if test="phone != null and phone != ''"> and phone = #{phone}</if>
<if test="counselor != null and counselor != ''"> and counselor = #{counselor}</if>
<if test="department != null and department != ''"> and department = #{department}</if>
</where>
</select>
<select id="selectOsPatientInfoById" parameterType="Long" resultMap="OsPatientInfoResult">
<include refid="selectOsPatientInfoVo"/>
where id = #{id}
</select>
<select id="selectOsPatientInfoByStudentId" parameterType="String" resultMap="OsPatientInfoResult">
<include refid="selectOsPatientInfoVo"/>
where student_id = #{studentId}
</select>
<insert id="insertOsPatientInfo" parameterType="HealthcareOsPatientInfo" useGeneratedKeys="true" keyProperty="id">
insert into healthcare_os_patient_info
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="patientType != null">patient_type,</if>
<if test="studentId != null">student_id,</if>
<if test="name != null and name != ''">name,</if>
<if test="gender != null and gender != ''">gender,</if>
<if test="age != null">age,</if>
<if test="major != null">major,</if>
<if test="classInfo != null">class_info,</if>
<if test="phone != null">phone,</if>
<if test="counselor != null">counselor,</if>
<if test="department != null">department,</if>
<if test="createBy != null and createBy != ''">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
<if test="idCard != null">id_card,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="patientType != null">#{patientType},</if>
<if test="studentId != null">#{studentId},</if>
<if test="name != null and name != ''">#{name},</if>
<if test="gender != null and gender != ''">#{gender},</if>
<if test="age != null">#{age},</if>
<if test="major != null">#{major},</if>
<if test="classInfo != null">#{classInfo},</if>
<if test="phone != null">#{phone},</if>
<if test="counselor != null">#{counselor},</if>
<if test="department != null">#{department},</if>
<if test="createBy != null and createBy != ''">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="idCard != null">#{idCard},</if>
</trim>
</insert>
<update id="updateOsPatientInfo" parameterType="HealthcareOsPatientInfo">
update healthcare_os_patient_info
<trim prefix="SET" suffixOverrides=",">
<if test="patientType != null">patient_type = #{patientType},</if>
<if test="studentId != null">student_id = #{studentId},</if>
<if test="name != null and name != ''">name = #{name},</if>
<if test="gender != null and gender != ''">gender = #{gender},</if>
<if test="age != null">age = #{age},</if>
<if test="major != null">major = #{major},</if>
<if test="classInfo != null">class_info = #{classInfo},</if>
<if test="phone != null">phone = #{phone},</if>
<if test="counselor != null">counselor = #{counselor},</if>
<if test="department != null">department = #{department},</if>
<if test="createBy != null and createBy != ''">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="idCard != null">id_card = #{idCard},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteOsPatientInfoById" parameterType="Long">
delete from healthcare_os_patient_info where id = #{id}
</delete>
<delete id="deleteOsPatientInfoByIds" parameterType="String">
delete from healthcare_os_patient_info where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>