|
@@ -25,20 +25,21 @@
|
|
<result column="CLOSE_STATUS" jdbcType="DECIMAL" property="closeStatus" />
|
|
<result column="CLOSE_STATUS" jdbcType="DECIMAL" property="closeStatus" />
|
|
<result column="SALER_ID" jdbcType="DECIMAL" property="salerId" />
|
|
<result column="SALER_ID" jdbcType="DECIMAL" property="salerId" />
|
|
<result column="SALE_TYPE" jdbcType="DECIMAL" property="saleType" />
|
|
<result column="SALE_TYPE" jdbcType="DECIMAL" property="saleType" />
|
|
|
|
+ <result column="WARRANTY_NUMBER" jdbcType="DECIMAL" property="warrantyNumber" />
|
|
</resultMap>
|
|
</resultMap>
|
|
<sql id="columns">
|
|
<sql id="columns">
|
|
SALE_ORDER_ID, PLAN_ID, SALE_NUMBER, SHIPPER_ID, RECEIVE_ID, SALE_ACCOUNT_BALANCE,
|
|
SALE_ORDER_ID, PLAN_ID, SALE_NUMBER, SHIPPER_ID, RECEIVE_ID, SALE_ACCOUNT_BALANCE,
|
|
SALE_CURRENT_ORDER_AMOUNT, SALE_HISTORICAL_ORDER_AMOUNT, SALE_ORDER_STATUS, SALE_ORDER_RECEIVE_CUSTOMER,
|
|
SALE_CURRENT_ORDER_AMOUNT, SALE_HISTORICAL_ORDER_AMOUNT, SALE_ORDER_STATUS, SALE_ORDER_RECEIVE_CUSTOMER,
|
|
SALE_ORDER_ISSELF_MENTION, SALE_UNIT_PRICE, SALE_ORDER_TAX, SALE_REMARK, INSERT_USERNAME,
|
|
SALE_ORDER_ISSELF_MENTION, SALE_UNIT_PRICE, SALE_ORDER_TAX, SALE_REMARK, INSERT_USERNAME,
|
|
INSERT_TIME, UPDATE_USERNAME, UPDATE_TIME, INSERT_UPDATE_REMARK, DELETED, CLOSE_STATUS,
|
|
INSERT_TIME, UPDATE_USERNAME, UPDATE_TIME, INSERT_UPDATE_REMARK, DELETED, CLOSE_STATUS,
|
|
- SALER_ID, SALE_TYPE
|
|
|
|
|
|
+ SALER_ID, SALE_TYPE, WARRANTY_NUMBER
|
|
</sql>
|
|
</sql>
|
|
<sql id="columns_alias">
|
|
<sql id="columns_alias">
|
|
t.SALE_ORDER_ID, t.PLAN_ID, t.SALE_NUMBER, t.SHIPPER_ID, t.RECEIVE_ID, t.SALE_ACCOUNT_BALANCE,
|
|
t.SALE_ORDER_ID, t.PLAN_ID, t.SALE_NUMBER, t.SHIPPER_ID, t.RECEIVE_ID, t.SALE_ACCOUNT_BALANCE,
|
|
t.SALE_CURRENT_ORDER_AMOUNT, t.SALE_HISTORICAL_ORDER_AMOUNT, t.SALE_ORDER_STATUS,
|
|
t.SALE_CURRENT_ORDER_AMOUNT, t.SALE_HISTORICAL_ORDER_AMOUNT, t.SALE_ORDER_STATUS,
|
|
t.SALE_ORDER_RECEIVE_CUSTOMER, t.SALE_ORDER_ISSELF_MENTION, t.SALE_UNIT_PRICE, t.SALE_ORDER_TAX,
|
|
t.SALE_ORDER_RECEIVE_CUSTOMER, t.SALE_ORDER_ISSELF_MENTION, t.SALE_UNIT_PRICE, t.SALE_ORDER_TAX,
|
|
t.SALE_REMARK, t.INSERT_USERNAME, t.INSERT_TIME, t.UPDATE_USERNAME, t.UPDATE_TIME,
|
|
t.SALE_REMARK, t.INSERT_USERNAME, t.INSERT_TIME, t.UPDATE_USERNAME, t.UPDATE_TIME,
|
|
- t.INSERT_UPDATE_REMARK, t.DELETED, t.CLOSE_STATUS, t.SALER_ID, t.SALE_TYPE
|
|
|
|
|
|
+ t.INSERT_UPDATE_REMARK, t.DELETED, t.CLOSE_STATUS, t.SALER_ID, t.SALE_TYPE, t.WARRANTY_NUMBER
|
|
</sql>
|
|
</sql>
|
|
<sql id="select">
|
|
<sql id="select">
|
|
SELECT <include refid="columns" /> FROM AMS_SALE_ORDER
|
|
SELECT <include refid="columns" /> FROM AMS_SALE_ORDER
|
|
@@ -117,6 +118,9 @@
|
|
<if test="saleType != null">
|
|
<if test="saleType != null">
|
|
and SALE_TYPE = #{saleType}
|
|
and SALE_TYPE = #{saleType}
|
|
</if>
|
|
</if>
|
|
|
|
+ <if test="warrantyNumber != null">
|
|
|
|
+ and WARRANTY_NUMBER = #{warrantyNumber}
|
|
|
|
+ </if>
|
|
</where>
|
|
</where>
|
|
</sql>
|
|
</sql>
|
|
<sql id="whereLike">
|
|
<sql id="whereLike">
|
|
@@ -190,6 +194,9 @@
|
|
<if test="saleType != null">
|
|
<if test="saleType != null">
|
|
and SALE_TYPE = #{saleType}
|
|
and SALE_TYPE = #{saleType}
|
|
</if>
|
|
</if>
|
|
|
|
+ <if test="warrantyNumber != null">
|
|
|
|
+ and WARRANTY_NUMBER = #{warrantyNumber}
|
|
|
|
+ </if>
|
|
</where>
|
|
</where>
|
|
</sql>
|
|
</sql>
|
|
<delete id="deleteByPrimaryKey" parameterType="DECIMAL">
|
|
<delete id="deleteByPrimaryKey" parameterType="DECIMAL">
|
|
@@ -265,6 +272,9 @@
|
|
<if test="saleType != null">
|
|
<if test="saleType != null">
|
|
or SALE_TYPE = #{saleType}
|
|
or SALE_TYPE = #{saleType}
|
|
</if>
|
|
</if>
|
|
|
|
+ <if test="warrantyNumber != null">
|
|
|
|
+ or WARRANTY_NUMBER = #{warrantyNumber}
|
|
|
|
+ </if>
|
|
</delete>
|
|
</delete>
|
|
<insert id="insert" parameterType="com.steerinfo.dil.model.AmsSaleOrder">
|
|
<insert id="insert" parameterType="com.steerinfo.dil.model.AmsSaleOrder">
|
|
insert into AMS_SALE_ORDER (SALE_ORDER_ID, PLAN_ID, SALE_NUMBER,
|
|
insert into AMS_SALE_ORDER (SALE_ORDER_ID, PLAN_ID, SALE_NUMBER,
|
|
@@ -275,7 +285,8 @@
|
|
SALE_ORDER_TAX, SALE_REMARK, INSERT_USERNAME,
|
|
SALE_ORDER_TAX, SALE_REMARK, INSERT_USERNAME,
|
|
INSERT_TIME, UPDATE_USERNAME, UPDATE_TIME,
|
|
INSERT_TIME, UPDATE_USERNAME, UPDATE_TIME,
|
|
INSERT_UPDATE_REMARK, DELETED, CLOSE_STATUS,
|
|
INSERT_UPDATE_REMARK, DELETED, CLOSE_STATUS,
|
|
- SALER_ID, SALE_TYPE)
|
|
|
|
|
|
+ SALER_ID, SALE_TYPE, WARRANTY_NUMBER
|
|
|
|
+ )
|
|
values (#{saleOrderId,jdbcType=DECIMAL}, #{planId,jdbcType=DECIMAL}, #{saleNumber,jdbcType=VARCHAR},
|
|
values (#{saleOrderId,jdbcType=DECIMAL}, #{planId,jdbcType=DECIMAL}, #{saleNumber,jdbcType=VARCHAR},
|
|
#{shipperId,jdbcType=DECIMAL}, #{receiveId,jdbcType=DECIMAL}, #{saleAccountBalance,jdbcType=DECIMAL},
|
|
#{shipperId,jdbcType=DECIMAL}, #{receiveId,jdbcType=DECIMAL}, #{saleAccountBalance,jdbcType=DECIMAL},
|
|
#{saleCurrentOrderAmount,jdbcType=DECIMAL}, #{saleHistoricalOrderAmount,jdbcType=DECIMAL},
|
|
#{saleCurrentOrderAmount,jdbcType=DECIMAL}, #{saleHistoricalOrderAmount,jdbcType=DECIMAL},
|
|
@@ -284,7 +295,8 @@
|
|
#{saleOrderTax,jdbcType=VARCHAR}, #{saleRemark,jdbcType=VARCHAR}, #{insertUsername,jdbcType=VARCHAR},
|
|
#{saleOrderTax,jdbcType=VARCHAR}, #{saleRemark,jdbcType=VARCHAR}, #{insertUsername,jdbcType=VARCHAR},
|
|
#{insertTime,jdbcType=TIMESTAMP}, #{updateUsername,jdbcType=VARCHAR}, #{updateTime,jdbcType=TIMESTAMP},
|
|
#{insertTime,jdbcType=TIMESTAMP}, #{updateUsername,jdbcType=VARCHAR}, #{updateTime,jdbcType=TIMESTAMP},
|
|
#{insertUpdateRemark,jdbcType=VARCHAR}, #{deleted,jdbcType=DECIMAL}, #{closeStatus,jdbcType=DECIMAL},
|
|
#{insertUpdateRemark,jdbcType=VARCHAR}, #{deleted,jdbcType=DECIMAL}, #{closeStatus,jdbcType=DECIMAL},
|
|
- #{salerId,jdbcType=DECIMAL}, #{saleType,jdbcType=DECIMAL})
|
|
|
|
|
|
+ #{salerId,jdbcType=DECIMAL}, #{saleType,jdbcType=DECIMAL}, #{warrantyNumber,jdbcType=DECIMAL}
|
|
|
|
+ )
|
|
</insert>
|
|
</insert>
|
|
<insert id="insertSelective" parameterType="com.steerinfo.dil.model.AmsSaleOrder">
|
|
<insert id="insertSelective" parameterType="com.steerinfo.dil.model.AmsSaleOrder">
|
|
insert into AMS_SALE_ORDER
|
|
insert into AMS_SALE_ORDER
|
|
@@ -358,6 +370,9 @@
|
|
<if test="saleType != null">
|
|
<if test="saleType != null">
|
|
SALE_TYPE,
|
|
SALE_TYPE,
|
|
</if>
|
|
</if>
|
|
|
|
+ <if test="warrantyNumber != null">
|
|
|
|
+ WARRANTY_NUMBER,
|
|
|
|
+ </if>
|
|
</trim>
|
|
</trim>
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
<if test="saleOrderId != null">
|
|
<if test="saleOrderId != null">
|
|
@@ -429,6 +444,9 @@
|
|
<if test="saleType != null">
|
|
<if test="saleType != null">
|
|
#{saleType,jdbcType=DECIMAL},
|
|
#{saleType,jdbcType=DECIMAL},
|
|
</if>
|
|
</if>
|
|
|
|
+ <if test="warrantyNumber != null">
|
|
|
|
+ #{warrantyNumber,jdbcType=DECIMAL},
|
|
|
|
+ </if>
|
|
</trim>
|
|
</trim>
|
|
</insert>
|
|
</insert>
|
|
<update id="updateByPrimaryKey" parameterType="com.steerinfo.dil.model.AmsSaleOrder">
|
|
<update id="updateByPrimaryKey" parameterType="com.steerinfo.dil.model.AmsSaleOrder">
|
|
@@ -454,7 +472,8 @@
|
|
DELETED = #{deleted,jdbcType=DECIMAL},
|
|
DELETED = #{deleted,jdbcType=DECIMAL},
|
|
CLOSE_STATUS = #{closeStatus,jdbcType=DECIMAL},
|
|
CLOSE_STATUS = #{closeStatus,jdbcType=DECIMAL},
|
|
SALER_ID = #{salerId,jdbcType=DECIMAL},
|
|
SALER_ID = #{salerId,jdbcType=DECIMAL},
|
|
- SALE_TYPE = #{saleType,jdbcType=DECIMAL}
|
|
|
|
|
|
+ SALE_TYPE = #{saleType,jdbcType=DECIMAL},
|
|
|
|
+ WARRANTY_NUMBER = #{warrantyNumber,jdbcType=DECIMAL}
|
|
where SALE_ORDER_ID = #{saleOrderId,jdbcType=DECIMAL}
|
|
where SALE_ORDER_ID = #{saleOrderId,jdbcType=DECIMAL}
|
|
</update>
|
|
</update>
|
|
<update id="updateByPrimaryKeySelective" parameterType="com.steerinfo.dil.model.AmsSaleOrder">
|
|
<update id="updateByPrimaryKeySelective" parameterType="com.steerinfo.dil.model.AmsSaleOrder">
|
|
@@ -526,6 +545,9 @@
|
|
<if test="saleType != null">
|
|
<if test="saleType != null">
|
|
SALE_TYPE = #{saleType,jdbcType=DECIMAL},
|
|
SALE_TYPE = #{saleType,jdbcType=DECIMAL},
|
|
</if>
|
|
</if>
|
|
|
|
+ <if test="warrantyNumber != null">
|
|
|
|
+ WARRANTY_NUMBER = #{warrantyNumber,jdbcType=DECIMAL},
|
|
|
|
+ </if>
|
|
</set>
|
|
</set>
|
|
where SALE_ORDER_ID = #{saleOrderId,jdbcType=DECIMAL}
|
|
where SALE_ORDER_ID = #{saleOrderId,jdbcType=DECIMAL}
|
|
</update>
|
|
</update>
|
|
@@ -553,7 +575,7 @@
|
|
INSERT_TIME, UPDATE_USERNAME,
|
|
INSERT_TIME, UPDATE_USERNAME,
|
|
UPDATE_TIME, INSERT_UPDATE_REMARK,
|
|
UPDATE_TIME, INSERT_UPDATE_REMARK,
|
|
DELETED, CLOSE_STATUS, SALER_ID,
|
|
DELETED, CLOSE_STATUS, SALER_ID,
|
|
- SALE_TYPE)
|
|
|
|
|
|
+ SALE_TYPE, WARRANTY_NUMBER)
|
|
( <foreach collection="list" item="item" separator="union all">
|
|
( <foreach collection="list" item="item" separator="union all">
|
|
select
|
|
select
|
|
#{item.saleOrderId,jdbcType=DECIMAL},
|
|
#{item.saleOrderId,jdbcType=DECIMAL},
|
|
@@ -566,7 +588,7 @@
|
|
#{item.insertTime,jdbcType=TIMESTAMP}, #{item.updateUsername,jdbcType=VARCHAR},
|
|
#{item.insertTime,jdbcType=TIMESTAMP}, #{item.updateUsername,jdbcType=VARCHAR},
|
|
#{item.updateTime,jdbcType=TIMESTAMP}, #{item.insertUpdateRemark,jdbcType=VARCHAR},
|
|
#{item.updateTime,jdbcType=TIMESTAMP}, #{item.insertUpdateRemark,jdbcType=VARCHAR},
|
|
#{item.deleted,jdbcType=DECIMAL}, #{item.closeStatus,jdbcType=DECIMAL}, #{item.salerId,jdbcType=DECIMAL},
|
|
#{item.deleted,jdbcType=DECIMAL}, #{item.closeStatus,jdbcType=DECIMAL}, #{item.salerId,jdbcType=DECIMAL},
|
|
- #{item.saleType,jdbcType=DECIMAL} from dual
|
|
|
|
|
|
+ #{item.saleType,jdbcType=DECIMAL}, #{item.warrantyNumber,jdbcType=DECIMAL} from dual
|
|
</foreach> )
|
|
</foreach> )
|
|
</insert>
|
|
</insert>
|
|
<update id="batchUpdate" parameterType="java.util.List">
|
|
<update id="batchUpdate" parameterType="java.util.List">
|
|
@@ -664,6 +686,10 @@
|
|
<foreach close="end" collection="list" index="index" item="item" open="case SALE_ORDER_ID" separator=" ">
|
|
<foreach close="end" collection="list" index="index" item="item" open="case SALE_ORDER_ID" separator=" ">
|
|
when #{item.saleOrderId,jdbcType=DECIMAL} then #{item.saleType,jdbcType=DECIMAL}
|
|
when #{item.saleOrderId,jdbcType=DECIMAL} then #{item.saleType,jdbcType=DECIMAL}
|
|
</foreach>
|
|
</foreach>
|
|
|
|
+ ,WARRANTY_NUMBER=
|
|
|
|
+ <foreach close="end" collection="list" index="index" item="item" open="case SALE_ORDER_ID" separator=" ">
|
|
|
|
+ when #{item.saleOrderId,jdbcType=DECIMAL} then #{item.warrantyNumber,jdbcType=DECIMAL}
|
|
|
|
+ </foreach>
|
|
where SALE_ORDER_ID in
|
|
where SALE_ORDER_ID in
|
|
<foreach close=")" collection="list" index="index" item="item" open="(" separator=",">
|
|
<foreach close=")" collection="list" index="index" item="item" open="(" separator=",">
|
|
#{item.saleOrderId,jdbcType=DECIMAL}
|
|
#{item.saleOrderId,jdbcType=DECIMAL}
|
|
@@ -1514,6 +1540,8 @@
|
|
RM.MATERIAL_NAME "materialName",
|
|
RM.MATERIAL_NAME "materialName",
|
|
RM.MATERIAL_SPECIFICATION "materialSpecification",
|
|
RM.MATERIAL_SPECIFICATION "materialSpecification",
|
|
RM.MATERIAL_MODEL "materialModel",
|
|
RM.MATERIAL_MODEL "materialModel",
|
|
|
|
+ ASM.MATERIAL_NUMBER "materialNumber",
|
|
|
|
+ RM.MATERIAL_SPECIFICATION || RM.MATERIAL_MODEL "specificationModel",
|
|
RM.MATERIAL_NAME || RM.MATERIAL_SPECIFICATION || RM.MATERIAL_MODEL "nameSpecificationModel"
|
|
RM.MATERIAL_NAME || RM.MATERIAL_SPECIFICATION || RM.MATERIAL_MODEL "nameSpecificationModel"
|
|
from AMS_SALE_ORDER a_s_order
|
|
from AMS_SALE_ORDER a_s_order
|
|
left join RMS_SHIPPER r_shipper
|
|
left join RMS_SHIPPER r_shipper
|
|
@@ -1530,6 +1558,13 @@
|
|
</if>
|
|
</if>
|
|
<if test="consigneeSsoId != null" >
|
|
<if test="consigneeSsoId != null" >
|
|
and r_consignee.CONSIGNEE_SSO_ID = #{consigneeSsoId}
|
|
and r_consignee.CONSIGNEE_SSO_ID = #{consigneeSsoId}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="oneDate != null">
|
|
|
|
+ and to_date(#{oneDate}, 'yyyy-mm-dd hh24:mi:ss') <= a_s_order.UPDATE_TIME
|
|
|
|
+ </if>
|
|
|
|
+ <if test="startDate != null">
|
|
|
|
+ and to_date(#{startDate}, 'yyyy-mm-dd hh24:mi:ss') <= a_s_order.UPDATE_TIME
|
|
|
|
+ and to_date(#{endDate}, 'yyyy-mm-dd hh24:mi:ss') >= a_s_order.UPDATE_TIME
|
|
</if>
|
|
</if>
|
|
)
|
|
)
|
|
<where>
|
|
<where>
|
|
@@ -1639,6 +1674,8 @@
|
|
RM.MATERIAL_NAME "materialName",
|
|
RM.MATERIAL_NAME "materialName",
|
|
RM.MATERIAL_SPECIFICATION "materialSpecification",
|
|
RM.MATERIAL_SPECIFICATION "materialSpecification",
|
|
RM.MATERIAL_MODEL "materialModel",
|
|
RM.MATERIAL_MODEL "materialModel",
|
|
|
|
+ RM.MATERIAL_SPECIFICATION || RM.MATERIAL_MODEL "specificationModel",
|
|
|
|
+ ASM.MATERIAL_NUMBER "materialNumber",
|
|
RM.MATERIAL_NAME || RM.MATERIAL_SPECIFICATION || RM.MATERIAL_MODEL "nameSpecificationModel"
|
|
RM.MATERIAL_NAME || RM.MATERIAL_SPECIFICATION || RM.MATERIAL_MODEL "nameSpecificationModel"
|
|
from AMS_SALE_ORDER a_s_order
|
|
from AMS_SALE_ORDER a_s_order
|
|
left join RMS_SHIPPER r_shipper
|
|
left join RMS_SHIPPER r_shipper
|
|
@@ -1654,6 +1691,13 @@
|
|
<if test="con != null">
|
|
<if test="con != null">
|
|
and (instr(r_consignee.CONSIGNEE_COMPANY_NAME, #{con}) > 0 or instr(a_s_order.SALE_NUMBER, #{con}) > 0)
|
|
and (instr(r_consignee.CONSIGNEE_COMPANY_NAME, #{con}) > 0 or instr(a_s_order.SALE_NUMBER, #{con}) > 0)
|
|
</if>
|
|
</if>
|
|
|
|
+ <if test="oneDate != null">
|
|
|
|
+ and to_date(#{oneDate}, 'yyyy-mm-dd hh24:mi:ss') <= a_s_order.UPDATE_TIME
|
|
|
|
+ </if>
|
|
|
|
+ <if test="startDate != null">
|
|
|
|
+ and to_date(#{startDate}, 'yyyy-mm-dd hh24:mi:ss') <= a_s_order.UPDATE_TIME
|
|
|
|
+ and to_date(#{endDate}, 'yyyy-mm-dd hh24:mi:ss') >= a_s_order.UPDATE_TIME
|
|
|
|
+ </if>
|
|
<if test="consigneeSsoId != null">
|
|
<if test="consigneeSsoId != null">
|
|
and r_consignee.CONSIGNEE_SSO_ID = #{consigneeSsoId}
|
|
and r_consignee.CONSIGNEE_SSO_ID = #{consigneeSsoId}
|
|
</if>
|
|
</if>
|
|
@@ -1765,7 +1809,7 @@
|
|
a_s_order.SALE_ORDER_TAX "saleOrderTax",
|
|
a_s_order.SALE_ORDER_TAX "saleOrderTax",
|
|
a_s_order.SALE_REMARK "saleRemark",
|
|
a_s_order.SALE_REMARK "saleRemark",
|
|
a_s_order.INSERT_TIME "insertTime",
|
|
a_s_order.INSERT_TIME "insertTime",
|
|
- DECODE(a_s_order.SALE_ORDER_STATUS,2,'销售已审批',4,'财务已审批') "statusStr",
|
|
|
|
|
|
+ DECODE(a_s_order.SALE_ORDER_STATUS,2,'销售已提交',4,'财务已审批') "statusStr",
|
|
RM.MATERIAL_NAME "materialName",
|
|
RM.MATERIAL_NAME "materialName",
|
|
a_s_order.CLOSE_STATUS "closeStatus"
|
|
a_s_order.CLOSE_STATUS "closeStatus"
|
|
from AMS_SALE_ORDER a_s_order
|
|
from AMS_SALE_ORDER a_s_order
|
|
@@ -1898,10 +1942,12 @@
|
|
a_s_order.SALE_ORDER_TAX "saleOrderTax",
|
|
a_s_order.SALE_ORDER_TAX "saleOrderTax",
|
|
a_s_order.SALE_REMARK "saleRemark",
|
|
a_s_order.SALE_REMARK "saleRemark",
|
|
a_s_order.INSERT_TIME "insertTime",
|
|
a_s_order.INSERT_TIME "insertTime",
|
|
- DECODE(a_s_order.SALE_ORDER_STATUS,2,'销售已审批',4,'财务已审批') "statusStr",
|
|
|
|
|
|
+ DECODE(a_s_order.SALE_ORDER_STATUS,2,'销售已提交',4,'财务已审批') "statusStr",
|
|
RM.MATERIAL_NAME "materialName",
|
|
RM.MATERIAL_NAME "materialName",
|
|
RM.MATERIAL_SPECIFICATION "materialSpecification",
|
|
RM.MATERIAL_SPECIFICATION "materialSpecification",
|
|
RM.MATERIAL_MODEL "materialModel",
|
|
RM.MATERIAL_MODEL "materialModel",
|
|
|
|
+ RM.MATERIAL_SPECIFICATION || RM.MATERIAL_MODEL "specificationModel",
|
|
|
|
+ ASM.MATERIAL_NUMBER "materialNumber",
|
|
RM.MATERIAL_NAME || RM.MATERIAL_SPECIFICATION || RM.MATERIAL_MODEL "nameSpecificationModel",
|
|
RM.MATERIAL_NAME || RM.MATERIAL_SPECIFICATION || RM.MATERIAL_MODEL "nameSpecificationModel",
|
|
ASM.SALE_WAREHOUSE "saleWareHouse"
|
|
ASM.SALE_WAREHOUSE "saleWareHouse"
|
|
from AMS_SALE_ORDER a_s_order
|
|
from AMS_SALE_ORDER a_s_order
|
|
@@ -1919,6 +1965,10 @@
|
|
<if test="con != null">
|
|
<if test="con != null">
|
|
and (instr(r_consignee.CONSIGNEE_COMPANY_NAME, #{con}) > 0 or instr(a_s_order.SALE_NUMBER, #{con}) > 0)
|
|
and (instr(r_consignee.CONSIGNEE_COMPANY_NAME, #{con}) > 0 or instr(a_s_order.SALE_NUMBER, #{con}) > 0)
|
|
</if>
|
|
</if>
|
|
|
|
+ <if test="startDate != null">
|
|
|
|
+ and to_date(#{startDate}, 'yyyy-mm-dd hh24:mi:ss') <= a_s_order.UPDATE_TIME
|
|
|
|
+ and to_date(#{endDate}, 'yyyy-mm-dd hh24:mi:ss') >= a_s_order.UPDATE_TIME
|
|
|
|
+ </if>
|
|
<if test="shipperId != null">
|
|
<if test="shipperId != null">
|
|
and a_s_order.SHIPPER_ID = #{shipperId}
|
|
and a_s_order.SHIPPER_ID = #{shipperId}
|
|
</if>
|
|
</if>
|
|
@@ -2055,7 +2105,7 @@
|
|
a_s_order.SALE_CURRENT_ORDER_AMOUNT "saleCurrentOrderAmount",
|
|
a_s_order.SALE_CURRENT_ORDER_AMOUNT "saleCurrentOrderAmount",
|
|
a_s_order.SALE_HISTORICAL_ORDER_AMOUNT "saleHistoricalOrderAmout",
|
|
a_s_order.SALE_HISTORICAL_ORDER_AMOUNT "saleHistoricalOrderAmout",
|
|
a_s_order.SALE_ORDER_RECEIVE_CUSTOMER "saleOrderReceiveCustomer",
|
|
a_s_order.SALE_ORDER_RECEIVE_CUSTOMER "saleOrderReceiveCustomer",
|
|
- DECODE(a_s_order.SALE_ORDER_STATUS,2,'销售已审批',4,'财务已审批') "statusStr",
|
|
|
|
|
|
+ DECODE(a_s_order.SALE_ORDER_STATUS,2,'销售已提交',4,'财务已审批') "statusStr",
|
|
a_s_order.SALE_UNIT_PRICE "saleUnitPrice",
|
|
a_s_order.SALE_UNIT_PRICE "saleUnitPrice",
|
|
a_s_order.SALE_ORDER_TAX "saleOrderTax",
|
|
a_s_order.SALE_ORDER_TAX "saleOrderTax",
|
|
a_s_order.SALE_REMARK "saleRemark",
|
|
a_s_order.SALE_REMARK "saleRemark",
|
|
@@ -2474,7 +2524,7 @@
|
|
a_s_order.SALE_ORDER_TAX "saleOrderTax",
|
|
a_s_order.SALE_ORDER_TAX "saleOrderTax",
|
|
a_s_order.SALE_REMARK "saleRemark",
|
|
a_s_order.SALE_REMARK "saleRemark",
|
|
a_s_order.INSERT_TIME "insertTime",
|
|
a_s_order.INSERT_TIME "insertTime",
|
|
- DECODE(a_s_order.SALE_ORDER_STATUS,2,'销售已审批',4,'财务已审批') "statusStr",
|
|
|
|
|
|
+ DECODE(a_s_order.SALE_ORDER_STATUS,2,'销售已提交',4,'财务已审批') "statusStr",
|
|
a_s_order.UPDATE_TIME "updateTime",
|
|
a_s_order.UPDATE_TIME "updateTime",
|
|
RM.MATERIAL_NAME "materialName",
|
|
RM.MATERIAL_NAME "materialName",
|
|
RM.MATERIAL_SPECIFICATION "materialSpecification",
|
|
RM.MATERIAL_SPECIFICATION "materialSpecification",
|
|
@@ -2629,7 +2679,7 @@
|
|
a_s_order.SALE_REMARK "saleRemark",
|
|
a_s_order.SALE_REMARK "saleRemark",
|
|
a_s_order.INSERT_TIME "insertTime",
|
|
a_s_order.INSERT_TIME "insertTime",
|
|
a_s_order.SALE_ORDER_STATUS "saleOrderStatus",
|
|
a_s_order.SALE_ORDER_STATUS "saleOrderStatus",
|
|
- DECODE(a_s_order.SALE_ORDER_STATUS,2,'销售已审批',4,'财务已审批') "statusStr",
|
|
|
|
|
|
+ DECODE(a_s_order.SALE_ORDER_STATUS,2,'销售已提交',4,'财务已审批') "statusStr",
|
|
RM.MATERIAL_NAME "materialName",
|
|
RM.MATERIAL_NAME "materialName",
|
|
RM.MATERIAL_SPECIFICATION "materialSpecification",
|
|
RM.MATERIAL_SPECIFICATION "materialSpecification",
|
|
RM.MATERIAL_MODEL "materialModel",
|
|
RM.MATERIAL_MODEL "materialModel",
|
|
@@ -2765,7 +2815,7 @@
|
|
RRA.ADDRESS_PROVINCE || RRA.ADDRESS_DISTRICT || RRA.ADDRESS_TOWN || RRP.ADDRESS_DELIVERY_ADDRESS AS
|
|
RRA.ADDRESS_PROVINCE || RRA.ADDRESS_DISTRICT || RRA.ADDRESS_TOWN || RRP.ADDRESS_DELIVERY_ADDRESS AS
|
|
"addressDeliveryAddress",
|
|
"addressDeliveryAddress",
|
|
ASOM.SALE_DATE_OF_RECEIPT AS "saleDateOfReceipt",
|
|
ASOM.SALE_DATE_OF_RECEIPT AS "saleDateOfReceipt",
|
|
- DECODE(ASO.SALE_ORDER_STATUS,2, '销售已审批',4, '财务已审批')
|
|
|
|
|
|
+ DECODE(ASO.SALE_ORDER_STATUS,2, '销售已提交',4, '财务已审批')
|
|
AS "approvalStatus",
|
|
AS "approvalStatus",
|
|
ASOM.SALE_ORDER_CONSIGNEE_TEL AS "saleOrderConsigneeTel",
|
|
ASOM.SALE_ORDER_CONSIGNEE_TEL AS "saleOrderConsigneeTel",
|
|
RSH.SHIPPER_NAME AS "shipperName",
|
|
RSH.SHIPPER_NAME AS "shipperName",
|
|
@@ -2777,6 +2827,8 @@
|
|
RM.MATERIAL_NAME AS "materialName",
|
|
RM.MATERIAL_NAME AS "materialName",
|
|
RM.MATERIAL_SPECIFICATION AS "materialSpecification",
|
|
RM.MATERIAL_SPECIFICATION AS "materialSpecification",
|
|
RM.MATERIAL_MODEL AS "materialModel",
|
|
RM.MATERIAL_MODEL AS "materialModel",
|
|
|
|
+ RM.MATERIAL_SPECIFICATION || RM.MATERIAL_MODEL AS "specificationModel",
|
|
|
|
+ ASM.MATERIAL_NUMBER AS "materialNumber",
|
|
RM.MATERIAL_NAME || RM.MATERIAL_SPECIFICATION || RM.MATERIAL_MODEL AS "nameSpecificationModel"
|
|
RM.MATERIAL_NAME || RM.MATERIAL_SPECIFICATION || RM.MATERIAL_MODEL AS "nameSpecificationModel"
|
|
FROM AMS_SALE_ORDER_MATERIAL ASOM
|
|
FROM AMS_SALE_ORDER_MATERIAL ASOM
|
|
LEFT JOIN AMS_SALE_ORDER ASO
|
|
LEFT JOIN AMS_SALE_ORDER ASO
|
|
@@ -2908,7 +2960,7 @@
|
|
RRA.ADDRESS_PROVINCE || RRA.ADDRESS_DISTRICT || RRA.ADDRESS_TOWN || RRP.ADDRESS_DELIVERY_ADDRESS AS
|
|
RRA.ADDRESS_PROVINCE || RRA.ADDRESS_DISTRICT || RRA.ADDRESS_TOWN || RRP.ADDRESS_DELIVERY_ADDRESS AS
|
|
"addressDeliveryAddress",
|
|
"addressDeliveryAddress",
|
|
ASOM.SALE_DATE_OF_RECEIPT AS "saleDateOfReceipt",
|
|
ASOM.SALE_DATE_OF_RECEIPT AS "saleDateOfReceipt",
|
|
- DECODE(ASO.SALE_ORDER_STATUS,2, '销售已审批',4, '财务已审批')
|
|
|
|
|
|
+ DECODE(ASO.SALE_ORDER_STATUS,2, '销售已提交',4, '财务已审批')
|
|
AS "approvalStatus",
|
|
AS "approvalStatus",
|
|
ASOM.SALE_ORDER_CONSIGNEE_TEL AS "saleOrderConsigneeTel",
|
|
ASOM.SALE_ORDER_CONSIGNEE_TEL AS "saleOrderConsigneeTel",
|
|
RSH.SHIPPER_NAME AS "shipperName",
|
|
RSH.SHIPPER_NAME AS "shipperName",
|
|
@@ -2921,7 +2973,9 @@
|
|
RM.MATERIAL_NAME || RM.MATERIAL_SPECIFICATION || RM.MATERIAL_MODEL AS "nameSpecificationModel",
|
|
RM.MATERIAL_NAME || RM.MATERIAL_SPECIFICATION || RM.MATERIAL_MODEL AS "nameSpecificationModel",
|
|
RM.MATERIAL_NAME AS "materialName",
|
|
RM.MATERIAL_NAME AS "materialName",
|
|
RM.MATERIAL_SPECIFICATION AS "materialSpecification",
|
|
RM.MATERIAL_SPECIFICATION AS "materialSpecification",
|
|
- RM.MATERIAL_MODEL AS "materialModel"
|
|
|
|
|
|
+ RM.MATERIAL_MODEL AS "materialModel",
|
|
|
|
+ RM.MATERIAL_SPECIFICATION || MATERIAL_MODEL AS "specificationModel",
|
|
|
|
+ ASM.MATERIAL_NUMBER AS "materialNumber"
|
|
FROM AMS_SALE_ORDER_MATERIAL ASOM
|
|
FROM AMS_SALE_ORDER_MATERIAL ASOM
|
|
LEFT JOIN AMS_SALE_ORDER ASO
|
|
LEFT JOIN AMS_SALE_ORDER ASO
|
|
ON ASO.SALE_ORDER_ID = ASOM.SALE_ORDER_ID
|
|
ON ASO.SALE_ORDER_ID = ASOM.SALE_ORDER_ID
|
|
@@ -3089,7 +3143,7 @@
|
|
RRA.ADDRESS_PROVINCE || RRA.ADDRESS_DISTRICT || RRA.ADDRESS_TOWN || RRP.ADDRESS_DELIVERY_ADDRESS AS
|
|
RRA.ADDRESS_PROVINCE || RRA.ADDRESS_DISTRICT || RRA.ADDRESS_TOWN || RRP.ADDRESS_DELIVERY_ADDRESS AS
|
|
"addressDeliveryAddress",
|
|
"addressDeliveryAddress",
|
|
ASOM.SALE_DATE_OF_RECEIPT AS "saleDateOfReceipt",
|
|
ASOM.SALE_DATE_OF_RECEIPT AS "saleDateOfReceipt",
|
|
- DECODE(ASO.SALE_ORDER_STATUS,2, '销售已审批',4, '财务已审批')
|
|
|
|
|
|
+ DECODE(ASO.SALE_ORDER_STATUS,2, '销售已提交',4, '财务已审批')
|
|
AS "approvalStatus",
|
|
AS "approvalStatus",
|
|
ASOM.SALE_ORDER_CONSIGNEE_TEL AS "saleOrderConsigneeTel",
|
|
ASOM.SALE_ORDER_CONSIGNEE_TEL AS "saleOrderConsigneeTel",
|
|
RSH.SHIPPER_NAME AS "shipperName",
|
|
RSH.SHIPPER_NAME AS "shipperName",
|
|
@@ -3102,7 +3156,11 @@
|
|
RM.MATERIAL_NAME AS "materialName",
|
|
RM.MATERIAL_NAME AS "materialName",
|
|
RM.MATERIAL_SPECIFICATION AS "materialSpecification",
|
|
RM.MATERIAL_SPECIFICATION AS "materialSpecification",
|
|
RM.MATERIAL_MODEL AS "materialModel",
|
|
RM.MATERIAL_MODEL AS "materialModel",
|
|
- RM.MATERIAL_NAME || RM.MATERIAL_SPECIFICATION || RM.MATERIAL_MODEL AS "nameSpecificationModel"
|
|
|
|
|
|
+ RM.MATERIAL_SPECIFICATION || RM.MATERIAL_MODEL AS "specificationModel",
|
|
|
|
+ RM.MATERIAL_NAME || RM.MATERIAL_SPECIFICATION || RM.MATERIAL_MODEL AS "nameSpecificationModel",
|
|
|
|
+ RCP.CAPACITY_NUMBER AS "capacityNumber",
|
|
|
|
+ OO.DRIVER_TEL AS "drivelTel",
|
|
|
|
+ ASM.MATERIAL_NUMBER AS "materialNumber"
|
|
FROM AMS_SALE_ORDER_MATERIAL ASOM
|
|
FROM AMS_SALE_ORDER_MATERIAL ASOM
|
|
LEFT JOIN AMS_SALE_ORDER ASO
|
|
LEFT JOIN AMS_SALE_ORDER ASO
|
|
ON ASO.SALE_ORDER_ID = ASOM.SALE_ORDER_ID
|
|
ON ASO.SALE_ORDER_ID = ASOM.SALE_ORDER_ID
|
|
@@ -3120,6 +3178,8 @@
|
|
ON ADSO.SALE_ORDER_MATERIAL_ID = ASOM.SALE_ORDER_MATERIAL_ID
|
|
ON ADSO.SALE_ORDER_MATERIAL_ID = ASOM.SALE_ORDER_MATERIAL_ID
|
|
LEFT JOIN OMSTRUCK_ORDER OO
|
|
LEFT JOIN OMSTRUCK_ORDER OO
|
|
ON OO.ORDER_PLAN_ID = ASOM.SALE_ORDER_MATERIAL_ID
|
|
ON OO.ORDER_PLAN_ID = ASOM.SALE_ORDER_MATERIAL_ID
|
|
|
|
+ LEFT JOIN RMS_CAPACITY RCP
|
|
|
|
+ ON RCP.CAPACITY_ID = OO.CAPACITY_ID
|
|
LEFT JOIN RMS_CARRIER RCA
|
|
LEFT JOIN RMS_CARRIER RCA
|
|
ON RCA.CARRIER_ID = ADSO.CARRIER_ID
|
|
ON RCA.CARRIER_ID = ADSO.CARRIER_ID
|
|
LEFT JOIN AMS_SALE_MATERIAL ASM
|
|
LEFT JOIN AMS_SALE_MATERIAL ASM
|
|
@@ -3493,7 +3553,7 @@
|
|
a_s_order.SALE_ORDER_TAX "saleOrderTax",
|
|
a_s_order.SALE_ORDER_TAX "saleOrderTax",
|
|
a_s_order.SALE_REMARK "saleRemark",
|
|
a_s_order.SALE_REMARK "saleRemark",
|
|
a_s_order.INSERT_TIME "insertTime",
|
|
a_s_order.INSERT_TIME "insertTime",
|
|
- DECODE(a_s_order.SALE_ORDER_STATUS,2,'销售已审批',4,'财务已审批') "statusStr",
|
|
|
|
|
|
+ DECODE(a_s_order.SALE_ORDER_STATUS,2,'销售已提交',4,'财务已审批') "statusStr",
|
|
RM.MATERIAL_NAME "materialName",
|
|
RM.MATERIAL_NAME "materialName",
|
|
ASM.MATERIAL_WEIGHT "materialWeight",
|
|
ASM.MATERIAL_WEIGHT "materialWeight",
|
|
ASM.SALE_WAREHOUSE "saleWareHouse",
|
|
ASM.SALE_WAREHOUSE "saleWareHouse",
|
|
@@ -3734,10 +3794,12 @@
|
|
a_s_order.SALE_ORDER_TAX "saleOrderTax",
|
|
a_s_order.SALE_ORDER_TAX "saleOrderTax",
|
|
a_s_order.SALE_REMARK "saleRemark",
|
|
a_s_order.SALE_REMARK "saleRemark",
|
|
a_s_order.INSERT_TIME "insertTime",
|
|
a_s_order.INSERT_TIME "insertTime",
|
|
- DECODE(a_s_order.SALE_ORDER_STATUS,2,'销售已审批',4,'财务已审批') "statusStr",
|
|
|
|
|
|
+ DECODE(a_s_order.SALE_ORDER_STATUS,2,'销售已提交',4,'财务已审批') "statusStr",
|
|
RM.MATERIAL_NAME "materialName",
|
|
RM.MATERIAL_NAME "materialName",
|
|
RM.MATERIAL_SPECIFICATION "materialSpecification",
|
|
RM.MATERIAL_SPECIFICATION "materialSpecification",
|
|
RM.MATERIAL_MODEL "materialModel",
|
|
RM.MATERIAL_MODEL "materialModel",
|
|
|
|
+ RM.MATERIAL_SPECIFICATION || RM.MATERIAL_MODEL "specificationModel",
|
|
|
|
+ ASM.MATERIAL_NUMBER "materialNumber",
|
|
RM.MATERIAL_NAME || RM.MATERIAL_SPECIFICATION || RM.MATERIAL_MODEL "nameSpecificationModel",
|
|
RM.MATERIAL_NAME || RM.MATERIAL_SPECIFICATION || RM.MATERIAL_MODEL "nameSpecificationModel",
|
|
ASM.SALE_WAREHOUSE "saleWareHouse"
|
|
ASM.SALE_WAREHOUSE "saleWareHouse"
|
|
from AMS_SALE_ORDER a_s_order
|
|
from AMS_SALE_ORDER a_s_order
|
|
@@ -3755,6 +3817,173 @@
|
|
<if test="con != null">
|
|
<if test="con != null">
|
|
and (instr(r_consignee.CONSIGNEE_COMPANY_NAME, #{con}) > 0 or instr(a_s_order.SALE_NUMBER, #{con}) > 0)
|
|
and (instr(r_consignee.CONSIGNEE_COMPANY_NAME, #{con}) > 0 or instr(a_s_order.SALE_NUMBER, #{con}) > 0)
|
|
</if>
|
|
</if>
|
|
|
|
+ <if test="oneDate != null">
|
|
|
|
+ and to_date(#{oneDate}, 'yyyy-mm-dd hh24:mi:ss') <= a_s_order.UPDATE_TIME
|
|
|
|
+ </if>
|
|
|
|
+ <if test="startDate != null">
|
|
|
|
+ and to_date(#{startDate}, 'yyyy-mm-dd hh24:mi:ss') <= a_s_order.UPDATE_TIME
|
|
|
|
+ and to_date(#{endDate}, 'yyyy-mm-dd hh24:mi:ss') >= a_s_order.UPDATE_TIME
|
|
|
|
+ </if>
|
|
|
|
+ <if test="consigneeSsoId != null">
|
|
|
|
+ and r_consignee.CONSIGNEE_SSO_ID = #{consigneeSsoId}
|
|
|
|
+ </if>
|
|
|
|
+ ORDER BY a_s_order.UPDATE_TIME DESC
|
|
|
|
+ )
|
|
|
|
+ <where>
|
|
|
|
+ <if test="saleNumber != null">
|
|
|
|
+ <foreach collection="saleNumber" item="item" open="(" separator="or" close=")">
|
|
|
|
+ "saleNumber" like '%${item}%'
|
|
|
|
+ </foreach>
|
|
|
|
+ </if>
|
|
|
|
+ <if test="materialName != null">
|
|
|
|
+ <foreach collection="materialName" item="item" open="(" separator="or" close=")">
|
|
|
|
+ "materialName" like '%${item}%'
|
|
|
|
+ </foreach>
|
|
|
|
+ </if>
|
|
|
|
+ <if test="materialSpecification != null">
|
|
|
|
+ <foreach collection="materialSpecification" item="item" open="(" separator="or" close=")">
|
|
|
|
+ "materialSpecification" like '%${item}%'
|
|
|
|
+ </foreach>
|
|
|
|
+ </if>
|
|
|
|
+ <if test="materialModel != null">
|
|
|
|
+ <foreach collection="materialModel" item="item" open="(" separator="or" close=")">
|
|
|
|
+ "materialModel" like '%${item}%'
|
|
|
|
+ </foreach>
|
|
|
|
+ </if>
|
|
|
|
+ <if test="statusStr != null">
|
|
|
|
+ <foreach collection="statusStr" item="item" open="(" separator="or" close=")">
|
|
|
|
+ and "statusStr" like '%${item}%'
|
|
|
|
+ </foreach>
|
|
|
|
+ </if>
|
|
|
|
+
|
|
|
|
+ <!-- <if test="startTime != null">-->
|
|
|
|
+ <!-- and "insertTime" >= to_date('${startTime}','yyyy-mm-dd')-->
|
|
|
|
+ <!-- </if>-->
|
|
|
|
+ <!-- <if test="endTime != null">-->
|
|
|
|
+ <!-- and "insertTime" <= to_date('${endTime}','yyyy-mm-dd')-->
|
|
|
|
+ <!-- </if>-->
|
|
|
|
+
|
|
|
|
+ <if test="shipperName != null">
|
|
|
|
+ and
|
|
|
|
+ <foreach collection="shipperName" item="item" open="(" separator="or" close=")">
|
|
|
|
+ "shipperName" like '%${item}%'
|
|
|
|
+ </foreach>
|
|
|
|
+ </if>
|
|
|
|
+ <if test="consigneeCompanyName != null">
|
|
|
|
+ and
|
|
|
|
+ <foreach collection="consigneeCompanyName" item="item" open="(" separator="or" close=")">
|
|
|
|
+ "consigneeCompanyName" like '%${item}%'
|
|
|
|
+ </foreach>
|
|
|
|
+ </if>
|
|
|
|
+ <if test="consigneeWarrantyAmount != null">
|
|
|
|
+ and
|
|
|
|
+ <foreach collection="consigneeWarrantyAmount" item="item" open="(" separator="or" close=")">
|
|
|
|
+ "consigneeWarrantyAmount" like '%${item}%'
|
|
|
|
+ </foreach>
|
|
|
|
+ </if>
|
|
|
|
+ <if test="consigneeWarrantyWeight != null">
|
|
|
|
+ and
|
|
|
|
+ <foreach collection="consigneeWarrantyWeight" item="item" open="(" separator="or" close=")">
|
|
|
|
+ "consigneeWarrantyWeight" like '%${item}%'
|
|
|
|
+ </foreach>
|
|
|
|
+ </if>
|
|
|
|
+ <if test="saleOrderIsselfMention != null">
|
|
|
|
+ and
|
|
|
|
+ <foreach collection="saleOrderIsselfMention" item="item" open="(" separator="or" close=")">
|
|
|
|
+ "saleOrderIsselfMention" like '%${item}%'
|
|
|
|
+ </foreach>
|
|
|
|
+ </if>
|
|
|
|
+ <if test="saleAccountBalance != null">
|
|
|
|
+ and
|
|
|
|
+ <foreach collection="saleAccountBalance" item="item" open="(" separator="or" close=")">
|
|
|
|
+ "saleAccountBalance" like '%${item}%'
|
|
|
|
+ </foreach>
|
|
|
|
+ </if>
|
|
|
|
+ <if test="saleCurrentOrderAmount != null">
|
|
|
|
+ and
|
|
|
|
+ <foreach collection="saleCurrentOrderAmount" item="item" open="(" separator="or" close=")">
|
|
|
|
+ "saleCurrentOrderAmount" like '%${item}%'
|
|
|
|
+ </foreach>
|
|
|
|
+ </if>
|
|
|
|
+ <if test="saleHistoricalOrderAmout != null">
|
|
|
|
+ and
|
|
|
|
+ <foreach collection="saleHistoricalOrderAmout" item="item" open="(" separator="or" close=")">
|
|
|
|
+ "saleHistoricalOrderAmout" like '%${item}%'
|
|
|
|
+ </foreach>
|
|
|
|
+ </if>
|
|
|
|
+ <if test="saleOrderReceiveCustomer != null">
|
|
|
|
+ and
|
|
|
|
+ <foreach collection="saleOrderReceiveCustomer" item="item" open="(" separator="or" close=")">
|
|
|
|
+ "saleOrderReceiveCustomer" like '%${item}%'
|
|
|
|
+ </foreach>
|
|
|
|
+ </if>
|
|
|
|
+ <if test="saleUnitPrice != null">
|
|
|
|
+ and
|
|
|
|
+ <foreach collection="saleUnitPrice" item="item" open="(" separator="or" close=")">
|
|
|
|
+ "saleUnitPrice" like '%${item}%'
|
|
|
|
+ </foreach>
|
|
|
|
+ </if>
|
|
|
|
+ <if test="saleOrderTax != null">
|
|
|
|
+ and
|
|
|
|
+ <foreach collection="saleOrderTax" item="item" open="(" separator="or" close=")">
|
|
|
|
+ "saleOrderTax" like '%${item}%'
|
|
|
|
+ </foreach>
|
|
|
|
+ </if>
|
|
|
|
+ <if test="saleRemark != null">
|
|
|
|
+ and
|
|
|
|
+ <foreach collection="saleRemark" item="item" open="(" separator="or" close=")">
|
|
|
|
+ "saleRemark" like '%${item}%'
|
|
|
|
+ </foreach>
|
|
|
|
+ </if>
|
|
|
|
+ </where>
|
|
|
|
+ </select>
|
|
|
|
+
|
|
|
|
+ <select id="getAllSteelSaleOrderList" parameterType="java.util.Map" resultType="java.util.Map" >
|
|
|
|
+ select * from(
|
|
|
|
+ select a_s_order.SALE_ORDER_ID "saleOrderId",
|
|
|
|
+ a_s_order.SALE_NUMBER "saleNumber",
|
|
|
|
+ r_shipper.SHIPPER_NAME "shipperName",
|
|
|
|
+ r_consignee.CONSIGNEE_COMPANY_NAME "consigneeCompanyName",
|
|
|
|
+ r_consignee.CONSIGNEE_WARRANTY_AMOUNT "consigneeWarrantyAmount",
|
|
|
|
+ r_consignee.CONSIGNEE_WARRANTY_WEIGHT "consigneeWarrantyWeight",
|
|
|
|
+ a_s_order.SALE_ORDER_ISSELF_MENTION "saleOrderIsselfMention",
|
|
|
|
+ a_s_order.SALE_ACCOUNT_BALANCE "saleAccountBalance",
|
|
|
|
+ a_s_order.SALE_CURRENT_ORDER_AMOUNT "saleCurrentOrderAmount",
|
|
|
|
+ a_s_order.SALE_HISTORICAL_ORDER_AMOUNT "saleHistoricalOrderAmout",
|
|
|
|
+ a_s_order.SALE_ORDER_RECEIVE_CUSTOMER "saleOrderReceiveCustomer",
|
|
|
|
+ a_s_order.SALE_UNIT_PRICE "saleUnitPrice",
|
|
|
|
+ a_s_order.SALE_ORDER_TAX "saleOrderTax",
|
|
|
|
+ a_s_order.SALE_REMARK "saleRemark",
|
|
|
|
+ a_s_order.INSERT_TIME "insertTime",
|
|
|
|
+ DECODE(a_s_order.SALE_ORDER_STATUS || a_s_order.DELETED,00,'未上传',10,'已上传',20,'销售已提交',40,'财务已审批',21,'反审核',41,'反审核',22,'已关闭',42,'已关闭') "statusStr",
|
|
|
|
+ RM.MATERIAL_NAME "materialName",
|
|
|
|
+ RM.MATERIAL_SPECIFICATION "materialSpecification",
|
|
|
|
+ RM.MATERIAL_MODEL "materialModel",
|
|
|
|
+ RM.MATERIAL_NAME || RM.MATERIAL_SPECIFICATION || RM.MATERIAL_MODEL "nameSpecificationModel",
|
|
|
|
+ ASM.SALE_WAREHOUSE "saleWareHouse"
|
|
|
|
+ from AMS_SALE_ORDER a_s_order
|
|
|
|
+ left join RMS_SHIPPER r_shipper
|
|
|
|
+ on a_s_order.SHIPPER_ID=r_shipper.SHIPPER_ID
|
|
|
|
+ left join RMS_CONSIGNEE r_consignee
|
|
|
|
+ on a_s_order.RECEIVE_ID=r_consignee.CONSIGNEE_ID
|
|
|
|
+ LEFT JOIN AMS_SALE_MATERIAL ASM
|
|
|
|
+ ON ASM.SALE_ORDER_ID = a_s_order.SALE_ORDER_ID
|
|
|
|
+ LEFT JOIN RMS_MATERIAL RM
|
|
|
|
+ ON RM.MATERIAL_ID = ASM.MATERIAL_ID
|
|
|
|
+ where a_s_order.CLOSE_STATUS is null
|
|
|
|
+ and a_s_order.DELETED = 0
|
|
|
|
+ <if test="con != null">
|
|
|
|
+ and (instr(r_consignee.CONSIGNEE_COMPANY_NAME, #{con}) > 0 or instr(a_s_order.SALE_NUMBER, #{con}) > 0)
|
|
|
|
+ </if>
|
|
|
|
+ <if test="shipperId != null">
|
|
|
|
+ and a_s_order.SHIPPER_ID = #{shipperId}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="saleType != null">
|
|
|
|
+ and a_s_order.SALE_TYPE = #{saleType}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="saleType == null">
|
|
|
|
+ and a_s_order.SALE_TYPE is null
|
|
|
|
+ </if>
|
|
<if test="consigneeSsoId != null">
|
|
<if test="consigneeSsoId != null">
|
|
and r_consignee.CONSIGNEE_SSO_ID = #{consigneeSsoId}
|
|
and r_consignee.CONSIGNEE_SSO_ID = #{consigneeSsoId}
|
|
</if>
|
|
</if>
|