|
@@ -63,52 +63,58 @@
|
|
|
<select id="getBySearch"
|
|
|
resultType="com.inkasso.factoring.acceptanceManagement.entity.vo.AcceptanceListVo"
|
|
|
resultMap="basicListResult">
|
|
|
- SELECT
|
|
|
- c.id,
|
|
|
- c.acceptance_number,
|
|
|
- c.business_number,
|
|
|
- c.expected_settlement_date,
|
|
|
- c.acceptance_status,
|
|
|
- c.submit_status,
|
|
|
- c.business_approval_status,
|
|
|
- t2.corporate_name supplier_name, -- 主企业
|
|
|
- t3.corporate_name core_enterprise_name, -- 核心企业
|
|
|
- t4.platform_name platform_name,
|
|
|
- t1.project_name,
|
|
|
- t5.name status,
|
|
|
- t6.goods_quantity,
|
|
|
- t7.task_name stage,
|
|
|
- t7.historic_task_id taskId
|
|
|
+ select
|
|
|
+ a.*,
|
|
|
+ t5.name status
|
|
|
+ from (
|
|
|
+ SELECT
|
|
|
+ c.id,
|
|
|
+ c.acceptance_number,
|
|
|
+ c.business_number,
|
|
|
+ c.expected_settlement_date,
|
|
|
+ if((t7.task_name = '录入验收单' and c.business_approval_status = 1),'project_init_completed',c.acceptance_status) acceptance_status,
|
|
|
+ c.submit_status,
|
|
|
+ c.business_approval_status,
|
|
|
+ c.gmt_create,
|
|
|
+ c.sys_user_id,
|
|
|
+ t2.corporate_name supplier_name,
|
|
|
+ t3.corporate_name core_enterprise_name,
|
|
|
+ t4.platform_name platform_name,
|
|
|
+ t1.project_name,
|
|
|
+ if((t7.task_name = '录入验收单' and c.business_approval_status = 1),'业务经理审核通过',t7.task_name) stage,
|
|
|
+ t6.goods_quantity,
|
|
|
+ t7.historic_task_id taskId
|
|
|
+
|
|
|
+ FROM
|
|
|
+ c_acceptance_basic_info c
|
|
|
+ LEFT JOIN c_project_information t1 ON t1.business_number = c.business_number
|
|
|
+ LEFT JOIN c_enterprise t2 ON t2.id = c.c_supplier_info_id
|
|
|
+ LEFT JOIN c_enterprise t3 ON t3.id = c.c_project_core_enterprise_id
|
|
|
+ LEFT JOIN trading_platform t4 ON t4.id = c.trading_platform_id
|
|
|
|
|
|
- FROM
|
|
|
- c_acceptance_basic_info c
|
|
|
- LEFT JOIN c_project_information t1 ON t1.business_number = c.business_number
|
|
|
- LEFT JOIN c_enterprise t2 ON t2.id = c.c_supplier_info_id
|
|
|
- LEFT JOIN c_enterprise t3 ON t3.id = c.c_project_core_enterprise_id
|
|
|
- LEFT JOIN trading_platform t4 ON t4.id = c.trading_platform_id
|
|
|
- LEFT JOIN t_dictionary t5 ON t5.code = c.acceptance_status
|
|
|
LEFT JOIN ( select
|
|
|
- c_acceptance_basic_info_id,
|
|
|
- sum(goods_quantity) goods_quantity
|
|
|
- from c_acceptance_goods_info
|
|
|
- group by c_acceptance_basic_info_id) t6 on c.id = t6.c_acceptance_basic_info_id
|
|
|
- LEFT JOIN ( ( SELECT m.* FROM (SELECT g.id, g.task_name, g.busness_key, g.business_type,g.historic_task_id
|
|
|
- FROM business_processing_log g where g.business_type like "AcceptanceSheet%" and g.end_time is null order by id desc limit 999999) m
|
|
|
- group BY m.busness_key ) ) t7 ON t7.busness_key = c.id
|
|
|
+ c_acceptance_basic_info_id,
|
|
|
+ sum(goods_quantity) goods_quantity
|
|
|
+ from c_acceptance_goods_info
|
|
|
+ group by c_acceptance_basic_info_id) t6 on c.id = t6.c_acceptance_basic_info_id
|
|
|
+ LEFT JOIN ( ( SELECT m.* FROM (SELECT g.id, g.task_name, g.busness_key, g.business_type,g.historic_task_id
|
|
|
+ FROM business_processing_log g where g.business_type like "AcceptanceSheet%" and g.end_time is null order by id desc limit 999999) m
|
|
|
+ group BY m.busness_key ) ) t7 ON t7.busness_key = c.id ) a
|
|
|
+ LEFT JOIN t_dictionary t5 ON t5.code = a.acceptance_status
|
|
|
<where>
|
|
|
<if test="status != null and status != ''">
|
|
|
- c.acceptance_status = #{status}
|
|
|
+ a.acceptance_status = #{status}
|
|
|
</if>
|
|
|
<if test="businessNumber != null and businessNumber != ''">
|
|
|
- AND (c.acceptance_number = #{businessNumber} OR c.business_number = #{businessNumber})
|
|
|
+ AND (a.acceptance_number = #{businessNumber} OR a.business_number = #{businessNumber})
|
|
|
</if>
|
|
|
<if test="fastSearch != null and fastSearch != ''">
|
|
|
- AND (t2.corporate_name = #{fastSearch} OR t3.corporate_name = #{fastSearch} OR t1.project_name =
|
|
|
+ AND (a.supplier_name = #{fastSearch} OR a.core_enterprise_name = #{fastSearch} OR a.project_name =
|
|
|
#{fastSearch})
|
|
|
</if>
|
|
|
- AND c.sys_user_id = #{customerId}
|
|
|
+ AND a.sys_user_id = #{customerId}
|
|
|
</where>
|
|
|
- ORDER BY c.gmt_create DESC
|
|
|
+ ORDER BY a.gmt_create DESC
|
|
|
|
|
|
</select>
|
|
|
<select id="findByCondition" parameterType="com.inkasso.factoring.acceptanceManagement.entity.CAcceptanceBasicInfo" resultType="com.inkasso.factoring.acceptanceManagement.entity.CAcceptanceBasicInfo">
|