|
@@ -5,9 +5,9 @@
|
|
|
<!-- 新增私人订制 -->
|
|
|
<insert id="insertPrivate" parameterType="PrivateOrder">
|
|
|
insert into
|
|
|
- bus_private_ordering(code,origin,destination,start_time,end_time,people_num,jdrq,people_all,budget_min,budget_max,language,nature_type,name,email,rhythm,hotel_scale,resources_needed,flight,remarks,uuid,order_type)
|
|
|
+ bus_private_ordering(code,origin,destination,start_time,end_time,people_num,jdrq,people_all,budget_min,budget_max,language,nature_type,name,email,rhythm,hotel_scale,resources_needed,flight,remarks,uuid)
|
|
|
values
|
|
|
- (#{code},#{origin},#{destination},#{startTime},#{endTime},#{peopleNum},format(SYSDATETIME(),'yyyy-MM-dd hh:mm:ss'),#{peopleAll},#{budgetMin},#{budgetMax},#{language},#{natureType},#{name},#{email},#{rhythm},#{hotelScale},#{resourcesNeeded},#{flight},#{remarks},#{uuid},0)
|
|
|
+ (#{code},#{origin},#{destination},#{startTime},#{endTime},#{peopleNum},format(SYSDATETIME(),'yyyy-MM-dd hh:mm:ss'),#{peopleAll},#{budgetMin},#{budgetMax},#{language},#{natureType},#{name},#{email},#{rhythm},#{hotelScale},#{resourcesNeeded},#{flight},#{remarks},#{uuid})
|
|
|
</insert>
|
|
|
<!-- 查询私人订制 -->
|
|
|
<select id="getPrivate" resultType="PrivateOrder">
|
|
@@ -16,6 +16,7 @@
|
|
|
FROM
|
|
|
( SELECT *, ROW_NUMBER ( ) OVER ( ORDER BY ID ) AS RowId FROM bus_private_ordering ) AS b
|
|
|
LEFT JOIN bus_supplier_release c ON b.uuid = c.demand_uuid
|
|
|
+ RIGHT JOIN bus_private_ordering_type a on order_type = #{orderType} and b.uuid = a.demand_uuid and c.code = a.code
|
|
|
WHERE
|
|
|
RowId BETWEEN #{page} AND #{limit}
|
|
|
<if test="uuid != null and uuid != ''">
|
|
@@ -24,7 +25,6 @@
|
|
|
<if test="code != null and code != ''">
|
|
|
and b.code = #{code}
|
|
|
</if>
|
|
|
- AND b.order_type = #{orderType}
|
|
|
</select>
|
|
|
<!-- 查询私人订制 -->
|
|
|
<select id="getPrivateAll" resultType="PrivateOrder">
|
|
@@ -33,6 +33,7 @@
|
|
|
FROM
|
|
|
( SELECT *, ROW_NUMBER ( ) OVER ( ORDER BY ID ) AS RowId FROM bus_private_ordering ) AS b
|
|
|
LEFT JOIN bus_supplier_release c ON b.uuid = c.demand_uuid
|
|
|
+ RIGHT JOIN bus_private_ordering_type a on order_type = #{orderType} and b.uuid = a.demand_uuid and c.code = a.code
|
|
|
WHERE
|
|
|
RowId BETWEEN #{page} AND #{limit}
|
|
|
<if test="uuid != null and uuid != ''">
|
|
@@ -47,4 +48,25 @@
|
|
|
<insert id="addCollection" parameterType="OrderingConllection">
|
|
|
insert into bus_collection(uuid,code,jdrq,ordering_uuid) values(#{uuid},#{code},format(SYSDATETIME(),'yyyy-MM-dd hh:mm:ss'),#{orderingUuid})
|
|
|
</insert>
|
|
|
+ <!-- 新增定制单状态 -->
|
|
|
+ <insert id="addPrivateType" parameterType="PrivateOrder">
|
|
|
+ insert into bus_private_ordering_type(code,demand_uuid,order_type) values(null, #{uuid}, 0)
|
|
|
+ </insert>
|
|
|
+ <!-- 查询私人订制零 -->
|
|
|
+ <select id="getPrivateZero" resultType="PrivateOrder">
|
|
|
+ SELECT
|
|
|
+ *,0 as orderType
|
|
|
+ FROM
|
|
|
+ ( SELECT *, ROW_NUMBER ( ) OVER ( ORDER BY ID ) AS RowId FROM bus_private_ordering ) AS b
|
|
|
+ LEFT JOIN bus_supplier_release c ON b.uuid = c.demand_uuid
|
|
|
+ WHERE
|
|
|
+ RowId BETWEEN #{page} AND #{limit}
|
|
|
+ and b.uuid NOT IN ( SELECT demand_uuid FROM bus_private_ordering_type where order_type = 0)
|
|
|
+ <if test="uuid != null and uuid != ''">
|
|
|
+ and b.uuid = #{uuid}
|
|
|
+ </if>
|
|
|
+ <if test="code != null and code != ''">
|
|
|
+ and b.code = #{code}
|
|
|
+ </if>
|
|
|
+ </select>
|
|
|
</mapper>
|