|
@@ -68,49 +68,24 @@
|
|
|
a.remark AS remark,
|
|
a.remark AS remark,
|
|
|
a.unit AS unit,
|
|
a.unit AS unit,
|
|
|
a.create_by AS createBy,
|
|
a.create_by AS createBy,
|
|
|
- a.create_time AS createTime,
|
|
|
|
|
- b.id AS loadAddressId,
|
|
|
|
|
- b.name AS loadName,
|
|
|
|
|
- b.city_name AS loadCityName,
|
|
|
|
|
- b.detail_address AS loadDetailAddress,
|
|
|
|
|
- c.id AS unloadAddressId,
|
|
|
|
|
- c.name AS unloadName,
|
|
|
|
|
- c.city_name AS unloadCityName,
|
|
|
|
|
- c.detail_address AS unloadDetailAddress
|
|
|
|
|
|
|
+ a.create_time AS createTime
|
|
|
</sql>
|
|
</sql>
|
|
|
|
|
|
|
|
- <select id="tradeOrderSelect"
|
|
|
|
|
- resultMap="mainEntityMap">
|
|
|
|
|
|
|
+ <select id="tradeOrderSelect" resultMap="mainEntityMap">
|
|
|
SELECT
|
|
SELECT
|
|
|
<include refid="Query_Column_List_Accept_Carriage">
|
|
<include refid="Query_Column_List_Accept_Carriage">
|
|
|
</include>
|
|
</include>
|
|
|
FROM kwo_trade_order a
|
|
FROM kwo_trade_order a
|
|
|
- LEFT JOIN kwo_trade_order_address b ON a.id = b.t_order_id
|
|
|
|
|
- AND b.address_type = "1" AND b.del_flag = 0
|
|
|
|
|
- LEFT JOIN kwo_trade_order_address c ON a.id = c.t_order_id
|
|
|
|
|
- AND c.address_type = "2" AND c.del_flag = 0
|
|
|
|
|
- LEFT JOIN kwo_trade_order_unit d ON a.id = d.t_order_id
|
|
|
|
|
- AND d.unit_type = "1" AND d.del_flag = 0
|
|
|
|
|
- LEFT JOIN kwo_trade_order_unit e ON a.id = e.t_order_id
|
|
|
|
|
- AND e.unit_type = "2" AND e.del_flag = 0
|
|
|
|
|
|
|
+ LEFT JOIN kwo_trade_order_unit d ON a.id = d.t_order_id AND d.unit_type = "1" AND d.del_flag = 0
|
|
|
|
|
+ LEFT JOIN kwo_trade_order_unit e ON a.id = e.t_order_id AND e.unit_type = "2" AND e.del_flag = 0
|
|
|
LEFT JOIN kwo_trade_order_goods g ON a.id = g.t_order_id AND g.del_flag = 0
|
|
LEFT JOIN kwo_trade_order_goods g ON a.id = g.t_order_id AND g.del_flag = 0
|
|
|
LEFT JOIN kwo_trade_order_contract f ON a.id = f.t_order_id AND f.del_flag = 0
|
|
LEFT JOIN kwo_trade_order_contract f ON a.id = f.t_order_id AND f.del_flag = 0
|
|
|
<where>
|
|
<where>
|
|
|
a.del_flag = 0
|
|
a.del_flag = 0
|
|
|
-- 数据权限匹配
|
|
-- 数据权限匹配
|
|
|
<if test="query.isMain == 0">
|
|
<if test="query.isMain == 0">
|
|
|
- and ((
|
|
|
|
|
- <if test="query.entId != null">
|
|
|
|
|
- a.ent_id = #{query.entId}
|
|
|
|
|
- </if>
|
|
|
|
|
- <if test="authUserIds != null and authUserIds.size() > 0">
|
|
|
|
|
- and a.create_by in
|
|
|
|
|
- <foreach collection="authUserIds" item="authUserId" open="(" close=")" separator=",">
|
|
|
|
|
- #{authUserId}
|
|
|
|
|
- </foreach>
|
|
|
|
|
- </if>
|
|
|
|
|
- )or
|
|
|
|
|
- (<if test="query.orderType == 1">
|
|
|
|
|
|
|
+ and (
|
|
|
|
|
+ <if test="query.orderType == 1">
|
|
|
<if test="query.entId != null">
|
|
<if test="query.entId != null">
|
|
|
d.top_ent_id = #{query.entId}
|
|
d.top_ent_id = #{query.entId}
|
|
|
</if>
|
|
</if>
|
|
@@ -119,6 +94,10 @@
|
|
|
<foreach collection="authUserIds" item="authUserId" open="(" close=")" separator=",">
|
|
<foreach collection="authUserIds" item="authUserId" open="(" close=")" separator=",">
|
|
|
#{authUserId}
|
|
#{authUserId}
|
|
|
</foreach>
|
|
</foreach>
|
|
|
|
|
+ or d.create_by in
|
|
|
|
|
+ <foreach collection="authUserIds" item="authUserId" open="(" close=")" separator=",">
|
|
|
|
|
+ #{authUserId}
|
|
|
|
|
+ </foreach>
|
|
|
</if>
|
|
</if>
|
|
|
</if>
|
|
</if>
|
|
|
<if test="query.orderType == 2">
|
|
<if test="query.orderType == 2">
|
|
@@ -130,17 +109,17 @@
|
|
|
<foreach collection="authUserIds" item="authUserId" open="(" close=")" separator=",">
|
|
<foreach collection="authUserIds" item="authUserId" open="(" close=")" separator=",">
|
|
|
#{authUserId}
|
|
#{authUserId}
|
|
|
</foreach>
|
|
</foreach>
|
|
|
|
|
+ or e.create_by in
|
|
|
|
|
+ <foreach collection="authUserIds" item="authUserId" open="(" close=")" separator=",">
|
|
|
|
|
+ #{authUserId}
|
|
|
|
|
+ </foreach>
|
|
|
</if>
|
|
</if>
|
|
|
- </if>)
|
|
|
|
|
|
|
+ </if>
|
|
|
)
|
|
)
|
|
|
</if>
|
|
</if>
|
|
|
<if test="query.isMain == 1">
|
|
<if test="query.isMain == 1">
|
|
|
- and ((
|
|
|
|
|
- <if test="query.entId != null">
|
|
|
|
|
- a.ent_id = #{query.entId}
|
|
|
|
|
- </if>)
|
|
|
|
|
- or
|
|
|
|
|
- (<if test="query.orderType == 1">
|
|
|
|
|
|
|
+ and (
|
|
|
|
|
+ <if test="query.orderType == 1">
|
|
|
<if test="query.entId != null">
|
|
<if test="query.entId != null">
|
|
|
d.top_ent_id = #{query.entId}
|
|
d.top_ent_id = #{query.entId}
|
|
|
</if>
|
|
</if>
|
|
@@ -149,7 +128,7 @@
|
|
|
<if test="query.entId != null">
|
|
<if test="query.entId != null">
|
|
|
e.top_ent_id = #{query.entId}
|
|
e.top_ent_id = #{query.entId}
|
|
|
</if>
|
|
</if>
|
|
|
- </if>)
|
|
|
|
|
|
|
+ </if>
|
|
|
)
|
|
)
|
|
|
</if>
|
|
</if>
|
|
|
-- 状态匹配
|
|
-- 状态匹配
|
|
@@ -187,13 +166,18 @@
|
|
|
<if test="query.endCreateTime != null ">
|
|
<if test="query.endCreateTime != null ">
|
|
|
and a.create_time <= #{query.endCreateTime}
|
|
and a.create_time <= #{query.endCreateTime}
|
|
|
</if>
|
|
</if>
|
|
|
- <if test="query.loadAddressCode != null and query.loadAddressCode != ''">
|
|
|
|
|
- and b.city_code LIKE CONCAT(#{query.loadAddressCode}
|
|
|
|
|
- , '%')
|
|
|
|
|
- </if>
|
|
|
|
|
- <if test="query.unloadAddressCode != null and query.unloadAddressCode != ''">
|
|
|
|
|
- and c.city_code LIKE CONCAT(#{query.unloadAddressCode}
|
|
|
|
|
- , '%')
|
|
|
|
|
|
|
+ <if test="(query.loadAddressCode != null and query.loadAddressCode != '') or (query.unloadAddressCode != null and query.unloadAddressCode != '')">
|
|
|
|
|
+ and a.id in (
|
|
|
|
|
+ SELECT t_order_id from kwo_trade_order_address where del_flag = 0
|
|
|
|
|
+ <if test="query.loadAddressCode != null and query.loadAddressCode != ''">
|
|
|
|
|
+ address_type = 1
|
|
|
|
|
+ and left(city_code, #{query.loadAddressLevel, jdbcType=INTEGER}) = left( #{query.loadAddressCode, jdbcType=INTEGER}, #{query.loadAddressLevel, jdbcType=INTEGER} )
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="query.unloadAddressCode != null and query.unloadAddressCode != ''">
|
|
|
|
|
+ address_type = 2
|
|
|
|
|
+ and left(city_code, #{query.unloadAddressLevel, jdbcType=INTEGER}) = left( #{query.unloadAddressCode, jdbcType=INTEGER}, #{query.unloadAddressLevel, jdbcType=INTEGER} )
|
|
|
|
|
+ </if>
|
|
|
|
|
+ )
|
|
|
</if>
|
|
</if>
|
|
|
<if test="query.trading != null and query.trading != ''">
|
|
<if test="query.trading != null and query.trading != ''">
|
|
|
and a.trading =#{query.trading}
|
|
and a.trading =#{query.trading}
|
|
@@ -216,32 +200,16 @@
|
|
|
<include refid="Query_Column_List_Accept_Carriage">
|
|
<include refid="Query_Column_List_Accept_Carriage">
|
|
|
</include>
|
|
</include>
|
|
|
FROM kwo_trade_order a
|
|
FROM kwo_trade_order a
|
|
|
- LEFT JOIN kwo_trade_order_address b ON a.id = b.t_order_id
|
|
|
|
|
- AND b.address_type = "1" AND b.del_flag = 0
|
|
|
|
|
- LEFT JOIN kwo_trade_order_address c ON a.id = c.t_order_id
|
|
|
|
|
- AND c.address_type = "2" AND c.del_flag = 0
|
|
|
|
|
- LEFT JOIN kwo_trade_order_unit d ON a.id = d.t_order_id
|
|
|
|
|
- AND d.unit_type = "1" AND d.del_flag = 0
|
|
|
|
|
- LEFT JOIN kwo_trade_order_unit e ON a.id = e.t_order_id
|
|
|
|
|
- AND e.unit_type = "2" AND e.del_flag = 0
|
|
|
|
|
|
|
+ LEFT JOIN kwo_trade_order_unit d ON a.id = d.t_order_id AND d.unit_type = "1" AND d.del_flag = 0
|
|
|
|
|
+ LEFT JOIN kwo_trade_order_unit e ON a.id = e.t_order_id AND e.unit_type = "2" AND e.del_flag = 0
|
|
|
LEFT JOIN kwo_trade_order_goods g ON a.id = g.t_order_id AND g.del_flag = 0
|
|
LEFT JOIN kwo_trade_order_goods g ON a.id = g.t_order_id AND g.del_flag = 0
|
|
|
LEFT JOIN kwo_trade_order_contract f ON a.id = f.t_order_id AND f.del_flag = 0
|
|
LEFT JOIN kwo_trade_order_contract f ON a.id = f.t_order_id AND f.del_flag = 0
|
|
|
<where>
|
|
<where>
|
|
|
a.del_flag = 0
|
|
a.del_flag = 0
|
|
|
-- 数据权限匹配
|
|
-- 数据权限匹配
|
|
|
<if test="query.isMain == 0">
|
|
<if test="query.isMain == 0">
|
|
|
- and ((
|
|
|
|
|
- <if test="query.entId != null">
|
|
|
|
|
- a.ent_id = #{query.entId}
|
|
|
|
|
- </if>
|
|
|
|
|
- <if test="authUserIds != null and authUserIds.size() > 0">
|
|
|
|
|
- and a.create_by in
|
|
|
|
|
- <foreach collection="authUserIds" item="authUserId" open="(" close=")" separator=",">
|
|
|
|
|
- #{authUserId}
|
|
|
|
|
- </foreach>
|
|
|
|
|
- </if>
|
|
|
|
|
- )or
|
|
|
|
|
- (<if test="query.orderType == 1">
|
|
|
|
|
|
|
+ and (
|
|
|
|
|
+ <if test="query.orderType == 1">
|
|
|
<if test="query.entId != null">
|
|
<if test="query.entId != null">
|
|
|
d.top_ent_id = #{query.entId}
|
|
d.top_ent_id = #{query.entId}
|
|
|
</if>
|
|
</if>
|
|
@@ -250,6 +218,10 @@
|
|
|
<foreach collection="authUserIds" item="authUserId" open="(" close=")" separator=",">
|
|
<foreach collection="authUserIds" item="authUserId" open="(" close=")" separator=",">
|
|
|
#{authUserId}
|
|
#{authUserId}
|
|
|
</foreach>
|
|
</foreach>
|
|
|
|
|
+ or d.create_by in
|
|
|
|
|
+ <foreach collection="authUserIds" item="authUserId" open="(" close=")" separator=",">
|
|
|
|
|
+ #{authUserId}
|
|
|
|
|
+ </foreach>
|
|
|
</if>
|
|
</if>
|
|
|
</if>
|
|
</if>
|
|
|
<if test="query.orderType == 2">
|
|
<if test="query.orderType == 2">
|
|
@@ -261,17 +233,17 @@
|
|
|
<foreach collection="authUserIds" item="authUserId" open="(" close=")" separator=",">
|
|
<foreach collection="authUserIds" item="authUserId" open="(" close=")" separator=",">
|
|
|
#{authUserId}
|
|
#{authUserId}
|
|
|
</foreach>
|
|
</foreach>
|
|
|
|
|
+ or e.create_by in
|
|
|
|
|
+ <foreach collection="authUserIds" item="authUserId" open="(" close=")" separator=",">
|
|
|
|
|
+ #{authUserId}
|
|
|
|
|
+ </foreach>
|
|
|
</if>
|
|
</if>
|
|
|
- </if>)
|
|
|
|
|
|
|
+ </if>
|
|
|
)
|
|
)
|
|
|
</if>
|
|
</if>
|
|
|
<if test="query.isMain == 1">
|
|
<if test="query.isMain == 1">
|
|
|
- and ((
|
|
|
|
|
- <if test="query.entId != null">
|
|
|
|
|
- a.ent_id = #{query.entId}
|
|
|
|
|
- </if>)
|
|
|
|
|
- or
|
|
|
|
|
- (<if test="query.orderType == 1">
|
|
|
|
|
|
|
+ and (
|
|
|
|
|
+ <if test="query.orderType == 1">
|
|
|
<if test="query.entId != null">
|
|
<if test="query.entId != null">
|
|
|
d.top_ent_id = #{query.entId}
|
|
d.top_ent_id = #{query.entId}
|
|
|
</if>
|
|
</if>
|
|
@@ -280,7 +252,7 @@
|
|
|
<if test="query.entId != null">
|
|
<if test="query.entId != null">
|
|
|
e.top_ent_id = #{query.entId}
|
|
e.top_ent_id = #{query.entId}
|
|
|
</if>
|
|
</if>
|
|
|
- </if>)
|
|
|
|
|
|
|
+ </if>
|
|
|
)
|
|
)
|
|
|
</if>
|
|
</if>
|
|
|
-- 状态匹配
|
|
-- 状态匹配
|
|
@@ -318,13 +290,18 @@
|
|
|
<if test="query.endCreateTime != null ">
|
|
<if test="query.endCreateTime != null ">
|
|
|
and a.create_time <= #{query.endCreateTime}
|
|
and a.create_time <= #{query.endCreateTime}
|
|
|
</if>
|
|
</if>
|
|
|
- <if test="query.loadAddressCode != null and query.loadAddressCode != ''">
|
|
|
|
|
- and b.city_code LIKE CONCAT(#{query.loadAddressCode}
|
|
|
|
|
- , '%')
|
|
|
|
|
- </if>
|
|
|
|
|
- <if test="query.unloadAddressCode != null and query.unloadAddressCode != ''">
|
|
|
|
|
- and c.city_code LIKE CONCAT(#{query.unloadAddressCode}
|
|
|
|
|
- , '%')
|
|
|
|
|
|
|
+ <if test="(query.loadAddressCode != null and query.loadAddressCode != '') or (query.unloadAddressCode != null and query.unloadAddressCode != '')">
|
|
|
|
|
+ and a.id in (
|
|
|
|
|
+ SELECT t_order_id from kwo_trade_order_address where del_flag = 0
|
|
|
|
|
+ <if test="query.loadAddressCode != null and query.loadAddressCode != ''">
|
|
|
|
|
+ address_type = 1
|
|
|
|
|
+ and left(city_code, #{query.loadAddressLevel, jdbcType=INTEGER}) = left( #{query.loadAddressCode, jdbcType=INTEGER}, #{query.loadAddressLevel, jdbcType=INTEGER} )
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="query.unloadAddressCode != null and query.unloadAddressCode != ''">
|
|
|
|
|
+ address_type = 2
|
|
|
|
|
+ and left(city_code, #{query.unloadAddressLevel, jdbcType=INTEGER}) = left( #{query.unloadAddressCode, jdbcType=INTEGER}, #{query.unloadAddressLevel, jdbcType=INTEGER} )
|
|
|
|
|
+ </if>
|
|
|
|
|
+ )
|
|
|
</if>
|
|
</if>
|
|
|
<if test="query.trading != null and query.trading != ''">
|
|
<if test="query.trading != null and query.trading != ''">
|
|
|
and a.trading =#{query.trading}
|
|
and a.trading =#{query.trading}
|
|
@@ -477,31 +454,15 @@
|
|
|
<select id="tradeOrderStatistic" resultType="com.sckw.core.model.vo.TableTop">
|
|
<select id="tradeOrderStatistic" resultType="com.sckw.core.model.vo.TableTop">
|
|
|
SELECT a.status AS `value`, COUNT(a.status) AS total
|
|
SELECT a.status AS `value`, COUNT(a.status) AS total
|
|
|
FROM kwo_trade_order a
|
|
FROM kwo_trade_order a
|
|
|
- LEFT JOIN kwo_trade_order_address b ON a.id = b.t_order_id
|
|
|
|
|
- AND b.address_type = "1" AND b.del_flag = 0
|
|
|
|
|
- LEFT JOIN kwo_trade_order_address c ON a.id = c.t_order_id
|
|
|
|
|
- AND c.address_type = "2" AND c.del_flag = 0
|
|
|
|
|
- LEFT JOIN kwo_trade_order_unit d ON a.id = d.t_order_id
|
|
|
|
|
- AND d.unit_type = "1" AND d.del_flag = 0
|
|
|
|
|
- LEFT JOIN kwo_trade_order_unit e ON a.id = e.t_order_id
|
|
|
|
|
- AND e.unit_type = "2" AND e.del_flag = 0
|
|
|
|
|
|
|
+ LEFT JOIN kwo_trade_order_unit d ON a.id = d.t_order_id AND d.unit_type = "1" AND d.del_flag = 0
|
|
|
|
|
+ LEFT JOIN kwo_trade_order_unit e ON a.id = e.t_order_id AND e.unit_type = "2" AND e.del_flag = 0
|
|
|
LEFT JOIN kwo_trade_order_goods g ON a.id = g.t_order_id AND g.del_flag = 0
|
|
LEFT JOIN kwo_trade_order_goods g ON a.id = g.t_order_id AND g.del_flag = 0
|
|
|
<where>
|
|
<where>
|
|
|
a.del_flag = 0
|
|
a.del_flag = 0
|
|
|
-- 数据权限匹配
|
|
-- 数据权限匹配
|
|
|
<if test="query.isMain == 0">
|
|
<if test="query.isMain == 0">
|
|
|
- and ((
|
|
|
|
|
- <if test="query.entId != null">
|
|
|
|
|
- a.ent_id = #{query.entId}
|
|
|
|
|
- </if>
|
|
|
|
|
- <if test="authUserIds != null and authUserIds.size() > 0">
|
|
|
|
|
- and a.create_by in
|
|
|
|
|
- <foreach collection="authUserIds" item="authUserId" open="(" close=")" separator=",">
|
|
|
|
|
- #{authUserId}
|
|
|
|
|
- </foreach>
|
|
|
|
|
- </if>
|
|
|
|
|
- )or
|
|
|
|
|
- (<if test="query.orderType == 1">
|
|
|
|
|
|
|
+ and (
|
|
|
|
|
+ <if test="query.orderType == 1">
|
|
|
<if test="query.entId != null">
|
|
<if test="query.entId != null">
|
|
|
d.top_ent_id = #{query.entId}
|
|
d.top_ent_id = #{query.entId}
|
|
|
</if>
|
|
</if>
|
|
@@ -510,6 +471,10 @@
|
|
|
<foreach collection="authUserIds" item="authUserId" open="(" close=")" separator=",">
|
|
<foreach collection="authUserIds" item="authUserId" open="(" close=")" separator=",">
|
|
|
#{authUserId}
|
|
#{authUserId}
|
|
|
</foreach>
|
|
</foreach>
|
|
|
|
|
+ or d.create_by in
|
|
|
|
|
+ <foreach collection="authUserIds" item="authUserId" open="(" close=")" separator=",">
|
|
|
|
|
+ #{authUserId}
|
|
|
|
|
+ </foreach>
|
|
|
</if>
|
|
</if>
|
|
|
</if>
|
|
</if>
|
|
|
<if test="query.orderType == 2">
|
|
<if test="query.orderType == 2">
|
|
@@ -521,17 +486,17 @@
|
|
|
<foreach collection="authUserIds" item="authUserId" open="(" close=")" separator=",">
|
|
<foreach collection="authUserIds" item="authUserId" open="(" close=")" separator=",">
|
|
|
#{authUserId}
|
|
#{authUserId}
|
|
|
</foreach>
|
|
</foreach>
|
|
|
|
|
+ or e.create_by in
|
|
|
|
|
+ <foreach collection="authUserIds" item="authUserId" open="(" close=")" separator=",">
|
|
|
|
|
+ #{authUserId}
|
|
|
|
|
+ </foreach>
|
|
|
</if>
|
|
</if>
|
|
|
- </if>)
|
|
|
|
|
|
|
+ </if>
|
|
|
)
|
|
)
|
|
|
</if>
|
|
</if>
|
|
|
<if test="query.isMain == 1">
|
|
<if test="query.isMain == 1">
|
|
|
- and ((
|
|
|
|
|
- <if test="query.entId != null">
|
|
|
|
|
- a.ent_id = #{query.entId}
|
|
|
|
|
- </if>)
|
|
|
|
|
- or
|
|
|
|
|
- (<if test="query.orderType == 1">
|
|
|
|
|
|
|
+ and (
|
|
|
|
|
+ <if test="query.orderType == 1">
|
|
|
<if test="query.entId != null">
|
|
<if test="query.entId != null">
|
|
|
d.top_ent_id = #{query.entId}
|
|
d.top_ent_id = #{query.entId}
|
|
|
</if>
|
|
</if>
|
|
@@ -540,7 +505,7 @@
|
|
|
<if test="query.entId != null">
|
|
<if test="query.entId != null">
|
|
|
e.top_ent_id = #{query.entId}
|
|
e.top_ent_id = #{query.entId}
|
|
|
</if>
|
|
</if>
|
|
|
- </if>)
|
|
|
|
|
|
|
+ </if>
|
|
|
)
|
|
)
|
|
|
</if>
|
|
</if>
|
|
|
-- 状态匹配
|
|
-- 状态匹配
|
|
@@ -578,13 +543,18 @@
|
|
|
<if test="query.endCreateTime != null ">
|
|
<if test="query.endCreateTime != null ">
|
|
|
and a.create_time <= #{query.endCreateTime}
|
|
and a.create_time <= #{query.endCreateTime}
|
|
|
</if>
|
|
</if>
|
|
|
- <if test="query.loadAddressCode != null and query.loadAddressCode != ''">
|
|
|
|
|
- and b.city_code LIKE CONCAT(#{query.loadAddressCode}
|
|
|
|
|
- , '%')
|
|
|
|
|
- </if>
|
|
|
|
|
- <if test="query.unloadAddressCode != null and query.unloadAddressCode != ''">
|
|
|
|
|
- and c.city_code LIKE CONCAT(#{query.unloadAddressCode}
|
|
|
|
|
- , '%')
|
|
|
|
|
|
|
+ <if test="(query.loadAddressCode != null and query.loadAddressCode != '') or (query.unloadAddressCode != null and query.unloadAddressCode != '')">
|
|
|
|
|
+ and a.id in (
|
|
|
|
|
+ SELECT t_order_id from kwo_trade_order_address where del_flag = 0
|
|
|
|
|
+ <if test="query.loadAddressCode != null and query.loadAddressCode != ''">
|
|
|
|
|
+ address_type = 1
|
|
|
|
|
+ and left(city_code, #{query.loadAddressLevel, jdbcType=INTEGER}) = left( #{query.loadAddressCode, jdbcType=INTEGER}, #{query.loadAddressLevel, jdbcType=INTEGER} )
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="query.unloadAddressCode != null and query.unloadAddressCode != ''">
|
|
|
|
|
+ address_type = 2
|
|
|
|
|
+ and left(city_code, #{query.unloadAddressLevel, jdbcType=INTEGER}) = left( #{query.unloadAddressCode, jdbcType=INTEGER}, #{query.unloadAddressLevel, jdbcType=INTEGER} )
|
|
|
|
|
+ </if>
|
|
|
|
|
+ )
|
|
|
</if>
|
|
</if>
|
|
|
<if test="query.trading != null and query.trading != ''">
|
|
<if test="query.trading != null and query.trading != ''">
|
|
|
and a.trading =#{query.trading}
|
|
and a.trading =#{query.trading}
|