| | |
| | | select |
| | | jpcd.*, |
| | | jd.name as districtName, |
| | | jpc.name as propertyCompanyName |
| | | from jczz_property_company_district jpcd |
| | | left join jczz_district jd on jd.id = jpcd.district_id and jd.is_deleted = 0 |
| | | left join jczz_property_company jpc on jpc.id = jpcd.property_company_id and jpc.is_deleted = 0 |
| | | jpc.name as propertyCompanyName, |
| | | jc.name communityName, |
| | | br.name streetName, |
| | | jg.grid_name |
| | | FROM |
| | | jczz_property_company_district jpcd |
| | | LEFT JOIN jczz_district jd ON jd.id = jpcd.district_id AND jd.is_deleted = 0 |
| | | LEFT JOIN jczz_property_company jpc ON jpc.id = jpcd.property_company_id AND jpc.is_deleted = 0 |
| | | LEFT JOIN jczz_community jc on jc.`code`=jd.community_code |
| | | LEFT JOIN blade_region br on br.code= jd.community_code |
| | | LEFT JOIN jczz_grid_range jgr on jgr.district_code=jd.id |
| | | LEFT JOIN jczz_grid jg on jg.id = jgr.grid_id |
| | | where jpcd.is_deleted = 0 |
| | | <if test="propertyCompanyDistrict.communityName!=null and propertyCompanyDistrict.communityName!=''"> |
| | | and jc.name like concat('%', #{propertyCompanyDistrict.communityName},'%') |
| | | </if> |
| | | |
| | | <if test="propertyCompanyDistrict.streetName!=null and propertyCompanyDistrict.streetName!=''"> |
| | | and br.name like concat('%', #{propertyCompanyDistrict.streetName},'%') |
| | | </if> |
| | | |
| | | <if test="propertyCompanyDistrict.gridName!=null and propertyCompanyDistrict.gridName!=''"> |
| | | and jg.grid_name like concat('%', #{propertyCompanyDistrict.gridName},'%') |
| | | </if> |
| | | |
| | | <if test="propertyCompanyDistrict.propertyCompanyId!=null"> |
| | | and jpcd.property_company_id = #{propertyCompanyDistrict.propertyCompanyId} |
| | | </if> |
| | | |
| | | <if test="propertyCompanyDistrict.districtId!=null"> |
| | | and jpcd.district_id = #{propertyCompanyDistrict.districtId} |
| | | </if> |
| | |
| | | <if test="propertyCompanyDistrict.propertyCompanyName!=null and propertyCompanyDistrict.propertyCompanyName!=''"> |
| | | and jpc.name like concat('%',#{propertyCompanyDistrict.propertyCompanyName},'%') |
| | | </if> |
| | | <if test="propertyCompanyDistrict.districtIds"> |
| | | <if test="propertyCompanyDistrict.districtIds != null and propertyCompanyDistrict.districtIds.size()>0"> |
| | | and jpcd.district_id in |
| | | <foreach collection="propertyCompanyDistrict.districtIds" item="id" open="(" close=")" separator=","> |
| | | #{id} |