|
@@ -11,7 +11,7 @@
|
|
<result column="fine_id" property="fineId" />
|
|
<result column="fine_id" property="fineId" />
|
|
<result column="refund_amount" property="refundAmount" />
|
|
<result column="refund_amount" property="refundAmount" />
|
|
<result column="refund_reason" property="refundReason" />
|
|
<result column="refund_reason" property="refundReason" />
|
|
- <result column="statue" property="statue" />
|
|
|
|
|
|
+ <result column="status" property="status" />
|
|
<result column="user_id" property="userId" />
|
|
<result column="user_id" property="userId" />
|
|
<result column="refund_date" property="refundDate" />
|
|
<result column="refund_date" property="refundDate" />
|
|
</resultMap>
|
|
</resultMap>
|
|
@@ -25,4 +25,90 @@
|
|
fine_id, refund_amount, refund_reason, statue, user_id, refund_date
|
|
fine_id, refund_amount, refund_reason, statue, user_id, refund_date
|
|
</sql>
|
|
</sql>
|
|
|
|
|
|
|
|
+ <!--条件分页查询罚款退款记录-->
|
|
|
|
+ <select id="selectPage" resultType="com.dayou.vo.FinanceFineRefundVO">
|
|
|
|
+ SELECT refund.id AS id,
|
|
|
|
+ refund.fine_id AS fineId,
|
|
|
|
+ oFund.order_id AS orderId,
|
|
|
|
+ oFund.order_name AS orderName,
|
|
|
|
+ <if test="dto != null and dto.businessType == 'ASSET_BUSINESS' or dto.businessType == 'MAJOR_BUSINESS'">
|
|
|
|
+ pFund.production_no AS productionNo,
|
|
|
|
+ `order`.bailor AS bailor,
|
|
|
|
+ </if>
|
|
|
|
+ <if test="dto != null and dto.businessType == 'PERSONAL_BUSINESS'">
|
|
|
|
+ `order`.order_id AS productionNo,
|
|
|
|
+ CONCAT(`order`.bailorA, IF(`order`.bailorB IS NOT NULL AND `order`.bailorB != '', ',', ''), `order`.bailorB) 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'">
|
|
|
|
+ CASE pro.production WHEN 'FINAL' THEN '结果报告' WHEN 'TECHNIC' THEN '技术报告' ELSE '-' END AS productionType,
|
|
|
|
+ </if>
|
|
|
|
+ user.name AS clientManagerName,
|
|
|
|
+ customer.name AS customerName,
|
|
|
|
+ subCustomer.name AS customerSubName,
|
|
|
|
+ fine.real_fine_amount AS finedAmount,
|
|
|
|
+ refund.refund_amount AS refundAmount,
|
|
|
|
+ refund.refund_date AS refundDate,
|
|
|
|
+ refund.refund_amount AS refundAmount,
|
|
|
|
+ refund.refund_reason AS refundReason,
|
|
|
|
+ refund.status AS status,
|
|
|
|
+ operator.name AS operator,
|
|
|
|
+ refund.refund_date AS refundDate
|
|
|
|
+ FROM finance_fine_refund AS refund
|
|
|
|
+ LEFT JOIN finance_fine AS fine ON fine.deleted = 0 AND fine.id = refund.fine_id
|
|
|
|
+ LEFT JOIN order_fund AS oFund ON oFund.deleted = 0 AND oFund.id = fine.order_fund_id
|
|
|
|
+ <if test="dto != null and dto.businessType == 'ASSET_BUSINESS'">
|
|
|
|
+ LEFT JOIN production_fund AS pFund ON pFund.deleted = 0 AND pFund.id = fine.production_fund_id AND pFund.order_fund_id = fine.order_fund_id
|
|
|
|
+ LEFT JOIN ( SELECT business_id, production_no, repertory_out_time FROM assets_production WHERE deleted = 0 AND repertory_out_time IS NOT NULL AND production_type != 'STATEMENT') AS pro
|
|
|
|
+ ON pFund.business_id = pro.business_id AND pFund.production_no = pro.production_no
|
|
|
|
+ LEFT JOIN assets AS `order` ON `order`.deleted = 0 AND `order`.id = pFund.business_id
|
|
|
|
+ </if>
|
|
|
|
+ <if test="dto != null and dto.businessType == 'MAJOR_BUSINESS'">
|
|
|
|
+ LEFT JOIN production_fund AS pFund ON pFund.deleted = 0 AND pFund.id = fine.production_fund_id AND pFund.order_fund_id = fine.order_fund_id
|
|
|
|
+ LEFT JOIN ( SELECT major_id AS business_id, report_no AS production_no, repertory_out_time, production FROM major_production WHERE deleted = 0 AND repertory_out_time IS NOT NULL) AS pro
|
|
|
|
+ ON pFund.business_id = pro.business_id AND pFund.production_no = pro.production_no AND production = pFund.production_type
|
|
|
|
+ LEFT JOIN major AS `order` ON `order`.deleted = 0 AND `order`.id = pFund.business_id
|
|
|
|
+ </if>
|
|
|
|
+ <if test="dto != null and dto.businessType == 'PERSONAL_BUSINESS'">
|
|
|
|
+ LEFT JOIN personal_target pt ON pt.personal_id = oFund.business_id
|
|
|
|
+ LEFT JOIN ( SELECT target_id,repertory_out_time, production FROM personal_production WHERE repertory_out_time IS NOT NULL GROUP BY target_id ) AS pro ON pro.target_id = pt.id
|
|
|
|
+ LEFT JOIN personal AS `order` ON `order`.deleted = 0 AND `order`.id = oFund.business_id
|
|
|
|
+ </if>
|
|
|
|
+ LEFT JOIN customer_company AS customer ON customer.id = `order`.clientele_id
|
|
|
|
+ LEFT JOIN customer_company AS subCustomer ON subCustomer.id = `order`.clientele_sub_id
|
|
|
|
+ LEFT JOIN user ON `order`.client_manager_id = user.id AND user.deleted = 0
|
|
|
|
+ LEFT JOIN user AS operator ON user.deleted = 0 AND user.id = refund.user_id
|
|
|
|
+ WHERE oFund.business_type = #{dto.businessType}
|
|
|
|
+ <if test="dto != null and dto.keyWord != null and dto.keyWord != ''">
|
|
|
|
+ AND (`order`.order_id LIKE CONCAT('%', #{dto.keyWord},'%')
|
|
|
|
+ <if test="dto != null and dto.businessType == 'ASSET_BUSINESS' or dto.businessType == 'MAJOR_BUSINESS'">
|
|
|
|
+ OR pFund.production_no LIKE CONCAT('%', #{dto.keyWord},'%')
|
|
|
|
+ </if>
|
|
|
|
+ )
|
|
|
|
+ </if>
|
|
|
|
+ <if test="dto != null and dto.finedAmount != null">
|
|
|
|
+ AND fine.real_fine_amount = #{dto.finedAmount}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="dto != null and dto.refundAmount != null">
|
|
|
|
+ AND refund.refund_amount = #{dto.refundAmount}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="dto != null and dto.clientManagerName != null and dto.clientManagerName != ''">
|
|
|
|
+ AND user.name = #{dto.clientManagerName}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="dto != null and dto.status != null">
|
|
|
|
+ AND fine.status = #{dto.status}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="dto != null and dto.startPunishDate != null and dto.endPunishDate!= null">
|
|
|
|
+ AND fine.created BETWEEN #{dto.startPunishDate} AND #{dto.endPunishDate}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="dto != null and dto.startRefundDate != null and dto.startRefundDate!= null">
|
|
|
|
+ AND refund.refund_date BETWEEN #{dto.startRefundDate} AND #{dto.startRefundDate}
|
|
|
|
+ </if>
|
|
|
|
+ </select>
|
|
|
|
+
|
|
</mapper>
|
|
</mapper>
|