hd_real_name/target/classes/mappers/push/ProjectPushMapper.xml

86 lines
8.9 KiB
XML

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.bonus.gzrn.rnbmw.push.dao.project.ProjectPushDao">
<select id="selectProjectPush" resultType="com.bonus.gzrn.rnbmw.push.entity.project.ProjectAllBean">
select
CONCAT('http://116.63.142.171:1919/gzrnama/',p.construction_contract_url) as constructionContractUrl,
CONCAT('http://116.63.142.171:1919/gzrnama/', p.tripartiteAgreementUrl) as tripartiteAgreementUrl,
p.set_tlement_date as settlementDate,p.set_tlement_cycle as settlementCycle,p.set_tlement_amount as settlementAmount,
CONCAT('SongBianDianProject',IFNULL(p.pro_old_id,p.id)) as projectId,p.name as projectName,
p.record_id as recordId,'电力工程' as category,'否' as govInvest,p.isRegistered,address.code as projectAddress,
p.origin as projectDetailedAddress,p.lon,p.lat,p.status,p.contractSigningDate,
p.contractPrice,p.start_time as startDate,p.end_time as completeDate,
p.start_time as planStartDate,p.end_time as planCompleteDate,
p.pro_leader as linkPersonName,p.pro_leader_phone as linkPersonPhone,
'电力' as subordinateDepartments,p.isInsurance,p.security_payments as securityPayments,
p.payment_type as securityPaymentsType,
p.labourSpecialName,p.labourSpecialPhone,p.labourSpecialIdCard,
p.payDate,sdd.name as bank,p.account_name as accountName,
p.open_bank_type as accountType,p.special_bank_type as specialAccountType,
pay_way as salaryPayChannel,open_bank_number as accountNo,
bank_name as bankName,account_balance as accountBalance,
GROUP_CONCAT(DISTINCT IFNULL(CONCAT('http://116.63.142.171:1919/gzrnama/',bpf.file_path),'http://npm.org/123.jpg')) as securityPaymentsExemptUrl,
GROUP_CONCAT(DISTINCT IFNULL(CONCAT('http://116.63.142.171:1919/gzrnama/',bpf1.file_path),'http://npm.org/123.jpg')) as safeguardCertificateUrl,
orgGeneralContractor.project_manager as orgProjectManager,orgGeneralContractor.project_manager_id_card_num as orgProjectManagerIdCardNum,
orgGeneralContractor.project_manager_phone as orgProjectManagerPhone,orgGeneralContractor.project_manager_approach_date as orgApproachDate,
orgGeneralContractor.principalName as orgPrincipalName, orgGeneralContractor.principalNamePhone as orgPrincipalNamePhone,
orgGeneralContractor.principalNameIdCardNum as orgPrincipalNameIdCardNum, orgGeneralContractor.constructionStatus as orgConstructionStatus,
orgGeneralContractor.legalPersonName as orgLegalPersonName, orgGeneralContractor.legalPersonIdCard as orgLegalPersonIdCard,
orgGeneralContractor.legalPersonPhone as orgLegalPersonPhone, orgGeneralContractor.orgType as orgOrgType,
orgGeneralContractor.registerCapital as orgRegisterCapital, orgGeneralContractor.registerAddressCode as orgRegisterAddressCode,
orgGeneralContractor.postalCode as orgPostalCode, orgGeneralContractor.laborerPersonName as orgLaborerPersonName,
orgGeneralContractor.laborerPersonIdCard as orgLaborerPersonIdCard, orgGeneralContractor.laborerPersonPhone as orgLaborerPersonPhone,
orgGeneralContractor.contactPerson as orgContactPerson, orgGeneralContractor.contactPersonPhone as orgContactPersonPhone,
orgGeneralContractor.officeAddress as orgOfficeAddress, orgGeneralContractor.registDate as orgRegistDate,
orgGeneralContractor.org_name as orgName,orgGeneralContractor.org_credit_code as orgCreditCode, orgGeneralContractor.register_address as orgRegisterAddress,
orgDesign.project_manager as orgDesignProjectManager,orgDesign.project_manager_id_card_num as orgDesignProjectManagerIdCardNum,
orgDesign.project_manager_phone as orgDesignProjectManagerPhone,orgDesign.org_name as orgDesignName,orgDesign.org_credit_code as orgDesignCreditCode,
orgDesign.principalName as orgDesignPrincipalName, orgDesign.principalNameIdCardNum as orgDesignPrincipalNameIdCardNum,
orgDesign.principalNamePhone as orgDesignPrincipalNamePhone, orgDesign.constructionStatus as orgDesignConstructionStatus,
orgDesign.project_manager_approach_date as orgDesignApproachDate, orgDesign.registerAddressCode as orgDesignRegisterAddressCode,
orgDesign.legalPersonName as orgDesignLegalPersonName, orgDesign.legalPersonIdCard as orgDesignLegalPersonIdCard,
orgDesign.legalPersonPhone as orgDesignLegalPersonPhone, orgDesign.register_address as orgDesignRegisterAddress,
orgOwner.project_manager as orgOwnerProjectManager,orgOwner.project_manager_id_card_num as orgOwnerProjectManagerIdCardNum,
orgOwner.project_manager_phone as orgOwnerProjectManagerPhone,orgOwner.org_name as orgOwnerName,orgOwner.org_credit_code as orgOwnerCreditCode,
orgOwner.legalPersonName as orgOwnerLegalPersonName, orgOwner.legalPersonIdCard as orgOwnerLegalPersonIdCard, orgOwner.legalPersonPhone as orgOwnerLegalPersonPhone,
orgOwner.orgType as orgOwnerOrgType, orgOwner.registerCapital as orgOwnerRegisterCapital, orgOwner.registerAddressCode as orgOwnerRegisterAddressCode,
orgOwner.postalCode as orgOwnerPostalCode, orgOwner.register_address as orgOwnerRegisterAddress, orgOwner.laborerPersonName as orgOwnerLaborerPersonName,
orgOwner.laborerPersonIdCard as orgOwnerLaborerPersonIdCard, orgOwner.laborerPersonPhone as orgOwnerLaborerPersonPhone,
orgOwner.contactPerson as orgOwnerContactPerson, orgOwner.contactPersonPhone as orgOwnerContactPersonPhone,
orgOwner.officeAddress as orgOwnerOfficeAddress, orgOwner.registDate as orgOwnerRegistDate,
orgSupervision.project_manager as orgSupervisionProjectManager,orgSupervision.project_manager_id_card_num as orgSupervisionProjectManagerIdCardNum,
orgSupervision.project_manager_phone as orgSupervisionProjectManagerPhone,orgSupervision.org_name as orgSupervisionName,orgSupervision.org_credit_code as orgSupervisionCreditCode,
orgSupervision.principalName as orgSupervisionPrincipalName, orgSupervision.principalNameIdCardNum as orgSupervisionPrincipalNameIdCardNum,
orgSupervision.principalNamePhone as orgSupervisionPrincipalNamePhone, orgSupervision.constructionStatus as orgSupervisionConstructionStatus,
orgSupervision.project_manager_approach_date as orgSupervisionApproachDate, orgSupervision.registerAddressCode as orgSupervisionRegisterAddressCode,
orgSupervision.legalPersonName as orgSupervisionLegalPersonName, orgSupervision.legalPersonIdCard as orgSupervisionLegalPersonIdCard,
orgSupervision.legalPersonPhone as orgSupervisionLegalPersonPhone, orgSupervision.register_address as orgSupervisionRegisterAddress,
orgSurvey.project_manager as orgSurveyProjectManager,orgSurvey.project_manager_id_card_num as orgSurveyProjectManagerIdCardNum,
orgSurvey.project_manager_phone as orgSurveyProjectManagerPhone,orgSurvey.org_name as orgSurveyName,orgSurvey.org_credit_code as orgSurveyCreditCode,
orgSurvey.principalName as orgSurveyPrincipalName, orgSurvey.principalNameIdCardNum as orgSurveyPrincipalNameIdCardNum,
orgSurvey.principalNamePhone as orgSurveyPrincipalNamePhone, orgSurvey.constructionStatus as orgSurveyConstructionStatus,
orgSurvey.project_manager_approach_date as orgSurveyApproachDate, orgSurvey.registerAddressCode as orgSurveyRegisterAddressCode,
orgSurvey.legalPersonName as orgSurveyLegalPersonName, orgSurvey.legalPersonIdCard as orgSurveyLegalPersonIdCard,
orgSurvey.legalPersonPhone as orgSurveyLegalPersonPhone, orgSurvey.register_address as orgSurveyRegisterAddress
from bm_project p
left join bm_project_file bpf on bpf.pro_id = p.id and bpf.accessory_type = 0 and bpf.is_active = '1'
left join bm_project_file bpf1 on bpf1.pro_id = p.id and bpf1.accessory_type = 1 and bpf1.is_active = '1'
left join sys_dic_detail address on p.registerAddressCode = address.id
left join sys_dic_detail sdd on sdd.id = p.bank_account
left join bm_project_five_parties orgGeneralContractor on orgGeneralContractor.pro_id = p.id and orgGeneralContractor.type = 1 and orgGeneralContractor.is_active = 1
left join bm_project_five_parties orgDesign on orgDesign.pro_id = p.id and orgDesign.type = 2 and orgDesign.is_active = 1
left join bm_project_five_parties orgOwner on orgOwner.pro_id = p.id and orgOwner.type = 3 and orgOwner.is_active = 1
left join bm_project_five_parties orgSupervision on orgSupervision.pro_id = p.id and orgSupervision.type = 4 and orgSupervision.is_active = 1
left join bm_project_five_parties orgSurvey on orgSurvey.pro_id = p.id and orgSurvey.type = 5 and orgSurvey.is_active = 1
where p.id = #{proId} and p.is_push != '1'
GROUP BY bpf.accessory_type,bpf1.accessory_type
</select>
<update id="updateProjectStatus">
update bm_project set is_push = #{status},push_time = #{time} where id = #{proId}
</update>
</mapper>