|
|
@ -781,8 +781,32 @@ |
|
|
|
select count(*) as count,PURPOSE as type |
|
|
|
from ic_house |
|
|
|
where DEL_FLAG = 0 |
|
|
|
and |
|
|
|
ORG_ID_PATH like concat(#{orgId},'%') |
|
|
|
<choose> |
|
|
|
<when test='orgType == "agency"'> |
|
|
|
AND neighbor_hood_id IN ( |
|
|
|
select a.id from ic_neighbor_hood a |
|
|
|
<!-- 排除掉无效组织、网格数据 --> |
|
|
|
inner join customer_agency b on a.agency_id = b.id and b.del_flag = '0' |
|
|
|
inner join customer_grid c on a.grid_id = c.id and c.del_flag = '0' |
|
|
|
where a.del_flag = '0' |
|
|
|
and (a.agency_id = #{orgId} OR a.agency_pids LIKE CONCAT('%', #{orgId}, '%')) |
|
|
|
) |
|
|
|
</when> |
|
|
|
<when test='orgType == "grid"'> |
|
|
|
AND neighbor_hood_id IN ( |
|
|
|
select id from ic_neighbor_hood |
|
|
|
where del_flag = '0' |
|
|
|
and grid_id = #{orgId} |
|
|
|
) |
|
|
|
</when> |
|
|
|
<otherwise> |
|
|
|
AND neighbor_hood_id IN ( |
|
|
|
select id from ic_neighbor_hood |
|
|
|
where del_flag = '0' |
|
|
|
and id = #{orgId} |
|
|
|
) |
|
|
|
</otherwise> |
|
|
|
</choose> |
|
|
|
<if test="timeStart != null"> |
|
|
|
and CREATED_TIME >= #{timeStart} |
|
|
|
</if> |
|
|
@ -796,8 +820,32 @@ |
|
|
|
select count(*) as count,RENT_FLAG as type |
|
|
|
from ic_house |
|
|
|
where DEL_FLAG = 0 |
|
|
|
and |
|
|
|
ORG_ID_PATH like concat(#{orgId},'%') |
|
|
|
<choose> |
|
|
|
<when test='orgType == "agency"'> |
|
|
|
AND neighbor_hood_id IN ( |
|
|
|
select a.id from ic_neighbor_hood a |
|
|
|
<!-- 排除掉无效组织、网格数据 --> |
|
|
|
inner join customer_agency b on a.agency_id = b.id and b.del_flag = '0' |
|
|
|
inner join customer_grid c on a.grid_id = c.id and c.del_flag = '0' |
|
|
|
where a.del_flag = '0' |
|
|
|
and (a.agency_id = #{orgId} OR a.agency_pids LIKE CONCAT('%', #{orgId}, '%')) |
|
|
|
) |
|
|
|
</when> |
|
|
|
<when test='orgType == "grid"'> |
|
|
|
AND neighbor_hood_id IN ( |
|
|
|
select id from ic_neighbor_hood |
|
|
|
where del_flag = '0' |
|
|
|
and grid_id = #{orgId} |
|
|
|
) |
|
|
|
</when> |
|
|
|
<otherwise> |
|
|
|
AND neighbor_hood_id IN ( |
|
|
|
select id from ic_neighbor_hood |
|
|
|
where del_flag = '0' |
|
|
|
and id = #{orgId} |
|
|
|
) |
|
|
|
</otherwise> |
|
|
|
</choose> |
|
|
|
<if test="timeStart != null"> |
|
|
|
and CREATED_TIME >= #{timeStart} |
|
|
|
</if> |
|
|
@ -816,8 +864,32 @@ |
|
|
|
left join customer_grid grid on grid.id = hood.GRID_ID |
|
|
|
|
|
|
|
where house.DEL_FLAG = '0' |
|
|
|
and |
|
|
|
house.ORG_ID_PATH like concat(#{orgId},'%') |
|
|
|
<choose> |
|
|
|
<when test='orgType == "agency"'> |
|
|
|
AND neighbor_hood_id IN ( |
|
|
|
select a.id from ic_neighbor_hood a |
|
|
|
<!-- 排除掉无效组织、网格数据 --> |
|
|
|
inner join customer_agency b on a.agency_id = b.id and b.del_flag = '0' |
|
|
|
inner join customer_grid c on a.grid_id = c.id and c.del_flag = '0' |
|
|
|
where a.del_flag = '0' |
|
|
|
and (a.agency_id = #{orgId} OR a.agency_pids LIKE CONCAT('%', #{orgId}, '%')) |
|
|
|
) |
|
|
|
</when> |
|
|
|
<when test='orgType == "grid"'> |
|
|
|
AND neighbor_hood_id IN ( |
|
|
|
select id from ic_neighbor_hood |
|
|
|
where del_flag = '0' |
|
|
|
and grid_id = #{orgId} |
|
|
|
) |
|
|
|
</when> |
|
|
|
<otherwise> |
|
|
|
AND neighbor_hood_id IN ( |
|
|
|
select id from ic_neighbor_hood |
|
|
|
where del_flag = '0' |
|
|
|
and id = #{orgId} |
|
|
|
) |
|
|
|
</otherwise> |
|
|
|
</choose> |
|
|
|
<if test="timeStart != null"> |
|
|
|
and house.CREATED_TIME >= #{timeStart} |
|
|
|
</if> |
|
|
|