linwei
2024-01-08 ad2ec97fe0c60eee4bb7c8cdacff7c876f280ea7
src/main/java/org/springblade/modules/property/mapper/PropertyCompanyMapper.xml
@@ -123,13 +123,36 @@
<!--            <if test="updateTime != null "> and update_time = #{updateTime}</if>-->
<!--            <if test="isDeleted != null "> and is_deleted = #{isDeleted}</if>-->
<!--        </where>-->
    </select>
    <!--物业公司详情map-->
    <resultMap id="propertyCompanyDetailMap" type="org.springblade.modules.property.vo.PropertyCompanyDetailVO" autoMapping="true">
        <id property="id" column="id"/>
        <collection property="districtUserVOS"  javaType="java.util.List"
                    ofType="org.springblade.modules.property.vo.PropertyDistrictUserVO" autoMapping="true">
            <id property="id" column="cid"/>
            <result property="name" column="real_name"/>
            <result property="phone" column="companyPersonPhone"/>
        </collection>
    </resultMap>
    <!--自定义详情查询-->
    <select id="getDetail" resultMap="propertyCompanyDetailMap">
        SELECT
            jpc.*,
            jpcd.principal,
            jpcd.principal_phone AS principalPhone,
            jpdu.id AS cid,
            bu.real_name,
            bu.phone AS companyPersonPhone
        FROM
            jczz_property_company jpc
            LEFT JOIN jczz_property_company_district jpcd ON jpcd.property_company_id = jpc.id and jpcd.is_deleted = 0
            LEFT JOIN jczz_property_district_user jpdu ON jpcd.id = jpdu.property_company_district_id
            LEFT JOIN blade_user bu ON locate(jpdu.user_id,bu.id)>0 and bu.is_deleted = 0
        WHERE jpc.is_deleted = 0
        and bu.real_name is not null
        and jpc.id = #{propertyCompany.id}
    </select>