|
@@ -37,10 +37,16 @@
|
|
<!-- 查询私人订制小程序 -->
|
|
<!-- 查询私人订制小程序 -->
|
|
<select id="getPrivateOrderSmall" resultType="PrivateOrder">
|
|
<select id="getPrivateOrderSmall" resultType="PrivateOrder">
|
|
SELECT
|
|
SELECT
|
|
- top ${limit} b.*,${orderType} as orderType,e.headpir,e.name as orderName
|
|
|
|
|
|
+ top ${limit} b.*,c.order_type as orderType,e.headpir,e.name as orderName
|
|
FROM
|
|
FROM
|
|
bus_private_ordering AS b
|
|
bus_private_ordering AS b
|
|
- JOIN ( SELECT code,demand_uuid FROM bus_private_ordering_type WHERE code = #{code} and order_type = #{orderType}) as c on b.uuid = c.demand_uuid
|
|
|
|
|
|
+ JOIN ( SELECT code,demand_uuid,order_type FROM bus_private_ordering_type WHERE code = #{code} and
|
|
|
|
+ <trim prefixOverrides="and | or">
|
|
|
|
+ <foreach collection="orderTypeVal.split(',')" item="item" separator="or" open="(" close=")">
|
|
|
|
+ order_type = #{item}
|
|
|
|
+ </foreach>
|
|
|
|
+ </trim>
|
|
|
|
+ ) as c on b.uuid = c.demand_uuid
|
|
LEFT JOIN sys_users as e on b.code = e.code
|
|
LEFT JOIN sys_users as e on b.code = e.code
|
|
WHERE
|
|
WHERE
|
|
uuid NOT IN (SELECT ordering_uuid FROM bus_ignore_supplier WHERE code = #{code})
|
|
uuid NOT IN (SELECT ordering_uuid FROM bus_ignore_supplier WHERE code = #{code})
|
|
@@ -53,7 +59,13 @@
|
|
and b.id not in
|
|
and b.id not in
|
|
(
|
|
(
|
|
select top ${page} b.id from bus_private_ordering as b
|
|
select top ${page} b.id from bus_private_ordering as b
|
|
- JOIN ( SELECT code,demand_uuid FROM bus_private_ordering_type WHERE code = #{code} and order_type = #{orderType}) as c on b.uuid = c.demand_uuid
|
|
|
|
|
|
+ JOIN ( SELECT code,demand_uuid FROM bus_private_ordering_type WHERE code = #{code} and
|
|
|
|
+ <trim prefixOverrides="and | or">
|
|
|
|
+ <foreach collection="orderTypeVal.split(',')" item="item" separator="or" open="(" close=")">
|
|
|
|
+ order_type = #{item}
|
|
|
|
+ </foreach>
|
|
|
|
+ </trim>
|
|
|
|
+ ) as c on b.uuid = c.demand_uuid
|
|
WHERE
|
|
WHERE
|
|
uuid NOT IN (SELECT ordering_uuid FROM bus_ignore_supplier WHERE code = #{code})
|
|
uuid NOT IN (SELECT ordering_uuid FROM bus_ignore_supplier WHERE code = #{code})
|
|
<if test="startTime != null and startTime !=''">
|
|
<if test="startTime != null and startTime !=''">
|
|
@@ -98,6 +110,37 @@
|
|
)
|
|
)
|
|
order by b.id desc
|
|
order by b.id desc
|
|
</select>
|
|
</select>
|
|
|
|
+ <select id="getPrivateOrderOne" resultType="PrivateOrder">
|
|
|
|
+ SELECT
|
|
|
|
+ top ${limit} b.*,c.order_type as orderType,e.headpir,e.name as orderName
|
|
|
|
+ FROM
|
|
|
|
+ bus_private_ordering AS b
|
|
|
|
+ JOIN ( SELECT code,demand_uuid,order_type FROM bus_private_ordering_type WHERE code = #{code} and (order_type = '1' or order_type = '7' or order_type = '6')) as c on b.uuid = c.demand_uuid
|
|
|
|
+ LEFT JOIN sys_users as e on b.code = e.code
|
|
|
|
+ WHERE
|
|
|
|
+ uuid NOT IN (SELECT ordering_uuid FROM bus_ignore_supplier WHERE code = #{code})
|
|
|
|
+ <if test="startTime != null and startTime !=''">
|
|
|
|
+ and CONVERT (datetime, start_time) <![CDATA[ >= ]]> #{startTime} and CONVERT(datetime, end_time) <![CDATA[ <= ]]> #{endTime}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="destination != null and destination !=''">
|
|
|
|
+ and destination like concat('%', #{destination}, '%')
|
|
|
|
+ </if>
|
|
|
|
+ and b.id not in
|
|
|
|
+ (
|
|
|
|
+ select top ${page} b.id from bus_private_ordering as b
|
|
|
|
+ JOIN ( SELECT code,demand_uuid FROM bus_private_ordering_type WHERE code = #{code} and (order_type = '1' or order_type = '7' or order_type = '6')) as c on b.uuid = c.demand_uuid
|
|
|
|
+ WHERE
|
|
|
|
+ uuid NOT IN (SELECT ordering_uuid FROM bus_ignore_supplier WHERE code = #{code})
|
|
|
|
+ <if test="startTime != null and startTime !=''">
|
|
|
|
+ and CONVERT (datetime, start_time) <![CDATA[ >= ]]> #{startTime} and CONVERT(datetime, end_time) <![CDATA[ <= ]]> #{endTime}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="destination != null and destination !=''">
|
|
|
|
+ and destination like concat('%', #{destination}, '%')
|
|
|
|
+ </if>
|
|
|
|
+ order by b.id desc
|
|
|
|
+ )
|
|
|
|
+ order by b.id desc
|
|
|
|
+ </select>
|
|
<!-- 查询私人订制特殊 -->
|
|
<!-- 查询私人订制特殊 -->
|
|
<select id="getPrivateOrderZeor" resultType="PrivateOrder">
|
|
<select id="getPrivateOrderZeor" resultType="PrivateOrder">
|
|
SELECT
|
|
SELECT
|
|
@@ -167,6 +210,21 @@
|
|
and destination like concat('%', #{destination}, '%')
|
|
and destination like concat('%', #{destination}, '%')
|
|
</if>
|
|
</if>
|
|
</select>
|
|
</select>
|
|
|
|
+ <select id="getPrivateOrderCountOne" resultType="int">
|
|
|
|
+ SELECT
|
|
|
|
+ COUNT( * ) AS COUNT
|
|
|
|
+ FROM
|
|
|
|
+ bus_private_ordering AS b
|
|
|
|
+ JOIN ( SELECT code,demand_uuid FROM bus_private_ordering_type WHERE code = #{code} and (order_type = '1' or order_type = '6' or order_type = '7')) as c on b.uuid = c.demand_uuid
|
|
|
|
+ WHERE
|
|
|
|
+ uuid NOT IN (SELECT ordering_uuid FROM bus_ignore_supplier WHERE code = #{code})
|
|
|
|
+ <if test="startTime != null and startTime !=''">
|
|
|
|
+ and CONVERT (datetime, start_time) <![CDATA[ >= ]]> #{startTime} and CONVERT(datetime, end_time) <![CDATA[ <= ]]> #{endTime}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="destination != null and destination !=''">
|
|
|
|
+ and destination like concat('%', #{destination}, '%')
|
|
|
|
+ </if>
|
|
|
|
+ </select>
|
|
<!-- 查询总条数特殊 -->
|
|
<!-- 查询总条数特殊 -->
|
|
<select id="getPrivateOrderCountZeor" resultType="int">
|
|
<select id="getPrivateOrderCountZeor" resultType="int">
|
|
SELECT
|
|
SELECT
|
|
@@ -208,4 +266,63 @@
|
|
<select id="getDemandCount" parameterType="String" resultType="int">
|
|
<select id="getDemandCount" parameterType="String" resultType="int">
|
|
select count(*) as count from bus_private_ordering_type where demand_uuid = #{uuid}
|
|
select count(*) as count from bus_private_ordering_type where demand_uuid = #{uuid}
|
|
</select>
|
|
</select>
|
|
|
|
+ <!-- 小程序查询私人订制特殊 -->
|
|
|
|
+ <select id="getPrivateOrderZeorSmall" resultType="PrivateOrder">
|
|
|
|
+ SELECT
|
|
|
|
+ top ${limit} b.*,${orderType} as orderType,e.headpir,e.name as orderName
|
|
|
|
+ FROM
|
|
|
|
+ bus_private_ordering AS b
|
|
|
|
+ JOIN ( SELECT code,uuid FROM bus_private_ordering WHERE uuid NOT IN ( SELECT demand_uuid FROM bus_private_ordering_type WHERE code = #{code} AND order_type != 0 ) ) AS c ON b.uuid = c.uuid
|
|
|
|
+ JOIN ( SELECT code,uuid FROM bus_private_ordering WHERE uuid NOT IN ( SELECT demand_uuid FROM bus_private_ordering_type WHERE order_type = 9 ) ) AS a ON b.uuid = a.uuid
|
|
|
|
+ JOIN ( SELECT code,uuid FROM bus_private_ordering WHERE uuid NOT IN ( SELECT demand_uuid FROM bus_private_ordering_type WHERE order_type = 10 ) ) AS d ON b.uuid = d.uuid
|
|
|
|
+ LEFT JOIN sys_users as e on b.code = e.code
|
|
|
|
+ WHERE
|
|
|
|
+ b.uuid NOT IN (SELECT ordering_uuid FROM bus_ignore_supplier WHERE code = #{code})
|
|
|
|
+ <if test="startTime != null and startTime !=''">
|
|
|
|
+ and CONVERT (datetime, b.start_time) <![CDATA[ >= ]]> #{startTime} and CONVERT(datetime, b.end_time) <![CDATA[ <= ]]> #{endTime}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="destination != null and destination !=''">
|
|
|
|
+ and b.destination like concat('%', #{destination}, '%')
|
|
|
|
+ </if>
|
|
|
|
+ and b.id not in
|
|
|
|
+ (
|
|
|
|
+ select top ${page} b.id from bus_private_ordering as b
|
|
|
|
+ JOIN ( SELECT code,uuid FROM bus_private_ordering WHERE uuid NOT IN ( SELECT demand_uuid FROM bus_private_ordering_type WHERE code = #{code} AND order_type != 0 ) ) AS c ON b.uuid = c.uuid
|
|
|
|
+ JOIN ( SELECT code,uuid FROM bus_private_ordering WHERE uuid NOT IN ( SELECT demand_uuid FROM bus_private_ordering_type WHERE order_type = 9 ) ) AS a ON b.uuid = a.uuid
|
|
|
|
+ JOIN ( SELECT code,uuid FROM bus_private_ordering WHERE uuid NOT IN ( SELECT demand_uuid FROM bus_private_ordering_type WHERE order_type = 10 ) ) AS d ON b.uuid = d.uuid
|
|
|
|
+ WHERE
|
|
|
|
+ b.uuid NOT IN (SELECT ordering_uuid FROM bus_ignore_supplier WHERE code = #{code})
|
|
|
|
+ <if test="startTime != null and startTime !=''">
|
|
|
|
+ and CONVERT (datetime, b.start_time) <![CDATA[ >= ]]> #{startTime} and CONVERT(datetime, b.end_time) <![CDATA[ <= ]]> #{endTime}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="destination != null and destination !=''">
|
|
|
|
+ and b.destination like concat('%', #{destination}, '%')
|
|
|
|
+ </if>
|
|
|
|
+ order by ${orderBy}
|
|
|
|
+ )
|
|
|
|
+ and b.supplier_code = '000' or b.supplier_code = #{code}
|
|
|
|
+ order by ${orderBy}
|
|
|
|
+ </select>
|
|
|
|
+ <!-- 小程序查询总条数 -->
|
|
|
|
+ <select id="getPrivateOrderCountSmall" resultType="int">
|
|
|
|
+ SELECT
|
|
|
|
+ COUNT( * ) AS COUNT
|
|
|
|
+ FROM
|
|
|
|
+ bus_private_ordering AS b
|
|
|
|
+ JOIN ( SELECT code,demand_uuid FROM bus_private_ordering_type WHERE code = #{code}
|
|
|
|
+ <trim prefix="and" prefixOverrides="and | or">
|
|
|
|
+ <foreach collection="orderTypeVal.split(',')" item="item" separator="or" open="(" close=")">
|
|
|
|
+ order_type = #{item}
|
|
|
|
+ </foreach>
|
|
|
|
+ </trim>
|
|
|
|
+ ) as c on b.uuid = c.demand_uuid
|
|
|
|
+ WHERE
|
|
|
|
+ uuid NOT IN (SELECT ordering_uuid FROM bus_ignore_supplier WHERE code = #{code})
|
|
|
|
+ <if test="startTime != null and startTime !=''">
|
|
|
|
+ and CONVERT (datetime, start_time) <![CDATA[ >= ]]> #{startTime} and CONVERT(datetime, end_time) <![CDATA[ <= ]]> #{endTime}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="destination != null and destination !=''">
|
|
|
|
+ and destination like concat('%', #{destination}, '%')
|
|
|
|
+ </if>
|
|
|
|
+ </select>
|
|
</mapper>
|
|
</mapper>
|