|
@@ -23,19 +23,21 @@
|
|
|
<result column="INSERT_UPDATE_REMARK" jdbcType="VARCHAR" property="insertUpdateRemark" />
|
|
|
<result column="DELETED" jdbcType="DECIMAL" property="deleted" />
|
|
|
<result column="CLOSE_STATUS" jdbcType="DECIMAL" property="closeStatus" />
|
|
|
+ <result column="SALER_ID" jdbcType="DECIMAL" property="salerId" />
|
|
|
</resultMap>
|
|
|
<sql id="columns">
|
|
|
- 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_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
|
|
|
+ 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_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,
|
|
|
+ SALER_ID
|
|
|
</sql>
|
|
|
<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_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_REMARK, t.INSERT_USERNAME, t.INSERT_TIME, t.UPDATE_USERNAME, t.UPDATE_TIME,
|
|
|
- t.INSERT_UPDATE_REMARK, t.DELETED, t.CLOSE_STATUS
|
|
|
+ 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_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.INSERT_UPDATE_REMARK, t.DELETED, t.CLOSE_STATUS, t.SALER_ID
|
|
|
</sql>
|
|
|
<sql id="select">
|
|
|
SELECT <include refid="columns" /> FROM AMS_SALE_ORDER
|
|
@@ -44,7 +46,7 @@
|
|
|
SELECT <include refid="columns_alias" /> FROM AMS_SALE_ORDER t
|
|
|
</sql>
|
|
|
<sql id="where">
|
|
|
- <where>
|
|
|
+ <where>
|
|
|
<if test="saleOrderId != null">
|
|
|
and SALE_ORDER_ID = #{saleOrderId}
|
|
|
</if>
|
|
@@ -108,10 +110,13 @@
|
|
|
<if test="closeStatus != null">
|
|
|
and CLOSE_STATUS = #{closeStatus}
|
|
|
</if>
|
|
|
+ <if test="salerId != null">
|
|
|
+ and SALER_ID = #{salerId}
|
|
|
+ </if>
|
|
|
</where>
|
|
|
</sql>
|
|
|
<sql id="whereLike">
|
|
|
- <where>
|
|
|
+ <where>
|
|
|
<if test="saleOrderId != null">
|
|
|
and SALE_ORDER_ID = #{saleOrderId}
|
|
|
</if>
|
|
@@ -175,95 +180,101 @@
|
|
|
<if test="closeStatus != null">
|
|
|
and CLOSE_STATUS = #{closeStatus}
|
|
|
</if>
|
|
|
+ <if test="salerId != null">
|
|
|
+ and SALER_ID = #{salerId}
|
|
|
+ </if>
|
|
|
</where>
|
|
|
</sql>
|
|
|
- <delete id="deleteByPrimaryKey" parameterType="java.math.BigDecimal">
|
|
|
+ <delete id="deleteByPrimaryKey" parameterType="DECIMAL">
|
|
|
delete from AMS_SALE_ORDER
|
|
|
where SALE_ORDER_ID = #{saleOrderId,jdbcType=DECIMAL}
|
|
|
</delete>
|
|
|
<delete id="deleteBySelectiveElement" parameterType="java.util.HashMap">
|
|
|
delete from AMS_SALE_ORDER
|
|
|
- where 1!=1
|
|
|
- <if test="planId != null">
|
|
|
- or PLAN_ID = #{planId}
|
|
|
- </if>
|
|
|
- <if test="saleNumber != null and saleNumber != ''">
|
|
|
- or SALE_NUMBER = #{saleNumber}
|
|
|
- </if>
|
|
|
- <if test="shipperId != null">
|
|
|
- or SHIPPER_ID = #{shipperId}
|
|
|
- </if>
|
|
|
- <if test="receiveId != null">
|
|
|
- or RECEIVE_ID = #{receiveId}
|
|
|
- </if>
|
|
|
- <if test="saleAccountBalance != null">
|
|
|
- or SALE_ACCOUNT_BALANCE = #{saleAccountBalance}
|
|
|
- </if>
|
|
|
- <if test="saleCurrentOrderAmount != null">
|
|
|
- or SALE_CURRENT_ORDER_AMOUNT = #{saleCurrentOrderAmount}
|
|
|
- </if>
|
|
|
- <if test="saleHistoricalOrderAmount != null">
|
|
|
- or SALE_HISTORICAL_ORDER_AMOUNT = #{saleHistoricalOrderAmount}
|
|
|
- </if>
|
|
|
- <if test="saleOrderStatus != null">
|
|
|
- or SALE_ORDER_STATUS = #{saleOrderStatus}
|
|
|
- </if>
|
|
|
- <if test="saleOrderReceiveCustomer != null and saleOrderReceiveCustomer != ''">
|
|
|
- or SALE_ORDER_RECEIVE_CUSTOMER = #{saleOrderReceiveCustomer}
|
|
|
- </if>
|
|
|
- <if test="saleOrderIsselfMention != null and saleOrderIsselfMention != ''">
|
|
|
- or SALE_ORDER_ISSELF_MENTION = #{saleOrderIsselfMention}
|
|
|
- </if>
|
|
|
- <if test="saleUnitPrice != null">
|
|
|
- or SALE_UNIT_PRICE = #{saleUnitPrice}
|
|
|
- </if>
|
|
|
- <if test="saleOrderTax != null and saleOrderTax != ''">
|
|
|
- or SALE_ORDER_TAX = #{saleOrderTax}
|
|
|
- </if>
|
|
|
- <if test="saleRemark != null and saleRemark != ''">
|
|
|
- or SALE_REMARK = #{saleRemark}
|
|
|
- </if>
|
|
|
- <if test="insertUsername != null and insertUsername != ''">
|
|
|
- or INSERT_USERNAME = #{insertUsername}
|
|
|
- </if>
|
|
|
- <if test="insertTime != null">
|
|
|
- or TO_CHAR(INSERT_TIME,'yyyy-MM-dd') = '#{insertTime}'
|
|
|
- </if>
|
|
|
- <if test="updateUsername != null and updateUsername != ''">
|
|
|
- or UPDATE_USERNAME = #{updateUsername}
|
|
|
- </if>
|
|
|
- <if test="updateTime != null">
|
|
|
- or TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = '#{updateTime}'
|
|
|
- </if>
|
|
|
- <if test="insertUpdateRemark != null and insertUpdateRemark != ''">
|
|
|
- or INSERT_UPDATE_REMARK = #{insertUpdateRemark}
|
|
|
- </if>
|
|
|
- <if test="deleted != null">
|
|
|
- or DELETED = #{deleted}
|
|
|
- </if>
|
|
|
- <if test="closeStatus != null">
|
|
|
- or CLOSE_STATUS = #{closeStatus}
|
|
|
- </if>
|
|
|
+ where 1!=1
|
|
|
+ <if test="planId != null">
|
|
|
+ or PLAN_ID = #{planId}
|
|
|
+ </if>
|
|
|
+ <if test="saleNumber != null and saleNumber != ''">
|
|
|
+ or SALE_NUMBER = #{saleNumber}
|
|
|
+ </if>
|
|
|
+ <if test="shipperId != null">
|
|
|
+ or SHIPPER_ID = #{shipperId}
|
|
|
+ </if>
|
|
|
+ <if test="receiveId != null">
|
|
|
+ or RECEIVE_ID = #{receiveId}
|
|
|
+ </if>
|
|
|
+ <if test="saleAccountBalance != null">
|
|
|
+ or SALE_ACCOUNT_BALANCE = #{saleAccountBalance}
|
|
|
+ </if>
|
|
|
+ <if test="saleCurrentOrderAmount != null">
|
|
|
+ or SALE_CURRENT_ORDER_AMOUNT = #{saleCurrentOrderAmount}
|
|
|
+ </if>
|
|
|
+ <if test="saleHistoricalOrderAmount != null">
|
|
|
+ or SALE_HISTORICAL_ORDER_AMOUNT = #{saleHistoricalOrderAmount}
|
|
|
+ </if>
|
|
|
+ <if test="saleOrderStatus != null">
|
|
|
+ or SALE_ORDER_STATUS = #{saleOrderStatus}
|
|
|
+ </if>
|
|
|
+ <if test="saleOrderReceiveCustomer != null and saleOrderReceiveCustomer != ''">
|
|
|
+ or SALE_ORDER_RECEIVE_CUSTOMER = #{saleOrderReceiveCustomer}
|
|
|
+ </if>
|
|
|
+ <if test="saleOrderIsselfMention != null and saleOrderIsselfMention != ''">
|
|
|
+ or SALE_ORDER_ISSELF_MENTION = #{saleOrderIsselfMention}
|
|
|
+ </if>
|
|
|
+ <if test="saleUnitPrice != null">
|
|
|
+ or SALE_UNIT_PRICE = #{saleUnitPrice}
|
|
|
+ </if>
|
|
|
+ <if test="saleOrderTax != null and saleOrderTax != ''">
|
|
|
+ or SALE_ORDER_TAX = #{saleOrderTax}
|
|
|
+ </if>
|
|
|
+ <if test="saleRemark != null and saleRemark != ''">
|
|
|
+ or SALE_REMARK = #{saleRemark}
|
|
|
+ </if>
|
|
|
+ <if test="insertUsername != null and insertUsername != ''">
|
|
|
+ or INSERT_USERNAME = #{insertUsername}
|
|
|
+ </if>
|
|
|
+ <if test="insertTime != null">
|
|
|
+ or TO_CHAR(INSERT_TIME,'yyyy-MM-dd') = '#{insertTime}'
|
|
|
+ </if>
|
|
|
+ <if test="updateUsername != null and updateUsername != ''">
|
|
|
+ or UPDATE_USERNAME = #{updateUsername}
|
|
|
+ </if>
|
|
|
+ <if test="updateTime != null">
|
|
|
+ or TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = '#{updateTime}'
|
|
|
+ </if>
|
|
|
+ <if test="insertUpdateRemark != null and insertUpdateRemark != ''">
|
|
|
+ or INSERT_UPDATE_REMARK = #{insertUpdateRemark}
|
|
|
+ </if>
|
|
|
+ <if test="deleted != null">
|
|
|
+ or DELETED = #{deleted}
|
|
|
+ </if>
|
|
|
+ <if test="closeStatus != null">
|
|
|
+ or CLOSE_STATUS = #{closeStatus}
|
|
|
+ </if>
|
|
|
+ <if test="salerId != null">
|
|
|
+ or SALER_ID = #{salerId}
|
|
|
+ </if>
|
|
|
</delete>
|
|
|
<insert id="insert" parameterType="com.steerinfo.dil.model.AmsSaleOrder">
|
|
|
- insert into AMS_SALE_ORDER (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_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
|
|
|
- )
|
|
|
- values (#{saleOrderId,jdbcType=DECIMAL}, #{planId,jdbcType=DECIMAL}, #{saleNumber,jdbcType=VARCHAR},
|
|
|
- #{shipperId,jdbcType=DECIMAL}, #{receiveId,jdbcType=DECIMAL}, #{saleAccountBalance,jdbcType=DECIMAL},
|
|
|
- #{saleCurrentOrderAmount,jdbcType=DECIMAL}, #{saleHistoricalOrderAmount,jdbcType=DECIMAL},
|
|
|
- #{saleOrderStatus,jdbcType=DECIMAL}, #{saleOrderReceiveCustomer,jdbcType=VARCHAR},
|
|
|
- #{saleOrderIsselfMention,jdbcType=VARCHAR}, #{saleUnitPrice,jdbcType=DECIMAL},
|
|
|
- #{saleOrderTax,jdbcType=VARCHAR}, #{saleRemark,jdbcType=VARCHAR}, #{insertUsername,jdbcType=VARCHAR},
|
|
|
- #{insertTime,jdbcType=TIMESTAMP}, #{updateUsername,jdbcType=VARCHAR}, #{updateTime,jdbcType=TIMESTAMP},
|
|
|
- #{insertUpdateRemark,jdbcType=VARCHAR}, #{deleted,jdbcType=DECIMAL}, #{closeStatus,jdbcType=DECIMAL}
|
|
|
- )
|
|
|
+ insert into AMS_SALE_ORDER (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_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,
|
|
|
+ SALER_ID)
|
|
|
+ values (#{saleOrderId,jdbcType=DECIMAL}, #{planId,jdbcType=DECIMAL}, #{saleNumber,jdbcType=VARCHAR},
|
|
|
+ #{shipperId,jdbcType=DECIMAL}, #{receiveId,jdbcType=DECIMAL}, #{saleAccountBalance,jdbcType=DECIMAL},
|
|
|
+ #{saleCurrentOrderAmount,jdbcType=DECIMAL}, #{saleHistoricalOrderAmount,jdbcType=DECIMAL},
|
|
|
+ #{saleOrderStatus,jdbcType=DECIMAL}, #{saleOrderReceiveCustomer,jdbcType=VARCHAR},
|
|
|
+ #{saleOrderIsselfMention,jdbcType=VARCHAR}, #{saleUnitPrice,jdbcType=DECIMAL},
|
|
|
+ #{saleOrderTax,jdbcType=VARCHAR}, #{saleRemark,jdbcType=VARCHAR}, #{insertUsername,jdbcType=VARCHAR},
|
|
|
+ #{insertTime,jdbcType=TIMESTAMP}, #{updateUsername,jdbcType=VARCHAR}, #{updateTime,jdbcType=TIMESTAMP},
|
|
|
+ #{insertUpdateRemark,jdbcType=VARCHAR}, #{deleted,jdbcType=DECIMAL}, #{closeStatus,jdbcType=DECIMAL},
|
|
|
+ #{salerId,jdbcType=DECIMAL})
|
|
|
</insert>
|
|
|
<insert id="insertSelective" parameterType="com.steerinfo.dil.model.AmsSaleOrder">
|
|
|
insert into AMS_SALE_ORDER
|
|
@@ -331,6 +342,9 @@
|
|
|
<if test="closeStatus != null">
|
|
|
CLOSE_STATUS,
|
|
|
</if>
|
|
|
+ <if test="salerId != null">
|
|
|
+ SALER_ID,
|
|
|
+ </if>
|
|
|
</trim>
|
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
<if test="saleOrderId != null">
|
|
@@ -396,30 +410,34 @@
|
|
|
<if test="closeStatus != null">
|
|
|
#{closeStatus,jdbcType=DECIMAL},
|
|
|
</if>
|
|
|
+ <if test="salerId != null">
|
|
|
+ #{salerId,jdbcType=DECIMAL},
|
|
|
+ </if>
|
|
|
</trim>
|
|
|
</insert>
|
|
|
<update id="updateByPrimaryKey" parameterType="com.steerinfo.dil.model.AmsSaleOrder">
|
|
|
update AMS_SALE_ORDER
|
|
|
set PLAN_ID = #{planId,jdbcType=DECIMAL},
|
|
|
- SALE_NUMBER = #{saleNumber,jdbcType=VARCHAR},
|
|
|
- SHIPPER_ID = #{shipperId,jdbcType=DECIMAL},
|
|
|
- RECEIVE_ID = #{receiveId,jdbcType=DECIMAL},
|
|
|
- SALE_ACCOUNT_BALANCE = #{saleAccountBalance,jdbcType=DECIMAL},
|
|
|
- SALE_CURRENT_ORDER_AMOUNT = #{saleCurrentOrderAmount,jdbcType=DECIMAL},
|
|
|
- SALE_HISTORICAL_ORDER_AMOUNT = #{saleHistoricalOrderAmount,jdbcType=DECIMAL},
|
|
|
- SALE_ORDER_STATUS = #{saleOrderStatus,jdbcType=DECIMAL},
|
|
|
- SALE_ORDER_RECEIVE_CUSTOMER = #{saleOrderReceiveCustomer,jdbcType=VARCHAR},
|
|
|
- SALE_ORDER_ISSELF_MENTION = #{saleOrderIsselfMention,jdbcType=VARCHAR},
|
|
|
- SALE_UNIT_PRICE = #{saleUnitPrice,jdbcType=DECIMAL},
|
|
|
- SALE_ORDER_TAX = #{saleOrderTax,jdbcType=VARCHAR},
|
|
|
- SALE_REMARK = #{saleRemark,jdbcType=VARCHAR},
|
|
|
- INSERT_USERNAME = #{insertUsername,jdbcType=VARCHAR},
|
|
|
- INSERT_TIME = #{insertTime,jdbcType=TIMESTAMP},
|
|
|
- UPDATE_USERNAME = #{updateUsername,jdbcType=VARCHAR},
|
|
|
- UPDATE_TIME = #{updateTime,jdbcType=TIMESTAMP},
|
|
|
- INSERT_UPDATE_REMARK = #{insertUpdateRemark,jdbcType=VARCHAR},
|
|
|
- DELETED = #{deleted,jdbcType=DECIMAL},
|
|
|
- CLOSE_STATUS = #{closeStatus,jdbcType=DECIMAL}
|
|
|
+ SALE_NUMBER = #{saleNumber,jdbcType=VARCHAR},
|
|
|
+ SHIPPER_ID = #{shipperId,jdbcType=DECIMAL},
|
|
|
+ RECEIVE_ID = #{receiveId,jdbcType=DECIMAL},
|
|
|
+ SALE_ACCOUNT_BALANCE = #{saleAccountBalance,jdbcType=DECIMAL},
|
|
|
+ SALE_CURRENT_ORDER_AMOUNT = #{saleCurrentOrderAmount,jdbcType=DECIMAL},
|
|
|
+ SALE_HISTORICAL_ORDER_AMOUNT = #{saleHistoricalOrderAmount,jdbcType=DECIMAL},
|
|
|
+ SALE_ORDER_STATUS = #{saleOrderStatus,jdbcType=DECIMAL},
|
|
|
+ SALE_ORDER_RECEIVE_CUSTOMER = #{saleOrderReceiveCustomer,jdbcType=VARCHAR},
|
|
|
+ SALE_ORDER_ISSELF_MENTION = #{saleOrderIsselfMention,jdbcType=VARCHAR},
|
|
|
+ SALE_UNIT_PRICE = #{saleUnitPrice,jdbcType=DECIMAL},
|
|
|
+ SALE_ORDER_TAX = #{saleOrderTax,jdbcType=VARCHAR},
|
|
|
+ SALE_REMARK = #{saleRemark,jdbcType=VARCHAR},
|
|
|
+ INSERT_USERNAME = #{insertUsername,jdbcType=VARCHAR},
|
|
|
+ INSERT_TIME = #{insertTime,jdbcType=TIMESTAMP},
|
|
|
+ UPDATE_USERNAME = #{updateUsername,jdbcType=VARCHAR},
|
|
|
+ UPDATE_TIME = #{updateTime,jdbcType=TIMESTAMP},
|
|
|
+ INSERT_UPDATE_REMARK = #{insertUpdateRemark,jdbcType=VARCHAR},
|
|
|
+ DELETED = #{deleted,jdbcType=DECIMAL},
|
|
|
+ CLOSE_STATUS = #{closeStatus,jdbcType=DECIMAL},
|
|
|
+ SALER_ID = #{salerId,jdbcType=DECIMAL}
|
|
|
where SALE_ORDER_ID = #{saleOrderId,jdbcType=DECIMAL}
|
|
|
</update>
|
|
|
<update id="updateByPrimaryKeySelective" parameterType="com.steerinfo.dil.model.AmsSaleOrder">
|
|
@@ -485,10 +503,13 @@
|
|
|
<if test="closeStatus != null">
|
|
|
CLOSE_STATUS = #{closeStatus,jdbcType=DECIMAL},
|
|
|
</if>
|
|
|
+ <if test="salerId != null">
|
|
|
+ SALER_ID = #{salerId,jdbcType=DECIMAL},
|
|
|
+ </if>
|
|
|
</set>
|
|
|
where SALE_ORDER_ID = #{saleOrderId,jdbcType=DECIMAL}
|
|
|
</update>
|
|
|
- <select id="selectByPrimaryKey" parameterType="java.math.BigDecimal" resultMap="BaseResultMap">
|
|
|
+ <select id="selectByPrimaryKey" parameterType="DECIMAL" resultMap="BaseResultMap">
|
|
|
<include refid="select" />
|
|
|
where SALE_ORDER_ID = #{saleOrderId,jdbcType=DECIMAL}
|
|
|
</select>
|
|
@@ -501,133 +522,138 @@
|
|
|
<include refid="whereLike" />
|
|
|
</select>
|
|
|
<insert id="batchInsert" parameterType="java.util.List">
|
|
|
- insert into AMS_SALE_ORDER
|
|
|
- (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_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)
|
|
|
- ( <foreach collection="list" item="item" separator="union all">
|
|
|
- select
|
|
|
- #{item.saleOrderId,jdbcType=DECIMAL},
|
|
|
- #{item.planId,jdbcType=DECIMAL}, #{item.saleNumber,jdbcType=VARCHAR}, #{item.shipperId,jdbcType=DECIMAL},
|
|
|
- #{item.receiveId,jdbcType=DECIMAL}, #{item.saleAccountBalance,jdbcType=DECIMAL},
|
|
|
- #{item.saleCurrentOrderAmount,jdbcType=DECIMAL}, #{item.saleHistoricalOrderAmount,jdbcType=DECIMAL},
|
|
|
- #{item.saleOrderStatus,jdbcType=DECIMAL}, #{item.saleOrderReceiveCustomer,jdbcType=VARCHAR},
|
|
|
- #{item.saleOrderIsselfMention,jdbcType=VARCHAR}, #{item.saleUnitPrice,jdbcType=DECIMAL},
|
|
|
- #{item.saleOrderTax,jdbcType=VARCHAR}, #{item.saleRemark,jdbcType=VARCHAR}, #{item.insertUsername,jdbcType=VARCHAR},
|
|
|
- #{item.insertTime,jdbcType=TIMESTAMP}, #{item.updateUsername,jdbcType=VARCHAR},
|
|
|
- #{item.updateTime,jdbcType=TIMESTAMP}, #{item.insertUpdateRemark,jdbcType=VARCHAR},
|
|
|
- #{item.deleted,jdbcType=DECIMAL}, #{item.closeStatus,jdbcType=DECIMAL} from dual
|
|
|
- </foreach> )
|
|
|
+ insert into AMS_SALE_ORDER
|
|
|
+ (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_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, SALER_ID
|
|
|
+ )
|
|
|
+ ( <foreach collection="list" item="item" separator="union all">
|
|
|
+ select
|
|
|
+ #{item.saleOrderId,jdbcType=DECIMAL},
|
|
|
+ #{item.planId,jdbcType=DECIMAL}, #{item.saleNumber,jdbcType=VARCHAR}, #{item.shipperId,jdbcType=DECIMAL},
|
|
|
+ #{item.receiveId,jdbcType=DECIMAL}, #{item.saleAccountBalance,jdbcType=DECIMAL},
|
|
|
+ #{item.saleCurrentOrderAmount,jdbcType=DECIMAL}, #{item.saleHistoricalOrderAmount,jdbcType=DECIMAL},
|
|
|
+ #{item.saleOrderStatus,jdbcType=DECIMAL}, #{item.saleOrderReceiveCustomer,jdbcType=VARCHAR},
|
|
|
+ #{item.saleOrderIsselfMention,jdbcType=VARCHAR}, #{item.saleUnitPrice,jdbcType=DECIMAL},
|
|
|
+ #{item.saleOrderTax,jdbcType=VARCHAR}, #{item.saleRemark,jdbcType=VARCHAR}, #{item.insertUsername,jdbcType=VARCHAR},
|
|
|
+ #{item.insertTime,jdbcType=TIMESTAMP}, #{item.updateUsername,jdbcType=VARCHAR},
|
|
|
+ #{item.updateTime,jdbcType=TIMESTAMP}, #{item.insertUpdateRemark,jdbcType=VARCHAR},
|
|
|
+ #{item.deleted,jdbcType=DECIMAL}, #{item.closeStatus,jdbcType=DECIMAL}, #{item.salerId,jdbcType=DECIMAL}
|
|
|
+ from dual
|
|
|
+ </foreach> )
|
|
|
</insert>
|
|
|
<update id="batchUpdate" parameterType="java.util.List">
|
|
|
- update AMS_SALE_ORDER
|
|
|
- set
|
|
|
- SALE_ORDER_ID=
|
|
|
- <foreach close="end" collection="list" index="index" item="item" open="case SALE_ORDER_ID" separator=" ">
|
|
|
- when #{item.saleOrderId,jdbcType=DECIMAL} then #{item.saleOrderId,jdbcType=DECIMAL}
|
|
|
- </foreach>
|
|
|
- ,PLAN_ID=
|
|
|
- <foreach close="end" collection="list" index="index" item="item" open="case SALE_ORDER_ID" separator=" ">
|
|
|
- when #{item.saleOrderId,jdbcType=DECIMAL} then #{item.planId,jdbcType=DECIMAL}
|
|
|
- </foreach>
|
|
|
- ,SALE_NUMBER=
|
|
|
- <foreach close="end" collection="list" index="index" item="item" open="case SALE_ORDER_ID" separator=" ">
|
|
|
- when #{item.saleOrderId,jdbcType=DECIMAL} then #{item.saleNumber,jdbcType=VARCHAR}
|
|
|
- </foreach>
|
|
|
- ,SHIPPER_ID=
|
|
|
- <foreach close="end" collection="list" index="index" item="item" open="case SALE_ORDER_ID" separator=" ">
|
|
|
- when #{item.saleOrderId,jdbcType=DECIMAL} then #{item.shipperId,jdbcType=DECIMAL}
|
|
|
- </foreach>
|
|
|
- ,RECEIVE_ID=
|
|
|
- <foreach close="end" collection="list" index="index" item="item" open="case SALE_ORDER_ID" separator=" ">
|
|
|
- when #{item.saleOrderId,jdbcType=DECIMAL} then #{item.receiveId,jdbcType=DECIMAL}
|
|
|
- </foreach>
|
|
|
- ,SALE_ACCOUNT_BALANCE=
|
|
|
- <foreach close="end" collection="list" index="index" item="item" open="case SALE_ORDER_ID" separator=" ">
|
|
|
- when #{item.saleOrderId,jdbcType=DECIMAL} then #{item.saleAccountBalance,jdbcType=DECIMAL}
|
|
|
- </foreach>
|
|
|
- ,SALE_CURRENT_ORDER_AMOUNT=
|
|
|
- <foreach close="end" collection="list" index="index" item="item" open="case SALE_ORDER_ID" separator=" ">
|
|
|
- when #{item.saleOrderId,jdbcType=DECIMAL} then #{item.saleCurrentOrderAmount,jdbcType=DECIMAL}
|
|
|
- </foreach>
|
|
|
- ,SALE_HISTORICAL_ORDER_AMOUNT=
|
|
|
- <foreach close="end" collection="list" index="index" item="item" open="case SALE_ORDER_ID" separator=" ">
|
|
|
- when #{item.saleOrderId,jdbcType=DECIMAL} then #{item.saleHistoricalOrderAmount,jdbcType=DECIMAL}
|
|
|
- </foreach>
|
|
|
- ,SALE_ORDER_STATUS=
|
|
|
- <foreach close="end" collection="list" index="index" item="item" open="case SALE_ORDER_ID" separator=" ">
|
|
|
- when #{item.saleOrderId,jdbcType=DECIMAL} then #{item.saleOrderStatus,jdbcType=DECIMAL}
|
|
|
- </foreach>
|
|
|
- ,SALE_ORDER_RECEIVE_CUSTOMER=
|
|
|
- <foreach close="end" collection="list" index="index" item="item" open="case SALE_ORDER_ID" separator=" ">
|
|
|
- when #{item.saleOrderId,jdbcType=DECIMAL} then #{item.saleOrderReceiveCustomer,jdbcType=VARCHAR}
|
|
|
- </foreach>
|
|
|
- ,SALE_ORDER_ISSELF_MENTION=
|
|
|
- <foreach close="end" collection="list" index="index" item="item" open="case SALE_ORDER_ID" separator=" ">
|
|
|
- when #{item.saleOrderId,jdbcType=DECIMAL} then #{item.saleOrderIsselfMention,jdbcType=VARCHAR}
|
|
|
- </foreach>
|
|
|
- ,SALE_UNIT_PRICE=
|
|
|
- <foreach close="end" collection="list" index="index" item="item" open="case SALE_ORDER_ID" separator=" ">
|
|
|
- when #{item.saleOrderId,jdbcType=DECIMAL} then #{item.saleUnitPrice,jdbcType=DECIMAL}
|
|
|
- </foreach>
|
|
|
- ,SALE_ORDER_TAX=
|
|
|
- <foreach close="end" collection="list" index="index" item="item" open="case SALE_ORDER_ID" separator=" ">
|
|
|
- when #{item.saleOrderId,jdbcType=DECIMAL} then #{item.saleOrderTax,jdbcType=VARCHAR}
|
|
|
- </foreach>
|
|
|
- ,SALE_REMARK=
|
|
|
- <foreach close="end" collection="list" index="index" item="item" open="case SALE_ORDER_ID" separator=" ">
|
|
|
- when #{item.saleOrderId,jdbcType=DECIMAL} then #{item.saleRemark,jdbcType=VARCHAR}
|
|
|
- </foreach>
|
|
|
- ,INSERT_USERNAME=
|
|
|
- <foreach close="end" collection="list" index="index" item="item" open="case SALE_ORDER_ID" separator=" ">
|
|
|
- when #{item.saleOrderId,jdbcType=DECIMAL} then #{item.insertUsername,jdbcType=VARCHAR}
|
|
|
- </foreach>
|
|
|
- ,INSERT_TIME=
|
|
|
- <foreach close="end" collection="list" index="index" item="item" open="case SALE_ORDER_ID" separator=" ">
|
|
|
- when #{item.saleOrderId,jdbcType=DECIMAL} then #{item.insertTime,jdbcType=TIMESTAMP}
|
|
|
- </foreach>
|
|
|
- ,UPDATE_USERNAME=
|
|
|
- <foreach close="end" collection="list" index="index" item="item" open="case SALE_ORDER_ID" separator=" ">
|
|
|
- when #{item.saleOrderId,jdbcType=DECIMAL} then #{item.updateUsername,jdbcType=VARCHAR}
|
|
|
- </foreach>
|
|
|
- ,UPDATE_TIME=
|
|
|
- <foreach close="end" collection="list" index="index" item="item" open="case SALE_ORDER_ID" separator=" ">
|
|
|
- when #{item.saleOrderId,jdbcType=DECIMAL} then #{item.updateTime,jdbcType=TIMESTAMP}
|
|
|
- </foreach>
|
|
|
- ,INSERT_UPDATE_REMARK=
|
|
|
- <foreach close="end" collection="list" index="index" item="item" open="case SALE_ORDER_ID" separator=" ">
|
|
|
- when #{item.saleOrderId,jdbcType=DECIMAL} then #{item.insertUpdateRemark,jdbcType=VARCHAR}
|
|
|
- </foreach>
|
|
|
- ,DELETED=
|
|
|
- <foreach close="end" collection="list" index="index" item="item" open="case SALE_ORDER_ID" separator=" ">
|
|
|
- when #{item.saleOrderId,jdbcType=DECIMAL} then #{item.deleted,jdbcType=DECIMAL}
|
|
|
- </foreach>
|
|
|
- ,CLOSE_STATUS=
|
|
|
- <foreach close="end" collection="list" index="index" item="item" open="case SALE_ORDER_ID" separator=" ">
|
|
|
- when #{item.saleOrderId,jdbcType=DECIMAL} then #{item.closeStatus,jdbcType=DECIMAL}
|
|
|
- </foreach>
|
|
|
- where SALE_ORDER_ID in
|
|
|
- <foreach close=")" collection="list" index="index" item="item" open="(" separator=",">
|
|
|
- #{item.saleOrderId,jdbcType=DECIMAL}
|
|
|
- </foreach>
|
|
|
+ update AMS_SALE_ORDER
|
|
|
+ set
|
|
|
+ SALE_ORDER_ID=
|
|
|
+ <foreach close="end" collection="list" index="index" item="item" open="case SALE_ORDER_ID" separator=" ">
|
|
|
+ when #{item.saleOrderId,jdbcType=DECIMAL} then #{item.saleOrderId,jdbcType=DECIMAL}
|
|
|
+ </foreach>
|
|
|
+ ,PLAN_ID=
|
|
|
+ <foreach close="end" collection="list" index="index" item="item" open="case SALE_ORDER_ID" separator=" ">
|
|
|
+ when #{item.saleOrderId,jdbcType=DECIMAL} then #{item.planId,jdbcType=DECIMAL}
|
|
|
+ </foreach>
|
|
|
+ ,SALE_NUMBER=
|
|
|
+ <foreach close="end" collection="list" index="index" item="item" open="case SALE_ORDER_ID" separator=" ">
|
|
|
+ when #{item.saleOrderId,jdbcType=DECIMAL} then #{item.saleNumber,jdbcType=VARCHAR}
|
|
|
+ </foreach>
|
|
|
+ ,SHIPPER_ID=
|
|
|
+ <foreach close="end" collection="list" index="index" item="item" open="case SALE_ORDER_ID" separator=" ">
|
|
|
+ when #{item.saleOrderId,jdbcType=DECIMAL} then #{item.shipperId,jdbcType=DECIMAL}
|
|
|
+ </foreach>
|
|
|
+ ,RECEIVE_ID=
|
|
|
+ <foreach close="end" collection="list" index="index" item="item" open="case SALE_ORDER_ID" separator=" ">
|
|
|
+ when #{item.saleOrderId,jdbcType=DECIMAL} then #{item.receiveId,jdbcType=DECIMAL}
|
|
|
+ </foreach>
|
|
|
+ ,SALE_ACCOUNT_BALANCE=
|
|
|
+ <foreach close="end" collection="list" index="index" item="item" open="case SALE_ORDER_ID" separator=" ">
|
|
|
+ when #{item.saleOrderId,jdbcType=DECIMAL} then #{item.saleAccountBalance,jdbcType=DECIMAL}
|
|
|
+ </foreach>
|
|
|
+ ,SALE_CURRENT_ORDER_AMOUNT=
|
|
|
+ <foreach close="end" collection="list" index="index" item="item" open="case SALE_ORDER_ID" separator=" ">
|
|
|
+ when #{item.saleOrderId,jdbcType=DECIMAL} then #{item.saleCurrentOrderAmount,jdbcType=DECIMAL}
|
|
|
+ </foreach>
|
|
|
+ ,SALE_HISTORICAL_ORDER_AMOUNT=
|
|
|
+ <foreach close="end" collection="list" index="index" item="item" open="case SALE_ORDER_ID" separator=" ">
|
|
|
+ when #{item.saleOrderId,jdbcType=DECIMAL} then #{item.saleHistoricalOrderAmount,jdbcType=DECIMAL}
|
|
|
+ </foreach>
|
|
|
+ ,SALE_ORDER_STATUS=
|
|
|
+ <foreach close="end" collection="list" index="index" item="item" open="case SALE_ORDER_ID" separator=" ">
|
|
|
+ when #{item.saleOrderId,jdbcType=DECIMAL} then #{item.saleOrderStatus,jdbcType=DECIMAL}
|
|
|
+ </foreach>
|
|
|
+ ,SALE_ORDER_RECEIVE_CUSTOMER=
|
|
|
+ <foreach close="end" collection="list" index="index" item="item" open="case SALE_ORDER_ID" separator=" ">
|
|
|
+ when #{item.saleOrderId,jdbcType=DECIMAL} then #{item.saleOrderReceiveCustomer,jdbcType=VARCHAR}
|
|
|
+ </foreach>
|
|
|
+ ,SALE_ORDER_ISSELF_MENTION=
|
|
|
+ <foreach close="end" collection="list" index="index" item="item" open="case SALE_ORDER_ID" separator=" ">
|
|
|
+ when #{item.saleOrderId,jdbcType=DECIMAL} then #{item.saleOrderIsselfMention,jdbcType=VARCHAR}
|
|
|
+ </foreach>
|
|
|
+ ,SALE_UNIT_PRICE=
|
|
|
+ <foreach close="end" collection="list" index="index" item="item" open="case SALE_ORDER_ID" separator=" ">
|
|
|
+ when #{item.saleOrderId,jdbcType=DECIMAL} then #{item.saleUnitPrice,jdbcType=DECIMAL}
|
|
|
+ </foreach>
|
|
|
+ ,SALE_ORDER_TAX=
|
|
|
+ <foreach close="end" collection="list" index="index" item="item" open="case SALE_ORDER_ID" separator=" ">
|
|
|
+ when #{item.saleOrderId,jdbcType=DECIMAL} then #{item.saleOrderTax,jdbcType=VARCHAR}
|
|
|
+ </foreach>
|
|
|
+ ,SALE_REMARK=
|
|
|
+ <foreach close="end" collection="list" index="index" item="item" open="case SALE_ORDER_ID" separator=" ">
|
|
|
+ when #{item.saleOrderId,jdbcType=DECIMAL} then #{item.saleRemark,jdbcType=VARCHAR}
|
|
|
+ </foreach>
|
|
|
+ ,INSERT_USERNAME=
|
|
|
+ <foreach close="end" collection="list" index="index" item="item" open="case SALE_ORDER_ID" separator=" ">
|
|
|
+ when #{item.saleOrderId,jdbcType=DECIMAL} then #{item.insertUsername,jdbcType=VARCHAR}
|
|
|
+ </foreach>
|
|
|
+ ,INSERT_TIME=
|
|
|
+ <foreach close="end" collection="list" index="index" item="item" open="case SALE_ORDER_ID" separator=" ">
|
|
|
+ when #{item.saleOrderId,jdbcType=DECIMAL} then #{item.insertTime,jdbcType=TIMESTAMP}
|
|
|
+ </foreach>
|
|
|
+ ,UPDATE_USERNAME=
|
|
|
+ <foreach close="end" collection="list" index="index" item="item" open="case SALE_ORDER_ID" separator=" ">
|
|
|
+ when #{item.saleOrderId,jdbcType=DECIMAL} then #{item.updateUsername,jdbcType=VARCHAR}
|
|
|
+ </foreach>
|
|
|
+ ,UPDATE_TIME=
|
|
|
+ <foreach close="end" collection="list" index="index" item="item" open="case SALE_ORDER_ID" separator=" ">
|
|
|
+ when #{item.saleOrderId,jdbcType=DECIMAL} then #{item.updateTime,jdbcType=TIMESTAMP}
|
|
|
+ </foreach>
|
|
|
+ ,INSERT_UPDATE_REMARK=
|
|
|
+ <foreach close="end" collection="list" index="index" item="item" open="case SALE_ORDER_ID" separator=" ">
|
|
|
+ when #{item.saleOrderId,jdbcType=DECIMAL} then #{item.insertUpdateRemark,jdbcType=VARCHAR}
|
|
|
+ </foreach>
|
|
|
+ ,DELETED=
|
|
|
+ <foreach close="end" collection="list" index="index" item="item" open="case SALE_ORDER_ID" separator=" ">
|
|
|
+ when #{item.saleOrderId,jdbcType=DECIMAL} then #{item.deleted,jdbcType=DECIMAL}
|
|
|
+ </foreach>
|
|
|
+ ,CLOSE_STATUS=
|
|
|
+ <foreach close="end" collection="list" index="index" item="item" open="case SALE_ORDER_ID" separator=" ">
|
|
|
+ when #{item.saleOrderId,jdbcType=DECIMAL} then #{item.closeStatus,jdbcType=DECIMAL}
|
|
|
+ </foreach>
|
|
|
+ ,SALER_ID=
|
|
|
+ <foreach close="end" collection="list" index="index" item="item" open="case SALE_ORDER_ID" separator=" ">
|
|
|
+ when #{item.saleOrderId,jdbcType=DECIMAL} then #{item.salerId,jdbcType=DECIMAL}
|
|
|
+ </foreach>
|
|
|
+ where SALE_ORDER_ID in
|
|
|
+ <foreach close=")" collection="list" index="index" item="item" open="(" separator=",">
|
|
|
+ #{item.saleOrderId,jdbcType=DECIMAL}
|
|
|
+ </foreach>
|
|
|
</update>
|
|
|
<delete id="batchDelete" parameterType="java.util.List">
|
|
|
delete from AMS_SALE_ORDER
|
|
|
- where SALE_ORDER_ID in
|
|
|
+ where SALE_ORDER_ID in
|
|
|
<foreach close=")" collection="list" item="id" open="(" separator=",">
|
|
|
#{id}
|
|
|
</foreach>
|
|
|
</delete>
|
|
|
<!-- 友情提示!!!-->
|
|
|
<!-- 请将自己写的代码放在此标签之下,方便以后粘贴复制。-->
|
|
|
- <!--根据插入时间排序-->
|
|
|
<sql id="orderBy">
|
|
|
<if test="orderField != null and orderField != ''">
|
|
|
order by "${orderField}"
|
|
@@ -1546,7 +1572,8 @@
|
|
|
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
|
|
|
- where a_s_order.SALE_ORDER_STATUS=1)
|
|
|
+ where a_s_order.SALE_ORDER_STATUS=1
|
|
|
+ and a_s_order.DELETED = 0)
|
|
|
<where>
|
|
|
<if test="saleNumber != null">
|
|
|
and
|
|
@@ -1636,8 +1663,7 @@
|
|
|
a_s_order.SALE_ORDER_TAX "saleOrderTax",
|
|
|
a_s_order.SALE_REMARK "saleRemark",
|
|
|
a_s_order.INSERT_TIME "insertTime",
|
|
|
- a_s_order.SALE_ORDER_STATUS "saleOrderStatus",
|
|
|
- a_s_order.SALE_ORDER_STATUS "statusStr",
|
|
|
+ DECODE(a_s_order.SALE_ORDER_STATUS,2,'销售已审批',4,'财务已审批') "statusStr",
|
|
|
RM.MATERIAL_NAME "materialName",
|
|
|
a_s_order.CLOSE_STATUS "closeStatus"
|
|
|
from AMS_SALE_ORDER a_s_order
|
|
@@ -1658,86 +1684,98 @@
|
|
|
<if test="con != null" >
|
|
|
or SSSR."saleNumber" LIKE #{con}
|
|
|
</if>
|
|
|
- <!-- <where>-->
|
|
|
- <!-- <if test="saleNumber != null">-->
|
|
|
- <!-- and-->
|
|
|
- <!-- <foreach collection="saleNumber" item="item" open="(" separator="or" close=")">-->
|
|
|
- <!-- "saleNumber" like '%${item}%'-->
|
|
|
- <!-- </foreach>-->
|
|
|
- <!-- </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>-->
|
|
|
+ <where>
|
|
|
+ <if test="saleNumber != null">
|
|
|
+ and
|
|
|
+ <foreach collection="saleNumber" item="item" open="(" separator="or" close=")">
|
|
|
+ "saleNumber" like '%${item}%'
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ <if test="materialName != null">
|
|
|
+ and
|
|
|
+ <foreach collection="materialName" item="item" open="(" separator="or" close=")">
|
|
|
+ "materialName" like '%${item}%'
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ <if test="statusStr != null">
|
|
|
+ and
|
|
|
+ <foreach collection="statusStr" item="item" open="(" separator="or" close=")">
|
|
|
+ "statusStr" like '%${item}%'
|
|
|
+ </foreach>
|
|
|
+ </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>
|
|
|
<include refid="orderBy"></include>
|
|
|
</select>
|
|
|
|
|
@@ -1758,8 +1796,7 @@
|
|
|
a_s_order.SALE_ORDER_TAX "saleOrderTax",
|
|
|
a_s_order.SALE_REMARK "saleRemark",
|
|
|
a_s_order.INSERT_TIME "insertTime",
|
|
|
- a_s_order.SALE_ORDER_STATUS "saleOrderStatus",
|
|
|
- a_s_order.SALE_ORDER_STATUS "statusStr",
|
|
|
+ DECODE(a_s_order.SALE_ORDER_STATUS,2,'销售已审批',4,'财务已审批') "statusStr",
|
|
|
a_s_order.INSERT_UPDATE_REMARK "materialName"
|
|
|
from AMS_SALE_ORDER a_s_order
|
|
|
left join RMS_SHIPPER r_shipper
|
|
@@ -1772,6 +1809,9 @@
|
|
|
<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>
|
|
|
)
|
|
|
<where>
|
|
|
<if test="saleNumber != null">
|
|
@@ -1779,6 +1819,19 @@
|
|
|
"saleNumber" 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=")">
|
|
@@ -1868,6 +1921,7 @@
|
|
|
a_s_order.SALE_CURRENT_ORDER_AMOUNT "saleCurrentOrderAmount",
|
|
|
a_s_order.SALE_HISTORICAL_ORDER_AMOUNT "saleHistoricalOrderAmout",
|
|
|
a_s_order.SALE_ORDER_RECEIVE_CUSTOMER "saleOrderReceiveCustomer",
|
|
|
+ DECODE(a_s_order.SALE_ORDER_STATUS,2,'销售已审批',4,'财务已审批') "statusStr",
|
|
|
a_s_order.SALE_UNIT_PRICE "saleUnitPrice",
|
|
|
a_s_order.SALE_ORDER_TAX "saleOrderTax",
|
|
|
a_s_order.SALE_REMARK "saleRemark",
|
|
@@ -1877,11 +1931,12 @@
|
|
|
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
|
|
|
- where a_s_order.SALE_ORDER_STATUS=4
|
|
|
+ where a_s_order.SALE_ORDER_STATUS in (2,4)
|
|
|
+ AND a_s_order.SHIPPER_ID = 2
|
|
|
<if test="con != null">
|
|
|
and instr(r_consignee.CONSIGNEE_COMPANY_NAME, #{con}) > 0
|
|
|
</if>
|
|
|
- )
|
|
|
+ )
|
|
|
<where>
|
|
|
<if test="saleNumber != null">
|
|
|
and
|
|
@@ -1889,6 +1944,12 @@
|
|
|
"saleNumber" like '%${item}%'
|
|
|
</foreach>
|
|
|
</if>
|
|
|
+ <if test="statusStr != null">
|
|
|
+ and
|
|
|
+ <foreach collection="statusStr" item="item" open="(" separator="or" close=")">
|
|
|
+ "statusStr" like '%${item}%'
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
<if test="shipperName != null">
|
|
|
and
|
|
|
<foreach collection="shipperName" item="item" open="(" separator="or" close=")">
|
|
@@ -2032,15 +2093,23 @@
|
|
|
</select>
|
|
|
|
|
|
<select id="getSaleMaterial" parameterType="java.util.Map" resultType="java.util.Map">
|
|
|
- SELECT
|
|
|
+ SELECT * FROM (SELECT
|
|
|
RM.MATERIAL_NAME AS "materialName"
|
|
|
FROM AMS_SALE_MATERIAL ASM
|
|
|
LEFT JOIN RMS_MATERIAL RM
|
|
|
ON RM.MATERIAL_ID = ASM.MATERIAL_ID
|
|
|
WHERE ASM.SALE_ORDER_ID = #{saleOrderId}
|
|
|
- <if test="con != null" >
|
|
|
+ <if test="con != null">
|
|
|
AND instr(RM.MATERIAL_NAME, #{con}) > 0
|
|
|
</if>
|
|
|
+ )
|
|
|
+ <where>
|
|
|
+ <if test="materialName != null">
|
|
|
+ <foreach collection="materialName" item="item" open="(" separator="or" close=")">
|
|
|
+ "materialName" like '%${item}%'
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
</select>
|
|
|
|
|
|
<select id="getNetWeight" parameterType="DECIMAL" resultType="DECIMAL">
|
|
@@ -2057,4 +2126,560 @@
|
|
|
FROM AMS_SALE_ORDER_MATERIAL ASOM
|
|
|
WHERE ASOM.SALE_ORDER_ID = #{saleOrderId}
|
|
|
</select>
|
|
|
+
|
|
|
+ <select id="getTruckNoAndMaterial" parameterType="DECIMAL" resultType="java.util.Map" >
|
|
|
+ SELECT DISTINCT ASOM.SALE_ORDER_MATERIAL_TRUCK_NO AS "truckNo",
|
|
|
+ RM.MATERIAL_NAME AS "materialName",
|
|
|
+ ASM.MATERIAL_ID AS "materialId",
|
|
|
+ ASTM.SALE_ORDER_MATERIAL_NUMBER AS "materialNumber",
|
|
|
+ ASOM.SALE_DATE_OF_RECEIPT AS "receiptDate",
|
|
|
+ RM.MATERIAL_SPECIFICATION || RM.MATERIAL_MODEL AS "materialModelSpecification",
|
|
|
+ RM.MATERIAL_CODE AS "materialCode",
|
|
|
+ RRA.ADDRESS_PROVINCE || RRA.ADDRESS_DISTRICT || RRA.ADDRESS_TOWN || RRP.ADDRESS_DELIVERY_ADDRESS AS "place",
|
|
|
+ ASOM.SALE_DATE_OF_RECEIPT AS "receiptDate",
|
|
|
+ ASOM.SALE_ORDER_CONSIGNEE_TEL AS "saleOrderConsigneeTel",
|
|
|
+ ASOM.SALE_ORDER_CONSIGNEE AS "saleOrderConsignee",
|
|
|
+ ASOM.SALE_ORDER_MATERIAL_ID AS "saleOrderMaterialId",
|
|
|
+ ASOM.SALE_SHIPPING_ADDRESS_ID AS "placeId",
|
|
|
+ RC.CAPACITY_NUMBER AS "capacityNumber",
|
|
|
+ ADSO.CARRIER_ID AS "carrierId"
|
|
|
+ FROM AMS_SALE_TRUCKNO_MATERIAL ASTM
|
|
|
+ LEFT JOIN AMS_SALE_ORDER_MATERIAL ASOM
|
|
|
+ ON ASOM.SALE_ORDER_MATERIAL_ID = ASTM.SALE_ORDER_MATERIAL_ID
|
|
|
+ LEFT JOIN RMS_RECEIVE_PLACE RRP
|
|
|
+ ON RRP.PLACE_ID = ASOM.SALE_SHIPPING_ADDRESS_ID
|
|
|
+ LEFT JOIN RMS_RECEIVE_ADDRESS RRA
|
|
|
+ ON RRA.ADDRESS_ID = RRP.ADDRESS_ID
|
|
|
+ LEFT JOIN AMS_SALE_MATERIAL ASM
|
|
|
+ ON ASTM.MATERIAL_ID = ASM.SALE_MATERIAL_ID
|
|
|
+ LEFT JOIN RMS_MATERIAL RM
|
|
|
+ ON RM.MATERIAL_ID = ASM.MATERIAL_ID
|
|
|
+ LEFT JOIN OMSTRUCK_ORDER OO
|
|
|
+ ON OO.ORDER_PLAN_ID = ASOM.SALE_ORDER_MATERIAL_ID
|
|
|
+ LEFT JOIN RMS_CAPACITY RC
|
|
|
+ ON RC.CAPACITY_ID = OO.CAPACITY_ID
|
|
|
+ LEFT JOIN AMS_DISPATCH_SALE_ORDER ADSO
|
|
|
+ ON ADSO.SALE_ORDER_MATERIAL_ID = ASOM.SALE_ORDER_MATERIAL_ID
|
|
|
+ WHERE ASOM.SALE_ORDER_ID = #{saleOrderId}
|
|
|
+ AND OO.ORDER_ID IS NULL
|
|
|
+ ORDER BY ASOM.SALE_ORDER_MATERIAL_TRUCK_NO ASC
|
|
|
+ </select>
|
|
|
+
|
|
|
+
|
|
|
+ <select id="getAddressByPlace" parameterType="DECIMAL" resultType="DECIMAL" >
|
|
|
+ SELECT RRP.ADDRESS_ID AS "adddressId"
|
|
|
+ FROM RMS_RECEIVE_PLACE RRP
|
|
|
+ WHERE RRP.PLACE_ID = #{placeId}
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="getCarrierByPlace" parameterType="DECIMAL" resultType="java.util.Map">
|
|
|
+ SELECT DISTINCT RC.CARRIER_ID AS "id",
|
|
|
+ RC.CARRIER_ID AS "value",
|
|
|
+ RC.CARRIER_NAME AS "label",
|
|
|
+ ACTP.PRICE_ID AS "priceId",
|
|
|
+ ACTP.PRICE_VALUE AS "priceValue"
|
|
|
+ FROM RMS_RECEIVE_PLACE RRP
|
|
|
+ LEFT JOIN AMS_CONTRACT_TRANSPORT_PRICE ACTP
|
|
|
+ ON ACTP.PLACE_ID = RRP.PLACE_ID
|
|
|
+ LEFT JOIN RMS_CARRIER RC
|
|
|
+ ON RC.CARRIER_ID = ACTP.CARRIER_ID
|
|
|
+ WHERE RRP.ADDRESS_ID = #{addressId}
|
|
|
+ AND ACTP.CARRIER_ID IS NOT NULL
|
|
|
+ AND ACTP.DELETED = 0
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="getPriceByCarrierAndPlace" parameterType="java.util.Map" resultType="java.util.Map">
|
|
|
+ SELECT ACTP.PRICE_ID AS "priceId",
|
|
|
+ ACTP.PRICE_VALUE AS "priceValue"
|
|
|
+ FROM AMS_CONTRACT_TRANSPORT_PRICE ACTP
|
|
|
+ WHERE ACTP.CARRIER_ID = #{carrierId}
|
|
|
+ AND ACTP.PLACE_ID = #{placeId}
|
|
|
+ AND ACTP.DELETED = 0
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="getSaleOrderListToCarrier" parameterType="java.util.Map" resultType="java.util.Map">
|
|
|
+ select DISTINCT * 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,2,'销售已审批',4,'财务已审批') "statusStr",
|
|
|
+ a_s_order.INSERT_UPDATE_REMARK "materialName",
|
|
|
+ a_s_order.UPDATE_TIME "updateTime"
|
|
|
+ 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_ORDER_MATERIAL ASOM
|
|
|
+ ON ASOM.SALE_ORDER_ID = a_s_order.SALE_ORDER_ID
|
|
|
+ LEFT JOIN AMS_DISPATCH_SALE_ORDER ADSO
|
|
|
+ ON ADSO.SALE_ORDER_MATERIAL_ID = ASOM.SALE_ORDER_MATERIAL_ID
|
|
|
+ LEFT JOIN RMS_CARRIER RC
|
|
|
+ ON RC.CARRIER_ID = ADSO.CARRIER_ID
|
|
|
+ LEFT JOIN OMSTRUCK_ORDER OO
|
|
|
+ ON OO.ORDER_PLAN_ID = ASOM.SALE_ORDER_MATERIAL_ID
|
|
|
+ where a_s_order.SALE_ORDER_STATUS in (2,4)
|
|
|
+ and a_s_order.CLOSE_STATUS is null
|
|
|
+ and a_s_order.DELETED = 0
|
|
|
+ and ADSO.DISPATCH_TYPE = 2
|
|
|
+ and OO.ORDER_ID IS NULL
|
|
|
+ <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="carrierSsoId != null" >
|
|
|
+ and RC.CARRIER_SSO_ID = #{carrierSsoId}
|
|
|
+ </if>
|
|
|
+ )
|
|
|
+ <where>
|
|
|
+ <if test="saleNumber != null">
|
|
|
+ <foreach collection="saleNumber" item="item" open="(" separator="or" close=")">
|
|
|
+ "saleNumber" like '%${item}%'
|
|
|
+ </foreach>
|
|
|
+ </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>
|
|
|
+ order by "updateTime" DESC
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="getSteelTruckNoList" parameterType="java.util.Map" resultType="java.util.Map">
|
|
|
+ SELECT *
|
|
|
+ FROM (
|
|
|
+ SELECT ASO.SALE_NUMBER AS "saleNumber",
|
|
|
+ ASOM.SALE_ORDER_MATERIAL_TRUCK_NO AS "truckNo",
|
|
|
+ RRA.ADDRESS_PROVINCE || RRA.ADDRESS_DISTRICT || RRA.ADDRESS_TOWN || RRP.ADDRESS_DELIVERY_ADDRESS AS
|
|
|
+ "addressDeliveryAddress",
|
|
|
+ ASOM.SALE_DATE_OF_RECEIPT AS "saleDateOfReceipt",
|
|
|
+ DECODE(ASO.SALE_ORDER_STATUS,2, '销售已审批',4, '财务已审批')
|
|
|
+ AS "approvalStatus",
|
|
|
+ ASOM.SALE_ORDER_CONSIGNEE_TEL AS "saleOrderConsigneeTel",
|
|
|
+ RSH.SHIPPER_NAME AS "shipperName",
|
|
|
+ RCO.CONSIGNEE_COMPANY_NAME AS "consigneeCompanyName",
|
|
|
+ ASO.SALE_ORDER_ISSELF_MENTION AS "isselfMention",
|
|
|
+ ASOM.INSERT_TIME AS "insertTime",
|
|
|
+ ASOM.SALE_ORDER_MATERIAL_ID AS "saleOrderMaterialId",
|
|
|
+ ASO.SALE_ORDER_ID AS "saleOrderId"
|
|
|
+ FROM AMS_SALE_ORDER_MATERIAL ASOM
|
|
|
+ LEFT JOIN AMS_SALE_ORDER ASO
|
|
|
+ ON ASO.SALE_ORDER_ID = ASOM.SALE_ORDER_ID
|
|
|
+ LEFT JOIN RMS_RECEIVE_PLACE RRP
|
|
|
+ ON RRP.PLACE_ID = ASOM.SALE_SHIPPING_ADDRESS_ID
|
|
|
+ LEFT JOIN RMS_RECEIVE_ADDRESS RRA
|
|
|
+ ON RRA.ADDRESS_ID = RRP.ADDRESS_ID
|
|
|
+ LEFT JOIN RMS_SHIPPER RSH
|
|
|
+ ON RSH.SHIPPER_ID = ASO.SHIPPER_ID
|
|
|
+ LEFT JOIN RMS_CONSIGNEE RCO
|
|
|
+ ON RCO.CONSIGNEE_ID = ASO.RECEIVE_ID
|
|
|
+ LEFT JOIN AMS_DISPATCH_SALE_ORDER ADSO
|
|
|
+ ON ADSO.SALE_ORDER_MATERIAL_ID = ASOM.SALE_ORDER_MATERIAL_ID
|
|
|
+ WHERE ASO.SALE_ORDER_STATUS IN (2,4)
|
|
|
+ AND ASOM.ISSUE_STATUS IS NULL
|
|
|
+ AND ADSO.CARRIER_ID IS NULL
|
|
|
+ )
|
|
|
+ <where>
|
|
|
+ <if test="saleNumber != null">
|
|
|
+ and
|
|
|
+ <foreach collection="saleNumber" item="item" open="(" separator="or" close=")">
|
|
|
+ "saleNumber" like '%${item}%'
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ <if test="truckNo != null">
|
|
|
+ and
|
|
|
+ <foreach collection="truckNo" item="item" open="(" separator="or" close=")">
|
|
|
+ "truckNo" like '%${item}%'
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ <if test="addressDeliveryAddress != null">
|
|
|
+ and
|
|
|
+ <foreach collection="addressDeliveryAddress" item="item" open="(" separator="or" close=")">
|
|
|
+ "addressDeliveryAddress" like '%${item}%'
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ <if test="saleDateOfReceipt != null">
|
|
|
+ and
|
|
|
+ <foreach collection="saleDateOfReceipt" item="item" open="(" separator="or" close=")">
|
|
|
+ "saleDateOfReceipt" like '%${item}%'
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ <if test="saleOrderConsignee != null">
|
|
|
+ and
|
|
|
+ <foreach collection="saleOrderConsignee" item="item" open="(" separator="or" close=")">
|
|
|
+ "saleOrderConsignee" like '%${item}%'
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ <if test="saleOrderConsigneeTel != null">
|
|
|
+ and
|
|
|
+ <foreach collection="saleOrderConsigneeTel" item="item" open="(" separator="or" close=")">
|
|
|
+ "saleOrderConsigneeTel" like '%${item}%'
|
|
|
+ </foreach>
|
|
|
+ </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="isselfMention != null">
|
|
|
+ and
|
|
|
+ <foreach collection="isselfMention" item="item" open="(" separator="or" close=")">
|
|
|
+ "isselfMention" like '%${item}%'
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ <include refid="orderBy"></include>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="getTruckNoMaterial" resultType="java.util.Map" parameterType="DECIMAL" >
|
|
|
+ SELECT
|
|
|
+ RM.MATERIAL_ID AS "materialId",
|
|
|
+ RM.MATERIAL_NAME AS "materialName",
|
|
|
+ RM.MATERIAL_SPECIFICATION || RM.MATERIAL_MODEL AS "specificationModel",
|
|
|
+ RM.MATERIAL_CODE AS "materialCode",
|
|
|
+ ASTM.SALE_ORDER_MATERIAL_NUMBER AS "materialNumber"
|
|
|
+ FROM AMS_SALE_ORDER_MATERIAL ASOM
|
|
|
+ LEFT JOIN AMS_SALE_TRUCKNO_MATERIAL ASTM
|
|
|
+ ON ASTM.SALE_ORDER_MATERIAL_ID = ASOM.SALE_ORDER_MATERIAL_ID
|
|
|
+ LEFT JOIN AMS_SALE_MATERIAL ASM
|
|
|
+ ON ASM.SALE_MATERIAL_ID = ASTM.MATERIAL_ID
|
|
|
+ LEFT JOIN RMS_MATERIAL RM
|
|
|
+ ON RM.MATERIAL_ID = ASM.MATERIAL_ID
|
|
|
+ WHERE ASOM.SALE_ORDER_MATERIAL_ID = #{saleOrderMaterialId}
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="getCarrierTruckNoList" parameterType="java.util.Map" resultType="java.util.Map">
|
|
|
+ SELECT DISTINCT *
|
|
|
+ FROM (
|
|
|
+ SELECT ASO.SALE_NUMBER AS "saleNumber",
|
|
|
+ ASOM.SALE_ORDER_MATERIAL_TRUCK_NO AS "truckNo",
|
|
|
+ RRA.ADDRESS_PROVINCE || RRA.ADDRESS_DISTRICT || RRA.ADDRESS_TOWN || RRP.ADDRESS_DELIVERY_ADDRESS AS
|
|
|
+ "addressDeliveryAddress",
|
|
|
+ ASOM.SALE_DATE_OF_RECEIPT AS "saleDateOfReceipt",
|
|
|
+ DECODE(ASO.SALE_ORDER_STATUS,2, '销售已审批',4, '财务已审批')
|
|
|
+ AS "approvalStatus",
|
|
|
+ ASOM.SALE_ORDER_CONSIGNEE_TEL AS "saleOrderConsigneeTel",
|
|
|
+ RSH.SHIPPER_NAME AS "shipperName",
|
|
|
+ RCO.CONSIGNEE_COMPANY_NAME AS "consigneeCompanyName",
|
|
|
+ ASO.SALE_ORDER_ISSELF_MENTION AS "isselfMention",
|
|
|
+ ASOM.INSERT_TIME AS "insertTime",
|
|
|
+ ASOM.SALE_ORDER_MATERIAL_ID AS "saleOrderMaterialId",
|
|
|
+ ASO.SALE_ORDER_ID AS "saleOrderId",
|
|
|
+ RCA.CARRIER_NAME AS "carrierName"
|
|
|
+ FROM AMS_SALE_ORDER_MATERIAL ASOM
|
|
|
+ LEFT JOIN AMS_SALE_ORDER ASO
|
|
|
+ ON ASO.SALE_ORDER_ID = ASOM.SALE_ORDER_ID
|
|
|
+ LEFT JOIN RMS_RECEIVE_PLACE RRP
|
|
|
+ ON RRP.PLACE_ID = ASOM.SALE_SHIPPING_ADDRESS_ID
|
|
|
+ LEFT JOIN RMS_RECEIVE_ADDRESS RRA
|
|
|
+ ON RRA.ADDRESS_ID = RRP.ADDRESS_ID
|
|
|
+ LEFT JOIN RMS_SHIPPER RSH
|
|
|
+ ON RSH.SHIPPER_ID = ASO.SHIPPER_ID
|
|
|
+ LEFT JOIN RMS_CONSIGNEE RCO
|
|
|
+ ON RCO.CONSIGNEE_ID = ASO.RECEIVE_ID
|
|
|
+ LEFT JOIN AMS_DISPATCH_SALE_ORDER ADSO
|
|
|
+ ON ADSO.SALE_ORDER_MATERIAL_ID = ASOM.SALE_ORDER_MATERIAL_ID
|
|
|
+ LEFT JOIN OMSTRUCK_ORDER OO
|
|
|
+ ON OO.ORDER_PLAN_ID = ASOM.SALE_ORDER_MATERIAL_ID
|
|
|
+ LEFT JOIN RMS_CARRIER RCA
|
|
|
+ ON RCA.CARRIER_ID = ADSO.CARRIER_ID
|
|
|
+ WHERE ASO.SALE_ORDER_STATUS IN (2,4)
|
|
|
+ AND ASOM.ISSUE_STATUS IS NULL
|
|
|
+ AND ADSO.DISPATCH_TYPE = 2
|
|
|
+ AND OO.ORDER_ID IS NULL
|
|
|
+ )
|
|
|
+ <where>
|
|
|
+ <if test="saleNumber != null">
|
|
|
+ and
|
|
|
+ <foreach collection="saleNumber" item="item" open="(" separator="or" close=")">
|
|
|
+ "saleNumber" like '%${item}%'
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ <if test="carrierName != null">
|
|
|
+ and
|
|
|
+ <foreach collection="carrierName" item="item" open="(" separator="or" close=")">
|
|
|
+ "carrierName" like '%${item}%'
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ <if test="truckNo != null">
|
|
|
+ and
|
|
|
+ <foreach collection="truckNo" item="item" open="(" separator="or" close=")">
|
|
|
+ "truckNo" like '%${item}%'
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ <if test="addressDeliveryAddress != null">
|
|
|
+ and
|
|
|
+ <foreach collection="addressDeliveryAddress" item="item" open="(" separator="or" close=")">
|
|
|
+ "addressDeliveryAddress" like '%${item}%'
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ <if test="saleDateOfReceipt != null">
|
|
|
+ and
|
|
|
+ <foreach collection="saleDateOfReceipt" item="item" open="(" separator="or" close=")">
|
|
|
+ "saleDateOfReceipt" like '%${item}%'
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ <if test="saleOrderConsignee != null">
|
|
|
+ and
|
|
|
+ <foreach collection="saleOrderConsignee" item="item" open="(" separator="or" close=")">
|
|
|
+ "saleOrderConsignee" like '%${item}%'
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ <if test="saleOrderConsigneeTel != null">
|
|
|
+ and
|
|
|
+ <foreach collection="saleOrderConsigneeTel" item="item" open="(" separator="or" close=")">
|
|
|
+ "saleOrderConsigneeTel" like '%${item}%'
|
|
|
+ </foreach>
|
|
|
+ </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="isselfMention != null">
|
|
|
+ and
|
|
|
+ <foreach collection="isselfMention" item="item" open="(" separator="or" close=")">
|
|
|
+ "isselfMention" like '%${item}%'
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ <include refid="orderBy"></include>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="getTruckNoMaterialAndCarrier" parameterType="DECIMAL" resultType="java.util.Map" >
|
|
|
+ SELECT DISTINCT ASOM.SALE_ORDER_MATERIAL_TRUCK_NO AS "truckNo",
|
|
|
+ RM.MATERIAL_NAME AS "materialName",
|
|
|
+ ASM.MATERIAL_ID AS "materialId",
|
|
|
+ ASTM.SALE_ORDER_MATERIAL_NUMBER AS "materialNumber",
|
|
|
+ ASM.MATERIAL_WEIGHT AS "materialWeight",
|
|
|
+ ASOM.SALE_DATE_OF_RECEIPT AS "receiptDate",
|
|
|
+ RM.MATERIAL_SPECIFICATION || RM.MATERIAL_MODEL AS "materialModelSpecification",
|
|
|
+ RM.MATERIAL_CODE AS "materialCode",
|
|
|
+ RRA.ADDRESS_PROVINCE || RRA.ADDRESS_DISTRICT || RRA.ADDRESS_TOWN ||
|
|
|
+ RRP.ADDRESS_DELIVERY_ADDRESS AS "place",
|
|
|
+ ASOM.SALE_DATE_OF_RECEIPT AS "receiptDate",
|
|
|
+ ASOM.SALE_ORDER_CONSIGNEE_TEL AS "saleOrderConsigneeTel",
|
|
|
+ ASOM.SALE_ORDER_CONSIGNEE AS "saleOrderConsignee",
|
|
|
+ ASOM.SALE_ORDER_MATERIAL_ID AS "saleOrderMaterialId",
|
|
|
+ ASOM.SALE_SHIPPING_ADDRESS_ID AS "placeId",
|
|
|
+ RC.CAPACITY_NUMBER AS "capacityNumber",
|
|
|
+ ADSO.CARRIER_ID AS "carrierId"
|
|
|
+ FROM AMS_SALE_TRUCKNO_MATERIAL ASTM
|
|
|
+ LEFT JOIN AMS_SALE_ORDER_MATERIAL ASOM
|
|
|
+ ON ASOM.SALE_ORDER_MATERIAL_ID = ASTM.SALE_ORDER_MATERIAL_ID
|
|
|
+ LEFT JOIN RMS_RECEIVE_PLACE RRP
|
|
|
+ ON RRP.PLACE_ID = ASOM.SALE_SHIPPING_ADDRESS_ID
|
|
|
+ LEFT JOIN RMS_RECEIVE_ADDRESS RRA
|
|
|
+ ON RRA.ADDRESS_ID = RRP.ADDRESS_ID
|
|
|
+ LEFT JOIN AMS_SALE_MATERIAL ASM
|
|
|
+ ON ASTM.MATERIAL_ID = ASM.SALE_MATERIAL_ID
|
|
|
+ LEFT JOIN RMS_MATERIAL RM
|
|
|
+ ON RM.MATERIAL_ID = ASM.MATERIAL_ID
|
|
|
+ LEFT JOIN OMSTRUCK_ORDER OO
|
|
|
+ ON OO.ORDER_PLAN_ID = ASOM.SALE_ORDER_MATERIAL_ID
|
|
|
+ LEFT JOIN RMS_CAPACITY RC
|
|
|
+ ON RC.CAPACITY_ID = OO.CAPACITY_ID
|
|
|
+ LEFT JOIN AMS_DISPATCH_SALE_ORDER ADSO
|
|
|
+ ON ADSO.SALE_ORDER_MATERIAL_ID = ASOM.SALE_ORDER_MATERIAL_ID
|
|
|
+ WHERE ASOM.SALE_ORDER_MATERIAL_ID = #{saleOrderMaterialId}
|
|
|
+ ORDER BY ASOM.SALE_ORDER_MATERIAL_TRUCK_NO ASC
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="getHaveCarTruckNoList" parameterType="java.util.Map" resultType="java.util.Map">
|
|
|
+ SELECT DISTINCT *
|
|
|
+ FROM (
|
|
|
+ SELECT ASO.SALE_NUMBER AS "saleNumber",
|
|
|
+ ASOM.SALE_ORDER_MATERIAL_TRUCK_NO AS "truckNo",
|
|
|
+ RRA.ADDRESS_PROVINCE || RRA.ADDRESS_DISTRICT || RRA.ADDRESS_TOWN || RRP.ADDRESS_DELIVERY_ADDRESS AS
|
|
|
+ "addressDeliveryAddress",
|
|
|
+ ASOM.SALE_DATE_OF_RECEIPT AS "saleDateOfReceipt",
|
|
|
+ DECODE(ASO.SALE_ORDER_STATUS,2, '销售已审批',4, '财务已审批')
|
|
|
+ AS "approvalStatus",
|
|
|
+ ASOM.SALE_ORDER_CONSIGNEE_TEL AS "saleOrderConsigneeTel",
|
|
|
+ RSH.SHIPPER_NAME AS "shipperName",
|
|
|
+ RCO.CONSIGNEE_COMPANY_NAME AS "consigneeCompanyName",
|
|
|
+ ASO.SALE_ORDER_ISSELF_MENTION AS "isselfMention",
|
|
|
+ ASOM.INSERT_TIME AS "insertTime",
|
|
|
+ ASOM.SALE_ORDER_MATERIAL_ID AS "saleOrderMaterialId",
|
|
|
+ ASO.SALE_ORDER_ID AS "saleOrderId",
|
|
|
+ RCA.CARRIER_NAME AS "carrierName"
|
|
|
+ FROM AMS_SALE_ORDER_MATERIAL ASOM
|
|
|
+ LEFT JOIN AMS_SALE_ORDER ASO
|
|
|
+ ON ASO.SALE_ORDER_ID = ASOM.SALE_ORDER_ID
|
|
|
+ LEFT JOIN RMS_RECEIVE_PLACE RRP
|
|
|
+ ON RRP.PLACE_ID = ASOM.SALE_SHIPPING_ADDRESS_ID
|
|
|
+ LEFT JOIN RMS_RECEIVE_ADDRESS RRA
|
|
|
+ ON RRA.ADDRESS_ID = RRP.ADDRESS_ID
|
|
|
+ LEFT JOIN RMS_SHIPPER RSH
|
|
|
+ ON RSH.SHIPPER_ID = ASO.SHIPPER_ID
|
|
|
+ LEFT JOIN RMS_CONSIGNEE RCO
|
|
|
+ ON RCO.CONSIGNEE_ID = ASO.RECEIVE_ID
|
|
|
+ LEFT JOIN AMS_DISPATCH_SALE_ORDER ADSO
|
|
|
+ ON ADSO.SALE_ORDER_MATERIAL_ID = ASOM.SALE_ORDER_MATERIAL_ID
|
|
|
+ LEFT JOIN OMSTRUCK_ORDER OO
|
|
|
+ ON OO.ORDER_PLAN_ID = ASOM.SALE_ORDER_MATERIAL_ID
|
|
|
+ LEFT JOIN RMS_CARRIER RCA
|
|
|
+ ON RCA.CARRIER_ID = ADSO.CARRIER_ID
|
|
|
+ WHERE ASO.SALE_ORDER_STATUS IN (2,4)
|
|
|
+ AND ASOM.ISSUE_STATUS IS NULL
|
|
|
+ AND ADSO.DISPATCH_TYPE = 2
|
|
|
+ AND OO.ORDER_ID IS NOT NULL
|
|
|
+ )
|
|
|
+ <where>
|
|
|
+ <if test="saleNumber != null">
|
|
|
+ and
|
|
|
+ <foreach collection="saleNumber" item="item" open="(" separator="or" close=")">
|
|
|
+ "saleNumber" like '%${item}%'
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ <if test="carrierName != null">
|
|
|
+ and
|
|
|
+ <foreach collection="carrierName" item="item" open="(" separator="or" close=")">
|
|
|
+ "carrierName" like '%${item}%'
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ <if test="truckNo != null">
|
|
|
+ and
|
|
|
+ <foreach collection="truckNo" item="item" open="(" separator="or" close=")">
|
|
|
+ "truckNo" like '%${item}%'
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ <if test="addressDeliveryAddress != null">
|
|
|
+ and
|
|
|
+ <foreach collection="addressDeliveryAddress" item="item" open="(" separator="or" close=")">
|
|
|
+ "addressDeliveryAddress" like '%${item}%'
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ <if test="saleDateOfReceipt != null">
|
|
|
+ and
|
|
|
+ <foreach collection="saleDateOfReceipt" item="item" open="(" separator="or" close=")">
|
|
|
+ "saleDateOfReceipt" like '%${item}%'
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ <if test="saleOrderConsignee != null">
|
|
|
+ and
|
|
|
+ <foreach collection="saleOrderConsignee" item="item" open="(" separator="or" close=")">
|
|
|
+ "saleOrderConsignee" like '%${item}%'
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ <if test="saleOrderConsigneeTel != null">
|
|
|
+ and
|
|
|
+ <foreach collection="saleOrderConsigneeTel" item="item" open="(" separator="or" close=")">
|
|
|
+ "saleOrderConsigneeTel" like '%${item}%'
|
|
|
+ </foreach>
|
|
|
+ </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="isselfMention != null">
|
|
|
+ and
|
|
|
+ <foreach collection="isselfMention" item="item" open="(" separator="or" close=")">
|
|
|
+ "isselfMention" like '%${item}%'
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ <include refid="orderBy"></include>
|
|
|
+ </select>
|
|
|
</mapper>
|