fix: 新增网银核销明细表 逾期客户信息表

This commit is contained in:
maliang 2020-11-26 16:56:16 +08:00
parent e5d2380798
commit 5a1dbab2c3
2 changed files with 1097 additions and 0 deletions

View File

@ -0,0 +1,613 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<TenwaReport>
<datasources>
<datasource>
<id>2c9023815726a036015726a496b00001</id>
<dataSourceName>eleasing_mysql</dataSourceName>
<dataSourceType>SPRING</dataSourceType>
<jndi>dataSourceJDBC</jndi>
<url></url>
<username></username>
<driverName></driverName>
<password></password>
<dialect>com.tenwa.report.query.dialect.MysqlDialect</dialect>
<dialectName>Mysql</dialectName>
</datasource>
</datasources>
<reports>
<report>
<id>2c9c81b67578fbb30175cef6042d0002</id>
<name>网银入账明细表</name>
<enname>online_bank_entry</enname>
<code>obe_20201116_1051</code>
<isActived>true</isActived>
<position>18</position>
<reportType>REPORT</reportType>
<parentReport>402882355da074c8015da089e7050001</parentReport>
<children/>
<layouts>
<layout>2c9c81b67578fbb30175cef87e83001c</layout>
</layouts>
</report>
</reports>
<tables>
<table>
<id>2c9c81b67578fbb30175cef7a7890003</id>
<name>网银核销明细表</name>
<enname>online_bank_entry</enname>
<reportDataSource>2c9023815726a036015726a496b00001</reportDataSource>
<queryType>COMPLEXSQL</queryType>
<sql>select a.EBANK_SN, a.FACT_DATE, a.FACT_MONEY, a.CONTRACT_NUMBER, a.PROJECT_NAME, a.type, a.HAD_MONEY,a.MAYOPE_MONEY,
a.PLAN_LIST, a.CORPUS,a.INTEREST,a.PENALTY,a.lfi_fact_money,
case WHEN a.sub_type = 'feetype1' then a.lfi_fact_money END service_amount,
case WHEN a.sub_type = 'feetype16' OR a.sub_type = 'feetype17' OR a.sub_type = 'feetype2' then a.lfi_fact_money END bond_amount,
case WHEN a.sub_type = 'feetype4' then a.lfi_fact_money END reserve_amount ,
case WHEN a.sub_type = 'feetype1' then '手续费'
when a.sub_type = 'feetype16' then '抵扣保证金'
when a.sub_type = 'feetype17' then '退还保证金'
when a.sub_type = 'feetype2' then '保证金'
when a.sub_type = 'feetype4' then '留购价款'
else a.sub_type
end sub_type,
a.CORPUS_OVERAGE, a.NOMINAL_PRICE, a.HANDLING_CHARGE, a.DUN_PENALTY, a.REPAYMENT_INTEREST, a.OTHER_IN, a.return_money
from (
select le.FACT_DATE,le.CLIENT_ACCOUNT,le.CLIENT_ACC_NUMBER, le.FACT_MONEY,le.HAD_MONEY,le.MAYOPE_MONEY,
lci.PROJECT_NAME,lci.CONTRACT_NUMBER,le.ID, '网银还款' as type, le.EBANK_SN,
'网银还款' as sub_type, lri.PLAN_LIST, lri.CORPUS,lri.INTEREST,lri.PENALTY,
'' as lfi_fact_money,
'' as CORPUS_OVERAGE, '' as NOMINAL_PRICE, '' as HANDLING_CHARGE, '' as DUN_PENALTY, '' as REPAYMENT_INTEREST, '' as OTHER_IN, '' as return_money
from LC_EBANK le
LEFT JOIN lc_rent_income lri on le.ID=lri.EBANK_NUMBER
LEFT JOIN lb_contract_info lci on lri.CONTRACT_ID=lci.id
where lri.EBANK_NUMBER is not null
union all
select le.FACT_DATE,le.CLIENT_ACCOUNT,le.CLIENT_ACC_NUMBER, le.FACT_MONEY,le.HAD_MONEY,le.MAYOPE_MONEY,
lci.PROJECT_NAME,lci.CONTRACT_NUMBER,le.ID, '资金核销' as type, le.EBANK_SN,
lfi.FEE_TYPE as sub_type, '' as PLAN_LIST,'' as CORPUS,'' as INTEREST,'' as PENALTY,
lfi.FACT_MONEY as lfi_fact_money,
'' as CORPUS_OVERAGE, '' as NOMINAL_PRICE, '' as HANDLING_CHARGE, '' as DUN_PENALTY, '' as REPAYMENT_INTEREST, '' as OTHER_IN, '' as return_money
from LC_EBANK le
LEFT JOIN lc_fund_income lfi on le.ID=lfi.EBANK_NUMBER
LEFT JOIN lb_contract_info lci on lfi.CONTRACT_ID=lci.id
where lfi.FEE_TYPE is not null
union all
select le.FACT_DATE,le.CLIENT_ACCOUNT,le.CLIENT_ACC_NUMBER, le.FACT_MONEY,le.HAD_MONEY,le.MAYOPE_MONEY,
lci.PROJECT_NAME,lci.CONTRACT_NUMBER,le.ID, '提前结清' as type, le.EBANK_SN,
'提前结清' as sub_type, '' as PLAN_LIST,'' as CORPUS,'' as INTEREST,'' as PENALTY,
'' as lfi_fact_money,
lfr.CORPUS_OVERAGE, lfr.NOMINAL_PRICE, lfr.HANDLING_CHARGE, lfr.DUN_PENALTY, lfr.REPAYMENT_INTEREST, lfr.OTHER_IN, '' as return_money
from LC_EBANK le
LEFT JOIN lc_ebank_temp let ON let.EBANK_NUMBER=le.ID
LEFT JOIN LC_FUND_RENT_ADJUST lfr ON lfr.FLOWUNID=let.FLOWUNID
LEFT JOIN lb_contract_info lci ON lfr.CONTRACT_ID=lci.id
where lfr.FLOWUNID is not null
union all
select le.FACT_DATE,le.CLIENT_ACCOUNT,le.CLIENT_ACC_NUMBER, le.FACT_MONEY,le.HAD_MONEY,le.MAYOPE_MONEY,
'' as PROJECT_NAME,'' as CONTRACT_NUMBER,le.ID, '其它支付' as type, le.EBANK_SN,
'网银退还' as sub_type, '' as PLAN_LIST,'' as CORPUS,'' as INTEREST,'' as PENALTY,
'' as lfi_fact_money,
'' as CORPUS_OVERAGE, '' as NOMINAL_PRICE, '' as HANDLING_CHARGE, '' as DUN_PENALTY, '' as REPAYMENT_INTEREST, '' as OTHER_IN, le.return_money
from lc_ebank_temp le
LEFT JOIN (select * from flow_object where flowno = 'OtherPayFlow') fo on le.FLOWUNID=fo.objectno
where fo.objectno is not null
) a</sql>
<sqlParamValue></sqlParamValue>
<columns>
<column>
<id>2c9c81b67578fbb30175cf0152e70060</id>
<name>EBANK_SN</name>
<columnDataType>STRING</columnDataType>
<formater></formater>
<label>网银流水号</label>
<enLabel>EBANK_SN</enLabel>
<width>100</width>
<position>24</position>
<isVisible>true</isVisible>
<color></color>
<isCountTotal>false</isCountTotal>
<isCountSubTotal>false</isCountSubTotal>
<isGroupby>false</isGroupby>
<isMerge>false</isMerge>
<action></action>
<actionParamters></actionParamters>
<actionCondition></actionCondition>
</column>
<column>
<id>2c9c81b67578fbb30175cf0152e70059</id>
<name>FACT_DATE</name>
<columnDataType>STRING</columnDataType>
<formater></formater>
<label>到账日期</label>
<enLabel>FACT_DATE</enLabel>
<width>100</width>
<position>25</position>
<isVisible>true</isVisible>
<color></color>
<isCountTotal>false</isCountTotal>
<isCountSubTotal>false</isCountSubTotal>
<isGroupby>false</isGroupby>
<isMerge>false</isMerge>
<action></action>
<actionParamters></actionParamters>
<actionCondition></actionCondition>
</column>
<column>
<id>2c9c81b67578fbb30175cf0152e60050</id>
<name>FACT_MONEY</name>
<columnDataType>NUMBER</columnDataType>
<formater></formater>
<label>到账金额</label>
<enLabel>FACT_MONEY</enLabel>
<width>100</width>
<position>26</position>
<isVisible>true</isVisible>
<color></color>
<isCountTotal>false</isCountTotal>
<isCountSubTotal>false</isCountSubTotal>
<isGroupby>false</isGroupby>
<isMerge>false</isMerge>
<action></action>
<actionParamters></actionParamters>
<actionCondition></actionCondition>
</column>
<column>
<id>2c9c81b67578fbb30175cf0152e60053</id>
<name>CONTRACT_NUMBER</name>
<columnDataType>STRING</columnDataType>
<formater></formater>
<label>核销合同号码</label>
<enLabel>CONTRACT_NUMBER</enLabel>
<width>100</width>
<position>27</position>
<isVisible>true</isVisible>
<color></color>
<isCountTotal>false</isCountTotal>
<isCountSubTotal>false</isCountSubTotal>
<isGroupby>false</isGroupby>
<isMerge>false</isMerge>
<action></action>
<actionParamters></actionParamters>
<actionCondition></actionCondition>
</column>
<column>
<id>2c9c81b67578fbb30175cf0152e7005e</id>
<name>PROJECT_NAME</name>
<columnDataType>STRING</columnDataType>
<formater></formater>
<label>核销客户名</label>
<enLabel>PROJECT_NAME</enLabel>
<width>100</width>
<position>28</position>
<isVisible>true</isVisible>
<color></color>
<isCountTotal>false</isCountTotal>
<isCountSubTotal>false</isCountSubTotal>
<isGroupby>false</isGroupby>
<isMerge>false</isMerge>
<action></action>
<actionParamters></actionParamters>
<actionCondition></actionCondition>
</column>
<column>
<id>2c9c81b67578fbb30175cf0152e7005c</id>
<name>type</name>
<columnDataType>STRING</columnDataType>
<formater></formater>
<label>业务类型</label>
<enLabel>type</enLabel>
<width>100</width>
<position>29</position>
<isVisible>true</isVisible>
<color></color>
<isCountTotal>false</isCountTotal>
<isCountSubTotal>false</isCountSubTotal>
<isGroupby>false</isGroupby>
<isMerge>false</isMerge>
<action></action>
<actionParamters></actionParamters>
<actionCondition></actionCondition>
</column>
<column>
<id>2c9c81b67578fbb30175cf0152e7005d</id>
<name>sub_type</name>
<columnDataType>STRING</columnDataType>
<formater></formater>
<label>核销类型</label>
<enLabel>sub_type</enLabel>
<width>100</width>
<position>30</position>
<isVisible>true</isVisible>
<color></color>
<isCountTotal>false</isCountTotal>
<isCountSubTotal>false</isCountSubTotal>
<isGroupby>false</isGroupby>
<isMerge>false</isMerge>
<action></action>
<actionParamters></actionParamters>
<actionCondition></actionCondition>
</column>
<column>
<id>2c9c81b67578fbb30175cf0152e70058</id>
<name>HAD_MONEY</name>
<columnDataType>NUMBER</columnDataType>
<formater></formater>
<label>核销总金额</label>
<enLabel>HAD_MONEY</enLabel>
<width>100</width>
<position>31</position>
<isVisible>true</isVisible>
<color></color>
<isCountTotal>false</isCountTotal>
<isCountSubTotal>false</isCountSubTotal>
<isGroupby>false</isGroupby>
<isMerge>false</isMerge>
<action></action>
<actionParamters></actionParamters>
<actionCondition></actionCondition>
</column>
<column>
<id>2c9c81b67578fbb30175cf0152e70057</id>
<name>MAYOPE_MONEY</name>
<columnDataType>NUMBER</columnDataType>
<formater></formater>
<label>剩余金额</label>
<enLabel>MAYOPE_MONEY</enLabel>
<width>100</width>
<position>32</position>
<isVisible>true</isVisible>
<color></color>
<isCountTotal>false</isCountTotal>
<isCountSubTotal>false</isCountSubTotal>
<isGroupby>false</isGroupby>
<isMerge>false</isMerge>
<action></action>
<actionParamters></actionParamters>
<actionCondition></actionCondition>
</column>
<column>
<id>2c9c81b67578fbb30176028dea620067</id>
<name>return_money</name>
<columnDataType>STRING</columnDataType>
<formater></formater>
<label>返还金额</label>
<enLabel>return_money</enLabel>
<width>100</width>
<position>33</position>
<isVisible>true</isVisible>
<color></color>
<isCountTotal>false</isCountTotal>
<isCountSubTotal>false</isCountSubTotal>
<isGroupby>false</isGroupby>
<isMerge>false</isMerge>
<action></action>
<actionParamters></actionParamters>
<actionCondition></actionCondition>
</column>
<column>
<id>2c9c81b67578fbb30175cf0152e70062</id>
<name>PLAN_LIST</name>
<columnDataType>STRING</columnDataType>
<formater></formater>
<label>期次</label>
<enLabel>PLAN_LIST</enLabel>
<width>100</width>
<position>34</position>
<isVisible>true</isVisible>
<color></color>
<isCountTotal>false</isCountTotal>
<isCountSubTotal>false</isCountSubTotal>
<isGroupby>false</isGroupby>
<isMerge>false</isMerge>
<action></action>
<actionParamters></actionParamters>
<actionCondition></actionCondition>
</column>
<column>
<id>2c9c81b67578fbb30175cf0152e70056</id>
<name>CORPUS</name>
<columnDataType>STRING</columnDataType>
<formater></formater>
<label>本金</label>
<enLabel>CORPUS</enLabel>
<width>100</width>
<position>35</position>
<isVisible>true</isVisible>
<color></color>
<isCountTotal>false</isCountTotal>
<isCountSubTotal>false</isCountSubTotal>
<isGroupby>false</isGroupby>
<isMerge>false</isMerge>
<action></action>
<actionParamters></actionParamters>
<actionCondition></actionCondition>
</column>
<column>
<id>2c9c81b67578fbb30175cf0152e70055</id>
<name>INTEREST</name>
<columnDataType>STRING</columnDataType>
<formater></formater>
<label>利息</label>
<enLabel>INTEREST</enLabel>
<width>100</width>
<position>36</position>
<isVisible>true</isVisible>
<color></color>
<isCountTotal>false</isCountTotal>
<isCountSubTotal>false</isCountSubTotal>
<isGroupby>false</isGroupby>
<isMerge>false</isMerge>
<action></action>
<actionParamters></actionParamters>
<actionCondition></actionCondition>
</column>
<column>
<id>2c9c81b67578fbb30175cf0152e70063</id>
<name>PENALTY</name>
<columnDataType>STRING</columnDataType>
<formater></formater>
<label>罚息</label>
<enLabel>PENALTY</enLabel>
<width>100</width>
<position>37</position>
<isVisible>true</isVisible>
<color></color>
<isCountTotal>false</isCountTotal>
<isCountSubTotal>false</isCountSubTotal>
<isGroupby>false</isGroupby>
<isMerge>false</isMerge>
<action></action>
<actionParamters></actionParamters>
<actionCondition></actionCondition>
</column>
<column>
<id>2c9c81b67578fbb30175cf0152e7005a</id>
<name>lfi_fact_money</name>
<columnDataType>STRING</columnDataType>
<formater></formater>
<label>资金核销金额</label>
<enLabel>lfi_fact_money</enLabel>
<width>100</width>
<position>38</position>
<isVisible>true</isVisible>
<color></color>
<isCountTotal>false</isCountTotal>
<isCountSubTotal>false</isCountSubTotal>
<isGroupby>false</isGroupby>
<isMerge>false</isMerge>
<action></action>
<actionParamters></actionParamters>
<actionCondition></actionCondition>
</column>
<column>
<id>2c9c81b67578fbb30175cf0152e70054</id>
<name>service_amount</name>
<columnDataType>STRING</columnDataType>
<formater></formater>
<label>手续费</label>
<enLabel>service_amount</enLabel>
<width>100</width>
<position>39</position>
<isVisible>true</isVisible>
<color></color>
<isCountTotal>false</isCountTotal>
<isCountSubTotal>false</isCountSubTotal>
<isGroupby>false</isGroupby>
<isMerge>false</isMerge>
<action></action>
<actionParamters></actionParamters>
<actionCondition></actionCondition>
</column>
<column>
<id>2c9c81b67578fbb30175cf0152e6004e</id>
<name>bond_amount</name>
<columnDataType>STRING</columnDataType>
<formater></formater>
<label>保证金</label>
<enLabel>bond_amount</enLabel>
<width>100</width>
<position>40</position>
<isVisible>true</isVisible>
<color></color>
<isCountTotal>false</isCountTotal>
<isCountSubTotal>false</isCountSubTotal>
<isGroupby>false</isGroupby>
<isMerge>false</isMerge>
<action></action>
<actionParamters></actionParamters>
<actionCondition></actionCondition>
</column>
<column>
<id>2c9c81b67578fbb30175cf0152e7005b</id>
<name>reserve_amount</name>
<columnDataType>STRING</columnDataType>
<formater></formater>
<label>留购价</label>
<enLabel>reserve_amount</enLabel>
<width>100</width>
<position>41</position>
<isVisible>true</isVisible>
<color></color>
<isCountTotal>false</isCountTotal>
<isCountSubTotal>false</isCountSubTotal>
<isGroupby>false</isGroupby>
<isMerge>false</isMerge>
<action></action>
<actionParamters></actionParamters>
<actionCondition></actionCondition>
</column>
<column>
<id>2c9c81b67578fbb30175cf0152e60051</id>
<name>CORPUS_OVERAGE</name>
<columnDataType>STRING</columnDataType>
<formater></formater>
<label>剩余本金</label>
<enLabel>CORPUS_OVERAGE</enLabel>
<width>100</width>
<position>42</position>
<isVisible>true</isVisible>
<color></color>
<isCountTotal>false</isCountTotal>
<isCountSubTotal>false</isCountSubTotal>
<isGroupby>false</isGroupby>
<isMerge>false</isMerge>
<action></action>
<actionParamters></actionParamters>
<actionCondition></actionCondition>
</column>
<column>
<id>2c9c81b67578fbb30175cf0152e60052</id>
<name>NOMINAL_PRICE</name>
<columnDataType>STRING</columnDataType>
<formater></formater>
<label>留购价款</label>
<enLabel>NOMINAL_PRICE</enLabel>
<width>100</width>
<position>43</position>
<isVisible>true</isVisible>
<color></color>
<isCountTotal>false</isCountTotal>
<isCountSubTotal>false</isCountSubTotal>
<isGroupby>false</isGroupby>
<isMerge>false</isMerge>
<action></action>
<actionParamters></actionParamters>
<actionCondition></actionCondition>
</column>
<column>
<id>2c9c81b67578fbb30175cf0152e6004f</id>
<name>HANDLING_CHARGE</name>
<columnDataType>STRING</columnDataType>
<formater></formater>
<label>违约金</label>
<enLabel>HANDLING_CHARGE</enLabel>
<width>100</width>
<position>44</position>
<isVisible>true</isVisible>
<color></color>
<isCountTotal>false</isCountTotal>
<isCountSubTotal>false</isCountSubTotal>
<isGroupby>false</isGroupby>
<isMerge>false</isMerge>
<action></action>
<actionParamters></actionParamters>
<actionCondition></actionCondition>
</column>
<column>
<id>2c9c81b67578fbb30175cf0152e6004d</id>
<name>DUN_PENALTY</name>
<columnDataType>STRING</columnDataType>
<formater></formater>
<label>逾期罚息</label>
<enLabel>DUN_PENALTY</enLabel>
<width>100</width>
<position>45</position>
<isVisible>true</isVisible>
<color></color>
<isCountTotal>false</isCountTotal>
<isCountSubTotal>false</isCountSubTotal>
<isGroupby>false</isGroupby>
<isMerge>false</isMerge>
<action></action>
<actionParamters></actionParamters>
<actionCondition></actionCondition>
</column>
<column>
<id>2c9c81b67578fbb30175cf0152e70061</id>
<name>REPAYMENT_INTEREST</name>
<columnDataType>STRING</columnDataType>
<formater></formater>
<label>还款日息差</label>
<enLabel>REPAYMENT_INTEREST</enLabel>
<width>100</width>
<position>46</position>
<isVisible>true</isVisible>
<color></color>
<isCountTotal>false</isCountTotal>
<isCountSubTotal>false</isCountSubTotal>
<isGroupby>false</isGroupby>
<isMerge>false</isMerge>
<action></action>
<actionParamters></actionParamters>
<actionCondition></actionCondition>
</column>
<column>
<id>2c9c81b67578fbb30175cf0152e7005f</id>
<name>OTHER_IN</name>
<columnDataType>STRING</columnDataType>
<formater></formater>
<label>其他应收</label>
<enLabel>OTHER_IN</enLabel>
<width>100</width>
<position>47</position>
<isVisible>true</isVisible>
<color></color>
<isCountTotal>false</isCountTotal>
<isCountSubTotal>false</isCountSubTotal>
<isGroupby>false</isGroupby>
<isMerge>false</isMerge>
<action></action>
<actionParamters></actionParamters>
<actionCondition></actionCondition>
</column>
</columns>
<controls/>
<searchs/>
<searchExpress></searchExpress>
<filters>
<filter>
<id>2c9c81b67578fbb30175d02a86880064</id>
<name>EBANK_SN</name>
<enname>EBANK_SN</enname>
<label>网银流水号</label>
<filterType>FILTER</filterType>
<dbType>STRING</dbType>
<htmlType>TEXT</htmlType>
<position>0</position>
</filter>
<filter>
<id>2c9c81b67578fbb30175d02bd27c0065</id>
<name>type</name>
<enname>type</enname>
<label>业务类型</label>
<filterType>FILTER</filterType>
<dbType>STRING</dbType>
<htmlType>TEXT</htmlType>
<position>1</position>
</filter>
<filter>
<id>2c9c81b67578fbb30175d02bd27c0066</id>
<name>sub_type</name>
<enname>sub_type</enname>
<label>核销类型</label>
<filterType>FILTER</filterType>
<dbType>STRING</dbType>
<htmlType>TEXT</htmlType>
<position>2</position>
</filter>
</filters>
<filterExpress></filterExpress>
<pageSize>20</pageSize>
<showRowNumber>false</showRowNumber>
<showTotalTitle>false</showTotalTitle>
<isScale>false</isScale>
<isCache>false</isCache>
<isExcel>false</isExcel>
</table>
</tables>
<charts/>
<pages/>
<layouts>
<layout>
<id>2c9c81b67578fbb30175cef87e83001c</id>
<divHeight>0</divHeight>
<divWidth>0</divWidth>
<position>0</position>
<contentId>TABLE#2c9c81b67578fbb30175cef7a7890003</contentId>
<report>2c9c81b67578fbb30175cef6042d0002</report>
<contentType>TABLE</contentType>
</layout>
</layouts>
</TenwaReport>

View File

@ -0,0 +1,484 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<TenwaReport>
<datasources>
<datasource>
<id>2c9023815726a036015726a496b00001</id>
<dataSourceName>eleasing_mysql</dataSourceName>
<dataSourceType>SPRING</dataSourceType>
<jndi>dataSourceJDBC</jndi>
<url></url>
<username></username>
<driverName></driverName>
<password></password>
<dialect>com.tenwa.report.query.dialect.MysqlDialect</dialect>
<dialectName>Mysql</dialectName>
</datasource>
</datasources>
<reports>
<report>
<id>ff8080817371053c0175daa8beeb0162</id>
<name>逾期客户信息表</name>
<enname>custom_overdue_info_report</enname>
<code>REPORT_CODE_1605691293281</code>
<isActived>true</isActived>
<position>33</position>
<reportType>REPORT</reportType>
<parentReport>2c9c81b7685efbbc016931c675a50006</parentReport>
<children/>
<layouts>
<layout>ff8080817371053c0175daabb5540164</layout>
</layouts>
</report>
</reports>
<tables>
<table>
<id>ff8080817371053c0175daaa88860163</id>
<name>逾期客户信息表</name>
<enname>custom_overdue_info_report</enname>
<reportDataSource>2c9023815726a036015726a496b00001</reportDataSource>
<queryType>COMPLEXSQL</queryType>
<sql>SELECT
distinct
rp.customer_name ,
rp.mobile ,
CONCAT(left(ci.certid,4),'**********',right(ci.certid,4)) AS certid,
cf.NAME ,
cf.tel,
cf.suname ,
cf.suphone ,
cf.workunit,
cp.EMERGENCY_CONTACT_PERSON ,
cp.EMERGENCY_CONTACT_TEL ,
cp.INTRO ,
cp.REMARK ,
lgb.FULLNAME1 ,
lgb.MOBILE1 ,
lgb.ADDRESS1 ,
lgb.FULLNAME2 ,
lgb.MOBILE2 ,
lgb.ADDRESS2
FROM
(
SELECT DISTINCT
rrp.contract_number,
rrp.customer_name,
rrp.mobile
FROM
report_rent_plan rrp
WHERE
over_days &gt; 3
AND collect_status &lt;&gt; '代偿'
and batch_status='未完成'
and str_to_date(replace(left(rrp.PLAN_DATE, 10), '/', '-'), '%Y-%m-%d') &lt;=NOW()
GROUP BY
rrp.contract_number
) rp
LEFT JOIN lb_contract_info lci ON rp.contract_number = lci.contract_no
LEFT JOIN lb_union_lessee lul ON lci.id = lul.contract_id
LEFT JOIN customer_info ci ON ci.customerid = lul.customer_id
LEFT JOIN CUSTOMER_PERSON cp ON cp.customerid = ci.customerid
LEFT JOIN customer_family cf ON ci.customerid = cf.customerid
AND cf.partner_ = 'Y'
AND cf.STATUS = 'valid'
AND lci.id = cf.contract_id
LEFT JOIN (
SELECT
contract_id,
MAX( CASE rank WHEN '1' THEN FULLNAME END ) FULLNAME1,
MAX( CASE rank WHEN '1' THEN MOBILE END ) MOBILE1,
MAX( CASE rank WHEN '1' THEN ADDRESS END ) ADDRESS1,
MAX( CASE rank WHEN '2' THEN FULLNAME END ) FULLNAME2,
MAX( CASE rank WHEN '2' THEN MOBILE END ) MOBILE2,
MAX( CASE rank WHEN '2' THEN ADDRESS END ) ADDRESS2
FROM
(
SELECT
a.*,
count( 1 ) AS rank
FROM
LB_GUARANTEE_UNIT a
LEFT JOIN LB_GUARANTEE_UNIT b ON a.contract_id = b.contract_id
AND a.FULLNAME &lt;= b.FULLNAME
GROUP BY
a.contract_id,
a.FULLNAME
ORDER BY
a.contract_id,
a.FULLNAME DESC
) t
GROUP BY
contract_id
) lgb ON lci.id = lgb.contract_id
</sql>
<sqlParamValue></sqlParamValue>
<columns>
<column>
<id>ff8080817371053c0175f39343590197</id>
<name>customer_name</name>
<columnDataType>STRING</columnDataType>
<formater></formater>
<label>申请人姓名</label>
<enLabel>customer_name</enLabel>
<width>100</width>
<position>18</position>
<isVisible>true</isVisible>
<color></color>
<isCountTotal>false</isCountTotal>
<isCountSubTotal>false</isCountSubTotal>
<isGroupby>false</isGroupby>
<isMerge>false</isMerge>
<action></action>
<actionParamters></actionParamters>
<actionCondition></actionCondition>
</column>
<column>
<id>ff8080817371053c0175f39343590196</id>
<name>mobile</name>
<columnDataType>STRING</columnDataType>
<formater></formater>
<label>申请人电话</label>
<enLabel>mobile</enLabel>
<width>100</width>
<position>19</position>
<isVisible>true</isVisible>
<color></color>
<isCountTotal>false</isCountTotal>
<isCountSubTotal>false</isCountSubTotal>
<isGroupby>false</isGroupby>
<isMerge>false</isMerge>
<action></action>
<actionParamters></actionParamters>
<actionCondition></actionCondition>
</column>
<column>
<id>ff8080817371053c0175f3934359018d</id>
<name>certid</name>
<columnDataType>STRING</columnDataType>
<formater></formater>
<label>身份证号</label>
<enLabel>certid</enLabel>
<width>100</width>
<position>20</position>
<isVisible>true</isVisible>
<color></color>
<isCountTotal>false</isCountTotal>
<isCountSubTotal>false</isCountSubTotal>
<isGroupby>false</isGroupby>
<isMerge>false</isMerge>
<action></action>
<actionParamters></actionParamters>
<actionCondition></actionCondition>
</column>
<column>
<id>ff8080817371053c0175f3934359018e</id>
<name>NAME</name>
<columnDataType>STRING</columnDataType>
<formater></formater>
<label>共同申请人姓名</label>
<enLabel>NAME</enLabel>
<width>100</width>
<position>21</position>
<isVisible>true</isVisible>
<color></color>
<isCountTotal>false</isCountTotal>
<isCountSubTotal>false</isCountSubTotal>
<isGroupby>false</isGroupby>
<isMerge>false</isMerge>
<action></action>
<actionParamters></actionParamters>
<actionCondition></actionCondition>
</column>
<column>
<id>ff8080817371053c0175f3934359019a</id>
<name>tel</name>
<columnDataType>STRING</columnDataType>
<formater></formater>
<label>共同申请人电话</label>
<enLabel>tel</enLabel>
<width>100</width>
<position>22</position>
<isVisible>true</isVisible>
<color></color>
<isCountTotal>false</isCountTotal>
<isCountSubTotal>false</isCountSubTotal>
<isGroupby>false</isGroupby>
<isMerge>false</isMerge>
<action></action>
<actionParamters></actionParamters>
<actionCondition></actionCondition>
</column>
<column>
<id>ff8080817371053c0175f393433e018b</id>
<name>suname</name>
<columnDataType>STRING</columnDataType>
<formater></formater>
<label>共同申请人单位</label>
<enLabel>suname</enLabel>
<width>100</width>
<position>23</position>
<isVisible>true</isVisible>
<color></color>
<isCountTotal>false</isCountTotal>
<isCountSubTotal>false</isCountSubTotal>
<isGroupby>false</isGroupby>
<isMerge>false</isMerge>
<action></action>
<actionParamters></actionParamters>
<actionCondition></actionCondition>
</column>
<column>
<id>ff8080817371053c0175f3934359018f</id>
<name>suphone</name>
<columnDataType>STRING</columnDataType>
<formater></formater>
<label>共同申请人单位电话</label>
<enLabel>suphone</enLabel>
<width>100</width>
<position>24</position>
<isVisible>true</isVisible>
<color></color>
<isCountTotal>false</isCountTotal>
<isCountSubTotal>false</isCountSubTotal>
<isGroupby>false</isGroupby>
<isMerge>false</isMerge>
<action></action>
<actionParamters></actionParamters>
<actionCondition></actionCondition>
</column>
<column>
<id>ff8080817371053c0175f3934359019b</id>
<name>workunit</name>
<columnDataType>STRING</columnDataType>
<formater></formater>
<label>共同申请人地址</label>
<enLabel>workunit</enLabel>
<width>100</width>
<position>25</position>
<isVisible>true</isVisible>
<color></color>
<isCountTotal>false</isCountTotal>
<isCountSubTotal>false</isCountSubTotal>
<isGroupby>false</isGroupby>
<isMerge>false</isMerge>
<action></action>
<actionParamters></actionParamters>
<actionCondition></actionCondition>
</column>
<column>
<id>ff8080817371053c0175f39343590192</id>
<name>EMERGENCY_CONTACT_PERSON</name>
<columnDataType>STRING</columnDataType>
<formater></formater>
<label>紧急联系人1姓名</label>
<enLabel>EMERGENCY_CONTACT_PERSON</enLabel>
<width>100</width>
<position>26</position>
<isVisible>true</isVisible>
<color></color>
<isCountTotal>false</isCountTotal>
<isCountSubTotal>false</isCountSubTotal>
<isGroupby>false</isGroupby>
<isMerge>false</isMerge>
<action></action>
<actionParamters></actionParamters>
<actionCondition></actionCondition>
</column>
<column>
<id>ff8080817371053c0175f39343590193</id>
<name>EMERGENCY_CONTACT_TEL</name>
<columnDataType>STRING</columnDataType>
<formater></formater>
<label>紧急联系人1电话</label>
<enLabel>EMERGENCY_CONTACT_TEL</enLabel>
<width>100</width>
<position>27</position>
<isVisible>true</isVisible>
<color></color>
<isCountTotal>false</isCountTotal>
<isCountSubTotal>false</isCountSubTotal>
<isGroupby>false</isGroupby>
<isMerge>false</isMerge>
<action></action>
<actionParamters></actionParamters>
<actionCondition></actionCondition>
</column>
<column>
<id>ff8080817371053c0175f3934359019c</id>
<name>INTRO</name>
<columnDataType>STRING</columnDataType>
<formater></formater>
<label>紧急联系人2姓名</label>
<enLabel>INTRO</enLabel>
<width>100</width>
<position>28</position>
<isVisible>true</isVisible>
<color></color>
<isCountTotal>false</isCountTotal>
<isCountSubTotal>false</isCountSubTotal>
<isGroupby>false</isGroupby>
<isMerge>false</isMerge>
<action></action>
<actionParamters></actionParamters>
<actionCondition></actionCondition>
</column>
<column>
<id>ff8080817371053c0175f39343590198</id>
<name>REMARK</name>
<columnDataType>STRING</columnDataType>
<formater></formater>
<label>紧急联系人2电话</label>
<enLabel>REMARK</enLabel>
<width>100</width>
<position>29</position>
<isVisible>true</isVisible>
<color></color>
<isCountTotal>false</isCountTotal>
<isCountSubTotal>false</isCountSubTotal>
<isGroupby>false</isGroupby>
<isMerge>false</isMerge>
<action></action>
<actionParamters></actionParamters>
<actionCondition></actionCondition>
</column>
<column>
<id>ff8080817371053c0175f39343590199</id>
<name>FULLNAME1</name>
<columnDataType>STRING</columnDataType>
<formater></formater>
<label>担保人1姓名</label>
<enLabel>FULLNAME1</enLabel>
<width>100</width>
<position>30</position>
<isVisible>true</isVisible>
<color></color>
<isCountTotal>false</isCountTotal>
<isCountSubTotal>false</isCountSubTotal>
<isGroupby>false</isGroupby>
<isMerge>false</isMerge>
<action></action>
<actionParamters></actionParamters>
<actionCondition></actionCondition>
</column>
<column>
<id>ff8080817371053c0175f39343590190</id>
<name>MOBILE1</name>
<columnDataType>STRING</columnDataType>
<formater></formater>
<label>担保人1电话</label>
<enLabel>MOBILE1</enLabel>
<width>100</width>
<position>31</position>
<isVisible>true</isVisible>
<color></color>
<isCountTotal>false</isCountTotal>
<isCountSubTotal>false</isCountSubTotal>
<isGroupby>false</isGroupby>
<isMerge>false</isMerge>
<action></action>
<actionParamters></actionParamters>
<actionCondition></actionCondition>
</column>
<column>
<id>ff8080817371053c0175f3934359018c</id>
<name>ADDRESS1</name>
<columnDataType>STRING</columnDataType>
<formater></formater>
<label>担保人1地址</label>
<enLabel>ADDRESS1</enLabel>
<width>100</width>
<position>32</position>
<isVisible>true</isVisible>
<color></color>
<isCountTotal>false</isCountTotal>
<isCountSubTotal>false</isCountSubTotal>
<isGroupby>false</isGroupby>
<isMerge>false</isMerge>
<action></action>
<actionParamters></actionParamters>
<actionCondition></actionCondition>
</column>
<column>
<id>ff8080817371053c0175f39343590194</id>
<name>FULLNAME2</name>
<columnDataType>STRING</columnDataType>
<formater></formater>
<label>担保人2姓名</label>
<enLabel>FULLNAME2</enLabel>
<width>100</width>
<position>33</position>
<isVisible>true</isVisible>
<color></color>
<isCountTotal>false</isCountTotal>
<isCountSubTotal>false</isCountSubTotal>
<isGroupby>false</isGroupby>
<isMerge>false</isMerge>
<action></action>
<actionParamters></actionParamters>
<actionCondition></actionCondition>
</column>
<column>
<id>ff8080817371053c0175f39343590191</id>
<name>MOBILE2</name>
<columnDataType>STRING</columnDataType>
<formater></formater>
<label>担保人2电话</label>
<enLabel>MOBILE2</enLabel>
<width>100</width>
<position>34</position>
<isVisible>true</isVisible>
<color></color>
<isCountTotal>false</isCountTotal>
<isCountSubTotal>false</isCountSubTotal>
<isGroupby>false</isGroupby>
<isMerge>false</isMerge>
<action></action>
<actionParamters></actionParamters>
<actionCondition></actionCondition>
</column>
<column>
<id>ff8080817371053c0175f39343590195</id>
<name>ADDRESS2</name>
<columnDataType>STRING</columnDataType>
<formater></formater>
<label>担保人2地址</label>
<enLabel>ADDRESS2</enLabel>
<width>100</width>
<position>35</position>
<isVisible>true</isVisible>
<color></color>
<isCountTotal>false</isCountTotal>
<isCountSubTotal>false</isCountSubTotal>
<isGroupby>false</isGroupby>
<isMerge>false</isMerge>
<action></action>
<actionParamters></actionParamters>
<actionCondition></actionCondition>
</column>
</columns>
<controls/>
<searchs/>
<searchExpress></searchExpress>
<filters/>
<filterExpress></filterExpress>
<pageSize>20</pageSize>
<showRowNumber>false</showRowNumber>
<showTotalTitle>false</showTotalTitle>
<isScale>false</isScale>
<isCache>false</isCache>
<isExcel>false</isExcel>
</table>
</tables>
<charts/>
<pages/>
<layouts>
<layout>
<id>ff8080817371053c0175daabb5540164</id>
<divHeight>0</divHeight>
<divWidth>0</divWidth>
<position>0</position>
<contentId>TABLE#ff8080817371053c0175daaa88860163</contentId>
<report>ff8080817371053c0175daa8beeb0162</report>
<contentType>TABLE</contentType>
</layout>
</layouts>
</TenwaReport>