<?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.system.mapper.TbOrdersMapper">
|
|
<resultMap type="TbOrders" id="TbOrdersResult">
|
<result property="OrderID" column="OrderID" />
|
<result property="LinkPerson" column="LinkPerson" />
|
<result property="LinkTel" column="LinkTel" />
|
<result property="AlarmTel" column="AlarmTel" />
|
<result property="PatientName" column="PatientName" />
|
<result property="Sex" column="Sex" />
|
<result property="Age" column="Age" />
|
<result property="Kg" column="Kg" />
|
<result property="Sense" column="Sense" />
|
<result property="LocalAddress" column="LocalAddress" />
|
<result property="LocalLongitude" column="LocalLongitude" />
|
<result property="LocalLatitude" column="LocalLatitude" />
|
<result property="LocalProvince" column="LocalProvince" />
|
<result property="LocalCity" column="LocalCity" />
|
<result property="LocalDistrict" column="LocalDistrict" />
|
<result property="SendAddress" column="SendAddress" />
|
<result property="SendLongitude" column="SendLongitude" />
|
<result property="SendLatitude" column="SendLatitude" />
|
<result property="SendProvince" column="SendProvince" />
|
<result property="SendCity" column="SendCity" />
|
<result property="SendDistrict" column="SendDistrict" />
|
<result property="BookingPrice" column="BookingPrice" />
|
<result property="BookingDate" column="BookingDate" />
|
<result property="Remark" column="Remark" />
|
<result property="Complaint" column="Complaint" />
|
<result property="PatientCount" column="PatientCount" />
|
<result property="BookingKM" column="BookingKM" />
|
<result property="EscortCode" column="EscortCode" />
|
<result property="LiftingCode" column="LiftingCode" />
|
<result property="LiftingFloor" column="LiftingFloor" />
|
<result property="RequirementCode" column="RequirementCode" />
|
<result property="TypeCode" column="TypeCode" />
|
<result property="ThirdPartyResult" column="ThirdPartyResult" />
|
<result property="ServiceOrdID" column="ServiceOrdID" />
|
<result property="ServiceOrdNo" column="ServiceOrdNo" />
|
<result property="CreateTime" column="CreateTime" />
|
<result property="UpdateTime" column="UpdateTime" />
|
<result property="OrderStatus" column="OrderStatus" />
|
</resultMap>
|
|
<sql id="selectTbOrdersVo">
|
select OrderID, LinkPerson, LinkTel, AlarmTel, PatientName, Sex, Age, Kg, Sense, LocalAddress, LocalLongitude, LocalLatitude, LocalProvince, LocalCity, LocalDistrict, SendAddress, SendLongitude, SendLatitude, SendProvince, SendCity, SendDistrict, BookingPrice, BookingDate, Remark, Complaint, PatientCount, BookingKM, EscortCode, LiftingCode, LiftingFloor, RequirementCode, TypeCode, ThirdPartyResult, ServiceOrdID, ServiceOrdNo, CreateTime, UpdateTime, OrderStatus from tb_orders
|
</sql>
|
|
<select id="selectTbOrdersList" parameterType="TbOrders" resultMap="TbOrdersResult">
|
<include refid="selectTbOrdersVo"/>
|
<where>
|
<if test="LinkPerson != null and LinkPerson != ''"> and LinkPerson = #{LinkPerson}</if>
|
<if test="LinkTel != null and LinkTel != ''"> and LinkTel = #{LinkTel}</if>
|
<if test="AlarmTel != null and AlarmTel != ''"> and AlarmTel = #{AlarmTel}</if>
|
<if test="PatientName != null and PatientName != ''"> and PatientName like concat('%', #{PatientName}, '%')</if>
|
<if test="Sex != null "> and Sex = #{Sex}</if>
|
<if test="Age != null and Age != ''"> and Age = #{Age}</if>
|
<if test="Kg != null and Kg != ''"> and Kg = #{Kg}</if>
|
<if test="Sense != null and Sense != ''"> and Sense = #{Sense}</if>
|
<if test="LocalAddress != null and LocalAddress != ''"> and LocalAddress = #{LocalAddress}</if>
|
<if test="LocalLongitude != null "> and LocalLongitude = #{LocalLongitude}</if>
|
<if test="LocalLatitude != null "> and LocalLatitude = #{LocalLatitude}</if>
|
<if test="LocalProvince != null and LocalProvince != ''"> and LocalProvince = #{LocalProvince}</if>
|
<if test="LocalCity != null and LocalCity != ''"> and LocalCity = #{LocalCity}</if>
|
<if test="LocalDistrict != null and LocalDistrict != ''"> and LocalDistrict = #{LocalDistrict}</if>
|
<if test="SendAddress != null and SendAddress != ''"> and SendAddress = #{SendAddress}</if>
|
<if test="SendLongitude != null "> and SendLongitude = #{SendLongitude}</if>
|
<if test="SendLatitude != null "> and SendLatitude = #{SendLatitude}</if>
|
<if test="SendProvince != null and SendProvince != ''"> and SendProvince = #{SendProvince}</if>
|
<if test="SendCity != null and SendCity != ''"> and SendCity = #{SendCity}</if>
|
<if test="SendDistrict != null and SendDistrict != ''"> and SendDistrict = #{SendDistrict}</if>
|
<if test="BookingPrice != null "> and BookingPrice = #{BookingPrice}</if>
|
<if test="BookingDate != null "> and BookingDate = #{BookingDate}</if>
|
<if test="Remark != null and Remark != ''"> and Remark = #{Remark}</if>
|
<if test="Complaint != null and Complaint != ''"> and Complaint = #{Complaint}</if>
|
<if test="PatientCount != null "> and PatientCount = #{PatientCount}</if>
|
<if test="BookingKM != null "> and BookingKM = #{BookingKM}</if>
|
<if test="EscortCode != null "> and EscortCode = #{EscortCode}</if>
|
<if test="LiftingCode != null "> and LiftingCode = #{LiftingCode}</if>
|
<if test="LiftingFloor != null "> and LiftingFloor = #{LiftingFloor}</if>
|
<if test="RequirementCode != null "> and RequirementCode = #{RequirementCode}</if>
|
<if test="TypeCode != null "> and TypeCode = #{TypeCode}</if>
|
<if test="ThirdPartyResult != null "> and ThirdPartyResult = #{ThirdPartyResult}</if>
|
<if test="ServiceOrdID != null and ServiceOrdID != ''"> and ServiceOrdID = #{ServiceOrdID}</if>
|
<if test="ServiceOrdNo != null and ServiceOrdNo != ''"> and ServiceOrdNo = #{ServiceOrdNo}</if>
|
<if test="CreateTime != null "> and CreateTime = #{CreateTime}</if>
|
<if test="UpdateTime != null "> and UpdateTime = #{UpdateTime}</if>
|
<if test="OrderStatus != null "> and OrderStatus = #{OrderStatus}</if>
|
</where>
|
ORDER BY CreateTime DESC
|
</select>
|
|
<select id="selectTbOrdersByOrderID" parameterType="Long" resultMap="TbOrdersResult">
|
<include refid="selectTbOrdersVo"/>
|
where OrderID = #{OrderID}
|
ORDER BY CreateTime DESC
|
</select>
|
|
<insert id="insertTbOrders" parameterType="TbOrders">
|
insert into tb_orders
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
<if test="OrderID != null">OrderID,</if>
|
<if test="LinkPerson != null">LinkPerson,</if>
|
<if test="LinkTel != null">LinkTel,</if>
|
<if test="AlarmTel != null">AlarmTel,</if>
|
<if test="PatientName != null">PatientName,</if>
|
<if test="Sex != null">Sex,</if>
|
<if test="Age != null">Age,</if>
|
<if test="Kg != null">Kg,</if>
|
<if test="Sense != null">Sense,</if>
|
<if test="LocalAddress != null">LocalAddress,</if>
|
<if test="LocalLongitude != null">LocalLongitude,</if>
|
<if test="LocalLatitude != null">LocalLatitude,</if>
|
<if test="LocalProvince != null">LocalProvince,</if>
|
<if test="LocalCity != null">LocalCity,</if>
|
<if test="LocalDistrict != null">LocalDistrict,</if>
|
<if test="SendAddress != null">SendAddress,</if>
|
<if test="SendLongitude != null">SendLongitude,</if>
|
<if test="SendLatitude != null">SendLatitude,</if>
|
<if test="SendProvince != null">SendProvince,</if>
|
<if test="SendCity != null">SendCity,</if>
|
<if test="SendDistrict != null">SendDistrict,</if>
|
<if test="BookingPrice != null">BookingPrice,</if>
|
<if test="BookingDate != null">BookingDate,</if>
|
<if test="Remark != null">Remark,</if>
|
<if test="Complaint != null">Complaint,</if>
|
<if test="PatientCount != null">PatientCount,</if>
|
<if test="BookingKM != null">BookingKM,</if>
|
<if test="EscortCode != null">EscortCode,</if>
|
<if test="LiftingCode != null">LiftingCode,</if>
|
<if test="LiftingFloor != null">LiftingFloor,</if>
|
<if test="RequirementCode != null">RequirementCode,</if>
|
<if test="TypeCode != null">TypeCode,</if>
|
<if test="ThirdPartyResult != null">ThirdPartyResult,</if>
|
<if test="ServiceOrdID != null">ServiceOrdID,</if>
|
<if test="ServiceOrdNo != null">ServiceOrdNo,</if>
|
<if test="CreateTime != null">CreateTime,</if>
|
<if test="UpdateTime != null">UpdateTime,</if>
|
<if test="OrderStatus != null">OrderStatus,</if>
|
</trim>
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
<if test="OrderID != null">#{OrderID},</if>
|
<if test="LinkPerson != null">#{LinkPerson},</if>
|
<if test="LinkTel != null">#{LinkTel},</if>
|
<if test="AlarmTel != null">#{AlarmTel},</if>
|
<if test="PatientName != null">#{PatientName},</if>
|
<if test="Sex != null">#{Sex},</if>
|
<if test="Age != null">#{Age},</if>
|
<if test="Kg != null">#{Kg},</if>
|
<if test="Sense != null">#{Sense},</if>
|
<if test="LocalAddress != null">#{LocalAddress},</if>
|
<if test="LocalLongitude != null">#{LocalLongitude},</if>
|
<if test="LocalLatitude != null">#{LocalLatitude},</if>
|
<if test="LocalProvince != null">#{LocalProvince},</if>
|
<if test="LocalCity != null">#{LocalCity},</if>
|
<if test="LocalDistrict != null">#{LocalDistrict},</if>
|
<if test="SendAddress != null">#{SendAddress},</if>
|
<if test="SendLongitude != null">#{SendLongitude},</if>
|
<if test="SendLatitude != null">#{SendLatitude},</if>
|
<if test="SendProvince != null">#{SendProvince},</if>
|
<if test="SendCity != null">#{SendCity},</if>
|
<if test="SendDistrict != null">#{SendDistrict},</if>
|
<if test="BookingPrice != null">#{BookingPrice},</if>
|
<if test="BookingDate != null">#{BookingDate},</if>
|
<if test="Remark != null">#{Remark},</if>
|
<if test="Complaint != null">#{Complaint},</if>
|
<if test="PatientCount != null">#{PatientCount},</if>
|
<if test="BookingKM != null">#{BookingKM},</if>
|
<if test="EscortCode != null">#{EscortCode},</if>
|
<if test="LiftingCode != null">#{LiftingCode},</if>
|
<if test="LiftingFloor != null">#{LiftingFloor},</if>
|
<if test="RequirementCode != null">#{RequirementCode},</if>
|
<if test="TypeCode != null">#{TypeCode},</if>
|
<if test="ThirdPartyResult != null">#{ThirdPartyResult},</if>
|
<if test="ServiceOrdID != null">#{ServiceOrdID},</if>
|
<if test="ServiceOrdNo != null">#{ServiceOrdNo},</if>
|
<if test="CreateTime != null">#{CreateTime},</if>
|
<if test="UpdateTime != null">#{UpdateTime},</if>
|
<if test="OrderStatus != null">#{OrderStatus},</if>
|
</trim>
|
</insert>
|
|
<update id="updateTbOrders" parameterType="TbOrders">
|
update tb_orders
|
<trim prefix="SET" suffixOverrides=",">
|
<if test="LinkPerson != null">LinkPerson = #{LinkPerson},</if>
|
<if test="LinkTel != null">LinkTel = #{LinkTel},</if>
|
<if test="AlarmTel != null">AlarmTel = #{AlarmTel},</if>
|
<if test="PatientName != null">PatientName = #{PatientName},</if>
|
<if test="Sex != null">Sex = #{Sex},</if>
|
<if test="Age != null">Age = #{Age},</if>
|
<if test="Kg != null">Kg = #{Kg},</if>
|
<if test="Sense != null">Sense = #{Sense},</if>
|
<if test="LocalAddress != null">LocalAddress = #{LocalAddress},</if>
|
<if test="LocalLongitude != null">LocalLongitude = #{LocalLongitude},</if>
|
<if test="LocalLatitude != null">LocalLatitude = #{LocalLatitude},</if>
|
<if test="LocalProvince != null">LocalProvince = #{LocalProvince},</if>
|
<if test="LocalCity != null">LocalCity = #{LocalCity},</if>
|
<if test="LocalDistrict != null">LocalDistrict = #{LocalDistrict},</if>
|
<if test="SendAddress != null">SendAddress = #{SendAddress},</if>
|
<if test="SendLongitude != null">SendLongitude = #{SendLongitude},</if>
|
<if test="SendLatitude != null">SendLatitude = #{SendLatitude},</if>
|
<if test="SendProvince != null">SendProvince = #{SendProvince},</if>
|
<if test="SendCity != null">SendCity = #{SendCity},</if>
|
<if test="SendDistrict != null">SendDistrict = #{SendDistrict},</if>
|
<if test="BookingPrice != null">BookingPrice = #{BookingPrice},</if>
|
<if test="BookingDate != null">BookingDate = #{BookingDate},</if>
|
<if test="Remark != null">Remark = #{Remark},</if>
|
<if test="Complaint != null">Complaint = #{Complaint},</if>
|
<if test="PatientCount != null">PatientCount = #{PatientCount},</if>
|
<if test="BookingKM != null">BookingKM = #{BookingKM},</if>
|
<if test="EscortCode != null">EscortCode = #{EscortCode},</if>
|
<if test="LiftingCode != null">LiftingCode = #{LiftingCode},</if>
|
<if test="LiftingFloor != null">LiftingFloor = #{LiftingFloor},</if>
|
<if test="RequirementCode != null">RequirementCode = #{RequirementCode},</if>
|
<if test="TypeCode != null">TypeCode = #{TypeCode},</if>
|
<if test="ThirdPartyResult != null">ThirdPartyResult = #{ThirdPartyResult},</if>
|
<if test="ServiceOrdID != null">ServiceOrdID = #{ServiceOrdID},</if>
|
<if test="ServiceOrdNo != null">ServiceOrdNo = #{ServiceOrdNo},</if>
|
<if test="CreateTime != null">CreateTime = #{CreateTime},</if>
|
<if test="UpdateTime != null">UpdateTime = #{UpdateTime},</if>
|
<if test="OrderStatus != null">OrderStatus = #{OrderStatus},</if>
|
</trim>
|
where OrderID = #{OrderID}
|
</update>
|
|
<delete id="deleteTbOrdersByOrderID" parameterType="Long">
|
delete from tb_orders where OrderID = #{OrderID}
|
</delete>
|
|
<delete id="deleteTbOrdersByOrderIDs" parameterType="String">
|
delete from tb_orders where OrderID in
|
<foreach item="OrderID" collection="array" open="(" separator="," close=")">
|
#{OrderID}
|
</foreach>
|
</delete>
|
|
<select id="checkServiceOrdIDExists" parameterType="String" resultType="Integer">
|
select count(1) from tb_orders where ServiceOrdID = #{ServiceOrdID}
|
</select>
|
|
<select id="selectTbOrdersByServiceOrdID" parameterType="String" resultMap="TbOrdersResult">
|
<include refid="selectTbOrdersVo"/>
|
where ServiceOrdID = #{ServiceOrdID}
|
</select>
|
|
</mapper>
|