|
@@ -28,38 +28,46 @@
|
|
order_fund_id, production_fund_id, fine_amount, real_fine_amount, explain, remark, status, leader_id, confirm_date
|
|
order_fund_id, production_fund_id, fine_amount, real_fine_amount, explain, remark, status, leader_id, confirm_date
|
|
</sql>
|
|
</sql>
|
|
|
|
|
|
- <!--分页查询超期罚款-->
|
|
|
|
- <select id="selectPage" resultType="com.dayou.vo.FinanceFineVO">
|
|
|
|
|
|
+ <sql id="financeFineVOSql">
|
|
SELECT fine.id AS id,
|
|
SELECT fine.id AS id,
|
|
- oFund.business_type AS businessType,
|
|
|
|
- oFund.order_id AS orderId,
|
|
|
|
- oFund.order_name AS orderName,
|
|
|
|
- (SELECT GROUP_CONCAT(ticket_no SEPARATOR ',')
|
|
|
|
- FROM finance_invoice
|
|
|
|
- WHERE finance_invoice.deleted = 0
|
|
|
|
- AND finance_invoice.order_fund_id = fine.order_fund_id
|
|
|
|
- AND IF(fine.production_fund_id IS NOT NULL, finance_invoice.production_fund_id = fine.production_fund_id, TRUE)
|
|
|
|
- ) AS invoiceNo,
|
|
|
|
- <if test="dto != null and dto.businessType == 'ASSET_BUSINESS' or dto.businessType == 'MAJOR_BUSINESS'">
|
|
|
|
- pFund.production_no AS productionNo,
|
|
|
|
- pFund.production_type AS productionType,
|
|
|
|
- pFund.production_should_amount AS shouldAmount,
|
|
|
|
- pFund.standard_amount AS standardAmount,
|
|
|
|
- `order`.bailor AS bailor,
|
|
|
|
- </if>
|
|
|
|
- <if test="dto != null and dto.businessType == 'PERSONAL_BUSINESS'">
|
|
|
|
- oFund.should_amount AS shouldAmount,
|
|
|
|
- CONCAT(`order`.bailorA, IF(`order`.bailorB IS NOT NULL AND `order`.bailorB != '', ',', ''), `order`.bailorB) AS bailor,
|
|
|
|
- </if>
|
|
|
|
- user.name AS clientManagerName,
|
|
|
|
- DATEDIFF(CURDATE(), DATE( pro.repertory_out_time )) AS overdueDay,
|
|
|
|
- customer.name AS customerName,
|
|
|
|
- subCustomer.name AS customerSubName,
|
|
|
|
- fine.fine_amount AS fineAmount,
|
|
|
|
- fine.real_fine_amount AS realFineAmount,
|
|
|
|
- fine.status AS status,
|
|
|
|
- fine.created AS punishDate,
|
|
|
|
- fine.`explain` AS `explain`
|
|
|
|
|
|
+ oFund.business_type AS businessType,
|
|
|
|
+ oFund.order_id AS orderId,
|
|
|
|
+ oFund.order_name AS orderName,
|
|
|
|
+ (SELECT GROUP_CONCAT(ticket_no SEPARATOR ',')
|
|
|
|
+ FROM finance_invoice
|
|
|
|
+ WHERE finance_invoice.deleted = 0
|
|
|
|
+ AND finance_invoice.order_fund_id = fine.order_fund_id
|
|
|
|
+ AND IF(fine.production_fund_id IS NOT NULL, finance_invoice.production_fund_id = fine.production_fund_id, TRUE)
|
|
|
|
+ ) AS invoiceNo,
|
|
|
|
+ <if test="dto != null and dto.businessType == 'ASSET_BUSINESS' or dto.businessType == 'MAJOR_BUSINESS'">
|
|
|
|
+ pFund.production_no AS productionNo,
|
|
|
|
+ pFund.production_should_amount AS shouldAmount,
|
|
|
|
+ pFund.standard_amount AS standardAmount,
|
|
|
|
+ `order`.bailor AS bailor,
|
|
|
|
+ </if>
|
|
|
|
+ <if test="dto != null and dto.businessType == 'ASSET_BUSINESS'">
|
|
|
|
+ CASE pFund.production_type WHEN 'LETTER' THEN '意见函' WHEN 'CONSULT' THEN '咨询报告' WHEN 'REPORT' THEN '评估报告' ELSE '-' END AS productionType,
|
|
|
|
+ </if>
|
|
|
|
+ <if test="dto != null and dto.businessType == 'MAJOR_BUSINESS'">
|
|
|
|
+ CASE pFund.production_type WHEN 'LETTER' THEN '复评函' WHEN 'REPORT' THEN '报告' WHEN 'STATEMENT' THEN '价值意见书' ELSE '-' END AS productionType,
|
|
|
|
+ </if>
|
|
|
|
+ <if test="dto != null and dto.businessType == 'PERSONAL_BUSINESS'">
|
|
|
|
+ `order`.order_id AS productionNo,
|
|
|
|
+ oFund.should_amount AS shouldAmount,
|
|
|
|
+ CONCAT(`order`.bailorA, IF(`order`.bailorB IS NOT NULL AND `order`.bailorB != '', ',', ''), `order`.bailorB) AS bailor,
|
|
|
|
+ </if>
|
|
|
|
+ <if test="dto != null and dto.businessType == 'PERSONAL_BUSINESS'">
|
|
|
|
+ CASE pro.production WHEN 'FINAL' THEN '结果报告' WHEN 'TECHNIC' THEN '技术报告' ELSE '-' END AS productionType,
|
|
|
|
+ </if>
|
|
|
|
+ user.name AS clientManagerName,
|
|
|
|
+ DATEDIFF(CURDATE(), DATE( pro.repertory_out_time )) AS overdueDay,
|
|
|
|
+ customer.name AS customerName,
|
|
|
|
+ subCustomer.name AS customerSubName,
|
|
|
|
+ fine.fine_amount AS fineAmount,
|
|
|
|
+ fine.real_fine_amount AS realFineAmount,
|
|
|
|
+ fine.status AS status,
|
|
|
|
+ fine.created AS punishDate,
|
|
|
|
+ fine.`explain` AS `explain`
|
|
FROM finance_fine AS fine
|
|
FROM finance_fine AS fine
|
|
LEFT JOIN order_fund AS oFund ON oFund.deleted = 0 AND fine.order_fund_id = oFund.id
|
|
LEFT JOIN order_fund AS oFund ON oFund.deleted = 0 AND fine.order_fund_id = oFund.id
|
|
<if test="dto != null and dto.businessType == 'ASSET_BUSINESS'">
|
|
<if test="dto != null and dto.businessType == 'ASSET_BUSINESS'">
|
|
@@ -105,11 +113,31 @@
|
|
<if test="dto != null and dto.status != null">
|
|
<if test="dto != null and dto.status != null">
|
|
AND fine.status = #{dto.status}
|
|
AND fine.status = #{dto.status}
|
|
</if>
|
|
</if>
|
|
|
|
+ <if test="dto != null and dto.clientManagerId != null">
|
|
|
|
+ AND `order`.client_manager_id = #{dto.clientManagerId}
|
|
|
|
+ </if>
|
|
<if test="dto != null and dto.startPunishDate != null and dto.endPunishDate!= null">
|
|
<if test="dto != null and dto.startPunishDate != null and dto.endPunishDate!= null">
|
|
AND fine.created BETWEEN #{dto.startPunishDate} AND #{dto.endPunishDate}
|
|
AND fine.created BETWEEN #{dto.startPunishDate} AND #{dto.endPunishDate}
|
|
</if>
|
|
</if>
|
|
|
|
+ </sql>
|
|
|
|
+
|
|
|
|
+ <!--分页查询超期罚款-->
|
|
|
|
+ <select id="selectPage" resultType="com.dayou.vo.FinanceFineVO">
|
|
|
|
+ <include refid="financeFineVOSql" />
|
|
|
|
+ </select>
|
|
|
|
+
|
|
|
|
+ <!--导出查询超期罚款-->
|
|
|
|
+ <select id="exportList" resultType="com.dayou.vo.FinanceFineVO">
|
|
|
|
+ <include refid="financeFineVOSql" />
|
|
</select>
|
|
</select>
|
|
|
|
|
|
|
|
+ <!--确认罚款金额-->
|
|
|
|
+ <update id="confirmFineAmount">
|
|
|
|
+ UPDATE finance_fine SET real_fine_amount = fine_amount
|
|
|
|
+ WHERE deleted = 0
|
|
|
|
+ AND id = #{id}
|
|
|
|
+ </update>
|
|
|
|
+
|
|
<!--获取逾期资产产品款项信息-->
|
|
<!--获取逾期资产产品款项信息-->
|
|
<select id="getAssetsOrder" resultType="com.dayou.vo.CompileFineAssetsOrder">
|
|
<select id="getAssetsOrder" resultType="com.dayou.vo.CompileFineAssetsOrder">
|
|
SELECT
|
|
SELECT
|