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">
|
2024-09-13 15:27:48 +08:00
|
|
|
|
<resultMap id="serviceCompanyServiceResult" type="com.pusong.business.domain.vo.PsCompanyInfoVo">
|
2024-09-25 10:16:02 +08:00
|
|
|
|
<id column="id" property="id"></id>
|
2024-09-13 15:27:48 +08:00
|
|
|
|
<collection columnPrefix="bus_" property="businessVoList" ofType="com.pusong.business.domain.vo.PsContractBusinessVo" >
|
2024-09-25 10:16:02 +08:00
|
|
|
|
<id column="id" property="id"></id>
|
|
|
|
|
<collection columnPrefix="det_" column="det" property="detailVoList" ofType="com.pusong.business.domain.vo.PsContractBusinessDetailVo" >
|
2024-09-13 15:27:48 +08:00
|
|
|
|
</collection>
|
|
|
|
|
</collection>
|
2024-09-26 11:18:22 +08:00
|
|
|
|
<collection columnPrefix="fu_" property="followUsers" ofType="com.pusong.system.domain.vo.SysUserVo" >
|
|
|
|
|
</collection>
|
2024-10-16 18:19:24 +08:00
|
|
|
|
|
|
|
|
|
<!-- <collection column="company_id" property="psContractBusinessVos"-->
|
|
|
|
|
<!-- select="com.pusong.business.mapper.PsContractBusinessMapper.selectTuoGuanBusinessListByCompanyId" fetchType="eager"-->
|
|
|
|
|
<!-- ofType="com.pusong.business.domain.vo.PsContractBusinessVo" >-->
|
|
|
|
|
<!-- </collection>-->
|
|
|
|
|
|
2024-10-09 09:06:51 +08:00
|
|
|
|
</resultMap>
|
2024-09-26 11:18:22 +08:00
|
|
|
|
|
2024-10-09 09:06:51 +08:00
|
|
|
|
<resultMap id="serviceCompanyServiceResult2" type="com.pusong.business.domain.vo.PsCompanyInfoVo">
|
|
|
|
|
<id column="pcc_id" property="pccId"></id>
|
|
|
|
|
<collection columnPrefix="bus_" property="businessVoList" ofType="com.pusong.business.domain.vo.PsContractBusinessVo" >
|
|
|
|
|
<id column="id" property="id"></id>
|
|
|
|
|
<collection columnPrefix="det_" column="det" property="detailVoList" ofType="com.pusong.business.domain.vo.PsContractBusinessDetailVo" >
|
|
|
|
|
</collection>
|
|
|
|
|
</collection>
|
|
|
|
|
<collection columnPrefix="fu_" property="followUsers" ofType="com.pusong.system.domain.vo.SysUserVo" >
|
|
|
|
|
</collection>
|
2024-10-16 18:19:24 +08:00
|
|
|
|
|
2024-09-13 15:27:48 +08:00
|
|
|
|
</resultMap>
|
|
|
|
|
|
2024-10-09 09:06:51 +08:00
|
|
|
|
|
2024-09-29 15:14:51 +08:00
|
|
|
|
<select id="selectVoCustomManager" resultType="com.pusong.business.domain.vo.PsCompanyInfoVo">
|
2024-09-27 17:55:40 +08:00
|
|
|
|
select
|
|
|
|
|
com.*
|
|
|
|
|
,cus.custom_manager
|
2024-09-29 15:14:51 +08:00
|
|
|
|
<if test="contractCode != null ">
|
2024-10-08 11:20:27 +08:00
|
|
|
|
,bus.is_proxy
|
2024-09-29 15:14:51 +08:00
|
|
|
|
</if>
|
2024-09-27 17:55:40 +08:00
|
|
|
|
from ps_company_info com
|
2024-09-29 15:14:51 +08:00
|
|
|
|
left join ps_custom_info cus on cus.id = com.custom_id
|
|
|
|
|
<if test="contractCode != null ">
|
2024-10-08 11:20:27 +08:00
|
|
|
|
-- inner join ps_contract_company cc on cc.contract_code = ${contractCode} and cc.company_id = com.id
|
|
|
|
|
left join ps_contract_business bus on bus.company_id = com.id and bus.contract_code = ${contractCode}
|
2024-09-29 15:14:51 +08:00
|
|
|
|
</if>
|
|
|
|
|
${ew.getCustomSqlSegment}
|
2024-09-27 17:55:40 +08:00
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-09-26 11:18:22 +08:00
|
|
|
|
<select id="selectPageList" resultMap="serviceCompanyServiceResult">
|
|
|
|
|
select
|
|
|
|
|
com.*,
|
|
|
|
|
cus.custom_manager,
|
2024-09-04 17:33:32 +08:00
|
|
|
|
cus.custom_name,
|
|
|
|
|
cus.custom_mobile,
|
|
|
|
|
cusi.custom_name custom_introducer,
|
2024-09-26 11:18:22 +08:00
|
|
|
|
usr.user_id fu_user_id,
|
|
|
|
|
usr.nick_name fu_nick_name
|
2024-09-04 17:33:32 +08:00
|
|
|
|
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-09-26 11:18:22 +08:00
|
|
|
|
left join ps_company_follow cf on com.id = cf.company_id
|
|
|
|
|
left join sys_user usr on cf.user_id = usr.user_id
|
|
|
|
|
${ew.getCustomSqlSegment}
|
2024-09-04 17:33:32 +08:00
|
|
|
|
</select>
|
2024-09-13 15:27:48 +08:00
|
|
|
|
|
2024-09-27 17:55:40 +08:00
|
|
|
|
<select id="selectPageList2" resultMap="serviceCompanyServiceResult">
|
|
|
|
|
select
|
|
|
|
|
com.*,
|
2024-10-16 18:19:24 +08:00
|
|
|
|
com.id company_id,
|
2024-09-27 17:55:40 +08:00
|
|
|
|
cus.custom_manager,
|
|
|
|
|
cus.custom_name,
|
|
|
|
|
cus.custom_mobile,
|
|
|
|
|
cusi.custom_name custom_introducer,
|
|
|
|
|
usr.user_id fu_user_id,
|
|
|
|
|
usr.nick_name fu_nick_name
|
|
|
|
|
from ps_company_info com
|
|
|
|
|
left join ps_custom_info cus on com.custom_id = cus.id
|
|
|
|
|
left join ps_custom_info cusi on cus.custom_introducer = cusi.id
|
|
|
|
|
left join ps_company_follow cf on com.id = cf.company_id
|
|
|
|
|
left join sys_user usr on cf.user_id = usr.user_id
|
|
|
|
|
${ew.getCustomSqlSegment}
|
|
|
|
|
</select>
|
2024-09-26 11:18:22 +08:00
|
|
|
|
|
2024-10-16 18:19:24 +08:00
|
|
|
|
|
2024-10-09 09:06:51 +08:00
|
|
|
|
<select id="selectServiceCompanyList" resultMap="serviceCompanyServiceResult2">
|
|
|
|
|
select
|
|
|
|
|
--pcc.contract_code contract_code, 必须在 com.*, 上边,否则company里的 contract_code值会被com表的字段覆盖
|
|
|
|
|
pcc.contract_code,
|
|
|
|
|
pcc.id pcc_id,
|
|
|
|
|
com.*,
|
2024-09-13 15:27:48 +08:00
|
|
|
|
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,
|
2024-09-25 10:16:02 +08:00
|
|
|
|
bus.is_proxy bus_is_proxy,
|
|
|
|
|
bus.is_old bus_is_old,
|
|
|
|
|
det.id det_id,
|
|
|
|
|
det.business_id bus_det_business_id,
|
|
|
|
|
det.contract_code bus_det_contract_code,
|
|
|
|
|
det.business_project bus_det_business_project,
|
|
|
|
|
det.business_project_label bus_det_business_project_label,
|
|
|
|
|
det.amount bus_det_amount,
|
|
|
|
|
det.amount_desc bus_det_amount_desc,
|
|
|
|
|
det.extent_info bus_det_extent_info
|
2024-10-09 09:06:51 +08:00
|
|
|
|
from ps_company_info com
|
|
|
|
|
inner join ps_contract_company pcc on pcc.company_id = com.id
|
2024-09-13 15:27:48 +08:00
|
|
|
|
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-09-26 11:18:22 +08:00
|
|
|
|
|
2024-07-31 17:04:22 +08:00
|
|
|
|
</mapper>
|