Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
Toggle navigation
This project
Loading...
Sign in
platform
/
finance_serv
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit f2aa3fe3
authored
Jul 31, 2018
by
王军业
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
[筛选]
1 parent
612f0cbc
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
238 additions
and
35 deletions
code/finance_serv/src/main/java/com/vion/financial/mapper/ContractMapper.java
code/finance_serv/src/main/java/com/vion/financial/mapper/CustomerMapper.java
code/finance_serv/src/main/java/com/vion/financial/mapping/ContractMapper.xml
code/finance_serv/src/main/java/com/vion/financial/mapping/CustomerMapper.xml
code/finance_serv/src/main/java/com/vion/financial/service/ContractService.java
code/finance_serv/src/main/java/com/vion/financial/service/imp/ContractServiceImpl.java
code/finance_serv/target/classes/com/vion/financial/mapping/ContractMapper.xml
code/finance_serv/target/classes/com/vion/financial/mapping/CustomerMapper.xml
code/finance_serv/src/main/java/com/vion/financial/mapper/ContractMapper.java
View file @
f2aa3fe
...
...
@@ -5,7 +5,6 @@ import java.util.List;
import
org.springframework.transaction.annotation.Transactional
;
import
com.vion.financial.vo.ContractVo
;
import
com.vion.financial.vo.ContractsListVo
;
import
com.vion.financial.vo.SelectVo
;
public
interface
ContractMapper
{
...
...
@@ -17,7 +16,7 @@ public interface ContractMapper {
@Transactional
public
void
deleteOne
(
String
contract_unid
);
public
List
<
String
>
queryList
();
public
ContractsListVo
selectByCondition
(
SelectVo
selectVo
);
public
List
<
ContractVo
>
selectByCondition
(
SelectVo
selectVo
);
public
boolean
isDelete
(
String
contract_unid
);
...
...
code/finance_serv/src/main/java/com/vion/financial/mapper/CustomerMapper.java
View file @
f2aa3fe
package
com
.
vion
.
financial
.
mapper
;
import
com.vion.financial.entity.Customer
;
public
interface
CustomerMapper
{
public
Object
addCustomer
(
Customer
customer
);
public
Customer
queryCustomer
(
String
s
);
public
Object
updateCustomer
(
Customer
customer
);
public
Object
deleteCustomer
(
int
n
);
}
package
com
.
vion
.
financial
.
mapper
;
import
java.util.List
;
import
com.vion.financial.entity.Customer
;
public
interface
CustomerMapper
{
public
void
addCustomer
(
Customer
customer
);
public
List
<
Customer
>
queryCustomer
();
public
void
updateCustomer
(
Customer
customer
);
public
void
deleteCustomer
(
int
n
);
}
code/finance_serv/src/main/java/com/vion/financial/mapping/ContractMapper.xml
View file @
f2aa3fe
...
...
@@ -273,8 +273,95 @@
<!-- delete from tb_contract where contract_unid = #{contract_unid} -->
</delete>
<select
id=
"selectByCondition"
parameterType=
"com.vion.financial.vo.SelectVo"
resultType=
"com.vion.financial.vo.ContractsListVo"
>
<select
id=
"selectByCondition"
parameterType=
"com.vion.financial.vo.SelectVo"
resultType=
"com.vion.financial.vo.ContractVo"
>
select contract_unid, salesperson_unid, province, city, county,
guarantee_period, sign_date, product_line_type, contract_state,
contract_type, contract_amount, deduct_amount, contract_amount_note,
stop_amount, reback_note, exemptions_amount, contract_remain_note,
is_archive, bad_amount, bad_amount_note, confirm_income_amount,
amount_state_unid, start_guarantee_date, end_guarantee_date,
mainten_start_point, contract_note, is_delete, project_unid,
customer_unid from tb_contract where
<if
test=
"salesperson_name__like !=null and salesperson_name__like !=''"
>
salesperson_unid like #{salesperson_name__like}
and
</if>
<if
test=
"project_name__like !=null and project_name__like !=''"
>
project_unid like #{project_name__like}
and
</if>
<if
test=
"customer_name__like !=null and customer_name__like !=''"
>
customer_unid like #{customer_name__like}
and
</if>
<if
test=
"province !=null and province !=''"
>
province=#{province}
and
</if>
<if
test=
"city !=null and city !=''"
>
city=#{city}
and
</if>
<if
test=
"county !=null and county !=''"
>
county=#{county}
and
</if>
<if
test=
"guarantee_period !=null"
>
guarantee_period=#{guarantee_period}
and
</if>
<if
test=
"year !=null and year !=''"
>
to_char(sign_date,"yyyy")=#{year}
and
</if>
<if
test=
"month !=null and month!=''"
>
to_char(sign_date,"MM")=#{month}
and
</if>
<if
test=
"product_line_type !=null and product_line_type !=''"
>
product_line_type=#{product_line_type}
and
</if>
<if
test=
"contract_state !=null and contract_state!=''"
>
contract_state=#{contract_state}
and
</if>
<if
test=
"contract_type !=null and contract_type !=''"
>
contract_type=#{contract_type}
and
</if>
<if
test=
"is_archive !=null"
>
is_archive=#{is_archive}
and
</if>
<if
test=
"acceptanc_type !=null and acceptanc_type !=''"
>
contract_unid in (select tb_project_acceptanc.contract_unid from tb_project_acceptanc where tb_project_acceptanc.acceptanc_type=#{acceptanc_type})
and
</if>
<if
test=
"confirm_income_amount !=null"
>
confirm_income_amount=#{confirm_income_amount}
and
</if>
<if
test=
"amount_state_unid !=null"
>
amount_state_unid=#{amount_state_unid}
and
</if>
<if
test=
"start_date !='' and end_date !=''"
>
#{start_date}
<![CDATA[<=]]>
sign_date
<![CDATA[<=]]>
#{end_date}
and
</if>
<if
test=
"amount_point !=null"
>
contract_amount
<![CDATA[>=]]>
#{amount_point}
and
</if>
<if
test=
"overdays_point !=null"
>
<!--逾期天数-->
contract_unid in (select over_days_view.contract_unid from over_days_view where over_days
<![CDATA[>=]]>
#{overdays_point})
and
</if>
<!--应收款余额-->
<if
test=
"limit !=null and offset !=null"
>
limit #{limit} offset #{offset}
</if>
</select>
<select
id=
"isDelete"
parameterType=
"String"
resultType=
"boolean"
>
select is_delete from tb_contract where contract_unid = #{contract_unid}
...
...
code/finance_serv/src/main/java/com/vion/financial/mapping/CustomerMapper.xml
View file @
f2aa3fe
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.vion.financial.mapper.CustomerMapper"
>
<insert
id=
"addCustomer"
parameterType=
"com.vion.financial.entity.Customer"
>
insert into tb_customer (customer_name) values (#{customer_name})
</insert>
<update
id=
"updateCustomer"
parameterType=
"com.vion.financial.entity.Customer"
>
update tb_customer set c
ontract_unid = #{contract_unid},customer_name = #{customer_name}
where customer_unid = #{customer_unid}
</update>
<select
id=
"queryCustomer"
parameterType=
"String"
>
select *
from tb_customer where contract_unid = #{contract_unid}
</select>
<delete
id=
"deleteCustomer"
parameterType=
"int"
>
delete from tb_customer where customer_unid = #{customer_unid}
</delete>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.vion.financial.mapper.CustomerMapper"
>
<insert
id=
"addCustomer"
parameterType=
"com.vion.financial.entity.Customer"
>
insert into tb_customer (customer_name) values (#{customer_name})
</insert>
<update
id=
"updateCustomer"
parameterType=
"com.vion.financial.entity.Customer"
>
update tb_customer set c
ustomer_name = #{customer_name}
where customer_unid = #{customer_unid}
</update>
<select
id=
"queryCustomer"
resultType=
"com.vion.financial.entity.Customer"
>
select *
from tb_customer
</select>
<delete
id=
"deleteCustomer"
parameterType=
"int"
>
delete from tb_customer where customer_unid = #{customer_unid}
</delete>
</mapper>
\ No newline at end of file
code/finance_serv/src/main/java/com/vion/financial/service/ContractService.java
View file @
f2aa3fe
package
com
.
vion
.
financial
.
service
;
import
com.vion.financial.vo.ContractVo
;
import
com.vion.financial.vo.SelectVo
;
public
interface
ContractService
{
public
Object
addOne
(
ContractVo
vontractVo
);
...
...
@@ -9,4 +10,5 @@ public interface ContractService {
public
Object
deleteOne
(
String
s
);
public
Object
queryList
();
boolean
isDelete
(
String
s
);
public
Object
selectByCondition
(
SelectVo
selectVo
);
}
code/finance_serv/src/main/java/com/vion/financial/service/imp/ContractServiceImpl.java
View file @
f2aa3fe
package
com
.
vion
.
financial
.
service
.
imp
;
import
java.util.ArrayList
;
import
java.util.List
;
import
org.slf4j.Logger
;
...
...
@@ -10,9 +11,11 @@ import org.springframework.stereotype.Service;
import
com.vion.financial.entity.Appendix
;
import
com.vion.financial.mapper.AppendixMapper
;
import
com.vion.financial.mapper.ContractMapper
;
import
com.vion.financial.mapper.PaymentAgreeMapper
;
import
com.vion.financial.service.ContractService
;
import
com.vion.financial.vo.ContractVo
;
import
com.vion.financial.vo.FailCode
;
import
com.vion.financial.vo.SelectVo
;
import
com.vion.financial.vo.SuccessCode
;
@Service
...
...
@@ -24,6 +27,9 @@ public class ContractServiceImpl implements ContractService {
AppendixMapper
appendixMapper
;
@Autowired
PaymentAgreeMapper
paymentAgreeMapper
;
@Autowired
SuccessCode
successCode
;
@Autowired
...
...
@@ -140,4 +146,24 @@ public class ContractServiceImpl implements ContractService {
return
failCode
;
}
}
@Override
public
Object
selectByCondition
(
SelectVo
selectVo
)
{
// TODO Auto-generated method stub
try
{
logger
.
info
(
"========================筛选合同列表==========================="
);
List
<
ContractVo
>
list
=
new
ArrayList
<
ContractVo
>();
for
(
ContractVo
contractVo:
contractMapper
.
selectByCondition
(
selectVo
))
{
contractVo
.
setPaymentAgree_list
(
paymentAgreeMapper
.
queryPaymentAgree
(
contractVo
.
getContract_unid
()));
list
.
add
(
contractVo
);
}
return
list
;
}
catch
(
Exception
e
)
{
// TODO: handle exception
logger
.
error
(
"筛选合同列表异常"
+
e
.
getLocalizedMessage
(),
e
);
failCode
.
setEnode
(
"500"
);
failCode
.
setEnode
(
"筛选异常"
);
return
failCode
;
}
}
}
code/finance_serv/target/classes/com/vion/financial/mapping/ContractMapper.xml
View file @
f2aa3fe
...
...
@@ -273,8 +273,95 @@
<!-- delete from tb_contract where contract_unid = #{contract_unid} -->
</delete>
<select
id=
"selectByCondition"
parameterType=
"com.vion.financial.vo.SelectVo"
resultType=
"com.vion.financial.vo.ContractsListVo"
>
<select
id=
"selectByCondition"
parameterType=
"com.vion.financial.vo.SelectVo"
resultType=
"com.vion.financial.vo.ContractVo"
>
select contract_unid, salesperson_unid, province, city, county,
guarantee_period, sign_date, product_line_type, contract_state,
contract_type, contract_amount, deduct_amount, contract_amount_note,
stop_amount, reback_note, exemptions_amount, contract_remain_note,
is_archive, bad_amount, bad_amount_note, confirm_income_amount,
amount_state_unid, start_guarantee_date, end_guarantee_date,
mainten_start_point, contract_note, is_delete, project_unid,
customer_unid from tb_contract where
<if
test=
"salesperson_name__like !=null and salesperson_name__like !=''"
>
salesperson_unid like #{salesperson_name__like}
and
</if>
<if
test=
"project_name__like !=null and project_name__like !=''"
>
project_unid like #{project_name__like}
and
</if>
<if
test=
"customer_name__like !=null and customer_name__like !=''"
>
customer_unid like #{customer_name__like}
and
</if>
<if
test=
"province !=null and province !=''"
>
province=#{province}
and
</if>
<if
test=
"city !=null and city !=''"
>
city=#{city}
and
</if>
<if
test=
"county !=null and county !=''"
>
county=#{county}
and
</if>
<if
test=
"guarantee_period !=null"
>
guarantee_period=#{guarantee_period}
and
</if>
<if
test=
"year !=null and year !=''"
>
to_char(sign_date,"yyyy")=#{year}
and
</if>
<if
test=
"month !=null and month!=''"
>
to_char(sign_date,"MM")=#{month}
and
</if>
<if
test=
"product_line_type !=null and product_line_type !=''"
>
product_line_type=#{product_line_type}
and
</if>
<if
test=
"contract_state !=null and contract_state!=''"
>
contract_state=#{contract_state}
and
</if>
<if
test=
"contract_type !=null and contract_type !=''"
>
contract_type=#{contract_type}
and
</if>
<if
test=
"is_archive !=null"
>
is_archive=#{is_archive}
and
</if>
<if
test=
"acceptanc_type !=null and acceptanc_type !=''"
>
contract_unid in (select tb_project_acceptanc.contract_unid from tb_project_acceptanc where tb_project_acceptanc.acceptanc_type=#{acceptanc_type})
and
</if>
<if
test=
"confirm_income_amount !=null"
>
confirm_income_amount=#{confirm_income_amount}
and
</if>
<if
test=
"amount_state_unid !=null"
>
amount_state_unid=#{amount_state_unid}
and
</if>
<if
test=
"start_date !='' and end_date !=''"
>
#{start_date}
<![CDATA[<=]]>
sign_date
<![CDATA[<=]]>
#{end_date}
and
</if>
<if
test=
"amount_point !=null"
>
contract_amount
<![CDATA[>=]]>
#{amount_point}
and
</if>
<if
test=
"overdays_point !=null"
>
<!--逾期天数-->
contract_unid in (select over_days_view.contract_unid from over_days_view where over_days
<![CDATA[>=]]>
#{overdays_point})
and
</if>
<!--应收款余额-->
<if
test=
"limit !=null and offset !=null"
>
limit #{limit} offset #{offset}
</if>
</select>
<select
id=
"isDelete"
parameterType=
"String"
resultType=
"boolean"
>
select is_delete from tb_contract where contract_unid = #{contract_unid}
...
...
code/finance_serv/target/classes/com/vion/financial/mapping/CustomerMapper.xml
View file @
f2aa3fe
...
...
@@ -5,11 +5,11 @@
insert into tb_customer (customer_name) values (#{customer_name})
</insert>
<update
id=
"updateCustomer"
parameterType=
"com.vion.financial.entity.Customer"
>
update tb_customer set c
ontract_unid = #{contract_unid},c
ustomer_name = #{customer_name}
update tb_customer set customer_name = #{customer_name}
where customer_unid = #{customer_unid}
</update>
<select
id=
"queryCustomer"
parameterType=
"String"
>
select *
from tb_customer where contract_unid = #{contract_unid}
<select
id=
"queryCustomer"
resultType=
"com.vion.financial.entity.Customer"
>
select *
from tb_customer
</select>
<delete
id=
"deleteCustomer"
parameterType=
"int"
>
delete from tb_customer where customer_unid = #{customer_unid}
...
...
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment