|
|
|
@ -302,6 +302,43 @@
|
|
|
|
|
AND g.f_status = 2
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<select id="queryBusinessContract" resultMap="contractList">
|
|
|
|
|
SELECT
|
|
|
|
|
a.*,
|
|
|
|
|
b.name AS firstSupplyName,
|
|
|
|
|
c.f_full_name AS enterpriseName,
|
|
|
|
|
d.contract_name AS relatedContractName,
|
|
|
|
|
e.name AS secondSupplyName,
|
|
|
|
|
f.name AS thirdSupplyName,
|
|
|
|
|
h.name AS businessName
|
|
|
|
|
FROM
|
|
|
|
|
jg_contract a
|
|
|
|
|
LEFT JOIN jg_subject_basic b ON a.subject = b.id
|
|
|
|
|
AND b.f_delete_mark IS NULL
|
|
|
|
|
LEFT JOIN base_organize c ON a.dept_id = c.f_id
|
|
|
|
|
AND c.f_delete_mark IS NULL
|
|
|
|
|
LEFT JOIN jg_contract d ON a.related_contract_id = d.id
|
|
|
|
|
AND d.f_delete_mark IS NULL
|
|
|
|
|
LEFT JOIN jg_subject_basic e ON a.subject2 = e.id
|
|
|
|
|
AND e.f_delete_mark IS NULL
|
|
|
|
|
LEFT JOIN jg_subject_basic f ON a.subject3 = f.id
|
|
|
|
|
AND f.f_delete_mark IS NULL
|
|
|
|
|
LEFT JOIN flow_task g ON a.id = g.f_process_id and g.f_delete_mark is null
|
|
|
|
|
LEFT JOIN jg_business_line h ON a.business_id=h.id AND h.f_delete_mark IS NULL
|
|
|
|
|
WHERE
|
|
|
|
|
a.contract_type = '1'
|
|
|
|
|
AND a.business_id = #{businessLine}
|
|
|
|
|
AND a.contract_number = #{contractNumber}
|
|
|
|
|
|
|
|
|
|
AND DATE_FORMAT( a.contract_period_time, '%Y-%m-%d' ) <= DATE_FORMAT( NOW( ), '%Y-%m-%d' )
|
|
|
|
|
AND DATE_FORMAT( a.contract_period_time_end, '%Y-%m-%d' ) >= DATE_FORMAT( NOW( ), '%Y-%m-%d' )
|
|
|
|
|
AND a.f_delete_mark IS NULL
|
|
|
|
|
AND a.organize_json_id like concat('%',#{organize},'%')
|
|
|
|
|
AND g.f_status = 2
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<select id="querySaleOrder" resultMap="saleOrder">
|
|
|
|
|
SELECT
|
|
|
|
|
a.*,
|
|
|
|
|