fix: 就医记录费用明细,功能提交。

This commit is contained in:
tianyongbao
2024-11-01 13:24:35 +08:00
parent 20ef1faaff
commit 3f3742a3ee
13 changed files with 691 additions and 2 deletions

View File

@@ -0,0 +1,143 @@
<?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.health.mapper.HealthDoctorRecordCostMapper">
<resultMap type="HealthDoctorRecordCostVo" id="HealthDoctorRecordCostResult">
<result property="id" column="id" />
<result property="doctorRecordId" column="doctor_record_id" />
<result property="type" column="type" />
<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="delFlag" column="del_flag" />
<result property="remark" column="remark" />
<result property="healthRecordId" column="health_record_id" />
<result property="costTime" column="cost_time" />
<result property="costName" column="cost_name" />
<result property="personId" column="person_id" />
<result property="totalCost" column="total_cost" />
<result property="price" column="price" />
<result property="count" column="count" />
<result property="unit" column="unit" />
<result property="medicineId" column="medicine_id" />
<result property="checkType" column="check_type" />
</resultMap>
<sql id="selectHealthDoctorRecordCostVo">
select a.id, a.doctor_record_id, a.type, a.create_by, a.create_time, a.update_by, a.update_time, a.del_flag, a.remark, a.health_record_id, a.cost_time, a.cost_name, a.person_id, a.total_cost, a.price, a.count, a.unit, a.medicine_id, a.check_type from health_doctor_record_cost a
</sql>
<select id="selectHealthDoctorRecordCostList" parameterType="HealthDoctorRecordCostDto" resultMap="HealthDoctorRecordCostResult">
<include refid="selectHealthDoctorRecordCostVo"/>
<where>
a.del_flag='0'
<if test="doctorRecordId != null "> and a.doctor_record_id = #{doctorRecordId}</if>
<if test="type != null and type != ''"> and a.type = #{type}</if>
<if test="healthRecordId != null "> and a.health_record_id = #{healthRecordId}</if>
<if test="costName != null and costName != ''"> and a.cost_name like '%'|| #{costName}||'%'</if>
<if test="personId != null "> and a.person_id = #{personId}</if>
<if test="checkType != null and checkType != ''"> and a.check_type = #{checkType}</if>
</where>
order by a.cost_time desc
</select>
<select id="selectHealthDoctorRecordCostById" parameterType="Long" resultMap="HealthDoctorRecordCostResult">
<include refid="selectHealthDoctorRecordCostVo"/>
where a.id = #{id}
</select>
<insert id="insertHealthDoctorRecordCost" parameterType="HealthDoctorRecordCost">
insert into health_doctor_record_cost
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">id,</if>
<if test="doctorRecordId != null">doctor_record_id,</if>
<if test="type != null">type,</if>
<if test="createBy != null">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="delFlag != null">del_flag,</if>
<if test="remark != null">remark,</if>
<if test="healthRecordId != null">health_record_id,</if>
<if test="costTime != null">cost_time,</if>
<if test="costName != null">cost_name,</if>
<if test="personId != null">person_id,</if>
<if test="totalCost != null">total_cost,</if>
<if test="price != null">price,</if>
<if test="count != null">count,</if>
<if test="unit != null">unit,</if>
<if test="medicineId != null">medicine_id,</if>
<if test="checkType != null">check_type,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">#{id},</if>
<if test="doctorRecordId != null">#{doctorRecordId},</if>
<if test="type != null">#{type},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="delFlag != null">#{delFlag},</if>
<if test="remark != null">#{remark},</if>
<if test="healthRecordId != null">#{healthRecordId},</if>
<if test="costTime != null">#{costTime},</if>
<if test="costName != null">#{costName},</if>
<if test="personId != null">#{personId},</if>
<if test="totalCost != null">#{totalCost},</if>
<if test="price != null">#{price},</if>
<if test="count != null">#{count},</if>
<if test="unit != null">#{unit},</if>
<if test="medicineId != null">#{medicineId},</if>
<if test="checkType != null">#{checkType},</if>
</trim>
</insert>
<update id="updateHealthDoctorRecordCost" parameterType="HealthDoctorRecordCost">
update health_doctor_record_cost
<trim prefix="SET" suffixOverrides=",">
<if test="doctorRecordId != null">doctor_record_id = #{doctorRecordId},</if>
<if test="type != null">type = #{type},</if>
<if test="createBy != null">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="delFlag != null">del_flag = #{delFlag},</if>
<if test="remark != null">remark = #{remark},</if>
<if test="healthRecordId != null">health_record_id = #{healthRecordId},</if>
<if test="costTime != null">cost_time = #{costTime},</if>
<if test="costName != null">cost_name = #{costName},</if>
<if test="personId != null">person_id = #{personId},</if>
<if test="totalCost != null">total_cost = #{totalCost},</if>
<if test="price != null">price = #{price},</if>
<if test="count != null">count = #{count},</if>
<if test="unit != null">unit = #{unit},</if>
<if test="medicineId != null">medicine_id = #{medicineId},</if>
<if test="checkType != null">check_type = #{checkType},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteHealthDoctorRecordCostById" parameterType="Long">
delete from health_doctor_record_cost where id = #{id}
</delete>
<delete id="deleteHealthDoctorRecordCostByIds" parameterType="String">
delete from health_doctor_record_cost where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
<update id="removeHealthDoctorRecordCostById" parameterType="Long">
update health_doctor_record_cost set del_flag='1' where id = #{id}
</update>
<update id="removeHealthDoctorRecordCostByIds" parameterType="String">
update health_doctor_record_cost set del_flag='1' where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</update>
</mapper>

View File

@@ -24,6 +24,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="totalCost" column="total_cost" />
<result property="partner" column="partner" />
<result property="costDetail" column="cost_detail" />
<result property="type" column="type" />
</resultMap>
<sql id="selectHealthDoctorRecordVo">
@@ -33,6 +34,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
a.departments,
a.doctor,
a.create_by,
a.type,
a.create_time,
a.update_by,
a.update_time,
@@ -65,6 +67,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="healthRecordId != null and healthRecordId != ''"> and a.health_record_id = #{healthRecordId}</if>
<if test="visitingTime != null "> and a.visiting_time = #{visitingTime}</if>
<if test="personId != null "> and a.person_id = #{personId}</if>
<if test="type != null and type != ''"> and a.type = #{type}</if>
<if test="endTime!=null and endTime !=''">
and #{endTime}>=to_char(a.visiting_time, 'yyyy-MM-dd')
</if>
@@ -102,6 +105,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="totalCost != null">total_cost,</if>
<if test="partner != null">partner,</if>
<if test="costDetail != null">cost_detail,</if>
<if test="type != null and type != ''">type,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">#{id},</if>
@@ -121,6 +125,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="totalCost != null">#{totalCost},</if>
<if test="partner != null">#{partner},</if>
<if test="costDetail != null">#{costDetail},</if>
<if test="type != null and type != ''">#{type},</if>
</trim>
</insert>
@@ -143,6 +148,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="totalCost != null">total_cost = #{totalCost},</if>
<if test="partner != null">partner = #{partner},</if>
<if test="costDetail != null">cost_detail = #{costDetail},</if>
<if test="type != null and type != ''">type = #{type},</if>
</trim>
where id = #{id}
</update>

View File

@@ -76,7 +76,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="personId != null "> and a.person_id = #{personId}</if>
<if test="resource != null and resource != ''"> and a.resource = #{resource}</if>
<if test="place != null and place != ''"> and a.place = #{place}</if>
<if test="medicineId != null">a.medicine_id = #{medicineId},</if>
<if test="medicineId != null">and a.medicine_id = #{medicineId}</if>
<if test="endTime!=null and endTime !=''">
and #{endTime}>=to_char(a.dosing_time, 'yyyy-MM-dd')
</if>