|
|
|
<?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.daqing.financial.guarantee.mapper.AlCollectionMapper">
|
|
|
|
|
|
|
|
<!-- 通用查询映射结果 -->
|
|
|
|
<resultMap id="BaseResultMap" type="com.daqing.framework.domain.guarantee.AlCollection">
|
|
|
|
<id column="id" property="id" />
|
|
|
|
<result column="insurance_id" property="insuranceId" />
|
|
|
|
<result column="collection_method" property="collectionMethod" />
|
|
|
|
<result column="collection_time" property="collectionTime" />
|
|
|
|
<result column="collection_feedback" property="collectionFeedback" />
|
|
|
|
<result column="enclosure_file" property="enclosureFile" />
|
|
|
|
</resultMap>
|
|
|
|
|
|
|
|
<!-- 催收管理列表 -->
|
|
|
|
<select id="list" resultType="com.daqing.framework.domain.guarantee.po.AlCollectionPO">
|
|
|
|
SELECT i.id AS id,i.business_code AS code,i.customer_name AS name,i.phone AS phone,i.business_type AS type,
|
|
|
|
i.guarantee_amount AS amount,i.department AS department,i.payment_status AS status,COUNT(c.id) AS numberOfCollection
|
|
|
|
FROM al_insurance_list AS i
|
|
|
|
INNER JOIN al_repayment_entry AS r
|
|
|
|
ON i.id = r.insurance_id
|
|
|
|
INNER JOIN al_collection AS c
|
|
|
|
ON i.id = c.insurance_id
|
|
|
|
WHERE r.is_overdue = 0
|
|
|
|
<if test="status != null">
|
|
|
|
AND i.status = #{status}
|
|
|
|
</if>
|
|
|
|
<if test="codeOrName != null and codeOrName != ''">
|
|
|
|
AND (i.customer_name like CONCAT('%',#{codeOrName},'%') OR i.business_code like CONCAT('%',#{codeOrName},'%'))
|
|
|
|
</if>
|
|
|
|
GROUP BY i.id
|
|
|
|
</select>
|
|
|
|
|
|
|
|
<!-- 催收 -->
|
|
|
|
<insert id="collection" parameterType="com.daqing.framework.domain.guarantee.AlCollection">
|
|
|
|
INSERT INTO al_collection (insurance_id,collection_method,collection_time,collection_feedback,enclosure_file
|
|
|
|
,overdue_amount,overdue_interest,other_expenses,collection_user,overdue_periods)
|
|
|
|
VALUES (#{collection.insuranceId},#{collection.collectionMethod},#{collection.collectionTime},
|
|
|
|
#{collection.collectionFeedback},#{collection.enclosureFile},
|
|
|
|
#{collection.overdueAmount},#{collection.overdueInterest},#{collection.otherExpenses},
|
|
|
|
#{collection.collectionUser},#{collection.overduePeriods})
|
|
|
|
</insert>
|
|
|
|
|
|
|
|
<select id="getOverdueDetailByInsuranceId" parameterType="integer" resultType="com.daqing.financial.guarantee.model.response.OverdueDetailResponse">
|
|
|
|
SELECT i.business_code AS code,i.customer_name AS name,i.business_type AS type,COUNT(c.id) AS numberOfCollection
|
|
|
|
FROM al_insurance_list AS i
|
|
|
|
INNER JOIN al_collection AS c
|
|
|
|
ON i.id = c.insurance_id
|
|
|
|
WHERE i.id = #{insuranceId}
|
|
|
|
</select>
|
|
|
|
|
|
|
|
<!-- 催收列表 -->
|
|
|
|
<select id="collectionList" parameterType="string" resultType="com.daqing.framework.domain.guarantee.AlCollection">
|
|
|
|
SELECT c.id AS id,c.overdue_amount AS overdue_amount,c.overdue_interest AS overdue_interest,c.other_expenses AS other_expenses,
|
|
|
|
c.collection_method AS collection_method,c.collection_user AS collection_user,c.collection_time AS collection_time,
|
|
|
|
c.collection_feedback AS collection_feedback,c.enclosure_file AS enclosure_file,i.business_code AS code,
|
|
|
|
i.customer_name AS name,i.business_type AS type
|
|
|
|
FROM al_collection AS c
|
|
|
|
INNER JOIN al_insurance_list AS i
|
|
|
|
ON i.id = c.insurance_id
|
|
|
|
</select>
|
|
|
|
|
|
|
|
<select id="moreOverdueDetail" parameterType="integer" resultType="com.daqing.financial.guarantee.model.response.MoreOverdueDetailResponse">
|
|
|
|
SELECT collection_method,collection_time,collection_feedback,enclosure_file
|
|
|
|
FROM al_collection
|
|
|
|
WHERE id = #{id}
|
|
|
|
</select>
|
|
|
|
|
|
|
|
<select id="getInsuranceIdById" parameterType="integer" resultType="integer">
|
|
|
|
SELECT insurance_id FROM al_collection WHERE id = #{id}
|
|
|
|
</select>
|
|
|
|
|
|
|
|
</mapper>
|