aircraft-server/aircraft-system/src/main/resources/mapper/order/OrderMainMapper.xml

41 lines
1.6 KiB
XML
Raw Normal View History

2025-07-11 08:56:56 +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.aircraft.modules.order.mapper.OrderMainMapper">
<!-- 通用查询结果列 -->
<sql id="BaseColumn">
id, order_no, order_type, order_initiator_id, phone, attraction_id, customer_id,
customer_name, route_ids, cargo_weight, total_amount, amount, surcharge_amount, open_id,
settlement_status, main_order_status, relevance_status, order_create_time,
order_finish_time, create_time, create_by, update_time, update_by, del_flag
</sql>
<select id="obtainOrderList" resultType="com.aircraft.modules.order.domain.OrderMain">
select
<include refid="BaseColumn"/>
from fms_od_order_main
where del_flag = 0
<if test="orderInitiatorId != null">
and id in (
select order_id from fms_od_order_operator where operator_id = #{orderInitiatorId}
)
</if>
<if test="phone != null and phone != ''">
and phone = #{phone}
</if>
<if test="customerId != null">
and customer_id = #{customerId}
</if>
<if test="attractionId != null">
and attraction_id = #{attractionId}
</if>
<if test="mainOrderStatusList != null and mainOrderStatusList.size() > 0">
and main_order_status in
<foreach item="item" collection="mainOrderStatusList" open="(" separator="," close=")">
#{item}
</foreach>
</if>
order by id desc
</select>
2025-07-11 08:56:56 +08:00
</mapper>