|
@@ -153,7 +153,9 @@
|
|
|
fund.should_amount,
|
|
|
fund.real_amount,
|
|
|
fund.discount,
|
|
|
+ pFund.id AS productionFundId,
|
|
|
pFund.standard_amount,
|
|
|
+ pFund.production_should_amount,
|
|
|
invoice.real_amount AS invoiceRealAmount,
|
|
|
#查询客户经理
|
|
|
(SELECT name FROM user WHERE id = assets.client_manager_id) AS clientManagerName,
|
|
@@ -393,11 +395,11 @@
|
|
|
ORDER BY assets.created DESC
|
|
|
</select>
|
|
|
|
|
|
- <!--条件查询资产已终止列表-->
|
|
|
+ <!--条件查询资产入库统计列表(分页查询)-->
|
|
|
<select id="selectRepertoryPage" resultType="com.dayou.vo.AssetsRepertoryVo">
|
|
|
SELECT (@i := @i + 1) AS id,
|
|
|
assets.order_id AS orderId,
|
|
|
- production_no AS reportNo,
|
|
|
+ production.production_no AS reportNo,
|
|
|
name AS orderName,
|
|
|
purpose.purpose_name AS purposeName,
|
|
|
method.method_name AS methodName,
|
|
@@ -420,7 +422,8 @@
|
|
|
production.evaluate_price AS evaluatePrice,
|
|
|
assets.bailor,
|
|
|
assets.bailor_contact_tel AS bailorContactTel,
|
|
|
- (SELECT user.name FROM user WHERE user.id = assets.principal_id) AS userName,
|
|
|
+ (SELECT user.name FROM user WHERE user.id = assets.principal_id) AS principalName,
|
|
|
+ (SELECT user.name FROM user WHERE user.id = assets.principal_id) AS firstReporter,
|
|
|
(SELECT user.name FROM user WHERE user.id = assets.client_manager_id) AS managerName,
|
|
|
(SELECT customer.name
|
|
|
FROM customer
|
|
@@ -446,27 +449,101 @@
|
|
|
WHERE user.id = user_post.user_id
|
|
|
AND user_post.post_id = post.id
|
|
|
AND post.department_id = department.id
|
|
|
- AND user.id = assets.client_manager_id) AS marketDepartment
|
|
|
+ AND user.id = assets.client_manager_id) AS marketDepartment,
|
|
|
+ fund.real_amount AS productionRealAmount
|
|
|
FROM (SELECT @i := 0) AS sort,
|
|
|
assets_production AS production
|
|
|
LEFT JOIN assets ON assets.id = production.business_id
|
|
|
LEFT JOIN assets_evaluation_target AS target ON target.report_no = production.production_no
|
|
|
LEFT JOIN assets_evaluation_target_purpose AS purpose ON purpose.id = target.evaluation_purpose_id
|
|
|
LEFT JOIN assets_evaluation_method AS method ON method.id = target.choice_evaluation_method_id
|
|
|
+ LEFT JOIN production_fund AS fund ON fund.production_no = production.production_no
|
|
|
WHERE production.deleted = 0
|
|
|
AND (production.repertory_state = 0 OR production.repertory_state = 1)
|
|
|
- AND production_type != 'STATEMENT'
|
|
|
- <if test="assetsSelectDTO != null and assetsSelectDTO.startTime != null and assetsSelectDTO.endTime != null ">
|
|
|
- AND startTime >= #{assetsSelectDTO.startTime}
|
|
|
- AND endTime <= #{assetsSelectDTO.endTime}
|
|
|
- </if>
|
|
|
+ AND production.production_type != 'STATEMENT'
|
|
|
<if test="assetsSelectDTO != null and assetsSelectDTO.keyWord != null and assetsSelectDTO.keyWord != '' ">
|
|
|
AND (
|
|
|
assets.order_id LIKE CONCAT('%',#{assetsSelectDTO.keyWord},'%') OR
|
|
|
assets.name LIKE CONCAT('%',#{assetsSelectDTO.keyWord},'%') OR
|
|
|
- production.production_no LIKE CONCAT('%',?,'%')
|
|
|
+ production.production_no LIKE CONCAT('%',#{assetsSelectDTO.keyWord},'%')
|
|
|
)
|
|
|
</if>
|
|
|
+ <if test="assetsSelectDTO != null and assetsSelectDTO.startTime != null and assetsSelectDTO.endTime != null ">
|
|
|
+ HAVING startTime >= #{assetsSelectDTO.startTime}
|
|
|
+ AND endTime <= #{assetsSelectDTO.endTime}
|
|
|
+ </if>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <!--条件查询资产入库统计集合(用于导出)-->
|
|
|
+ <select id="selectRepertoryList" resultType="com.dayou.vo.AssetsRepertoryVo">
|
|
|
+ SELECT (@i := @i + 1) AS id,
|
|
|
+ assets.order_id AS orderId,
|
|
|
+ production.production_no AS reportNo,
|
|
|
+ name AS orderName,
|
|
|
+ purpose.purpose_name AS purposeName,
|
|
|
+ method.method_name AS methodName,
|
|
|
+ (SELECT instance.created
|
|
|
+ FROM work_flow_node_instance AS instance,
|
|
|
+ work_node AS node
|
|
|
+ WHERE instance.business_id = assets.id
|
|
|
+ AND instance.node_id = node.id
|
|
|
+ AND instance.deleted = 0
|
|
|
+ AND node.code = 'SPOT_RECONNAISSANCE_DETERMINE_PRICE') AS startTime,
|
|
|
+ (SELECT instance.created
|
|
|
+ FROM work_flow_node_instance AS instance,
|
|
|
+ work_node AS node
|
|
|
+ WHERE business_min_id = reportNo
|
|
|
+ AND instance.node_id = node.id
|
|
|
+ AND instance.deleted = 0
|
|
|
+ AND node.code = 'REPORT_OUT') AS endTime,
|
|
|
+ production.valuation_basis_date AS valuationBasisDate,
|
|
|
+ production.evaluate_amount AS evaluateAmount,
|
|
|
+ production.evaluate_price AS evaluatePrice,
|
|
|
+ assets.bailor,
|
|
|
+ assets.bailor_contact_tel AS bailorContactTel,
|
|
|
+ (SELECT user.name FROM user WHERE user.id = assets.principal_id) AS principalName,
|
|
|
+ (SELECT user.name FROM user WHERE user.id = assets.principal_id) AS firstReporter,
|
|
|
+ (SELECT user.name FROM user WHERE user.id = assets.client_manager_id) AS managerName,
|
|
|
+ (SELECT customer.name
|
|
|
+ FROM customer
|
|
|
+ WHERE customer.id = assets.clientele_id) AS customerName,
|
|
|
+ (SELECT customer_company.name
|
|
|
+ FROM customer_company
|
|
|
+ WHERE customer_company.id = clientele_sub_id) AS customerSubName,
|
|
|
+ production.repertory_in_time AS repertoryInTime,
|
|
|
+ production.repertory_out_time AS repertoryOutTime,
|
|
|
+ (SELECT instance.modified
|
|
|
+ FROM work_flow_node_instance AS instance,
|
|
|
+ work_node AS node
|
|
|
+ WHERE business_min_id = reportNo
|
|
|
+ AND instance.node_id = node.id
|
|
|
+ AND instance.deleted = 0
|
|
|
+ AND node.code = 'BUSINESS_ARCHIVING') AS archivedTime,
|
|
|
+ (SELECT department.name FROM department WHERE department.id = assets.department_id) AS evaluateDepartment,
|
|
|
+ (SELECT department.name
|
|
|
+ FROM department,
|
|
|
+ user,
|
|
|
+ user_post,
|
|
|
+ post
|
|
|
+ WHERE user.id = user_post.user_id
|
|
|
+ AND user_post.post_id = post.id
|
|
|
+ AND post.department_id = department.id
|
|
|
+ AND user.id = assets.client_manager_id) AS marketDepartment,
|
|
|
+ fund.real_amount AS productionRealAmount
|
|
|
+ FROM (SELECT @i := 0) AS sort,
|
|
|
+ assets_production AS production
|
|
|
+ LEFT JOIN assets ON assets.id = production.business_id
|
|
|
+ LEFT JOIN assets_evaluation_target AS target ON target.report_no = production.production_no
|
|
|
+ LEFT JOIN assets_evaluation_target_purpose AS purpose ON purpose.id = target.evaluation_purpose_id
|
|
|
+ LEFT JOIN assets_evaluation_method AS method ON method.id = target.choice_evaluation_method_id
|
|
|
+ LEFT JOIN production_fund AS fund ON fund.production_no = production.production_no
|
|
|
+ WHERE production.deleted = 0
|
|
|
+ AND (production.repertory_state = 0 OR production.repertory_state = 1)
|
|
|
+ AND production.production_type != 'STATEMENT'
|
|
|
+ <if test="assetsSelectDTO != null and assetsSelectDTO.startTime != null and assetsSelectDTO.endTime != null ">
|
|
|
+ HAVING startTime >= #{assetsSelectDTO.startTime}
|
|
|
+ AND endTime <= #{assetsSelectDTO.endTime}
|
|
|
+ </if>
|
|
|
</select>
|
|
|
|
|
|
<!--根据业务id获取资产业务详情-->
|