bugfix:对账排除住院订单
This commit is contained in:
@@ -80,6 +80,8 @@
|
||||
inner join bankbill_history b on a.PlatformTransId = b.C_YSDDH
|
||||
where b.C_JYRQ >= #{startTime}
|
||||
and b.C_JYRQ <= #{endTime}
|
||||
and a.PayMethod != '2' -- 排除不参与对账的记录
|
||||
and (b.is_inpatient is null or b.is_inpatient = '0') -- 排除住院订单
|
||||
<if test="prepayment_code != null and prepayment_code != ''">
|
||||
and a.PayType != #{prepayment_code}
|
||||
</if>
|
||||
@@ -120,6 +122,7 @@
|
||||
, '0'
|
||||
, '1'
|
||||
from (select * from hisbill_history where trade_date = #{trade_date} and payType!=#{cash_code}
|
||||
and PayMethod != '2' -- 排除不参与对账的记录
|
||||
<if test="military_code != null and military_code != ''">
|
||||
and payType!=#{military_code}
|
||||
</if>
|
||||
@@ -134,7 +137,7 @@
|
||||
</if>
|
||||
) a
|
||||
inner join
|
||||
(select * from bankbill_history where C_JYRQ = #{trade_date}) b
|
||||
(select * from bankbill_history where C_JYRQ = #{trade_date} and (is_inpatient is null or is_inpatient = '0')) b -- 排除住院订单
|
||||
on a.PlatformTransId = b.C_SHDDH and a.TradingStatus = b.C_JYLX and ROUND(CAST(a.Amount AS DECIMAL(18,2)), 2) = ROUND(CAST(b.C_JYJE AS DECIMAL(18,2)), 2)
|
||||
</insert>
|
||||
|
||||
@@ -163,6 +166,7 @@
|
||||
, '1'
|
||||
, '1'
|
||||
from (select * from hisbill_history where trade_date = #{trade_date} and payType!=#{cash_code}
|
||||
and PayMethod != '2' -- 排除不参与对账的记录
|
||||
<if test="military_code != null and military_code != ''">
|
||||
and payType!=#{military_code}
|
||||
</if>
|
||||
@@ -177,7 +181,7 @@
|
||||
</if>
|
||||
) a
|
||||
left join
|
||||
(select * from bankbill_history where C_JYRQ = #{trade_date}) b
|
||||
(select * from bankbill_history where C_JYRQ = #{trade_date} and (is_inpatient is null or is_inpatient = '0')) b -- 排除住院订单
|
||||
on a.PlatformTransId = b.C_SHDDH and a.TradingStatus = b.C_JYLX and ROUND(CAST(a.Amount AS DECIMAL(18,2)), 2) = ROUND(CAST(b.C_JYJE AS DECIMAL(18,2)), 2)
|
||||
where b.C_SHDDH is null
|
||||
</insert>
|
||||
@@ -207,6 +211,7 @@
|
||||
, '1'
|
||||
, '1'
|
||||
from (select * from hisbill_history where trade_date = #{trade_date} and payType!=#{cash_code}
|
||||
and PayMethod != '2' -- 排除不参与对账的记录
|
||||
<if test="military_code != null and military_code != ''">
|
||||
and payType!=#{military_code}
|
||||
</if>
|
||||
@@ -221,7 +226,7 @@
|
||||
</if>
|
||||
) a
|
||||
right join
|
||||
(select * from bankbill_history where C_JYRQ = #{trade_date}) b
|
||||
(select * from bankbill_history where C_JYRQ = #{trade_date} and (is_inpatient is null or is_inpatient = '0')) b -- 排除住院订单
|
||||
on a.PlatformTransId = b.C_SHDDH and a.TradingStatus = b.C_JYLX and ROUND(CAST(a.Amount AS DECIMAL(18,2)), 2) = ROUND(CAST(b.C_JYJE AS DECIMAL(18,2)), 2)
|
||||
where a.PlatformTransId is null
|
||||
</insert>
|
||||
@@ -252,6 +257,7 @@
|
||||
, '0'
|
||||
, '1'
|
||||
from (select * from hisbill_history where trade_date = #{trade_date} and payType = #{cash_code}
|
||||
and PayMethod != '2' -- 排除不参与对账的记录
|
||||
<if test="excludeMilitaryOperators != null and excludeMilitaryOperators.size() > 0">
|
||||
and HisOperCode not in
|
||||
<foreach collection="excludeMilitaryOperators" item="operator" open="(" separator="," close=")">
|
||||
@@ -290,6 +296,7 @@
|
||||
, '1'
|
||||
, '1'
|
||||
from (select * from hisbill_history where trade_date = #{trade_date} and payType = #{cash_code}
|
||||
and PayMethod != '2' -- 排除不参与对账的记录
|
||||
<if test="excludeMilitaryOperators != null and excludeMilitaryOperators.size() > 0">
|
||||
and HisOperCode not in
|
||||
<foreach collection="excludeMilitaryOperators" item="operator" open="(" separator="," close=")">
|
||||
@@ -329,6 +336,7 @@
|
||||
, '1'
|
||||
, '1'
|
||||
from (select * from hisbill_history where trade_date = #{trade_date} and payType = #{cash_code}
|
||||
and PayMethod != '2' -- 排除不参与对账的记录
|
||||
<if test="excludeMilitaryOperators != null and excludeMilitaryOperators.size() > 0">
|
||||
and HisOperCode not in
|
||||
<foreach collection="excludeMilitaryOperators" item="operator" open="(" separator="," close=")">
|
||||
@@ -589,11 +597,11 @@
|
||||
</select>-->
|
||||
|
||||
<select id="findHisAndThirdJoinDataByParamAndNotUnique" parameterType="HashMap" resultType="HashMap">
|
||||
select TranID, H_JYLX,Amount
|
||||
select TranID, H_JYLX
|
||||
from third_join_his
|
||||
where trade_date = #{trade_date}
|
||||
and TranID != ''
|
||||
group by TranID, H_JYLX,Amount
|
||||
group by TranID, H_JYLX
|
||||
having count(TranID) > 1
|
||||
</select>
|
||||
|
||||
@@ -606,6 +614,14 @@
|
||||
and H_JYLX = #{h_jylx}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteThirdUnilateralByIddh" parameterType="HashMap">
|
||||
delete
|
||||
from third_join_his
|
||||
where trade_date = #{trade_date}
|
||||
and I_DDH = #{i_ddh}
|
||||
and err_type = '2'
|
||||
</delete>
|
||||
|
||||
<!--添加修改后的重复记录回数据库-->
|
||||
<insert id="addNotUniqueData" parameterType="java.util.List">
|
||||
insert into third_join_his(JYSJ
|
||||
|
||||
Reference in New Issue
Block a user