差旅费用报销单测试sql语句

This commit is contained in:
hecan 2024-06-19 14:45:09 +08:00
parent 375e1619b0
commit f1fcd9658a
1 changed files with 129 additions and 6 deletions

View File

@ -66,10 +66,51 @@
</sql>
<!-- 采用==查询 -->
<select id="PaymentEntity_list_base" resultMap="get-PaymentEntity-result" parameterType="com.hzya.frame.seeyon.cbs8.entity.PaymentEntity">
select
<!-- select
<include refid="PaymentEntity_Base_Column_List"/>
from
v_hzya_oa_cbs_all
v_hzya_oa_cbs_all-->
-- 差旅费报销单
SELECT
formson_0210.id as oaId, -- 主表id
'formson_0210' as tableName, -- 表名
COL_SUMMARY.SUBJECT as title, -- 单据标题
unit.name as payCompany, -- 付款公司
'差旅费报销单' as billName,
'field0072' as payResultField, -- 支付结果字段
'field0073' as payDateField, -- 打款日期字段
'' as receiptFiled,-- 电子回单字段
COL_SUMMARY.id as summaryId,
formmain_0209.field0017||'-'||formson_0210.sort as referenceNum, -- 单据编号
formmain_0209.START_DATE as startDate, -- 单据日期
formmain_0209.FINISHEDFLAG as finishedflag, -- 流程状态
formson_0210.field0073 as payDate, -- 打款日期
formson_0210.field0072 as payResult, -- 支付结果
REGEXP_REPLACE(formmain_0209.field0042, '[[:space:]]', '') as payAccount, -- 付款账户
REGEXP_REPLACE(formmain_0209.field0041, '[[:space:]]', '') as payBankName, -- 付款开户行
formmain_0209.field0035 as amount, -- 金额
formmain_0209.field0038 as purpose, -- 用途
formmain_0209.field0038 as cbsAbstract, -- 摘要
REGEXP_REPLACE(formson_0210.field0069, '[[:space:]]', '') as revAccount, -- 收款账户
formson_0210.field0068 as revBankName, -- 收款开户行
'' as revAccountName, -- 收款人
REGEXP_REPLACE(formson_0210.field0071, '[[:space:]]', '') as cnapsCode, -- 收款联行号
item.showvalue as personalFlag,-- 公私标记
'' as revBankType,-- 收款银行类型
'10' as currency,-- 币种
'' as busType,-- 业务类型
'' as receipt -- 电子回单
from
formson_0210
LEFT JOIN formmain_0209 ON formson_0210.FORMMAIN_ID = formmain_0209.id
LEFT JOIN COL_SUMMARY ON COL_SUMMARY.FORM_RECORDID = formmain_0209.id
LEFT JOIN CTP_AFFAIR ON CTP_AFFAIR.object_id = COL_SUMMARY.id
left join CTP_ENUM_ITEM item on item.id =formson_0210.field0070
left join ORG_UNIT unit on unit.id =formmain_0209.field0002
-- left join V_USER_VIEW_ALL us on us.staffid=formmain_0209.field0024
WHERE 1=1
-- and formmain_0209.field0035>0
and CTP_AFFAIR.node_name = '发起者' and CTP_AFFAIR.COMPLETE_TIME is null and CTP_AFFAIR.STATE = 3
<trim prefix="where" prefixOverrides="and">
<if test="referenceNum != null and referenceNum !='' "> referenceNum = #{referenceNum} </if>
<if test="busType != null and busType !='' "> and busType = #{busType} </if>
@ -97,10 +138,51 @@
<!-- 查询交易成功,且电子回单为空的,上传电子回单用 -->
<select id="PaymentEntity_list_base_elec_isnull" resultMap="get-PaymentEntity-result" parameterType="com.hzya.frame.seeyon.cbs8.entity.PaymentEntity">
select
<!-- select
<include refid="PaymentEntity_Base_Column_List"/>
from
v_hzya_oa_cbs_all
v_hzya_oa_cbs_all-->
-- 差旅费报销单
SELECT
formson_0210.id as oaId, -- 主表id
'formson_0210' as tableName, -- 表名
COL_SUMMARY.SUBJECT as title, -- 单据标题
unit.name as payCompany, -- 付款公司
'差旅费报销单' as billName,
'field0072' as payResultField, -- 支付结果字段
'field0073' as payDateField, -- 打款日期字段
'' as receiptFiled,-- 电子回单字段
COL_SUMMARY.id as summaryId,
formmain_0209.field0017||'-'||formson_0210.sort as referenceNum, -- 单据编号
formmain_0209.START_DATE as startDate, -- 单据日期
formmain_0209.FINISHEDFLAG as finishedflag, -- 流程状态
formson_0210.field0073 as payDate, -- 打款日期
formson_0210.field0072 as payResult, -- 支付结果
REGEXP_REPLACE(formmain_0209.field0042, '[[:space:]]', '') as payAccount, -- 付款账户
REGEXP_REPLACE(formmain_0209.field0041, '[[:space:]]', '') as payBankName, -- 付款开户行
formmain_0209.field0035 as amount, -- 金额
formmain_0209.field0038 as purpose, -- 用途
formmain_0209.field0038 as cbsAbstract, -- 摘要
REGEXP_REPLACE(formson_0210.field0069, '[[:space:]]', '') as revAccount, -- 收款账户
formson_0210.field0068 as revBankName, -- 收款开户行
'' as revAccountName, -- 收款人
REGEXP_REPLACE(formson_0210.field0071, '[[:space:]]', '') as cnapsCode, -- 收款联行号
item.showvalue as personalFlag,-- 公私标记
'' as revBankType,-- 收款银行类型
'10' as currency,-- 币种
'' as busType,-- 业务类型
'' as receipt -- 电子回单
from
formson_0210
LEFT JOIN formmain_0209 ON formson_0210.FORMMAIN_ID = formmain_0209.id
LEFT JOIN COL_SUMMARY ON COL_SUMMARY.FORM_RECORDID = formmain_0209.id
LEFT JOIN CTP_AFFAIR ON CTP_AFFAIR.object_id = COL_SUMMARY.id
left join CTP_ENUM_ITEM item on item.id =formson_0210.field0070
left join ORG_UNIT unit on unit.id =formmain_0209.field0002
-- left join V_USER_VIEW_ALL us on us.staffid=formmain_0209.field0024
WHERE 1=1
-- and formmain_0209.field0035>0
and CTP_AFFAIR.node_name = '发起者' and CTP_AFFAIR.COMPLETE_TIME is null and CTP_AFFAIR.STATE = 3
<trim prefix="where" prefixOverrides="and">
<if test="referenceNum != null and referenceNum !='' "> referenceNum = #{referenceNum} </if>
<if test="busType != null and busType !='' "> and busType = #{busType} </if>
@ -127,10 +209,51 @@
</select>
<!-- 查询推送状态为null的代表没有发送请求或者请求客户服务器没有返回的 采用==查询 -->
<select id="PaymentEntity_list_base_unpaid" resultMap="get-PaymentEntity-result" parameterType="com.hzya.frame.seeyon.cbs8.entity.PaymentEntity">
select
<!--select
<include refid="PaymentEntity_Base_Column_List"/>
from
v_hzya_oa_cbs
v_hzya_oa_cbs-->
-- 差旅费报销单
SELECT
formson_0210.id as oaId, -- 主表id
'formson_0210' as tableName, -- 表名
COL_SUMMARY.SUBJECT as title, -- 单据标题
unit.name as payCompany, -- 付款公司
'差旅费报销单' as billName,
'field0072' as payResultField, -- 支付结果字段
'field0073' as payDateField, -- 打款日期字段
'' as receiptFiled,-- 电子回单字段
COL_SUMMARY.id as summaryId,
formmain_0209.field0017||'-'||formson_0210.sort as referenceNum, -- 单据编号
formmain_0209.START_DATE as startDate, -- 单据日期
formmain_0209.FINISHEDFLAG as finishedflag, -- 流程状态
formson_0210.field0073 as payDate, -- 打款日期
formson_0210.field0072 as payResult, -- 支付结果
REGEXP_REPLACE(formmain_0209.field0042, '[[:space:]]', '') as payAccount, -- 付款账户
REGEXP_REPLACE(formmain_0209.field0041, '[[:space:]]', '') as payBankName, -- 付款开户行
formmain_0209.field0035 as amount, -- 金额
formmain_0209.field0038 as purpose, -- 用途
formmain_0209.field0038 as cbsAbstract, -- 摘要
REGEXP_REPLACE(formson_0210.field0069, '[[:space:]]', '') as revAccount, -- 收款账户
formson_0210.field0068 as revBankName, -- 收款开户行
'' as revAccountName, -- 收款人
REGEXP_REPLACE(formson_0210.field0071, '[[:space:]]', '') as cnapsCode, -- 收款联行号
item.showvalue as personalFlag,-- 公私标记
'' as revBankType,-- 收款银行类型
'10' as currency,-- 币种
'' as busType,-- 业务类型
'' as receipt -- 电子回单
from
formson_0210
LEFT JOIN formmain_0209 ON formson_0210.FORMMAIN_ID = formmain_0209.id
LEFT JOIN COL_SUMMARY ON COL_SUMMARY.FORM_RECORDID = formmain_0209.id
LEFT JOIN CTP_AFFAIR ON CTP_AFFAIR.object_id = COL_SUMMARY.id
left join CTP_ENUM_ITEM item on item.id =formson_0210.field0070
left join ORG_UNIT unit on unit.id =formmain_0209.field0002
-- left join V_USER_VIEW_ALL us on us.staffid=formmain_0209.field0024
WHERE 1=1
-- and formmain_0209.field0035>0
and CTP_AFFAIR.node_name = '发起者' and CTP_AFFAIR.COMPLETE_TIME is null and CTP_AFFAIR.STATE = 3
<trim prefix="where" prefixOverrides="and">
<if test="referenceNum != null and referenceNum !='' "> referenceNum = #{referenceNum} </if>
<if test="busType != null and busType !='' "> and busType = #{busType} </if>