car_server/boot-valuation/boot-valuation-server/target/classes/mapper/ValuationMapper.xml

54 lines
2.6 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.boot.valuation.mapper.ValuationMapper">
<resultMap id="estimated" type="com.boot.valuation.common.domain.Estimated">
<id column="id" property="id"></id>
<result column="kilometres" property="kilometres"></result>
<result column="server_time" property="serverTime"></result>
<result column="meal_price" property="mealPrice"></result>
<result column="basics_price" property="basicsPrice"></result>
<result column="section_id" property="sectionId"></result>
<result column="night_server_mileage_price" property="nightServerMileagePrice"></result>
<result column="night_server_time_price" property="nightServerTimePrice"></result>
<result column="mileage_price" property="mileagePrice"></result>
<result column="time_price" property="timePrice"></result>
<result column="long_way_mileage" property="longWayMileage"></result>
<result column="long_way_price" property="longWayPrice"></result>
</resultMap>
<select id="getEstimatedId" resultMap="estimated">
SELECT
e.id,e.kilometres,e.server_time,e.meal_price,e.basics_price,e.section_id,n.night_server_mileage_price,n.night_server_time_price,n.mileage_price,n.time_price,n.long_way_mileage,n.long_way_price
FROM estimated_order e LEFT JOIN night_server n ON e.night_id = n.id
<where>
<if test="null != cityId">
and e.city_id = #{cityId}
</if>
<if test="null != serverTypeId">
and e.server_type_id = #{serverTypeId}
</if>
<if test="null != channelId">
and e.channel_id = #{channelId}
</if>
<if test="null != rankId">
and e.rank_id = #{rankId}
</if>
</where>
</select>
<resultMap id="section" type="com.boot.valuation.common.domain.Section">
<id column="id" property="id"></id>
<result column="start_time" property="startTime"></result>
<result column="end_time" property="endTime"></result>
<result column="kilometre_price" property="kilometrePrice"></result>
<result column="time_price" property="timePrice"></result>
</resultMap>
<select id="computeSectionMoney" resultMap="section">
SELECT
id,start_time,end_time,kilometre_price,time_price
from tb_section
where id = #{sss}
</select>
</mapper>