Commit d72da2a5 by 谢明辉

Merge branch 'develop' of http://192.168.9.26/platform/finance_serv into develop

2 parents 6b95bc1a f2aa3fe3
......@@ -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);
......
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);
}
......@@ -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}
......
<?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 contract_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 customer_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
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);
}
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;
}
}
}
......@@ -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}
......
......@@ -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 contract_unid = #{contract_unid},customer_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}
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!