Files
gzh-server/src/main/resources/mybatis/mapper/reserve/BinganMapper.xml
2026-01-22 10:41:24 +08:00

76 lines
2.9 KiB
XML

<?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.guahao.h5.reserve.mapper.BinganMapper">
<insert id="insertInfo">
insert into express
(user_id,patient_name,id_number,phone,hos_number,patient_id,
inhos_date,outhos_date,handle_type,delivery_type,
re_name,re_id,re_phone,card_fronturl,card_backurl,record_fronturl,record_backurl,attorney_url,create_time)
values
(#{userId}, #{patientName}, #{idNumber}, #{phone}, #{hosNumber},#{patientId},
#{inhosDate}, #{outhosDate}, #{handleType}, #{deliveryType},
#{reName}, #{reId}, #{rePhone}, #{cardFronturl}, #{cardBackurl},
#{recordFronturl}, #{recordBackurl}, #{powerOfAttorneyUrl}, #{createTime})
</insert>
<update id="deleteApplication">
update express
set
deleted = 1
where
id = #{id}
</update>
<update id="updateReptnoByOrderNo">
update express
set
reptno = #{rcptNo},
status = 2,
code = #{code}
where
orderno = #{outTradeNo}
</update>
<update id="updateByOrderNo">
UPDATE express
SET orderno = NULL
WHERE orderno = #{orderno}
</update>
<update id="updateById">
update express
set orderno = #{payOrderNo}
WHERE id = #{id}
</update>
<update id="updateByOrderNoAndStatus">
UPDATE express
SET status = 0
WHERE orderno = #{orderno}
</update>
<update id="updateByCopies">
UPDATE express
SET copies = #{copies},
amount = #{amount}
WHERE id = #{id}
</update>
<select id="checkSameNameRecordToday" resultType="java.lang.Boolean">
SELECT COUNT(*) > 0
FROM express
WHERE patient_name = #{patientName}
AND DATE(create_time) = DATE(#{dateOnly})
AND deleted = 0;
</select>
<select id="selectListByUserId" resultType="com.guahao.h5.reserve.vo.BingAnVO">
SELECT * FROM express WHERE user_id = #{userId} and deleted = 0;
</select>
<select id="selectByOrderNo" resultType="com.guahao.h5.reserve.vo.BingAnVO">
SELECT * FROM express WHERE orderno = #{outTradeNo} and deleted = 0;
</select>
<select id="selectListByUserIdAndStatus" resultType="com.guahao.h5.reserve.vo.BingAnVO">
SELECT * FROM express WHERE user_id = #{userId} and status = #{status} and deleted = 0 and orderno IS NOT NULL;
</select>
<select id="selectListByPatientId" resultType="com.guahao.h5.reserve.vo.BingAnVO">
SELECT * FROM express WHERE patient_id = #{patientId} and deleted = 0;
</select>
<select id="selectListByHosNum" resultType="com.guahao.h5.reserve.vo.BingAnVO">
SELECT * FROM express WHERE hos_number = #{hosNum} and deleted = 0;
</select>
</mapper>