create table supcan_data_source
(
    ID          varchar(36)  not null comment '主键'
        primary key,
    SOURCE_NAME varchar(50)  null comment '数据源名称',
    `SQL`       text         null comment '数据源SQL',
    E_COLUMN    text         null comment '英文列名',
    C_COLUMN    text         null comment '中文说明',
    NOTE        text         null comment '备注',
    CREATED_BY  varchar(50)  null,
    CREATED_ON  datetime     null,
    UPDATED_BY  varchar(50)  null,
    UPDATED_ON  datetime     null,
    COD         varchar(36)  null comment '代码',
    JNDI        varchar(36)  null comment '数据源',
    PID         varchar(36)  null,
    COLUMNS     varchar(200) null comment '缓存键',
    VCOLUMNS    text         null comment '缓存名'
);

INSERT INTO ag_devmysql.supcan_data_source (ID, SOURCE_NAME, `SQL`, E_COLUMN, C_COLUMN, NOTE, CREATED_BY, CREATED_ON, UPDATED_BY, UPDATED_ON, COD, JNDI, PID, COLUMNS, VCOLUMNS) VALUES ('004CLGECJWXUF', '账单明细', 'select * from fee_bill_det', 'FEE_DET_ID,ID,FEE_BILL_MONEY,NOTES', '费用明细id,ID,账单金额,备注', null, 'admin', '2020-05-25 16:09:59', 'admin', '2020-05-27 09:08:59', 'fee_bill_det', 'default', '2222', null, null);
INSERT INTO ag_devmysql.supcan_data_source (ID, SOURCE_NAME, `SQL`, E_COLUMN, C_COLUMN, NOTE, CREATED_BY, CREATED_ON, UPDATED_BY, UPDATED_ON, COD, JNDI, PID, COLUMNS, VCOLUMNS) VALUES ('004CLZU1QKUHZ', '查询收付款申请头', 'select FEE_FACT_DATE, FEE_UNIT_ID, BANK
from fee_fact_head ', 'FEE_FACT_DATE,FEE_UNIT_ID,BANK', '收/ 付款日期,开票单位,银行', null, 'admin', '2020-05-27 10:34:35', 'admin', '2020-05-27 10:34:35', 'FEE_FACT_HEAD', 'default', '2222', null, null);
INSERT INTO ag_devmysql.supcan_data_source (ID, SOURCE_NAME, `SQL`, E_COLUMN, C_COLUMN, NOTE, CREATED_BY, CREATED_ON, UPDATED_BY, UPDATED_ON, COD, JNDI, PID, COLUMNS, VCOLUMNS) VALUES ('004CLZU1QKUI8', '查询发票头', 'select MONEY, FEE_UNIT_ID, INV_NO,INV_TITLE, COIN_KIND_ID
from inv_head', 'MONEY,FEE_UNIT_ID,INV_NO,INV_TITLE,COIN_KIND_ID', '金额,开票单位,发票号,发票抬头,币种', null, 'admin', '2020-05-27 10:44:16', 'admin', '2020-05-27 10:44:16', 'INV_HEAD', 'default', '2222', null, null);
INSERT INTO ag_devmysql.supcan_data_source (ID, SOURCE_NAME, `SQL`, E_COLUMN, C_COLUMN, NOTE, CREATED_BY, CREATED_ON, UPDATED_BY, UPDATED_ON, COD, JNDI, PID, COLUMNS, VCOLUMNS) VALUES ('004CLZU1QKUM7', '25、购入箱明细表', 'SELECT c.CONTRACT_NO,\'买入\' AS BUSI_TYPE,c.CONTRACT_DTE,c.RELEASE_NO,c.LEASE_NO,r.CNTR,r.CNTR_SIZ_TYP,r.BUY_PRICE,
r.BUY_CURRENCY_RAT,r.BUY_PRICE_RMB ,r.CNTR_CORP_LAST,r.BUSI_TIM,r.CNTR_CORP_COD,c.CY_COD,r.REMARK_TXT 
FROM contract_cntr r LEFT JOIN contract c
ON r.CONTRACT_NO = c.CONTRACT_NO @whereSql@', 'CONTRACT_NO,BUSI_TYPE,CONTRACT_DTE,RELEASE_NO,CNTR,CNTR_SIZ_TYP,BUY_PRICE,BUY_CURRENCY_RAT,BUY_PRICE_RMB,CNTR_CORP_LAST,BUSI_TIM,CNTR_CORP_COD,CY_COD,REMARK_TXT', '申请号,业务类型,申请日期,外放箱号,箱号,尺寸类型,买箱价格,买箱汇率,买箱RMB价格,原箱属,业务时间,箱属代码,堆场代码,备注', null, 'admin', '2020-05-27 11:08:15', 'admin', '2020-06-12 14:38:34', 'CONTRACT_for25', 'default', '2222', null, null);
INSERT INTO ag_devmysql.supcan_data_source (ID, SOURCE_NAME, `SQL`, E_COLUMN, C_COLUMN, NOTE, CREATED_BY, CREATED_ON, UPDATED_BY, UPDATED_ON, COD, JNDI, PID, COLUMNS, VCOLUMNS) VALUES ('004CLZU1QKVAC', '22、应收账款追踪表', 'SELECT  i.INV_ID, \'\' AS BUSI_TYPE, fd.SETTLE_ON, c.CLIENT_CODE,c.CLIENT_NAME, c.CLIENT_TYPE,   
\'\' AS INVOICE_ID, ih.INV_TITLE,ih.FEE_UNIT_ID , fd.CURRENCY, i.INV_MONEY,ih.INV_DATE, \'\' as PAY_DATE, \'\' as FK_DATE, \'\' as BANK_SLIP, \'\' as DZ_DATE, fd.CREATED_BY 
FROM fee_detail fd
LEFT JOIN inv_det i ON i.FEE_DET_ID= fd.ID 
LEFT JOIN c_client c ON c.CLIENT_CODE=fd.CLIENT_CODE 
left join inv_head ih on i.INV_ID = INV_NO 
where fd.PAY_RECEIVE_TYPE = 0 @whereSql@', 'INV_ID,BUSI_TYPE,SETTLE_ON,CLIENT_CODE,CLIENT_NAME,CLIENT_TYPE,INVOICE_ID,INV_TITLE,FEE_UNIT_ID,CURRENCY,INV_MONEY,INV_DATE,PAY_DATE,FK_DATE,BANK_SLIP,DZ_DATE,CREATED_BY', '发票号,业务类型,结算日期,结算单位,结算单位名称,客户类别,客户合同号,发票抬头,开票抬头,币种,开票金额,开票日期,合同约定应付款时间,合同付款反馈时间,客户提供水单照片,财务到账时间,开票人', null, 'admin', '2020-05-27 14:47:46', 'admin', '2020-06-12 14:45:49', 'FEE_for22', 'default', '2222', null, null);
INSERT INTO ag_devmysql.supcan_data_source (ID, SOURCE_NAME, `SQL`, E_COLUMN, C_COLUMN, NOTE, CREATED_BY, CREATED_ON, UPDATED_BY, UPDATED_ON, COD, JNDI, PID, COLUMNS, VCOLUMNS) VALUES ('004CLZU1QKVP5', '23、应付账款追踪表', 'SELECT  i.INV_ID, c.CLIENT_CODE,c.CLIENT_NAME,c.EN_CLIENT_NAME, \'\' AS BUSI_TYPE,   
fd.CURRENCY, fd.FINAL_MONEY,fd.JOB_FINISH_DATE,\'\' AS FK_DATE, fd.CHECK_TIME, 
\'\' AS PAY_DATE, \'\' AS FIN_DATE,  fd.NOTES  
FROM fee_detail fd
LEFT JOIN inv_det i ON i.FEE_DET_ID= fd.ID 
LEFT JOIN c_client c ON c.CLIENT_CODE=fd.CLIENT_CODE 
LEFT JOIN inv_head ih ON i.INV_ID = ih.INV_NO 
WHERE fd.PAY_RECEIVE_TYPE = 1 @whereSql@', 'INV_ID,CLIENT_CODE,CLIENT_NAME,EN_CLIENT_NAME,BUSI_TYPE,CURRENCY,FINAL_MONEY,JOB_FINISH_DATE,FK_DATE,CHECK_TIME,PAY_DATE,FIN_DATE,NOTES', '发票号,结算单位,结算单位名称,结算单位简称,业务类型,
币别,金额,业务提交时间,合同约定付款最后时间,财务审核时间,
预计付款时间,付款完成时间,备注
', null, 'admin', '2020-05-27 16:31:45', 'admin', '2020-06-12 14:46:04', 'FEE_for23', 'default', '2222', null, null);
INSERT INTO ag_devmysql.supcan_data_source (ID, SOURCE_NAME, `SQL`, E_COLUMN, C_COLUMN, NOTE, CREATED_BY, CREATED_ON, UPDATED_BY, UPDATED_ON, COD, JNDI, PID, COLUMNS, VCOLUMNS) VALUES ('004CLZU1QKVS8', '21、应收账款到账查询表', 'SELECT  i.INV_ID, fd.CHECK_TIME, c.CLIENT_CODE,c.CLIENT_NAME,c.CLIENT_TYPE, 
\'\' AS INVOICE_ID, ih.INV_TITLE, ih.FEE_UNIT_ID ,i.INV_MONEY, fd.FINAL_MONEY,
\'\' AS BALANCE, fd.CURRENCY, ih.VOUCHER_MAN, ih.INV_DATE,  fd.CREATED_BY, 
ih.VOUCHER_TIME, \'\' as BANK_SLIP_DATE, \'\' as TRACKING  
FROM fee_detail fd
LEFT JOIN inv_det i ON i.FEE_DET_ID= fd.ID 
LEFT JOIN c_client c ON c.CLIENT_CODE=fd.CLIENT_CODE 
left join inv_head ih on i.INV_ID = INV_NO 
where fd.PAY_RECEIVE_TYPE = 0 @whereSql@', 'INV_ID,CHECK_TIME,CLIENT_CODE,CLIENT_NAME,CLIENT_TYPE,INVOICE_ID,INV_TITLE,FEE_UNIT_ID,INV_MONEY,FINAL_MONEY,BALANCE,CURRENCY,VOUCHER_MAN,INV_DATE,CREATED_BY,VOUCHER_TIME,BANK_SLIP_DATE,TRACKING', '发票号,审核时间,客户代码,客户简称,客户类别,客户合同号,发票抬头,开票抬头,开票金额,到账金额,余额,币种,开票日期,开票人,转财务人,转财务时间,水单日期,详细跟踪情况', null, 'admin', '2020-05-27 17:08:16', 'admin', '2020-06-12 14:45:33', 'FEE_for21', 'default', '2222', null, null);
INSERT INTO ag_devmysql.supcan_data_source (ID, SOURCE_NAME, `SQL`, E_COLUMN, C_COLUMN, NOTE, CREATED_BY, CREATED_ON, UPDATED_BY, UPDATED_ON, COD, JNDI, PID, COLUMNS, VCOLUMNS) VALUES ('004CLZU1QKVY9', '20、集装箱折旧表', 'select IN_CY_TIM,concat(CNTR_SIZ_TYP,\'集装箱\') AS NAME,CNTR,CNTR_STAT,\'\' AS SUPPLIER,
RELEASE_NO,BUY_PRICE,\'\' AS ZJ_YEAR, \'\' AS YEAR_ZJ_RATE, \'\' AS MONTH_ZJ_MONEY,
\'\' AS YT_ZJ,\'\' AS NET, \'\' AS RESIDUAL_VALUE 
from cntr @whereSql@', 'IN_CY_TIM,NAME,CNTR,CNTR_STAT,SUPPLIER,RELEASE_NO,BUY_PRICE,ZJ_YEAR,YEAR_ZJ_RATE,MONTH_ZJ_MONEY,YT_ZJ,NET,RESIDUAL_VALUE', '进场日期,名称,箱号,状态,供应商,外放箱号,买箱价格,折旧月数,年折旧率5%,月折旧额,已提折旧,净额,残值50%', null, 'admin', '2020-05-27 17:38:05', 'admin', '2020-06-12 14:38:42', 'CNTR_for20', 'default', '2222', null, null);
INSERT INTO ag_devmysql.supcan_data_source (ID, SOURCE_NAME, `SQL`, E_COLUMN, C_COLUMN, NOTE, CREATED_BY, CREATED_ON, UPDATED_BY, UPDATED_ON, COD, JNDI, PID, COLUMNS, VCOLUMNS) VALUES ('004CMAUM8W52M', '19、应付堆场汇总表', 'select \'\' as PROJECT,\'\' as QY_COMPANY, c.CLIENT_CODE,c.CLIENT_NAME,c.CLIENT_SHORT,fd.CURRENCY,\'\' as QC_MONEY,\'\' as J_NAME, \'\' as D_NAME,\'\' as QM_MONEY,fd.ACTUAL_RATE,fd.NOTES 
from fee_detail fd
left join c_client c on fd.CLIENT_CODE = c.CLIENT_CODE 
where fd.PAY_RECEIVE_TYPE = 1
@whereSql@', 'PROJECT,QY_COMPANY,CLIENT_CODE,CLIENT_NAME,CLIENT_SHORT,CURRENCY,QC_MONEY,J_NAME,D_NAME,QM_MONEY,ACTUAL_RATE,NOTES', '科目名称,签约公司,供应商编码,客户,客户简称,币种,期初余额,借方,贷方,期末欠款,汇率,备注', null, 'admin', '2020-05-28 09:14:25', 'admin', '2020-06-12 14:42:22', 'FEE_for19', 'default', '2222', null, null);
INSERT INTO ag_devmysql.supcan_data_source (ID, SOURCE_NAME, `SQL`, E_COLUMN, C_COLUMN, NOTE, CREATED_BY, CREATED_ON, UPDATED_BY, UPDATED_ON, COD, JNDI, PID, COLUMNS, VCOLUMNS) VALUES ('004CMBF61PV2R', '18、应付堆场、调运等费用明细表', 'select fd.CREATED_ON,fd.CLIENT_CODE,c.CLIENT_NAME,c.EN_CLIENT_NAME,fd.CURRENCY,
\'\' AS FEE_TYPE, i.INV_ID, fd.JOB_FINISH_DATE, \'\' AS IN_CY_COD,\'\' AS HX_COD,
fd.PIECES, \'\' AS CNTR_TYPE, \'\' AS BANK, \'\' AS J_MONEY, \'\' AS D_MONEY,
fd.NOTES 
from fee_detail fd
LEFT JOIN inv_det i ON i.FEE_DET_ID= fd.ID 
LEFT JOIN c_client c ON c.CLIENT_CODE=fd.CLIENT_CODE 
LEFT JOIN inv_head ih ON i.INV_ID = ih.INV_NO 
where fd.PAY_RECEIVE_TYPE = 1 @whereSql@', 'CREATED_ON,CLIENT_CODE,CLIENT_NAME,EN_CLIENT_NAME,CURRENCY,FEE_TYPE,INV_ID,JOB_FINISH_DATE,IN_CY_COD,HX_COD,PIECES,CNTR_TYPE,BANK,J_MONEY,D_MONEY,NOTES', '日期,结算单位,客户名称,客户简称,币种,费用类型,发票号码,业务发生月份,提箱地,还箱地,数量,箱型,付款银行,借方,贷方,备注', null, 'admin', '2020-05-28 10:25:52', 'admin', '2020-06-12 14:42:45', 'FEE_for18', 'default', '2222', null, null);
INSERT INTO ag_devmysql.supcan_data_source (ID, SOURCE_NAME, `SQL`, E_COLUMN, C_COLUMN, NOTE, CREATED_BY, CREATED_ON, UPDATED_BY, UPDATED_ON, COD, JNDI, PID, COLUMNS, VCOLUMNS) VALUES ('004CMBF61PV5D', '17、应付购箱租箱汇总表', 'SELECT fd.JOB_CATEGORY_CODE,fd.CLIENT_CODE,c.CLIENT_NAME,fd.CURRENCY,
\'\' AS QC_MONEY,\'\' AS J_MONEY,\'\' AS D_MONEY,\'\' AS QM_MONEY,fd.ACTUAL_RATE 
FROM fee_detail fd
LEFT JOIN c_client c ON c.CLIENT_CODE = fd.CLIENT_CODE 
where fd.PAY_RECEIVE_TYPE = 1 @whereSql@', 'JOB_CATEGORY_CODE,CLIENT_CODE,CLIENT_NAME,CURRENCY,QC_MONEY,J_MONEY,D_MONEY,QM_MONEY,ACTUAL_RATE', '业务类型,结算单位,客户,币种,期初余额,借方,贷方,期末欠款,汇率', null, 'admin', '2020-05-28 11:17:32', 'admin', '2020-06-12 14:42:12', 'FEE_for17', 'default', '2222', null, null);
INSERT INTO ag_devmysql.supcan_data_source (ID, SOURCE_NAME, `SQL`, E_COLUMN, C_COLUMN, NOTE, CREATED_BY, CREATED_ON, UPDATED_BY, UPDATED_ON, COD, JNDI, PID, COLUMNS, VCOLUMNS) VALUES ('004CMBF61PV90', '16、应付购箱、租箱明细表', 'select fd.CREATED_ON,fd.CLIENT_CODE,c.CLIENT_NAME,c.EN_CLIENT_NAME,fd.CURRENCY,
cc.CONTRACT_NO, cc.CNTR_TYP_COD,\'\' AS BANK, \'\' AS note, cc.RELEASE_NO,
i.INV_ID, cc.CNTR_SIZ_TYP, fd.PIECES,\'\' AS UNIT_MONEY ,cc.PLAC_COD ,
\'\'AS J_MONEY,\'\' AS D_MONEY,\'\' AS FK_DATE,fd.NOTES 
from fee_detail fd
LEFT JOIN inv_det i ON i.FEE_DET_ID= fd.ID 
LEFT JOIN c_client c ON c.CLIENT_CODE=fd.CLIENT_CODE 
LEFT JOIN inv_head ih ON i.INV_ID = ih.INV_NO 
left join contract_cntr cc on fd.BUSSINESS_CODE = cc.ID 
where fd.PAY_RECEIVE_TYPE = 1 @whereSql@', 'CREATED_ON,CLIENT_CODE,CLIENT_NAME,EN_CLIENT_NAME,CURRENCY,CONTRACT_NO,CNTR_TYP_COD,BANK,note,RELEASE_NO,INV_ID,CNTR_SIZ_TYP,PIECES,UNIT_MONEY,PLAC_COD,J_MONEY,D_MONEY,FK_DATE,NOTES', '日期,公司名称,客户,客户简称,币种,系统申请号,类型代码,付款银行,说明,外放箱号,发票号,箱型,数量,单价,放箱地,借方,贷方,付款时间,备注', null, 'admin', '2020-05-28 11:48:19', 'admin', '2020-06-12 14:40:18', 'FEE_for16', 'default', '2222', null, null);
INSERT INTO ag_devmysql.supcan_data_source (ID, SOURCE_NAME, `SQL`, E_COLUMN, C_COLUMN, NOTE, CREATED_BY, CREATED_ON, UPDATED_BY, UPDATED_ON, COD, JNDI, PID, COLUMNS, VCOLUMNS) VALUES ('004CMBF61PVDI', '14、应收账款汇总表', 'SELECT \'\' AS TYPE,c.CLIENT_TYPE,c.CLIENT_NAME,c.EN_CLIENT_NAME,fd.CURRENCY,
\'\' AS QC_MONEY,\'\' AS J_MONEY,\'\' AS D_MONEY,\'\' AS QM_MONEY,fd.ACTUAL_RATE,fd.NOTES 
FROM fee_detail fd 
LEFT JOIN c_client c ON c.CLIENT_CODE = fd.CLIENT_CODE 
where fd.PAY_RECEIVE_TYPE = 0 @whereSql@', 'TYPE,CLIENT_TYPE,CLIENT_NAME,EN_CLIENT_NAME,CURRENCY,QC_MONEY,J_MONEY,D_MONEY,QM_MONEY,ACTUAL_RATE,NOTES', '性质,客户类型,客户名称,客户简称,币种,期初余额,借方,贷方,期末欠款,汇率,备注', null, 'admin', '2020-05-28 13:55:57', 'admin', '2020-06-12 14:39:42', 'FEE_for14', 'default', '2222', null, null);
INSERT INTO ag_devmysql.supcan_data_source (ID, SOURCE_NAME, `SQL`, E_COLUMN, C_COLUMN, NOTE, CREATED_BY, CREATED_ON, UPDATED_BY, UPDATED_ON, COD, JNDI, PID, COLUMNS, VCOLUMNS) VALUES ('004CMBF61PVHY', '13、应收账款明细表', 'SELECT fd.CREATED_ON,c.CLIENT_TYPE,c.CLIENT_NAME,c.CLIENT_SHORT,fd.CURRENCY,
i.INV_ID,cc.RELEASE_NO,cc.PLAC_COD,fd.PIECES,cc.CNTR_SIZ_TYP,
\'\' AS UNIT_MONEY, \'\' AS ACCEPT_FLAG,ih.FEE_UNIT_ID,\'\' AS SK_USER,fd.NOTES,
\'\' AS J_MONEY,\'\' AS D_MONEY,\'\' AS BANK 
FROM  fee_detail fd 
LEFT JOIN inv_det i ON i.FEE_DET_ID= fd.ID 
LEFT JOIN c_client c ON c.CLIENT_CODE=fd.CLIENT_CODE 
LEFT JOIN inv_head ih ON i.INV_ID = ih.INV_NO 
LEFT JOIN contract_cntr cc ON fd.BUSSINESS_CODE = cc.ID 
WHERE fd.PAY_RECEIVE_TYPE = 0 @whereSql@', 'CREATED_ON,CLIENT_TYPE,CLIENT_NAME,CLIENT_SHORT,CURRENCY,INV_ID,RELEASE_NO,PLAC_COD,PIECES,CNTR_SIZ_TYP,UNIT_MONEY,ACCEPT_FLAG,FEE_UNIT_ID,SK_USER,NOTES,J_MONEY,D_MONEY,BANK', '日期,客户类型,客户名称,客户简称,币种,
发票号,外放箱号,放箱地,数量,箱型,
单价,是否确认,开票公司,收款账户,摘要,
借方,贷方,手续费支出', null, 'admin', '2020-05-28 14:29:18', 'admin', '2020-06-12 14:39:58', 'FEE_for13', 'default', '2222', null, null);
INSERT INTO ag_devmysql.supcan_data_source (ID, SOURCE_NAME, `SQL`, E_COLUMN, C_COLUMN, NOTE, CREATED_BY, CREATED_ON, UPDATED_BY, UPDATED_ON, COD, JNDI, PID, COLUMNS, VCOLUMNS) VALUES ('004CMBF61PVK6', '10、HONEYTAK应付汇总', 'SELECT cc.CNTR_SIZ_COD,fd.PIECES,fd.CURRENCY,\'0.00\' AS BUY_UNIT_MONEY, cc.BUY_CURRENCY_RAT, \'\' AS BUY_UNIT_MONEY_HKD, \'\' AS BUY_PRICE_HKD 
FROM   fee_detail fd 
LEFT JOIN contract_cntr cc ON fd.BUSSINESS_CODE = cc.ID 
WHERE fd.PAY_RECEIVE_TYPE = 1 @whereSql@
', 'CNTR_SIZ_COD,PIECES,CURRENCY,BUY_UNIT_MONEY,BUY_CURRENCY_RAT,BUY_UNIT_MONEY_HKD,BUY_PRICE_HKD', '箱型,购入台数,币别,购入单价,购入金额,购箱汇率,购入单价HKD,购入金额HKD', null, 'admin', '2020-05-28 15:05:16', 'admin', '2020-06-12 14:39:08', 'FEE_for10', 'default', '2222', null, null);
INSERT INTO ag_devmysql.supcan_data_source (ID, SOURCE_NAME, `SQL`, E_COLUMN, C_COLUMN, NOTE, CREATED_BY, CREATED_ON, UPDATED_BY, UPDATED_ON, COD, JNDI, PID, COLUMNS, VCOLUMNS) VALUES ('004CMBF61PVNZ', '9、HONETYTAK 应付台账', 'SELECT ih.INV_DATE,ih.INV_NO,ih.FEE_UNIT_ID,ih.INV_ITEM,ih.COIN_KIND_ID,
\'\' AS RAT,\'\' AS P_MONEY,\'\' AS FK_DATE,\'\' AS FK_MONEY,
\'\' AS SX_MONEY,\'\' AS R_INV_ID, ih.MONEY
,cc.CNTR_SIZ_TYP, fd.PIECES, \'\' AS UNIT_MONEY, \'\' AS TOTAL_MONEY 
FROM inv_head ih 
LEFT JOIN inv_det i ON i.INV_ID = ih.INV_NO 
LEFT JOIN fee_detail fd ON i.FEE_DET_ID= fd.ID
LEFT JOIN contract_cntr cc ON fd.BUSSINESS_CODE = cc.ID 
where fd.PAY_RECEIVE_TYPE = 1 @whereSql@', 'INV_DATE,INV_NO,FEE_UNIT_ID,INV_ITEM,COIN_KIND_ID,RAT,P_MONEY,FK_DATE,FK_MONEY,SX_MONEY,R_INV_ID,MONEY,CNTR_SIZ_TYP,PIECES,UNIT_MONEY,TOTAL_MONEY', '发票时间,发票号码,开票单位,开票项目,币别,汇率,应付金额,付款时间,付款金额,手续费用,应收发票号,发票金额,箱型,数量,单价,总价', null, 'admin', '2020-05-28 15:50:48', 'admin', '2020-06-12 14:38:12', 'FEE_for9', 'default', '2222', null, null);
INSERT INTO ag_devmysql.supcan_data_source (ID, SOURCE_NAME, `SQL`, E_COLUMN, C_COLUMN, NOTE, CREATED_BY, CREATED_ON, UPDATED_BY, UPDATED_ON, COD, JNDI, PID, COLUMNS, VCOLUMNS) VALUES ('004CMBF61PVVM', '8、HONEYTAK应收汇总', 'SELECT \'\' AS FEE_TYPE,cc.CNTR_SIZ_TYP,fd.PIECES,fd.CURRENCY,fd.FINAL_MONEY,\'\' AS HKD_MONEY 
FROM fee_detail fd 
LEFT JOIN contract_cntr cc ON fd.BUSSINESS_CODE = cc.ID 
WHERE fd.PAY_RECEIVE_TYPE = 0 @whereSql@', 'FEE_TYPE,CNTR_SIZ_TYP,PIECES,CURRENCY,FINAL_MONEY,HKD_MONEY', '项目,箱型,销售台数,币别,销售金额,销售金额HKD', null, 'admin', '2020-05-28 16:28:05', 'admin', '2020-06-12 14:38:06', 'FEE_for8', 'default', '2222', null, null);
INSERT INTO ag_devmysql.supcan_data_source (ID, SOURCE_NAME, `SQL`, E_COLUMN, C_COLUMN, NOTE, CREATED_BY, CREATED_ON, UPDATED_BY, UPDATED_ON, COD, JNDI, PID, COLUMNS, VCOLUMNS) VALUES ('004CMBF61PVZ3', '7、HONEYTAK应收台账', 'SELECT ih.INV_DATE,ih.INV_NO,ih.FEE_UNIT_ID,ih.INV_ITEM,ih.COIN_KIND_ID,
\'\' AS RAT,\'\' AS P_MONEY,\'\' AS SK_DATE,ih.MONEY,\'\' AS SX_MONEY,
cc.CNTR_SIZ_TYP,fd.PIECES,\'\' AS UNIT_MONEY 
FROM inv_head ih 
LEFT JOIN inv_det i ON i.INV_ID = ih.INV_NO 
LEFT JOIN fee_detail fd ON i.FEE_DET_ID= fd.ID
LEFT JOIN contract_cntr cc ON fd.BUSSINESS_CODE = cc.ID 
WHERE fd.PAY_RECEIVE_TYPE = 0 @whereSql@', 'INV_DATE,INV_NO,FEE_UNIT_ID,INV_ITEM,COIN_KIND_ID,RAT,P_MONEY,SK_DATE,MONEY,SX_MONEY,CNTR_SIZ_TYP,PIECES,UNIT_MONEY', '发票时间,发票号码,客户名称,开票项目,币别,汇率,应收金额,收款时间,收款金额,手续费用,箱型,数量,单价', null, 'admin', '2020-05-28 16:50:03', 'admin', '2020-06-12 14:37:57', 'FEE_for7', 'default', '2222', null, null);
INSERT INTO ag_devmysql.supcan_data_source (ID, SOURCE_NAME, `SQL`, E_COLUMN, C_COLUMN, NOTE, CREATED_BY, CREATED_ON, UPDATED_BY, UPDATED_ON, COD, JNDI, PID, COLUMNS, VCOLUMNS) VALUES ('004CMBF61PW21', '5、库存箱明细表', 'SELECT  CNTR, CNTR_STAT,SEQ_NO, \'\' AS ORDER_ID, \'\' AS ORDER_BY,
CNTR_SIZ_TYP, BUY_PRICE, BUY_CURRENCY_RAT, BUY_PRICE_RMB, IN_CY_TIM,
RELEASE_NO, CY_COD, \'\' AS CNTR_USER, \'\' AS ORDER_TYPE  
FROM cntr @whereSql@', 'CNTR,CNTR_STAT,SEQ_NO,ORDER_ID,ORDER_BY,CNTR_SIZ_TYP,BUY_PRICE,BUY_CURRENCY_RAT,BUY_PRICE_RMB,IN_CY_TIM,RELEASE_NO,CY_COD,CNTR_USER,ORDER_TYPE', '箱号,箱状态,箱序号,委托号,委托顺序,箱型,原始买入价,汇率,RMB价格,进场时间,外放箱号,堆场,用箱人,委托类型', null, 'admin', '2020-05-28 17:17:37', 'admin', '2020-06-12 14:37:37', 'FEE_for5', 'default', '2222', null, null);
INSERT INTO ag_devmysql.supcan_data_source (ID, SOURCE_NAME, `SQL`, E_COLUMN, C_COLUMN, NOTE, CREATED_BY, CREATED_ON, UPDATED_BY, UPDATED_ON, COD, JNDI, PID, COLUMNS, VCOLUMNS) VALUES ('004CMBF61PW8R', '4、库存进销存(无数据)', null, null, null, null, 'admin', '2020-05-28 17:45:40', 'admin', '2020-06-12 14:47:17', 'FEE_for4', 'default', '2222', null, null);
INSERT INTO ag_devmysql.supcan_data_source (ID, SOURCE_NAME, `SQL`, E_COLUMN, C_COLUMN, NOTE, CREATED_BY, CREATED_ON, UPDATED_BY, UPDATED_ON, COD, JNDI, PID, COLUMNS, VCOLUMNS) VALUES ('004CMBF61PWBH', '2、资金汇总表', 'select CLIENT_NAME,\'\' AS BANK,CURRENCY,\'\' AS QC_MONEY,\'\' AS J_MONEY,\'\' AS D_MONEY,\'\' AS RATE
from fee_detail @whereSql@', 'CLIENT_NAME,BANK,CURRENCY,QC_MONEY,J_MONEY,D_MONEY,RATE', '收款公司,银行名称,币别,期初余额,借方,贷方,余额(原币)', null, 'admin', '2020-05-28 18:12:47', 'admin', '2020-06-20 14:19:27', 'FEE_for2', 'default', '2222', null, null);
INSERT INTO ag_devmysql.supcan_data_source (ID, SOURCE_NAME, `SQL`, E_COLUMN, C_COLUMN, NOTE, CREATED_BY, CREATED_ON, UPDATED_BY, UPDATED_ON, COD, JNDI, PID, COLUMNS, VCOLUMNS) VALUES ('004CMLVK6GD5Z', '1、资金明细表', 'SELECT fd.CREATED_ON,\'\' AS SK_COMPANY,ffh.BANK_ACCOUNT,c.CLIENT_CODE,ih.INV_NO,fd.JOB_CATEGORY_CODE,fd.CURRENCY,\'\' AS J_MONEY,\'\' AS D_MONEY,ffh.BANK_CHARGE 
FROM fee_detail fd 
LEFT JOIN inv_det i ON i.FEE_DET_ID= fd.ID 
LEFT JOIN c_client c ON c.CLIENT_CODE=fd.CLIENT_CODE 
LEFT JOIN inv_head ih ON i.INV_ID = ih.INV_NO 
LEFT JOIN fee_fact_det ffd ON ffd.FEE_DET_ID= fd.ID 
LEFT JOIN fee_fact_head ffh ON ffh.ID = ffd.FEE_FACT_ID 
@whereSql@', 'CREATED_ON,SK_COMPANY,BANK_ACCOUNT,CLIENT_CODE,INV_NO,JOB_CATEGORY_CODE,CURRENCY,J_MONEY,D_MONEY,BANK_CHARGE', '日期,收款公司,银行名称,开票名称,发票号,业务类型,收款币别,借方,贷方,收款手续费', null, 'admin', '2020-05-29 09:16:13', 'admin', '2020-06-02 09:47:50', 'FEE_for1', 'default', '2222', null, null);
INSERT INTO ag_devmysql.supcan_data_source (ID, SOURCE_NAME, `SQL`, E_COLUMN, C_COLUMN, NOTE, CREATED_BY, CREATED_ON, UPDATED_BY, UPDATED_ON, COD, JNDI, PID, COLUMNS, VCOLUMNS) VALUES ('004CMMD7HN2HG', '6、单箱利润核算', 'SELECT c.CNTR_CORP_COD,c.CNTR,\'\' AS ZX_MONEY,\'\' AS SX_MONEY,\'\' AS DX_MONEY,\'\' AS OTHER_MONEY,\'\' AS COST,\'\' AS ZX_COST,\'\' AS CY_FEE,\'\' AS TRANS_FEE,\'\' AS REPAIR_FEE,
\'\' AS YX_FEE,\'\' AS OTHER_FEE,\'\' AS GROSS_PROFIT,c.BUY_CURRENCY_RAT 
FROM cntr c @whereSql@', 'CNTR_CORP_COD,CNTR,ZX_MONEY,SX_MONEY,DX_MONEY,OTHER_MONEY,COST,ZX_COST,CY_FEE,TRANS_FEE,REPAIR_FEE,YX_FEE,OTHER_FEE,GROSS_PROFIT,BUY_CURRENCY_RAT', '箱属,箱号,租箱收入,售箱收入,调箱收入,其他收入,箱成本,租箱成本,堆场费用,运输费用(调运),修理费用,验箱费用,其他费用,箱毛利,买箱汇率', null, 'admin', '2020-05-29 10:18:36', 'admin', '2020-06-12 14:37:42', 'FEE_for6', 'default', '2222', null, null);
INSERT INTO ag_devmysql.supcan_data_source (ID, SOURCE_NAME, `SQL`, E_COLUMN, C_COLUMN, NOTE, CREATED_BY, CREATED_ON, UPDATED_BY, UPDATED_ON, COD, JNDI, PID, COLUMNS, VCOLUMNS) VALUES ('004CMMD7HN2L3', '11、售箱收入月度统计', 'SELECT cc.CNTR_SIZ_TYP, fd.PIECES ,fd.FINAL_MONEY,fd.CREATED_ON 
FROM  fee_detail fd 
LEFT JOIN contract_cntr cc ON fd.BUSSINESS_CODE = cc.ID @whereSql@', 'CNTR_SIZ_TYP,PIECES,FINAL_MONEY,CREATED_ON', '科目名称,数量,金额,时间', null, 'admin', '2020-05-29 11:17:25', 'admin', '2020-06-12 14:39:15', 'FEE_for11', 'default', '2222', null, null);
INSERT INTO ag_devmysql.supcan_data_source (ID, SOURCE_NAME, `SQL`, E_COLUMN, C_COLUMN, NOTE, CREATED_BY, CREATED_ON, UPDATED_BY, UPDATED_ON, COD, JNDI, PID, COLUMNS, VCOLUMNS) VALUES ('004CMMD7HN2Q6', '12、租箱收入月度统计', 'SELECT c.CLIENT_NAME, fd.FINAL_MONEY, fd.CREATED_ON 
FROM  fee_detail fd 
LEFT JOIN contract_cntr cc ON fd.BUSSINESS_CODE = cc.ID 
LEFT JOIN c_client c ON c.CLIENT_CODE=fd.CLIENT_CODE 
@whereSql@', 'CLIENT_NAME,FINAL_MONEY,CREATED_ON', '客户名称,金额,时间', null, 'admin', '2020-05-29 14:17:12', 'admin', '2020-06-12 14:39:27', 'FEE_for12', 'default', '2222', null, null);
INSERT INTO ag_devmysql.supcan_data_source (ID, SOURCE_NAME, `SQL`, E_COLUMN, C_COLUMN, NOTE, CREATED_BY, CREATED_ON, UPDATED_BY, UPDATED_ON, COD, JNDI, PID, COLUMNS, VCOLUMNS) VALUES ('004CMMD7HN2RY', '15、客户应收款统计表', 'SELECT c.CLIENT_NAME,fd.CURRENCY, fd.FINAL_MONEY, fd.CREATED_ON 
FROM  fee_detail fd 
LEFT JOIN contract_cntr cc ON fd.BUSSINESS_CODE = cc.ID 
LEFT JOIN c_client c ON c.CLIENT_CODE=fd.CLIENT_CODE 
WHERE fd.PAY_RECEIVE_TYPE = 0 @whereSql@', 'CLIENT_NAME,CURRENCY,FINAL_MONEY,CREATED_ON', '客户名称,币别,金额,时间', null, 'admin', '2020-05-29 14:28:00', 'admin', '2020-06-12 14:39:35', 'FEE_for15', 'default', '2222', null, null);
INSERT INTO ag_devmysql.supcan_data_source (ID, SOURCE_NAME, `SQL`, E_COLUMN, C_COLUMN, NOTE, CREATED_BY, CREATED_ON, UPDATED_BY, UPDATED_ON, COD, JNDI, PID, COLUMNS, VCOLUMNS) VALUES ('004CMMD7HN2WB', '24、应收账款账龄表', 'SELECT cc.BUS_CONTRACT,cc.CLIENT_NAME,ih.MONEY,ih.INV_DATE,cc.VALID_DATE, ih.COIN_KIND_ID 
FROM inv_head ih 
LEFT JOIN inv_det i ON i.INV_ID = ih.INV_NO 
LEFT JOIN fee_detail fd ON i.FEE_DET_ID= fd.ID 
LEFT JOIN c_client cc ON fd.CLIENT_CODE=cc.CLIENT_CODE @whereSql@', 'BUS_CONTRACT,CLIENT_NAME,MONEY,INV_DATE,VALID_DATE,COIN_KIND_ID', '客户经理,客户名称,金额,时间,合同期限,币别', null, 'admin', '2020-05-29 15:24:03', 'admin', '2020-06-12 14:46:28', 'FEE_for24', 'default', '2222', null, null);
INSERT INTO ag_devmysql.supcan_data_source (ID, SOURCE_NAME, `SQL`, E_COLUMN, C_COLUMN, NOTE, CREATED_BY, CREATED_ON, UPDATED_BY, UPDATED_ON, COD, JNDI, PID, COLUMNS, VCOLUMNS) VALUES ('004CNULHY5VBP', '币别', 'select SYS_KEY, SYS_VALUE 
from s_code
where SYS_CATEGORY = \'COIN_KIND_ID\'', 'SYS_KEY,SYS_VALUE', '键,值', null, 'admin', '2020-06-02 10:57:11', 'admin', '2020-06-02 10:57:11', 'COIN_KIND', 'default', '3333', null, null);
INSERT INTO ag_devmysql.supcan_data_source (ID, SOURCE_NAME, `SQL`, E_COLUMN, C_COLUMN, NOTE, CREATED_BY, CREATED_ON, UPDATED_BY, UPDATED_ON, COD, JNDI, PID, COLUMNS, VCOLUMNS) VALUES ('004CP2FNQFLLH', '3、资金收支汇总', 'SELECT ID, PAY_RECEIVE_TYPE, CURRENCY,CREATED_ON, FINAL_MONEY 
FROM fee_detail @whereSql@', 'ID,PAY_RECEIVE_TYPE,CURRENCY,CREATED_ON,FINAL_MONEY', 'ID,收付类型,币种,创建时间,金额', null, 'admin', '2020-06-06 10:54:07', 'admin', '2020-06-12 14:32:02', 'FEE_for3', 'default', '2222', null, null);
INSERT INTO ag_devmysql.supcan_data_source (ID, SOURCE_NAME, `SQL`, E_COLUMN, C_COLUMN, NOTE, CREATED_BY, CREATED_ON, UPDATED_BY, UPDATED_ON, COD, JNDI, PID, COLUMNS, VCOLUMNS) VALUES ('004CQYT3L2JW8', '堆场', 'SELECT  ID K, CLIENT_NAME V 
 FROM C_CLIENT WHERE id IN (SELECT client_code FROM c_client_type_rela_data WHERE client_type_code = \'CY\')', 'K,V', '键,值', null, 'admin', '2020-06-12 16:54:47', 'admin', '2020-06-12 16:56:35', 'C_CLIENT_CY', 'default', '3333', null, null);
INSERT INTO ag_devmysql.supcan_data_source (ID, SOURCE_NAME, `SQL`, E_COLUMN, C_COLUMN, NOTE, CREATED_BY, CREATED_ON, UPDATED_BY, UPDATED_ON, COD, JNDI, PID, COLUMNS, VCOLUMNS) VALUES ('004CQYT3L2K02', '箱属', ' SELECT ID K, CLIENT_NAME V 
 FROM C_CLIENT WHERE id IN (SELECT client_code FROM c_client_type_rela_data WHERE client_type_code = \'CM\')', 'K,V', '键,值', null, 'admin', '2020-06-12 17:02:51', 'admin', '2020-06-12 17:02:51', 'C_CLIENT_CM', 'default', '3333', null, null);
INSERT INTO ag_devmysql.supcan_data_source (ID, SOURCE_NAME, `SQL`, E_COLUMN, C_COLUMN, NOTE, CREATED_BY, CREATED_ON, UPDATED_BY, UPDATED_ON, COD, JNDI, PID, COLUMNS, VCOLUMNS) VALUES ('004CS729WYKZ4', '箱盘存', 'SELECT CNTR, CNTR_SIZ_TYP, CNTR_CORP_LAST, CNTR_CORP_COD, CNTR_STAT, 
IN_CY_COD, LEASE_NO, RELEASE_NO, CY_COD, LOCK_ID, 
CNTR_LEV, CNTR_LEV_LAS, CNTR_TXT_LAS, CNTR_TXT, DAM_ID, 
CNTR_DAM, IN_CY_TIM, IN_CY_TXT, OUT_CY_TIM, OUT_CY_TXT, 
TARE_WEIGHT, REMARK_TXT, OPER_NAM, RECORD_TIM, UPDATE_NAM, 
UPDATE_TIM, BUY_PRICE, BUY_CURRENCY_RAT, BUY_PRICE_RMB, BORN_YEAR, 
LOCK_TXT
FROM cntr
', '箱号,尺寸类型,原箱属,箱属代码,当前状态,进场方式,内放箱号,外放箱号,堆场代码,锁箱标志,箱况等级,原箱况等级,原箱况,箱况,箱残损,箱残损描述,进场时间,进场来源,出场时间,出场去向,皮重,备注,操作员,记录时间,最终修改人,最终修改时间,买箱价格,买箱汇率,买箱RMB价格, 造箱日期,锁箱说明', 'CNTR,CNTR_SIZ_TYP,CNTR_CORP_LAST,CNTR_CORP_COD,CNTR_STAT, IN_CY_COD, LEASE_NO, RELEASE_NO, CY_COD, LOCK_ID,CNTR_LEV, CNTR_LEV_LAS, CNTR_TXT_LAS, CNTR_TXT,DAM_ID, CNTR_DAM, IN_CY_TIM, IN_CY_TXT, OUT_CY_TIM,OUT_CY_TXT, TARE_WEIGHT, REMARK_TXT,OPER_NAM,RECORD_TIM, UPDATE_NAM, UPDATE_TIM,BUY_PRICE, BUY_CURRENCY_RAT, BUY_PRICE_RMB, BORN_YEAR, LOCK_TXT', null, 'admin', '2020-06-16 15:48:45', 'admin', '2020-06-16 16:07:46', 'CNTR_INVENTORY', 'default', '4444', null, null);
INSERT INTO ag_devmysql.supcan_data_source (ID, SOURCE_NAME, `SQL`, E_COLUMN, C_COLUMN, NOTE, CREATED_BY, CREATED_ON, UPDATED_BY, UPDATED_ON, COD, JNDI, PID, COLUMNS, VCOLUMNS) VALUES ('004CYM3V6CED9', '费用报表', 'select f.BUSSINESS_CODE,f.FEE_LIST_ID,f.FINAL_MONEY,c.CNTR,k.DESCRIPTION,cl.CLIENT_NAME,if(f.PAY_RECEIVE_TYPE=\'0\',\'应收费用\',\'应付费用\') PR from C_CLIENT cl,fee_detail f,contract_cntr c,C_BASE_CHARGING_ITEM k where cl.ID=f.CLIENT_CODE and  f.BUSSINESS_CODE=c.ID and f.FEE_LIST_ID=k.ID @whereSql@', 'BUSSINESS_CODE,FEE_LIST_ID,FINAL_MONEY,CNTR,DESCRIPTION,CLIENT_NAME,PR', '箱号id,费用列表id,费用,箱号,费用列表,结算单位,PAY_RECEIVE_TYPE', null, 'admin', '2020-07-07 15:15:50', 'admin', '2020-07-09 16:02:23', 'fee_detail', 'default', '2222', null, null);
INSERT INTO ag_devmysql.supcan_data_source (ID, SOURCE_NAME, `SQL`, E_COLUMN, C_COLUMN, NOTE, CREATED_BY, CREATED_ON, UPDATED_BY, UPDATED_ON, COD, JNDI, PID, COLUMNS, VCOLUMNS) VALUES ('2222', '费用报表', null, null, null, null, null, null, null, null, null, null, '-1', null, null);
INSERT INTO ag_devmysql.supcan_data_source (ID, SOURCE_NAME, `SQL`, E_COLUMN, C_COLUMN, NOTE, CREATED_BY, CREATED_ON, UPDATED_BY, UPDATED_ON, COD, JNDI, PID, COLUMNS, VCOLUMNS) VALUES ('3333', '报表统计', null, null, null, null, null, null, null, null, null, null, '-1', null, null);
INSERT INTO ag_devmysql.supcan_data_source (ID, SOURCE_NAME, `SQL`, E_COLUMN, C_COLUMN, NOTE, CREATED_BY, CREATED_ON, UPDATED_BY, UPDATED_ON, COD, JNDI, PID, COLUMNS, VCOLUMNS) VALUES ('4444', '箱报表', null, null, null, null, null, null, null, null, null, null, '-1', null, null);
