update:建行账单接入
This commit is contained in:
@@ -59,6 +59,43 @@
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<!-- 查询有自费金额的HIS账单记录 -->
|
||||
<select id="findHisDetailWithZfAmount" parameterType="HashMap" resultType="HashMap">
|
||||
select
|
||||
PayMethod,
|
||||
TradingStatus,
|
||||
BizType,
|
||||
PayType,
|
||||
TradeTime,
|
||||
HisOperCode,
|
||||
Amount,
|
||||
zfAmount,
|
||||
PlatformTransId,
|
||||
PatientId,
|
||||
PatientName,
|
||||
trade_date,
|
||||
his_wsdl_id,
|
||||
HisTransId,
|
||||
clr_type,
|
||||
insutype,
|
||||
ybzhAmount,
|
||||
ybtcAmount
|
||||
from hisbill_history
|
||||
<where>
|
||||
<if test="trade_date!=null and trade_date!=''">
|
||||
and trade_date = #{trade_date}
|
||||
</if>
|
||||
<if test="has_zf_amount!=null and has_zf_amount!=''">
|
||||
and zfAmount is not null
|
||||
and zfAmount != ''
|
||||
and zfAmount != '0'
|
||||
and zfAmount != '0.00'
|
||||
and ABS(CAST(zfAmount AS DECIMAL(18,2))) > 0
|
||||
</if>
|
||||
</where>
|
||||
order by TradeTime, PlatformTransId
|
||||
</select>
|
||||
|
||||
<delete id="deleteHisBillOriginalByParam" parameterType="HashMap">
|
||||
delete from hisbill_original where trade_date=#{trade_date}
|
||||
</delete>
|
||||
@@ -114,12 +151,12 @@
|
||||
|
||||
<insert id="insertAllHisBillHistory" parameterType="java.util.List">
|
||||
insert into
|
||||
hisbill_history(PayMethod,TradingStatus,BizType,PayType,TradeTime,HisOperCode,Amount,remarks,PlatformTransId,PatientId,PatientName,trade_date,his_wsdl_id,HisTransId,clr_type,insutype,ybzhAmount,ybtcAmount)
|
||||
hisbill_history(PayMethod,TradingStatus,BizType,PayType,TradeTime,HisOperCode,Amount,remarks,PlatformTransId,PatientId,PatientName,trade_date,his_wsdl_id,HisTransId,clr_type,insutype,ybzhAmount,ybtcAmount,zfAmount)
|
||||
values
|
||||
<foreach collection="list" index="index" item="itm" separator=",">
|
||||
(
|
||||
#{itm.payMethod},#{itm.tradingStatus},#{itm.bizType},#{itm.payType},#{itm.tradeTime},#{itm.hisOperCode},#{itm.amount},#{itm.remarks},#{itm.platformTransId},#{itm.patientId}
|
||||
,#{itm.patientName},#{itm.trade_date},#{itm.his_wsdl_id},#{itm.hisTransId},#{itm.clrType},#{itm.insutype},#{itm.ybzhAmount},#{itm.ybtcAmount}
|
||||
,#{itm.patientName},#{itm.trade_date},#{itm.his_wsdl_id},#{itm.hisTransId},#{itm.clrType},#{itm.insutype},#{itm.ybzhAmount},#{itm.ybtcAmount},#{itm.zfAmount}
|
||||
)
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
@@ -4,17 +4,31 @@
|
||||
|
||||
|
||||
<select id="findReconciliationResultPageList" parameterType="HashMap" resultType="HashMap">
|
||||
select trade_date,third_money,his_money,difference,third_unilateral,his_unilateral,manager_history_unilateral,today_unilateral,unilateral_num,pending_unilateral,pending_unilateral_num,status,area
|
||||
,(case status when '1' then '通过' else '不通过' end) as status_str
|
||||
select DISTINCT
|
||||
trade_date,
|
||||
third_money,
|
||||
his_money,
|
||||
difference,
|
||||
third_unilateral,
|
||||
his_unilateral,
|
||||
manager_history_unilateral,
|
||||
today_unilateral,
|
||||
unilateral_num,
|
||||
pending_unilateral,
|
||||
pending_unilateral_num,
|
||||
status,
|
||||
area,
|
||||
(case status when '1' then '通过' else '不通过' end) as status_str
|
||||
from reconciliation_result
|
||||
<where>
|
||||
<if test="startTime!=null and startTime!=''">
|
||||
and trade_date >=#{startTime}
|
||||
</if>
|
||||
<if test="endTime!=null and endTime!=''">
|
||||
and trade_date <#{endTime}
|
||||
and trade_date <=#{endTime}
|
||||
</if>
|
||||
</where>
|
||||
order by trade_date desc
|
||||
</select>
|
||||
|
||||
<insert id="insertReconciliationResult" parameterType="HashMap">
|
||||
|
||||
@@ -117,6 +117,9 @@
|
||||
<if test="military_code != null and military_code != ''">
|
||||
and payType!=#{military_code}
|
||||
</if>
|
||||
<if test="medical_insurance_code != null and medical_insurance_code != ''">
|
||||
and payType!=#{medical_insurance_code}
|
||||
</if>
|
||||
) a
|
||||
inner join
|
||||
(select * from bankbill_history where C_JYRQ = #{trade_date}) b
|
||||
@@ -151,6 +154,9 @@
|
||||
<if test="military_code != null and military_code != ''">
|
||||
and payType!=#{military_code}
|
||||
</if>
|
||||
<if test="medical_insurance_code != null and medical_insurance_code != ''">
|
||||
and payType!=#{medical_insurance_code}
|
||||
</if>
|
||||
) a
|
||||
left join
|
||||
(select * from bankbill_history where C_JYRQ = #{trade_date}) b
|
||||
@@ -186,6 +192,9 @@
|
||||
<if test="military_code != null and military_code != ''">
|
||||
and payType!=#{military_code}
|
||||
</if>
|
||||
<if test="medical_insurance_code != null and medical_insurance_code != ''">
|
||||
and payType!=#{medical_insurance_code}
|
||||
</if>
|
||||
) a
|
||||
right join
|
||||
(select * from bankbill_history where C_JYRQ = #{trade_date}) b
|
||||
@@ -428,7 +437,23 @@
|
||||
where HisOperCode = #{hisOperCode}
|
||||
and trade_date = #{trade_date}
|
||||
and PayType = #{payType}
|
||||
and payMethod = #{payMethod}
|
||||
</update>
|
||||
|
||||
<!-- 根据三方信息更新关联表记录(用于自费对账自动核销) -->
|
||||
<update id="updateJoinDateByThird" parameterType="HashMap">
|
||||
update third_join_his
|
||||
set check_result=#{check_result}
|
||||
<where>
|
||||
<if test="i_ddh!=null and i_ddh!=''">
|
||||
and I_DDH=#{i_ddh}
|
||||
</if>
|
||||
<if test="i_jylx!=null and i_jylx!=''">
|
||||
and I_JYLX=#{i_jylx}
|
||||
</if>
|
||||
<if test="trade_date!=null and trade_date!=''">
|
||||
and trade_date=#{trade_date}
|
||||
</if>
|
||||
</where>
|
||||
</update>
|
||||
|
||||
<update id="updateJoinSetActiveByZhiPiao" parameterType="HashMap">
|
||||
@@ -440,6 +465,21 @@
|
||||
and payMethod = #{payMethod}
|
||||
</update>
|
||||
|
||||
<delete id="deleteJoinDataByThird" parameterType="HashMap">
|
||||
delete from third_join_his
|
||||
<where>
|
||||
<if test="i_ddh!=null and i_ddh!=''">
|
||||
and I_DDH=#{i_ddh}
|
||||
</if>
|
||||
<if test="i_jylx!=null and i_jylx!=''">
|
||||
and I_JYLX=#{i_jylx}
|
||||
</if>
|
||||
<if test="trade_date!=null and trade_date!=''">
|
||||
and trade_date=#{trade_date}
|
||||
</if>
|
||||
</where>
|
||||
</delete>
|
||||
|
||||
<select id="findAllBankDetailNum" parameterType="HashMap" resultType="HashMap">
|
||||
select count(1) as num
|
||||
from third_join_his
|
||||
|
||||
@@ -202,6 +202,29 @@
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<!-- 根据ID更新单边账记录 -->
|
||||
<update id="updateUnilateralById" parameterType="HashMap">
|
||||
update unmanger_unilateral
|
||||
<set>
|
||||
<if test="is_manager!=null and is_manager!=''">
|
||||
is_manager=#{is_manager},
|
||||
</if>
|
||||
<if test="manager_time!=null and manager_time!=''">
|
||||
manager_time=#{manager_time},
|
||||
</if>
|
||||
<if test="remark!=null and remark!=''">
|
||||
remark=#{remark},
|
||||
</if>
|
||||
<if test="modify_time!=null and modify_time!=''">
|
||||
modify_time=#{modify_time},
|
||||
</if>
|
||||
<if test="managerType!=null and managerType!=''">
|
||||
managerType=#{managerType}
|
||||
</if>
|
||||
</set>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteUnilateralByJoinIdNotNull" parameterType="HashMap">
|
||||
delete
|
||||
from unmanger_unilateral
|
||||
@@ -217,4 +240,8 @@
|
||||
and TranID = #{tranID}
|
||||
and H_JYLX = #{h_jylx}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteUnilateralById" parameterType="HashMap">
|
||||
delete from unmanger_unilateral where id = #{id}
|
||||
</delete>
|
||||
</mapper>
|
||||
@@ -3,21 +3,54 @@
|
||||
<mapper namespace="com.saye.hospitalgd.mapper.historyLog.ReconciliationLogMapper">
|
||||
|
||||
<select id="findReconciliationLogPageList" parameterType="HashMap" resultType="HashMap">
|
||||
select trade_date,modify_time,create_time,manager_num,status,user_name,remark
|
||||
from reconciliation_info
|
||||
|
||||
<where>
|
||||
<if test="startTime!=null and startTime!=''">
|
||||
and trade_date >=#{startTime}
|
||||
</if>
|
||||
<if test="endTime!=null and endTime!=''">
|
||||
and trade_date <=#{endTime}
|
||||
</if>
|
||||
<if test="status!=null and status!=''">
|
||||
and status=#{status}
|
||||
</if>
|
||||
</where>
|
||||
order by trade_date desc
|
||||
select
|
||||
t.trade_date as TRADE_DATE,
|
||||
t.modify_time as MODIFY_TIME,
|
||||
t.create_time as CREATE_TIME,
|
||||
t.manager_num as MANAGER_NUM,
|
||||
t.status as STATUS,
|
||||
t.user_name as USER_NAME,
|
||||
t.remark as REMARK
|
||||
from (
|
||||
select
|
||||
trade_date,
|
||||
modify_time,
|
||||
create_time,
|
||||
manager_num,
|
||||
status,
|
||||
user_name,
|
||||
remark,
|
||||
ROW_NUMBER() OVER (PARTITION BY trade_date ORDER BY create_time DESC) as rn
|
||||
from reconciliation_info
|
||||
<where>
|
||||
<!-- 确保trade_date是有效的日期格式 -->
|
||||
and trade_date is not null
|
||||
and trade_date != ''
|
||||
and trade_date REGEXP '^[0-9]{4}-[0-9]{2}-[0-9]{2}$'
|
||||
<!-- 确保status是有效值 -->
|
||||
and status in ('0', '1')
|
||||
<!-- 确保manager_num是整数且不包含小数点(排除金额数据) -->
|
||||
and manager_num is not null
|
||||
and manager_num not like '%.%'
|
||||
and manager_num REGEXP '^[0-9]+$'
|
||||
and CAST(manager_num AS UNSIGNED) < 10000
|
||||
<!-- 确保时间字段不包含小数点(排除金额数据) -->
|
||||
and (modify_time is null or modify_time not like '%.%')
|
||||
and (create_time is null or create_time not like '%.%')
|
||||
|
||||
<if test="startTime!=null and startTime!=''">
|
||||
and trade_date >=#{startTime}
|
||||
</if>
|
||||
<if test="endTime!=null and endTime!=''">
|
||||
and trade_date <=#{endTime}
|
||||
</if>
|
||||
<if test="status!=null and status!=''">
|
||||
and status=#{status}
|
||||
</if>
|
||||
</where>
|
||||
) t
|
||||
where t.rn = 1
|
||||
order by t.trade_date desc
|
||||
</select>
|
||||
|
||||
<select id="findReconciliationLogByParam" parameterType="HashMap" resultType="HashMap">
|
||||
|
||||
@@ -117,7 +117,21 @@
|
||||
cols: [
|
||||
[
|
||||
// {field:'AREA',title: '院区', align:'center',rowspan:2,width:120,totalRowText:'合计'},
|
||||
{field: 'TRADE_DATE', title: '日期', align: 'center', rowspan: 2, width: 120, totalRowText: ''},
|
||||
{
|
||||
field: 'TRADE_DATE',
|
||||
title: '日期',
|
||||
align: 'center',
|
||||
rowspan: 2,
|
||||
width: 120,
|
||||
totalRowText: '合计',
|
||||
templet: function(d) {
|
||||
// Layui合计行的特征:TOTAL_NUMS字段存在
|
||||
if (d.TOTAL_NUMS !== undefined) {
|
||||
return '<span style="font-weight: bold; color: #333;">合计</span>';
|
||||
}
|
||||
return d.TRADE_DATE || '';
|
||||
}
|
||||
},
|
||||
{title: '结算金额', align: 'center', colspan: 4},
|
||||
{title: '单边账', align: 'center', colspan: 2},
|
||||
{title: '对账情况', align: 'center', colspan: 2},
|
||||
@@ -169,6 +183,10 @@
|
||||
width: 100,
|
||||
sort: false,
|
||||
templet: function (d) {
|
||||
// 合计行不显示状态
|
||||
if (d.TOTAL_NUMS !== undefined) {
|
||||
return '-';
|
||||
}
|
||||
return d.STATUS === '1' ? '通过' : '不通过';
|
||||
}
|
||||
},
|
||||
@@ -182,12 +200,17 @@
|
||||
let objStr = "";
|
||||
if (dataList.length === 1) {
|
||||
objStr = dataList[0].TRADE_DATE;
|
||||
// 只有一条数据时,隐藏合计行
|
||||
$('.layui-table-total').hide();
|
||||
} else {
|
||||
objStr = dataList[0].TRADE_DATE;
|
||||
objStr = objStr + "~";
|
||||
objStr = objStr + dataList[dataList.length - 1].TRADE_DATE;
|
||||
// 多条数据时,显示合计行并设置第一列文字为"合计"
|
||||
$('.layui-table-total').show();
|
||||
$('.layui-table-total tr.layui-table-sum td').first().find('div').html('<span style="font-weight: bold;">合计</span>');
|
||||
}
|
||||
$('.layui-table-total table td:eq(1) div').html(objStr);
|
||||
$(".selectDate").text(objStr);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user