|
@@ -2484,16 +2484,23 @@
|
|
|
and (aso.DELETED between 1 and 2 and aso.SALE_ORDER_STATUS = 4 or aso.DELETED = 0 and aso.SALE_ORDER_STATUS between 0 and 4)
|
|
|
and ASM.SALE_MATERIAL_ID IS NOT NULL
|
|
|
and (BDO.WETHER_TO_STATEMENT IS NULL or BDO.WETHER_TO_STATEMENT != 1)
|
|
|
- <if test="oneDate != null">
|
|
|
+ <if test="oneDate != null and saleMakeDate == null">
|
|
|
and to_date(#{oneDate}, 'yyyy-mm-dd') < = to_date(to_char(ASOM.SALE_DATE_OF_RECEIPT-1,'yyyy-mm-dd'),'yyyy-mm-dd')
|
|
|
</if>
|
|
|
<if test="carrierSsoId != null">
|
|
|
and R_CARRIER.CARRIER_SSO_ID = #{carrierSsoId}
|
|
|
</if>
|
|
|
- <if test="startDate != null">
|
|
|
+ <if test="startDate != null and saleMakeDate == null">
|
|
|
and to_date(#{startDate}, 'yyyy-mm-dd') <= to_date(to_char(ASOM.SALE_DATE_OF_RECEIPT-1,'yyyy-mm-dd'),'yyyy-mm-dd')
|
|
|
and to_date(#{endDate}, 'yyyy-mm-dd') >= to_date(to_char(ASOM.SALE_DATE_OF_RECEIPT-1,'yyyy-mm-dd'),'yyyy-mm-dd')
|
|
|
</if>
|
|
|
+ <if test="oneDate != null and saleMakeDate != null">
|
|
|
+ and to_date(#{oneDate}, 'yyyy-mm-dd') = to_date(to_char(ASM.SALE_MAKE_DATE,'yyyy-mm-dd'),'yyyy-mm-dd')
|
|
|
+ </if>
|
|
|
+ <if test="startDate != null and saleMakeDate != null">
|
|
|
+ and to_date(#{startDate}, 'yyyy-mm-dd hh24:mi:ss') <= ASM.SALE_MAKE_DATE
|
|
|
+ and to_date(#{endDate}, 'yyyy-mm-dd hh24:mi:ss') >= ASM.SALE_MAKE_DATE
|
|
|
+ </if>
|
|
|
<if test="remark != null" >
|
|
|
and RSR.SALER_NAME || RCA.CAPACITY_NUMBER || RC.CONSIGNEE_COMPANY_NAME || R_CARRIER.CARRIER_ABBREVIATION || RM.MATERIAL_NAME || RM.MATERIAL_MODEL || RM.MATERIAL_SPECIFICATION
|
|
|
|| (CASE WHEN RRA_HISTORY.ADDRESS_PROVINCE is not null
|
|
@@ -2807,16 +2814,23 @@
|
|
|
and ASM.SALE_MATERIAL_ID IS NOT NULL
|
|
|
and BDO.WETHER_TO_STATEMENT = 1
|
|
|
and BDO.STATEMENT_ID IS NULL
|
|
|
- <if test="oneDate != null">
|
|
|
+ <if test="oneDate != null and saleMakeDate == null">
|
|
|
and to_date(#{oneDate}, 'yyyy-mm-dd') < = to_date(to_char(ASOM.SALE_DATE_OF_RECEIPT-1,'yyyy-mm-dd'),'yyyy-mm-dd')
|
|
|
</if>
|
|
|
<if test="carrierSsoId != null">
|
|
|
and R_CARRIER.CARRIER_SSO_ID = #{carrierSsoId}
|
|
|
</if>
|
|
|
- <if test="startDate != null">
|
|
|
+ <if test="startDate != null and saleMakeDate == null">
|
|
|
and to_date(#{startDate}, 'yyyy-mm-dd') <= to_date(to_char(ASOM.SALE_DATE_OF_RECEIPT-1,'yyyy-mm-dd'),'yyyy-mm-dd')
|
|
|
and to_date(#{endDate}, 'yyyy-mm-dd') >= to_date(to_char(ASOM.SALE_DATE_OF_RECEIPT-1,'yyyy-mm-dd'),'yyyy-mm-dd')
|
|
|
</if>
|
|
|
+ <if test="oneDate != null and saleMakeDate != null">
|
|
|
+ and to_date(#{oneDate}, 'yyyy-mm-dd') = to_date(to_char(ASM.SALE_MAKE_DATE,'yyyy-mm-dd'),'yyyy-mm-dd')
|
|
|
+ </if>
|
|
|
+ <if test="startDate != null and saleMakeDate != null">
|
|
|
+ and to_date(#{startDate}, 'yyyy-mm-dd hh24:mi:ss') <= ASM.SALE_MAKE_DATE
|
|
|
+ and to_date(#{endDate}, 'yyyy-mm-dd hh24:mi:ss') >= ASM.SALE_MAKE_DATE
|
|
|
+ </if>
|
|
|
<if test="remark != null" >
|
|
|
and RSR.SALER_NAME || RCA.CAPACITY_NUMBER || RC.CONSIGNEE_COMPANY_NAME || R_CARRIER.CARRIER_ABBREVIATION || RM.MATERIAL_NAME || RM.MATERIAL_MODEL || RM.MATERIAL_SPECIFICATION
|
|
|
|| (CASE WHEN RRA_HISTORY.ADDRESS_PROVINCE is not null
|