linwe
2023-11-25 8400a67289b214b83a20484410fff96d236c6d49
src/main/java/org/springblade/modules/property/mapper/PropertyCompanyMapper.xml
@@ -8,9 +8,9 @@
        <result column="name" property="name"/>
        <result column="address" property="address"/>
        <result column="social_credit_code" property="socialCreditCode"/>
        <result column="province_code" property="provinceCode"/>
        <result column="city_code" property="cityCode"/>
        <result column="county_code" property="countyCode"/>
        <result column="province" property="province"/>
        <result column="city" property="city"/>
        <result column="area" property="area"/>
        <result column="remark" property="remark"/>
        <result column="create_user" property="createUser"/>
        <result column="create_time" property="createTime"/>
@@ -19,9 +19,48 @@
        <result column="is_deleted" property="isDeleted"/>
    </resultMap>
    <select id="selectPropertyCompanyPage" resultMap="propertyCompanyResultMap">
    <!--自定义分页查询-->
    <select id="selectPropertyCompanyPage" resultType="org.springblade.modules.property.vo.PropertyCompanyVO">
        select * from jczz_property_company where is_deleted = 0
        <if test="propertyCompany.name!=null and propertyCompany.name!=''">
            and name like concat('%',#{propertyCompany.name},'%')
        </if>
    </select>
    <!--物业公司列表查询(不分页)-->
    <select id="getPropertyCompanyList" resultType="org.springblade.modules.property.vo.PropertyCompanyVO">
        select * from jczz_property_company where is_deleted = 0
        <if test="propertyCompany.name!=null and propertyCompany.name!=''">
            and name like concat('%',#{propertyCompany.name},'%')
        </if>
    </select>
    <!--物业公司列表查询(不分页)-->
    <select id="getUserByPropertyCompany" resultType="java.util.Map">
        select
            bu.id,bu.real_name as name
        from blade_user bu
        left join blade_dept bd on bd.id = bu.dept_id and bd.is_deleted = 0
        left join jczz_property_company jpc on jpc.dept_id = bd.id and jpc.is_deleted = 0
        where bu.is_deleted = 0 and bu.real_name is not null
        and jpc.id = #{propertyCompany.id}
    </select>
    <!--查询对应的机构id集合-->
    <select id="getDeptListByCompanyId" resultType="java.lang.Long">
        select dept_id from jczz_property_company
        jpc where is_deleted = 0
        <choose>
            <when test="list != null and list.size()>0">
                and id in
                <foreach collection="list" item="id" separator ="," open="("  close=")">
                    #{id}
                </foreach>
            </when>
            <otherwise>
                and id in ('')
            </otherwise>
        </choose>
    </select>