更新JBO
This commit is contained in:
parent
6f7f6e2a82
commit
08340ca574
@ -3453,5 +3453,20 @@
|
||||
</managerProperties>
|
||||
</manager>
|
||||
</class>
|
||||
<class name="VI_OVERDUE_RENT_PLAN_SUM" label="" keyAttributes="contract_id">
|
||||
<attributes>
|
||||
<attribute name="contract_id" label="contract_id" type="STRING"/>
|
||||
<attribute name="over_list" label="over_list" type="STRING"/>
|
||||
<attribute name="over_days" label="over_days" type="STRING"/>
|
||||
<attribute name="over_money" label="over_money" type="STRING"/>
|
||||
<attribute name="over_penalty" label="over_penalty" type="STRING"/>
|
||||
</attributes>
|
||||
<manager>
|
||||
<managerProperties>
|
||||
<property name="table" value="vi_overdue_rent_plan_sum" />
|
||||
<property name="createKey" value="true" />
|
||||
</managerProperties>
|
||||
</manager>
|
||||
</class>
|
||||
</package>
|
||||
</jbo>
|
||||
|
||||
@ -328,4 +328,125 @@ public class OverdueProjectCache {
|
||||
}
|
||||
return guarantee;
|
||||
}
|
||||
/**
|
||||
* 逾期天数,逾期期数,逾期金额,逾期罚息
|
||||
*/
|
||||
//逾期天数
|
||||
public static String getOverdueDays(String id)throws Exception{
|
||||
String overDay="0";
|
||||
String contract_id=id;
|
||||
Transaction Sqlca =null;
|
||||
try {
|
||||
Sqlca = Transaction.createTransaction(CacheLoaderFactory.getDataSource());
|
||||
String sql="SELECT contract_id,MAX(Overdue_days) AS over_days FROM vi_overdue_rent_plan WHERE Overdue_days > 0 AND contract_id = :contract_id GROUP BY contract_id";
|
||||
SqlObject asql = new SqlObject(sql);
|
||||
asql.setParameter("contract_id", contract_id);
|
||||
ASResultSet rs = null;
|
||||
rs = Sqlca.getASResultSet(asql);
|
||||
if(rs.next()){
|
||||
overDay=rs.getStringValue("overdays");
|
||||
}
|
||||
if(overDay==null || overDay.equals("")){
|
||||
overDay="0";
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}finally{
|
||||
if(Sqlca!=null){
|
||||
Sqlca.disConnect();
|
||||
Sqlca = null;
|
||||
}
|
||||
}
|
||||
return overDay;
|
||||
}
|
||||
//逾期期数
|
||||
public static String getOverdueList(String id) throws JBOException
|
||||
{
|
||||
String outlist="";
|
||||
Transaction Sqlca =null;
|
||||
try {
|
||||
Sqlca = Transaction.createTransaction(CacheLoaderFactory.getDataSource());
|
||||
String sql="SELECT contract_id,COUNT(plan_list) AS over_list FROM vi_overdue_rent_plan WHERE Overdue_days > 0 AND contract_id = :contract_id GROUP BY contract_id";
|
||||
SqlObject asql = new SqlObject(sql);
|
||||
asql.setParameter("contract_id", id);
|
||||
ASResultSet rs = null;
|
||||
rs = Sqlca.getASResultSet(asql);
|
||||
if(rs.next()){
|
||||
outlist=rs.getStringValue("over_list");
|
||||
if(outlist==null||outlist.length()<=0)
|
||||
{
|
||||
outlist="0";
|
||||
}
|
||||
}else{
|
||||
outlist="0";
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}finally{
|
||||
if(Sqlca!=null){
|
||||
Sqlca.disConnect();
|
||||
Sqlca = null;
|
||||
}
|
||||
}
|
||||
return outlist;
|
||||
}
|
||||
//逾期金额
|
||||
public static String getOverMoney(String id) throws JBOException
|
||||
{
|
||||
String incrent="";
|
||||
Transaction Sqlca =null;
|
||||
try {
|
||||
Sqlca = Transaction.createTransaction(CacheLoaderFactory.getDataSource());
|
||||
String sql="SELECT contract_id,SUM(overduerent) AS over_money FROM vi_overdue_rent_plan WHERE Overdue_days > 0 AND contract_id = :contract_id GROUP BY contract_id";
|
||||
SqlObject asql = new SqlObject(sql);
|
||||
asql.setParameter("contract_id", id);
|
||||
ASResultSet rs = null;
|
||||
rs = Sqlca.getASResultSet(asql);
|
||||
if(rs.next()){
|
||||
incrent=rs.getStringValue("over_money");
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}finally{
|
||||
if(Sqlca!=null){
|
||||
Sqlca.disConnect();
|
||||
Sqlca = null;
|
||||
}
|
||||
}
|
||||
|
||||
if(incrent==null||incrent.length()<=0)
|
||||
{
|
||||
incrent="0";
|
||||
}
|
||||
return incrent;
|
||||
}
|
||||
//逾期罚息
|
||||
public static String getOverPenalty(String id) throws JBOException
|
||||
{
|
||||
String penalty="";
|
||||
Transaction Sqlca =null;
|
||||
try {
|
||||
Sqlca = Transaction.createTransaction(CacheLoaderFactory.getDataSource());
|
||||
String sql="SELECT contract_id,SUM(penalty) AS over_penalty FROM vi_overdue_rent_plan WHERE Overdue_days > 0 AND contract_id = :contract_id GROUP BY contract_id";
|
||||
SqlObject asql = new SqlObject(sql);
|
||||
asql.setParameter("contract_id", id);
|
||||
ASResultSet rs = null;
|
||||
rs = Sqlca.getASResultSet(asql);
|
||||
if(rs.next()){
|
||||
penalty=rs.getStringValue("over_penalty");
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}finally{
|
||||
if(Sqlca!=null){
|
||||
Sqlca.disConnect();
|
||||
Sqlca = null;
|
||||
}
|
||||
}
|
||||
if(penalty==null||penalty.length()<=0)
|
||||
{
|
||||
penalty="0";
|
||||
}
|
||||
return penalty;
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user