pusong-crm/pusong-modules/pusong-business/src/main/resources/mapper/business/PsCompanyInfoMapper.xml

58 lines
2.7 KiB
XML
Raw Normal View History

2024-07-31 17:04:22 +08:00
<?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.pusong.business.mapper.PsCompanyInfoMapper">
<resultMap id="serviceCompanyServiceResult" type="com.pusong.business.domain.vo.PsCompanyInfoVo">
<id column="ID" property="id"></id>
<collection columnPrefix="bus_" property="businessVoList" ofType="com.pusong.business.domain.vo.PsContractBusinessVo" >
<collection columnPrefix="detail_" property="detailVoList" ofType="com.pusong.business.domain.vo.PsContractBusinessDetailVo" >
<!-- <id column="ID" property="id"></id>-->
<!-- <result column="CUSTOMER_NAME" property="customerName" />-->
<!-- <result column="CUSTOMER_ID_NO" property="customerIdNo" />-->
</collection>
</collection>
</resultMap>
2024-09-04 17:33:32 +08:00
<select id="selectPageList" resultType="com.pusong.business.domain.vo.PsCompanyQueryVo">
select cus.custom_manager,
com.company_name,
com.customer_num,
com.legal_person_name,
com.legal_person_idcard,
cus.custom_name,
cus.custom_mobile,
cusi.custom_name custom_introducer,
com.create_time
from ps_company_info com
left join ps_custom_info cus on com.custom_id = cus.id
2024-09-05 09:27:29 +08:00
left join ps_custom_info cusi on cus.custom_introducer = cusi.id
2024-07-31 17:04:22 +08:00
2024-09-04 17:33:32 +08:00
${ew.getCustomSqlSegment}
</select>
<select id="selectServiceCompanyList" resultMap="serviceCompanyServiceResult">
select com.*,
bus.business_amount bus_business_amount,
bus.business_desc bus_business_desc,
bus.business_type bus_business_type,
bus.company_id bus_company_id,
bus.contract_code bus_contract_code,
bus.end_date bus_end_date,
bus.id bus_id,
bus.start_date bus_start_date,
det.contract_code detail_contract_code,
det.business_project detail_business_project,
det.business_project_label detail_business_project_label,
det.amount detail_amount,
det.amount_desc detail_amount_desc,
det.extent_info detail_extent_info
from ps_contract_company pcc
left join ps_company_info com on pcc.company_id = com.id
left join ps_contract_business bus on bus.company_id = com.id and bus.contract_code = pcc.contract_code
left join ps_contract_business_detail det on det.business_id = bus.id
${ew.getCustomSqlSegment}
</select>
2024-07-31 17:04:22 +08:00
</mapper>